name
stringlengths 15
44
| language
stringclasses 1
value | prompt
stringlengths 311
1.97k
| doctests
stringclasses 1
value | original
stringlengths 108
137
| prompt_terminology
stringclasses 1
value | tests
stringlengths 300
2.15k
| stop_tokens
sequencelengths 1
1
|
---|---|---|---|---|---|---|---|
HumanEval_105_by_length | adb | pragma Ada_2022;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
package Placeholder is
type Integer_Array is array (Positive range <>) of Integer;
type Unbounded_String_Array is array (Positive range <>) of Unbounded_String;
function By_Length (Arr : Integer_Array) return Unbounded_String_Array;
-- Given an array of integers, sort the integers that are between 1 and 9 inclusive,
-- reverse the resulting array, and then replace each digit by its corresponding name from
-- "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine".
-- For example:
-- >>> By_Length ([2, 1, 1, 4, 5, 8, 2, 3])
-- [To_Unbounded_String ("Eight"), To_Unbounded_String ("Five"), To_Unbounded_String ("Four"), To_Unbounded_String ("Three"), To_Unbounded_String ("Two"), To_Unbounded_String ("Two"), To_Unbounded_String ("One"), To_Unbounded_String ("One")]
-- If the array is empty, return an empty array:
-- >>> By_Length ([])
-- []
-- If the array has any strange number ignore it:
-- >>> By_Length ([1, -1, 55])
-- [To_Unbounded_String ("One")]
end Placeholder;
pragma Ada_2022;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
package body Placeholder is
function By_Length (Arr : Integer_Array) return Unbounded_String_Array | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_105_by_length.py | reworded |
end By_Length;
end Placeholder;
pragma Ada_2022;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (Arr : Integer_Array) return Unbounded_String_Array renames Placeholder.By_Length;
begin
pragma Assert (Candidate ([2, 1, 1, 4, 5, 8, 2, 3]) = [To_Unbounded_String ("Eight"), To_Unbounded_String ("Five"), To_Unbounded_String ("Four"), To_Unbounded_String ("Three"), To_Unbounded_String ("Two"), To_Unbounded_String ("Two"), To_Unbounded_String ("One"), To_Unbounded_String ("One")]);
pragma Assert (Candidate ([]) = []);
pragma Assert (Candidate ([1, -1, 55]) = [To_Unbounded_String ("One")]);
pragma Assert (Candidate ([1, -1, 3, 2]) = [To_Unbounded_String ("Three"), To_Unbounded_String ("Two"), To_Unbounded_String ("One")]);
pragma Assert (Candidate ([9, 4, 8]) = [To_Unbounded_String ("Nine"), To_Unbounded_String ("Eight"), To_Unbounded_String ("Four")]);
end Main; | [
"\n end "
] |
HumanEval_106_f | adb | pragma Ada_2022;
package Placeholder is
type Integer_Array is array (Positive range <>) of Integer;
function F (N : Integer) return Integer_Array;
-- Implement the function f that takes n as a parameter,
-- and returns a Vector of size n, such that the value of the element at index i is the factorial of i if i is even
-- or the sum of numbers from 1 to i otherwise.
-- i starts from 1.
-- the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).
-- Example:
-- >>> F (5)
-- [1, 2, 6, 24, 15]
end Placeholder;
pragma Ada_2022;
package body Placeholder is
function F (N : Integer) return Integer_Array | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_106_f.py | reworded |
end F;
end Placeholder;
pragma Ada_2022;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (N : Integer) return Integer_Array renames Placeholder.F;
begin
pragma Assert (Candidate (5) = [1, 2, 6, 24, 15]);
pragma Assert (Candidate (7) = [1, 2, 6, 24, 15, 720, 28]);
pragma Assert (Candidate (1) = [1]);
pragma Assert (Candidate (3) = [1, 2, 6]);
end Main; | [
"\n end "
] |
HumanEval_107_even_odd_palindrome | adb | pragma Ada_2022;
package Placeholder is
type Integer_Integer_Tuple is record
Integer_1 : Integer;
Integer_2 : Integer;
end record;
function Even_Odd_Palindrome (N : Integer) return Integer_Integer_Tuple;
-- Given a positive integer n, return a record that has the number of even and odd
-- integer palindromes that fall within the range(1, n), inclusive.
-- Example 1:
-- >>> Even_Odd_Palindrome (3)
-- (1, 2)
-- Explanation:
-- Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.
-- Example 2:
-- >>> Even_Odd_Palindrome (12)
-- (4, 6)
-- Explanation:
-- Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.
-- Note:
-- 1. 1 <= n <= 10^3
-- 2. returned record has the number of even and odd integer palindromes respectively.
end Placeholder;
pragma Ada_2022;
package body Placeholder is
function Even_Odd_Palindrome (N : Integer) return Integer_Integer_Tuple | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_107_even_odd_palindrome.py | reworded |
end Even_Odd_Palindrome;
end Placeholder;
pragma Ada_2022;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (N : Integer) return Integer_Integer_Tuple renames Placeholder.Even_Odd_Palindrome;
begin
pragma Assert (Candidate (123) = (8, 13));
pragma Assert (Candidate (12) = (4, 6));
pragma Assert (Candidate (3) = (1, 2));
pragma Assert (Candidate (63) = (6, 8));
pragma Assert (Candidate (25) = (5, 6));
pragma Assert (Candidate (19) = (4, 6));
pragma Assert (Candidate (9) = (4, 5));
pragma Assert (Candidate (1) = (0, 1));
end Main; | [
"\n end "
] |
HumanEval_108_count_nums | adb | pragma Ada_2022;
package Placeholder is
type Integer_Array is array (Positive range <>) of Integer;
function Count_Nums (Arr : Integer_Array) return Integer;
-- Write a function count_nums which takes an array of integers and returns
-- the number of elements which has a sum of digits > 0.
-- If a number is negative, then its first signed digit will be negative:
-- e.g. -123 has signed digits -1, 2, and 3.
-- >>> Count_Nums ([])
-- 0
-- >>> Count_Nums ([-1, 11, -11])
-- 1
-- >>> Count_Nums ([1, 1, 2])
-- 3
end Placeholder;
pragma Ada_2022;
package body Placeholder is
function Count_Nums (Arr : Integer_Array) return Integer | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_108_count_nums.py | reworded |
end Count_Nums;
end Placeholder;
pragma Ada_2022;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (Arr : Integer_Array) return Integer renames Placeholder.Count_Nums;
begin
pragma Assert (Candidate ([]) = 0);
pragma Assert (Candidate ([-1, -2, 0]) = 0);
pragma Assert (Candidate ([1, 1, 2, -2, 3, 4, 5]) = 6);
pragma Assert (Candidate ([1, 6, 9, -6, 0, 1, 5]) = 5);
pragma Assert (Candidate ([1, 100, 98, -7, 1, -1]) = 4);
pragma Assert (Candidate ([12, 23, 34, -45, -56, 0]) = 5);
pragma Assert (Candidate ([0, 1]) = 1);
pragma Assert (Candidate ([1]) = 1);
end Main; | [
"\n end "
] |
HumanEval_109_move_one_ball | adb | pragma Ada_2022;
package Placeholder is
type Integer_Array is array (Positive range <>) of Integer;
function Move_One_Ball (Arr : Integer_Array) return Boolean;
-- We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The
-- numbers in the array will be randomly ordered. Your task is to determine if
-- it is possible to get an array sorted in non-decreasing order by performing
-- the following operation on the given array:
-- You are allowed to perform right shift operation any number of times.
-- One right shift operation means shifting all elements of the array by one
-- position in the right direction. The last element of the array will be moved to
-- the starting position in the array i.e. 0th index.
-- If it is possible to obtain the sorted array by performing the above operation
-- then return True else return False.
-- If the given array is empty then return True.
-- Note: The given Vector is guaranteed to have unique elements.
-- For Example:
-- >>> Move_One_Ball ([3, 4, 5, 1, 2])
-- True
-- Explanation: By performin 2 right shift operations, non-decreasing order can
-- be achieved for the given array.
-- >>> Move_One_Ball ([3, 5, 4, 1, 2])
-- False
-- Explanation:It is not possible to get non-decreasing order for the given
-- array by performing any number of right shift operations.
end Placeholder;
pragma Ada_2022;
package body Placeholder is
function Move_One_Ball (Arr : Integer_Array) return Boolean | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_109_move_one_ball.py | reworded |
end Move_One_Ball;
end Placeholder;
pragma Ada_2022;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (Arr : Integer_Array) return Boolean renames Placeholder.Move_One_Ball;
begin
pragma Assert (Candidate ([3, 4, 5, 1, 2]) = True);
pragma Assert (Candidate ([3, 5, 10, 1, 2]) = True);
pragma Assert (Candidate ([4, 3, 1, 2]) = False);
pragma Assert (Candidate ([3, 5, 4, 1, 2]) = False);
pragma Assert (Candidate ([]) = True);
end Main; | [
"\n end "
] |
HumanEval_110_exchange | adb | pragma Ada_2022;
package Placeholder is
type Integer_Array is array (Positive range <>) of Integer;
function Exchange (Lst1 : Integer_Array; Lst2 : Integer_Array) return String;
-- In this problem, you will implement a function that takes two Vectors of numbers,
-- and determines whether it is possible to perform an exchange of elements
-- between them to make lst1 a Vector of only even numbers.
-- There is no limit on the number of exchanged elements between lst1 and lst2.
-- If it is possible to exchange elements between the lst1 and lst2 to make
-- all the elements of lst1 to be even, return "YES".
-- Otherwise, return "NO".
-- For example:
-- >>> Exchange ([1, 2, 3, 4], [1, 2, 3, 4])
-- "YES"
-- >>> Exchange ([1, 2, 3, 4], [1, 5, 3, 4])
-- "NO"
-- It is assumed that the input Vectors will be non-empty.
end Placeholder;
pragma Ada_2022;
package body Placeholder is
function Exchange (Lst1 : Integer_Array; Lst2 : Integer_Array) return String | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_110_exchange.py | reworded |
end Exchange;
end Placeholder;
pragma Ada_2022;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (Lst1 : Integer_Array; Lst2 : Integer_Array) return String renames Placeholder.Exchange;
begin
pragma Assert (Candidate ([1, 2, 3, 4], [1, 2, 3, 4]) = "YES");
pragma Assert (Candidate ([1, 2, 3, 4], [1, 5, 3, 4]) = "NO");
pragma Assert (Candidate ([1, 2, 3, 4], [2, 1, 4, 3]) = "YES");
pragma Assert (Candidate ([5, 7, 3], [2, 6, 4]) = "YES");
pragma Assert (Candidate ([5, 7, 3], [2, 6, 3]) = "NO");
pragma Assert (Candidate ([3, 2, 6, 1, 8, 9], [3, 5, 5, 1, 1, 1]) = "NO");
pragma Assert (Candidate ([100, 200], [200, 200]) = "YES");
end Main; | [
"\n end "
] |
HumanEval_111_histogram | adb | pragma Ada_2022;
with Ada.Containers.Indefinite_Ordered_Maps;
package Placeholder is
package String_Integer_Dict is new Ada.Containers.Indefinite_Ordered_Maps (Key_Type => String, Element_Type => Integer);
use String_Integer_Dict;
function Histogram (Test : String) return String_Integer_Dict.Map;
-- Given a string representing a space separated lowercase letters, return a Map
-- of the letter with the most repetition and containing the corresponding count.
-- If several letters have the same occurrence, return all of them.
-- Example:
-- >>> Histogram ("a b c")
-- ["a" => 1, "b" => 1, "c" => 1]
-- >>> Histogram ("a b b a")
-- ["a" => 2, "b" => 2]
-- >>> Histogram ("a b c a b")
-- ["a" => 2, "b" => 2]
-- >>> Histogram ("b b b b a")
-- ["b" => 4]
-- >>> Histogram ("")
-- []
end Placeholder;
pragma Ada_2022;
with Ada.Containers.Indefinite_Ordered_Maps;
package body Placeholder is
function Histogram (Test : String) return String_Integer_Dict.Map | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_111_histogram.py | reworded |
end Histogram;
end Placeholder;
pragma Ada_2022;
with Ada.Containers.Indefinite_Ordered_Maps;
with Placeholder; use Placeholder;
procedure Main is
use String_Integer_Dict;
function Candidate (Test : String) return String_Integer_Dict.Map renames Placeholder.Histogram;
begin
pragma Assert (Candidate ("a b b a") = ["a" => 2, "b" => 2]);
pragma Assert (Candidate ("a b c a b") = ["a" => 2, "b" => 2]);
pragma Assert (Candidate ("a b c d g") = ["a" => 1, "b" => 1, "c" => 1, "d" => 1, "g" => 1]);
pragma Assert (Candidate ("r t g") = ["r" => 1, "t" => 1, "g" => 1]);
pragma Assert (Candidate ("b b b b a") = ["b" => 4]);
pragma Assert (Candidate ("r t g") = ["r" => 1, "t" => 1, "g" => 1]);
pragma Assert (Candidate ("") = []);
pragma Assert (Candidate ("a") = ["a" => 1]);
end Main; | [
"\n end "
] |
HumanEval_112_reverse_delete | adb | pragma Ada_2022;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
package Placeholder is
type Unbounded_String_Boolean_Tuple is record
Unbounded_String_1 : Unbounded_String;
Boolean_2 : Boolean;
end record;
function Reverse_Delete (S : String; C : String) return Unbounded_String_Boolean_Tuple;
-- Task
-- We are given two strings s and c, you have to deleted all the characters in s that are equal to any character in c
-- then check if the result string is palindrome.
-- A string is called palindrome if it reads the same backward as forward.
-- You should return a record containing the result string and True/False for the check.
-- Example
-- >>> Reverse_Delete ("abcde", "ae")
-- (To_Unbounded_String ("bcd"), False)
-- >>> Reverse_Delete ("abcdef", "b")
-- (To_Unbounded_String ("acdef"), False)
-- >>> Reverse_Delete ("abcdedcba", "ab")
-- (To_Unbounded_String ("cdedc"), True)
end Placeholder;
pragma Ada_2022;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
package body Placeholder is
function Reverse_Delete (S : String; C : String) return Unbounded_String_Boolean_Tuple | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_112_reverse_delete.py | reworded |
end Reverse_Delete;
end Placeholder;
pragma Ada_2022;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (S : String; C : String) return Unbounded_String_Boolean_Tuple renames Placeholder.Reverse_Delete;
begin
pragma Assert (Candidate ("abcde", "ae") = (To_Unbounded_String ("bcd"), False));
pragma Assert (Candidate ("abcdef", "b") = (To_Unbounded_String ("acdef"), False));
pragma Assert (Candidate ("abcdedcba", "ab") = (To_Unbounded_String ("cdedc"), True));
pragma Assert (Candidate ("dwik", "w") = (To_Unbounded_String ("dik"), False));
pragma Assert (Candidate ("a", "a") = ("", True));
pragma Assert (Candidate ("abcdedcba", "") = (To_Unbounded_String ("abcdedcba"), True));
pragma Assert (Candidate ("abcdedcba", "v") = (To_Unbounded_String ("abcdedcba"), True));
pragma Assert (Candidate ("vabba", "v") = (To_Unbounded_String ("abba"), True));
pragma Assert (Candidate ("mamma", "mia") = ("", True));
end Main; | [
"\n end "
] |
HumanEval_113_odd_count | adb | pragma Ada_2022;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
package Placeholder is
type Unbounded_String_Array is array (Positive range <>) of Unbounded_String;
function Odd_Count (Lst : Unbounded_String_Array) return Unbounded_String_Array;
-- Given a Vector of strings, where each string consists of only digits, return a Vector.
-- Each element i of the output should be "the number of odd elements in the
-- string i of the input." where all the i's should be replaced by the number
-- of odd digits in the i'th string of the input.
-- >>> Odd_Count ([To_Unbounded_String ("1234567")])
-- [To_Unbounded_String ("the number of odd elements 4n the str4ng 4 of the 4nput.")]
-- >>> Odd_Count ([To_Unbounded_String ("3"), To_Unbounded_String ("11111111")])
-- [To_Unbounded_String ("the number of odd elements 1n the str1ng 1 of the 1nput."), To_Unbounded_String ("the number of odd elements 8n the str8ng 8 of the 8nput.")]
end Placeholder;
pragma Ada_2022;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
package body Placeholder is
function Odd_Count (Lst : Unbounded_String_Array) return Unbounded_String_Array | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_113_odd_count.py | reworded |
end Odd_Count;
end Placeholder;
pragma Ada_2022;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (Lst : Unbounded_String_Array) return Unbounded_String_Array renames Placeholder.Odd_Count;
begin
pragma Assert (Candidate ([To_Unbounded_String ("1234567")]) = [To_Unbounded_String ("the number of odd elements 4n the str4ng 4 of the 4nput.")]);
pragma Assert (Candidate ([To_Unbounded_String ("3"), To_Unbounded_String ("11111111")]) = [To_Unbounded_String ("the number of odd elements 1n the str1ng 1 of the 1nput."), To_Unbounded_String ("the number of odd elements 8n the str8ng 8 of the 8nput.")]);
pragma Assert (Candidate ([To_Unbounded_String ("271"), To_Unbounded_String ("137"), To_Unbounded_String ("314")]) = [To_Unbounded_String ("the number of odd elements 2n the str2ng 2 of the 2nput."), To_Unbounded_String ("the number of odd elements 3n the str3ng 3 of the 3nput."), To_Unbounded_String ("the number of odd elements 2n the str2ng 2 of the 2nput.")]);
end Main; | [
"\n end "
] |
HumanEval_114_minSubArraySum | adb | pragma Ada_2022;
package Placeholder is
type Integer_Array is array (Positive range <>) of Integer;
function Min_Sub_Array_Sum (Nums : Integer_Array) return Integer;
-- Given an array of integers nums, find the minimum sum of any non-empty sub-array
-- of nums.
-- Example
-- >>> Minsubarraysum ([2, 3, 4, 1, 2, 4])
-- 1
-- >>> Minsubarraysum ([-1, -2, -3])
-- -6
end Placeholder;
pragma Ada_2022;
package body Placeholder is
function Min_Sub_Array_Sum (Nums : Integer_Array) return Integer | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_114_minSubArraySum.py | reworded |
end Min_Sub_Array_Sum;
end Placeholder;
pragma Ada_2022;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (Nums : Integer_Array) return Integer renames Placeholder.Min_Sub_Array_Sum;
begin
pragma Assert (Candidate ([2, 3, 4, 1, 2, 4]) = 1);
pragma Assert (Candidate ([-1, -2, -3]) = -6);
pragma Assert (Candidate ([-1, -2, -3, 2, -10]) = -14);
pragma Assert (Candidate ([-9999999999999999]) = -9999999999999999);
pragma Assert (Candidate ([0, 10, 20, 1000000]) = 0);
pragma Assert (Candidate ([-1, -2, -3, 10, -5]) = -6);
pragma Assert (Candidate ([100, -1, -2, -3, 10, -5]) = -6);
pragma Assert (Candidate ([10, 11, 13, 8, 3, 4]) = 3);
pragma Assert (Candidate ([100, -33, 32, -1, 0, -2]) = -33);
pragma Assert (Candidate ([-10]) = -10);
pragma Assert (Candidate ([7]) = 7);
pragma Assert (Candidate ([1, -1]) = -1);
end Main; | [
"\n end "
] |
HumanEval_115_max_fill | adb | pragma Ada_2022;
with Ada.Containers.Vectors;
package Placeholder is
package Integer_Vector is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => Integer);
use Integer_Vector;
type Integer_Vector_Vector_Array is array (Positive range <>) of Integer_Vector.Vector;
function Max_Fill (Grid : Integer_Vector_Vector_Array; Capacity : Integer) return Integer;
-- You are given a rectangular grid of wells. Each row represents a single well,
-- and each 1 in a row represents a single unit of water.
-- Each well has a corresponding bucket that can be used to extract water from it,
-- and all buckets have the same capacity.
-- Your task is to use the buckets to empty the wells.
-- Output the number of times you need to lower the buckets.
-- Example 1:
-- >>> Max_Fill ([[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], 1)
-- 6
-- Example 2:
-- >>> Max_Fill ([[0, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 1, 1, 1]], 2)
-- 5
-- Example 3:
-- >>> Max_Fill ([[0, 0, 0], [0, 0, 0]], 5)
-- 0
-- Constraints:
-- * all wells have the same length
-- * 1 <= grid.length <= 10^2
-- * 1 <= grid[:,1].length <= 10^2
-- * grid[i][j] -> 0 | 1
-- * 1 <= capacity <= 10
end Placeholder;
pragma Ada_2022;
with Ada.Containers.Vectors;
package body Placeholder is
function Max_Fill (Grid : Integer_Vector_Vector_Array; Capacity : Integer) return Integer | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_115_max_fill.py | reworded |
end Max_Fill;
end Placeholder;
pragma Ada_2022;
with Ada.Containers.Vectors;
with Placeholder; use Placeholder;
procedure Main is
use Integer_Vector;
function Candidate (Grid : Integer_Vector_Vector_Array; Capacity : Integer) return Integer renames Placeholder.Max_Fill;
begin
pragma Assert (Candidate ([[0, 0, 1, 0], [0, 1, 0, 0], [1, 1, 1, 1]], 1) = 6);
pragma Assert (Candidate ([[0, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 1, 1, 1]], 2) = 5);
pragma Assert (Candidate ([[0, 0, 0], [0, 0, 0]], 5) = 0);
pragma Assert (Candidate ([[1, 1, 1, 1], [1, 1, 1, 1]], 2) = 4);
pragma Assert (Candidate ([[1, 1, 1, 1], [1, 1, 1, 1]], 9) = 2);
end Main; | [
"\n end "
] |
HumanEval_116_sort_array | adb | pragma Ada_2022;
package Placeholder is
type Integer_Array is array (Positive range <>) of Integer;
function Sort_Array (Arr : Integer_Array) return Integer_Array;
-- In this Kata, you have to sort an array of non-negative integers according to
-- number of ones in their binary representation in ascending order.
-- For similar number of ones, sort based on decimal value.
-- It must be implemented like this:
-- >>> Sort_Array ([1, 5, 2, 3, 4])
-- [1, 2, 3, 4, 5]
-- >>> Sort_Array ([-2, -3, -4, -5, -6])
-- [-6, -5, -4, -3, -2]
-- >>> Sort_Array ([1, 0, 2, 3, 4])
-- [0, 1, 2, 3, 4]
end Placeholder;
pragma Ada_2022;
package body Placeholder is
function Sort_Array (Arr : Integer_Array) return Integer_Array | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_116_sort_array.py | reworded |
end Sort_Array;
end Placeholder;
pragma Ada_2022;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (Arr : Integer_Array) return Integer_Array renames Placeholder.Sort_Array;
begin
pragma Assert (Candidate ([1, 5, 2, 3, 4]) = [1, 2, 4, 3, 5]);
pragma Assert (Candidate ([-2, -3, -4, -5, -6]) = [-4, -2, -6, -5, -3]);
pragma Assert (Candidate ([1, 0, 2, 3, 4]) = [0, 1, 2, 4, 3]);
pragma Assert (Candidate ([]) = []);
pragma Assert (Candidate ([2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4]) = [2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77]);
pragma Assert (Candidate ([3, 6, 44, 12, 32, 5]) = [32, 3, 5, 6, 12, 44]);
pragma Assert (Candidate ([2, 4, 8, 16, 32]) = [2, 4, 8, 16, 32]);
pragma Assert (Candidate ([2, 4, 8, 16, 32]) = [2, 4, 8, 16, 32]);
end Main; | [
"\n end "
] |
HumanEval_117_select_words | adb | pragma Ada_2022;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
package Placeholder is
type Unbounded_String_Array is array (Positive range <>) of Unbounded_String;
function Select_Words (S : String; N : Integer) return Unbounded_String_Array;
-- Given a string s and a natural number n, you have been tasked to implement
-- a function that returns a Vector of all words from string s that contain exactly
-- n consonants, in order these words appear in the string s.
-- If the string s is empty then the function should return an empty Vector.
-- Note: you may assume the input string contains only letters and spaces.
-- Examples:
-- >>> Select_Words ("Mary had a little lamb", 4)
-- [To_Unbounded_String ("little")]
-- >>> Select_Words ("Mary had a little lamb", 3)
-- [To_Unbounded_String ("Mary"), To_Unbounded_String ("lamb")]
-- >>> Select_Words ("simple white space", 2)
-- []
-- >>> Select_Words ("Hello world", 4)
-- [To_Unbounded_String ("world")]
-- >>> Select_Words ("Uncle sam", 3)
-- [To_Unbounded_String ("Uncle")]
end Placeholder;
pragma Ada_2022;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
package body Placeholder is
function Select_Words (S : String; N : Integer) return Unbounded_String_Array | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_117_select_words.py | reworded |
end Select_Words;
end Placeholder;
pragma Ada_2022;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (S : String; N : Integer) return Unbounded_String_Array renames Placeholder.Select_Words;
begin
pragma Assert (Candidate ("Mary had a little lamb", 4) = [To_Unbounded_String ("little")]);
pragma Assert (Candidate ("Mary had a little lamb", 3) = [To_Unbounded_String ("Mary"), To_Unbounded_String ("lamb")]);
pragma Assert (Candidate ("simple white space", 2) = []);
pragma Assert (Candidate ("Hello world", 4) = [To_Unbounded_String ("world")]);
pragma Assert (Candidate ("Uncle sam", 3) = [To_Unbounded_String ("Uncle")]);
pragma Assert (Candidate ("", 4) = []);
pragma Assert (Candidate ("a b c d e f", 1) = [To_Unbounded_String ("b"), To_Unbounded_String ("c"), To_Unbounded_String ("d"), To_Unbounded_String ("f")]);
end Main; | [
"\n end "
] |
HumanEval_118_get_closest_vowel | adb | pragma Ada_2022;
package Placeholder is
function Get_Closest_Vowel (Word : String) return String;
-- You are given a word. Your task is to find the closest vowel that stands between
-- two consonants from the right side of the word (case sensitive).
-- Vowels in the beginning and ending doesn't count. Return empty string if you didn't
-- find any vowel met the above condition.
-- You may assume that the given string contains English letter only.
-- Example:
-- >>> Get_Closest_Vowel ("yogurt")
-- "u"
-- >>> Get_Closest_Vowel ("FULL")
-- "U"
-- >>> Get_Closest_Vowel ("quick")
-- ""
-- >>> Get_Closest_Vowel ("ab")
-- ""
end Placeholder;
pragma Ada_2022;
package body Placeholder is
function Get_Closest_Vowel (Word : String) return String | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_118_get_closest_vowel.py | reworded |
end Get_Closest_Vowel;
end Placeholder;
pragma Ada_2022;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (Word : String) return String renames Placeholder.Get_Closest_Vowel;
begin
pragma Assert (Candidate ("yogurt") = "u");
pragma Assert (Candidate ("full") = "u");
pragma Assert (Candidate ("easy") = "");
pragma Assert (Candidate ("eAsy") = "");
pragma Assert (Candidate ("ali") = "");
pragma Assert (Candidate ("bad") = "a");
pragma Assert (Candidate ("most") = "o");
pragma Assert (Candidate ("ab") = "");
pragma Assert (Candidate ("ba") = "");
pragma Assert (Candidate ("quick") = "");
pragma Assert (Candidate ("anime") = "i");
pragma Assert (Candidate ("Asia") = "");
pragma Assert (Candidate ("Above") = "o");
end Main; | [
"\n end "
] |
HumanEval_119_match_parens | adb | pragma Ada_2022;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
package Placeholder is
type Unbounded_String_Array is array (Positive range <>) of Unbounded_String;
function Match_Parens (Lst : Unbounded_String_Array) return String;
-- You are given a Vector of two strings, both strings consist of open
-- parentheses '(' or close parentheses ')' only.
-- Your job is to check if it is possible to concatenate the two strings in
-- some order, that the resulting string will be good.
-- A string S is considered to be good if and only if all parentheses in S
-- are balanced. For example: the string '(())()' is good, while the string
-- '())' is not.
-- Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.
-- Examples:
-- >>> Match_Parens ([To_Unbounded_String ("()("), To_Unbounded_String (")")])
-- "Yes"
-- >>> Match_Parens ([To_Unbounded_String (")"), To_Unbounded_String (")")])
-- "No"
end Placeholder;
pragma Ada_2022;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
package body Placeholder is
function Match_Parens (Lst : Unbounded_String_Array) return String | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_119_match_parens.py | reworded |
end Match_Parens;
end Placeholder;
pragma Ada_2022;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (Lst : Unbounded_String_Array) return String renames Placeholder.Match_Parens;
begin
pragma Assert (Candidate ([To_Unbounded_String ("()("), To_Unbounded_String (")")]) = "Yes");
pragma Assert (Candidate ([To_Unbounded_String (")"), To_Unbounded_String (")")]) = "No");
pragma Assert (Candidate ([To_Unbounded_String ("(()(())"), To_Unbounded_String ("())())")]) = "No");
pragma Assert (Candidate ([To_Unbounded_String (")())"), To_Unbounded_String ("(()()(")]) = "Yes");
pragma Assert (Candidate ([To_Unbounded_String ("(())))"), To_Unbounded_String ("(()())((")]) = "Yes");
pragma Assert (Candidate ([To_Unbounded_String ("()"), To_Unbounded_String ("())")]) = "No");
pragma Assert (Candidate ([To_Unbounded_String ("(()("), To_Unbounded_String ("()))()")]) = "Yes");
pragma Assert (Candidate ([To_Unbounded_String ("(((("), To_Unbounded_String ("((())")]) = "No");
pragma Assert (Candidate ([To_Unbounded_String (")(()"), To_Unbounded_String ("(()(")]) = "No");
pragma Assert (Candidate ([To_Unbounded_String (")("), To_Unbounded_String (")(")]) = "No");
pragma Assert (Candidate ([To_Unbounded_String ("("), To_Unbounded_String (")")]) = "Yes");
pragma Assert (Candidate ([To_Unbounded_String (")"), To_Unbounded_String ("(")]) = "Yes");
end Main; | [
"\n end "
] |
HumanEval_120_maximum | adb | pragma Ada_2022;
package Placeholder is
type Integer_Array is array (Positive range <>) of Integer;
function Maximum (Arr : Integer_Array; K : Integer) return Integer_Array;
-- Given an array arr of integers and a positive integer k, return a sorted Vector
-- of length k with the maximum k numbers in arr.
-- Example 1:
-- >>> Maximum ([-3, -4, 5], 3)
-- [-4, -3, 5]
-- Example 2:
-- >>> Maximum ([4, -4, 4], 2)
-- [4, 4]
-- Example 3:
-- >>> Maximum ([-3, 2, 1, 2, -1, -2, 1], 1)
-- [2]
-- Note:
-- 1. The length of the array will be in the range of [1, 1000].
-- 2. The elements in the array will be in the range of [-1000, 1000].
-- 3. 0 <= k <= len(arr)
end Placeholder;
pragma Ada_2022;
package body Placeholder is
function Maximum (Arr : Integer_Array; K : Integer) return Integer_Array | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_120_maximum.py | reworded |
end Maximum;
end Placeholder;
pragma Ada_2022;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (Arr : Integer_Array; K : Integer) return Integer_Array renames Placeholder.Maximum;
begin
pragma Assert (Candidate ([-3, -4, 5], 3) = [-4, -3, 5]);
pragma Assert (Candidate ([4, -4, 4], 2) = [4, 4]);
pragma Assert (Candidate ([-3, 2, 1, 2, -1, -2, 1], 1) = [2]);
pragma Assert (Candidate ([123, -123, 20, 0, 1, 2, -3], 3) = [2, 20, 123]);
pragma Assert (Candidate ([-123, 20, 0, 1, 2, -3], 4) = [0, 1, 2, 20]);
pragma Assert (Candidate ([5, 15, 0, 3, -13, -8, 0], 7) = [-13, -8, 0, 0, 3, 5, 15]);
pragma Assert (Candidate ([-1, 0, 2, 5, 3, -10], 2) = [3, 5]);
pragma Assert (Candidate ([1, 0, 5, -7], 1) = [5]);
pragma Assert (Candidate ([4, -4], 2) = [-4, 4]);
pragma Assert (Candidate ([-10, 10], 2) = [-10, 10]);
pragma Assert (Candidate ([1, 2, 3, -23, 243, -400, 0], 0) = []);
end Main; | [
"\n end "
] |
HumanEval_121_solution | adb | pragma Ada_2022;
package Placeholder is
type Integer_Array is array (Positive range <>) of Integer;
function Solution (Lst : Integer_Array) return Integer;
-- Given a non-empty Vector of integers, return the sum of all of the odd elements that are in even positions.
-- Examples
-- >>> Solution ([5, 8, 7, 1])
-- 12
-- >>> Solution ([3, 3, 3, 3, 3])
-- 9
-- >>> Solution ([30, 13, 24, 321])
-- 0
end Placeholder;
pragma Ada_2022;
package body Placeholder is
function Solution (Lst : Integer_Array) return Integer | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_121_solution.py | reworded |
end Solution;
end Placeholder;
pragma Ada_2022;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (Lst : Integer_Array) return Integer renames Placeholder.Solution;
begin
pragma Assert (Candidate ([5, 8, 7, 1]) = 12);
pragma Assert (Candidate ([3, 3, 3, 3, 3]) = 9);
pragma Assert (Candidate ([30, 13, 24, 321]) = 0);
pragma Assert (Candidate ([5, 9]) = 5);
pragma Assert (Candidate ([2, 4, 8]) = 0);
pragma Assert (Candidate ([30, 13, 23, 32]) = 23);
pragma Assert (Candidate ([3, 13, 2, 9]) = 3);
end Main; | [
"\n end "
] |
HumanEval_122_add_elements | adb | pragma Ada_2022;
package Placeholder is
type Integer_Array is array (Positive range <>) of Integer;
function Add_Elements (Arr : Integer_Array; K : Integer) return Integer;
-- Given a non-empty array of integers arr and an integer k, return
-- the sum of the elements with at most two digits from the first k elements of arr.
-- Example:
-- >>> Add_Elements ([111, 21, 3, 4000, 5, 6, 7, 8, 9], 4)
-- 24
-- Constraints:
-- 1. 1 <= len(arr) <= 100
-- 2. 1 <= k <= len(arr)
end Placeholder;
pragma Ada_2022;
package body Placeholder is
function Add_Elements (Arr : Integer_Array; K : Integer) return Integer | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_122_add_elements.py | reworded |
end Add_Elements;
end Placeholder;
pragma Ada_2022;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (Arr : Integer_Array; K : Integer) return Integer renames Placeholder.Add_Elements;
begin
pragma Assert (Candidate ([1, -2, -3, 41, 57, 76, 87, 88, 99], 3) = -4);
pragma Assert (Candidate ([111, 121, 3, 4000, 5, 6], 2) = 0);
pragma Assert (Candidate ([11, 21, 3, 90, 5, 6, 7, 8, 9], 4) = 125);
pragma Assert (Candidate ([111, 21, 3, 4000, 5, 6, 7, 8, 9], 4) = 24);
pragma Assert (Candidate ([1], 1) = 1);
end Main; | [
"\n end "
] |
HumanEval_123_get_odd_collatz | adb | pragma Ada_2022;
package Placeholder is
type Integer_Array is array (Positive range <>) of Integer;
function Get_Odd_Collatz (N : Integer) return Integer_Array;
-- Given a positive integer n, return a sorted Vector that has the odd numbers in collatz sequence.
-- The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined
-- as follows: start with any positive integer n. Then each term is obtained from the
-- previous term as follows: if the previous term is even, the next term is one half of
-- the previous term. If the previous term is odd, the next term is 3 times the previous
-- term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.
-- Note:
-- 1. Collatz(1) is [1].
-- 2. returned Vector sorted in increasing order.
-- For example:
-- 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.
-- >>> Get_Odd_Collatz (5)
-- [1, 5]
end Placeholder;
pragma Ada_2022;
package body Placeholder is
function Get_Odd_Collatz (N : Integer) return Integer_Array | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_123_get_odd_collatz.py | reworded |
end Get_Odd_Collatz;
end Placeholder;
pragma Ada_2022;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (N : Integer) return Integer_Array renames Placeholder.Get_Odd_Collatz;
begin
pragma Assert (Candidate (14) = [1, 5, 7, 11, 13, 17]);
pragma Assert (Candidate (5) = [1, 5]);
pragma Assert (Candidate (12) = [1, 3, 5]);
pragma Assert (Candidate (1) = [1]);
end Main; | [
"\n end "
] |
HumanEval_124_valid_date | adb | pragma Ada_2022;
package Placeholder is
function Valid_Date (Date : String) return Boolean;
-- You have to write a function which validates a given date string and
-- returns True if the date is valid otherwise False.
-- The date is valid if all of the following rules are satisfied:
-- 1. The date string is not empty.
-- 2. The number of days is not less than 1 or higher than 31 days 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.
-- 3. The months should not be less than 1 or higher than 12.
-- 4. The date should be in the format: mm-dd-yyyy
-- >>> Valid_Date ("03-11-2000")
-- True
-- >>> Valid_Date ("15-01-2012")
-- False
-- >>> Valid_Date ("04-0-2040")
-- False
-- >>> Valid_Date ("06-04-2020")
-- True
-- >>> Valid_Date ("06/04/2020")
-- False
end Placeholder;
pragma Ada_2022;
package body Placeholder is
function Valid_Date (Date : String) return Boolean | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_124_valid_date.py | reworded |
end Valid_Date;
end Placeholder;
pragma Ada_2022;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (Date : String) return Boolean renames Placeholder.Valid_Date;
begin
pragma Assert (Candidate ("03-11-2000") = True);
pragma Assert (Candidate ("15-01-2012") = False);
pragma Assert (Candidate ("04-0-2040") = False);
pragma Assert (Candidate ("06-04-2020") = True);
pragma Assert (Candidate ("01-01-2007") = True);
pragma Assert (Candidate ("03-32-2011") = False);
pragma Assert (Candidate ("") = False);
pragma Assert (Candidate ("04-31-3000") = False);
pragma Assert (Candidate ("06-06-2005") = True);
pragma Assert (Candidate ("21-31-2000") = False);
pragma Assert (Candidate ("04-12-2003") = True);
pragma Assert (Candidate ("04122003") = False);
pragma Assert (Candidate ("20030412") = False);
pragma Assert (Candidate ("2003-04") = False);
pragma Assert (Candidate ("2003-04-12") = False);
pragma Assert (Candidate ("04-2003") = False);
end Main; | [
"\n end "
] |
HumanEval_126_is_sorted | adb | pragma Ada_2022;
package Placeholder is
type Integer_Array is array (Positive range <>) of Integer;
function Is_Sorted (Lst : Integer_Array) return Boolean;
-- Given a Vector of numbers, return whether or not they are sorted
-- in ascending order. If Vector has more than 1 duplicate of the same
-- number, return False. Assume no negative numbers and only integers.
-- Examples
-- >>> Is_Sorted ([5])
-- True
-- >>> Is_Sorted ([1, 2, 3, 4, 5])
-- True
-- >>> Is_Sorted ([1, 3, 2, 4, 5])
-- False
-- >>> Is_Sorted ([1, 2, 3, 4, 5, 6])
-- True
-- >>> Is_Sorted ([1, 2, 3, 4, 5, 6, 7])
-- True
-- >>> Is_Sorted ([1, 3, 2, 4, 5, 6, 7])
-- False
-- >>> Is_Sorted ([1, 2, 2, 3, 3, 4])
-- True
-- >>> Is_Sorted ([1, 2, 2, 2, 3, 4])
-- False
end Placeholder;
pragma Ada_2022;
package body Placeholder is
function Is_Sorted (Lst : Integer_Array) return Boolean | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_126_is_sorted.py | reworded |
end Is_Sorted;
end Placeholder;
pragma Ada_2022;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (Lst : Integer_Array) return Boolean renames Placeholder.Is_Sorted;
begin
pragma Assert (Candidate ([5]) = True);
pragma Assert (Candidate ([1, 2, 3, 4, 5]) = True);
pragma Assert (Candidate ([1, 3, 2, 4, 5]) = False);
pragma Assert (Candidate ([1, 2, 3, 4, 5, 6]) = True);
pragma Assert (Candidate ([1, 2, 3, 4, 5, 6, 7]) = True);
pragma Assert (Candidate ([1, 3, 2, 4, 5, 6, 7]) = False);
pragma Assert (Candidate ([]) = True);
pragma Assert (Candidate ([1]) = True);
pragma Assert (Candidate ([3, 2, 1]) = False);
pragma Assert (Candidate ([1, 2, 2, 2, 3, 4]) = False);
pragma Assert (Candidate ([1, 2, 3, 3, 3, 4]) = False);
pragma Assert (Candidate ([1, 2, 2, 3, 3, 4]) = True);
pragma Assert (Candidate ([1, 2, 3, 4]) = True);
end Main; | [
"\n end "
] |
HumanEval_127_intersection | adb | pragma Ada_2022;
package Placeholder is
type Integer_Integer_Tuple is record
Integer_1 : Integer;
Integer_2 : Integer;
end record;
function Intersection (Interval1 : Integer_Integer_Tuple; Interval2 : Integer_Integer_Tuple) return String;
-- You are given two intervals,
-- where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).
-- The given intervals are closed which means that the interval (start, end)
-- includes both start and end.
-- For each given interval, it is assumed that its start is less or equal its end.
-- Your task is to determine whether the length of intersection of these two
-- intervals is a prime number.
-- Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)
-- which its length is 1, which not a prime number.
-- If the length of the intersection is a prime number, return "YES",
-- otherwise, return "NO".
-- If the two intervals don't intersect, return "NO".
-- [input/output] samples:
-- >>> Intersection ((1, 2), (2, 3))
-- "NO"
-- >>> Intersection ((-1, 1), (0, 4))
-- "NO"
-- >>> Intersection ((-3, -1), (-5, 5))
-- "YES"
end Placeholder;
pragma Ada_2022;
package body Placeholder is
function Intersection (Interval1 : Integer_Integer_Tuple; Interval2 : Integer_Integer_Tuple) return String | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_127_intersection.py | reworded |
end Intersection;
end Placeholder;
pragma Ada_2022;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (Interval1 : Integer_Integer_Tuple; Interval2 : Integer_Integer_Tuple) return String renames Placeholder.Intersection;
begin
pragma Assert (Candidate ((1, 2), (2, 3)) = "NO");
pragma Assert (Candidate ((-1, 1), (0, 4)) = "NO");
pragma Assert (Candidate ((-3, -1), (-5, 5)) = "YES");
pragma Assert (Candidate ((-2, 2), (-4, 0)) = "YES");
pragma Assert (Candidate ((-11, 2), (-1, -1)) = "NO");
pragma Assert (Candidate ((1, 2), (3, 5)) = "NO");
pragma Assert (Candidate ((1, 2), (1, 2)) = "NO");
pragma Assert (Candidate ((-2, -2), (-3, -2)) = "NO");
end Main; | [
"\n end "
] |
HumanEval_128_prod_signs | adb | pragma Ada_2022;
package Placeholder is
type Integer_Array is array (Positive range <>) of Integer;
type Integer_Option (Valid : Boolean := False) is record
case Valid is
when True =>
Value : Integer;
when False =>
null;
end case;
end record;
function Prod_Signs (Arr : Integer_Array) return Integer_Option;
-- You are given an array arr of integers and you need to return
-- sum of magnitudes of integers multiplied by product of all signs
-- of each number in the array, represented by 1, -1 or 0.
-- Note: return null for empty arr.
-- Example:
-- >>> Prod_Signs ([1, 2, 2, -4])
-- (Valid => True, Value => 9)
-- >>> Prod_Signs ([0, 1])
-- (Valid => True, Value => 0)
-- >>> Prod_Signs ([])
-- (Valid => False)
end Placeholder;
pragma Ada_2022;
package body Placeholder is
function Prod_Signs (Arr : Integer_Array) return Integer_Option | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_128_prod_signs.py | reworded |
end Prod_Signs;
end Placeholder;
pragma Ada_2022;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (Arr : Integer_Array) return Integer_Option renames Placeholder.Prod_Signs;
begin
pragma Assert (Candidate ([1, 2, 2, -4]) = (Valid => True, Value => -9));
pragma Assert (Candidate ([0, 1]) = (Valid => True, Value => 0));
pragma Assert (Candidate ([1, 1, 1, 2, 3, -1, 1]) = (Valid => True, Value => -10));
pragma Assert (Candidate ([]) = (Valid => False));
pragma Assert (Candidate ([2, 4, 1, 2, -1, -1, 9]) = (Valid => True, Value => 20));
pragma Assert (Candidate ([-1, 1, -1, 1]) = (Valid => True, Value => 4));
pragma Assert (Candidate ([-1, 1, 1, 1]) = (Valid => True, Value => -4));
pragma Assert (Candidate ([-1, 1, 1, 0]) = (Valid => True, Value => 0));
end Main; | [
"\n end "
] |
HumanEval_129_minPath | adb | pragma Ada_2022;
with Ada.Containers.Vectors;
package Placeholder is
package Integer_Vector is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => Integer);
use Integer_Vector;
type Integer_Vector_Vector_Array is array (Positive range <>) of Integer_Vector.Vector;
type Integer_Array is array (Positive range <>) of Integer;
function Min_Path (Grid : Integer_Vector_Vector_Array; K : Integer) return Integer_Array;
-- Given a grid with N rows and N columns (N >= 2) and a positive integer k,
-- each cell of the grid contains a value. Every integer in the range [1, N * N]
-- inclusive appears exactly once on the cells of the grid.
-- You have to find the minimum path of length k in the grid. You can start
-- from any cell, and in each step you can move to any of the neighbor cells,
-- in other words, you can go to cells which share an edge with you current
-- cell.
-- Please note that a path of length k means visiting exactly k cells (not
-- necessarily distinct).
-- You CANNOT go off the grid.
-- A path A (of length k) is considered less than a path B (of length k) if
-- after making the ordered Vectors of the values on the cells that A and B go
-- through (let's call them lst_A and lst_B), lst_A is lexicographically less
-- than lst_B, in other words, there exist an integer index i (1 <= i <= k)
-- such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have
-- lst_A[j] = lst_B[j].
-- It is guaranteed that the answer is unique.
-- Return an ordered Vector of the values on the cells that the minimum path go through.
-- Examples:
-- >>> Minpath ([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 3)
-- [1, 2, 1]
-- >>> Minpath ([[5, 9, 3], [4, 1, 6], [7, 8, 2]], 1)
-- [1]
end Placeholder;
pragma Ada_2022;
with Ada.Containers.Vectors;
package body Placeholder is
function Min_Path (Grid : Integer_Vector_Vector_Array; K : Integer) return Integer_Array | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_129_minPath.py | reworded |
end Min_Path;
end Placeholder;
pragma Ada_2022;
with Ada.Containers.Vectors;
with Placeholder; use Placeholder;
procedure Main is
use Integer_Vector;
function Candidate (Grid : Integer_Vector_Vector_Array; K : Integer) return Integer_Array renames Placeholder.Min_Path;
begin
pragma Assert (Candidate ([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 3) = [1, 2, 1]);
pragma Assert (Candidate ([[5, 9, 3], [4, 1, 6], [7, 8, 2]], 1) = [1]);
pragma Assert (Candidate ([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]], 4) = [1, 2, 1, 2]);
pragma Assert (Candidate ([[6, 4, 13, 10], [5, 7, 12, 1], [3, 16, 11, 15], [8, 14, 9, 2]], 7) = [1, 10, 1, 10, 1, 10, 1]);
pragma Assert (Candidate ([[8, 14, 9, 2], [6, 4, 13, 15], [5, 7, 1, 12], [3, 10, 11, 16]], 5) = [1, 7, 1, 7, 1]);
pragma Assert (Candidate ([[11, 8, 7, 2], [5, 16, 14, 4], [9, 3, 15, 6], [12, 13, 10, 1]], 9) = [1, 6, 1, 6, 1, 6, 1, 6, 1]);
pragma Assert (Candidate ([[12, 13, 10, 1], [9, 3, 15, 6], [5, 16, 14, 4], [11, 8, 7, 2]], 12) = [1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6]);
pragma Assert (Candidate ([[2, 7, 4], [3, 1, 5], [6, 8, 9]], 8) = [1, 3, 1, 3, 1, 3, 1, 3]);
pragma Assert (Candidate ([[6, 1, 5], [3, 8, 9], [2, 7, 4]], 8) = [1, 5, 1, 5, 1, 5, 1, 5]);
pragma Assert (Candidate ([[1, 2], [3, 4]], 10) = [1, 2, 1, 2, 1, 2, 1, 2, 1, 2]);
pragma Assert (Candidate ([[1, 3], [3, 2]], 10) = [1, 3, 1, 3, 1, 3, 1, 3, 1, 3]);
end Main; | [
"\n end "
] |
HumanEval_130_tri | adb | pragma Ada_2022;
package Placeholder is
type Integer_Array is array (Positive range <>) of Integer;
function Tri (N : Integer) return Integer_Array;
-- Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in
-- the last couple centuries. However, what people don't know is Tribonacci sequence.
-- Tribonacci sequence is defined by the recurrence:
-- tri(1) = 3
-- tri(n) = 1 + n / 2, if n is even.
-- tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.
-- For example:
-- tri(2) = 1 + (2 / 2) = 2
-- tri(4) = 3
-- tri(3) = tri(2) + tri(1) + tri(4)
-- = 2 + 3 + 3 = 8
-- You are given a non-negative integer number n, you have to a return a Vector of the
-- first n + 1 numbers of the Tribonacci sequence.
-- Examples:
-- >>> Tri (3)
-- [1, 3, 2, 8]
end Placeholder;
pragma Ada_2022;
package body Placeholder is
function Tri (N : Integer) return Integer_Array | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_130_tri.py | reworded |
end Tri;
end Placeholder;
pragma Ada_2022;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (N : Integer) return Integer_Array renames Placeholder.Tri;
begin
pragma Assert (Candidate (3) = [1, 3, 2, 8]);
pragma Assert (Candidate (4) = [1, 3, 2, 8, 3]);
pragma Assert (Candidate (5) = [1, 3, 2, 8, 3, 15]);
pragma Assert (Candidate (6) = [1, 3, 2, 8, 3, 15, 4]);
pragma Assert (Candidate (7) = [1, 3, 2, 8, 3, 15, 4, 24]);
pragma Assert (Candidate (8) = [1, 3, 2, 8, 3, 15, 4, 24, 5]);
pragma Assert (Candidate (9) = [1, 3, 2, 8, 3, 15, 4, 24, 5, 35]);
pragma Assert (Candidate (20) = [1, 3, 2, 8, 3, 15, 4, 24, 5, 35, 6, 48, 7, 63, 8, 80, 9, 99, 10, 120, 11]);
pragma Assert (Candidate (0) = [1]);
pragma Assert (Candidate (1) = [1, 3]);
end Main; | [
"\n end "
] |
HumanEval_131_digits | adb | pragma Ada_2022;
package Placeholder is
function Digits (N : Integer) return Integer;
-- Given a positive integer n, return the product of the odd digits.
-- Return 0 if all digits are even.
-- For example:
-- >>> My_Digits (1)
-- 1
-- >>> My_Digits (4)
-- 0
-- >>> My_Digits (235)
-- 15
end Placeholder;
pragma Ada_2022;
package body Placeholder is
function Digits (N : Integer) return Integer | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_131_digits.py | reworded |
end Digits;
end Placeholder;
pragma Ada_2022;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (N : Integer) return Integer renames Placeholder.Digits;
begin
pragma Assert (Candidate (5) = 5);
pragma Assert (Candidate (54) = 5);
pragma Assert (Candidate (120) = 1);
pragma Assert (Candidate (5014) = 5);
pragma Assert (Candidate (98765) = 315);
pragma Assert (Candidate (5576543) = 2625);
pragma Assert (Candidate (2468) = 0);
end Main; | [
"\n end "
] |
HumanEval_132_is_nested | adb | pragma Ada_2022;
package Placeholder is
function Is_Nested (My_String : String) return Boolean;
-- Create a function that takes a string as input which contains only square brackets.
-- The function should return True if and only if there is a valid subsequence of brackets
-- where at least one bracket in the subsequence is nested.
-- >>> Is_Nested ("[[]]")
-- True
-- >>> Is_Nested ("[]]]]]]][[[[[]")
-- False
-- >>> Is_Nested ("[][]")
-- False
-- >>> Is_Nested ("[]")
-- False
-- >>> Is_Nested ("[[][]]")
-- True
-- >>> Is_Nested ("[[]][[")
-- True
end Placeholder;
pragma Ada_2022;
package body Placeholder is
function Is_Nested (My_String : String) return Boolean | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_132_is_nested.py | reworded |
end Is_Nested;
end Placeholder;
pragma Ada_2022;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (My_String : String) return Boolean renames Placeholder.Is_Nested;
begin
pragma Assert (Candidate ("[[]]") = True);
pragma Assert (Candidate ("[]]]]]]][[[[[]") = False);
pragma Assert (Candidate ("[][]") = False);
pragma Assert (Candidate ("[]") = False);
pragma Assert (Candidate ("[[[[]]]]") = True);
pragma Assert (Candidate ("[]]]]]]]]]]") = False);
pragma Assert (Candidate ("[][][[]]") = True);
pragma Assert (Candidate ("[[]") = False);
pragma Assert (Candidate ("[]]") = False);
pragma Assert (Candidate ("[[]][[") = True);
pragma Assert (Candidate ("[[][]]") = True);
pragma Assert (Candidate ("") = False);
pragma Assert (Candidate ("[[[[[[[[") = False);
pragma Assert (Candidate ("]]]]]]]]") = False);
end Main; | [
"\n end "
] |
HumanEval_133_sum_squares | adb | pragma Ada_2022;
package Placeholder is
type Float_Array is array (Positive range <>) of Float;
function Sum_Squares (Lst : Float_Array) return Integer;
-- You are given a Vector of numbers.
-- You need to return the sum of squared numbers in the given Vector,
-- round each element in the Vector to the upper int(Ceiling) first.
-- Examples:
-- >>> Lst ([1.0, 2.0, 3.0])
-- 14
-- >>> Lst ([1.0, 4.0, 9.0])
-- 98
-- >>> Lst ([1.0, 3.0, 5.0, 7.0])
-- 84
-- >>> Lst ([1.4, 4.2, 0.0])
-- 29
-- >>> Lst ([-2.4, 1.0, 1.0])
-- 6
end Placeholder;
pragma Ada_2022;
package body Placeholder is
function Sum_Squares (Lst : Float_Array) return Integer | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_133_sum_squares.py | reworded |
end Sum_Squares;
end Placeholder;
pragma Ada_2022;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (Lst : Float_Array) return Integer renames Placeholder.Sum_Squares;
begin
pragma Assert (Candidate ([1.0, 2.0, 3.0]) = 14);
pragma Assert (Candidate ([1.0, 2.0, 3.0]) = 14);
pragma Assert (Candidate ([1.0, 3.0, 5.0, 7.0]) = 84);
pragma Assert (Candidate ([1.4, 4.2, 0.0]) = 29);
pragma Assert (Candidate ([-2.4, 1.0, 1.0]) = 6);
pragma Assert (Candidate ([100.0, 1.0, 15.0, 2.0]) = 10230);
pragma Assert (Candidate ([10000.0, 10000.0]) = 200000000);
pragma Assert (Candidate ([-1.4, 4.6, 6.3]) = 75);
pragma Assert (Candidate ([-1.4, 17.9, 18.9, 19.9]) = 1086);
pragma Assert (Candidate ([0.0]) = 0);
pragma Assert (Candidate ([-1.0]) = 1);
pragma Assert (Candidate ([-1.0, 1.0, 0.0]) = 2);
end Main; | [
"\n end "
] |
HumanEval_134_check_if_last_char_is_a_letter | adb | pragma Ada_2022;
package Placeholder is
function Check_If_Last_Char_Is_A_Letter (Txt : String) return Boolean;
-- Create a function that returns True if the last character
-- of a given string is an alphabetical character and is not
-- a part of a word, and False otherwise.
-- Note: "word" is a group of characters separated by space.
-- Examples:
-- >>> Check_If_Last_Char_Is_A_Letter ("apple pie")
-- False
-- >>> Check_If_Last_Char_Is_A_Letter ("apple pi e")
-- True
-- >>> Check_If_Last_Char_Is_A_Letter ("apple pi e ")
-- False
-- >>> Check_If_Last_Char_Is_A_Letter ("")
-- False
end Placeholder;
pragma Ada_2022;
package body Placeholder is
function Check_If_Last_Char_Is_A_Letter (Txt : String) return Boolean | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_134_check_if_last_char_is_a_letter.py | reworded |
end Check_If_Last_Char_Is_A_Letter;
end Placeholder;
pragma Ada_2022;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (Txt : String) return Boolean renames Placeholder.Check_If_Last_Char_Is_A_Letter;
begin
pragma Assert (Candidate ("apple") = False);
pragma Assert (Candidate ("apple pi e") = True);
pragma Assert (Candidate ("eeeee") = False);
pragma Assert (Candidate ("A") = True);
pragma Assert (Candidate ("Pumpkin pie ") = False);
pragma Assert (Candidate ("Pumpkin pie 1") = False);
pragma Assert (Candidate ("") = False);
pragma Assert (Candidate ("eeeee e ") = False);
pragma Assert (Candidate ("apple pie") = False);
pragma Assert (Candidate ("apple pi e ") = False);
end Main; | [
"\n end "
] |
HumanEval_135_can_arrange | adb | pragma Ada_2022;
package Placeholder is
type Integer_Array is array (Positive range <>) of Integer;
function Can_Arrange (Arr : Integer_Array) return Integer;
-- Create a function which returns the largest index of an element which
-- is not greater than or equal to the element immediately preceding it. If
-- no such element exists then return -1. The given array will not contain
-- duplicate values.
-- Examples:
-- >>> Can_Arrange ([1, 2, 4, 3, 5])
-- 3
-- >>> Can_Arrange ([1, 2, 3])
-- -1
end Placeholder;
pragma Ada_2022;
package body Placeholder is
function Can_Arrange (Arr : Integer_Array) return Integer | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_135_can_arrange.py | reworded |
end Can_Arrange;
end Placeholder;
pragma Ada_2022;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (Arr : Integer_Array) return Integer renames Placeholder.Can_Arrange;
begin
pragma Assert (Candidate ([1, 2, 4, 3, 5]) = 3);
pragma Assert (Candidate ([1, 2, 4, 5]) = -1);
pragma Assert (Candidate ([1, 4, 2, 5, 6, 7, 8, 9, 10]) = 2);
pragma Assert (Candidate ([4, 8, 5, 7, 3]) = 4);
pragma Assert (Candidate ([]) = -1);
end Main; | [
"\n end "
] |
HumanEval_136_largest_smallest_integers | adb | pragma Ada_2022;
package Placeholder is
type Integer_Array is array (Positive range <>) of Integer;
type Integer_Option (Valid : Boolean := False) is record
case Valid is
when True =>
Value : Integer;
when False =>
null;
end case;
end record;
type Integer_Option_Integer_Option_Tuple is record
Integer_Option_1 : Integer_Option;
Integer_Option_2 : Integer_Option;
end record;
function Largest_Smallest_Integers (Lst : Integer_Array) return Integer_Option_Integer_Option_Tuple;
-- Create a function that returns a record (a, b), where 'a' is
-- the largest of negative integers, and 'b' is the smallest
-- of positive integers in a Vector.
-- If there is no negative or positive integers, return them as null.
-- Examples:
-- >>> Largest_Smallest_Integers ([2, 4, 1, 3, 5, 7])
-- ((Valid => False), (Valid => True, Value => 1))
-- >>> Largest_Smallest_Integers ([])
-- ((Valid => False), (Valid => False))
-- >>> Largest_Smallest_Integers ([0])
-- ((Valid => False), (Valid => False))
end Placeholder;
pragma Ada_2022;
package body Placeholder is
function Largest_Smallest_Integers (Lst : Integer_Array) return Integer_Option_Integer_Option_Tuple | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_136_largest_smallest_integers.py | reworded |
end Largest_Smallest_Integers;
end Placeholder;
pragma Ada_2022;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (Lst : Integer_Array) return Integer_Option_Integer_Option_Tuple renames Placeholder.Largest_Smallest_Integers;
begin
pragma Assert (Candidate ([2, 4, 1, 3, 5, 7]) = ((Valid => False), (Valid => True, Value => 1)));
pragma Assert (Candidate ([2, 4, 1, 3, 5, 7, 0]) = ((Valid => False), (Valid => True, Value => 1)));
pragma Assert (Candidate ([1, 3, 2, 4, 5, 6, -2]) = ((Valid => True, Value => -2), (Valid => True, Value => 1)));
pragma Assert (Candidate ([4, 5, 3, 6, 2, 7, -7]) = ((Valid => True, Value => -7), (Valid => True, Value => 2)));
pragma Assert (Candidate ([7, 3, 8, 4, 9, 2, 5, -9]) = ((Valid => True, Value => -9), (Valid => True, Value => 2)));
pragma Assert (Candidate ([]) = ((Valid => False), (Valid => False)));
pragma Assert (Candidate ([0]) = ((Valid => False), (Valid => False)));
pragma Assert (Candidate ([-1, -3, -5, -6]) = ((Valid => True, Value => -1), (Valid => False)));
pragma Assert (Candidate ([-1, -3, -5, -6, 0]) = ((Valid => True, Value => -1), (Valid => False)));
pragma Assert (Candidate ([-6, -4, -4, -3, 1]) = ((Valid => True, Value => -3), (Valid => True, Value => 1)));
pragma Assert (Candidate ([-6, -4, -4, -3, -100, 1]) = ((Valid => True, Value => -3), (Valid => True, Value => 1)));
end Main; | [
"\n end "
] |
HumanEval_138_is_equal_to_sum_even | adb | pragma Ada_2022;
package Placeholder is
function Is_Equal_To_Sum_Even (N : Integer) return Boolean;
-- Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers
-- Example
-- >>> Is_Equal_To_Sum_Even (4)
-- False
-- >>> Is_Equal_To_Sum_Even (6)
-- False
-- >>> Is_Equal_To_Sum_Even (8)
-- True
end Placeholder;
pragma Ada_2022;
package body Placeholder is
function Is_Equal_To_Sum_Even (N : Integer) return Boolean | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_138_is_equal_to_sum_even.py | reworded |
end Is_Equal_To_Sum_Even;
end Placeholder;
pragma Ada_2022;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (N : Integer) return Boolean renames Placeholder.Is_Equal_To_Sum_Even;
begin
pragma Assert (Candidate (4) = False);
pragma Assert (Candidate (6) = False);
pragma Assert (Candidate (8) = True);
pragma Assert (Candidate (10) = True);
pragma Assert (Candidate (11) = False);
pragma Assert (Candidate (12) = True);
pragma Assert (Candidate (13) = False);
pragma Assert (Candidate (16) = True);
end Main; | [
"\n end "
] |
HumanEval_139_special_factorial | adb | pragma Ada_2022;
package Placeholder is
function Special_Factorial (N : Integer) return Integer;
-- The Brazilian factorial is defined as:
-- brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!
-- where n > 0
-- For example:
-- >>> Special_Factorial (4)
-- 288
-- The function will receive an integer as input and should return the special
-- factorial of this integer.
end Placeholder;
pragma Ada_2022;
package body Placeholder is
function Special_Factorial (N : Integer) return Integer | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_139_special_factorial.py | reworded |
end Special_Factorial;
end Placeholder;
pragma Ada_2022;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (N : Integer) return Integer renames Placeholder.Special_Factorial;
begin
pragma Assert (Candidate (4) = 288);
pragma Assert (Candidate (5) = 34560);
pragma Assert (Candidate (7) = 125411328000);
pragma Assert (Candidate (1) = 1);
end Main; | [
"\n end "
] |
HumanEval_140_fix_spaces | adb | pragma Ada_2022;
package Placeholder is
function Fix_Spaces (Text : String) return String;
-- Given a string text, replace all spaces in it with underscores,
-- and if a string has more than 2 consecutive spaces,
-- then replace all consecutive spaces with -
-- >>> Fix_Spaces (" Example")
-- "Example"
-- >>> Fix_Spaces (" Example 1")
-- "Example_1"
-- >>> Fix_Spaces (" Example 2")
-- "_Example_2"
-- >>> Fix_Spaces (" Example 3")
-- "_Example-3"
end Placeholder;
pragma Ada_2022;
package body Placeholder is
function Fix_Spaces (Text : String) return String | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_140_fix_spaces.py | reworded |
end Fix_Spaces;
end Placeholder;
pragma Ada_2022;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (Text : String) return String renames Placeholder.Fix_Spaces;
begin
pragma Assert (Candidate ("Example") = "Example");
pragma Assert (Candidate ("Mudasir Hanif ") = "Mudasir_Hanif_");
pragma Assert (Candidate ("Yellow Yellow Dirty Fellow") = "Yellow_Yellow__Dirty__Fellow");
pragma Assert (Candidate ("Exa mple") = "Exa-mple");
pragma Assert (Candidate (" Exa 1 2 2 mple") = "-Exa_1_2_2_mple");
end Main; | [
"\n end "
] |
HumanEval_141_file_name_check | adb | pragma Ada_2022;
package Placeholder is
function File_Name_Check (File_Name : String) return String;
-- Create a function which takes a string representing a file's name, and returns
-- 'Yes' if the the file's name is valid, and returns 'No' otherwise.
-- A file's name is considered to be valid if and only if all the following conditions
-- are met:
-- - There should not be more than three digits ('0'-'9') in the file's name.
-- - The file's name contains exactly one dot '.'
-- - The substring before the dot should not be empty, and it starts with a letter from
-- the latin alphapet ('a'-'z' and 'A'-'Z').
-- - The substring after the dot should be one of these: ['txt', 'exe', 'dll']
-- Examples:
-- >>> File_Name_Check ("example.txt")
-- "Yes"
-- >>> File_Name_Check ("1example.dll")
-- "No"
end Placeholder;
pragma Ada_2022;
package body Placeholder is
function File_Name_Check (File_Name : String) return String | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_141_file_name_check.py | reworded |
end File_Name_Check;
end Placeholder;
pragma Ada_2022;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (File_Name : String) return String renames Placeholder.File_Name_Check;
begin
pragma Assert (Candidate ("example.txt") = "Yes");
pragma Assert (Candidate ("1example.dll") = "No");
pragma Assert (Candidate ("s1sdf3.asd") = "No");
pragma Assert (Candidate ("K.dll") = "Yes");
pragma Assert (Candidate ("MY16FILE3.exe") = "Yes");
pragma Assert (Candidate ("His12FILE94.exe") = "No");
pragma Assert (Candidate ("_Y.txt") = "No");
pragma Assert (Candidate ("?aREYA.exe") = "No");
pragma Assert (Candidate ("/this_is_valid.dll") = "No");
pragma Assert (Candidate ("this_is_valid.wow") = "No");
pragma Assert (Candidate ("this_is_valid.txt") = "Yes");
pragma Assert (Candidate ("this_is_valid.txtexe") = "No");
pragma Assert (Candidate ("#this2_i4s_5valid.ten") = "No");
pragma Assert (Candidate ("@this1_is6_valid.exe") = "No");
pragma Assert (Candidate ("this_is_12valid.6exe4.txt") = "No");
pragma Assert (Candidate ("all.exe.txt") = "No");
pragma Assert (Candidate ("I563_No.exe") = "Yes");
pragma Assert (Candidate ("Is3youfault.txt") = "Yes");
pragma Assert (Candidate ("no_one#knows.dll") = "Yes");
pragma Assert (Candidate ("1I563_Yes3.exe") = "No");
pragma Assert (Candidate ("I563_Yes3.txtt") = "No");
pragma Assert (Candidate ("final..txt") = "No");
pragma Assert (Candidate ("final132") = "No");
pragma Assert (Candidate ("_f4indsartal132.") = "No");
pragma Assert (Candidate (".txt") = "No");
pragma Assert (Candidate ("s.") = "No");
end Main; | [
"\n end "
] |
HumanEval_142_sum_squares | adb | pragma Ada_2022;
package Placeholder is
type Integer_Array is array (Positive range <>) of Integer;
function Sum_Squares (Lst : Integer_Array) return Integer;
-- "
-- This function will take a Vector of integers. For all entries in the Vector, the function shall square the integer entry if its index is a
-- 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
-- change the entries in the Vector whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries.
-- Examples:
-- >>> Sum_Squares ([1, 2, 3])
-- 6
-- >>> Sum_Squares ([])
-- 0
-- >>> Sum_Squares ([-1, -5, 2, -1, -5])
-- -126
end Placeholder;
pragma Ada_2022;
package body Placeholder is
function Sum_Squares (Lst : Integer_Array) return Integer | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_142_sum_squares.py | reworded |
end Sum_Squares;
end Placeholder;
pragma Ada_2022;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (Lst : Integer_Array) return Integer renames Placeholder.Sum_Squares;
begin
pragma Assert (Candidate ([1, 2, 3]) = 6);
pragma Assert (Candidate ([1, 4, 9]) = 14);
pragma Assert (Candidate ([]) = 0);
pragma Assert (Candidate ([1, 1, 1, 1, 1, 1, 1, 1, 1]) = 9);
pragma Assert (Candidate ([-1, -1, -1, -1, -1, -1, -1, -1, -1]) = -3);
pragma Assert (Candidate ([0]) = 0);
pragma Assert (Candidate ([-1, -5, 2, -1, -5]) = -126);
pragma Assert (Candidate ([-56, -99, 1, 0, -2]) = 3030);
pragma Assert (Candidate ([-1, 0, 0, 0, 0, 0, 0, 0, -1]) = 0);
pragma Assert (Candidate ([-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37]) = -14196);
pragma Assert (Candidate ([-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10]) = -1448);
end Main; | [
"\n end "
] |
HumanEval_143_words_in_sentence | adb | pragma Ada_2022;
package Placeholder is
function Words_In_Sentence (Sentence : String) return String;
-- You are given a string representing a sentence,
-- the sentence contains some words separated by a space,
-- and you have to return a string that contains the words from the original sentence,
-- whose lengths are prime numbers,
-- the order of the words in the new string should be the same as the original one.
-- Example 1:
-- >>> Words_In_Sentence ("This is a test")
-- "is"
-- Example 2:
-- >>> Words_In_Sentence ("lets go for swimming")
-- "go for"
-- Constraints:
-- * 1 <= len(sentence) <= 100
-- * sentence contains only letters
end Placeholder;
pragma Ada_2022;
package body Placeholder is
function Words_In_Sentence (Sentence : String) return String | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_143_words_in_sentence.py | reworded |
end Words_In_Sentence;
end Placeholder;
pragma Ada_2022;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (Sentence : String) return String renames Placeholder.Words_In_Sentence;
begin
pragma Assert (Candidate ("This is a test") = "is");
pragma Assert (Candidate ("lets go for swimming") = "go for");
pragma Assert (Candidate ("there is no place available here") = "there is no place");
pragma Assert (Candidate ("Hi I am Hussein") = "Hi am Hussein");
pragma Assert (Candidate ("go for it") = "go for it");
pragma Assert (Candidate ("here") = "");
pragma Assert (Candidate ("here is") = "is");
end Main; | [
"\n end "
] |
HumanEval_144_simplify | adb | pragma Ada_2022;
package Placeholder is
function Simplify (X : String; N : String) return Boolean;
-- Your task is to implement a function that will simplify the expression
-- x * n. The function returns True if x * n evaluates to a whole number and False
-- otherwise. Both x and n, are string representation of a fraction, and have the following format,
-- <numerator>/<denominator> where both numerator and denominator are positive whole numbers.
-- You can assume that x, and n are valid fractions, and do not have zero as denominator.
-- >>> Simplify ("1/5", "5/1")
-- True
-- >>> Simplify ("1/6", "2/1")
-- False
-- >>> Simplify ("7/10", "10/2")
-- False
end Placeholder;
pragma Ada_2022;
package body Placeholder is
function Simplify (X : String; N : String) return Boolean | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_144_simplify.py | reworded |
end Simplify;
end Placeholder;
pragma Ada_2022;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (X : String; N : String) return Boolean renames Placeholder.Simplify;
begin
pragma Assert (Candidate ("1/5", "5/1") = True);
pragma Assert (Candidate ("1/6", "2/1") = False);
pragma Assert (Candidate ("5/1", "3/1") = True);
pragma Assert (Candidate ("7/10", "10/2") = False);
pragma Assert (Candidate ("2/10", "50/10") = True);
pragma Assert (Candidate ("7/2", "4/2") = True);
pragma Assert (Candidate ("11/6", "6/1") = True);
pragma Assert (Candidate ("2/3", "5/2") = False);
pragma Assert (Candidate ("5/2", "3/5") = False);
pragma Assert (Candidate ("2/4", "8/4") = True);
pragma Assert (Candidate ("2/4", "4/2") = True);
pragma Assert (Candidate ("1/5", "5/1") = True);
pragma Assert (Candidate ("1/5", "1/5") = False);
end Main; | [
"\n end "
] |
HumanEval_145_order_by_points | adb | pragma Ada_2022;
package Placeholder is
type Integer_Array is array (Positive range <>) of Integer;
function Order_By_Points (Nums : Integer_Array) return Integer_Array;
-- Write a function which sorts the given Vector of integers
-- in ascending order according to the sum of their digits.
-- Note: if there are several items with similar sum of their digits,
-- order them based on their index in original Vector.
-- For example:
-- >>> Order_By_Points ([1, 11, -1, -11, -12])
-- [-1, -11, 1, -12, 11]
-- >>> Order_By_Points ([])
-- []
end Placeholder;
pragma Ada_2022;
package body Placeholder is
function Order_By_Points (Nums : Integer_Array) return Integer_Array | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_145_order_by_points.py | reworded |
end Order_By_Points;
end Placeholder;
pragma Ada_2022;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (Nums : Integer_Array) return Integer_Array renames Placeholder.Order_By_Points;
begin
pragma Assert (Candidate ([1, 11, -1, -11, -12]) = [-1, -11, 1, -12, 11]);
pragma Assert (Candidate ([1234, 423, 463, 145, 2, 423, 423, 53, 6, 37, 3457, 3, 56, 0, 46]) = [0, 2, 3, 6, 53, 423, 423, 423, 1234, 145, 37, 46, 56, 463, 3457]);
pragma Assert (Candidate ([]) = []);
pragma Assert (Candidate ([1, -11, -32, 43, 54, -98, 2, -3]) = [-3, -32, -98, -11, 1, 2, 43, 54]);
pragma Assert (Candidate ([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]) = [1, 10, 2, 11, 3, 4, 5, 6, 7, 8, 9]);
pragma Assert (Candidate ([0, 6, 6, -76, -21, 23, 4]) = [-76, -21, 0, 4, 23, 6, 6]);
end Main; | [
"\n end "
] |
HumanEval_146_specialFilter | adb | pragma Ada_2022;
package Placeholder is
type Integer_Array is array (Positive range <>) of Integer;
function Special_Filter (Nums : Integer_Array) return Integer;
-- Write a function that takes an array of numbers as input and returns
-- the number of elements in the array that are greater than 10 and both
-- first and last digits of a number are odd (1, 3, 5, 7, 9).
-- For example:
-- >>> Specialfilter ([15, -73, 14, -15])
-- 1
-- >>> Specialfilter ([33, -2, -3, 45, 21, 109])
-- 2
end Placeholder;
pragma Ada_2022;
package body Placeholder is
function Special_Filter (Nums : Integer_Array) return Integer | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_146_specialFilter.py | reworded |
end Special_Filter;
end Placeholder;
pragma Ada_2022;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (Nums : Integer_Array) return Integer renames Placeholder.Special_Filter;
begin
pragma Assert (Candidate ([5, -2, 1, -5]) = 0);
pragma Assert (Candidate ([15, -73, 14, -15]) = 1);
pragma Assert (Candidate ([33, -2, -3, 45, 21, 109]) = 2);
pragma Assert (Candidate ([43, -12, 93, 125, 121, 109]) = 4);
pragma Assert (Candidate ([71, -2, -33, 75, 21, 19]) = 3);
pragma Assert (Candidate ([1]) = 0);
pragma Assert (Candidate ([]) = 0);
end Main; | [
"\n end "
] |
HumanEval_147_get_max_triples | adb | pragma Ada_2022;
package Placeholder is
function Get_Max_Triples (N : Integer) return Integer;
-- You are given a positive integer n. You have to create an integer array a of length n.
-- For each i (1 ≤ i ≤ n), the value of a[i] = i * i - i + 1.
-- Return the number of triples (a[i], a[j], a[k]) of a where i < j < k,
-- and a[i] + a[j] + a[k] is a multiple of 3.
-- Example :
-- >>> Get_Max_Triples (5)
-- 1
-- Explanation:
-- a = [1, 3, 7, 13, 21]
-- The only valid triple is (1, 7, 13).
end Placeholder;
pragma Ada_2022;
package body Placeholder is
function Get_Max_Triples (N : Integer) return Integer | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_147_get_max_triples.py | reworded |
end Get_Max_Triples;
end Placeholder;
pragma Ada_2022;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (N : Integer) return Integer renames Placeholder.Get_Max_Triples;
begin
pragma Assert (Candidate (5) = 1);
pragma Assert (Candidate (6) = 4);
pragma Assert (Candidate (10) = 36);
pragma Assert (Candidate (100) = 53361);
end Main; | [
"\n end "
] |
HumanEval_148_bf | adb | pragma Ada_2022;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
package Placeholder is
type Unbounded_String_Array is array (Positive range <>) of Unbounded_String;
function Bf (Planet1 : String; Planet2 : String) return Unbounded_String_Array;
-- There are eight planets in our solar system: the closerst to the Sun
-- is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn,
-- Uranus, Neptune.
-- Write a function that takes two planet names as strings planet1 and planet2.
-- The function should return a record containing all planets whose orbits are
-- located between the orbit of planet1 and the orbit of planet2, sorted by
-- the proximity to the sun.
-- The function should return an empty record if planet1 or planet2
-- are not correct planet names.
-- Examples
-- >>> Bf ("Jupiter", "Neptune")
-- (To_Unbounded_String ("Saturn"), To_Unbounded_String ("Uranus"))
-- >>> Bf ("Earth", "Mercury")
-- `VmVudXM=`
-- >>> Bf ("Mercury", "Uranus")
-- (To_Unbounded_String ("Venus"), To_Unbounded_String ("Earth"), To_Unbounded_String ("Mars"), To_Unbounded_String ("Jupiter"), To_Unbounded_String ("Saturn"))
end Placeholder;
pragma Ada_2022;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
package body Placeholder is
function Bf (Planet1 : String; Planet2 : String) return Unbounded_String_Array | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_148_bf.py | reworded |
end Bf;
end Placeholder;
pragma Ada_2022;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (Planet1 : String; Planet2 : String) return Unbounded_String_Array renames Placeholder.Bf;
begin
pragma Assert (Candidate ("Jupiter", "Neptune") = (To_Unbounded_String ("Saturn"), To_Unbounded_String ("Uranus")));
pragma Assert (Candidate ("Earth", "Mercury") = (To_Unbounded_String ("Venus")));
pragma Assert (Candidate ("Mercury", "Uranus") = (To_Unbounded_String ("Venus"), To_Unbounded_String ("Earth"), To_Unbounded_String ("Mars"), To_Unbounded_String ("Jupiter"), To_Unbounded_String ("Saturn")));
pragma Assert (Candidate ("Neptune", "Venus") = (To_Unbounded_String ("Earth"), To_Unbounded_String ("Mars"), To_Unbounded_String ("Jupiter"), To_Unbounded_String ("Saturn"), To_Unbounded_String ("Uranus")));
pragma Assert (Candidate ("Earth", "Earth") = ());
pragma Assert (Candidate ("Mars", "Earth") = ());
pragma Assert (Candidate ("Jupiter", "Makemake") = ());
end Main; | [
"\n end "
] |
HumanEval_149_sorted_list_sum | adb | pragma Ada_2022;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
package Placeholder is
type Unbounded_String_Array is array (Positive range <>) of Unbounded_String;
function Sorted_List_Sum (Lst : Unbounded_String_Array) return Unbounded_String_Array;
-- Write a function that accepts a Vector of strings as a parameter,
-- deletes the strings that have odd lengths from it,
-- and returns the resulted Vector with a sorted order,
-- The Vector is always a Vector of strings and never an array of numbers,
-- and it may contain duplicates.
-- The order of the Vector should be ascending by length of each word, and you
-- should return the Vector sorted by that rule.
-- If two words have the same length, sort the Vector alphabetically.
-- The function should return a Vector of strings in sorted order.
-- You may assume that all words will have the same length.
-- For example:
-- >>> List_Sort ([To_Unbounded_String ("aa"), To_Unbounded_String ("a"), To_Unbounded_String ("aaa")])
-- [To_Unbounded_String ("aa")]
-- >>> List_Sort ([To_Unbounded_String ("ab"), To_Unbounded_String ("a"), To_Unbounded_String ("aaa"), To_Unbounded_String ("cd")])
-- [To_Unbounded_String ("ab"), To_Unbounded_String ("cd")]
end Placeholder;
pragma Ada_2022;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
package body Placeholder is
function Sorted_List_Sum (Lst : Unbounded_String_Array) return Unbounded_String_Array | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_149_sorted_list_sum.py | reworded |
end Sorted_List_Sum;
end Placeholder;
pragma Ada_2022;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (Lst : Unbounded_String_Array) return Unbounded_String_Array renames Placeholder.Sorted_List_Sum;
begin
pragma Assert (Candidate ([To_Unbounded_String ("aa"), To_Unbounded_String ("a"), To_Unbounded_String ("aaa")]) = [To_Unbounded_String ("aa")]);
pragma Assert (Candidate ([To_Unbounded_String ("school"), To_Unbounded_String ("AI"), To_Unbounded_String ("asdf"), To_Unbounded_String ("b")]) = [To_Unbounded_String ("AI"), To_Unbounded_String ("asdf"), To_Unbounded_String ("school")]);
pragma Assert (Candidate ([To_Unbounded_String ("d"), To_Unbounded_String ("b"), To_Unbounded_String ("c"), To_Unbounded_String ("a")]) = []);
pragma Assert (Candidate ([To_Unbounded_String ("d"), To_Unbounded_String ("dcba"), To_Unbounded_String ("abcd"), To_Unbounded_String ("a")]) = [To_Unbounded_String ("abcd"), To_Unbounded_String ("dcba")]);
pragma Assert (Candidate ([To_Unbounded_String ("AI"), To_Unbounded_String ("ai"), To_Unbounded_String ("au")]) = [To_Unbounded_String ("AI"), To_Unbounded_String ("ai"), To_Unbounded_String ("au")]);
pragma Assert (Candidate ([To_Unbounded_String ("a"), To_Unbounded_String ("b"), To_Unbounded_String ("b"), To_Unbounded_String ("c"), To_Unbounded_String ("c"), To_Unbounded_String ("a")]) = []);
pragma Assert (Candidate ([To_Unbounded_String ("aaaa"), To_Unbounded_String ("bbbb"), To_Unbounded_String ("dd"), To_Unbounded_String ("cc")]) = [To_Unbounded_String ("cc"), To_Unbounded_String ("dd"), To_Unbounded_String ("aaaa"), To_Unbounded_String ("bbbb")]);
end Main; | [
"\n end "
] |
HumanEval_150_x_or_y | adb | pragma Ada_2022;
package Placeholder is
function X_Or_Y (N : Integer; X : Integer; Y : Integer) return Integer;
-- A simple program which should return the value of x if n is
-- a prime number and should return the value of y otherwise.
-- Examples:
-- >>> X_Or_Y (7, 34, 12)
-- 34
-- >>> X_Or_Y (15, 8, 5)
-- 5
end Placeholder;
pragma Ada_2022;
package body Placeholder is
function X_Or_Y (N : Integer; X : Integer; Y : Integer) return Integer | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_150_x_or_y.py | reworded |
end X_Or_Y;
end Placeholder;
pragma Ada_2022;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (N : Integer; X : Integer; Y : Integer) return Integer renames Placeholder.X_Or_Y;
begin
pragma Assert (Candidate (7, 34, 12) = 34);
pragma Assert (Candidate (15, 8, 5) = 5);
pragma Assert (Candidate (3, 33, 5212) = 33);
pragma Assert (Candidate (1259, 3, 52) = 3);
pragma Assert (Candidate (7919, -1, 12) = -1);
pragma Assert (Candidate (3609, 1245, 583) = 583);
pragma Assert (Candidate (91, 56, 129) = 129);
pragma Assert (Candidate (6, 34, 1234) = 1234);
pragma Assert (Candidate (1, 2, 0) = 0);
pragma Assert (Candidate (2, 2, 0) = 2);
end Main; | [
"\n end "
] |
HumanEval_151_double_the_difference | adb | pragma Ada_2022;
package Placeholder is
type Float_Array is array (Positive range <>) of Float;
function Double_The_Difference (Lst : Float_Array) return Integer;
-- Given a Vector of numbers, return the sum of squares of the numbers
-- in the Vector that are odd. Ignore numbers that are negative or not integers.
-- >>> Double_The_Difference ([1, 3, 2, 0])
-- 10
-- >>> Double_The_Difference ([-1, -2, 0])
-- 0
-- >>> Double_The_Difference ([9, -2])
-- 81
-- >>> Double_The_Difference ([0])
-- 0
-- If the input Vector is empty, return 0.
end Placeholder;
pragma Ada_2022;
package body Placeholder is
function Double_The_Difference (Lst : Float_Array) return Integer | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_151_double_the_difference.py | reworded |
end Double_The_Difference;
end Placeholder;
pragma Ada_2022;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (Lst : Float_Array) return Integer renames Placeholder.Double_The_Difference;
begin
pragma Assert (Candidate ([]) = 0);
pragma Assert (Candidate ([5.0, 4.0]) = 25);
pragma Assert (Candidate ([0.1, 0.2, 0.3]) = 0);
pragma Assert (Candidate ([-10.0, -20.0, -30.0]) = 0);
pragma Assert (Candidate ([-1.0, -2.0, 8.0]) = 0);
pragma Assert (Candidate ([0.2, 3.0, 5.0]) = 34);
pragma Assert (Candidate ([-9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0]) = 165);
end Main; | [
"\n end "
] |
HumanEval_152_compare | adb | pragma Ada_2022;
package Placeholder is
type Integer_Array is array (Positive range <>) of Integer;
function Compare (Game : Integer_Array; Guess : Integer_Array) return Integer_Array;
-- I think we all remember that feeling when the result of some long-awaited
-- event is finally known. The feelings and thoughts you have at that moment are
-- definitely worth noting down and comparing.
-- Your task is to determine if a person correctly guessed the results of a number of matches.
-- You are given two arrays of scores and guesses of equal length, where each index shows a match.
-- Return an array of the same length denoting how far off each guess was. If they have guessed correctly,
-- the value is 0, and if not, the value is the absolute difference between the guess and the score.
-- example:
-- >>> Compare ([1, 2, 3, 4, 5, 1], [1, 2, 3, 4, 2, -2])
-- [0, 0, 0, 0, 3, 3]
-- >>> Compare ([0, 5, 0, 0, 0, 4], [4, 1, 1, 0, 0, -2])
-- [4, 4, 1, 0, 0, 6]
end Placeholder;
pragma Ada_2022;
package body Placeholder is
function Compare (Game : Integer_Array; Guess : Integer_Array) return Integer_Array | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_152_compare.py | reworded |
end Compare;
end Placeholder;
pragma Ada_2022;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (Game : Integer_Array; Guess : Integer_Array) return Integer_Array renames Placeholder.Compare;
begin
pragma Assert (Candidate ([1, 2, 3, 4, 5, 1], [1, 2, 3, 4, 2, -2]) = [0, 0, 0, 0, 3, 3]);
pragma Assert (Candidate ([0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]) = [0, 0, 0, 0, 0, 0]);
pragma Assert (Candidate ([1, 2, 3], [-1, -2, -3]) = [2, 4, 6]);
pragma Assert (Candidate ([1, 2, 3, 5], [-1, 2, 3, 4]) = [2, 0, 0, 1]);
end Main; | [
"\n end "
] |
HumanEval_153_Strongest_Extension | adb | pragma Ada_2022;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
package Placeholder is
type Unbounded_String_Array is array (Positive range <>) of Unbounded_String;
function Strongest_Extension (Class_Name : String; Extensions : Unbounded_String_Array) return String;
-- You will be given the name of a class (a string) and a Vector of extensions.
-- The extensions are to be used to load additional classes to the class. The
-- strength of the extension is as follows: Let CAP be the number of the uppercase
-- letters in the extension's name, and let SM be the number of lowercase letters
-- in the extension's name, the strength is given by the fraction CAP - SM.
-- You should find the strongest extension and return a string in this
-- format: ClassName.StrongestExtensionName.
-- If there are two or more extensions with the same strength, you should
-- choose the one that comes first in the Vector.
-- For example, if you are given "Slices" as the class and a Vector of the
-- extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should
-- return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension
-- (its strength is -1).
-- Example:
-- >>> Strongest_Extension ("my_class", [To_Unbounded_String ("AA"), To_Unbounded_String ("Be"), To_Unbounded_String ("CC")])
-- "my_class.AA"
end Placeholder;
pragma Ada_2022;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
package body Placeholder is
function Strongest_Extension (Class_Name : String; Extensions : Unbounded_String_Array) return String | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_153_Strongest_Extension.py | reworded |
end Strongest_Extension;
end Placeholder;
pragma Ada_2022;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (Class_Name : String; Extensions : Unbounded_String_Array) return String renames Placeholder.Strongest_Extension;
begin
pragma Assert (Candidate ("Watashi", [To_Unbounded_String ("tEN"), To_Unbounded_String ("niNE"), To_Unbounded_String ("eIGHt8OKe")]) = "Watashi.eIGHt8OKe");
pragma Assert (Candidate ("Boku123", [To_Unbounded_String ("nani"), To_Unbounded_String ("NazeDa"), To_Unbounded_String ("YEs.WeCaNe"), To_Unbounded_String ("32145tggg")]) = "Boku123.YEs.WeCaNe");
pragma Assert (Candidate ("__YESIMHERE", [To_Unbounded_String ("t"), To_Unbounded_String ("eMptY"), To_Unbounded_String ("nothing"), To_Unbounded_String ("zeR00"), To_Unbounded_String ("NuLl__"), To_Unbounded_String ("123NoooneB321")]) = "__YESIMHERE.NuLl__");
pragma Assert (Candidate ("K", [To_Unbounded_String ("Ta"), To_Unbounded_String ("TAR"), To_Unbounded_String ("t234An"), To_Unbounded_String ("cosSo")]) = "K.TAR");
pragma Assert (Candidate ("__HAHA", [To_Unbounded_String ("Tab"), To_Unbounded_String ("123"), To_Unbounded_String ("781345"), To_Unbounded_String ("-_-")]) = "__HAHA.123");
pragma Assert (Candidate ("YameRore", [To_Unbounded_String ("HhAas"), To_Unbounded_String ("okIWILL123"), To_Unbounded_String ("WorkOut"), To_Unbounded_String ("Fails"), To_Unbounded_String ("-_-")]) = "YameRore.okIWILL123");
pragma Assert (Candidate ("finNNalLLly", [To_Unbounded_String ("Die"), To_Unbounded_String ("NowW"), To_Unbounded_String ("Wow"), To_Unbounded_String ("WoW")]) = "finNNalLLly.WoW");
pragma Assert (Candidate ("_", [To_Unbounded_String ("Bb"), To_Unbounded_String ("91245")]) = "_.Bb");
pragma Assert (Candidate ("Sp", [To_Unbounded_String ("671235"), To_Unbounded_String ("Bb")]) = "Sp.671235");
end Main; | [
"\n end "
] |
HumanEval_154_cycpattern_check | adb | pragma Ada_2022;
package Placeholder is
function Cycpattern_Check (A : String; B : String) return Boolean;
-- 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
-- >>> Cycpattern_Check ("abcd", "abd")
-- False
-- >>> Cycpattern_Check ("hello", "ell")
-- True
-- >>> Cycpattern_Check ("whassup", "psus")
-- False
-- >>> Cycpattern_Check ("abab", "baa")
-- True
-- >>> Cycpattern_Check ("efef", "eeff")
-- False
-- >>> Cycpattern_Check ("himenss", "simen")
-- True
end Placeholder;
pragma Ada_2022;
package body Placeholder is
function Cycpattern_Check (A : String; B : String) return Boolean | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_154_cycpattern_check.py | reworded |
end Cycpattern_Check;
end Placeholder;
pragma Ada_2022;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (A : String; B : String) return Boolean renames Placeholder.Cycpattern_Check;
begin
pragma Assert (Candidate ("xyzw", "xyw") = False);
pragma Assert (Candidate ("yello", "ell") = True);
pragma Assert (Candidate ("whattup", "ptut") = False);
pragma Assert (Candidate ("efef", "fee") = True);
pragma Assert (Candidate ("abab", "aabb") = False);
pragma Assert (Candidate ("winemtt", "tinem") = True);
end Main; | [
"\n end "
] |
HumanEval_155_even_odd_count | adb | pragma Ada_2022;
package Placeholder is
type Integer_Integer_Tuple is record
Integer_1 : Integer;
Integer_2 : Integer;
end record;
function Even_Odd_Count (Num : Integer) return Integer_Integer_Tuple;
-- Given an integer. return a record that has the number of even and odd digits respectively.
-- Example:
-- >>> Even_Odd_Count (-12)
-- (1, 1)
-- >>> Even_Odd_Count (123)
-- (1, 2)
end Placeholder;
pragma Ada_2022;
package body Placeholder is
function Even_Odd_Count (Num : Integer) return Integer_Integer_Tuple | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_155_even_odd_count.py | reworded |
end Even_Odd_Count;
end Placeholder;
pragma Ada_2022;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (Num : Integer) return Integer_Integer_Tuple renames Placeholder.Even_Odd_Count;
begin
pragma Assert (Candidate (7) = (0, 1));
pragma Assert (Candidate (-78) = (1, 1));
pragma Assert (Candidate (3452) = (2, 2));
pragma Assert (Candidate (346211) = (3, 3));
pragma Assert (Candidate (-345821) = (3, 3));
pragma Assert (Candidate (-2) = (1, 0));
pragma Assert (Candidate (-45347) = (2, 3));
pragma Assert (Candidate (0) = (1, 0));
end Main; | [
"\n end "
] |
HumanEval_156_int_to_mini_roman | adb | pragma Ada_2022;
package Placeholder is
function Int_To_Mini_Roman (Number : Integer) return String;
-- Given a positive integer, obtain its roman numeral equivalent as a string,
-- and return it in lowercase.
-- Restrictions: 1 <= num <= 1000
-- Examples:
-- >>> Int_To_Mini_Roman (19)
-- "xix"
-- >>> Int_To_Mini_Roman (152)
-- "clii"
-- >>> Int_To_Mini_Roman (426)
-- "cdxxvi"
end Placeholder;
pragma Ada_2022;
package body Placeholder is
function Int_To_Mini_Roman (Number : Integer) return String | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_156_int_to_mini_roman.py | reworded |
end Int_To_Mini_Roman;
end Placeholder;
pragma Ada_2022;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (Number : Integer) return String renames Placeholder.Int_To_Mini_Roman;
begin
pragma Assert (Candidate (19) = "xix");
pragma Assert (Candidate (152) = "clii");
pragma Assert (Candidate (251) = "ccli");
pragma Assert (Candidate (426) = "cdxxvi");
pragma Assert (Candidate (500) = "d");
pragma Assert (Candidate (1) = "i");
pragma Assert (Candidate (4) = "iv");
pragma Assert (Candidate (43) = "xliii");
pragma Assert (Candidate (90) = "xc");
pragma Assert (Candidate (94) = "xciv");
pragma Assert (Candidate (532) = "dxxxii");
pragma Assert (Candidate (900) = "cm");
pragma Assert (Candidate (994) = "cmxciv");
pragma Assert (Candidate (1000) = "m");
end Main; | [
"\n end "
] |
HumanEval_157_right_angle_triangle | adb | pragma Ada_2022;
package Placeholder is
function Right_Angle_Triangle (A : Integer; B : Integer; C : Integer) return Boolean;
-- Given the lengths of the three sides of a triangle. Return True if the three
-- sides form a right-angled triangle, False otherwise.
-- A right-angled triangle is a triangle in which one angle is right angle or
-- 90 degree.
-- Example:
-- >>> Right_Angle_Triangle (3, 4, 5)
-- True
-- >>> Right_Angle_Triangle (1, 2, 3)
-- False
end Placeholder;
pragma Ada_2022;
package body Placeholder is
function Right_Angle_Triangle (A : Integer; B : Integer; C : Integer) return Boolean | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_157_right_angle_triangle.py | reworded |
end Right_Angle_Triangle;
end Placeholder;
pragma Ada_2022;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (A : Integer; B : Integer; C : Integer) return Boolean renames Placeholder.Right_Angle_Triangle;
begin
pragma Assert (Candidate (3, 4, 5) = True);
pragma Assert (Candidate (1, 2, 3) = False);
pragma Assert (Candidate (10, 6, 8) = True);
pragma Assert (Candidate (2, 2, 2) = False);
pragma Assert (Candidate (7, 24, 25) = True);
pragma Assert (Candidate (10, 5, 7) = False);
pragma Assert (Candidate (5, 12, 13) = True);
pragma Assert (Candidate (15, 8, 17) = True);
pragma Assert (Candidate (48, 55, 73) = True);
pragma Assert (Candidate (1, 1, 1) = False);
pragma Assert (Candidate (2, 2, 10) = False);
end Main; | [
"\n end "
] |
HumanEval_158_find_max | adb | pragma Ada_2022;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
package Placeholder is
type Unbounded_String_Array is array (Positive range <>) of Unbounded_String;
function Find_Max (Words : Unbounded_String_Array) return String;
-- Write a function that accepts a Vector of strings.
-- The Vector contains different words. Return the word with maximum number
-- of unique characters. If multiple strings have maximum number of unique
-- characters, return the one which comes first in lexicographical order.
-- >>> Find_Max ([To_Unbounded_String ("name"), To_Unbounded_String ("of"), To_Unbounded_String ("string")])
-- "string"
-- >>> Find_Max ([To_Unbounded_String ("name"), To_Unbounded_String ("enam"), To_Unbounded_String ("game")])
-- "enam"
-- >>> Find_Max ([To_Unbounded_String ("aaaaaaa"), To_Unbounded_String ("bb"), To_Unbounded_String ("cc")])
-- "aaaaaaa"
end Placeholder;
pragma Ada_2022;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
package body Placeholder is
function Find_Max (Words : Unbounded_String_Array) return String | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_158_find_max.py | reworded |
end Find_Max;
end Placeholder;
pragma Ada_2022;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (Words : Unbounded_String_Array) return String renames Placeholder.Find_Max;
begin
pragma Assert (Candidate ([To_Unbounded_String ("name"), To_Unbounded_String ("of"), To_Unbounded_String ("string")]) = "string");
pragma Assert (Candidate ([To_Unbounded_String ("name"), To_Unbounded_String ("enam"), To_Unbounded_String ("game")]) = "enam");
pragma Assert (Candidate ([To_Unbounded_String ("aaaaaaa"), To_Unbounded_String ("bb"), To_Unbounded_String ("cc")]) = "aaaaaaa");
pragma Assert (Candidate ([To_Unbounded_String ("abc"), To_Unbounded_String ("cba")]) = "abc");
pragma Assert (Candidate ([To_Unbounded_String ("play"), To_Unbounded_String ("this"), To_Unbounded_String ("game"), To_Unbounded_String ("of"), To_Unbounded_String ("footbott")]) = "footbott");
pragma Assert (Candidate ([To_Unbounded_String ("we"), To_Unbounded_String ("are"), To_Unbounded_String ("gonna"), To_Unbounded_String ("rock")]) = "gonna");
pragma Assert (Candidate ([To_Unbounded_String ("we"), To_Unbounded_String ("are"), To_Unbounded_String ("a"), To_Unbounded_String ("mad"), To_Unbounded_String ("nation")]) = "nation");
pragma Assert (Candidate ([To_Unbounded_String ("this"), To_Unbounded_String ("is"), To_Unbounded_String ("a"), To_Unbounded_String ("prrk")]) = "this");
pragma Assert (Candidate ([To_Unbounded_String ("b")]) = "b");
pragma Assert (Candidate ([To_Unbounded_String ("play"), To_Unbounded_String ("play"), To_Unbounded_String ("play")]) = "play");
end Main; | [
"\n end "
] |
HumanEval_159_eat | adb | pragma Ada_2022;
package Placeholder is
type Integer_Array is array (Positive range <>) of Integer;
function Eat (Number : Integer; Need : Integer; Remaining : Integer) return Integer_Array;
-- You're a hungry rabbit, and you already have eaten a certain number of carrots,
-- but now you need to eat more carrots to complete the day's meals.
-- you should return an array of [ total number of eaten carrots after your meals,
-- the number of carrots left after your meals ]
-- if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.
-- Example:
-- >>> Eat (5, 6, 10)
-- [11, 4]
-- >>> Eat (4, 8, 9)
-- [12, 1]
-- >>> Eat (1, 10, 10)
-- [11, 0]
-- >>> Eat (2, 11, 5)
-- [7, 0]
-- Variables:
-- @number : integer
-- the number of carrots that you have eaten.
-- @need : integer
-- the number of carrots that you need to eat.
-- @remaining : integer
-- the number of remaining carrots thet exist in stock
-- Constrain:
-- * 0 <= number <= 1000
-- * 0 <= need <= 1000
-- * 0 <= remaining <= 1000
-- Have fun :)
end Placeholder;
pragma Ada_2022;
package body Placeholder is
function Eat (Number : Integer; Need : Integer; Remaining : Integer) return Integer_Array | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_159_eat.py | reworded |
end Eat;
end Placeholder;
pragma Ada_2022;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (Number : Integer; Need : Integer; Remaining : Integer) return Integer_Array renames Placeholder.Eat;
begin
pragma Assert (Candidate (5, 6, 10) = [11, 4]);
pragma Assert (Candidate (4, 8, 9) = [12, 1]);
pragma Assert (Candidate (1, 10, 10) = [11, 0]);
pragma Assert (Candidate (2, 11, 5) = [7, 0]);
pragma Assert (Candidate (4, 5, 7) = [9, 2]);
pragma Assert (Candidate (4, 5, 1) = [5, 0]);
end Main; | [
"\n end "
] |
HumanEval_160_do_algebra | adb | pragma Ada_2022;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
package Placeholder is
type Unbounded_String_Array is array (Positive range <>) of Unbounded_String;
type Integer_Array is array (Positive range <>) of Integer;
function Do_Algebra (Operator : Unbounded_String_Array; Operand : Integer_Array) return Integer;
-- Given two Vectors operator, and operand. The first Vector has basic algebra operations, and
-- the second Vector is a Vector of integers. Use the two given Vectors to build the algebric
-- expression and return the evaluation of this expression.
-- The basic algebra operations:
-- Addition ( + )
-- Subtraction ( - )
-- Multiplication ( * )
-- Floor division ( // )
-- Exponentiation ( ** )
-- Example:
-- operator['+', '*', '-']
-- array = [2, 3, 4, 5]
-- result = 2 + 3 * 4 - 5
-- => result = 9
-- Note:
-- The length of operator Vector is equal to the length of operand Vector minus one.
-- Operand is a Vector of of non-negative integers.
-- Operator Vector has at least one operator, and operand Vector has at least two operands.
end Placeholder;
pragma Ada_2022;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
package body Placeholder is
function Do_Algebra (Operator : Unbounded_String_Array; Operand : Integer_Array) return Integer | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_160_do_algebra.py | reworded |
end Do_Algebra;
end Placeholder;
pragma Ada_2022;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (Operator : Unbounded_String_Array; Operand : Integer_Array) return Integer renames Placeholder.Do_Algebra;
begin
pragma Assert (Candidate ([To_Unbounded_String ("**"), To_Unbounded_String ("*"), To_Unbounded_String ("+")], [2, 3, 4, 5]) = 37);
pragma Assert (Candidate ([To_Unbounded_String ("+"), To_Unbounded_String ("*"), To_Unbounded_String ("-")], [2, 3, 4, 5]) = 9);
pragma Assert (Candidate ([To_Unbounded_String ("//"), To_Unbounded_String ("*")], [7, 3, 4]) = 8);
end Main; | [
"\n end "
] |
HumanEval_161_solve | adb | pragma Ada_2022;
package Placeholder is
function Solve (S : String) return String;
-- You are given a string s.
-- if s[i] is a letter, reverse its case from lower to upper or vise versa,
-- otherwise keep it as it is.
-- If the string contains no letters, reverse the string.
-- The function should return the resulted string.
-- Examples
-- >>> Solve ("1234")
-- "4321"
-- >>> Solve ("ab")
-- "AB"
-- >>> Solve ("#a@C")
-- "#A@c"
end Placeholder;
pragma Ada_2022;
package body Placeholder is
function Solve (S : String) return String | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_161_solve.py | reworded |
end Solve;
end Placeholder;
pragma Ada_2022;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (S : String) return String renames Placeholder.Solve;
begin
pragma Assert (Candidate ("AsDf") = "aSdF");
pragma Assert (Candidate ("1234") = "4321");
pragma Assert (Candidate ("ab") = "AB");
pragma Assert (Candidate ("#a@C") = "#A@c");
pragma Assert (Candidate ("#AsdfW^45") = "#aSDFw^45");
pragma Assert (Candidate ("#6@2") = "2@6#");
pragma Assert (Candidate ("#$a^D") = "#$A^d");
pragma Assert (Candidate ("#ccc") = "#CCC");
end Main; | [
"\n end "
] |
HumanEval_162_string_to_md5 | adb | pragma Ada_2022;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
package Placeholder is
type Unbounded_String_Option (Valid : Boolean := False) is record
case Valid is
when True =>
Value : Unbounded_String;
when False =>
null;
end case;
end record;
function String_To_Md5 (Text : String) return Unbounded_String_Option;
-- Given a string 'text', return its md5 hash equivalent string.
-- If 'text' is an empty string, return null.
-- >>> String_To_Md5 ("Hello world")
-- (Valid => True, Value => To_Unbounded_String ("3e25960a79dbc69b674cd4ec67a72c62"))
end Placeholder;
pragma Ada_2022;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
package body Placeholder is
function String_To_Md5 (Text : String) return Unbounded_String_Option | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_162_string_to_md5.py | reworded |
end String_To_Md5;
end Placeholder;
pragma Ada_2022;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (Text : String) return Unbounded_String_Option renames Placeholder.String_To_Md5;
begin
pragma Assert (Candidate ("Hello world") = (Valid => True, Value => To_Unbounded_String ("3e25960a79dbc69b674cd4ec67a72c62")));
pragma Assert (Candidate ("") = (Valid => False));
pragma Assert (Candidate ("A B C") = (Valid => True, Value => To_Unbounded_String ("0ef78513b0cb8cef12743f5aeb35f888")));
pragma Assert (Candidate ("password") = (Valid => True, Value => To_Unbounded_String ("5f4dcc3b5aa765d61d8327deb882cf99")));
end Main; | [
"\n end "
] |
HumanEval_163_generate_integers | adb | pragma Ada_2022;
package Placeholder is
type Integer_Array is array (Positive range <>) of Integer;
function Generate_Integers (A : Integer; B : Integer) return Integer_Array;
-- Given two positive integers a and b, return the even digits between a
-- and b, in ascending order.
-- For example:
-- >>> Generate_Integers (2, 8)
-- [2, 4, 6, 8]
-- >>> Generate_Integers (8, 2)
-- [2, 4, 6, 8]
-- >>> Generate_Integers (10, 14)
-- []
end Placeholder;
pragma Ada_2022;
package body Placeholder is
function Generate_Integers (A : Integer; B : Integer) return Integer_Array | transform | /mnt/ssd/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_163_generate_integers.py | reworded |
end Generate_Integers;
end Placeholder;
pragma Ada_2022;
with Placeholder; use Placeholder;
procedure Main is
function Candidate (A : Integer; B : Integer) return Integer_Array renames Placeholder.Generate_Integers;
begin
pragma Assert (Candidate (2, 10) = [2, 4, 6, 8]);
pragma Assert (Candidate (10, 2) = [2, 4, 6, 8]);
pragma Assert (Candidate (132, 2) = [2, 4, 6, 8]);
pragma Assert (Candidate (17, 89) = []);
end Main; | [
"\n end "
] |