mirror of
https://github.com/deepseek-ai/DeepSeek-Coder
synced 2024-12-13 07:34:08 +00:00
162 lines
305 KiB
Plaintext
162 lines
305 KiB
Plaintext
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- strlen\n stopifnot(isTRUE(all.equal(candidate(''), 0)))\n stopifnot(isTRUE(all.equal(candidate('x'), 1)))\n stopifnot(isTRUE(all.equal(candidate('asdasnakj'), 9)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_23_strlen", "test": "test_humaneval <- function() {\n candidate <- strlen\n stopifnot(isTRUE(all.equal(candidate(''), 0)))\n stopifnot(isTRUE(all.equal(candidate('x'), 1)))\n stopifnot(isTRUE(all.equal(candidate('asdasnakj'), 9)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- encrypt\n stopifnot(isTRUE(all.equal(candidate('hi'), 'lm')))\n stopifnot(isTRUE(all.equal(candidate('asdfghjkl'), 'ewhjklnop')))\n stopifnot(isTRUE(all.equal(candidate('gf'), 'kj')))\n stopifnot(isTRUE(all.equal(candidate('et'), 'ix')))\n stopifnot(isTRUE(all.equal(candidate('faewfawefaewg'), 'jeiajeaijeiak')))\n stopifnot(isTRUE(all.equal(candidate('hellomyfriend'), 'lippsqcjvmirh')))\n stopifnot(isTRUE(all.equal(candidate('dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh'), 'hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl')))\n stopifnot(isTRUE(all.equal(candidate('a'), 'e')))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_89_encrypt", "test": "test_humaneval <- function() {\n candidate <- encrypt\n stopifnot(isTRUE(all.equal(candidate('hi'), 'lm')))\n stopifnot(isTRUE(all.equal(candidate('asdfghjkl'), 'ewhjklnop')))\n stopifnot(isTRUE(all.equal(candidate('gf'), 'kj')))\n stopifnot(isTRUE(all.equal(candidate('et'), 'ix')))\n stopifnot(isTRUE(all.equal(candidate('faewfawefaewg'), 'jeiajeaijeiak')))\n stopifnot(isTRUE(all.equal(candidate('hellomyfriend'), 'lippsqcjvmirh')))\n stopifnot(isTRUE(all.equal(candidate('dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh'), 'hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl')))\n stopifnot(isTRUE(all.equal(candidate('a'), 'e')))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- check_dict_case\n stopifnot(isTRUE(all.equal(candidate(list('p' = 'pineapple', 'b' = 'banana')), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(list('p' = 'pineapple', 'A' = 'banana', 'B' = 'banana')), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(list('p' = 'pineapple', '5' = 'banana', 'a' = 'apple')), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(list('Name' = 'John', 'Age' = '36', 'City' = 'Houston')), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(list('STATE' = 'NC', 'ZIP' = '12345')), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(list('fruit' = 'Orange', 'taste' = 'Sweet')), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(list()), FALSE)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_95_check_dict_case", "test": "test_humaneval <- function() {\n candidate <- check_dict_case\n stopifnot(isTRUE(all.equal(candidate(list('p' = 'pineapple', 'b' = 'banana')), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(list('p' = 'pineapple', 'A' = 'banana', 'B' = 'banana')), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(list('p' = 'pineapple', '5' = 'banana', 'a' = 'apple')), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(list('Name' = 'John', 'Age' = '36', 'City' = 'Houston')), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(list('STATE' = 'NC', 'ZIP' = '12345')), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(list('fruit' = 'Orange', 'taste' = 'Sweet')), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(list()), FALSE)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- add\n stopifnot(isTRUE(all.equal(candidate(c(4, 88)), 88)))\n stopifnot(isTRUE(all.equal(candidate(c(4, 5, 6, 7, 2, 122)), 122)))\n stopifnot(isTRUE(all.equal(candidate(c(4, 0, 6, 7)), 0)))\n stopifnot(isTRUE(all.equal(candidate(c(4, 4, 6, 8)), 12)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_85_add", "test": "test_humaneval <- function() {\n candidate <- add\n stopifnot(isTRUE(all.equal(candidate(c(4, 88)), 88)))\n stopifnot(isTRUE(all.equal(candidate(c(4, 5, 6, 7, 2, 122)), 122)))\n stopifnot(isTRUE(all.equal(candidate(c(4, 0, 6, 7)), 0)))\n stopifnot(isTRUE(all.equal(candidate(c(4, 4, 6, 8)), 12)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- fix_spaces\n stopifnot(isTRUE(all.equal(candidate('Example'), 'Example')))\n stopifnot(isTRUE(all.equal(candidate('Mudasir Hanif '), 'Mudasir_Hanif_')))\n stopifnot(isTRUE(all.equal(candidate('Yellow Yellow Dirty Fellow'), 'Yellow_Yellow__Dirty__Fellow')))\n stopifnot(isTRUE(all.equal(candidate('Exa mple'), 'Exa-mple')))\n stopifnot(isTRUE(all.equal(candidate(' Exa 1 2 2 mple'), '-Exa_1_2_2_mple')))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_140_fix_spaces", "test": "test_humaneval <- function() {\n candidate <- fix_spaces\n stopifnot(isTRUE(all.equal(candidate('Example'), 'Example')))\n stopifnot(isTRUE(all.equal(candidate('Mudasir Hanif '), 'Mudasir_Hanif_')))\n stopifnot(isTRUE(all.equal(candidate('Yellow Yellow Dirty Fellow'), 'Yellow_Yellow__Dirty__Fellow')))\n stopifnot(isTRUE(all.equal(candidate('Exa mple'), 'Exa-mple')))\n stopifnot(isTRUE(all.equal(candidate(' Exa 1 2 2 mple'), '-Exa_1_2_2_mple')))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- fibfib\n stopifnot(isTRUE(all.equal(candidate(2), 1)))\n stopifnot(isTRUE(all.equal(candidate(1), 0)))\n stopifnot(isTRUE(all.equal(candidate(5), 4)))\n stopifnot(isTRUE(all.equal(candidate(8), 24)))\n stopifnot(isTRUE(all.equal(candidate(10), 81)))\n stopifnot(isTRUE(all.equal(candidate(12), 274)))\n stopifnot(isTRUE(all.equal(candidate(14), 927)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_63_fibfib", "test": "test_humaneval <- function() {\n candidate <- fibfib\n stopifnot(isTRUE(all.equal(candidate(2), 1)))\n stopifnot(isTRUE(all.equal(candidate(1), 0)))\n stopifnot(isTRUE(all.equal(candidate(5), 4)))\n stopifnot(isTRUE(all.equal(candidate(8), 24)))\n stopifnot(isTRUE(all.equal(candidate(10), 81)))\n stopifnot(isTRUE(all.equal(candidate(12), 274)))\n stopifnot(isTRUE(all.equal(candidate(14), 927)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- double_the_difference\n stopifnot(isTRUE(all.equal(candidate(c()), 0)))\n stopifnot(isTRUE(all.equal(candidate(c(5.0, 4.0)), 25)))\n stopifnot(isTRUE(all.equal(candidate(c(0.1, 0.2, 0.3)), 0)))\n stopifnot(isTRUE(all.equal(candidate(c(-10.0, -20.0, -30.0)), 0)))\n stopifnot(isTRUE(all.equal(candidate(c(-1.0, -2.0, 8.0)), 0)))\n stopifnot(isTRUE(all.equal(candidate(c(0.2, 3.0, 5.0)), 34)))\n stopifnot(isTRUE(all.equal(candidate(c(-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0)), 165)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_151_double_the_difference", "test": "test_humaneval <- function() {\n candidate <- double_the_difference\n stopifnot(isTRUE(all.equal(candidate(c()), 0)))\n stopifnot(isTRUE(all.equal(candidate(c(5.0, 4.0)), 25)))\n stopifnot(isTRUE(all.equal(candidate(c(0.1, 0.2, 0.3)), 0)))\n stopifnot(isTRUE(all.equal(candidate(c(-10.0, -20.0, -30.0)), 0)))\n stopifnot(isTRUE(all.equal(candidate(c(-1.0, -2.0, 8.0)), 0)))\n stopifnot(isTRUE(all.equal(candidate(c(0.2, 3.0, 5.0)), 34)))\n stopifnot(isTRUE(all.equal(candidate(c(-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0)), 165)))\n}\ntest_humaneval()"}
|
||
|
{"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# c(5)\n# >>> filter_integers(list(1, 2, 3, 'abc', list(), c()))\n# c(1, 2, 3)\nfilter_integers <- function(values) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- filter_integers\n stopifnot(isTRUE(all.equal(candidate(c()), c())))\n stopifnot(isTRUE(all.equal(candidate(list(4, list(), c(), 23.2, 9, 'adasd')), c(4, 9))))\n stopifnot(isTRUE(all.equal(candidate(list(3, 'c', 3, 3, 'a', 'b')), c(3, 3, 3))))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_22_filter_integers", "test": "test_humaneval <- function() {\n candidate <- filter_integers\n stopifnot(isTRUE(all.equal(candidate(c()), c())))\n stopifnot(isTRUE(all.equal(candidate(list(4, list(), c(), 23.2, 9, 'adasd')), c(4, 9))))\n stopifnot(isTRUE(all.equal(candidate(list(3, 'c', 3, 3, 'a', 'b')), c(3, 3, 3))))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_41_car_race_collision.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- car_race_collision\n stopifnot(isTRUE(all.equal(candidate(2), 4)))\n stopifnot(isTRUE(all.equal(candidate(3), 9)))\n stopifnot(isTRUE(all.equal(candidate(4), 16)))\n stopifnot(isTRUE(all.equal(candidate(8), 64)))\n stopifnot(isTRUE(all.equal(candidate(10), 100)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_41_car_race_collision", "test": "test_humaneval <- function() {\n candidate <- car_race_collision\n stopifnot(isTRUE(all.equal(candidate(2), 4)))\n stopifnot(isTRUE(all.equal(candidate(3), 9)))\n stopifnot(isTRUE(all.equal(candidate(4), 16)))\n stopifnot(isTRUE(all.equal(candidate(8), 64)))\n stopifnot(isTRUE(all.equal(candidate(10), 100)))\n}\ntest_humaneval()"}
|
||
|
{"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# c(4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4)\nparse_music <- function(music_string) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- parse_music\n stopifnot(isTRUE(all.equal(candidate(''), c())))\n stopifnot(isTRUE(all.equal(candidate('o o o o'), c(4, 4, 4, 4))))\n stopifnot(isTRUE(all.equal(candidate('.| .| .| .|'), c(1, 1, 1, 1))))\n stopifnot(isTRUE(all.equal(candidate('o| o| .| .| o o o o'), c(2, 2, 1, 1, 4, 4, 4, 4))))\n stopifnot(isTRUE(all.equal(candidate('o| .| o| .| o o| o o|'), c(2, 1, 2, 1, 4, 2, 4, 2))))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_17_parse_music", "test": "test_humaneval <- function() {\n candidate <- parse_music\n stopifnot(isTRUE(all.equal(candidate(''), c())))\n stopifnot(isTRUE(all.equal(candidate('o o o o'), c(4, 4, 4, 4))))\n stopifnot(isTRUE(all.equal(candidate('.| .| .| .|'), c(1, 1, 1, 1))))\n stopifnot(isTRUE(all.equal(candidate('o| o| .| .| o o o o'), c(2, 2, 1, 1, 4, 4, 4, 4))))\n stopifnot(isTRUE(all.equal(candidate('o| .| o| .| o o| o o|'), c(2, 1, 2, 1, 4, 2, 4, 2))))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- decimal_to_binary\n stopifnot(isTRUE(all.equal(candidate(0), 'db0db')))\n stopifnot(isTRUE(all.equal(candidate(32), 'db100000db')))\n stopifnot(isTRUE(all.equal(candidate(103), 'db1100111db')))\n stopifnot(isTRUE(all.equal(candidate(15), 'db1111db')))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_79_decimal_to_binary", "test": "test_humaneval <- function() {\n candidate <- decimal_to_binary\n stopifnot(isTRUE(all.equal(candidate(0), 'db0db')))\n stopifnot(isTRUE(all.equal(candidate(32), 'db100000db')))\n stopifnot(isTRUE(all.equal(candidate(103), 'db1100111db')))\n stopifnot(isTRUE(all.equal(candidate(15), 'db1111db')))\n}\ntest_humaneval()"}
|
||
|
{"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# c('a', 'ab', 'abc')\nall_prefixes <- function(string) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- all_prefixes\n stopifnot(isTRUE(all.equal(candidate(''), c())))\n stopifnot(isTRUE(all.equal(candidate('asdfgh'), c('a', 'as', 'asd', 'asdf', 'asdfg', 'asdfgh'))))\n stopifnot(isTRUE(all.equal(candidate('WWW'), c('W', 'WW', 'WWW'))))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_14_all_prefixes", "test": "test_humaneval <- function() {\n candidate <- all_prefixes\n stopifnot(isTRUE(all.equal(candidate(''), c())))\n stopifnot(isTRUE(all.equal(candidate('asdfgh'), c('a', 'as', 'asd', 'asdf', 'asdfg', 'asdfgh'))))\n stopifnot(isTRUE(all.equal(candidate('WWW'), c('W', 'WW', 'WWW'))))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- add\n stopifnot(isTRUE(all.equal(candidate(0, 1), 1)))\n stopifnot(isTRUE(all.equal(candidate(1, 0), 1)))\n stopifnot(isTRUE(all.equal(candidate(2, 3), 5)))\n stopifnot(isTRUE(all.equal(candidate(5, 7), 12)))\n stopifnot(isTRUE(all.equal(candidate(7, 5), 12)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_53_add", "test": "test_humaneval <- function() {\n candidate <- add\n stopifnot(isTRUE(all.equal(candidate(0, 1), 1)))\n stopifnot(isTRUE(all.equal(candidate(1, 0), 1)))\n stopifnot(isTRUE(all.equal(candidate(2, 3), 5)))\n stopifnot(isTRUE(all.equal(candidate(5, 7), 12)))\n stopifnot(isTRUE(all.equal(candidate(7, 5), 12)))\n}\ntest_humaneval()"}
|
||
|
{"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# c(11, 4)\n# >>> eat(4, 8, 9)\n# c(12, 1)\n# >>> eat(1, 10, 10)\n# c(11, 0)\n# >>> eat(2, 11, 5)\n# c(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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- eat\n stopifnot(isTRUE(all.equal(candidate(5, 6, 10), c(11, 4))))\n stopifnot(isTRUE(all.equal(candidate(4, 8, 9), c(12, 1))))\n stopifnot(isTRUE(all.equal(candidate(1, 10, 10), c(11, 0))))\n stopifnot(isTRUE(all.equal(candidate(2, 11, 5), c(7, 0))))\n stopifnot(isTRUE(all.equal(candidate(4, 5, 7), c(9, 2))))\n stopifnot(isTRUE(all.equal(candidate(4, 5, 1), c(5, 0))))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_159_eat", "test": "test_humaneval <- function() {\n candidate <- eat\n stopifnot(isTRUE(all.equal(candidate(5, 6, 10), c(11, 4))))\n stopifnot(isTRUE(all.equal(candidate(4, 8, 9), c(12, 1))))\n stopifnot(isTRUE(all.equal(candidate(1, 10, 10), c(11, 0))))\n stopifnot(isTRUE(all.equal(candidate(2, 11, 5), c(7, 0))))\n stopifnot(isTRUE(all.equal(candidate(4, 5, 7), c(9, 2))))\n stopifnot(isTRUE(all.equal(candidate(4, 5, 1), c(5, 0))))\n}\ntest_humaneval()"}
|
||
|
{"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(c(0, 0, 1, 0), c(0, 1, 0, 0), c(1, 1, 1, 1)), 1)\n# 6\n# Example 2:\n# >>> max_fill(list(c(0, 0, 1, 1), c(0, 0, 0, 0), c(1, 1, 1, 1), c(0, 1, 1, 1)), 2)\n# 5\n# Example 3:\n# >>> max_fill(list(c(0, 0, 0), c(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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- max_fill\n stopifnot(isTRUE(all.equal(candidate(list(c(0, 0, 1, 0), c(0, 1, 0, 0), c(1, 1, 1, 1)), 1), 6)))\n stopifnot(isTRUE(all.equal(candidate(list(c(0, 0, 1, 1), c(0, 0, 0, 0), c(1, 1, 1, 1), c(0, 1, 1, 1)), 2), 5)))\n stopifnot(isTRUE(all.equal(candidate(list(c(0, 0, 0), c(0, 0, 0)), 5), 0)))\n stopifnot(isTRUE(all.equal(candidate(list(c(1, 1, 1, 1), c(1, 1, 1, 1)), 2), 4)))\n stopifnot(isTRUE(all.equal(candidate(list(c(1, 1, 1, 1), c(1, 1, 1, 1)), 9), 2)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_115_max_fill", "test": "test_humaneval <- function() {\n candidate <- max_fill\n stopifnot(isTRUE(all.equal(candidate(list(c(0, 0, 1, 0), c(0, 1, 0, 0), c(1, 1, 1, 1)), 1), 6)))\n stopifnot(isTRUE(all.equal(candidate(list(c(0, 0, 1, 1), c(0, 0, 0, 0), c(1, 1, 1, 1), c(0, 1, 1, 1)), 2), 5)))\n stopifnot(isTRUE(all.equal(candidate(list(c(0, 0, 0), c(0, 0, 0)), 5), 0)))\n stopifnot(isTRUE(all.equal(candidate(list(c(1, 1, 1, 1), c(1, 1, 1, 1)), 2), 4)))\n stopifnot(isTRUE(all.equal(candidate(list(c(1, 1, 1, 1), c(1, 1, 1, 1)), 9), 2)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_160_do_algebra.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- do_algebra\n stopifnot(isTRUE(all.equal(candidate(c('**', '*', '+'), c(2, 3, 4, 5)), 37)))\n stopifnot(isTRUE(all.equal(candidate(c('+', '*', '-'), c(2, 3, 4, 5)), 9)))\n stopifnot(isTRUE(all.equal(candidate(c('//', '*'), c(7, 3, 4)), 8)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_160_do_algebra", "test": "test_humaneval <- function() {\n candidate <- do_algebra\n stopifnot(isTRUE(all.equal(candidate(c('**', '*', '+'), c(2, 3, 4, 5)), 37)))\n stopifnot(isTRUE(all.equal(candidate(c('+', '*', '-'), c(2, 3, 4, 5)), 9)))\n stopifnot(isTRUE(all.equal(candidate(c('//', '*'), c(7, 3, 4)), 8)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- flip_case\n stopifnot(isTRUE(all.equal(candidate(''), '')))\n stopifnot(isTRUE(all.equal(candidate('Hello!'), 'hELLO!')))\n stopifnot(isTRUE(all.equal(candidate('These violent delights have violent ends'), 'tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS')))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_27_flip_case", "test": "test_humaneval <- function() {\n candidate <- flip_case\n stopifnot(isTRUE(all.equal(candidate(''), '')))\n stopifnot(isTRUE(all.equal(candidate('Hello!'), 'hELLO!')))\n stopifnot(isTRUE(all.equal(candidate('These violent delights have violent ends'), 'tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS')))\n}\ntest_humaneval()"}
|
||
|
{"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# c('Eight', 'Five', 'Four', 'Three', 'Two', 'Two', 'One', 'One')\n# If the vector is empty, return an empty vector:\n# >>> by_length(c())\n# c()\n# If the vector has any strange number ignore it:\n# >>> by_length(c(1, -1, 55))\n# c('One')\nby_length <- function(arr) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- by_length\n stopifnot(isTRUE(all.equal(candidate(c(2, 1, 1, 4, 5, 8, 2, 3)), c('Eight', 'Five', 'Four', 'Three', 'Two', 'Two', 'One', 'One'))))\n stopifnot(isTRUE(all.equal(candidate(c()), c())))\n stopifnot(isTRUE(all.equal(candidate(c(1, -1, 55)), c('One'))))\n stopifnot(isTRUE(all.equal(candidate(c(1, -1, 3, 2)), c('Three', 'Two', 'One'))))\n stopifnot(isTRUE(all.equal(candidate(c(9, 4, 8)), c('Nine', 'Eight', 'Four'))))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_105_by_length", "test": "test_humaneval <- function() {\n candidate <- by_length\n stopifnot(isTRUE(all.equal(candidate(c(2, 1, 1, 4, 5, 8, 2, 3)), c('Eight', 'Five', 'Four', 'Three', 'Two', 'Two', 'One', 'One'))))\n stopifnot(isTRUE(all.equal(candidate(c()), c())))\n stopifnot(isTRUE(all.equal(candidate(c(1, -1, 55)), c('One'))))\n stopifnot(isTRUE(all.equal(candidate(c(1, -1, 3, 2)), c('Three', 'Two', 'One'))))\n stopifnot(isTRUE(all.equal(candidate(c(9, 4, 8)), c('Nine', 'Eight', 'Four'))))\n}\ntest_humaneval()"}
|
||
|
{"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# c(2, 2, 2)\n# >>> factorize(25)\n# c(5, 5)\n# >>> factorize(70)\n# c(2, 5, 7)\nfactorize <- function(n) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- factorize\n stopifnot(isTRUE(all.equal(candidate(2), c(2))))\n stopifnot(isTRUE(all.equal(candidate(4), c(2, 2))))\n stopifnot(isTRUE(all.equal(candidate(8), c(2, 2, 2))))\n stopifnot(isTRUE(all.equal(candidate(57), c(3, 19))))\n stopifnot(isTRUE(all.equal(candidate(3249), c(3, 3, 19, 19))))\n stopifnot(isTRUE(all.equal(candidate(185193), c(3, 3, 3, 19, 19, 19))))\n stopifnot(isTRUE(all.equal(candidate(20577), c(3, 19, 19, 19))))\n stopifnot(isTRUE(all.equal(candidate(18), c(2, 3, 3))))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_25_factorize", "test": "test_humaneval <- function() {\n candidate <- factorize\n stopifnot(isTRUE(all.equal(candidate(2), c(2))))\n stopifnot(isTRUE(all.equal(candidate(4), c(2, 2))))\n stopifnot(isTRUE(all.equal(candidate(8), c(2, 2, 2))))\n stopifnot(isTRUE(all.equal(candidate(57), c(3, 19))))\n stopifnot(isTRUE(all.equal(candidate(3249), c(3, 3, 19, 19))))\n stopifnot(isTRUE(all.equal(candidate(185193), c(3, 3, 3, 19, 19, 19))))\n stopifnot(isTRUE(all.equal(candidate(20577), c(3, 19, 19, 19))))\n stopifnot(isTRUE(all.equal(candidate(18), c(2, 3, 3))))\n}\ntest_humaneval()"}
|
||
|
{"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# c(2, 3)\n# >>> count_up_to(11)\n# c(2, 3, 5, 7)\n# >>> count_up_to(0)\n# c()\n# >>> count_up_to(20)\n# c(2, 3, 5, 7, 11, 13, 17, 19)\n# >>> count_up_to(1)\n# c()\n# >>> count_up_to(18)\n# c(2, 3, 5, 7, 11, 13, 17)\ncount_up_to <- function(n) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- count_up_to\n stopifnot(isTRUE(all.equal(candidate(5), c(2, 3))))\n stopifnot(isTRUE(all.equal(candidate(6), c(2, 3, 5))))\n stopifnot(isTRUE(all.equal(candidate(7), c(2, 3, 5))))\n stopifnot(isTRUE(all.equal(candidate(10), c(2, 3, 5, 7))))\n stopifnot(isTRUE(all.equal(candidate(0), c())))\n stopifnot(isTRUE(all.equal(candidate(22), c(2, 3, 5, 7, 11, 13, 17, 19))))\n stopifnot(isTRUE(all.equal(candidate(1), c())))\n stopifnot(isTRUE(all.equal(candidate(18), c(2, 3, 5, 7, 11, 13, 17))))\n stopifnot(isTRUE(all.equal(candidate(47), c(2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43))))\n stopifnot(isTRUE(all.equal(candidate(101), c(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}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_96_count_up_to", "test": "test_humaneval <- function() {\n candidate <- count_up_to\n stopifnot(isTRUE(all.equal(candidate(5), c(2, 3))))\n stopifnot(isTRUE(all.equal(candidate(6), c(2, 3, 5))))\n stopifnot(isTRUE(all.equal(candidate(7), c(2, 3, 5))))\n stopifnot(isTRUE(all.equal(candidate(10), c(2, 3, 5, 7))))\n stopifnot(isTRUE(all.equal(candidate(0), c())))\n stopifnot(isTRUE(all.equal(candidate(22), c(2, 3, 5, 7, 11, 13, 17, 19))))\n stopifnot(isTRUE(all.equal(candidate(1), c())))\n stopifnot(isTRUE(all.equal(candidate(18), c(2, 3, 5, 7, 11, 13, 17))))\n stopifnot(isTRUE(all.equal(candidate(47), c(2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43))))\n stopifnot(isTRUE(all.equal(candidate(101), c(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}\ntest_humaneval()"}
|
||
|
{"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# c(0, 2, 3, 5, 9, 123)\nunique <- function(l) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- unique\n stopifnot(isTRUE(all.equal(candidate(c(5, 3, 5, 2, 3, 3, 9, 0, 123)), c(0, 2, 3, 5, 9, 123))))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_34_unique", "test": "test_humaneval <- function() {\n candidate <- unique\n stopifnot(isTRUE(all.equal(candidate(c(5, 3, 5, 2, 3, 3, 9, 0, 123)), c(0, 2, 3, 5, 9, 123))))\n}\ntest_humaneval()"}
|
||
|
{"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# c()\n# >>> total_match(c('hi', 'admin'), c('hI', 'Hi'))\n# c('hI', 'Hi')\n# >>> total_match(c('hi', 'admin'), c('hi', 'hi', 'admin', 'project'))\n# c('hi', 'admin')\n# >>> total_match(c('hi', 'admin'), c('hI', 'hi', 'hi'))\n# c('hI', 'hi', 'hi')\n# >>> total_match(c('4'), c('1', '2', '3', '4', '5'))\n# c('4')\ntotal_match <- function(lst1, lst2) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- total_match\n stopifnot(isTRUE(all.equal(candidate(c(), c()), c())))\n stopifnot(isTRUE(all.equal(candidate(c('hi', 'admin'), c('hi', 'hi')), c('hi', 'hi'))))\n stopifnot(isTRUE(all.equal(candidate(c('hi', 'admin'), c('hi', 'hi', 'admin', 'project')), c('hi', 'admin'))))\n stopifnot(isTRUE(all.equal(candidate(c('4'), c('1', '2', '3', '4', '5')), c('4'))))\n stopifnot(isTRUE(all.equal(candidate(c('hi', 'admin'), c('hI', 'Hi')), c('hI', 'Hi'))))\n stopifnot(isTRUE(all.equal(candidate(c('hi', 'admin'), c('hI', 'hi', 'hi')), c('hI', 'hi', 'hi'))))\n stopifnot(isTRUE(all.equal(candidate(c('hi', 'admin'), c('hI', 'hi', 'hii')), c('hi', 'admin'))))\n stopifnot(isTRUE(all.equal(candidate(c(), c('this')), c())))\n stopifnot(isTRUE(all.equal(candidate(c('this'), c()), c())))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_74_total_match", "test": "test_humaneval <- function() {\n candidate <- total_match\n stopifnot(isTRUE(all.equal(candidate(c(), c()), c())))\n stopifnot(isTRUE(all.equal(candidate(c('hi', 'admin'), c('hi', 'hi')), c('hi', 'hi'))))\n stopifnot(isTRUE(all.equal(candidate(c('hi', 'admin'), c('hi', 'hi', 'admin', 'project')), c('hi', 'admin'))))\n stopifnot(isTRUE(all.equal(candidate(c('4'), c('1', '2', '3', '4', '5')), c('4'))))\n stopifnot(isTRUE(all.equal(candidate(c('hi', 'admin'), c('hI', 'Hi')), c('hI', 'Hi'))))\n stopifnot(isTRUE(all.equal(candidate(c('hi', 'admin'), c('hI', 'hi', 'hi')), c('hI', 'hi', 'hi'))))\n stopifnot(isTRUE(all.equal(candidate(c('hi', 'admin'), c('hI', 'hi', 'hii')), c('hi', 'admin'))))\n stopifnot(isTRUE(all.equal(candidate(c(), c('this')), c())))\n stopifnot(isTRUE(all.equal(candidate(c('this'), c()), c())))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- max_element\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3)), 3)))\n stopifnot(isTRUE(all.equal(candidate(c(5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10)), 124)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_35_max_element", "test": "test_humaneval <- function() {\n candidate <- max_element\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3)), 3)))\n stopifnot(isTRUE(all.equal(candidate(c(5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10)), 124)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- is_nested\n stopifnot(isTRUE(all.equal(candidate('[[]]'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('[]]]]]]][[[[[]'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('[][]'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('[]'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('[[[[]]]]'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('[]]]]]]]]]]'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('[][][[]]'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('[[]'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('[]]'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('[[]][['), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('[[][]]'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(''), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('[[[[[[[['), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(']]]]]]]]'), FALSE)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_132_is_nested", "test": "test_humaneval <- function() {\n candidate <- is_nested\n stopifnot(isTRUE(all.equal(candidate('[[]]'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('[]]]]]]][[[[[]'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('[][]'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('[]'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('[[[[]]]]'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('[]]]]]]]]]]'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('[][][[]]'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('[[]'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('[]]'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('[[]][['), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('[[][]]'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(''), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('[[[[[[[['), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(']]]]]]]]'), FALSE)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_103_rounded_avg.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- rounded_avg\n stopifnot(isTRUE(all.equal(candidate(1, 5), '0b11')))\n stopifnot(isTRUE(all.equal(candidate(7, 13), '0b1010')))\n stopifnot(isTRUE(all.equal(candidate(964, 977), '0b1111001010')))\n stopifnot(isTRUE(all.equal(candidate(996, 997), '0b1111100100')))\n stopifnot(isTRUE(all.equal(candidate(560, 851), '0b1011000010')))\n stopifnot(isTRUE(all.equal(candidate(185, 546), '0b101101110')))\n stopifnot(isTRUE(all.equal(candidate(362, 496), '0b110101101')))\n stopifnot(isTRUE(all.equal(candidate(350, 902), '0b1001110010')))\n stopifnot(isTRUE(all.equal(candidate(197, 233), '0b11010111')))\n stopifnot(isTRUE(all.equal(candidate(7, 5), -1)))\n stopifnot(isTRUE(all.equal(candidate(5, 1), -1)))\n stopifnot(isTRUE(all.equal(candidate(5, 5), '0b101')))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_103_rounded_avg", "test": "test_humaneval <- function() {\n candidate <- rounded_avg\n stopifnot(isTRUE(all.equal(candidate(1, 5), '0b11')))\n stopifnot(isTRUE(all.equal(candidate(7, 13), '0b1010')))\n stopifnot(isTRUE(all.equal(candidate(964, 977), '0b1111001010')))\n stopifnot(isTRUE(all.equal(candidate(996, 997), '0b1111100100')))\n stopifnot(isTRUE(all.equal(candidate(560, 851), '0b1011000010')))\n stopifnot(isTRUE(all.equal(candidate(185, 546), '0b101101110')))\n stopifnot(isTRUE(all.equal(candidate(362, 496), '0b110101101')))\n stopifnot(isTRUE(all.equal(candidate(350, 902), '0b1001110010')))\n stopifnot(isTRUE(all.equal(candidate(197, 233), '0b11010111')))\n stopifnot(isTRUE(all.equal(candidate(7, 5), -1)))\n stopifnot(isTRUE(all.equal(candidate(5, 1), -1)))\n stopifnot(isTRUE(all.equal(candidate(5, 5), '0b101')))\n}\ntest_humaneval()"}
|
||
|
{"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# c('the number of odd elements 4n the str4ng 4 of the 4nput.')\n# >>> odd_count(c('3', '11111111'))\n# c('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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- odd_count\n stopifnot(isTRUE(all.equal(candidate(c('1234567')), c('the number of odd elements 4n the str4ng 4 of the 4nput.'))))\n stopifnot(isTRUE(all.equal(candidate(c('3', '11111111')), c('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 stopifnot(isTRUE(all.equal(candidate(c('271', '137', '314')), c('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}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_113_odd_count", "test": "test_humaneval <- function() {\n candidate <- odd_count\n stopifnot(isTRUE(all.equal(candidate(c('1234567')), c('the number of odd elements 4n the str4ng 4 of the 4nput.'))))\n stopifnot(isTRUE(all.equal(candidate(c('3', '11111111')), c('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 stopifnot(isTRUE(all.equal(candidate(c('271', '137', '314')), c('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}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- move_one_ball\n stopifnot(isTRUE(all.equal(candidate(c(3, 4, 5, 1, 2)), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(3, 5, 10, 1, 2)), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(4, 3, 1, 2)), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(3, 5, 4, 1, 2)), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c()), TRUE)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_109_move_one_ball", "test": "test_humaneval <- function() {\n candidate <- move_one_ball\n stopifnot(isTRUE(all.equal(candidate(c(3, 4, 5, 1, 2)), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(3, 5, 10, 1, 2)), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(4, 3, 1, 2)), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(3, 5, 4, 1, 2)), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c()), TRUE)))\n}\ntest_humaneval()"}
|
||
|
{"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# c(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# c(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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- even_odd_palindrome\n stopifnot(isTRUE(all.equal(candidate(123), c(8, 13))))\n stopifnot(isTRUE(all.equal(candidate(12), c(4, 6))))\n stopifnot(isTRUE(all.equal(candidate(3), c(1, 2))))\n stopifnot(isTRUE(all.equal(candidate(63), c(6, 8))))\n stopifnot(isTRUE(all.equal(candidate(25), c(5, 6))))\n stopifnot(isTRUE(all.equal(candidate(19), c(4, 6))))\n stopifnot(isTRUE(all.equal(candidate(9), c(4, 5))))\n stopifnot(isTRUE(all.equal(candidate(1), c(0, 1))))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_107_even_odd_palindrome", "test": "test_humaneval <- function() {\n candidate <- even_odd_palindrome\n stopifnot(isTRUE(all.equal(candidate(123), c(8, 13))))\n stopifnot(isTRUE(all.equal(candidate(12), c(4, 6))))\n stopifnot(isTRUE(all.equal(candidate(3), c(1, 2))))\n stopifnot(isTRUE(all.equal(candidate(63), c(6, 8))))\n stopifnot(isTRUE(all.equal(candidate(25), c(5, 6))))\n stopifnot(isTRUE(all.equal(candidate(19), c(4, 6))))\n stopifnot(isTRUE(all.equal(candidate(9), c(4, 5))))\n stopifnot(isTRUE(all.equal(candidate(1), c(0, 1))))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- is_equal_to_sum_even\n stopifnot(isTRUE(all.equal(candidate(4), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(6), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(8), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(10), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(11), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(12), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(13), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(16), TRUE)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_138_is_equal_to_sum_even", "test": "test_humaneval <- function() {\n candidate <- is_equal_to_sum_even\n stopifnot(isTRUE(all.equal(candidate(4), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(6), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(8), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(10), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(11), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(12), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(13), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(16), TRUE)))\n}\ntest_humaneval()"}
|
||
|
{"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# c(1, 4, 12, 20)\n# >>> derivative(c(1, 2, 3))\n# c(2, 6)\nderivative <- function(xs) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- derivative\n stopifnot(isTRUE(all.equal(candidate(c(3, 1, 2, 4, 5)), c(1, 4, 12, 20))))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3)), c(2, 6))))\n stopifnot(isTRUE(all.equal(candidate(c(3, 2, 1)), c(2, 2))))\n stopifnot(isTRUE(all.equal(candidate(c(3, 2, 1, 0, 4)), c(2, 2, 0, 16))))\n stopifnot(isTRUE(all.equal(candidate(c(1)), c())))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_62_derivative", "test": "test_humaneval <- function() {\n candidate <- derivative\n stopifnot(isTRUE(all.equal(candidate(c(3, 1, 2, 4, 5)), c(1, 4, 12, 20))))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3)), c(2, 6))))\n stopifnot(isTRUE(all.equal(candidate(c(3, 2, 1)), c(2, 2))))\n stopifnot(isTRUE(all.equal(candidate(c(3, 2, 1, 0, 4)), c(2, 2, 0, 16))))\n stopifnot(isTRUE(all.equal(candidate(c(1)), c())))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- is_sorted\n stopifnot(isTRUE(all.equal(candidate(c(5)), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 4, 5)), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 3, 2, 4, 5)), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 4, 5, 6)), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 4, 5, 6, 7)), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 3, 2, 4, 5, 6, 7)), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c()), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1)), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(3, 2, 1)), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 2, 2, 3, 4)), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 3, 3, 4)), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 2, 3, 3, 4)), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 4)), TRUE)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_126_is_sorted", "test": "test_humaneval <- function() {\n candidate <- is_sorted\n stopifnot(isTRUE(all.equal(candidate(c(5)), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 4, 5)), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 3, 2, 4, 5)), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 4, 5, 6)), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 4, 5, 6, 7)), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 3, 2, 4, 5, 6, 7)), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c()), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1)), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(3, 2, 1)), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 2, 2, 3, 4)), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 3, 3, 4)), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 2, 3, 3, 4)), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 4)), TRUE)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- solve\n stopifnot(isTRUE(all.equal(candidate('AsDf'), 'aSdF')))\n stopifnot(isTRUE(all.equal(candidate('1234'), '4321')))\n stopifnot(isTRUE(all.equal(candidate('ab'), 'AB')))\n stopifnot(isTRUE(all.equal(candidate('#a@C'), '#A@c')))\n stopifnot(isTRUE(all.equal(candidate('#AsdfW^45'), '#aSDFw^45')))\n stopifnot(isTRUE(all.equal(candidate('#6@2'), '2@6#')))\n stopifnot(isTRUE(all.equal(candidate('#$a^D'), '#$A^d')))\n stopifnot(isTRUE(all.equal(candidate('#ccc'), '#CCC')))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_161_solve", "test": "test_humaneval <- function() {\n candidate <- solve\n stopifnot(isTRUE(all.equal(candidate('AsDf'), 'aSdF')))\n stopifnot(isTRUE(all.equal(candidate('1234'), '4321')))\n stopifnot(isTRUE(all.equal(candidate('ab'), 'AB')))\n stopifnot(isTRUE(all.equal(candidate('#a@C'), '#A@c')))\n stopifnot(isTRUE(all.equal(candidate('#AsdfW^45'), '#aSDFw^45')))\n stopifnot(isTRUE(all.equal(candidate('#6@2'), '2@6#')))\n stopifnot(isTRUE(all.equal(candidate('#$a^D'), '#$A^d')))\n stopifnot(isTRUE(all.equal(candidate('#ccc'), '#CCC')))\n}\ntest_humaneval()"}
|
||
|
{"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# c(1, 3, 2, 8)\ntri <- function(n) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- tri\n stopifnot(isTRUE(all.equal(candidate(3), c(1, 3, 2, 8))))\n stopifnot(isTRUE(all.equal(candidate(4), c(1, 3, 2, 8, 3))))\n stopifnot(isTRUE(all.equal(candidate(5), c(1, 3, 2, 8, 3, 15))))\n stopifnot(isTRUE(all.equal(candidate(6), c(1, 3, 2, 8, 3, 15, 4))))\n stopifnot(isTRUE(all.equal(candidate(7), c(1, 3, 2, 8, 3, 15, 4, 24))))\n stopifnot(isTRUE(all.equal(candidate(8), c(1, 3, 2, 8, 3, 15, 4, 24, 5))))\n stopifnot(isTRUE(all.equal(candidate(9), c(1, 3, 2, 8, 3, 15, 4, 24, 5, 35))))\n stopifnot(isTRUE(all.equal(candidate(20), c(1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11))))\n stopifnot(isTRUE(all.equal(candidate(0), c(1))))\n stopifnot(isTRUE(all.equal(candidate(1), c(1, 3))))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_130_tri", "test": "test_humaneval <- function() {\n candidate <- tri\n stopifnot(isTRUE(all.equal(candidate(3), c(1, 3, 2, 8))))\n stopifnot(isTRUE(all.equal(candidate(4), c(1, 3, 2, 8, 3))))\n stopifnot(isTRUE(all.equal(candidate(5), c(1, 3, 2, 8, 3, 15))))\n stopifnot(isTRUE(all.equal(candidate(6), c(1, 3, 2, 8, 3, 15, 4))))\n stopifnot(isTRUE(all.equal(candidate(7), c(1, 3, 2, 8, 3, 15, 4, 24))))\n stopifnot(isTRUE(all.equal(candidate(8), c(1, 3, 2, 8, 3, 15, 4, 24, 5))))\n stopifnot(isTRUE(all.equal(candidate(9), c(1, 3, 2, 8, 3, 15, 4, 24, 5, 35))))\n stopifnot(isTRUE(all.equal(candidate(20), c(1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11))))\n stopifnot(isTRUE(all.equal(candidate(0), c(1))))\n stopifnot(isTRUE(all.equal(candidate(1), c(1, 3))))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- fizz_buzz\n stopifnot(isTRUE(all.equal(candidate(50), 0)))\n stopifnot(isTRUE(all.equal(candidate(78), 2)))\n stopifnot(isTRUE(all.equal(candidate(79), 3)))\n stopifnot(isTRUE(all.equal(candidate(100), 3)))\n stopifnot(isTRUE(all.equal(candidate(200), 6)))\n stopifnot(isTRUE(all.equal(candidate(4000), 192)))\n stopifnot(isTRUE(all.equal(candidate(10000), 639)))\n stopifnot(isTRUE(all.equal(candidate(100000), 8026)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_36_fizz_buzz", "test": "test_humaneval <- function() {\n candidate <- fizz_buzz\n stopifnot(isTRUE(all.equal(candidate(50), 0)))\n stopifnot(isTRUE(all.equal(candidate(78), 2)))\n stopifnot(isTRUE(all.equal(candidate(79), 3)))\n stopifnot(isTRUE(all.equal(candidate(100), 3)))\n stopifnot(isTRUE(all.equal(candidate(200), 6)))\n stopifnot(isTRUE(all.equal(candidate(4000), 192)))\n stopifnot(isTRUE(all.equal(candidate(10000), 639)))\n stopifnot(isTRUE(all.equal(candidate(100000), 8026)))\n}\ntest_humaneval()"}
|
||
|
{"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# c()\n# >>> filter_by_prefix(c('abc', 'bcd', 'cde', 'array'), 'a')\n# c('abc', 'array')\nfilter_by_prefix <- function(strings, prefix) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- filter_by_prefix\n stopifnot(isTRUE(all.equal(candidate(c(), 'john'), c())))\n stopifnot(isTRUE(all.equal(candidate(c('xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'), 'xxx'), c('xxx', 'xxxAAA', 'xxx'))))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_29_filter_by_prefix", "test": "test_humaneval <- function() {\n candidate <- filter_by_prefix\n stopifnot(isTRUE(all.equal(candidate(c(), 'john'), c())))\n stopifnot(isTRUE(all.equal(candidate(c('xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'), 'xxx'), c('xxx', 'xxxAAA', 'xxx'))))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- solve\n stopifnot(isTRUE(all.equal(candidate(1000), '1')))\n stopifnot(isTRUE(all.equal(candidate(150), '110')))\n stopifnot(isTRUE(all.equal(candidate(147), '1100')))\n stopifnot(isTRUE(all.equal(candidate(333), '1001')))\n stopifnot(isTRUE(all.equal(candidate(963), '10010')))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_84_solve", "test": "test_humaneval <- function() {\n candidate <- solve\n stopifnot(isTRUE(all.equal(candidate(1000), '1')))\n stopifnot(isTRUE(all.equal(candidate(150), '110')))\n stopifnot(isTRUE(all.equal(candidate(147), '1100')))\n stopifnot(isTRUE(all.equal(candidate(333), '1001')))\n stopifnot(isTRUE(all.equal(candidate(963), '10010')))\n}\ntest_humaneval()"}
|
||
|
{"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(c(1, 2, 3), c(4, 5, 6), c(7, 8, 9)), 3)\n# c(1, 2, 1)\n# >>> minPath(list(c(5, 9, 3), c(4, 1, 6), c(7, 8, 2)), 1)\n# c(1)\nminPath <- function(grid, k) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- minPath\n stopifnot(isTRUE(all.equal(candidate(list(c(1, 2, 3), c(4, 5, 6), c(7, 8, 9)), 3), c(1, 2, 1))))\n stopifnot(isTRUE(all.equal(candidate(list(c(5, 9, 3), c(4, 1, 6), c(7, 8, 2)), 1), c(1))))\n stopifnot(isTRUE(all.equal(candidate(list(c(1, 2, 3, 4), c(5, 6, 7, 8), c(9, 10, 11, 12), c(13, 14, 15, 16)), 4), c(1, 2, 1, 2))))\n stopifnot(isTRUE(all.equal(candidate(list(c(6, 4, 13, 10), c(5, 7, 12, 1), c(3, 16, 11, 15), c(8, 14, 9, 2)), 7), c(1, 10, 1, 10, 1, 10, 1))))\n stopifnot(isTRUE(all.equal(candidate(list(c(8, 14, 9, 2), c(6, 4, 13, 15), c(5, 7, 1, 12), c(3, 10, 11, 16)), 5), c(1, 7, 1, 7, 1))))\n stopifnot(isTRUE(all.equal(candidate(list(c(11, 8, 7, 2), c(5, 16, 14, 4), c(9, 3, 15, 6), c(12, 13, 10, 1)), 9), c(1, 6, 1, 6, 1, 6, 1, 6, 1))))\n stopifnot(isTRUE(all.equal(candidate(list(c(12, 13, 10, 1), c(9, 3, 15, 6), c(5, 16, 14, 4), c(11, 8, 7, 2)), 12), c(1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6))))\n stopifnot(isTRUE(all.equal(candidate(list(c(2, 7, 4), c(3, 1, 5), c(6, 8, 9)), 8), c(1, 3, 1, 3, 1, 3, 1, 3))))\n stopifnot(isTRUE(all.equal(candidate(list(c(6, 1, 5), c(3, 8, 9), c(2, 7, 4)), 8), c(1, 5, 1, 5, 1, 5, 1, 5))))\n stopifnot(isTRUE(all.equal(candidate(list(c(1, 2), c(3, 4)), 10), c(1, 2, 1, 2, 1, 2, 1, 2, 1, 2))))\n stopifnot(isTRUE(all.equal(candidate(list(c(1, 3), c(3, 2)), 10), c(1, 3, 1, 3, 1, 3, 1, 3, 1, 3))))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_129_minPath", "test": "test_humaneval <- function() {\n candidate <- minPath\n stopifnot(isTRUE(all.equal(candidate(list(c(1, 2, 3), c(4, 5, 6), c(7, 8, 9)), 3), c(1, 2, 1))))\n stopifnot(isTRUE(all.equal(candidate(list(c(5, 9, 3), c(4, 1, 6), c(7, 8, 2)), 1), c(1))))\n stopifnot(isTRUE(all.equal(candidate(list(c(1, 2, 3, 4), c(5, 6, 7, 8), c(9, 10, 11, 12), c(13, 14, 15, 16)), 4), c(1, 2, 1, 2))))\n stopifnot(isTRUE(all.equal(candidate(list(c(6, 4, 13, 10), c(5, 7, 12, 1), c(3, 16, 11, 15), c(8, 14, 9, 2)), 7), c(1, 10, 1, 10, 1, 10, 1))))\n stopifnot(isTRUE(all.equal(candidate(list(c(8, 14, 9, 2), c(6, 4, 13, 15), c(5, 7, 1, 12), c(3, 10, 11, 16)), 5), c(1, 7, 1, 7, 1))))\n stopifnot(isTRUE(all.equal(candidate(list(c(11, 8, 7, 2), c(5, 16, 14, 4), c(9, 3, 15, 6), c(12, 13, 10, 1)), 9), c(1, 6, 1, 6, 1, 6, 1, 6, 1))))\n stopifnot(isTRUE(all.equal(candidate(list(c(12, 13, 10, 1), c(9, 3, 15, 6), c(5, 16, 14, 4), c(11, 8, 7, 2)), 12), c(1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- count_upper\n stopifnot(isTRUE(all.equal(candidate('aBCdEf'), 1)))\n stopifnot(isTRUE(all.equal(candidate('abcdefg'), 0)))\n stopifnot(isTRUE(all.equal(candidate('dBBE'), 0)))\n stopifnot(isTRUE(all.equal(candidate('B'), 0)))\n stopifnot(isTRUE(all.equal(candidate('U'), 1)))\n stopifnot(isTRUE(all.equal(candidate(''), 0)))\n stopifnot(isTRUE(all.equal(candidate('EEEE'), 2)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_98_count_upper", "test": "test_humaneval <- function() {\n candidate <- count_upper\n stopifnot(isTRUE(all.equal(candidate('aBCdEf'), 1)))\n stopifnot(isTRUE(all.equal(candidate('abcdefg'), 0)))\n stopifnot(isTRUE(all.equal(candidate('dBBE'), 0)))\n stopifnot(isTRUE(all.equal(candidate('B'), 0)))\n stopifnot(isTRUE(all.equal(candidate('U'), 1)))\n stopifnot(isTRUE(all.equal(candidate(''), 0)))\n stopifnot(isTRUE(all.equal(candidate('EEEE'), 2)))\n}\ntest_humaneval()"}
|
||
|
{"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# c(-4, -3, 5)\n# Example 2:\n# >>> maximum(c(4, -4, 4), 2)\n# c(4, 4)\n# Example 3:\n# >>> maximum(c(-3, 2, 1, 2, -1, -2, 1), 1)\n# c(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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- maximum\n stopifnot(isTRUE(all.equal(candidate(c(-3, -4, 5), 3), c(-4, -3, 5))))\n stopifnot(isTRUE(all.equal(candidate(c(4, -4, 4), 2), c(4, 4))))\n stopifnot(isTRUE(all.equal(candidate(c(-3, 2, 1, 2, -1, -2, 1), 1), c(2))))\n stopifnot(isTRUE(all.equal(candidate(c(123, -123, 20, 0, 1, 2, -3), 3), c(2, 20, 123))))\n stopifnot(isTRUE(all.equal(candidate(c(-123, 20, 0, 1, 2, -3), 4), c(0, 1, 2, 20))))\n stopifnot(isTRUE(all.equal(candidate(c(5, 15, 0, 3, -13, -8, 0), 7), c(-13, -8, 0, 0, 3, 5, 15))))\n stopifnot(isTRUE(all.equal(candidate(c(-1, 0, 2, 5, 3, -10), 2), c(3, 5))))\n stopifnot(isTRUE(all.equal(candidate(c(1, 0, 5, -7), 1), c(5))))\n stopifnot(isTRUE(all.equal(candidate(c(4, -4), 2), c(-4, 4))))\n stopifnot(isTRUE(all.equal(candidate(c(-10, 10), 2), c(-10, 10))))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, -23, 243, -400, 0), 0), c())))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_120_maximum", "test": "test_humaneval <- function() {\n candidate <- maximum\n stopifnot(isTRUE(all.equal(candidate(c(-3, -4, 5), 3), c(-4, -3, 5))))\n stopifnot(isTRUE(all.equal(candidate(c(4, -4, 4), 2), c(4, 4))))\n stopifnot(isTRUE(all.equal(candidate(c(-3, 2, 1, 2, -1, -2, 1), 1), c(2))))\n stopifnot(isTRUE(all.equal(candidate(c(123, -123, 20, 0, 1, 2, -3), 3), c(2, 20, 123))))\n stopifnot(isTRUE(all.equal(candidate(c(-123, 20, 0, 1, 2, -3), 4), c(0, 1, 2, 20))))\n stopifnot(isTRUE(all.equal(candidate(c(5, 15, 0, 3, -13, -8, 0), 7), c(-13, -8, 0, 0, 3, 5, 15))))\n stopifnot(isTRUE(all.equal(candidate(c(-1, 0, 2, 5, 3, -10), 2), c(3, 5))))\n stopifnot(isTRUE(all.equal(candidate(c(1, 0, 5, -7), 1), c(5))))\n stopifnot(isTRUE(all.equal(candidate(c(4, -4), 2), c(-4, 4))))\n stopifnot(isTRUE(all.equal(candidate(c(-10, 10), 2), c(-10, 10))))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, -23, 243, -400, 0), 0), c())))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- largest_divisor\n stopifnot(isTRUE(all.equal(candidate(3), 1)))\n stopifnot(isTRUE(all.equal(candidate(7), 1)))\n stopifnot(isTRUE(all.equal(candidate(10), 5)))\n stopifnot(isTRUE(all.equal(candidate(100), 50)))\n stopifnot(isTRUE(all.equal(candidate(49), 7)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_24_largest_divisor", "test": "test_humaneval <- function() {\n candidate <- largest_divisor\n stopifnot(isTRUE(all.equal(candidate(3), 1)))\n stopifnot(isTRUE(all.equal(candidate(7), 1)))\n stopifnot(isTRUE(all.equal(candidate(10), 5)))\n stopifnot(isTRUE(all.equal(candidate(100), 50)))\n stopifnot(isTRUE(all.equal(candidate(49), 7)))\n}\ntest_humaneval()"}
|
||
|
{"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# c()\n# >>> sort_array(c(5))\n# c(5)\n# >>> sort_array(c(2, 4, 3, 0, 1, 5))\n# c(0, 1, 2, 3, 4, 5)\n# >>> sort_array(c(2, 4, 3, 0, 1, 5, 6))\n# c(6, 5, 4, 3, 2, 1, 0)\nsort_array <- function(array) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- sort_array\n stopifnot(isTRUE(all.equal(candidate(c()), c())))\n stopifnot(isTRUE(all.equal(candidate(c(5)), c(5))))\n stopifnot(isTRUE(all.equal(candidate(c(2, 4, 3, 0, 1, 5)), c(0, 1, 2, 3, 4, 5))))\n stopifnot(isTRUE(all.equal(candidate(c(2, 4, 3, 0, 1, 5, 6)), c(6, 5, 4, 3, 2, 1, 0))))\n stopifnot(isTRUE(all.equal(candidate(c(2, 1)), c(1, 2))))\n stopifnot(isTRUE(all.equal(candidate(c(15, 42, 87, 32, 11, 0)), c(0, 11, 15, 32, 42, 87))))\n stopifnot(isTRUE(all.equal(candidate(c(21, 14, 23, 11)), c(23, 21, 14, 11))))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_88_sort_array", "test": "test_humaneval <- function() {\n candidate <- sort_array\n stopifnot(isTRUE(all.equal(candidate(c()), c())))\n stopifnot(isTRUE(all.equal(candidate(c(5)), c(5))))\n stopifnot(isTRUE(all.equal(candidate(c(2, 4, 3, 0, 1, 5)), c(0, 1, 2, 3, 4, 5))))\n stopifnot(isTRUE(all.equal(candidate(c(2, 4, 3, 0, 1, 5, 6)), c(6, 5, 4, 3, 2, 1, 0))))\n stopifnot(isTRUE(all.equal(candidate(c(2, 1)), c(1, 2))))\n stopifnot(isTRUE(all.equal(candidate(c(15, 42, 87, 32, 11, 0)), c(0, 11, 15, 32, 42, 87))))\n stopifnot(isTRUE(all.equal(candidate(c(21, 14, 23, 11)), c(23, 21, 14, 11))))\n}\ntest_humaneval()"}
|
||
|
{"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# c(1, 2, 6, 24, 15)\nf <- function(n) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- f\n stopifnot(isTRUE(all.equal(candidate(5), c(1, 2, 6, 24, 15))))\n stopifnot(isTRUE(all.equal(candidate(7), c(1, 2, 6, 24, 15, 720, 28))))\n stopifnot(isTRUE(all.equal(candidate(1), c(1))))\n stopifnot(isTRUE(all.equal(candidate(3), c(1, 2, 6))))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_106_f", "test": "test_humaneval <- function() {\n candidate <- f\n stopifnot(isTRUE(all.equal(candidate(5), c(1, 2, 6, 24, 15))))\n stopifnot(isTRUE(all.equal(candidate(7), c(1, 2, 6, 24, 15, 720, 28))))\n stopifnot(isTRUE(all.equal(candidate(1), c(1))))\n stopifnot(isTRUE(all.equal(candidate(3), c(1, 2, 6))))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- iscube\n stopifnot(isTRUE(all.equal(candidate(1), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(2), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(-1), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(64), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(180), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(1000), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(0), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(1729), FALSE)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_77_iscube", "test": "test_humaneval <- function() {\n candidate <- iscube\n stopifnot(isTRUE(all.equal(candidate(1), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(2), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(-1), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(64), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(180), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(1000), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(0), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(1729), FALSE)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- encode\n stopifnot(isTRUE(all.equal(candidate('TEST'), 'tgst')))\n stopifnot(isTRUE(all.equal(candidate('Mudasir'), 'mWDCSKR')))\n stopifnot(isTRUE(all.equal(candidate('YES'), 'ygs')))\n stopifnot(isTRUE(all.equal(candidate('This is a message'), 'tHKS KS C MGSSCGG')))\n stopifnot(isTRUE(all.equal(candidate('I DoNt KnOw WhAt tO WrItE'), 'k dQnT kNqW wHcT Tq wRkTg')))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_93_encode", "test": "test_humaneval <- function() {\n candidate <- encode\n stopifnot(isTRUE(all.equal(candidate('TEST'), 'tgst')))\n stopifnot(isTRUE(all.equal(candidate('Mudasir'), 'mWDCSKR')))\n stopifnot(isTRUE(all.equal(candidate('YES'), 'ygs')))\n stopifnot(isTRUE(all.equal(candidate('This is a message'), 'tHKS KS C MGSSCGG')))\n stopifnot(isTRUE(all.equal(candidate('I DoNt KnOw WhAt tO WrItE'), 'k dQnT kNqW wHcT Tq wRkTg')))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- is_bored\n stopifnot(isTRUE(all.equal(candidate('Hello world'), 0)))\n stopifnot(isTRUE(all.equal(candidate('Is the sky blue?'), 0)))\n stopifnot(isTRUE(all.equal(candidate('I love It !'), 1)))\n stopifnot(isTRUE(all.equal(candidate('bIt'), 0)))\n stopifnot(isTRUE(all.equal(candidate('I feel good today. I will be productive. will kill It'), 2)))\n stopifnot(isTRUE(all.equal(candidate('You and I are going for a walk'), 0)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_91_is_bored", "test": "test_humaneval <- function() {\n candidate <- is_bored\n stopifnot(isTRUE(all.equal(candidate('Hello world'), 0)))\n stopifnot(isTRUE(all.equal(candidate('Is the sky blue?'), 0)))\n stopifnot(isTRUE(all.equal(candidate('I love It !'), 1)))\n stopifnot(isTRUE(all.equal(candidate('bIt'), 0)))\n stopifnot(isTRUE(all.equal(candidate('I feel good today. I will be productive. will kill It'), 2)))\n stopifnot(isTRUE(all.equal(candidate('You and I are going for a walk'), 0)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- pairs_sum_to_zero\n stopifnot(isTRUE(all.equal(candidate(c(1, 3, 5, 0)), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 3, -2, 1)), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 7)), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(2, 4, -5, 3, 5, 7)), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1)), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(-3, 9, -1, 3, 2, 30)), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(-3, 9, -1, 3, 2, 31)), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(-3, 9, -1, 4, 2, 30)), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(-3, 9, -1, 4, 2, 31)), FALSE)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_43_pairs_sum_to_zero", "test": "test_humaneval <- function() {\n candidate <- pairs_sum_to_zero\n stopifnot(isTRUE(all.equal(candidate(c(1, 3, 5, 0)), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 3, -2, 1)), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 7)), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(2, 4, -5, 3, 5, 7)), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1)), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(-3, 9, -1, 3, 2, 30)), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(-3, 9, -1, 3, 2, 31)), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(-3, 9, -1, 4, 2, 30)), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(-3, 9, -1, 4, 2, 31)), FALSE)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- triangle_area\n stopifnot(isTRUE(all.equal(candidate(3, 4, 5), 6.0)))\n stopifnot(isTRUE(all.equal(candidate(1, 2, 10), -1)))\n stopifnot(isTRUE(all.equal(candidate(4, 8, 5), 8.18)))\n stopifnot(isTRUE(all.equal(candidate(2, 2, 2), 1.73)))\n stopifnot(isTRUE(all.equal(candidate(1, 2, 3), -1)))\n stopifnot(isTRUE(all.equal(candidate(10, 5, 7), 16.25)))\n stopifnot(isTRUE(all.equal(candidate(2, 6, 3), -1)))\n stopifnot(isTRUE(all.equal(candidate(1, 1, 1), 0.43)))\n stopifnot(isTRUE(all.equal(candidate(2, 2, 10), -1)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_71_triangle_area", "test": "test_humaneval <- function() {\n candidate <- triangle_area\n stopifnot(isTRUE(all.equal(candidate(3, 4, 5), 6.0)))\n stopifnot(isTRUE(all.equal(candidate(1, 2, 10), -1)))\n stopifnot(isTRUE(all.equal(candidate(4, 8, 5), 8.18)))\n stopifnot(isTRUE(all.equal(candidate(2, 2, 2), 1.73)))\n stopifnot(isTRUE(all.equal(candidate(1, 2, 3), -1)))\n stopifnot(isTRUE(all.equal(candidate(10, 5, 7), 16.25)))\n stopifnot(isTRUE(all.equal(candidate(2, 6, 3), -1)))\n stopifnot(isTRUE(all.equal(candidate(1, 1, 1), 0.43)))\n stopifnot(isTRUE(all.equal(candidate(2, 2, 10), -1)))\n}\ntest_humaneval()"}
|
||
|
{"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# c('Saturn', 'Uranus')\n# >>> bf('Earth', 'Mercury')\n# 'Venus'\n# >>> bf('Mercury', 'Uranus')\n# c('Venus', 'Earth', 'Mars', 'Jupiter', 'Saturn')\nbf <- function(planet1, planet2) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_148_bf.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- bf\n stopifnot(isTRUE(all.equal(candidate('Jupiter', 'Neptune'), c('Saturn', 'Uranus'))))\n stopifnot(isTRUE(all.equal(candidate('Earth', 'Mercury'), c('Venus'))))\n stopifnot(isTRUE(all.equal(candidate('Mercury', 'Uranus'), c('Venus', 'Earth', 'Mars', 'Jupiter', 'Saturn'))))\n stopifnot(isTRUE(all.equal(candidate('Neptune', 'Venus'), c('Earth', 'Mars', 'Jupiter', 'Saturn', 'Uranus'))))\n stopifnot(isTRUE(all.equal(candidate('Earth', 'Earth'), c())))\n stopifnot(isTRUE(all.equal(candidate('Mars', 'Earth'), c())))\n stopifnot(isTRUE(all.equal(candidate('Jupiter', 'Makemake'), c())))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_148_bf", "test": "test_humaneval <- function() {\n candidate <- bf\n stopifnot(isTRUE(all.equal(candidate('Jupiter', 'Neptune'), c('Saturn', 'Uranus'))))\n stopifnot(isTRUE(all.equal(candidate('Earth', 'Mercury'), c('Venus'))))\n stopifnot(isTRUE(all.equal(candidate('Mercury', 'Uranus'), c('Venus', 'Earth', 'Mars', 'Jupiter', 'Saturn'))))\n stopifnot(isTRUE(all.equal(candidate('Neptune', 'Venus'), c('Earth', 'Mars', 'Jupiter', 'Saturn', 'Uranus'))))\n stopifnot(isTRUE(all.equal(candidate('Earth', 'Earth'), c())))\n stopifnot(isTRUE(all.equal(candidate('Mars', 'Earth'), c())))\n stopifnot(isTRUE(all.equal(candidate('Jupiter', 'Makemake'), c())))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- digits\n stopifnot(isTRUE(all.equal(candidate(5), 5)))\n stopifnot(isTRUE(all.equal(candidate(54), 5)))\n stopifnot(isTRUE(all.equal(candidate(120), 1)))\n stopifnot(isTRUE(all.equal(candidate(5014), 5)))\n stopifnot(isTRUE(all.equal(candidate(98765), 315)))\n stopifnot(isTRUE(all.equal(candidate(5576543), 2625)))\n stopifnot(isTRUE(all.equal(candidate(2468), 0)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_131_digits", "test": "test_humaneval <- function() {\n candidate <- digits\n stopifnot(isTRUE(all.equal(candidate(5), 5)))\n stopifnot(isTRUE(all.equal(candidate(54), 5)))\n stopifnot(isTRUE(all.equal(candidate(120), 1)))\n stopifnot(isTRUE(all.equal(candidate(5014), 5)))\n stopifnot(isTRUE(all.equal(candidate(98765), 315)))\n stopifnot(isTRUE(all.equal(candidate(5576543), 2625)))\n stopifnot(isTRUE(all.equal(candidate(2468), 0)))\n}\ntest_humaneval()"}
|
||
|
{"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# c('Hi', 'my', 'name', 'is', 'John')\n# >>> words_string('One, two, three, four, five, six')\n# c('One', 'two', 'three', 'four', 'five', 'six')\nwords_string <- function(s) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- words_string\n stopifnot(isTRUE(all.equal(candidate('Hi, my name is John'), c('Hi', 'my', 'name', 'is', 'John'))))\n stopifnot(isTRUE(all.equal(candidate('One, two, three, four, five, six'), c('One', 'two', 'three', 'four', 'five', 'six'))))\n stopifnot(isTRUE(all.equal(candidate('Hi, my name'), c('Hi', 'my', 'name'))))\n stopifnot(isTRUE(all.equal(candidate('One,, two, three, four, five, six,'), c('One', 'two', 'three', 'four', 'five', 'six'))))\n stopifnot(isTRUE(all.equal(candidate(''), c())))\n stopifnot(isTRUE(all.equal(candidate('ahmed , gamal'), c('ahmed', 'gamal'))))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_101_words_string", "test": "test_humaneval <- function() {\n candidate <- words_string\n stopifnot(isTRUE(all.equal(candidate('Hi, my name is John'), c('Hi', 'my', 'name', 'is', 'John'))))\n stopifnot(isTRUE(all.equal(candidate('One, two, three, four, five, six'), c('One', 'two', 'three', 'four', 'five', 'six'))))\n stopifnot(isTRUE(all.equal(candidate('Hi, my name'), c('Hi', 'my', 'name'))))\n stopifnot(isTRUE(all.equal(candidate('One,, two, three, four, five, six,'), c('One', 'two', 'three', 'four', 'five', 'six'))))\n stopifnot(isTRUE(all.equal(candidate(''), c())))\n stopifnot(isTRUE(all.equal(candidate('ahmed , gamal'), c('ahmed', 'gamal'))))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- how_many_times\n stopifnot(isTRUE(all.equal(candidate('', 'x'), 0)))\n stopifnot(isTRUE(all.equal(candidate('xyxyxyx', 'x'), 4)))\n stopifnot(isTRUE(all.equal(candidate('cacacacac', 'cac'), 4)))\n stopifnot(isTRUE(all.equal(candidate('john doe', 'john'), 1)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_18_how_many_times", "test": "test_humaneval <- function() {\n candidate <- how_many_times\n stopifnot(isTRUE(all.equal(candidate('', 'x'), 0)))\n stopifnot(isTRUE(all.equal(candidate('xyxyxyx', 'x'), 4)))\n stopifnot(isTRUE(all.equal(candidate('cacacacac', 'cac'), 4)))\n stopifnot(isTRUE(all.equal(candidate('john doe', 'john'), 1)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_137_compare_one.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- compare_one\n stopifnot(isTRUE(all.equal(candidate(1, 2), 2)))\n stopifnot(isTRUE(all.equal(candidate(1, 2.5), 2.5)))\n stopifnot(isTRUE(all.equal(candidate(2, 3), 3)))\n stopifnot(isTRUE(all.equal(candidate(5, 6), 6)))\n stopifnot(isTRUE(all.equal(candidate(1, '2,3'), '2,3')))\n stopifnot(isTRUE(all.equal(candidate('5,1', '6'), '6')))\n stopifnot(isTRUE(all.equal(candidate('1', '2'), '2')))\n stopifnot(isTRUE(all.equal(candidate('1', 1), NULL)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_137_compare_one", "test": "test_humaneval <- function() {\n candidate <- compare_one\n stopifnot(isTRUE(all.equal(candidate(1, 2), 2)))\n stopifnot(isTRUE(all.equal(candidate(1, 2.5), 2.5)))\n stopifnot(isTRUE(all.equal(candidate(2, 3), 3)))\n stopifnot(isTRUE(all.equal(candidate(5, 6), 6)))\n stopifnot(isTRUE(all.equal(candidate(1, '2,3'), '2,3')))\n stopifnot(isTRUE(all.equal(candidate('5,1', '6'), '6')))\n stopifnot(isTRUE(all.equal(candidate('1', '2'), '2')))\n stopifnot(isTRUE(all.equal(candidate('1', 1), NULL)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- remove_vowels\n stopifnot(isTRUE(all.equal(candidate(''), '')))\n stopifnot(isTRUE(all.equal(candidate('abcdef\\nghijklm'), 'bcdf\\nghjklm')))\n stopifnot(isTRUE(all.equal(candidate('fedcba'), 'fdcb')))\n stopifnot(isTRUE(all.equal(candidate('eeeee'), '')))\n stopifnot(isTRUE(all.equal(candidate('acBAA'), 'cB')))\n stopifnot(isTRUE(all.equal(candidate('EcBOO'), 'cB')))\n stopifnot(isTRUE(all.equal(candidate('ybcd'), 'ybcd')))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_51_remove_vowels", "test": "test_humaneval <- function() {\n candidate <- remove_vowels\n stopifnot(isTRUE(all.equal(candidate(''), '')))\n stopifnot(isTRUE(all.equal(candidate('abcdef\\nghijklm'), 'bcdf\\nghjklm')))\n stopifnot(isTRUE(all.equal(candidate('fedcba'), 'fdcb')))\n stopifnot(isTRUE(all.equal(candidate('eeeee'), '')))\n stopifnot(isTRUE(all.equal(candidate('acBAA'), 'cB')))\n stopifnot(isTRUE(all.equal(candidate('EcBOO'), 'cB')))\n stopifnot(isTRUE(all.equal(candidate('ybcd'), 'ybcd')))\n}\ntest_humaneval()"}
|
||
|
{"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# c(1, 4, 2, 3)\n# >>> strange_sort_list(c(5, 5, 5, 5))\n# c(5, 5, 5, 5)\n# >>> strange_sort_list(c())\n# c()\nstrange_sort_list <- function(lst) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- strange_sort_list\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 4)), c(1, 4, 2, 3))))\n stopifnot(isTRUE(all.equal(candidate(c(5, 6, 7, 8, 9)), c(5, 9, 6, 8, 7))))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 4, 5)), c(1, 5, 2, 4, 3))))\n stopifnot(isTRUE(all.equal(candidate(c(5, 6, 7, 8, 9, 1)), c(1, 9, 5, 8, 6, 7))))\n stopifnot(isTRUE(all.equal(candidate(c(5, 5, 5, 5)), c(5, 5, 5, 5))))\n stopifnot(isTRUE(all.equal(candidate(c()), c())))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 4, 5, 6, 7, 8)), c(1, 8, 2, 7, 3, 6, 4, 5))))\n stopifnot(isTRUE(all.equal(candidate(c(0, 2, 2, 2, 5, 5, -5, -5)), c(-5, 5, -5, 5, 0, 2, 2, 2))))\n stopifnot(isTRUE(all.equal(candidate(c(111111)), c(111111))))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_70_strange_sort_list", "test": "test_humaneval <- function() {\n candidate <- strange_sort_list\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 4)), c(1, 4, 2, 3))))\n stopifnot(isTRUE(all.equal(candidate(c(5, 6, 7, 8, 9)), c(5, 9, 6, 8, 7))))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 4, 5)), c(1, 5, 2, 4, 3))))\n stopifnot(isTRUE(all.equal(candidate(c(5, 6, 7, 8, 9, 1)), c(1, 9, 5, 8, 6, 7))))\n stopifnot(isTRUE(all.equal(candidate(c(5, 5, 5, 5)), c(5, 5, 5, 5))))\n stopifnot(isTRUE(all.equal(candidate(c()), c())))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 4, 5, 6, 7, 8)), c(1, 8, 2, 7, 3, 6, 4, 5))))\n stopifnot(isTRUE(all.equal(candidate(c(0, 2, 2, 2, 5, 5, -5, -5)), c(-5, 5, -5, 5, 0, 2, 2, 2))))\n stopifnot(isTRUE(all.equal(candidate(c(111111)), c(111111))))\n}\ntest_humaneval()"}
|
||
|
{"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# c(2.0, 2.2)\n# >>> find_closest_elements(c(1.0, 2.0, 3.0, 4.0, 5.0, 2.0))\n# c(2.0, 2.0)\nfind_closest_elements <- function(numbers) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- find_closest_elements\n stopifnot(isTRUE(all.equal(candidate(c(1.0, 2.0, 3.9, 4.0, 5.0, 2.2)), c(3.9, 4.0))))\n stopifnot(isTRUE(all.equal(candidate(c(1.0, 2.0, 5.9, 4.0, 5.0)), c(5.0, 5.9))))\n stopifnot(isTRUE(all.equal(candidate(c(1.0, 2.0, 3.0, 4.0, 5.0, 2.2)), c(2.0, 2.2))))\n stopifnot(isTRUE(all.equal(candidate(c(1.0, 2.0, 3.0, 4.0, 5.0, 2.0)), c(2.0, 2.0))))\n stopifnot(isTRUE(all.equal(candidate(c(1.1, 2.2, 3.1, 4.1, 5.1)), c(2.2, 3.1))))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_20_find_closest_elements", "test": "test_humaneval <- function() {\n candidate <- find_closest_elements\n stopifnot(isTRUE(all.equal(candidate(c(1.0, 2.0, 3.9, 4.0, 5.0, 2.2)), c(3.9, 4.0))))\n stopifnot(isTRUE(all.equal(candidate(c(1.0, 2.0, 5.9, 4.0, 5.0)), c(5.0, 5.9))))\n stopifnot(isTRUE(all.equal(candidate(c(1.0, 2.0, 3.0, 4.0, 5.0, 2.2)), c(2.0, 2.2))))\n stopifnot(isTRUE(all.equal(candidate(c(1.0, 2.0, 3.0, 4.0, 5.0, 2.0)), c(2.0, 2.0))))\n stopifnot(isTRUE(all.equal(candidate(c(1.1, 2.2, 3.1, 4.1, 5.1)), c(2.2, 3.1))))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- is_simple_power\n stopifnot(isTRUE(all.equal(candidate(16, 2), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(143214, 16), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(4, 2), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(9, 3), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(16, 4), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(24, 2), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(128, 4), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(12, 6), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(1, 1), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(1, 12), TRUE)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_76_is_simple_power", "test": "test_humaneval <- function() {\n candidate <- is_simple_power\n stopifnot(isTRUE(all.equal(candidate(16, 2), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(143214, 16), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(4, 2), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(9, 3), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(16, 4), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(24, 2), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(128, 4), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(12, 6), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(1, 1), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(1, 12), TRUE)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- prime_fib\n stopifnot(isTRUE(all.equal(candidate(1), 2)))\n stopifnot(isTRUE(all.equal(candidate(2), 3)))\n stopifnot(isTRUE(all.equal(candidate(3), 5)))\n stopifnot(isTRUE(all.equal(candidate(4), 13)))\n stopifnot(isTRUE(all.equal(candidate(5), 89)))\n stopifnot(isTRUE(all.equal(candidate(6), 233)))\n stopifnot(isTRUE(all.equal(candidate(7), 1597)))\n stopifnot(isTRUE(all.equal(candidate(8), 28657)))\n stopifnot(isTRUE(all.equal(candidate(9), 514229)))\n stopifnot(isTRUE(all.equal(candidate(10), 433494437)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_39_prime_fib", "test": "test_humaneval <- function() {\n candidate <- prime_fib\n stopifnot(isTRUE(all.equal(candidate(1), 2)))\n stopifnot(isTRUE(all.equal(candidate(2), 3)))\n stopifnot(isTRUE(all.equal(candidate(3), 5)))\n stopifnot(isTRUE(all.equal(candidate(4), 13)))\n stopifnot(isTRUE(all.equal(candidate(5), 89)))\n stopifnot(isTRUE(all.equal(candidate(6), 233)))\n stopifnot(isTRUE(all.equal(candidate(7), 1597)))\n stopifnot(isTRUE(all.equal(candidate(8), 28657)))\n stopifnot(isTRUE(all.equal(candidate(9), 514229)))\n stopifnot(isTRUE(all.equal(candidate(10), 433494437)))\n}\ntest_humaneval()"}
|
||
|
{"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# c(-1, -11, 1, -12, 11)\n# >>> order_by_points(c())\n# c()\norder_by_points <- function(nums) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- order_by_points\n stopifnot(isTRUE(all.equal(candidate(c(1, 11, -1, -11, -12)), c(-1, -11, 1, -12, 11))))\n stopifnot(isTRUE(all.equal(candidate(c(1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46)), c(0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457))))\n stopifnot(isTRUE(all.equal(candidate(c()), c())))\n stopifnot(isTRUE(all.equal(candidate(c(1, -11, -32, 43, 54, -98, 2, -3)), c(-3, -32, -98, -11, 1, 2, 43, 54))))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)), c(1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9))))\n stopifnot(isTRUE(all.equal(candidate(c(0, 6, 6, -76, -21, 23, 4)), c(-76, -21, 0, 4, 23, 6, 6))))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_145_order_by_points", "test": "test_humaneval <- function() {\n candidate <- order_by_points\n stopifnot(isTRUE(all.equal(candidate(c(1, 11, -1, -11, -12)), c(-1, -11, 1, -12, 11))))\n stopifnot(isTRUE(all.equal(candidate(c(1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46)), c(0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457))))\n stopifnot(isTRUE(all.equal(candidate(c()), c())))\n stopifnot(isTRUE(all.equal(candidate(c(1, -11, -32, 43, 54, -98, 2, -3)), c(-3, -32, -98, -11, 1, 2, 43, 54))))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)), c(1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9))))\n stopifnot(isTRUE(all.equal(candidate(c(0, 6, 6, -76, -21, 23, 4)), c(-76, -21, 0, 4, 23, 6, 6))))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- has_close_elements\n stopifnot(isTRUE(all.equal(candidate(c(1.0, 2.0, 3.9, 4.0, 5.0, 2.2), 0.3), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1.0, 2.0, 3.9, 4.0, 5.0, 2.2), 0.05), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(1.0, 2.0, 5.9, 4.0, 5.0), 0.95), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1.0, 2.0, 5.9, 4.0, 5.0), 0.8), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(1.0, 2.0, 3.0, 4.0, 5.0, 2.0), 0.1), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1.1, 2.2, 3.1, 4.1, 5.1), 1.0), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1.1, 2.2, 3.1, 4.1, 5.1), 0.5), FALSE)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_0_has_close_elements", "test": "test_humaneval <- function() {\n candidate <- has_close_elements\n stopifnot(isTRUE(all.equal(candidate(c(1.0, 2.0, 3.9, 4.0, 5.0, 2.2), 0.3), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1.0, 2.0, 3.9, 4.0, 5.0, 2.2), 0.05), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(1.0, 2.0, 5.9, 4.0, 5.0), 0.95), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1.0, 2.0, 5.9, 4.0, 5.0), 0.8), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(1.0, 2.0, 3.0, 4.0, 5.0, 2.0), 0.1), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1.1, 2.2, 3.1, 4.1, 5.1), 1.0), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1.1, 2.2, 3.1, 4.1, 5.1), 0.5), FALSE)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- make_palindrome\n stopifnot(isTRUE(all.equal(candidate(''), '')))\n stopifnot(isTRUE(all.equal(candidate('x'), 'x')))\n stopifnot(isTRUE(all.equal(candidate('xyz'), 'xyzyx')))\n stopifnot(isTRUE(all.equal(candidate('xyx'), 'xyx')))\n stopifnot(isTRUE(all.equal(candidate('jerry'), 'jerryrrej')))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_10_make_palindrome", "test": "test_humaneval <- function() {\n candidate <- make_palindrome\n stopifnot(isTRUE(all.equal(candidate(''), '')))\n stopifnot(isTRUE(all.equal(candidate('x'), 'x')))\n stopifnot(isTRUE(all.equal(candidate('xyz'), 'xyzyx')))\n stopifnot(isTRUE(all.equal(candidate('xyx'), 'xyx')))\n stopifnot(isTRUE(all.equal(candidate('jerry'), 'jerryrrej')))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- string_xor\n stopifnot(isTRUE(all.equal(candidate('111000', '101010'), '010010')))\n stopifnot(isTRUE(all.equal(candidate('1', '1'), '0')))\n stopifnot(isTRUE(all.equal(candidate('0101', '0000'), '0101')))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_11_string_xor", "test": "test_humaneval <- function() {\n candidate <- string_xor\n stopifnot(isTRUE(all.equal(candidate('111000', '101010'), '010010')))\n stopifnot(isTRUE(all.equal(candidate('1', '1'), '0')))\n stopifnot(isTRUE(all.equal(candidate('0101', '0000'), '0101')))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- special_factorial\n stopifnot(isTRUE(all.equal(candidate(4), 288)))\n stopifnot(isTRUE(all.equal(candidate(5), 34560)))\n stopifnot(isTRUE(all.equal(candidate(7), 125411328000)))\n stopifnot(isTRUE(all.equal(candidate(1), 1)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_139_special_factorial", "test": "test_humaneval <- function() {\n candidate <- special_factorial\n stopifnot(isTRUE(all.equal(candidate(4), 288)))\n stopifnot(isTRUE(all.equal(candidate(5), 34560)))\n stopifnot(isTRUE(all.equal(candidate(7), 125411328000)))\n stopifnot(isTRUE(all.equal(candidate(1), 1)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- add_elements\n stopifnot(isTRUE(all.equal(candidate(c(1, -2, -3, 41, 57, 76, 87, 88, 99), 3), -4)))\n stopifnot(isTRUE(all.equal(candidate(c(111, 121, 3, 4000, 5, 6), 2), 0)))\n stopifnot(isTRUE(all.equal(candidate(c(11, 21, 3, 90, 5, 6, 7, 8, 9), 4), 125)))\n stopifnot(isTRUE(all.equal(candidate(c(111, 21, 3, 4000, 5, 6, 7, 8, 9), 4), 24)))\n stopifnot(isTRUE(all.equal(candidate(c(1), 1), 1)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_122_add_elements", "test": "test_humaneval <- function() {\n candidate <- add_elements\n stopifnot(isTRUE(all.equal(candidate(c(1, -2, -3, 41, 57, 76, 87, 88, 99), 3), -4)))\n stopifnot(isTRUE(all.equal(candidate(c(111, 121, 3, 4000, 5, 6), 2), 0)))\n stopifnot(isTRUE(all.equal(candidate(c(11, 21, 3, 90, 5, 6, 7, 8, 9), 4), 125)))\n stopifnot(isTRUE(all.equal(candidate(c(111, 21, 3, 4000, 5, 6, 7, 8, 9), 4), 24)))\n stopifnot(isTRUE(all.equal(candidate(c(1), 1), 1)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- fib4\n stopifnot(isTRUE(all.equal(candidate(5), 4)))\n stopifnot(isTRUE(all.equal(candidate(8), 28)))\n stopifnot(isTRUE(all.equal(candidate(10), 104)))\n stopifnot(isTRUE(all.equal(candidate(12), 386)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_46_fib4", "test": "test_humaneval <- function() {\n candidate <- fib4\n stopifnot(isTRUE(all.equal(candidate(5), 4)))\n stopifnot(isTRUE(all.equal(candidate(8), 28)))\n stopifnot(isTRUE(all.equal(candidate(10), 104)))\n stopifnot(isTRUE(all.equal(candidate(12), 386)))\n}\ntest_humaneval()"}
|
||
|
{"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# c(1, 15, 33)\n# >>> unique_digits(c(152, 323, 1422, 10))\n# c()\nunique_digits <- function(x) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_104_unique_digits.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- unique_digits\n stopifnot(isTRUE(all.equal(candidate(c(15, 33, 1422, 1)), c(1, 15, 33))))\n stopifnot(isTRUE(all.equal(candidate(c(152, 323, 1422, 10)), c())))\n stopifnot(isTRUE(all.equal(candidate(c(12345, 2033, 111, 151)), c(111, 151))))\n stopifnot(isTRUE(all.equal(candidate(c(135, 103, 31)), c(31, 135))))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_104_unique_digits", "test": "test_humaneval <- function() {\n candidate <- unique_digits\n stopifnot(isTRUE(all.equal(candidate(c(15, 33, 1422, 1)), c(1, 15, 33))))\n stopifnot(isTRUE(all.equal(candidate(c(152, 323, 1422, 10)), c())))\n stopifnot(isTRUE(all.equal(candidate(c(12345, 2033, 111, 151)), c(111, 151))))\n stopifnot(isTRUE(all.equal(candidate(c(135, 103, 31)), c(31, 135))))\n}\ntest_humaneval()"}
|
||
|
{"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# c('little')\n# >>> select_words('Mary had a little lamb', 3)\n# c('Mary', 'lamb')\n# >>> select_words('simple white space', 2)\n# c()\n# >>> select_words('Hello world', 4)\n# c('world')\n# >>> select_words('Uncle sam', 3)\n# c('Uncle')\nselect_words <- function(s, n) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- select_words\n stopifnot(isTRUE(all.equal(candidate('Mary had a little lamb', 4), c('little'))))\n stopifnot(isTRUE(all.equal(candidate('Mary had a little lamb', 3), c('Mary', 'lamb'))))\n stopifnot(isTRUE(all.equal(candidate('simple white space', 2), c())))\n stopifnot(isTRUE(all.equal(candidate('Hello world', 4), c('world'))))\n stopifnot(isTRUE(all.equal(candidate('Uncle sam', 3), c('Uncle'))))\n stopifnot(isTRUE(all.equal(candidate('', 4), c())))\n stopifnot(isTRUE(all.equal(candidate('a b c d e f', 1), c('b', 'c', 'd', 'f'))))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_117_select_words", "test": "test_humaneval <- function() {\n candidate <- select_words\n stopifnot(isTRUE(all.equal(candidate('Mary had a little lamb', 4), c('little'))))\n stopifnot(isTRUE(all.equal(candidate('Mary had a little lamb', 3), c('Mary', 'lamb'))))\n stopifnot(isTRUE(all.equal(candidate('simple white space', 2), c())))\n stopifnot(isTRUE(all.equal(candidate('Hello world', 4), c('world'))))\n stopifnot(isTRUE(all.equal(candidate('Uncle sam', 3), c('Uncle'))))\n stopifnot(isTRUE(all.equal(candidate('', 4), c())))\n stopifnot(isTRUE(all.equal(candidate('a b c d e f', 1), c('b', 'c', 'd', 'f'))))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- will_it_fly\n stopifnot(isTRUE(all.equal(candidate(c(3, 2, 3), 9), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2), 5), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(3), 5), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(3, 2, 3), 1), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3), 6), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(5), 5), TRUE)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_72_will_it_fly", "test": "test_humaneval <- function() {\n candidate <- will_it_fly\n stopifnot(isTRUE(all.equal(candidate(c(3, 2, 3), 9), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2), 5), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(3), 5), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(3, 2, 3), 1), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3), 6), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(5), 5), TRUE)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- fib\n stopifnot(isTRUE(all.equal(candidate(10), 55)))\n stopifnot(isTRUE(all.equal(candidate(1), 1)))\n stopifnot(isTRUE(all.equal(candidate(8), 21)))\n stopifnot(isTRUE(all.equal(candidate(11), 89)))\n stopifnot(isTRUE(all.equal(candidate(12), 144)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_55_fib", "test": "test_humaneval <- function() {\n candidate <- fib\n stopifnot(isTRUE(all.equal(candidate(10), 55)))\n stopifnot(isTRUE(all.equal(candidate(1), 1)))\n stopifnot(isTRUE(all.equal(candidate(8), 21)))\n stopifnot(isTRUE(all.equal(candidate(11), 89)))\n stopifnot(isTRUE(all.equal(candidate(12), 144)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- Strongest_Extension\n stopifnot(isTRUE(all.equal(candidate('Watashi', c('tEN', 'niNE', 'eIGHt8OKe')), 'Watashi.eIGHt8OKe')))\n stopifnot(isTRUE(all.equal(candidate('Boku123', c('nani', 'NazeDa', 'YEs.WeCaNe', '32145tggg')), 'Boku123.YEs.WeCaNe')))\n stopifnot(isTRUE(all.equal(candidate('__YESIMHERE', c('t', 'eMptY', 'nothing', 'zeR00', 'NuLl__', '123NoooneB321')), '__YESIMHERE.NuLl__')))\n stopifnot(isTRUE(all.equal(candidate('K', c('Ta', 'TAR', 't234An', 'cosSo')), 'K.TAR')))\n stopifnot(isTRUE(all.equal(candidate('__HAHA', c('Tab', '123', '781345', '-_-')), '__HAHA.123')))\n stopifnot(isTRUE(all.equal(candidate('YameRore', c('HhAas', 'okIWILL123', 'WorkOut', 'Fails', '-_-')), 'YameRore.okIWILL123')))\n stopifnot(isTRUE(all.equal(candidate('finNNalLLly', c('Die', 'NowW', 'Wow', 'WoW')), 'finNNalLLly.WoW')))\n stopifnot(isTRUE(all.equal(candidate('_', c('Bb', '91245')), '_.Bb')))\n stopifnot(isTRUE(all.equal(candidate('Sp', c('671235', 'Bb')), 'Sp.671235')))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_153_Strongest_Extension", "test": "test_humaneval <- function() {\n candidate <- Strongest_Extension\n stopifnot(isTRUE(all.equal(candidate('Watashi', c('tEN', 'niNE', 'eIGHt8OKe')), 'Watashi.eIGHt8OKe')))\n stopifnot(isTRUE(all.equal(candidate('Boku123', c('nani', 'NazeDa', 'YEs.WeCaNe', '32145tggg')), 'Boku123.YEs.WeCaNe')))\n stopifnot(isTRUE(all.equal(candidate('__YESIMHERE', c('t', 'eMptY', 'nothing', 'zeR00', 'NuLl__', '123NoooneB321')), '__YESIMHERE.NuLl__')))\n stopifnot(isTRUE(all.equal(candidate('K', c('Ta', 'TAR', 't234An', 'cosSo')), 'K.TAR')))\n stopifnot(isTRUE(all.equal(candidate('__HAHA', c('Tab', '123', '781345', '-_-')), '__HAHA.123')))\n stopifnot(isTRUE(all.equal(candidate('YameRore', c('HhAas', 'okIWILL123', 'WorkOut', 'Fails', '-_-')), 'YameRore.okIWILL123')))\n stopifnot(isTRUE(all.equal(candidate('finNNalLLly', c('Die', 'NowW', 'Wow', 'WoW')), 'finNNalLLly.WoW')))\n stopifnot(isTRUE(all.equal(candidate('_', c('Bb', '91245')), '_.Bb')))\n stopifnot(isTRUE(all.equal(candidate('Sp', c('671235', 'Bb')), 'Sp.671235')))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- match_parens\n stopifnot(isTRUE(all.equal(candidate(c('()(', ')')), 'Yes')))\n stopifnot(isTRUE(all.equal(candidate(c(')', ')')), 'No')))\n stopifnot(isTRUE(all.equal(candidate(c('(()(())', '())())')), 'No')))\n stopifnot(isTRUE(all.equal(candidate(c(')())', '(()()(')), 'Yes')))\n stopifnot(isTRUE(all.equal(candidate(c('(())))', '(()())((')), 'Yes')))\n stopifnot(isTRUE(all.equal(candidate(c('()', '())')), 'No')))\n stopifnot(isTRUE(all.equal(candidate(c('(()(', '()))()')), 'Yes')))\n stopifnot(isTRUE(all.equal(candidate(c('((((', '((())')), 'No')))\n stopifnot(isTRUE(all.equal(candidate(c(')(()', '(()(')), 'No')))\n stopifnot(isTRUE(all.equal(candidate(c(')(', ')(')), 'No')))\n stopifnot(isTRUE(all.equal(candidate(c('(', ')')), 'Yes')))\n stopifnot(isTRUE(all.equal(candidate(c(')', '(')), 'Yes')))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_119_match_parens", "test": "test_humaneval <- function() {\n candidate <- match_parens\n stopifnot(isTRUE(all.equal(candidate(c('()(', ')')), 'Yes')))\n stopifnot(isTRUE(all.equal(candidate(c(')', ')')), 'No')))\n stopifnot(isTRUE(all.equal(candidate(c('(()(())', '())())')), 'No')))\n stopifnot(isTRUE(all.equal(candidate(c(')())', '(()()(')), 'Yes')))\n stopifnot(isTRUE(all.equal(candidate(c('(())))', '(()())((')), 'Yes')))\n stopifnot(isTRUE(all.equal(candidate(c('()', '())')), 'No')))\n stopifnot(isTRUE(all.equal(candidate(c('(()(', '()))()')), 'Yes')))\n stopifnot(isTRUE(all.equal(candidate(c('((((', '((())')), 'No')))\n stopifnot(isTRUE(all.equal(candidate(c(')(()', '(()(')), 'No')))\n stopifnot(isTRUE(all.equal(candidate(c(')(', ')(')), 'No')))\n stopifnot(isTRUE(all.equal(candidate(c('(', ')')), 'Yes')))\n stopifnot(isTRUE(all.equal(candidate(c(')', '(')), 'Yes')))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- next_smallest\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 4, 5)), 2)))\n stopifnot(isTRUE(all.equal(candidate(c(5, 1, 4, 3, 2)), 2)))\n stopifnot(isTRUE(all.equal(candidate(c()), NULL)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 1)), NULL)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 1, 1, 1, 0)), 1)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 1)), NULL)))\n stopifnot(isTRUE(all.equal(candidate(c(-35, 34, 12, -45)), -35)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_90_next_smallest", "test": "test_humaneval <- function() {\n candidate <- next_smallest\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 4, 5)), 2)))\n stopifnot(isTRUE(all.equal(candidate(c(5, 1, 4, 3, 2)), 2)))\n stopifnot(isTRUE(all.equal(candidate(c()), NULL)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 1)), NULL)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 1, 1, 1, 0)), 1)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 1)), NULL)))\n stopifnot(isTRUE(all.equal(candidate(c(-35, 34, 12, -45)), -35)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- any_int\n stopifnot(isTRUE(all.equal(candidate(2, 3, 1), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(2.5, 2, 3), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(1.5, 5, 3.5), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(2, 6, 2), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(4, 2, 2), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(2.2, 2.2, 2.2), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(-4, 6, 2), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(2, 1, 1), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(3, 4, 7), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(3.0, 4, 7), FALSE)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_92_any_int", "test": "test_humaneval <- function() {\n candidate <- any_int\n stopifnot(isTRUE(all.equal(candidate(2, 3, 1), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(2.5, 2, 3), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(1.5, 5, 3.5), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(2, 6, 2), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(4, 2, 2), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(2.2, 2.2, 2.2), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(-4, 6, 2), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(2, 1, 1), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(3, 4, 7), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(3.0, 4, 7), FALSE)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- truncate_number\n stopifnot(isTRUE(all.equal(candidate(3.5), 0.5)))\n stopifnot(isTRUE(all.equal(candidate(1.25), 0.25)))\n stopifnot(isTRUE(all.equal(candidate(123.0), 0.0)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_2_truncate_number", "test": "test_humaneval <- function() {\n candidate <- truncate_number\n stopifnot(isTRUE(all.equal(candidate(3.5), 0.5)))\n stopifnot(isTRUE(all.equal(candidate(1.25), 0.25)))\n stopifnot(isTRUE(all.equal(candidate(123.0), 0.0)))\n}\ntest_humaneval()"}
|
||
|
{"name": "HumanEval_42_incr_list", "language": "r", "prompt": "# Return list with elements incremented by 1.\n# >>> incr_list(c(1, 2, 3))\n# c(2, 3, 4)\n# >>> incr_list(c(5, 3, 5, 2, 3, 3, 9, 0, 123))\n# c(6, 4, 6, 3, 4, 4, 10, 1, 124)\nincr_list <- function(l) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- incr_list\n stopifnot(isTRUE(all.equal(candidate(c()), c())))\n stopifnot(isTRUE(all.equal(candidate(c(3, 2, 1)), c(4, 3, 2))))\n stopifnot(isTRUE(all.equal(candidate(c(5, 2, 5, 2, 3, 3, 9, 0, 123)), c(6, 3, 6, 3, 4, 4, 10, 1, 124))))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_42_incr_list", "test": "test_humaneval <- function() {\n candidate <- incr_list\n stopifnot(isTRUE(all.equal(candidate(c()), c())))\n stopifnot(isTRUE(all.equal(candidate(c(3, 2, 1)), c(4, 3, 2))))\n stopifnot(isTRUE(all.equal(candidate(c(5, 2, 5, 2, 3, 3, 9, 0, 123)), c(6, 3, 6, 3, 4, 4, 10, 1, 124))))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- x_or_y\n stopifnot(isTRUE(all.equal(candidate(7, 34, 12), 34)))\n stopifnot(isTRUE(all.equal(candidate(15, 8, 5), 5)))\n stopifnot(isTRUE(all.equal(candidate(3, 33, 5212), 33)))\n stopifnot(isTRUE(all.equal(candidate(1259, 3, 52), 3)))\n stopifnot(isTRUE(all.equal(candidate(7919, -1, 12), -1)))\n stopifnot(isTRUE(all.equal(candidate(3609, 1245, 583), 583)))\n stopifnot(isTRUE(all.equal(candidate(91, 56, 129), 129)))\n stopifnot(isTRUE(all.equal(candidate(6, 34, 1234), 1234)))\n stopifnot(isTRUE(all.equal(candidate(1, 2, 0), 0)))\n stopifnot(isTRUE(all.equal(candidate(2, 2, 0), 2)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_150_x_or_y", "test": "test_humaneval <- function() {\n candidate <- x_or_y\n stopifnot(isTRUE(all.equal(candidate(7, 34, 12), 34)))\n stopifnot(isTRUE(all.equal(candidate(15, 8, 5), 5)))\n stopifnot(isTRUE(all.equal(candidate(3, 33, 5212), 33)))\n stopifnot(isTRUE(all.equal(candidate(1259, 3, 52), 3)))\n stopifnot(isTRUE(all.equal(candidate(7919, -1, 12), -1)))\n stopifnot(isTRUE(all.equal(candidate(3609, 1245, 583), 583)))\n stopifnot(isTRUE(all.equal(candidate(91, 56, 129), 129)))\n stopifnot(isTRUE(all.equal(candidate(6, 34, 1234), 1234)))\n stopifnot(isTRUE(all.equal(candidate(1, 2, 0), 0)))\n stopifnot(isTRUE(all.equal(candidate(2, 2, 0), 2)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- modp\n stopifnot(isTRUE(all.equal(candidate(3, 5), 3)))\n stopifnot(isTRUE(all.equal(candidate(1101, 101), 2)))\n stopifnot(isTRUE(all.equal(candidate(0, 101), 1)))\n stopifnot(isTRUE(all.equal(candidate(3, 11), 8)))\n stopifnot(isTRUE(all.equal(candidate(100, 101), 1)))\n stopifnot(isTRUE(all.equal(candidate(30, 5), 4)))\n stopifnot(isTRUE(all.equal(candidate(31, 5), 3)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_49_modp", "test": "test_humaneval <- function() {\n candidate <- modp\n stopifnot(isTRUE(all.equal(candidate(3, 5), 3)))\n stopifnot(isTRUE(all.equal(candidate(1101, 101), 2)))\n stopifnot(isTRUE(all.equal(candidate(0, 101), 1)))\n stopifnot(isTRUE(all.equal(candidate(3, 11), 8)))\n stopifnot(isTRUE(all.equal(candidate(100, 101), 1)))\n stopifnot(isTRUE(all.equal(candidate(30, 5), 4)))\n stopifnot(isTRUE(all.equal(candidate(31, 5), 3)))\n}\ntest_humaneval()"}
|
||
|
{"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# c(1, 1)\n# >>> even_odd_count(123)\n# c(1, 2)\neven_odd_count <- function(num) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- even_odd_count\n stopifnot(isTRUE(all.equal(candidate(7), c(0, 1))))\n stopifnot(isTRUE(all.equal(candidate(-78), c(1, 1))))\n stopifnot(isTRUE(all.equal(candidate(3452), c(2, 2))))\n stopifnot(isTRUE(all.equal(candidate(346211), c(3, 3))))\n stopifnot(isTRUE(all.equal(candidate(-345821), c(3, 3))))\n stopifnot(isTRUE(all.equal(candidate(-2), c(1, 0))))\n stopifnot(isTRUE(all.equal(candidate(-45347), c(2, 3))))\n stopifnot(isTRUE(all.equal(candidate(0), c(1, 0))))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_155_even_odd_count", "test": "test_humaneval <- function() {\n candidate <- even_odd_count\n stopifnot(isTRUE(all.equal(candidate(7), c(0, 1))))\n stopifnot(isTRUE(all.equal(candidate(-78), c(1, 1))))\n stopifnot(isTRUE(all.equal(candidate(3452), c(2, 2))))\n stopifnot(isTRUE(all.equal(candidate(346211), c(3, 3))))\n stopifnot(isTRUE(all.equal(candidate(-345821), c(3, 3))))\n stopifnot(isTRUE(all.equal(candidate(-2), c(1, 0))))\n stopifnot(isTRUE(all.equal(candidate(-45347), c(2, 3))))\n stopifnot(isTRUE(all.equal(candidate(0), c(1, 0))))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- is_happy\n stopifnot(isTRUE(all.equal(candidate('a'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('aa'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('abcd'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('aabb'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('adb'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('xyy'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('iopaxpoi'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('iopaxioi'), FALSE)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_80_is_happy", "test": "test_humaneval <- function() {\n candidate <- is_happy\n stopifnot(isTRUE(all.equal(candidate('a'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('aa'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('abcd'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('aabb'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('adb'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('xyy'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('iopaxpoi'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('iopaxioi'), FALSE)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- largest_prime_factor\n stopifnot(isTRUE(all.equal(candidate(15), 5)))\n stopifnot(isTRUE(all.equal(candidate(27), 3)))\n stopifnot(isTRUE(all.equal(candidate(63), 7)))\n stopifnot(isTRUE(all.equal(candidate(330), 11)))\n stopifnot(isTRUE(all.equal(candidate(13195), 29)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_59_largest_prime_factor", "test": "test_humaneval <- function() {\n candidate <- largest_prime_factor\n stopifnot(isTRUE(all.equal(candidate(15), 5)))\n stopifnot(isTRUE(all.equal(candidate(27), 3)))\n stopifnot(isTRUE(all.equal(candidate(63), 7)))\n stopifnot(isTRUE(all.equal(candidate(330), 11)))\n stopifnot(isTRUE(all.equal(candidate(13195), 29)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- digitSum\n stopifnot(isTRUE(all.equal(candidate(''), 0)))\n stopifnot(isTRUE(all.equal(candidate('abAB'), 131)))\n stopifnot(isTRUE(all.equal(candidate('abcCd'), 67)))\n stopifnot(isTRUE(all.equal(candidate('helloE'), 69)))\n stopifnot(isTRUE(all.equal(candidate('woArBld'), 131)))\n stopifnot(isTRUE(all.equal(candidate('aAaaaXa'), 153)))\n stopifnot(isTRUE(all.equal(candidate(' How are yOu?'), 151)))\n stopifnot(isTRUE(all.equal(candidate('You arE Very Smart'), 327)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_66_digitSum", "test": "test_humaneval <- function() {\n candidate <- digitSum\n stopifnot(isTRUE(all.equal(candidate(''), 0)))\n stopifnot(isTRUE(all.equal(candidate('abAB'), 131)))\n stopifnot(isTRUE(all.equal(candidate('abcCd'), 67)))\n stopifnot(isTRUE(all.equal(candidate('helloE'), 69)))\n stopifnot(isTRUE(all.equal(candidate('woArBld'), 131)))\n stopifnot(isTRUE(all.equal(candidate('aAaaaXa'), 153)))\n stopifnot(isTRUE(all.equal(candidate(' How are yOu?'), 151)))\n stopifnot(isTRUE(all.equal(candidate('You arE Very Smart'), 327)))\n}\ntest_humaneval()"}
|
||
|
{"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# c(0.0, 0.25, 0.5, 0.75, 1.0)\nrescale_to_unit <- function(numbers) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- rescale_to_unit\n stopifnot(isTRUE(all.equal(candidate(c(2.0, 49.9)), c(0.0, 1.0))))\n stopifnot(isTRUE(all.equal(candidate(c(100.0, 49.9)), c(1.0, 0.0))))\n stopifnot(isTRUE(all.equal(candidate(c(1.0, 2.0, 3.0, 4.0, 5.0)), c(0.0, 0.25, 0.5, 0.75, 1.0))))\n stopifnot(isTRUE(all.equal(candidate(c(2.0, 1.0, 5.0, 3.0, 4.0)), c(0.25, 0.0, 1.0, 0.5, 0.75))))\n stopifnot(isTRUE(all.equal(candidate(c(12.0, 11.0, 15.0, 13.0, 14.0)), c(0.25, 0.0, 1.0, 0.5, 0.75))))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_21_rescale_to_unit", "test": "test_humaneval <- function() {\n candidate <- rescale_to_unit\n stopifnot(isTRUE(all.equal(candidate(c(2.0, 49.9)), c(0.0, 1.0))))\n stopifnot(isTRUE(all.equal(candidate(c(100.0, 49.9)), c(1.0, 0.0))))\n stopifnot(isTRUE(all.equal(candidate(c(1.0, 2.0, 3.0, 4.0, 5.0)), c(0.0, 0.25, 0.5, 0.75, 1.0))))\n stopifnot(isTRUE(all.equal(candidate(c(2.0, 1.0, 5.0, 3.0, 4.0)), c(0.25, 0.0, 1.0, 0.5, 0.75))))\n stopifnot(isTRUE(all.equal(candidate(c(12.0, 11.0, 15.0, 13.0, 14.0)), c(0.25, 0.0, 1.0, 0.5, 0.75))))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- solution\n stopifnot(isTRUE(all.equal(candidate(c(5, 8, 7, 1)), 12)))\n stopifnot(isTRUE(all.equal(candidate(c(3, 3, 3, 3, 3)), 9)))\n stopifnot(isTRUE(all.equal(candidate(c(30, 13, 24, 321)), 0)))\n stopifnot(isTRUE(all.equal(candidate(c(5, 9)), 5)))\n stopifnot(isTRUE(all.equal(candidate(c(2, 4, 8)), 0)))\n stopifnot(isTRUE(all.equal(candidate(c(30, 13, 23, 32)), 23)))\n stopifnot(isTRUE(all.equal(candidate(c(3, 13, 2, 9)), 3)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_121_solution", "test": "test_humaneval <- function() {\n candidate <- solution\n stopifnot(isTRUE(all.equal(candidate(c(5, 8, 7, 1)), 12)))\n stopifnot(isTRUE(all.equal(candidate(c(3, 3, 3, 3, 3)), 9)))\n stopifnot(isTRUE(all.equal(candidate(c(30, 13, 24, 321)), 0)))\n stopifnot(isTRUE(all.equal(candidate(c(5, 9)), 5)))\n stopifnot(isTRUE(all.equal(candidate(c(2, 4, 8)), 0)))\n stopifnot(isTRUE(all.equal(candidate(c(30, 13, 23, 32)), 23)))\n stopifnot(isTRUE(all.equal(candidate(c(3, 13, 2, 9)), 3)))\n}\ntest_humaneval()"}
|
||
|
{"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# c(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# c(2, 1)\n# Explanation: 2 has the smallest even value, and 2 has the smallest index.\n# Example 3:\n# >>> pluck(c())\n# c()\n# Example 4:\n# >>> pluck(c(5, 0, 3, 0, 4, 2))\n# c(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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- pluck\n stopifnot(isTRUE(all.equal(candidate(c(4, 2, 3)), c(2, 1))))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3)), c(2, 1))))\n stopifnot(isTRUE(all.equal(candidate(c()), c())))\n stopifnot(isTRUE(all.equal(candidate(c(5, 0, 3, 0, 4, 2)), c(0, 1))))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 0, 5, 3)), c(0, 3))))\n stopifnot(isTRUE(all.equal(candidate(c(5, 4, 8, 4, 8)), c(4, 1))))\n stopifnot(isTRUE(all.equal(candidate(c(7, 6, 7, 1)), c(6, 1))))\n stopifnot(isTRUE(all.equal(candidate(c(7, 9, 7, 1)), c())))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_68_pluck", "test": "test_humaneval <- function() {\n candidate <- pluck\n stopifnot(isTRUE(all.equal(candidate(c(4, 2, 3)), c(2, 1))))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3)), c(2, 1))))\n stopifnot(isTRUE(all.equal(candidate(c()), c())))\n stopifnot(isTRUE(all.equal(candidate(c(5, 0, 3, 0, 4, 2)), c(0, 1))))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 0, 5, 3)), c(0, 3))))\n stopifnot(isTRUE(all.equal(candidate(c(5, 4, 8, 4, 8)), c(4, 1))))\n stopifnot(isTRUE(all.equal(candidate(c(7, 6, 7, 1)), c(6, 1))))\n stopifnot(isTRUE(all.equal(candidate(c(7, 9, 7, 1)), c())))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- get_max_triples\n stopifnot(isTRUE(all.equal(candidate(5), 1)))\n stopifnot(isTRUE(all.equal(candidate(6), 4)))\n stopifnot(isTRUE(all.equal(candidate(10), 36)))\n stopifnot(isTRUE(all.equal(candidate(100), 53361)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_147_get_max_triples", "test": "test_humaneval <- function() {\n candidate <- get_max_triples\n stopifnot(isTRUE(all.equal(candidate(5), 1)))\n stopifnot(isTRUE(all.equal(candidate(6), 4)))\n stopifnot(isTRUE(all.equal(candidate(10), 36)))\n stopifnot(isTRUE(all.equal(candidate(100), 53361)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- exchange\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 4), c(1, 2, 3, 4)), 'YES')))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 4), c(1, 5, 3, 4)), 'NO')))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 4), c(2, 1, 4, 3)), 'YES')))\n stopifnot(isTRUE(all.equal(candidate(c(5, 7, 3), c(2, 6, 4)), 'YES')))\n stopifnot(isTRUE(all.equal(candidate(c(5, 7, 3), c(2, 6, 3)), 'NO')))\n stopifnot(isTRUE(all.equal(candidate(c(3, 2, 6, 1, 8, 9), c(3, 5, 5, 1, 1, 1)), 'NO')))\n stopifnot(isTRUE(all.equal(candidate(c(100, 200), c(200, 200)), 'YES')))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_110_exchange", "test": "test_humaneval <- function() {\n candidate <- exchange\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 4), c(1, 2, 3, 4)), 'YES')))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 4), c(1, 5, 3, 4)), 'NO')))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 4), c(2, 1, 4, 3)), 'YES')))\n stopifnot(isTRUE(all.equal(candidate(c(5, 7, 3), c(2, 6, 4)), 'YES')))\n stopifnot(isTRUE(all.equal(candidate(c(5, 7, 3), c(2, 6, 3)), 'NO')))\n stopifnot(isTRUE(all.equal(candidate(c(3, 2, 6, 1, 8, 9), c(3, 5, 5, 1, 1, 1)), 'NO')))\n stopifnot(isTRUE(all.equal(candidate(c(100, 200), c(200, 200)), 'YES')))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- median\n stopifnot(isTRUE(all.equal(candidate(c(3, 1, 2, 4, 5)), 3)))\n stopifnot(isTRUE(all.equal(candidate(c(-10, 4, 6, 1000, 10, 20)), 8.0)))\n stopifnot(isTRUE(all.equal(candidate(c(5)), 5)))\n stopifnot(isTRUE(all.equal(candidate(c(6, 5)), 5.5)))\n stopifnot(isTRUE(all.equal(candidate(c(8, 1, 3, 9, 9, 2, 7)), 7)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_47_median", "test": "test_humaneval <- function() {\n candidate <- median\n stopifnot(isTRUE(all.equal(candidate(c(3, 1, 2, 4, 5)), 3)))\n stopifnot(isTRUE(all.equal(candidate(c(-10, 4, 6, 1000, 10, 20)), 8.0)))\n stopifnot(isTRUE(all.equal(candidate(c(5)), 5)))\n stopifnot(isTRUE(all.equal(candidate(c(6, 5)), 5.5)))\n stopifnot(isTRUE(all.equal(candidate(c(8, 1, 3, 9, 9, 2, 7)), 7)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- prime_length\n stopifnot(isTRUE(all.equal(candidate('Hello'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('abcdcba'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('kittens'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('orange'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('wow'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('world'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('MadaM'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('Wow'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(''), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('HI'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('go'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('gogo'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('aaaaaaaaaaaaaaa'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('Madam'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('M'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('0'), FALSE)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_82_prime_length", "test": "test_humaneval <- function() {\n candidate <- prime_length\n stopifnot(isTRUE(all.equal(candidate('Hello'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('abcdcba'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('kittens'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('orange'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('wow'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('world'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('MadaM'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('Wow'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(''), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('HI'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('go'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('gogo'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('aaaaaaaaaaaaaaa'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('Madam'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('M'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('0'), FALSE)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- smallest_change\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 5, 4, 7, 9, 6)), 4)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 4, 3, 2, 2)), 1)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 4, 2)), 1)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 4, 4, 2)), 1)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 2, 1)), 0)))\n stopifnot(isTRUE(all.equal(candidate(c(3, 1, 1, 3)), 0)))\n stopifnot(isTRUE(all.equal(candidate(c(1)), 0)))\n stopifnot(isTRUE(all.equal(candidate(c(0, 1)), 1)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_73_smallest_change", "test": "test_humaneval <- function() {\n candidate <- smallest_change\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 5, 4, 7, 9, 6)), 4)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 4, 3, 2, 2)), 1)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 4, 2)), 1)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 4, 4, 2)), 1)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 2, 1)), 0)))\n stopifnot(isTRUE(all.equal(candidate(c(3, 1, 1, 3)), 0)))\n stopifnot(isTRUE(all.equal(candidate(c(1)), 0)))\n stopifnot(isTRUE(all.equal(candidate(c(0, 1)), 1)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- sum_squares\n stopifnot(isTRUE(all.equal(candidate(c(1.0, 2.0, 3.0)), 14)))\n stopifnot(isTRUE(all.equal(candidate(c(1.0, 2.0, 3.0)), 14)))\n stopifnot(isTRUE(all.equal(candidate(c(1.0, 3.0, 5.0, 7.0)), 84)))\n stopifnot(isTRUE(all.equal(candidate(c(1.4, 4.2, 0.0)), 29)))\n stopifnot(isTRUE(all.equal(candidate(c(-2.4, 1.0, 1.0)), 6)))\n stopifnot(isTRUE(all.equal(candidate(c(100.0, 1.0, 15.0, 2.0)), 10230)))\n stopifnot(isTRUE(all.equal(candidate(c(10000.0, 10000.0)), 200000000)))\n stopifnot(isTRUE(all.equal(candidate(c(-1.4, 4.6, 6.3)), 75)))\n stopifnot(isTRUE(all.equal(candidate(c(-1.4, 17.9, 18.9, 19.9)), 1086)))\n stopifnot(isTRUE(all.equal(candidate(c(0.0)), 0)))\n stopifnot(isTRUE(all.equal(candidate(c(-1.0)), 1)))\n stopifnot(isTRUE(all.equal(candidate(c(-1.0, 1.0, 0.0)), 2)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_133_sum_squares", "test": "test_humaneval <- function() {\n candidate <- sum_squares\n stopifnot(isTRUE(all.equal(candidate(c(1.0, 2.0, 3.0)), 14)))\n stopifnot(isTRUE(all.equal(candidate(c(1.0, 2.0, 3.0)), 14)))\n stopifnot(isTRUE(all.equal(candidate(c(1.0, 3.0, 5.0, 7.0)), 84)))\n stopifnot(isTRUE(all.equal(candidate(c(1.4, 4.2, 0.0)), 29)))\n stopifnot(isTRUE(all.equal(candidate(c(-2.4, 1.0, 1.0)), 6)))\n stopifnot(isTRUE(all.equal(candidate(c(100.0, 1.0, 15.0, 2.0)), 10230)))\n stopifnot(isTRUE(all.equal(candidate(c(10000.0, 10000.0)), 200000000)))\n stopifnot(isTRUE(all.equal(candidate(c(-1.4, 4.6, 6.3)), 75)))\n stopifnot(isTRUE(all.equal(candidate(c(-1.4, 17.9, 18.9, 19.9)), 1086)))\n stopifnot(isTRUE(all.equal(candidate(c(0.0)), 0)))\n stopifnot(isTRUE(all.equal(candidate(c(-1.0)), 1)))\n stopifnot(isTRUE(all.equal(candidate(c(-1.0, 1.0, 0.0)), 2)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- file_name_check\n stopifnot(isTRUE(all.equal(candidate('example.txt'), 'Yes')))\n stopifnot(isTRUE(all.equal(candidate('1example.dll'), 'No')))\n stopifnot(isTRUE(all.equal(candidate('s1sdf3.asd'), 'No')))\n stopifnot(isTRUE(all.equal(candidate('K.dll'), 'Yes')))\n stopifnot(isTRUE(all.equal(candidate('MY16FILE3.exe'), 'Yes')))\n stopifnot(isTRUE(all.equal(candidate('His12FILE94.exe'), 'No')))\n stopifnot(isTRUE(all.equal(candidate('_Y.txt'), 'No')))\n stopifnot(isTRUE(all.equal(candidate('?aREYA.exe'), 'No')))\n stopifnot(isTRUE(all.equal(candidate('/this_is_valid.dll'), 'No')))\n stopifnot(isTRUE(all.equal(candidate('this_is_valid.wow'), 'No')))\n stopifnot(isTRUE(all.equal(candidate('this_is_valid.txt'), 'Yes')))\n stopifnot(isTRUE(all.equal(candidate('this_is_valid.txtexe'), 'No')))\n stopifnot(isTRUE(all.equal(candidate('#this2_i4s_5valid.ten'), 'No')))\n stopifnot(isTRUE(all.equal(candidate('@this1_is6_valid.exe'), 'No')))\n stopifnot(isTRUE(all.equal(candidate('this_is_12valid.6exe4.txt'), 'No')))\n stopifnot(isTRUE(all.equal(candidate('all.exe.txt'), 'No')))\n stopifnot(isTRUE(all.equal(candidate('I563_No.exe'), 'Yes')))\n stopifnot(isTRUE(all.equal(candidate('Is3youfault.txt'), 'Yes')))\n stopifnot(isTRUE(all.equal(candidate('no_one#knows.dll'), 'Yes')))\n stopifnot(isTRUE(all.equal(candidate('1I563_Yes3.exe'), 'No')))\n stopifnot(isTRUE(all.equal(candidate('I563_Yes3.txtt'), 'No')))\n stopifnot(isTRUE(all.equal(candidate('final..txt'), 'No')))\n stopifnot(isTRUE(all.equal(candidate('final132'), 'No')))\n stopifnot(isTRUE(all.equal(candidate('_f4indsartal132.'), 'No')))\n stopifnot(isTRUE(all.equal(candidate('.txt'), 'No')))\n stopifnot(isTRUE(all.equal(candidate('s.'), 'No')))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_141_file_name_check", "test": "test_humaneval <- function() {\n candidate <- file_name_check\n stopifnot(isTRUE(all.equal(candidate('example.txt'), 'Yes')))\n stopifnot(isTRUE(all.equal(candidate('1example.dll'), 'No')))\n stopifnot(isTRUE(all.equal(candidate('s1sdf3.asd'), 'No')))\n stopifnot(isTRUE(all.equal(candidate('K.dll'), 'Yes')))\n stopifnot(isTRUE(all.equal(candidate('MY16FILE3.exe'), 'Yes')))\n stopifnot(isTRUE(all.equal(candidate('His12FILE94.exe'), 'No')))\n stopifnot(isTRUE(all.equal(candidate('_Y.txt'), 'No')))\n stopifnot(isTRUE(all.equal(candidate('?aREYA.exe'), 'No')))\n stopifnot(isTRUE(all.equal(candidate('/this_is_valid.dll'), 'No')))\n stopifnot(isTRUE(all.equal(candidate('this_is_valid.wow'), 'No')))\n stopifnot(isTRUE(all.equal(candidate('this_is_valid.txt'), 'Yes')))\n stopifnot(isTRUE(all.equal(candidate('this_is_valid.txtexe'), 'No')))\n stopifnot(isTRUE(all.equal(candidate('#this2_i4s_5valid.ten'), 'No')))\n stopifnot(isTRUE(all.equal(candidate('@this1_is6_valid.exe'), 'No')))\n stopifnot(isTRUE(all.equal(candidate('this_is_12valid.6exe4.txt'), 'No')))\n stopifn
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- triples_sum_to_zero\n stopifnot(isTRUE(all.equal(candidate(c(1, 3, 5, 0)), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 3, 5, -1)), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 3, -2, 1)), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 7)), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 5, 7)), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(2, 4, -5, 3, 9, 7)), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1)), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 3, 5, -100)), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(100, 3, 5, -100)), FALSE)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_40_triples_sum_to_zero", "test": "test_humaneval <- function() {\n candidate <- triples_sum_to_zero\n stopifnot(isTRUE(all.equal(candidate(c(1, 3, 5, 0)), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 3, 5, -1)), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 3, -2, 1)), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 7)), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 5, 7)), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(2, 4, -5, 3, 9, 7)), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1)), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 3, 5, -100)), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(100, 3, 5, -100)), FALSE)))\n}\ntest_humaneval()"}
|
||
|
{"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(c(1, 2), c(2, 3))\n# 'NO'\n# >>> intersection(c(-1, 1), c(0, 4))\n# 'NO'\n# >>> intersection(c(-3, -1), c(-5, 5))\n# 'YES'\nintersection <- function(interval1, interval2) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- intersection\n stopifnot(isTRUE(all.equal(candidate(c(1, 2), c(2, 3)), 'NO')))\n stopifnot(isTRUE(all.equal(candidate(c(-1, 1), c(0, 4)), 'NO')))\n stopifnot(isTRUE(all.equal(candidate(c(-3, -1), c(-5, 5)), 'YES')))\n stopifnot(isTRUE(all.equal(candidate(c(-2, 2), c(-4, 0)), 'YES')))\n stopifnot(isTRUE(all.equal(candidate(c(-11, 2), c(-1, -1)), 'NO')))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2), c(3, 5)), 'NO')))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2), c(1, 2)), 'NO')))\n stopifnot(isTRUE(all.equal(candidate(c(-2, -2), c(-3, -2)), 'NO')))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_127_intersection", "test": "test_humaneval <- function() {\n candidate <- intersection\n stopifnot(isTRUE(all.equal(candidate(c(1, 2), c(2, 3)), 'NO')))\n stopifnot(isTRUE(all.equal(candidate(c(-1, 1), c(0, 4)), 'NO')))\n stopifnot(isTRUE(all.equal(candidate(c(-3, -1), c(-5, 5)), 'YES')))\n stopifnot(isTRUE(all.equal(candidate(c(-2, 2), c(-4, 0)), 'YES')))\n stopifnot(isTRUE(all.equal(candidate(c(-11, 2), c(-1, -1)), 'NO')))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2), c(3, 5)), 'NO')))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2), c(1, 2)), 'NO')))\n stopifnot(isTRUE(all.equal(candidate(c(-2, -2), c(-3, -2)), 'NO')))\n}\ntest_humaneval()"}
|
||
|
{"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# c('()', '(())', '(()())')\nseparate_paren_groups <- function(paren_string) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- separate_paren_groups\n stopifnot(isTRUE(all.equal(candidate('(()()) ((())) () ((())()())'), c('(()())', '((()))', '()', '((())()())'))))\n stopifnot(isTRUE(all.equal(candidate('() (()) ((())) (((())))'), c('()', '(())', '((()))', '(((())))'))))\n stopifnot(isTRUE(all.equal(candidate('(()(())((())))'), c('(()(())((())))'))))\n stopifnot(isTRUE(all.equal(candidate('( ) (( )) (( )( ))'), c('()', '(())', '(()())'))))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_1_separate_paren_groups", "test": "test_humaneval <- function() {\n candidate <- separate_paren_groups\n stopifnot(isTRUE(all.equal(candidate('(()()) ((())) () ((())()())'), c('(()())', '((()))', '()', '((())()())'))))\n stopifnot(isTRUE(all.equal(candidate('() (()) ((())) (((())))'), c('()', '(())', '((()))', '(((())))'))))\n stopifnot(isTRUE(all.equal(candidate('(()(())((())))'), c('(()(())((())))'))))\n stopifnot(isTRUE(all.equal(candidate('( ) (( )) (( )( ))'), c('()', '(())', '(()())'))))\n}\ntest_humaneval()"}
|
||
|
{"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# c(0, 0, 0, 0, 3, 3)\n# >>> compare(c(0, 5, 0, 0, 0, 4), c(4, 1, 1, 0, 0, -2))\n# c(4, 4, 1, 0, 0, 6)\ncompare <- function(game, guess) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- compare\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 4, 5, 1), c(1, 2, 3, 4, 2, -2)), c(0, 0, 0, 0, 3, 3))))\n stopifnot(isTRUE(all.equal(candidate(c(0, 0, 0, 0, 0, 0), c(0, 0, 0, 0, 0, 0)), c(0, 0, 0, 0, 0, 0))))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3), c(-1, -2, -3)), c(2, 4, 6))))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 5), c(-1, 2, 3, 4)), c(2, 0, 0, 1))))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_152_compare", "test": "test_humaneval <- function() {\n candidate <- compare\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 4, 5, 1), c(1, 2, 3, 4, 2, -2)), c(0, 0, 0, 0, 3, 3))))\n stopifnot(isTRUE(all.equal(candidate(c(0, 0, 0, 0, 0, 0), c(0, 0, 0, 0, 0, 0)), c(0, 0, 0, 0, 0, 0))))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3), c(-1, -2, -3)), c(2, 4, 6))))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 5), c(-1, 2, 3, 4)), c(2, 0, 0, 1))))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_83_starts_one_ends.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- starts_one_ends\n stopifnot(isTRUE(all.equal(candidate(1), 1)))\n stopifnot(isTRUE(all.equal(candidate(2), 18)))\n stopifnot(isTRUE(all.equal(candidate(3), 180)))\n stopifnot(isTRUE(all.equal(candidate(4), 1800)))\n stopifnot(isTRUE(all.equal(candidate(5), 18000)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_83_starts_one_ends", "test": "test_humaneval <- function() {\n candidate <- starts_one_ends\n stopifnot(isTRUE(all.equal(candidate(1), 1)))\n stopifnot(isTRUE(all.equal(candidate(2), 18)))\n stopifnot(isTRUE(all.equal(candidate(3), 180)))\n stopifnot(isTRUE(all.equal(candidate(4), 1800)))\n stopifnot(isTRUE(all.equal(candidate(5), 18000)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/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() {\n candidate <- check_if_last_char_is_a_letter\n stopifnot(isTRUE(all.equal(candidate('apple'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('apple pi e'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('eeeee'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('A'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('Pumpkin pie '), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('Pumpkin pie 1'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(''), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('eeeee e '), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('apple pie'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('apple pi e '), FALSE)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_134_check_if_last_char_is_a_letter", "test": "test_humaneval <- function() {\n candidate <- check_if_last_char_is_a_letter\n stopifnot(isTRUE(all.equal(candidate('apple'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('apple pi e'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('eeeee'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('A'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('Pumpkin pie '), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('Pumpkin pie 1'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(''), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('eeeee e '), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('apple pie'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('apple pi e '), FALSE)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- valid_date\n stopifnot(isTRUE(all.equal(candidate('03-11-2000'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('15-01-2012'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('04-0-2040'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('06-04-2020'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('01-01-2007'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('03-32-2011'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(''), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('04-31-3000'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('06-06-2005'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('21-31-2000'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('04-12-2003'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('04122003'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('20030412'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('2003-04'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('2003-04-12'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('04-2003'), FALSE)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_124_valid_date", "test": "test_humaneval <- function() {\n candidate <- valid_date\n stopifnot(isTRUE(all.equal(candidate('03-11-2000'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('15-01-2012'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('04-0-2040'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('06-04-2020'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('01-01-2007'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('03-32-2011'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(''), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('04-31-3000'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('06-06-2005'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('21-31-2000'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('04-12-2003'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('04122003'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('20030412'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('2003-04'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('2003-04-12'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('04-2003'), FALSE)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- count_nums\n stopifnot(isTRUE(all.equal(candidate(c()), 0)))\n stopifnot(isTRUE(all.equal(candidate(c(-1, -2, 0)), 0)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 1, 2, -2, 3, 4, 5)), 6)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 6, 9, -6, 0, 1, 5)), 5)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 100, 98, -7, 1, -1)), 4)))\n stopifnot(isTRUE(all.equal(candidate(c(12, 23, 34, -45, -56, 0)), 5)))\n stopifnot(isTRUE(all.equal(candidate(c(0, 1)), 1)))\n stopifnot(isTRUE(all.equal(candidate(c(1)), 1)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_108_count_nums", "test": "test_humaneval <- function() {\n candidate <- count_nums\n stopifnot(isTRUE(all.equal(candidate(c()), 0)))\n stopifnot(isTRUE(all.equal(candidate(c(-1, -2, 0)), 0)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 1, 2, -2, 3, 4, 5)), 6)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 6, 9, -6, 0, 1, 5)), 5)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 100, 98, -7, 1, -1)), 4)))\n stopifnot(isTRUE(all.equal(candidate(c(12, 23, 34, -45, -56, 0)), 5)))\n stopifnot(isTRUE(all.equal(candidate(c(0, 1)), 1)))\n stopifnot(isTRUE(all.equal(candidate(c(1)), 1)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- anti_shuffle\n stopifnot(isTRUE(all.equal(candidate('Hi'), 'Hi')))\n stopifnot(isTRUE(all.equal(candidate('hello'), 'ehllo')))\n stopifnot(isTRUE(all.equal(candidate('number'), 'bemnru')))\n stopifnot(isTRUE(all.equal(candidate('abcd'), 'abcd')))\n stopifnot(isTRUE(all.equal(candidate('Hello World!!!'), 'Hello !!!Wdlor')))\n stopifnot(isTRUE(all.equal(candidate(''), '')))\n stopifnot(isTRUE(all.equal(candidate('Hi. My name is Mister Robot. How are you?'), '.Hi My aemn is Meirst .Rboot How aer ?ouy')))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_86_anti_shuffle", "test": "test_humaneval <- function() {\n candidate <- anti_shuffle\n stopifnot(isTRUE(all.equal(candidate('Hi'), 'Hi')))\n stopifnot(isTRUE(all.equal(candidate('hello'), 'ehllo')))\n stopifnot(isTRUE(all.equal(candidate('number'), 'bemnru')))\n stopifnot(isTRUE(all.equal(candidate('abcd'), 'abcd')))\n stopifnot(isTRUE(all.equal(candidate('Hello World!!!'), 'Hello !!!Wdlor')))\n stopifnot(isTRUE(all.equal(candidate(''), '')))\n stopifnot(isTRUE(all.equal(candidate('Hi. My name is Mister Robot. How are you?'), '.Hi My aemn is Meirst .Rboot How aer ?ouy')))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- is_palindrome\n stopifnot(isTRUE(all.equal(candidate(''), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('aba'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('aaaaa'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('zbcd'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('xywyx'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('xywyz'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('xywzx'), FALSE)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_48_is_palindrome", "test": "test_humaneval <- function() {\n candidate <- is_palindrome\n stopifnot(isTRUE(all.equal(candidate(''), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('aba'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('aaaaa'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('zbcd'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('xywyx'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('xywyz'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('xywzx'), FALSE)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- get_closest_vowel\n stopifnot(isTRUE(all.equal(candidate('yogurt'), 'u')))\n stopifnot(isTRUE(all.equal(candidate('full'), 'u')))\n stopifnot(isTRUE(all.equal(candidate('easy'), '')))\n stopifnot(isTRUE(all.equal(candidate('eAsy'), '')))\n stopifnot(isTRUE(all.equal(candidate('ali'), '')))\n stopifnot(isTRUE(all.equal(candidate('bad'), 'a')))\n stopifnot(isTRUE(all.equal(candidate('most'), 'o')))\n stopifnot(isTRUE(all.equal(candidate('ab'), '')))\n stopifnot(isTRUE(all.equal(candidate('ba'), '')))\n stopifnot(isTRUE(all.equal(candidate('quick'), '')))\n stopifnot(isTRUE(all.equal(candidate('anime'), 'i')))\n stopifnot(isTRUE(all.equal(candidate('Asia'), '')))\n stopifnot(isTRUE(all.equal(candidate('Above'), 'o')))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_118_get_closest_vowel", "test": "test_humaneval <- function() {\n candidate <- get_closest_vowel\n stopifnot(isTRUE(all.equal(candidate('yogurt'), 'u')))\n stopifnot(isTRUE(all.equal(candidate('full'), 'u')))\n stopifnot(isTRUE(all.equal(candidate('easy'), '')))\n stopifnot(isTRUE(all.equal(candidate('eAsy'), '')))\n stopifnot(isTRUE(all.equal(candidate('ali'), '')))\n stopifnot(isTRUE(all.equal(candidate('bad'), 'a')))\n stopifnot(isTRUE(all.equal(candidate('most'), 'o')))\n stopifnot(isTRUE(all.equal(candidate('ab'), '')))\n stopifnot(isTRUE(all.equal(candidate('ba'), '')))\n stopifnot(isTRUE(all.equal(candidate('quick'), '')))\n stopifnot(isTRUE(all.equal(candidate('anime'), 'i')))\n stopifnot(isTRUE(all.equal(candidate('Asia'), '')))\n stopifnot(isTRUE(all.equal(candidate('Above'), 'o')))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- is_prime\n stopifnot(isTRUE(all.equal(candidate(6), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(101), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(11), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(13441), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(61), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(4), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(1), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(5), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(11), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(17), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(85), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(77), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(255379), FALSE)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_31_is_prime", "test": "test_humaneval <- function() {\n candidate <- is_prime\n stopifnot(isTRUE(all.equal(candidate(6), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(101), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(11), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(13441), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(61), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(4), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(1), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(5), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(11), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(17), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(85), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(77), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(255379), FALSE)))\n}\ntest_humaneval()"}
|
||
|
{"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# <numerator>/<denominator> 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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- simplify\n stopifnot(isTRUE(all.equal(candidate('1/5', '5/1'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('1/6', '2/1'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('5/1', '3/1'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('7/10', '10/2'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('2/10', '50/10'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('7/2', '4/2'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('11/6', '6/1'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('2/3', '5/2'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('5/2', '3/5'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('2/4', '8/4'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('2/4', '4/2'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('1/5', '5/1'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('1/5', '1/5'), FALSE)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_144_simplify", "test": "test_humaneval <- function() {\n candidate <- simplify\n stopifnot(isTRUE(all.equal(candidate('1/5', '5/1'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('1/6', '2/1'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('5/1', '3/1'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('7/10', '10/2'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('2/10', '50/10'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('7/2', '4/2'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('11/6', '6/1'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('2/3', '5/2'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('5/2', '3/5'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('2/4', '8/4'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('2/4', '4/2'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('1/5', '5/1'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('1/5', '1/5'), FALSE)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- hex_key\n stopifnot(isTRUE(all.equal(candidate('AB'), 1)))\n stopifnot(isTRUE(all.equal(candidate('1077E'), 2)))\n stopifnot(isTRUE(all.equal(candidate('ABED1A33'), 4)))\n stopifnot(isTRUE(all.equal(candidate('2020'), 2)))\n stopifnot(isTRUE(all.equal(candidate('123456789ABCDEF0'), 6)))\n stopifnot(isTRUE(all.equal(candidate('112233445566778899AABBCCDDEEFF00'), 12)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_78_hex_key", "test": "test_humaneval <- function() {\n candidate <- hex_key\n stopifnot(isTRUE(all.equal(candidate('AB'), 1)))\n stopifnot(isTRUE(all.equal(candidate('1077E'), 2)))\n stopifnot(isTRUE(all.equal(candidate('ABED1A33'), 4)))\n stopifnot(isTRUE(all.equal(candidate('2020'), 2)))\n stopifnot(isTRUE(all.equal(candidate('123456789ABCDEF0'), 6)))\n stopifnot(isTRUE(all.equal(candidate('112233445566778899AABBCCDDEEFF00'), 12)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- words_in_sentence\n stopifnot(isTRUE(all.equal(candidate('This is a test'), 'is')))\n stopifnot(isTRUE(all.equal(candidate('lets go for swimming'), 'go for')))\n stopifnot(isTRUE(all.equal(candidate('there is no place available here'), 'there is no place')))\n stopifnot(isTRUE(all.equal(candidate('Hi I am Hussein'), 'Hi am Hussein')))\n stopifnot(isTRUE(all.equal(candidate('go for it'), 'go for it')))\n stopifnot(isTRUE(all.equal(candidate('here'), '')))\n stopifnot(isTRUE(all.equal(candidate('here is'), 'is')))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_143_words_in_sentence", "test": "test_humaneval <- function() {\n candidate <- words_in_sentence\n stopifnot(isTRUE(all.equal(candidate('This is a test'), 'is')))\n stopifnot(isTRUE(all.equal(candidate('lets go for swimming'), 'go for')))\n stopifnot(isTRUE(all.equal(candidate('there is no place available here'), 'there is no place')))\n stopifnot(isTRUE(all.equal(candidate('Hi I am Hussein'), 'Hi am Hussein')))\n stopifnot(isTRUE(all.equal(candidate('go for it'), 'go for it')))\n stopifnot(isTRUE(all.equal(candidate('here'), '')))\n stopifnot(isTRUE(all.equal(candidate('here is'), 'is')))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- histogram\n stopifnot(isTRUE(all.equal(candidate('a b b a'), list('a' = 2, 'b' = 2))))\n stopifnot(isTRUE(all.equal(candidate('a b c a b'), list('a' = 2, 'b' = 2))))\n stopifnot(isTRUE(all.equal(candidate('a b c d g'), list('a' = 1, 'b' = 1, 'c' = 1, 'd' = 1, 'g' = 1))))\n stopifnot(isTRUE(all.equal(candidate('r t g'), list('r' = 1, 't' = 1, 'g' = 1))))\n stopifnot(isTRUE(all.equal(candidate('b b b b a'), list('b' = 4))))\n stopifnot(isTRUE(all.equal(candidate('r t g'), list('r' = 1, 't' = 1, 'g' = 1))))\n stopifnot(isTRUE(all.equal(candidate(''), list())))\n stopifnot(isTRUE(all.equal(candidate('a'), list('a' = 1))))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_111_histogram", "test": "test_humaneval <- function() {\n candidate <- histogram\n stopifnot(isTRUE(all.equal(candidate('a b b a'), list('a' = 2, 'b' = 2))))\n stopifnot(isTRUE(all.equal(candidate('a b c a b'), list('a' = 2, 'b' = 2))))\n stopifnot(isTRUE(all.equal(candidate('a b c d g'), list('a' = 1, 'b' = 1, 'c' = 1, 'd' = 1, 'g' = 1))))\n stopifnot(isTRUE(all.equal(candidate('r t g'), list('r' = 1, 't' = 1, 'g' = 1))))\n stopifnot(isTRUE(all.equal(candidate('b b b b a'), list('b' = 4))))\n stopifnot(isTRUE(all.equal(candidate('r t g'), list('r' = 1, 't' = 1, 'g' = 1))))\n stopifnot(isTRUE(all.equal(candidate(''), list())))\n stopifnot(isTRUE(all.equal(candidate('a'), list('a' = 1))))\n}\ntest_humaneval()"}
|
||
|
{"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(c(1, 2, 3, 4, 5, 6), c(1, 2, 3, 4, 1, 6), c(1, 2, 3, 4, 5, 1)), 1)\n# list(c(0, 0), c(1, 4), c(1, 0), c(2, 5), c(2, 0))\n# >>> get_row(c(), 1)\n# c()\n# >>> get_row(list(c(), c(1), c(1, 2, 3)), 3)\n# list(c(2, 2))\nget_row <- function(lst, x) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- get_row\n stopifnot(isTRUE(all.equal(candidate(list(c(1, 2, 3, 4, 5, 6), c(1, 2, 3, 4, 1, 6), c(1, 2, 3, 4, 5, 1)), 1), list(c(0, 0), c(1, 4), c(1, 0), c(2, 5), c(2, 0)))))\n stopifnot(isTRUE(all.equal(candidate(list(c(1, 2, 3, 4, 5, 6), c(1, 2, 3, 4, 5, 6), c(1, 2, 3, 4, 5, 6), c(1, 2, 3, 4, 5, 6), c(1, 2, 3, 4, 5, 6), c(1, 2, 3, 4, 5, 6)), 2), list(c(0, 1), c(1, 1), c(2, 1), c(3, 1), c(4, 1), c(5, 1)))))\n stopifnot(isTRUE(all.equal(candidate(list(c(1, 2, 3, 4, 5, 6), c(1, 2, 3, 4, 5, 6), c(1, 1, 3, 4, 5, 6), c(1, 2, 1, 4, 5, 6), c(1, 2, 3, 1, 5, 6), c(1, 2, 3, 4, 1, 6), c(1, 2, 3, 4, 5, 1)), 1), list(c(0, 0), c(1, 0), c(2, 1), c(2, 0), c(3, 2), c(3, 0), c(4, 3), c(4, 0), c(5, 4), c(5, 0), c(6, 5), c(6, 0)))))\n stopifnot(isTRUE(all.equal(candidate(c(), 1), c())))\n stopifnot(isTRUE(all.equal(candidate(list(c(1)), 2), c())))\n stopifnot(isTRUE(all.equal(candidate(list(c(), c(1), c(1, 2, 3)), 3), list(c(2, 2)))))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_87_get_row", "test": "test_humaneval <- function() {\n candidate <- get_row\n stopifnot(isTRUE(all.equal(candidate(list(c(1, 2, 3, 4, 5, 6), c(1, 2, 3, 4, 1, 6), c(1, 2, 3, 4, 5, 1)), 1), list(c(0, 0), c(1, 4), c(1, 0), c(2, 5), c(2, 0)))))\n stopifnot(isTRUE(all.equal(candidate(list(c(1, 2, 3, 4, 5, 6), c(1, 2, 3, 4, 5, 6), c(1, 2, 3, 4, 5, 6), c(1, 2, 3, 4, 5, 6), c(1, 2, 3, 4, 5, 6), c(1, 2, 3, 4, 5, 6)), 2), list(c(0, 1), c(1, 1), c(2, 1), c(3, 1), c(4, 1), c(5, 1)))))\n stopifnot(isTRUE(all.equal(candidate(list(c(1, 2, 3, 4, 5, 6), c(1, 2, 3, 4, 5, 6), c(1, 1, 3, 4, 5, 6), c(1, 2, 1, 4, 5, 6), c(1, 2, 3, 1, 5, 6), c(1, 2, 3, 4, 1, 6), c(1, 2, 3, 4, 5, 1)), 1), list(c(0, 0), c(1, 0), c(2, 1), c(2, 0), c(3, 2), c(3, 0), c(4, 3), c(4, 0), c(5, 4), c(5, 0), c(6, 5), c(6, 0)))))\n stopifnot(isTRUE(all.equal(candidate(c(), 1), c())))\n stopifnot(isTRUE(all.equal(candidate(list(c(1)), 2), c())))\n stopifnot(isTRUE(all.equal(candidate(list(c(), c(1), c(1, 2, 3)), 3), list(c(2, 2)))))\n}\ntest_humaneval()"}
|
||
|
{"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# c(1, 5)\nget_odd_collatz <- function(n) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- get_odd_collatz\n stopifnot(isTRUE(all.equal(candidate(14), c(1, 5, 7, 11, 13, 17))))\n stopifnot(isTRUE(all.equal(candidate(5), c(1, 5))))\n stopifnot(isTRUE(all.equal(candidate(12), c(1, 3, 5))))\n stopifnot(isTRUE(all.equal(candidate(1), c(1))))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_123_get_odd_collatz", "test": "test_humaneval <- function() {\n candidate <- get_odd_collatz\n stopifnot(isTRUE(all.equal(candidate(14), c(1, 5, 7, 11, 13, 17))))\n stopifnot(isTRUE(all.equal(candidate(5), c(1, 5))))\n stopifnot(isTRUE(all.equal(candidate(12), c(1, 3, 5))))\n stopifnot(isTRUE(all.equal(candidate(1), c(1))))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- can_arrange\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 4, 3, 5)), 3)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 4, 5)), -1)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 4, 2, 5, 6, 7, 8, 9, 10)), 2)))\n stopifnot(isTRUE(all.equal(candidate(c(4, 8, 5, 7, 3)), 4)))\n stopifnot(isTRUE(all.equal(candidate(c()), -1)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_135_can_arrange", "test": "test_humaneval <- function() {\n candidate <- can_arrange\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 4, 3, 5)), 3)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 4, 5)), -1)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 4, 2, 5, 6, 7, 8, 9, 10)), 2)))\n stopifnot(isTRUE(all.equal(candidate(c(4, 8, 5, 7, 3)), 4)))\n stopifnot(isTRUE(all.equal(candidate(c()), -1)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- sort_numbers\n stopifnot(isTRUE(all.equal(candidate(''), '')))\n stopifnot(isTRUE(all.equal(candidate('three'), 'three')))\n stopifnot(isTRUE(all.equal(candidate('three five nine'), 'three five nine')))\n stopifnot(isTRUE(all.equal(candidate('five zero four seven nine eight'), 'zero four five seven eight nine')))\n stopifnot(isTRUE(all.equal(candidate('six five four three two one zero'), 'zero one two three four five six')))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_19_sort_numbers", "test": "test_humaneval <- function() {\n candidate <- sort_numbers\n stopifnot(isTRUE(all.equal(candidate(''), '')))\n stopifnot(isTRUE(all.equal(candidate('three'), 'three')))\n stopifnot(isTRUE(all.equal(candidate('three five nine'), 'three five nine')))\n stopifnot(isTRUE(all.equal(candidate('five zero four seven nine eight'), 'zero four five seven eight nine')))\n stopifnot(isTRUE(all.equal(candidate('six five four three two one zero'), 'zero one two three four five six')))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- circular_shift\n stopifnot(isTRUE(all.equal(candidate(100, 2), '001')))\n stopifnot(isTRUE(all.equal(candidate(12, 2), '12')))\n stopifnot(isTRUE(all.equal(candidate(97, 8), '79')))\n stopifnot(isTRUE(all.equal(candidate(12, 1), '21')))\n stopifnot(isTRUE(all.equal(candidate(11, 101), '11')))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_65_circular_shift", "test": "test_humaneval <- function() {\n candidate <- circular_shift\n stopifnot(isTRUE(all.equal(candidate(100, 2), '001')))\n stopifnot(isTRUE(all.equal(candidate(12, 2), '12')))\n stopifnot(isTRUE(all.equal(candidate(97, 8), '79')))\n stopifnot(isTRUE(all.equal(candidate(12, 1), '21')))\n stopifnot(isTRUE(all.equal(candidate(11, 101), '11')))\n}\ntest_humaneval()"}
|
||
|
{"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# c(1, 2, 3)\n# >>> lst\n# c()\n# >>> lst\n# c(-1, -5, 2, -1, -5)\nsum_squares <- function(lst) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- sum_squares\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3)), 6)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 4, 9)), 14)))\n stopifnot(isTRUE(all.equal(candidate(c()), 0)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 1, 1, 1, 1, 1, 1, 1, 1)), 9)))\n stopifnot(isTRUE(all.equal(candidate(c(-1, -1, -1, -1, -1, -1, -1, -1, -1)), -3)))\n stopifnot(isTRUE(all.equal(candidate(c(0)), 0)))\n stopifnot(isTRUE(all.equal(candidate(c(-1, -5, 2, -1, -5)), -126)))\n stopifnot(isTRUE(all.equal(candidate(c(-56, -99, 1, 0, -2)), 3030)))\n stopifnot(isTRUE(all.equal(candidate(c(-1, 0, 0, 0, 0, 0, 0, 0, -1)), 0)))\n stopifnot(isTRUE(all.equal(candidate(c(-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37)), -14196)))\n stopifnot(isTRUE(all.equal(candidate(c(-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10)), -1448)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_142_sum_squares", "test": "test_humaneval <- function() {\n candidate <- sum_squares\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3)), 6)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 4, 9)), 14)))\n stopifnot(isTRUE(all.equal(candidate(c()), 0)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 1, 1, 1, 1, 1, 1, 1, 1)), 9)))\n stopifnot(isTRUE(all.equal(candidate(c(-1, -1, -1, -1, -1, -1, -1, -1, -1)), -3)))\n stopifnot(isTRUE(all.equal(candidate(c(0)), 0)))\n stopifnot(isTRUE(all.equal(candidate(c(-1, -5, 2, -1, -5)), -126)))\n stopifnot(isTRUE(all.equal(candidate(c(-56, -99, 1, 0, -2)), 3030)))\n stopifnot(isTRUE(all.equal(candidate(c(-1, 0, 0, 0, 0, 0, 0, 0, -1)), 0)))\n stopifnot(isTRUE(all.equal(candidate(c(-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37)), -14196)))\n stopifnot(isTRUE(all.equal(candidate(c(-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10)), -1448)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- skjkasdkd\n stopifnot(isTRUE(all.equal(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)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1)), 25)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3)), 13)))\n stopifnot(isTRUE(all.equal(candidate(c(0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6)), 11)))\n stopifnot(isTRUE(all.equal(candidate(c(0, 81, 12, 3, 1, 21)), 3)))\n stopifnot(isTRUE(all.equal(candidate(c(0, 8, 1, 2, 1, 7)), 7)))\n stopifnot(isTRUE(all.equal(candidate(c(8191)), 19)))\n stopifnot(isTRUE(all.equal(candidate(c(8191, 123456, 127, 7)), 19)))\n stopifnot(isTRUE(all.equal(candidate(c(127, 97, 8192)), 10)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_94_skjkasdkd", "test": "test_humaneval <- function() {\n candidate <- skjkasdkd\n stopifnot(isTRUE(all.equal(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)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1)), 25)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3)), 13)))\n stopifnot(isTRUE(all.equal(candidate(c(0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6)), 11)))\n stopifnot(isTRUE(all.equal(candidate(c(0, 81, 12, 3, 1, 21)), 3)))\n stopifnot(isTRUE(all.equal(candidate(c(0, 8, 1, 2, 1, 7)), 7)))\n stopifnot(isTRUE(all.equal(candidate(c(8191)), 19)))\n stopifnot(isTRUE(all.equal(candidate(c(8191, 123456, 127, 7)), 19)))\n stopifnot(isTRUE(all.equal(candidate(c(127, 97, 8192)), 10)))\n}\ntest_humaneval()"}
|
||
|
{"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# c(0, 1)\n# >>> sum_product(c(1, 2, 3, 4))\n# c(10, 24)\nsum_product <- function(numbers) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- sum_product\n stopifnot(isTRUE(all.equal(candidate(c()), c(0, 1))))\n stopifnot(isTRUE(all.equal(candidate(c(1, 1, 1)), c(3, 1))))\n stopifnot(isTRUE(all.equal(candidate(c(100, 0)), c(100, 0))))\n stopifnot(isTRUE(all.equal(candidate(c(3, 5, 7)), c(15, 105))))\n stopifnot(isTRUE(all.equal(candidate(c(10)), c(10, 10))))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_8_sum_product", "test": "test_humaneval <- function() {\n candidate <- sum_product\n stopifnot(isTRUE(all.equal(candidate(c()), c(0, 1))))\n stopifnot(isTRUE(all.equal(candidate(c(1, 1, 1)), c(3, 1))))\n stopifnot(isTRUE(all.equal(candidate(c(100, 0)), c(100, 0))))\n stopifnot(isTRUE(all.equal(candidate(c(3, 5, 7)), c(15, 105))))\n stopifnot(isTRUE(all.equal(candidate(c(10)), c(10, 10))))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- choose_num\n stopifnot(isTRUE(all.equal(candidate(12, 15), 14)))\n stopifnot(isTRUE(all.equal(candidate(13, 12), -1)))\n stopifnot(isTRUE(all.equal(candidate(33, 12354), 12354)))\n stopifnot(isTRUE(all.equal(candidate(5234, 5233), -1)))\n stopifnot(isTRUE(all.equal(candidate(6, 29), 28)))\n stopifnot(isTRUE(all.equal(candidate(27, 10), -1)))\n stopifnot(isTRUE(all.equal(candidate(7, 7), -1)))\n stopifnot(isTRUE(all.equal(candidate(546, 546), 546)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_102_choose_num", "test": "test_humaneval <- function() {\n candidate <- choose_num\n stopifnot(isTRUE(all.equal(candidate(12, 15), 14)))\n stopifnot(isTRUE(all.equal(candidate(13, 12), -1)))\n stopifnot(isTRUE(all.equal(candidate(33, 12354), 12354)))\n stopifnot(isTRUE(all.equal(candidate(5234, 5233), -1)))\n stopifnot(isTRUE(all.equal(candidate(6, 29), 28)))\n stopifnot(isTRUE(all.equal(candidate(27, 10), -1)))\n stopifnot(isTRUE(all.equal(candidate(7, 7), -1)))\n stopifnot(isTRUE(all.equal(candidate(546, 546), 546)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- largest_smallest_integers\n stopifnot(isTRUE(all.equal(candidate(c(2, 4, 1, 3, 5, 7)), list(NULL, 1))))\n stopifnot(isTRUE(all.equal(candidate(c(2, 4, 1, 3, 5, 7, 0)), list(NULL, 1))))\n stopifnot(isTRUE(all.equal(candidate(c(1, 3, 2, 4, 5, 6, -2)), c(-2, 1))))\n stopifnot(isTRUE(all.equal(candidate(c(4, 5, 3, 6, 2, 7, -7)), c(-7, 2))))\n stopifnot(isTRUE(all.equal(candidate(c(7, 3, 8, 4, 9, 2, 5, -9)), c(-9, 2))))\n stopifnot(isTRUE(all.equal(candidate(c()), list(NULL, NULL))))\n stopifnot(isTRUE(all.equal(candidate(c(0)), list(NULL, NULL))))\n stopifnot(isTRUE(all.equal(candidate(c(-1, -3, -5, -6)), list(-1, NULL))))\n stopifnot(isTRUE(all.equal(candidate(c(-1, -3, -5, -6, 0)), list(-1, NULL))))\n stopifnot(isTRUE(all.equal(candidate(c(-6, -4, -4, -3, 1)), c(-3, 1))))\n stopifnot(isTRUE(all.equal(candidate(c(-6, -4, -4, -3, -100, 1)), c(-3, 1))))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_136_largest_smallest_integers", "test": "test_humaneval <- function() {\n candidate <- largest_smallest_integers\n stopifnot(isTRUE(all.equal(candidate(c(2, 4, 1, 3, 5, 7)), list(NULL, 1))))\n stopifnot(isTRUE(all.equal(candidate(c(2, 4, 1, 3, 5, 7, 0)), list(NULL, 1))))\n stopifnot(isTRUE(all.equal(candidate(c(1, 3, 2, 4, 5, 6, -2)), c(-2, 1))))\n stopifnot(isTRUE(all.equal(candidate(c(4, 5, 3, 6, 2, 7, -7)), c(-7, 2))))\n stopifnot(isTRUE(all.equal(candidate(c(7, 3, 8, 4, 9, 2, 5, -9)), c(-9, 2))))\n stopifnot(isTRUE(all.equal(candidate(c()), list(NULL, NULL))))\n stopifnot(isTRUE(all.equal(candidate(c(0)), list(NULL, NULL))))\n stopifnot(isTRUE(all.equal(candidate(c(-1, -3, -5, -6)), list(-1, NULL))))\n stopifnot(isTRUE(all.equal(candidate(c(-1, -3, -5, -6, 0)), list(-1, NULL))))\n stopifnot(isTRUE(all.equal(candidate(c(-6, -4, -4, -3, 1)), c(-3, 1))))\n stopifnot(isTRUE(all.equal(candidate(c(-6, -4, -4, -3, -100, 1)), c(-3, 1))))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- count_distinct_characters\n stopifnot(isTRUE(all.equal(candidate(''), 0)))\n stopifnot(isTRUE(all.equal(candidate('abcde'), 5)))\n stopifnot(isTRUE(all.equal(candidate('abcdecadeCADE'), 5)))\n stopifnot(isTRUE(all.equal(candidate('aaaaAAAAaaaa'), 1)))\n stopifnot(isTRUE(all.equal(candidate('Jerry jERRY JeRRRY'), 5)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_16_count_distinct_characters", "test": "test_humaneval <- function() {\n candidate <- count_distinct_characters\n stopifnot(isTRUE(all.equal(candidate(''), 0)))\n stopifnot(isTRUE(all.equal(candidate('abcde'), 5)))\n stopifnot(isTRUE(all.equal(candidate('abcdecadeCADE'), 5)))\n stopifnot(isTRUE(all.equal(candidate('aaaaAAAAaaaa'), 1)))\n stopifnot(isTRUE(all.equal(candidate('Jerry jERRY JeRRRY'), 5)))\n}\ntest_humaneval()"}
|
||
|
{"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# c(3, 5, 7)\nmake_a_pile <- function(n) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- make_a_pile\n stopifnot(isTRUE(all.equal(candidate(3), c(3, 5, 7))))\n stopifnot(isTRUE(all.equal(candidate(4), c(4, 6, 8, 10))))\n stopifnot(isTRUE(all.equal(candidate(5), c(5, 7, 9, 11, 13))))\n stopifnot(isTRUE(all.equal(candidate(6), c(6, 8, 10, 12, 14, 16))))\n stopifnot(isTRUE(all.equal(candidate(8), c(8, 10, 12, 14, 16, 18, 20, 22))))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_100_make_a_pile", "test": "test_humaneval <- function() {\n candidate <- make_a_pile\n stopifnot(isTRUE(all.equal(candidate(3), c(3, 5, 7))))\n stopifnot(isTRUE(all.equal(candidate(4), c(4, 6, 8, 10))))\n stopifnot(isTRUE(all.equal(candidate(5), c(5, 7, 9, 11, 13))))\n stopifnot(isTRUE(all.equal(candidate(6), c(6, 8, 10, 12, 14, 16))))\n stopifnot(isTRUE(all.equal(candidate(8), c(8, 10, 12, 14, 16, 18, 20, 22))))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- prod_signs\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 2, -4)), -9)))\n stopifnot(isTRUE(all.equal(candidate(c(0, 1)), 0)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 1, 1, 2, 3, -1, 1)), -10)))\n stopifnot(isTRUE(all.equal(candidate(c()), NULL)))\n stopifnot(isTRUE(all.equal(candidate(c(2, 4, 1, 2, -1, -1, 9)), 20)))\n stopifnot(isTRUE(all.equal(candidate(c(-1, 1, -1, 1)), 4)))\n stopifnot(isTRUE(all.equal(candidate(c(-1, 1, 1, 1)), -4)))\n stopifnot(isTRUE(all.equal(candidate(c(-1, 1, 1, 0)), 0)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_128_prod_signs", "test": "test_humaneval <- function() {\n candidate <- prod_signs\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 2, -4)), -9)))\n stopifnot(isTRUE(all.equal(candidate(c(0, 1)), 0)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 1, 1, 2, 3, -1, 1)), -10)))\n stopifnot(isTRUE(all.equal(candidate(c()), NULL)))\n stopifnot(isTRUE(all.equal(candidate(c(2, 4, 1, 2, -1, -1, 9)), 20)))\n stopifnot(isTRUE(all.equal(candidate(c(-1, 1, -1, 1)), 4)))\n stopifnot(isTRUE(all.equal(candidate(c(-1, 1, 1, 1)), -4)))\n stopifnot(isTRUE(all.equal(candidate(c(-1, 1, 1, 0)), 0)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- minSubArraySum\n stopifnot(isTRUE(all.equal(candidate(c(2, 3, 4, 1, 2, 4)), 1)))\n stopifnot(isTRUE(all.equal(candidate(c(-1, -2, -3)), -6)))\n stopifnot(isTRUE(all.equal(candidate(c(-1, -2, -3, 2, -10)), -14)))\n stopifnot(isTRUE(all.equal(candidate(c(-9999999999999999)), -9999999999999999)))\n stopifnot(isTRUE(all.equal(candidate(c(0, 10, 20, 1000000)), 0)))\n stopifnot(isTRUE(all.equal(candidate(c(-1, -2, -3, 10, -5)), -6)))\n stopifnot(isTRUE(all.equal(candidate(c(100, -1, -2, -3, 10, -5)), -6)))\n stopifnot(isTRUE(all.equal(candidate(c(10, 11, 13, 8, 3, 4)), 3)))\n stopifnot(isTRUE(all.equal(candidate(c(100, -33, 32, -1, 0, -2)), -33)))\n stopifnot(isTRUE(all.equal(candidate(c(-10)), -10)))\n stopifnot(isTRUE(all.equal(candidate(c(7)), 7)))\n stopifnot(isTRUE(all.equal(candidate(c(1, -1)), -1)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_114_minSubArraySum", "test": "test_humaneval <- function() {\n candidate <- minSubArraySum\n stopifnot(isTRUE(all.equal(candidate(c(2, 3, 4, 1, 2, 4)), 1)))\n stopifnot(isTRUE(all.equal(candidate(c(-1, -2, -3)), -6)))\n stopifnot(isTRUE(all.equal(candidate(c(-1, -2, -3, 2, -10)), -14)))\n stopifnot(isTRUE(all.equal(candidate(c(-9999999999999999)), -9999999999999999)))\n stopifnot(isTRUE(all.equal(candidate(c(0, 10, 20, 1000000)), 0)))\n stopifnot(isTRUE(all.equal(candidate(c(-1, -2, -3, 10, -5)), -6)))\n stopifnot(isTRUE(all.equal(candidate(c(100, -1, -2, -3, 10, -5)), -6)))\n stopifnot(isTRUE(all.equal(candidate(c(10, 11, 13, 8, 3, 4)), 3)))\n stopifnot(isTRUE(all.equal(candidate(c(100, -33, 32, -1, 0, -2)), -33)))\n stopifnot(isTRUE(all.equal(candidate(c(-10)), -10)))\n stopifnot(isTRUE(all.equal(candidate(c(7)), 7)))\n stopifnot(isTRUE(all.equal(candidate(c(1, -1)), -1)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- string_sequence\n stopifnot(isTRUE(all.equal(candidate(0), '0')))\n stopifnot(isTRUE(all.equal(candidate(3), '0 1 2 3')))\n stopifnot(isTRUE(all.equal(candidate(10), '0 1 2 3 4 5 6 7 8 9 10')))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_15_string_sequence", "test": "test_humaneval <- function() {\n candidate <- string_sequence\n stopifnot(isTRUE(all.equal(candidate(0), '0')))\n stopifnot(isTRUE(all.equal(candidate(3), '0 1 2 3')))\n stopifnot(isTRUE(all.equal(candidate(10), '0 1 2 3 4 5 6 7 8 9 10')))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- cycpattern_check\n stopifnot(isTRUE(all.equal(candidate('xyzw', 'xyw'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('yello', 'ell'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('whattup', 'ptut'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('efef', 'fee'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('abab', 'aabb'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('winemtt', 'tinem'), TRUE)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_154_cycpattern_check", "test": "test_humaneval <- function() {\n candidate <- cycpattern_check\n stopifnot(isTRUE(all.equal(candidate('xyzw', 'xyw'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('yello', 'ell'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('whattup', 'ptut'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('efef', 'fee'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('abab', 'aabb'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('winemtt', 'tinem'), TRUE)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- monotonic\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 4, 10)), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 4, 20)), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 20, 4, 10)), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(4, 1, 0, -10)), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(4, 1, 1, 0)), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 2, 5, 60)), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 4, 5, 60)), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(9, 9, 9, 9)), TRUE)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_57_monotonic", "test": "test_humaneval <- function() {\n candidate <- monotonic\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 4, 10)), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 4, 20)), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 20, 4, 10)), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(4, 1, 0, -10)), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(4, 1, 1, 0)), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 2, 5, 60)), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 4, 5, 60)), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(9, 9, 9, 9)), TRUE)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- longest\n stopifnot(isTRUE(all.equal(candidate(c()), NULL)))\n stopifnot(isTRUE(all.equal(candidate(c('x', 'y', 'z')), 'x')))\n stopifnot(isTRUE(all.equal(candidate(c('x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc')), 'zzzz')))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_12_longest", "test": "test_humaneval <- function() {\n candidate <- longest\n stopifnot(isTRUE(all.equal(candidate(c()), NULL)))\n stopifnot(isTRUE(all.equal(candidate(c('x', 'y', 'z')), 'x')))\n stopifnot(isTRUE(all.equal(candidate(c('x', 'yyy', 'zzzz', 'www', 'kkkk', 'abc')), 'zzzz')))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- below_threshold\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 4, 10), 100), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 20, 4, 10), 5), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 20, 4, 10), 21), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 20, 4, 10), 22), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 8, 4, 10), 11), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 8, 4, 10), 10), FALSE)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_52_below_threshold", "test": "test_humaneval <- function() {\n candidate <- below_threshold\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 4, 10), 100), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 20, 4, 10), 5), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 20, 4, 10), 21), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 20, 4, 10), 22), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 8, 4, 10), 11), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 8, 4, 10), 10), FALSE)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- is_multiply_prime\n stopifnot(isTRUE(all.equal(candidate(5), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(30), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(8), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(10), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(125), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(105), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(126), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(729), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(891), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(1001), TRUE)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_75_is_multiply_prime", "test": "test_humaneval <- function() {\n candidate <- is_multiply_prime\n stopifnot(isTRUE(all.equal(candidate(5), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(30), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(8), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(10), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(125), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(105), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(126), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(729), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(891), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(1001), TRUE)))\n}\ntest_humaneval()"}
|
||
|
{"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# c(2, 5, 6)\n# >>> get_positive(c(5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10))\n# c(5, 3, 2, 3, 9, 123, 1)\nget_positive <- function(l) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- get_positive\n stopifnot(isTRUE(all.equal(candidate(c(-1, -2, 4, 5, 6)), c(4, 5, 6))))\n stopifnot(isTRUE(all.equal(candidate(c(5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10)), c(5, 3, 2, 3, 3, 9, 123, 1))))\n stopifnot(isTRUE(all.equal(candidate(c(-1, -2)), c())))\n stopifnot(isTRUE(all.equal(candidate(c()), c())))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_30_get_positive", "test": "test_humaneval <- function() {\n candidate <- get_positive\n stopifnot(isTRUE(all.equal(candidate(c(-1, -2, 4, 5, 6)), c(4, 5, 6))))\n stopifnot(isTRUE(all.equal(candidate(c(5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10)), c(5, 3, 2, 3, 3, 9, 123, 1))))\n stopifnot(isTRUE(all.equal(candidate(c(-1, -2)), c())))\n stopifnot(isTRUE(all.equal(candidate(c()), c())))\n}\ntest_humaneval()"}
|
||
|
{"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# c(1, 2, 3)\n# >>> sort_third(c(5, 6, 3, 4, 8, 9, 2))\n# c(2, 6, 3, 4, 8, 9, 5)\nsort_third <- function(l) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- sort_third\n stopifnot(isTRUE(all.equal(candidate(c(5, 6, 3, 4, 8, 9, 2)), c(2, 6, 3, 4, 8, 9, 5))))\n stopifnot(isTRUE(all.equal(candidate(c(5, 8, 3, 4, 6, 9, 2)), c(2, 8, 3, 4, 6, 9, 5))))\n stopifnot(isTRUE(all.equal(candidate(c(5, 6, 9, 4, 8, 3, 2)), c(2, 6, 9, 4, 8, 3, 5))))\n stopifnot(isTRUE(all.equal(candidate(c(5, 6, 3, 4, 8, 9, 2, 1)), c(2, 6, 3, 4, 8, 9, 5, 1))))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_33_sort_third", "test": "test_humaneval <- function() {\n candidate <- sort_third\n stopifnot(isTRUE(all.equal(candidate(c(5, 6, 3, 4, 8, 9, 2)), c(2, 6, 3, 4, 8, 9, 5))))\n stopifnot(isTRUE(all.equal(candidate(c(5, 8, 3, 4, 6, 9, 2)), c(2, 8, 3, 4, 6, 9, 5))))\n stopifnot(isTRUE(all.equal(candidate(c(5, 6, 9, 4, 8, 3, 2)), c(2, 6, 9, 4, 8, 3, 5))))\n stopifnot(isTRUE(all.equal(candidate(c(5, 6, 3, 4, 8, 9, 2, 1)), c(2, 6, 3, 4, 8, 9, 5, 1))))\n}\ntest_humaneval()"}
|
||
|
{"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# c(2, 3, 1, 3)\nparse_nested_parens <- function(paren_string) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- parse_nested_parens\n stopifnot(isTRUE(all.equal(candidate('(()()) ((())) () ((())()())'), c(2, 3, 1, 3))))\n stopifnot(isTRUE(all.equal(candidate('() (()) ((())) (((())))'), c(1, 2, 3, 4))))\n stopifnot(isTRUE(all.equal(candidate('(()(())((())))'), c(4))))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_6_parse_nested_parens", "test": "test_humaneval <- function() {\n candidate <- parse_nested_parens\n stopifnot(isTRUE(all.equal(candidate('(()()) ((())) () ((())()())'), c(2, 3, 1, 3))))\n stopifnot(isTRUE(all.equal(candidate('() (()) ((())) (((())))'), c(1, 2, 3, 4))))\n stopifnot(isTRUE(all.equal(candidate('(()(())((())))'), c(4))))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- triangle_area\n stopifnot(isTRUE(all.equal(candidate(5, 3), 7.5)))\n stopifnot(isTRUE(all.equal(candidate(2, 2), 2.0)))\n stopifnot(isTRUE(all.equal(candidate(10, 8), 40.0)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_45_triangle_area", "test": "test_humaneval <- function() {\n candidate <- triangle_area\n stopifnot(isTRUE(all.equal(candidate(5, 3), 7.5)))\n stopifnot(isTRUE(all.equal(candidate(2, 2), 2.0)))\n stopifnot(isTRUE(all.equal(candidate(10, 8), 40.0)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- multiply\n stopifnot(isTRUE(all.equal(candidate(148, 412), 16)))\n stopifnot(isTRUE(all.equal(candidate(19, 28), 72)))\n stopifnot(isTRUE(all.equal(candidate(2020, 1851), 0)))\n stopifnot(isTRUE(all.equal(candidate(14, -15), 20)))\n stopifnot(isTRUE(all.equal(candidate(76, 67), 42)))\n stopifnot(isTRUE(all.equal(candidate(17, 27), 49)))\n stopifnot(isTRUE(all.equal(candidate(0, 1), 0)))\n stopifnot(isTRUE(all.equal(candidate(0, 0), 0)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_97_multiply", "test": "test_humaneval <- function() {\n candidate <- multiply\n stopifnot(isTRUE(all.equal(candidate(148, 412), 16)))\n stopifnot(isTRUE(all.equal(candidate(19, 28), 72)))\n stopifnot(isTRUE(all.equal(candidate(2020, 1851), 0)))\n stopifnot(isTRUE(all.equal(candidate(14, -15), 20)))\n stopifnot(isTRUE(all.equal(candidate(76, 67), 42)))\n stopifnot(isTRUE(all.equal(candidate(17, 27), 49)))\n stopifnot(isTRUE(all.equal(candidate(0, 1), 0)))\n stopifnot(isTRUE(all.equal(candidate(0, 0), 0)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- mean_absolute_deviation\n stopifnot(isTRUE(all.equal(candidate(c(1.0, 2.0)), 0.5)))\n stopifnot(isTRUE(all.equal(candidate(c(1.0, 2.0, 3.0, 4.0)), 1.0)))\n stopifnot(isTRUE(all.equal(candidate(c(1.0, 2.0, 3.0, 4.0, 5.0)), 1.2)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_4_mean_absolute_deviation", "test": "test_humaneval <- function() {\n candidate <- mean_absolute_deviation\n stopifnot(isTRUE(all.equal(candidate(c(1.0, 2.0)), 0.5)))\n stopifnot(isTRUE(all.equal(candidate(c(1.0, 2.0, 3.0, 4.0)), 1.0)))\n stopifnot(isTRUE(all.equal(candidate(c(1.0, 2.0, 3.0, 4.0, 5.0)), 1.2)))\n}\ntest_humaneval()"}
|
||
|
{"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# c(1, 5, 653)\n# >>> common(c(5, 3, 2, 8), c(3, 2))\n# c(2, 3)\ncommon <- function(l1, l2) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- common\n stopifnot(isTRUE(all.equal(candidate(c(1, 4, 3, 34, 653, 2, 5), c(5, 7, 1, 5, 9, 653, 121)), c(1, 5, 653))))\n stopifnot(isTRUE(all.equal(candidate(c(5, 3, 2, 8), c(3, 2)), c(2, 3))))\n stopifnot(isTRUE(all.equal(candidate(c(4, 3, 2, 8), c(3, 2, 4)), c(2, 3, 4))))\n stopifnot(isTRUE(all.equal(candidate(c(4, 3, 2, 8), c()), c())))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_58_common", "test": "test_humaneval <- function() {\n candidate <- common\n stopifnot(isTRUE(all.equal(candidate(c(1, 4, 3, 34, 653, 2, 5), c(5, 7, 1, 5, 9, 653, 121)), c(1, 5, 653))))\n stopifnot(isTRUE(all.equal(candidate(c(5, 3, 2, 8), c(3, 2)), c(2, 3))))\n stopifnot(isTRUE(all.equal(candidate(c(4, 3, 2, 8), c(3, 2, 4)), c(2, 3, 4))))\n stopifnot(isTRUE(all.equal(candidate(c(4, 3, 2, 8), c()), c())))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- int_to_mini_roman\n stopifnot(isTRUE(all.equal(candidate(19), 'xix')))\n stopifnot(isTRUE(all.equal(candidate(152), 'clii')))\n stopifnot(isTRUE(all.equal(candidate(251), 'ccli')))\n stopifnot(isTRUE(all.equal(candidate(426), 'cdxxvi')))\n stopifnot(isTRUE(all.equal(candidate(500), 'd')))\n stopifnot(isTRUE(all.equal(candidate(1), 'i')))\n stopifnot(isTRUE(all.equal(candidate(4), 'iv')))\n stopifnot(isTRUE(all.equal(candidate(43), 'xliii')))\n stopifnot(isTRUE(all.equal(candidate(90), 'xc')))\n stopifnot(isTRUE(all.equal(candidate(94), 'xciv')))\n stopifnot(isTRUE(all.equal(candidate(532), 'dxxxii')))\n stopifnot(isTRUE(all.equal(candidate(900), 'cm')))\n stopifnot(isTRUE(all.equal(candidate(994), 'cmxciv')))\n stopifnot(isTRUE(all.equal(candidate(1000), 'm')))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_156_int_to_mini_roman", "test": "test_humaneval <- function() {\n candidate <- int_to_mini_roman\n stopifnot(isTRUE(all.equal(candidate(19), 'xix')))\n stopifnot(isTRUE(all.equal(candidate(152), 'clii')))\n stopifnot(isTRUE(all.equal(candidate(251), 'ccli')))\n stopifnot(isTRUE(all.equal(candidate(426), 'cdxxvi')))\n stopifnot(isTRUE(all.equal(candidate(500), 'd')))\n stopifnot(isTRUE(all.equal(candidate(1), 'i')))\n stopifnot(isTRUE(all.equal(candidate(4), 'iv')))\n stopifnot(isTRUE(all.equal(candidate(43), 'xliii')))\n stopifnot(isTRUE(all.equal(candidate(90), 'xc')))\n stopifnot(isTRUE(all.equal(candidate(94), 'xciv')))\n stopifnot(isTRUE(all.equal(candidate(532), 'dxxxii')))\n stopifnot(isTRUE(all.equal(candidate(900), 'cm')))\n stopifnot(isTRUE(all.equal(candidate(994), 'cmxciv')))\n stopifnot(isTRUE(all.equal(candidate(1000), 'm')))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- fruit_distribution\n stopifnot(isTRUE(all.equal(candidate('5 apples and 6 oranges', 19), 8)))\n stopifnot(isTRUE(all.equal(candidate('5 apples and 6 oranges', 21), 10)))\n stopifnot(isTRUE(all.equal(candidate('0 apples and 1 oranges', 3), 2)))\n stopifnot(isTRUE(all.equal(candidate('1 apples and 0 oranges', 3), 2)))\n stopifnot(isTRUE(all.equal(candidate('2 apples and 3 oranges', 100), 95)))\n stopifnot(isTRUE(all.equal(candidate('2 apples and 3 oranges', 5), 0)))\n stopifnot(isTRUE(all.equal(candidate('1 apples and 100 oranges', 120), 19)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_67_fruit_distribution", "test": "test_humaneval <- function() {\n candidate <- fruit_distribution\n stopifnot(isTRUE(all.equal(candidate('5 apples and 6 oranges', 19), 8)))\n stopifnot(isTRUE(all.equal(candidate('5 apples and 6 oranges', 21), 10)))\n stopifnot(isTRUE(all.equal(candidate('0 apples and 1 oranges', 3), 2)))\n stopifnot(isTRUE(all.equal(candidate('1 apples and 0 oranges', 3), 2)))\n stopifnot(isTRUE(all.equal(candidate('2 apples and 3 oranges', 100), 95)))\n stopifnot(isTRUE(all.equal(candidate('2 apples and 3 oranges', 5), 0)))\n stopifnot(isTRUE(all.equal(candidate('1 apples and 100 oranges', 120), 19)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- reverse_delete\n stopifnot(isTRUE(all.equal(candidate('abcde', 'ae'), list('bcd', FALSE))))\n stopifnot(isTRUE(all.equal(candidate('abcdef', 'b'), list('acdef', FALSE))))\n stopifnot(isTRUE(all.equal(candidate('abcdedcba', 'ab'), list('cdedc', TRUE))))\n stopifnot(isTRUE(all.equal(candidate('dwik', 'w'), list('dik', FALSE))))\n stopifnot(isTRUE(all.equal(candidate('a', 'a'), list('', TRUE))))\n stopifnot(isTRUE(all.equal(candidate('abcdedcba', ''), list('abcdedcba', TRUE))))\n stopifnot(isTRUE(all.equal(candidate('abcdedcba', 'v'), list('abcdedcba', TRUE))))\n stopifnot(isTRUE(all.equal(candidate('vabba', 'v'), list('abba', TRUE))))\n stopifnot(isTRUE(all.equal(candidate('mamma', 'mia'), list('', TRUE))))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_112_reverse_delete", "test": "test_humaneval <- function() {\n candidate <- reverse_delete\n stopifnot(isTRUE(all.equal(candidate('abcde', 'ae'), list('bcd', FALSE))))\n stopifnot(isTRUE(all.equal(candidate('abcdef', 'b'), list('acdef', FALSE))))\n stopifnot(isTRUE(all.equal(candidate('abcdedcba', 'ab'), list('cdedc', TRUE))))\n stopifnot(isTRUE(all.equal(candidate('dwik', 'w'), list('dik', FALSE))))\n stopifnot(isTRUE(all.equal(candidate('a', 'a'), list('', TRUE))))\n stopifnot(isTRUE(all.equal(candidate('abcdedcba', ''), list('abcdedcba', TRUE))))\n stopifnot(isTRUE(all.equal(candidate('abcdedcba', 'v'), list('abcdedcba', TRUE))))\n stopifnot(isTRUE(all.equal(candidate('vabba', 'v'), list('abba', TRUE))))\n stopifnot(isTRUE(all.equal(candidate('mamma', 'mia'), list('', TRUE))))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- greatest_common_divisor\n stopifnot(isTRUE(all.equal(candidate(3, 7), 1)))\n stopifnot(isTRUE(all.equal(candidate(10, 15), 5)))\n stopifnot(isTRUE(all.equal(candidate(49, 14), 7)))\n stopifnot(isTRUE(all.equal(candidate(144, 60), 12)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_13_greatest_common_divisor", "test": "test_humaneval <- function() {\n candidate <- greatest_common_divisor\n stopifnot(isTRUE(all.equal(candidate(3, 7), 1)))\n stopifnot(isTRUE(all.equal(candidate(10, 15), 5)))\n stopifnot(isTRUE(all.equal(candidate(49, 14), 7)))\n stopifnot(isTRUE(all.equal(candidate(144, 60), 12)))\n}\ntest_humaneval()"}
|
||
|
{"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# c('Hello', 'world!')\n# >>> split_words('Hello,world!')\n# c('Hello', 'world!')\n# >>> split_words('abcdef')\n# 3\nsplit_words <- function(txt) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_125_split_words.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- split_words\n stopifnot(isTRUE(all.equal(candidate('Hello world!'), c('Hello', 'world!'))))\n stopifnot(isTRUE(all.equal(candidate('Hello,world!'), c('Hello', 'world!'))))\n stopifnot(isTRUE(all.equal(candidate('Hello world,!'), c('Hello', 'world,!'))))\n stopifnot(isTRUE(all.equal(candidate('Hello,Hello,world !'), c('Hello,Hello,world', '!'))))\n stopifnot(isTRUE(all.equal(candidate('abcdef'), 3)))\n stopifnot(isTRUE(all.equal(candidate('aaabb'), 2)))\n stopifnot(isTRUE(all.equal(candidate('aaaBb'), 1)))\n stopifnot(isTRUE(all.equal(candidate(''), 0)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_125_split_words", "test": "test_humaneval <- function() {\n candidate <- split_words\n stopifnot(isTRUE(all.equal(candidate('Hello world!'), c('Hello', 'world!'))))\n stopifnot(isTRUE(all.equal(candidate('Hello,world!'), c('Hello', 'world!'))))\n stopifnot(isTRUE(all.equal(candidate('Hello world,!'), c('Hello', 'world,!'))))\n stopifnot(isTRUE(all.equal(candidate('Hello,Hello,world !'), c('Hello,Hello,world', '!'))))\n stopifnot(isTRUE(all.equal(candidate('abcdef'), 3)))\n stopifnot(isTRUE(all.equal(candidate('aaabb'), 2)))\n stopifnot(isTRUE(all.equal(candidate('aaaBb'), 1)))\n stopifnot(isTRUE(all.equal(candidate(''), 0)))\n}\ntest_humaneval()"}
|
||
|
{"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# c(1, 2, 3, 4, 5)\n# >>> sort_array(c(-2, -3, -4, -5, -6))\n# c(-6, -5, -4, -3, -2)\n# >>> sort_array(c(1, 0, 2, 3, 4))\n# c(0, 1, 2, 3, 4)\nsort_array <- function(arr) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- sort_array\n stopifnot(isTRUE(all.equal(candidate(c(1, 5, 2, 3, 4)), c(1, 2, 4, 3, 5))))\n stopifnot(isTRUE(all.equal(candidate(c(-2, -3, -4, -5, -6)), c(-4, -2, -6, -5, -3))))\n stopifnot(isTRUE(all.equal(candidate(c(1, 0, 2, 3, 4)), c(0, 1, 2, 4, 3))))\n stopifnot(isTRUE(all.equal(candidate(c()), c())))\n stopifnot(isTRUE(all.equal(candidate(c(2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4)), c(2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77))))\n stopifnot(isTRUE(all.equal(candidate(c(3, 6, 44, 12, 32, 5)), c(32, 3, 5, 6, 12, 44))))\n stopifnot(isTRUE(all.equal(candidate(c(2, 4, 8, 16, 32)), c(2, 4, 8, 16, 32))))\n stopifnot(isTRUE(all.equal(candidate(c(2, 4, 8, 16, 32)), c(2, 4, 8, 16, 32))))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_116_sort_array", "test": "test_humaneval <- function() {\n candidate <- sort_array\n stopifnot(isTRUE(all.equal(candidate(c(1, 5, 2, 3, 4)), c(1, 2, 4, 3, 5))))\n stopifnot(isTRUE(all.equal(candidate(c(-2, -3, -4, -5, -6)), c(-4, -2, -6, -5, -3))))\n stopifnot(isTRUE(all.equal(candidate(c(1, 0, 2, 3, 4)), c(0, 1, 2, 4, 3))))\n stopifnot(isTRUE(all.equal(candidate(c()), c())))\n stopifnot(isTRUE(all.equal(candidate(c(2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4)), c(2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77))))\n stopifnot(isTRUE(all.equal(candidate(c(3, 6, 44, 12, 32, 5)), c(32, 3, 5, 6, 12, 44))))\n stopifnot(isTRUE(all.equal(candidate(c(2, 4, 8, 16, 32)), c(2, 4, 8, 16, 32))))\n stopifnot(isTRUE(all.equal(candidate(c(2, 4, 8, 16, 32)), c(2, 4, 8, 16, 32))))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- concatenate\n stopifnot(isTRUE(all.equal(candidate(c()), '')))\n stopifnot(isTRUE(all.equal(candidate(c('x', 'y', 'z')), 'xyz')))\n stopifnot(isTRUE(all.equal(candidate(c('x', 'y', 'z', 'w', 'k')), 'xyzwk')))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_28_concatenate", "test": "test_humaneval <- function() {\n candidate <- concatenate\n stopifnot(isTRUE(all.equal(candidate(c()), '')))\n stopifnot(isTRUE(all.equal(candidate(c('x', 'y', 'z')), 'xyz')))\n stopifnot(isTRUE(all.equal(candidate(c('x', 'y', 'z', 'w', 'k')), 'xyzwk')))\n}\ntest_humaneval()"}
|
||
|
{"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# c('aa')\n# >>> list_sort(c('ab', 'a', 'aaa', 'cd'))\n# c('ab', 'cd')\nsorted_list_sum <- function(lst) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- sorted_list_sum\n stopifnot(isTRUE(all.equal(candidate(c('aa', 'a', 'aaa')), c('aa'))))\n stopifnot(isTRUE(all.equal(candidate(c('school', 'AI', 'asdf', 'b')), c('AI', 'asdf', 'school'))))\n stopifnot(isTRUE(all.equal(candidate(c('d', 'b', 'c', 'a')), c())))\n stopifnot(isTRUE(all.equal(candidate(c('d', 'dcba', 'abcd', 'a')), c('abcd', 'dcba'))))\n stopifnot(isTRUE(all.equal(candidate(c('AI', 'ai', 'au')), c('AI', 'ai', 'au'))))\n stopifnot(isTRUE(all.equal(candidate(c('a', 'b', 'b', 'c', 'c', 'a')), c())))\n stopifnot(isTRUE(all.equal(candidate(c('aaaa', 'bbbb', 'dd', 'cc')), c('cc', 'dd', 'aaaa', 'bbbb'))))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_149_sorted_list_sum", "test": "test_humaneval <- function() {\n candidate <- sorted_list_sum\n stopifnot(isTRUE(all.equal(candidate(c('aa', 'a', 'aaa')), c('aa'))))\n stopifnot(isTRUE(all.equal(candidate(c('school', 'AI', 'asdf', 'b')), c('AI', 'asdf', 'school'))))\n stopifnot(isTRUE(all.equal(candidate(c('d', 'b', 'c', 'a')), c())))\n stopifnot(isTRUE(all.equal(candidate(c('d', 'dcba', 'abcd', 'a')), c('abcd', 'dcba'))))\n stopifnot(isTRUE(all.equal(candidate(c('AI', 'ai', 'au')), c('AI', 'ai', 'au'))))\n stopifnot(isTRUE(all.equal(candidate(c('a', 'b', 'b', 'c', 'c', 'a')), c())))\n stopifnot(isTRUE(all.equal(candidate(c('aaaa', 'bbbb', 'dd', 'cc')), c('cc', 'dd', 'aaaa', 'bbbb'))))\n}\ntest_humaneval()"}
|
||
|
{"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# c()\n# >>> filter_by_substring(c('abc', 'bacd', 'cde', 'array'), 'a')\n# c('abc', 'bacd', 'array')\nfilter_by_substring <- function(strings, substring) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- filter_by_substring\n stopifnot(isTRUE(all.equal(candidate(c(), 'john'), c())))\n stopifnot(isTRUE(all.equal(candidate(c('xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'), 'xxx'), c('xxx', 'xxxAAA', 'xxx'))))\n stopifnot(isTRUE(all.equal(candidate(c('xxx', 'asd', 'aaaxxy', 'john doe', 'xxxAAA', 'xxx'), 'xx'), c('xxx', 'aaaxxy', 'xxxAAA', 'xxx'))))\n stopifnot(isTRUE(all.equal(candidate(c('grunt', 'trumpet', 'prune', 'gruesome'), 'run'), c('grunt', 'prune'))))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_7_filter_by_substring", "test": "test_humaneval <- function() {\n candidate <- filter_by_substring\n stopifnot(isTRUE(all.equal(candidate(c(), 'john'), c())))\n stopifnot(isTRUE(all.equal(candidate(c('xxx', 'asd', 'xxy', 'john doe', 'xxxAAA', 'xxx'), 'xxx'), c('xxx', 'xxxAAA', 'xxx'))))\n stopifnot(isTRUE(all.equal(candidate(c('xxx', 'asd', 'aaaxxy', 'john doe', 'xxxAAA', 'xxx'), 'xx'), c('xxx', 'aaaxxy', 'xxxAAA', 'xxx'))))\n stopifnot(isTRUE(all.equal(candidate(c('grunt', 'trumpet', 'prune', 'gruesome'), 'run'), c('grunt', 'prune'))))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- closest_integer\n stopifnot(isTRUE(all.equal(candidate('10'), 10)))\n stopifnot(isTRUE(all.equal(candidate('14.5'), 15)))\n stopifnot(isTRUE(all.equal(candidate('-15.5'), -16)))\n stopifnot(isTRUE(all.equal(candidate('15.3'), 15)))\n stopifnot(isTRUE(all.equal(candidate('0'), 0)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_99_closest_integer", "test": "test_humaneval <- function() {\n candidate <- closest_integer\n stopifnot(isTRUE(all.equal(candidate('10'), 10)))\n stopifnot(isTRUE(all.equal(candidate('14.5'), 15)))\n stopifnot(isTRUE(all.equal(candidate('-15.5'), -16)))\n stopifnot(isTRUE(all.equal(candidate('15.3'), 15)))\n stopifnot(isTRUE(all.equal(candidate('0'), 0)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- vowels_count\n stopifnot(isTRUE(all.equal(candidate('abcde'), 2)))\n stopifnot(isTRUE(all.equal(candidate('Alone'), 3)))\n stopifnot(isTRUE(all.equal(candidate('key'), 2)))\n stopifnot(isTRUE(all.equal(candidate('bye'), 1)))\n stopifnot(isTRUE(all.equal(candidate('keY'), 2)))\n stopifnot(isTRUE(all.equal(candidate('bYe'), 1)))\n stopifnot(isTRUE(all.equal(candidate('ACEDY'), 3)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_64_vowels_count", "test": "test_humaneval <- function() {\n candidate <- vowels_count\n stopifnot(isTRUE(all.equal(candidate('abcde'), 2)))\n stopifnot(isTRUE(all.equal(candidate('Alone'), 3)))\n stopifnot(isTRUE(all.equal(candidate('key'), 2)))\n stopifnot(isTRUE(all.equal(candidate('bye'), 1)))\n stopifnot(isTRUE(all.equal(candidate('keY'), 2)))\n stopifnot(isTRUE(all.equal(candidate('bYe'), 1)))\n stopifnot(isTRUE(all.equal(candidate('ACEDY'), 3)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- find_max\n stopifnot(isTRUE(all.equal(candidate(c('name', 'of', 'string')), 'string')))\n stopifnot(isTRUE(all.equal(candidate(c('name', 'enam', 'game')), 'enam')))\n stopifnot(isTRUE(all.equal(candidate(c('aaaaaaa', 'bb', 'cc')), 'aaaaaaa')))\n stopifnot(isTRUE(all.equal(candidate(c('abc', 'cba')), 'abc')))\n stopifnot(isTRUE(all.equal(candidate(c('play', 'this', 'game', 'of', 'footbott')), 'footbott')))\n stopifnot(isTRUE(all.equal(candidate(c('we', 'are', 'gonna', 'rock')), 'gonna')))\n stopifnot(isTRUE(all.equal(candidate(c('we', 'are', 'a', 'mad', 'nation')), 'nation')))\n stopifnot(isTRUE(all.equal(candidate(c('this', 'is', 'a', 'prrk')), 'this')))\n stopifnot(isTRUE(all.equal(candidate(c('b')), 'b')))\n stopifnot(isTRUE(all.equal(candidate(c('play', 'play', 'play')), 'play')))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_158_find_max", "test": "test_humaneval <- function() {\n candidate <- find_max\n stopifnot(isTRUE(all.equal(candidate(c('name', 'of', 'string')), 'string')))\n stopifnot(isTRUE(all.equal(candidate(c('name', 'enam', 'game')), 'enam')))\n stopifnot(isTRUE(all.equal(candidate(c('aaaaaaa', 'bb', 'cc')), 'aaaaaaa')))\n stopifnot(isTRUE(all.equal(candidate(c('abc', 'cba')), 'abc')))\n stopifnot(isTRUE(all.equal(candidate(c('play', 'this', 'game', 'of', 'footbott')), 'footbott')))\n stopifnot(isTRUE(all.equal(candidate(c('we', 'are', 'gonna', 'rock')), 'gonna')))\n stopifnot(isTRUE(all.equal(candidate(c('we', 'are', 'a', 'mad', 'nation')), 'nation')))\n stopifnot(isTRUE(all.equal(candidate(c('this', 'is', 'a', 'prrk')), 'this')))\n stopifnot(isTRUE(all.equal(candidate(c('b')), 'b')))\n stopifnot(isTRUE(all.equal(candidate(c('play', 'play', 'play')), 'play')))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- string_to_md5\n stopifnot(isTRUE(all.equal(candidate('Hello world'), '3e25960a79dbc69b674cd4ec67a72c62')))\n stopifnot(isTRUE(all.equal(candidate(''), NULL)))\n stopifnot(isTRUE(all.equal(candidate('A B C'), '0ef78513b0cb8cef12743f5aeb35f888')))\n stopifnot(isTRUE(all.equal(candidate('password'), '5f4dcc3b5aa765d61d8327deb882cf99')))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_162_string_to_md5", "test": "test_humaneval <- function() {\n candidate <- string_to_md5\n stopifnot(isTRUE(all.equal(candidate('Hello world'), '3e25960a79dbc69b674cd4ec67a72c62')))\n stopifnot(isTRUE(all.equal(candidate(''), NULL)))\n stopifnot(isTRUE(all.equal(candidate('A B C'), '0ef78513b0cb8cef12743f5aeb35f888')))\n stopifnot(isTRUE(all.equal(candidate('password'), '5f4dcc3b5aa765d61d8327deb882cf99')))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- change_base\n stopifnot(isTRUE(all.equal(candidate(8, 3), '22')))\n stopifnot(isTRUE(all.equal(candidate(9, 3), '100')))\n stopifnot(isTRUE(all.equal(candidate(234, 2), '11101010')))\n stopifnot(isTRUE(all.equal(candidate(16, 2), '10000')))\n stopifnot(isTRUE(all.equal(candidate(8, 2), '1000')))\n stopifnot(isTRUE(all.equal(candidate(7, 2), '111')))\n stopifnot(isTRUE(all.equal(candidate(2, 3), '2')))\n stopifnot(isTRUE(all.equal(candidate(3, 4), '3')))\n stopifnot(isTRUE(all.equal(candidate(4, 5), '4')))\n stopifnot(isTRUE(all.equal(candidate(5, 6), '5')))\n stopifnot(isTRUE(all.equal(candidate(6, 7), '6')))\n stopifnot(isTRUE(all.equal(candidate(7, 8), '7')))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_44_change_base", "test": "test_humaneval <- function() {\n candidate <- change_base\n stopifnot(isTRUE(all.equal(candidate(8, 3), '22')))\n stopifnot(isTRUE(all.equal(candidate(9, 3), '100')))\n stopifnot(isTRUE(all.equal(candidate(234, 2), '11101010')))\n stopifnot(isTRUE(all.equal(candidate(16, 2), '10000')))\n stopifnot(isTRUE(all.equal(candidate(8, 2), '1000')))\n stopifnot(isTRUE(all.equal(candidate(7, 2), '111')))\n stopifnot(isTRUE(all.equal(candidate(2, 3), '2')))\n stopifnot(isTRUE(all.equal(candidate(3, 4), '3')))\n stopifnot(isTRUE(all.equal(candidate(4, 5), '4')))\n stopifnot(isTRUE(all.equal(candidate(5, 6), '5')))\n stopifnot(isTRUE(all.equal(candidate(6, 7), '6')))\n stopifnot(isTRUE(all.equal(candidate(7, 8), '7')))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- right_angle_triangle\n stopifnot(isTRUE(all.equal(candidate(3, 4, 5), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(1, 2, 3), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(10, 6, 8), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(2, 2, 2), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(7, 24, 25), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(10, 5, 7), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(5, 12, 13), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(15, 8, 17), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(48, 55, 73), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(1, 1, 1), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(2, 2, 10), FALSE)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_157_right_angle_triangle", "test": "test_humaneval <- function() {\n candidate <- right_angle_triangle\n stopifnot(isTRUE(all.equal(candidate(3, 4, 5), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(1, 2, 3), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(10, 6, 8), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(2, 2, 2), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(7, 24, 25), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(10, 5, 7), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(5, 12, 13), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(15, 8, 17), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(48, 55, 73), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(1, 1, 1), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(2, 2, 10), FALSE)))\n}\ntest_humaneval()"}
|
||
|
{"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# c('A+', 'B', 'C-', 'C', 'A-')\nnumerical_letter_grade <- function(grades) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- numerical_letter_grade\n stopifnot(isTRUE(all.equal(candidate(c(4.0, 3, 1.7, 2, 3.5)), c('A+', 'B', 'C-', 'C', 'A-'))))\n stopifnot(isTRUE(all.equal(candidate(c(1.2)), c('D+'))))\n stopifnot(isTRUE(all.equal(candidate(c(0.5)), c('D-'))))\n stopifnot(isTRUE(all.equal(candidate(c(0.0)), c('E'))))\n stopifnot(isTRUE(all.equal(candidate(c(1.0, 0.3, 1.5, 2.8, 3.3)), c('D', 'D-', 'C-', 'B', 'B+'))))\n stopifnot(isTRUE(all.equal(candidate(c(0.0, 0.7)), c('E', 'D-'))))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_81_numerical_letter_grade", "test": "test_humaneval <- function() {\n candidate <- numerical_letter_grade\n stopifnot(isTRUE(all.equal(candidate(c(4.0, 3, 1.7, 2, 3.5)), c('A+', 'B', 'C-', 'C', 'A-'))))\n stopifnot(isTRUE(all.equal(candidate(c(1.2)), c('D+'))))\n stopifnot(isTRUE(all.equal(candidate(c(0.5)), c('D-'))))\n stopifnot(isTRUE(all.equal(candidate(c(0.0)), c('E'))))\n stopifnot(isTRUE(all.equal(candidate(c(1.0, 0.3, 1.5, 2.8, 3.3)), c('D', 'D-', 'C-', 'B', 'B+'))))\n stopifnot(isTRUE(all.equal(candidate(c(0.0, 0.7)), c('E', 'D-'))))\n}\ntest_humaneval()"}
|
||
|
{"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# c()\n# >>> intersperse(c(1, 2, 3), 4)\n# c(1, 4, 2, 4, 3)\nintersperse <- function(numbers, delimeter) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- intersperse\n stopifnot(isTRUE(all.equal(candidate(c(), 7), c())))\n stopifnot(isTRUE(all.equal(candidate(c(5, 6, 3, 2), 8), c(5, 8, 6, 8, 3, 8, 2))))\n stopifnot(isTRUE(all.equal(candidate(c(2, 2, 2), 2), c(2, 2, 2, 2, 2))))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_5_intersperse", "test": "test_humaneval <- function() {\n candidate <- intersperse\n stopifnot(isTRUE(all.equal(candidate(c(), 7), c())))\n stopifnot(isTRUE(all.equal(candidate(c(5, 6, 3, 2), 8), c(5, 8, 6, 8, 3, 8, 2))))\n stopifnot(isTRUE(all.equal(candidate(c(2, 2, 2), 2), c(2, 2, 2, 2, 2))))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- specialFilter\n stopifnot(isTRUE(all.equal(candidate(c(5, -2, 1, -5)), 0)))\n stopifnot(isTRUE(all.equal(candidate(c(15, -73, 14, -15)), 1)))\n stopifnot(isTRUE(all.equal(candidate(c(33, -2, -3, 45, 21, 109)), 2)))\n stopifnot(isTRUE(all.equal(candidate(c(43, -12, 93, 125, 121, 109)), 4)))\n stopifnot(isTRUE(all.equal(candidate(c(71, -2, -33, 75, 21, 19)), 3)))\n stopifnot(isTRUE(all.equal(candidate(c(1)), 0)))\n stopifnot(isTRUE(all.equal(candidate(c()), 0)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_146_specialFilter", "test": "test_humaneval <- function() {\n candidate <- specialFilter\n stopifnot(isTRUE(all.equal(candidate(c(5, -2, 1, -5)), 0)))\n stopifnot(isTRUE(all.equal(candidate(c(15, -73, 14, -15)), 1)))\n stopifnot(isTRUE(all.equal(candidate(c(33, -2, -3, 45, 21, 109)), 2)))\n stopifnot(isTRUE(all.equal(candidate(c(43, -12, 93, 125, 121, 109)), 4)))\n stopifnot(isTRUE(all.equal(candidate(c(71, -2, -33, 75, 21, 19)), 3)))\n stopifnot(isTRUE(all.equal(candidate(c(1)), 0)))\n stopifnot(isTRUE(all.equal(candidate(c()), 0)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- sum_to_n\n stopifnot(isTRUE(all.equal(candidate(1), 1)))\n stopifnot(isTRUE(all.equal(candidate(6), 21)))\n stopifnot(isTRUE(all.equal(candidate(11), 66)))\n stopifnot(isTRUE(all.equal(candidate(30), 465)))\n stopifnot(isTRUE(all.equal(candidate(100), 5050)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_60_sum_to_n", "test": "test_humaneval <- function() {\n candidate <- sum_to_n\n stopifnot(isTRUE(all.equal(candidate(1), 1)))\n stopifnot(isTRUE(all.equal(candidate(6), 21)))\n stopifnot(isTRUE(all.equal(candidate(11), 66)))\n stopifnot(isTRUE(all.equal(candidate(30), 465)))\n stopifnot(isTRUE(all.equal(candidate(100), 5050)))\n}\ntest_humaneval()"}
|
||
|
{"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# c(1, 3, 4)\nremove_duplicates <- function(numbers) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- remove_duplicates\n stopifnot(isTRUE(all.equal(candidate(c()), c())))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 4)), c(1, 2, 3, 4))))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 2, 4, 3, 5)), c(1, 4, 5))))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_26_remove_duplicates", "test": "test_humaneval <- function() {\n candidate <- remove_duplicates\n stopifnot(isTRUE(all.equal(candidate(c()), c())))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 4)), c(1, 2, 3, 4))))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 2, 4, 3, 5)), c(1, 4, 5))))\n}\ntest_humaneval()"}
|
||
|
{"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# c(2, 4, 6, 8)\n# >>> generate_integers(8, 2)\n# c(2, 4, 6, 8)\n# >>> generate_integers(10, 14)\n# c()\ngenerate_integers <- function(a, b) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- generate_integers\n stopifnot(isTRUE(all.equal(candidate(2, 10), c(2, 4, 6, 8))))\n stopifnot(isTRUE(all.equal(candidate(10, 2), c(2, 4, 6, 8))))\n stopifnot(isTRUE(all.equal(candidate(132, 2), c(2, 4, 6, 8))))\n stopifnot(isTRUE(all.equal(candidate(17, 89), c())))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_163_generate_integers", "test": "test_humaneval <- function() {\n candidate <- generate_integers\n stopifnot(isTRUE(all.equal(candidate(2, 10), c(2, 4, 6, 8))))\n stopifnot(isTRUE(all.equal(candidate(10, 2), c(2, 4, 6, 8))))\n stopifnot(isTRUE(all.equal(candidate(132, 2), c(2, 4, 6, 8))))\n stopifnot(isTRUE(all.equal(candidate(17, 89), c())))\n}\ntest_humaneval()"}
|
||
|
{"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# c(1, 2, 3, 3, 3, 4, 4)\nrolling_max <- function(numbers) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- rolling_max\n stopifnot(isTRUE(all.equal(candidate(c()), c())))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 4)), c(1, 2, 3, 4))))\n stopifnot(isTRUE(all.equal(candidate(c(4, 3, 2, 1)), c(4, 4, 4, 4))))\n stopifnot(isTRUE(all.equal(candidate(c(3, 2, 3, 100, 3)), c(3, 3, 3, 100, 100))))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_9_rolling_max", "test": "test_humaneval <- function() {\n candidate <- rolling_max\n stopifnot(isTRUE(all.equal(candidate(c()), c())))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3, 4)), c(1, 2, 3, 4))))\n stopifnot(isTRUE(all.equal(candidate(c(4, 3, 2, 1)), c(4, 4, 4, 4))))\n stopifnot(isTRUE(all.equal(candidate(c(3, 2, 3, 100, 3)), c(3, 3, 3, 100, 100))))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- below_zero\n stopifnot(isTRUE(all.equal(candidate(c()), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, -3, 1, 2, -3)), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, -4, 5, 6)), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, -1, 2, -2, 5, -5, 4, -4)), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, -1, 2, -2, 5, -5, 4, -5)), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, -2, 2, -2, 5, -5, 4, -4)), TRUE)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_3_below_zero", "test": "test_humaneval <- function() {\n candidate <- below_zero\n stopifnot(isTRUE(all.equal(candidate(c()), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, -3, 1, 2, -3)), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, -4, 5, 6)), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, -1, 2, -2, 5, -5, 4, -4)), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, -1, 2, -2, 5, -5, 4, -5)), TRUE)))\n stopifnot(isTRUE(all.equal(candidate(c(1, -2, 2, -2, 5, -5, 4, -4)), TRUE)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- search\n stopifnot(isTRUE(all.equal(candidate(c(5, 5, 5, 5, 1)), 1)))\n stopifnot(isTRUE(all.equal(candidate(c(4, 1, 4, 1, 4, 4)), 4)))\n stopifnot(isTRUE(all.equal(candidate(c(3, 3)), -1)))\n stopifnot(isTRUE(all.equal(candidate(c(8, 8, 8, 8, 8, 8, 8, 8)), 8)))\n stopifnot(isTRUE(all.equal(candidate(c(2, 3, 3, 2, 2)), 2)))\n stopifnot(isTRUE(all.equal(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)))\n stopifnot(isTRUE(all.equal(candidate(c(3, 2, 8, 2)), 2)))\n stopifnot(isTRUE(all.equal(candidate(c(6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10)), 1)))\n stopifnot(isTRUE(all.equal(candidate(c(8, 8, 3, 6, 5, 6, 4)), -1)))\n stopifnot(isTRUE(all.equal(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)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 9, 10, 1, 3)), 1)))\n stopifnot(isTRUE(all.equal(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)))\n stopifnot(isTRUE(all.equal(candidate(c(1)), 1)))\n stopifnot(isTRUE(all.equal(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)))\n stopifnot(isTRUE(all.equal(candidate(c(2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10)), 2)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3)), 1)))\n stopifnot(isTRUE(all.equal(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)))\n stopifnot(isTRUE(all.equal(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)))\n stopifnot(isTRUE(all.equal(candidate(c(9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1)), 2)))\n stopifnot(isTRUE(all.equal(candidate(c(5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8)), -1)))\n stopifnot(isTRUE(all.equal(candidate(c(10)), -1)))\n stopifnot(isTRUE(all.equal(candidate(c(9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2)), 2)))\n stopifnot(isTRUE(all.equal(candidate(c(5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8)), 1)))\n stopifnot(isTRUE(all.equal(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)))\n stopifnot(isTRUE(all.equal(candidate(c(3, 10, 10, 9, 2)), -1)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_69_search", "test": "test_humaneval <- function() {\n candidate <- search\n stopifnot(isTRUE(all.equal(candidate(c(5, 5, 5, 5, 1)), 1)))\n stopifnot(isTRUE(all.equal(candidate(c(4, 1, 4, 1, 4, 4)), 4)))\n stopifnot(isTRUE(all.equal(candidate(c(3, 3)), -1)))\n stopifnot(isTRUE(all.equal(candidate(c(8, 8, 8, 8, 8, 8, 8, 8)), 8)))\n stopifnot(isTRUE(all.equal(candidate(c(2, 3, 3, 2, 2)), 2)))\n stopifnot(isTRUE(all.equal(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)))\n stopifnot(isTRUE(all.equal(candidate(c(3, 2, 8, 2)), 2)))\n stopifnot(isTRUE(all.equal(candidate(c(6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10)), 1)))\n stopifnot(isTRUE(all.equal(candidate(c(8, 8, 3, 6, 5, 6, 4)), -1)))\n stopifnot(isTRUE(all.equal(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)))\n stopifnot(isTRUE(all.equal(candidate(c(1, 9, 10, 1, 3
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- correct_bracketing\n stopifnot(isTRUE(all.equal(candidate('()'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('(()())'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('()()(()())()'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('()()((()()())())(()()(()))'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('((()())))'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(')(()'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('('), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('(((('), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(')'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('(()'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('()()(()())())(()'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('()()(()())()))()'), FALSE)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_61_correct_bracketing", "test": "test_humaneval <- function() {\n candidate <- correct_bracketing\n stopifnot(isTRUE(all.equal(candidate('()'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('(()())'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('()()(()())()'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('()()((()()())())(()()(()))'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('((()())))'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(')(()'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('('), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('(((('), FALSE)))\n stopifnot(isTRUE(all.equal(candidate(')'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('(()'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('()()(()())())(()'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('()()(()())()))()'), FALSE)))\n}\ntest_humaneval()"}
|
||
|
{"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# c(1, 2, 3)\n# >>> sort_even(c(5, 6, 3, 4))\n# c(3, 6, 5, 4)\nsort_even <- function(l) {", "doctests": "transform", "original": "/home/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- sort_even\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3)), c(1, 2, 3))))\n stopifnot(isTRUE(all.equal(candidate(c(5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10)), c(-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123))))\n stopifnot(isTRUE(all.equal(candidate(c(5, 8, -12, 4, 23, 2, 3, 11, 12, -10)), c(-12, 8, 3, 4, 5, 2, 12, 11, 23, -10))))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_37_sort_even", "test": "test_humaneval <- function() {\n candidate <- sort_even\n stopifnot(isTRUE(all.equal(candidate(c(1, 2, 3)), c(1, 2, 3))))\n stopifnot(isTRUE(all.equal(candidate(c(5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10)), c(-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123))))\n stopifnot(isTRUE(all.equal(candidate(c(5, 8, -12, 4, 23, 2, 3, 11, 12, -10)), c(-12, 8, 3, 4, 5, 2, 12, 11, 23, -10))))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- same_chars\n stopifnot(isTRUE(all.equal(candidate('eabcdzzzz', 'dddzzzzzzzddeddabc'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('abcd', 'dddddddabc'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('dddddddabc', 'abcd'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('eabcd', 'dddddddabc'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('abcd', 'dddddddabcf'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('eabcdzzzz', 'dddzzzzzzzddddabc'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('aabb', 'aaccc'), FALSE)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_54_same_chars", "test": "test_humaneval <- function() {\n candidate <- same_chars\n stopifnot(isTRUE(all.equal(candidate('eabcdzzzz', 'dddzzzzzzzddeddabc'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('abcd', 'dddddddabc'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('dddddddabc', 'abcd'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('eabcd', 'dddddddabc'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('abcd', 'dddddddabcf'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('eabcdzzzz', 'dddzzzzzzzddddabc'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('aabb', 'aaccc'), FALSE)))\n}\ntest_humaneval()"}
|
||
|
{"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/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py", "prompt_terminology": "reworded", "tests": "test_humaneval <- function() {\n candidate <- correct_bracketing\n stopifnot(isTRUE(all.equal(candidate('<>'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('<<><>>'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('<><><<><>><>'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('<><><<<><><>><>><<><><<>>>'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('<<<><>>>>'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('><<>'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('<'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('<<<<'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('>'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('<<>'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('<><><<><>><>><<>'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('<><><<><>><>>><>'), FALSE)))\n}\ntest_humaneval()", "stop_tokens": ["\n#", "\n```"], "task_id": "HumanEval_56_correct_bracketing", "test": "test_humaneval <- function() {\n candidate <- correct_bracketing\n stopifnot(isTRUE(all.equal(candidate('<>'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('<<><>>'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('<><><<><>><>'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('<><><<<><><>><>><<><><<>>>'), TRUE)))\n stopifnot(isTRUE(all.equal(candidate('<<<><>>>>'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('><<>'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('<'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('<<<<'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('>'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('<<>'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('<><><<><>><>><<>'), FALSE)))\n stopifnot(isTRUE(all.equal(candidate('<><><<><>><>>><>'), FALSE)))\n}\ntest_humaneval()"}
|