Prompt:
# Write a function vowels_count which takes a string representing
# a word as input and returns the number of vowels in the string.
# Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a
# vowel, but only when it is at the end of the given word.
# Example:

defmodule HumanEval do
  def candidate(s), do: vowels_count(s)
  def vowels_count(s) do

ExUnit.start()
defmodule HumanEvalTest do
  use ExUnit.Case, async: true
  test 'vowels_count' do
    assert 2 == HumanEval.candidate("abcde")
    assert 3 == HumanEval.candidate("Alone")
    assert 2 == HumanEval.candidate("key")
    assert 1 == HumanEval.candidate("bye")
    assert 2 == HumanEval.candidate("keY")
    assert 1 == HumanEval.candidate("bYe")
    assert 3 == HumanEval.candidate("ACEDY")
  end
end


Prompt:
# Circular shift the digits of the integer x, shift the digits right by shift
# and return the result as a string.
# If shift > number of digits, return digits reversed.

defmodule HumanEval do
  def candidate(x, shift), do: circular_shift(x, shift)
  def circular_shift(x, shift) do

ExUnit.start()
defmodule HumanEvalTest do
  use ExUnit.Case, async: true
  test 'circular_shift' do
    assert "001" == HumanEval.candidate(100, 2)
    assert "12" == HumanEval.candidate(12, 2)
    assert "79" == HumanEval.candidate(97, 8)
    assert "21" == HumanEval.candidate(12, 1)
    assert "11" == HumanEval.candidate(11, 101)
  end
end


Prompt:
# Task
# Write a function that takes a string as input and returns the sum of the upper characters only'
# ASCII codes.
# Examples:

defmodule HumanEval do
  def candidate(s), do: digitSum(s)
  def digitSum(s) do

ExUnit.start()
defmodule HumanEvalTest do
  use ExUnit.Case, async: true
  test 'digitSum' do
    assert 0 == HumanEval.candidate("")
    assert 131 == HumanEval.candidate("abAB")
    assert 67 == HumanEval.candidate("abcCd")
    assert 69 == HumanEval.candidate("helloE")
    assert 131 == HumanEval.candidate("woArBld")
    assert 153 == HumanEval.candidate("aAaaaXa")
    assert 151 == HumanEval.candidate(" How are yOu?")
    assert 327 == HumanEval.candidate("You arE Very Smart")
  end
end


Prompt:
# In this task, you will be given a string that represents a number of apples and oranges
# that are distributed in a basket of fruit this basket contains
# apples, oranges, and mango fruits. Given the string that represents the total number of
# the oranges and apples and an integer that represent the total number of the fruits
# in the basket return the number of the mango fruits in the basket.
# for examble:

defmodule HumanEval do
  def candidate(s, n), do: fruit_distribution(s, n)
  def fruit_distribution(s, n) do

ExUnit.start()
defmodule HumanEvalTest do
  use ExUnit.Case, async: true
  test 'fruit_distribution' do
    assert 8 == HumanEval.candidate("5 apples and 6 oranges", 19)
    assert 10 == HumanEval.candidate("5 apples and 6 oranges", 21)
    assert 2 == HumanEval.candidate("0 apples and 1 oranges", 3)
    assert 2 == HumanEval.candidate("1 apples and 0 oranges", 3)
    assert 95 == HumanEval.candidate("2 apples and 3 oranges", 100)
    assert 0 == HumanEval.candidate("2 apples and 3 oranges", 5)
    assert 19 == HumanEval.candidate("1 apples and 100 oranges", 120)
  end
end


Prompt:
# "Given an array representing a branch of a tree that has non-negative integer nodes
# your task is to pluck one of the nodes and return it.
# The plucked node should be the node with the smallest even value.
# If multiple nodes with the same smallest even value are found return the node that has smallest index.
# The plucked node should be returned in a list, [ smalest_value, its index ],
# If there are no even values or the given array is empty, return [].
# Example 1:
# Explanation: 2 has the smallest even value, and 2 has the smallest index.
# Example 2:
# Explanation: 2 has the smallest even value, and 2 has the smallest index.
# Example 3:
# Example 4:
# Explanation: 0 is the smallest value, but  there are two zeros,
# so we will choose the first zero, which has the smallest index.
# Constraints:
# * 1 <= nodes.length <= 10000
# * 0 <= node.value

defmodule HumanEval do
  def candidate(arr), do: pluck(arr)
  def pluck(arr) do

ExUnit.start()
defmodule HumanEvalTest do
  use ExUnit.Case, async: true
  test 'pluck' do
    assert [2, 1] == HumanEval.candidate([4, 2, 3])
    assert [2, 1] == HumanEval.candidate([1, 2, 3])
    assert [] == HumanEval.candidate([])
    assert [0, 1] == HumanEval.candidate([5, 0, 3, 0, 4, 2])
    assert [0, 3] == HumanEval.candidate([1, 2, 3, 0, 5, 3])
    assert [4, 1] == HumanEval.candidate([5, 4, 8, 4, 8])
    assert [6, 1] == HumanEval.candidate([7, 6, 7, 1])
    assert [] == HumanEval.candidate([7, 9, 7, 1])
  end
end


Prompt:
# You are given a non-empty list of positive integers. Return the greatest integer that is greater than
# zero, and has a frequency greater than or equal to the value of the integer itself.
# The frequency of an integer is the number of times it appears in the list.
# If no such a value exist, return -1.
# Examples:

defmodule HumanEval do
  def candidate(lst), do: search(lst)
  def search(lst) do


Prompt:
# Input to this function is a string represented multiple groups for nested parentheses separated by spaces.
# For each of the group, output the deepest level of nesting of parentheses.
# E.g. (()()) has maximum two levels of nesting while ((())) has three.

defmodule HumanEval do
  def candidate(paren_string), do: parse_nested_parens(paren_string)
  def parse_nested_parens(paren_string) do

ExUnit.start()
defmodule HumanEvalTest do
  use ExUnit.Case, async: true
  test 'parse_nested_parens' do
    assert [2, 3, 1, 3] == HumanEval.candidate("(()()) ((())) () ((())()())")
    assert [1, 2, 3, 4] == HumanEval.candidate("() (()) ((())) (((())))")
    assert [4] == HumanEval.candidate("(()(())((())))")
  end
end


Prompt:
# Given list of integers, return list in strange order.
# Strange sorting, is when you start with the minimum value,
# then maximum of the remaining integers, then minimum and so on.
# Examples:

defmodule HumanEval do
  def candidate(lst), do: strange_sort_list(lst)
  def strange_sort_list(lst) do

ExUnit.start()
defmodule HumanEvalTest do
  use ExUnit.Case, async: true
  test 'strange_sort_list' do
    assert [1, 4, 2, 3] == HumanEval.candidate([1, 2, 3, 4])
    assert [5, 9, 6, 8, 7] == HumanEval.candidate([5, 6, 7, 8, 9])
    assert [1, 5, 2, 4, 3] == HumanEval.candidate([1, 2, 3, 4, 5])
    assert [1, 9, 5, 8, 6, 7] == HumanEval.candidate([5, 6, 7, 8, 9, 1])
    assert [5, 5, 5, 5] == HumanEval.candidate([5, 5, 5, 5])
    assert [] == HumanEval.candidate([])
    assert [1, 8, 2, 7, 3, 6, 4, 5] == HumanEval.candidate([1, 2, 3, 4, 5, 6, 7, 8])
    assert [-5, 5, -5, 5, 0, 2, 2, 2] == HumanEval.candidate([0, 2, 2, 2, 5, 5, -5, -5])
    assert [111111] == HumanEval.candidate([111111])
  end
end


Prompt:
# Given the lengths of the three sides of a triangle. Return the area of
# the triangle rounded to 2 decimal points if the three sides form a valid triangle.
# Otherwise return -1
# Three sides make a valid triangle when the sum of any two sides is greater
# than the third side.
# Example:

defmodule HumanEval do
  def candidate(a, b, c), do: triangle_area(a, b, c)
  def triangle_area(a, b, c) do

ExUnit.start()
defmodule HumanEvalTest do
  use ExUnit.Case, async: true
  test 'triangle_area' do
    assert 6.0 == HumanEval.candidate(3, 4, 5)
    assert -1 == HumanEval.candidate(1, 2, 10)
    assert 8.18 == HumanEval.candidate(4, 8, 5)
    assert 1.73 == HumanEval.candidate(2, 2, 2)
    assert -1 == HumanEval.candidate(1, 2, 3)
    assert 16.25 == HumanEval.candidate(10, 5, 7)
    assert -1 == HumanEval.candidate(2, 6, 3)
    assert 0.43 == HumanEval.candidate(1, 1, 1)
    assert -1 == HumanEval.candidate(2, 2, 10)
  end
end


Prompt:
# Write a function that returns True if the object q will fly, and False otherwise.
# The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.
# Example:
# # 1+2 is less than the maximum possible weight, but it's unbalanced.
# # it's balanced, but 3+2+3 is more than the maximum possible weight.
# # 3+2+3 is less than the maximum possible weight, and it's balanced.
# # 3 is less than the maximum possible weight, and it's balanced.

defmodule HumanEval do
  def candidate(q, w), do: will_it_fly(q, w)
  def will_it_fly(q, w) do

ExUnit.start()
defmodule HumanEvalTest do
  use ExUnit.Case, async: true
  test 'will_it_fly' do
    assert true == HumanEval.candidate([3, 2, 3], 9)
    assert false == HumanEval.candidate([1, 2], 5)
    assert true == HumanEval.candidate([3], 5)
    assert false == HumanEval.candidate([3, 2, 3], 1)
    assert false == HumanEval.candidate([1, 2, 3], 6)
    assert true == HumanEval.candidate([5], 5)
  end
end


Prompt:
# Given an array arr of integers, find the minimum number of elements that
# need to be changed to make the array palindromic. A palindromic array is an array that
# is read the same backwards and forwards. In one change, you can change one element to any other element.
# For example:

defmodule HumanEval do
  def candidate(arr), do: smallest_change(arr)
  def smallest_change(arr) do

ExUnit.start()
defmodule HumanEvalTest do
  use ExUnit.Case, async: true
  test 'smallest_change' do
    assert 4 == HumanEval.candidate([1, 2, 3, 5, 4, 7, 9, 6])
    assert 1 == HumanEval.candidate([1, 2, 3, 4, 3, 2, 2])
    assert 1 == HumanEval.candidate([1, 4, 2])
    assert 1 == HumanEval.candidate([1, 4, 4, 2])
    assert 0 == HumanEval.candidate([1, 2, 3, 2, 1])
    assert 0 == HumanEval.candidate([3, 1, 1, 3])
    assert 0 == HumanEval.candidate([1])
    assert 1 == HumanEval.candidate([0, 1])
  end
end


Prompt:
# Write a function that accepts two lists of strings and returns the list that has
# total number of chars in the all strings of the list less than the other list.
# if the two lists have the same number of chars, return the first list.
# Examples

defmodule HumanEval do
  def candidate(lst1, lst2), do: total_match(lst1, lst2)
  def total_match(lst1, lst2) do

ExUnit.start()
defmodule HumanEvalTest do
  use ExUnit.Case, async: true
  test 'total_match' do
    assert [] == HumanEval.candidate([], [])
    assert ["hi", "hi"] == HumanEval.candidate(["hi", "admin"], ["hi", "hi"])
    assert ["hi", "admin"] == HumanEval.candidate(["hi", "admin"], ["hi", "hi", "admin", "project"])
    assert ["4"] == HumanEval.candidate(["4"], ["1", "2", "3", "4", "5"])
    assert ["hI", "Hi"] == HumanEval.candidate(["hi", "admin"], ["hI", "Hi"])
    assert ["hI", "hi", "hi"] == HumanEval.candidate(["hi", "admin"], ["hI", "hi", "hi"])
    assert ["hi", "admin"] == HumanEval.candidate(["hi", "admin"], ["hI", "hi", "hii"])
    assert [] == HumanEval.candidate([], ["this"])
    assert [] == HumanEval.candidate(["this"], [])
  end
end


Prompt:
# Write a function that returns true if the given number is the multiplication of 3 prime numbers
# and false otherwise.
# Knowing that (a) is less then 100.
# Example:
# 30 = 2 * 3 * 5

defmodule HumanEval do
  def candidate(a), do: is_multiply_prime(a)
  def is_multiply_prime(a) do

ExUnit.start()
defmodule HumanEvalTest do
  use ExUnit.Case, async: true
  test 'is_multiply_prime' do
    assert false == HumanEval.candidate(5)
    assert true == HumanEval.candidate(30)
    assert true == HumanEval.candidate(8)
    assert false == HumanEval.candidate(10)
    assert true == HumanEval.candidate(125)
    assert true == HumanEval.candidate(105)
    assert false == HumanEval.candidate(126)
    assert false == HumanEval.candidate(729)
    assert false == HumanEval.candidate(891)
    assert true == HumanEval.candidate(1001)
  end
end


Prompt:
# Your task is to write a function that returns true if a number x is a simple
# power of n and false in other cases.
# x is a simple power of n if n**int=x
# For example:

defmodule HumanEval do
  def candidate(x, n), do: is_simple_power(x, n)
  def is_simple_power(x, n) do

ExUnit.start()
defmodule HumanEvalTest do
  use ExUnit.Case, async: true
  test 'is_simple_power' do
    assert true == HumanEval.candidate(16, 2)
    assert false == HumanEval.candidate(143214, 16)
    assert true == HumanEval.candidate(4, 2)
    assert true == HumanEval.candidate(9, 3)
    assert true == HumanEval.candidate(16, 4)
    assert false == HumanEval.candidate(24, 2)
    assert false == HumanEval.candidate(128, 4)
    assert false == HumanEval.candidate(12, 6)
    assert true == HumanEval.candidate(1, 1)
    assert true == HumanEval.candidate(1, 12)
  end
end


Prompt:
# Write a function that takes an integer a and returns True
# if this ingeger is a cube of some integer number.
# Note: you may assume the input is always valid.
# Examples:

defmodule HumanEval do
  def candidate(a), do: iscube(a)
  def iscube(a) do

ExUnit.start()
defmodule HumanEvalTest do
  use ExUnit.Case, async: true
  test 'iscube' do
    assert true == HumanEval.candidate(1)
    assert false == HumanEval.candidate(2)
    assert true == HumanEval.candidate(-1)
    assert true == HumanEval.candidate(64)
    assert false == HumanEval.candidate(180)
    assert true == HumanEval.candidate(1000)
    assert true == HumanEval.candidate(0)
    assert false == HumanEval.candidate(1729)
  end
end


Prompt:
# You have been tasked to write a function that receives
# a hexadecimal number as a string and counts the number of hexadecimal
# digits that are primes (prime number, or a prime, is a natural number
# greater than 1 that is not a product of two smaller natural numbers).
# Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.
# Prime numbers are 2, 3, 5, 7, 11, 13, 17,...
# So you have to determine a number of the following digits: 2, 3, 5, 7,
# B (=decimal 11), D (=decimal 13).
# Note: you may assume the input is always correct or empty string,
# and symbols A,B,C,D,E,F are always uppercase.
# Examples:

defmodule HumanEval do
  def candidate(num), do: hex_key(num)
  def hex_key(num) do

ExUnit.start()
defmodule HumanEvalTest do
  use ExUnit.Case, async: true
  test 'hex_key' do
    assert 1 == HumanEval.candidate("AB")
    assert 2 == HumanEval.candidate("1077E")
    assert 4 == HumanEval.candidate("ABED1A33")
    assert 2 == HumanEval.candidate("2020")
    assert 6 == HumanEval.candidate("123456789ABCDEF0")
    assert 12 == HumanEval.candidate("112233445566778899AABBCCDDEEFF00")
  end
end


Prompt:
# You will be given a number in decimal form and your task is to convert it to
# binary format. The function should return a string, with each character representing a binary
# number. Each character in the string will be '0' or '1'.
# There will be an extra couple of characters 'db' at the beginning and at the end of the string.
# The extra characters are there to help with the format.
# Examples:

defmodule HumanEval do
  def candidate(decimal), do: decimal_to_binary(decimal)
  def decimal_to_binary(decimal) do

ExUnit.start()
defmodule HumanEvalTest do
  use ExUnit.Case, async: true
  test 'decimal_to_binary' do
    assert "db0db" == HumanEval.candidate(0)
    assert "db100000db" == HumanEval.candidate(32)
    assert "db1100111db" == HumanEval.candidate(103)
    assert "db1111db" == HumanEval.candidate(15)
  end
end


Prompt:
# Filter an input list of strings only for ones that contain given substring

defmodule HumanEval do
  def candidate(strings, substring), do: filter_by_substring(strings, substring)
  def filter_by_substring(strings, substring) do

ExUnit.start()
defmodule HumanEvalTest do
  use ExUnit.Case, async: true
  test 'filter_by_substring' do
    assert [] == HumanEval.candidate([], "john")
    assert ["xxx", "xxxAAA", "xxx"] == HumanEval.candidate(["xxx", "asd", "xxy", "john doe", "xxxAAA", "xxx"], "xxx")
    assert ["xxx", "aaaxxy", "xxxAAA", "xxx"] == HumanEval.candidate(["xxx", "asd", "aaaxxy", "john doe", "xxxAAA", "xxx"], "xx")
    assert ["grunt", "prune"] == HumanEval.candidate(["grunt", "trumpet", "prune", "gruesome"], "run")
  end
end


Prompt:
# You are given a string s.
# Your task is to check if the string is happy or not.
# A string is happy if its length is at least 3 and every 3 consecutive letters are distinct
# For example:

defmodule HumanEval do
  def candidate(s), do: is_happy(s)
  def is_happy(s) do

ExUnit.start()
defmodule HumanEvalTest do
  use ExUnit.Case, async: true
  test 'is_happy' do
    assert false == HumanEval.candidate("a")
    assert false == HumanEval.candidate("aa")
    assert true == HumanEval.candidate("abcd")
    assert false == HumanEval.candidate("aabb")
    assert true == HumanEval.candidate("adb")
    assert false == HumanEval.candidate("xyy")
    assert true == HumanEval.candidate("iopaxpoi")
    assert false == HumanEval.candidate("iopaxioi")
  end
end


Prompt:
# It is the last week of the semester and the teacher has to give the grades
# to students. The teacher has been making her own algorithm for grading.
# The only problem is, she has lost the code she used for grading.
# She has given you a list of GPAs for some students and you have to write
# a function that can output a list of letter grades using the following table:
# GPA       |    Letter grade
# 4.0                A+
# > 3.7                A
# > 3.3                A-
# > 3.0                B+
# > 2.7                B
# > 2.3                B-
# > 2.0                C+
# > 1.7                C
# > 1.3                C-
# > 1.0                D+
# > 0.7                D
# > 0.0                D-
# 0.0                E
# Example:

defmodule HumanEval do
  def candidate(grades), do: numerical_letter_grade(grades)
  def numerical_letter_grade(grades) do

ExUnit.start()
defmodule HumanEvalTest do
  use ExUnit.Case, async: true
  test 'numerical_letter_grade' do
    assert ["A+", "B", "C-", "C", "A-"] == HumanEval.candidate([4.0, 3, 1.7, 2, 3.5])
    assert ["D+"] == HumanEval.candidate([1.2])
    assert ["D-"] == HumanEval.candidate([0.5])
    assert ["E"] == HumanEval.candidate([0.0])
    assert ["D", "D-", "C-", "B", "B+"] == HumanEval.candidate([1.0, 0.3, 1.5, 2.8, 3.3])
    assert ["E", "D-"] == HumanEval.candidate([0.0, 0.7])
  end
end


Prompt:
# Write a function that takes a string and returns True if the string
# length is a prime number or False otherwise
# Examples

defmodule HumanEval do
  def candidate(string), do: prime_length(string)
  def prime_length(string) do

ExUnit.start()
defmodule HumanEvalTest do
  use ExUnit.Case, async: true
  test 'prime_length' do
    assert true == HumanEval.candidate("Hello")
    assert true == HumanEval.candidate("abcdcba")
    assert true == HumanEval.candidate("kittens")
    assert false == HumanEval.candidate("orange")
    assert true == HumanEval.candidate("wow")
    assert true == HumanEval.candidate("world")
    assert true == HumanEval.candidate("MadaM")
    assert true == HumanEval.candidate("Wow")
    assert false == HumanEval.candidate("")
    assert true == HumanEval.candidate("HI")
    assert true == HumanEval.candidate("go")
    assert false == HumanEval.candidate("gogo")
    assert false == HumanEval.candidate("aaaaaaaaaaaaaaa")
    assert true == HumanEval.candidate("Madam")
    assert false == HumanEval.candidate("M")
    assert false == HumanEval.candidate("0")
  end
end


Prompt:
# Given a positive integer N, return the total sum of its digits in binary.
# Example
# Variables:
# @N integer
# Constraints: 0 ≤ N ≤ 10000.
# Output:
# a string of binary number

defmodule HumanEval do
  def candidate(N), do: solve(N)
  def solve(N) do

ExUnit.start()
defmodule HumanEvalTest do
  use ExUnit.Case, async: true
  test 'solve' do
    assert "1" == HumanEval.candidate(1000)
    assert "110" == HumanEval.candidate(150)
    assert "1100" == HumanEval.candidate(147)
    assert "1001" == HumanEval.candidate(333)
    assert "10010" == HumanEval.candidate(963)
  end
end


Prompt:
# Given a non-empty list of integers lst. add the even elements that are at odd indices..
# Examples:

defmodule HumanEval do
  def candidate(lst), do: add(lst)
  def add(lst) do

ExUnit.start()
defmodule HumanEvalTest do
  use ExUnit.Case, async: true
  test 'add' do
    assert 88 == HumanEval.candidate([4, 88])
    assert 122 == HumanEval.candidate([4, 5, 6, 7, 2, 122])
    assert 0 == HumanEval.candidate([4, 0, 6, 7])
    assert 12 == HumanEval.candidate([4, 4, 6, 8])
  end
end


Prompt:
# Write a function that takes a string and returns an ordered version of it.
# Ordered version of string, is a string where all words (separated by space)
# are replaced by a new word where all the characters arranged in
# ascending order based on ascii value.
# Note: You should keep the order of words and blank spaces in the sentence.
# For example:

defmodule HumanEval do
  def candidate(s), do: anti_shuffle(s)
  def anti_shuffle(s) do

ExUnit.start()
defmodule HumanEvalTest do
  use ExUnit.Case, async: true
  test 'anti_shuffle' do
    assert "Hi" == HumanEval.candidate("Hi")
    assert "ehllo" == HumanEval.candidate("hello")
    assert "bemnru" == HumanEval.candidate("number")
    assert "abcd" == HumanEval.candidate("abcd")
    assert "Hello !!!Wdlor" == HumanEval.candidate("Hello World!!!")
    assert "" == HumanEval.candidate("")
    assert ".Hi My aemn is Meirst .Rboot How aer ?ouy" == HumanEval.candidate("Hi. My name is Mister Robot. How are you?")
  end
end


Prompt:
# You are given a 2 dimensional data, as a nested lists,
# which is similar to matrix, however, unlike matrices,
# each row may contain a different number of columns.
# Given lst, and integer x, find integers x in the list,
# and return list of tuples, [(x1, y1), (x2, y2) ...] such that
# each tuple is a coordinate - (row, columns), starting with 0.
# Sort coordinates initially by rows in ascending order.
# Also, sort coordinates of the row by columns in descending order.
# Examples:

defmodule HumanEval do
  def candidate(lst, x), do: get_row(lst, x)
  def get_row(lst, x) do


Prompt:
# Given an array of non-negative integers, return a copy of the given array after sorting,
# you will sort the given array in ascending order if the sum( first index value, last index value) is odd,
# or sort it in descending order if the sum( first index value, last index value) is even.
# Note:
# * don't change the given array.
# Examples:

defmodule HumanEval do
  def candidate(array), do: sort_array(array)
  def sort_array(array) do

ExUnit.start()
defmodule HumanEvalTest do
  use ExUnit.Case, async: true
  test 'sort_array' do
    assert [] == HumanEval.candidate([])
    assert [5] == HumanEval.candidate([5])
    assert [0, 1, 2, 3, 4, 5] == HumanEval.candidate([2, 4, 3, 0, 1, 5])
    assert [6, 5, 4, 3, 2, 1, 0] == HumanEval.candidate([2, 4, 3, 0, 1, 5, 6])
    assert [1, 2] == HumanEval.candidate([2, 1])
    assert [0, 11, 15, 32, 42, 87] == HumanEval.candidate([15, 42, 87, 32, 11, 0])
    assert [23, 21, 14, 11] == HumanEval.candidate([21, 14, 23, 11])
  end
end


Prompt:
# Create a function encrypt that takes a string as an argument and
# returns a string encrypted with the alphabet being rotated.
# The alphabet should be rotated in a manner such that the letters
# shift down by two multiplied to two places.
# For example:

defmodule HumanEval do
  def candidate(s), do: encrypt(s)
  def encrypt(s) do

ExUnit.start()
defmodule HumanEvalTest do
  use ExUnit.Case, async: true
  test 'encrypt' do
    assert "lm" == HumanEval.candidate("hi")
    assert "ewhjklnop" == HumanEval.candidate("asdfghjkl")
    assert "kj" == HumanEval.candidate("gf")
    assert "ix" == HumanEval.candidate("et")
    assert "jeiajeaijeiak" == HumanEval.candidate("faewfawefaewg")
    assert "lippsqcjvmirh" == HumanEval.candidate("hellomyfriend")
    assert "hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl" == HumanEval.candidate("dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh")
    assert "e" == HumanEval.candidate("a")
  end
end


Prompt:
# For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.
# Empty sum should be equal to 0 and empty product should be equal to 1.

defmodule HumanEval do
  def candidate(numbers), do: sum_product(numbers)
  def sum_product(numbers) do

ExUnit.start()
defmodule HumanEvalTest do
  use ExUnit.Case, async: true
  test 'sum_product' do
    assert {0, 1} == HumanEval.candidate([])
    assert {3, 1} == HumanEval.candidate([1, 1, 1])
    assert {100, 0} == HumanEval.candidate([100, 0])
    assert {15, 105} == HumanEval.candidate([3, 5, 7])
    assert {10, 10} == HumanEval.candidate([10])
  end
end


Prompt:
# You are given a list of integers.
# Write a function next_smallest() that returns the 2nd smallest element of the list.
# Return None if there is no such element.

defmodule HumanEval do
  def candidate(lst), do: next_smallest(lst)
  def next_smallest(lst) do

ExUnit.start()
defmodule HumanEvalTest do
  use ExUnit.Case, async: true
  test 'next_smallest' do
    assert 2 == HumanEval.candidate([1, 2, 3, 4, 5])
    assert 2 == HumanEval.candidate([5, 1, 4, 3, 2])
    assert nil == HumanEval.candidate([])
    assert nil == HumanEval.candidate([1, 1])
    assert 1 == HumanEval.candidate([1, 1, 1, 1, 0])
    assert nil == HumanEval.candidate([1, 1])
    assert -35 == HumanEval.candidate([-35, 34, 12, -45])
  end
end


Prompt:
# You'll be given a string of words, and your task is to count the number
# of boredoms. A boredom is a sentence that starts with the word "I".
# Sentences are delimited by '.', '?' or '!'.
# For example:

defmodule HumanEval do
  def candidate(S), do: is_bored(S)
  def is_bored(S) do

ExUnit.start()
defmodule HumanEvalTest do
  use ExUnit.Case, async: true
  test 'is_bored' do
    assert 0 == HumanEval.candidate("Hello world")
    assert 0 == HumanEval.candidate("Is the sky blue?")
    assert 1 == HumanEval.candidate("I love It !")
    assert 0 == HumanEval.candidate("bIt")
    assert 2 == HumanEval.candidate("I feel good today. I will be productive. will kill It")
    assert 0 == HumanEval.candidate("You and I are going for a walk")
  end
end


Prompt:
# Create a function that takes 3 numbers.
# Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.
# Returns false in any other cases.
# Examples

defmodule HumanEval do
  def candidate(x, y, z), do: any_int(x, y, z)
  def any_int(x, y, z) do

ExUnit.start()
defmodule HumanEvalTest do
  use ExUnit.Case, async: true
  test 'any_int' do
    assert true == HumanEval.candidate(2, 3, 1)
    assert false == HumanEval.candidate(2.5, 2, 3)
    assert false == HumanEval.candidate(1.5, 5, 3.5)
    assert false == HumanEval.candidate(2, 6, 2)
    assert true == HumanEval.candidate(4, 2, 2)
    assert false == HumanEval.candidate(2.2, 2.2, 2.2)
    assert true == HumanEval.candidate(-4, 6, 2)
    assert true == HumanEval.candidate(2, 1, 1)
    assert true == HumanEval.candidate(3, 4, 7)
    assert false == HumanEval.candidate(3.0, 4, 7)
  end
end


Prompt:
# Write a function that takes a message, and encodes in such a
# way that it swaps case of all letters, replaces all vowels in
# the message with the letter that appears 2 places ahead of that
# vowel in the english alphabet.
# Assume only letters.
# Examples:

defmodule HumanEval do
  def candidate(message), do: encode(message)
  def encode(message) do

ExUnit.start()
defmodule HumanEvalTest do
  use ExUnit.Case, async: true
  test 'encode' do
    assert "tgst" == HumanEval.candidate("TEST")
    assert "mWDCSKR" == HumanEval.candidate("Mudasir")
    assert "ygs" == HumanEval.candidate("YES")
    assert "tHKS KS C MGSSCGG" == HumanEval.candidate("This is a message")
    assert "k dQnT kNqW wHcT Tq wRkTg" == HumanEval.candidate("I DoNt KnOw WhAt tO WrItE")
  end
end


Prompt:
# You are given a list of integers.
# You need to find the largest prime value and return the sum of its digits.
# Examples:

defmodule HumanEval do
  def candidate(lst), do: skjkasdkd(lst)
  def skjkasdkd(lst) do


Prompt:
# Given a dictionary, return True if all keys are strings in lower
# case or all keys are strings in upper case, else return False.
# The function should return False is the given dictionary is empty.
# Examples:

defmodule HumanEval do
  def candidate(dict), do: check_dict_case(dict)
  def check_dict_case(dict) do

ExUnit.start()
defmodule HumanEvalTest do
  use ExUnit.Case, async: true
  test 'check_dict_case' do
    assert true == HumanEval.candidate(%{"p" => "pineapple", "b" => "banana"})
    assert false == HumanEval.candidate(%{"p" => "pineapple", "A" => "banana", "B" => "banana"})
    assert false == HumanEval.candidate(%{"p" => "pineapple", "5" => "banana", "a" => "apple"})
    assert false == HumanEval.candidate(%{"Name" => "John", "Age" => "36", "City" => "Houston"})
    assert true == HumanEval.candidate(%{"STATE" => "NC", "ZIP" => "12345"})
    assert true == HumanEval.candidate(%{"fruit" => "Orange", "taste" => "Sweet"})
    assert false == HumanEval.candidate(%{})
  end
end


Prompt:
# Implement a function that takes an non-negative integer and returns an array of the first n
# integers that are prime numbers and less than n.
# for example:

defmodule HumanEval do
  def candidate(n), do: count_up_to(n)
  def count_up_to(n) do

ExUnit.start()
defmodule HumanEvalTest do
  use ExUnit.Case, async: true
  test 'count_up_to' do
    assert [2, 3] == HumanEval.candidate(5)
    assert [2, 3, 5] == HumanEval.candidate(6)
    assert [2, 3, 5] == HumanEval.candidate(7)
    assert [2, 3, 5, 7] == HumanEval.candidate(10)
    assert [] == HumanEval.candidate(0)
    assert [2, 3, 5, 7, 11, 13, 17, 19] == HumanEval.candidate(22)
    assert [] == HumanEval.candidate(1)
    assert [2, 3, 5, 7, 11, 13, 17] == HumanEval.candidate(18)
    assert [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43] == HumanEval.candidate(47)
    assert [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97] == HumanEval.candidate(101)
  end
end


Prompt:
# Complete the function that takes two integers and returns
# the product of their unit digits.
# Assume the input is always valid.
# Examples:

defmodule HumanEval do
  def candidate(a, b), do: multiply(a, b)
  def multiply(a, b) do

ExUnit.start()
defmodule HumanEvalTest do
  use ExUnit.Case, async: true
  test 'multiply' do
    assert 16 == HumanEval.candidate(148, 412)
    assert 72 == HumanEval.candidate(19, 28)
    assert 0 == HumanEval.candidate(2020, 1851)
    assert 20 == HumanEval.candidate(14, -15)
    assert 42 == HumanEval.candidate(76, 67)
    assert 49 == HumanEval.candidate(17, 27)
    assert 0 == HumanEval.candidate(0, 1)
    assert 0 == HumanEval.candidate(0, 0)
  end
end


Prompt:
# Given a string s, count the number of uppercase vowels in even indices.
# For example:

defmodule HumanEval do
  def candidate(s), do: count_upper(s)
  def count_upper(s) do

ExUnit.start()
defmodule HumanEvalTest do
  use ExUnit.Case, async: true
  test 'count_upper' do
    assert 1 == HumanEval.candidate("aBCdEf")
    assert 0 == HumanEval.candidate("abcdefg")
    assert 0 == HumanEval.candidate("dBBE")
    assert 0 == HumanEval.candidate("B")
    assert 1 == HumanEval.candidate("U")
    assert 0 == HumanEval.candidate("")
    assert 2 == HumanEval.candidate("EEEE")
  end
end


Prompt:
# Create a function that takes a value (string) representing a number
# and returns the closest integer to it. If the number is equidistant
# from two integers, round it away from zero.
# Examples
# Note:
# Rounding away from zero means that if the given number is equidistant
# from two integers, the one you should return is the one that is the
# farthest from zero. For example closest_integer("14.5") should
# return 15 and closest_integer("-14.5") should return -15.

defmodule HumanEval do
  def candidate(value), do: closest_integer(value)
  def closest_integer(value) do

ExUnit.start()
defmodule HumanEvalTest do
  use ExUnit.Case, async: true
  test 'closest_integer' do
    assert 10 == HumanEval.candidate("10")
    assert 15 == HumanEval.candidate("14.5")
    assert -16 == HumanEval.candidate("-15.5")
    assert 15 == HumanEval.candidate("15.3")
    assert 0 == HumanEval.candidate("0")
  end
end


Prompt:
# From a given list of integers, generate a list of rolling maximum element found until given moment
# in the sequence.

defmodule HumanEval do
  def candidate(numbers), do: rolling_max(numbers)
  def rolling_max(numbers) do

ExUnit.start()
defmodule HumanEvalTest do
  use ExUnit.Case, async: true
  test 'rolling_max' do
    assert [] == HumanEval.candidate([])
    assert [1, 2, 3, 4] == HumanEval.candidate([1, 2, 3, 4])
    assert [4, 4, 4, 4] == HumanEval.candidate([4, 3, 2, 1])
    assert [3, 3, 3, 100, 100] == HumanEval.candidate([3, 2, 3, 100, 3])
  end
end