Dataset Viewer
Auto-converted to Parquet Duplicate
custom_id
stringlengths
12
12
method
stringclasses
1 value
url
stringclasses
1 value
body
dict
779682de5441
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "from typing import List\n\n\ndef has_close_elements(numbers: List[float], threshold: float) -> bool:\n \"\"\" Check if in given list of numbers, are any two numbers closer to each other than\n given threshold.\n >>> has_close...
9aca1241d366
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "from typing import List\n\n\ndef separate_paren_groups(paren_string: str) -> List[str]:\n \"\"\" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n separate those group into se...
aeb5c7afb1f3
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def truncate_number(number: float) -> float:\n \"\"\" Given a positive floating point number, it can be decomposed into\n and integer part (largest integer smaller than given number) and decimals\n (leftover part always small...
98bfec1503c8
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "from typing import List\n\n\ndef below_zero(operations: List[int]) -> bool:\n \"\"\" You're given a list of deposit and withdrawal operations on a bank account that starts with\n zero balance. Your task is to detect if at any po...
a11e0b6ef27e
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "from typing import List\n\n\ndef mean_absolute_deviation(numbers: List[float]) -> float:\n \"\"\" For a given list of input numbers, calculate Mean Absolute Deviation\n around the mean of this dataset.\n Mean Absolute Deviati...
743255fa4f17
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "from typing import List\n\n\ndef intersperse(numbers: List[int], delimeter: int) -> List[int]:\n \"\"\" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n >>> intersperse([], 4)\n []\...
f3ccb8a21ce8
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "from typing import List\n\n\ndef parse_nested_parens(paren_string: str) -> List[int]:\n \"\"\" Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n For each of the group, o...
1a710e5578ff
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "from typing import List\n\n\ndef filter_by_substring(strings: List[str], substring: str) -> List[str]:\n \"\"\" Filter an input list of strings only for ones that contain given substring\n >>> filter_by_substring([], 'a')\n [...
d2dfa0ff9ec2
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "from typing import List, Tuple\n\n\ndef sum_product(numbers: List[int]) -> Tuple[int, int]:\n \"\"\" For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n Empty sum shoul...
d8f1e7ce94c9
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "from typing import List, Tuple\n\n\ndef rolling_max(numbers: List[int]) -> List[int]:\n \"\"\" From a given list of integers, generate a list of rolling maximum element found until given moment\n in the sequence.\n >>> rollin...
807b13361e42
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def is_palindrome(string: str) -> bool:\n \"\"\" Test if given string is a palindrome \"\"\"\n return string == string[::-1]\n\n\ndef make_palindrome(string: str) -> str:\n \"\"\" Find the shortest palindrome that begins with...
189a7a22efe4
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "from typing import List\n\n\ndef string_xor(a: str, b: str) -> str:\n \"\"\" Input are two strings a and b consisting only of 1s and 0s.\n Perform binary XOR on these inputs and return result also as a string.\n >>> string_xo...
d5c8d3647556
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "from typing import List, Optional\n\n\ndef longest(strings: List[str]) -> Optional[str]:\n \"\"\" Out of list of strings, return the longest one. Return the first one in case of multiple\n strings of the same length. Return None...
e054f4044bf0
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def greatest_common_divisor(a: int, b: int) -> int:\n \"\"\" Return a greatest common divisor of two integers a and b\n >>> greatest_common_divisor(3, 5)\n 1\n >>> greatest_common_divisor(25, 15)\n 5\n \"\"\"" } ...
1898b937efca
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "from typing import List\n\n\ndef all_prefixes(string: str) -> List[str]:\n \"\"\" Return list of all prefixes from shortest to longest of the input string\n >>> all_prefixes('abc')\n ['a', 'ab', 'abc']\n \"\"\"" } ] ...
dff805dedd7e
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def string_sequence(n: int) -> str:\n \"\"\" Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n >>> string_sequence(0)\n '0'\n >>> string_sequence(5)\n '0 1 2 3 4 5'\n \"\"\"" ...
9b6e53303692
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def count_distinct_characters(string: str) -> int:\n \"\"\" Given a string, find out how many distinct characters (regardless of case) does it consist of\n >>> count_distinct_characters('xyzXYZ')\n 3\n >>> count_distinct_c...
c0561c2bf017
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "from typing import List\n\n\ndef parse_music(music_string: str) -> List[int]:\n \"\"\" Input to this function is a string representing musical notes in a special ASCII format.\n Your task is to parse this string and return list ...
4db1f5491ba4
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def how_many_times(string: str, substring: str) -> int:\n \"\"\" Find how many times a given substring can be found in the original string. Count overlaping cases.\n >>> how_many_times('', 'a')\n 0\n >>> how_many_times('aa...
cdaa799ab5f5
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "from typing import List\n\n\ndef sort_numbers(numbers: str) -> str:\n \"\"\" Input is a space-delimited string of numberals from 'zero' to 'nine'.\n Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven'...
71c8721141a9
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "from typing import List, Tuple\n\n\ndef find_closest_elements(numbers: List[float]) -> Tuple[float, float]:\n \"\"\" From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n o...
96f92851e6f6
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "from typing import List\n\n\ndef rescale_to_unit(numbers: List[float]) -> List[float]:\n \"\"\" Given list of numbers (of at least two elements), apply a linear transform to that list,\n such that the smallest number will become...
a653bee950ab
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "from typing import List, Any\n\n\ndef filter_integers(values: List[Any]) -> List[int]:\n \"\"\" Filter given list of any python values only for integers\n >>> filter_integers(['a', 3.14, 5])\n [5]\n >>> filter_integers([1,...
92e1c1c4a37a
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def strlen(string: str) -> int:\n \"\"\" Return length of given string\n >>> strlen('')\n 0\n >>> strlen('abc')\n 3\n \"\"\"" } ] }
47c439c04ff7
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def largest_divisor(n: int) -> int:\n \"\"\" For a given number n, find the largest number that divides n evenly, smaller than n\n >>> largest_divisor(15)\n 5\n \"\"\"" } ] }
122752b4451b
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "from typing import List\n\n\ndef factorize(n: int) -> List[int]:\n \"\"\" Return list of prime factors of given integer in the order from smallest to largest.\n Each of the factors should be listed number of times corresponding ...
63aff9ed2fd1
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "from typing import List\n\n\ndef remove_duplicates(numbers: List[int]) -> List[int]:\n \"\"\" From a list of integers, remove all elements that occur more than once.\n Keep order of elements left the same as in the input.\n >...
a9cbf5ca66e8
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def flip_case(string: str) -> str:\n \"\"\" For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n >>> flip_case('Hello')\n 'hELLO'\n \"\"\"" } ] }
7f0f01384aaf
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "from typing import List\n\n\ndef concatenate(strings: List[str]) -> str:\n \"\"\" Concatenate list of strings into a single string\n >>> concatenate([])\n ''\n >>> concatenate(['a', 'b', 'c'])\n 'abc'\n \"\"\"" }...
f6755edfb25f
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "from typing import List\n\n\ndef filter_by_prefix(strings: List[str], prefix: str) -> List[str]:\n \"\"\" Filter an input list of strings only for ones that start with a given prefix.\n >>> filter_by_prefix([], 'a')\n []\n ...
8122a6b4eca7
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def get_positive(l: list):\n \"\"\"Return only positive numbers in the list.\n >>> get_positive([-1, 2, -4, 5, 6])\n [2, 5, 6]\n >>> get_positive([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n [5, 3, 2, 3, 9, 123, 1]\n \...
e2f73cbaef33
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def is_prime(n):\n \"\"\"Return true if a given number is prime, and false otherwise.\n >>> is_prime(6)\n False\n >>> is_prime(101)\n True\n >>> is_prime(11)\n True\n >>> is_prime(13441)\n True\n >>> is_p...
98d43d9077c7
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "import math\n\n\ndef poly(xs: list, x: float):\n \"\"\"\n Evaluates polynomial with coefficients xs at point x.\n return xs[0] + xs[1] * x + xs[1] * x^2 + .... xs[n] * x^n\n \"\"\"\n return sum([coeff * math.pow(x, i) f...
b2de9bc0f639
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def sort_third(l: list):\n \"\"\"This function takes a list l and returns a list l' such that\n l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three a...
0d0c3ab41e54
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def unique(l: list):\n \"\"\"Return sorted unique elements in a list\n >>> unique([5, 3, 5, 2, 3, 3, 9, 0, 123])\n [0, 2, 3, 5, 9, 123]\n \"\"\"" } ] }
4737c8d1cb3c
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def max_element(l: list):\n \"\"\"Return maximum element in the list.\n >>> max_element([1, 2, 3])\n 3\n >>> max_element([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n 123\n \"\"\"" } ] }
d94f2ad6489e
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def fizz_buzz(n: int):\n \"\"\"Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n >>> fizz_buzz(50)\n 0\n >>> fizz_buzz(78)\n 2\n >>> fizz_buzz(79)\n 3\n \...
ed82c4d3c52c
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def sort_even(l: list):\n \"\"\"This function takes a list l and returns a list l' such that\n l' is identical to l in the odd indicies, while its values at the even indicies are equal\n to the values of the even indicies of ...
36bade592089
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def encode_cyclic(s: str):\n \"\"\"\n returns encoded string by cycling groups of three characters.\n \"\"\"\n # split string to groups. Each of length 3.\n groups = [s[(3 * i):min((3 * i + 3), len(s))] for i in range((...
857b0275403a
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def prime_fib(n: int):\n \"\"\"\n prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n >>> prime_fib(1)\n 2\n >>> prime_fib(2)\n 3\n >>> prime_fib(3)\n 5\n >>> prime_fib(4)\n 13...
9b68a8f82931
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def triples_sum_to_zero(l: list):\n \"\"\"\n triples_sum_to_zero takes a list of integers as an input.\n it returns True if there are three distinct elements in the list that\n sum to zero, and False otherwise.\n\n >>> ...
09656606da0f
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def car_race_collision(n: int):\n \"\"\"\n Imagine a road that's a perfectly straight infinitely long line.\n n cars are driving left to right; simultaneously, a different set of n cars\n are driving right to left. The ...
bc2ea73164c3
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def incr_list(l: list):\n \"\"\"Return list with elements incremented by 1.\n >>> incr_list([1, 2, 3])\n [2, 3, 4]\n >>> incr_list([5, 3, 5, 2, 3, 3, 9, 0, 123])\n [6, 4, 6, 3, 4, 4, 10, 1, 124]\n \"\"\"" } ] }
f2d5108bcd7f
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def pairs_sum_to_zero(l):\n \"\"\"\n pairs_sum_to_zero takes a list of integers as an input.\n it returns True if there are two distinct elements in the list that\n sum to zero, and False otherwise.\n >>> pairs_sum_to_z...
74e905f9a967
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def change_base(x: int, base: int):\n \"\"\"Change numerical base of input number x to base.\n return string representation after the conversion.\n base numbers are less than 10.\n >>> change_base(8, 3)\n '22'\n >>> ...
000e0293c8be
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def triangle_area(a, h):\n \"\"\"Given length of a side and high return area for a triangle.\n >>> triangle_area(5, 3)\n 7.5\n \"\"\"" } ] }
a33dbdb87412
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def fib4(n: int):\n \"\"\"The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n fib4(0) -> 0\n fib4(1) -> 0\n fib4(2) -> 2\n fib4(3) -> 0\n fib4(n) -> fib4(n-1) + fib4...
21ddeed97e9c
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def median(l: list):\n \"\"\"Return median of elements in the list l.\n >>> median([3, 1, 2, 4, 5])\n 3\n >>> median([-10, 4, 6, 1000, 10, 20])\n 15.0\n \"\"\"" } ] }
2fadd3fd700a
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def is_palindrome(text: str):\n \"\"\"\n Checks if given string is a palindrome\n >>> is_palindrome('')\n True\n >>> is_palindrome('aba')\n True\n >>> is_palindrome('aaaaa')\n True\n >>> is_palindrome('zbcd'...
d32e46e8bf66
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def modp(n: int, p: int):\n \"\"\"Return 2^n modulo p (be aware of numerics).\n >>> modp(3, 5)\n 3\n >>> modp(1101, 101)\n 2\n >>> modp(0, 101)\n 1\n >>> modp(3, 11)\n 8\n >>> modp(100, 101)\n 1\n \...
44bcbc712df4
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def encode_shift(s: str):\n \"\"\"\n returns encoded string by shifting every character by 5 in the alphabet.\n \"\"\"\n return \"\".join([chr(((ord(ch) + 5 - ord(\"a\")) % 26) + ord(\"a\")) for ch in s])\n\n\ndef decode_s...
17aa5a399c69
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def remove_vowels(text):\n \"\"\"\n remove_vowels is a function that takes string and returns string without vowels.\n >>> remove_vowels('')\n ''\n >>> remove_vowels(\"abcdef\\nghijklm\")\n 'bcdf\\nghjklm'\n >>> r...
2e30f44a4160
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def below_threshold(l: list, t: int):\n \"\"\"Return True if all numbers in the list l are below threshold t.\n >>> below_threshold([1, 2, 4, 10], 100)\n True\n >>> below_threshold([1, 20, 4, 10], 5)\n False\n \"\"\"...
77fd6fb7255e
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def add(x: int, y: int):\n \"\"\"Add two numbers x and y\n >>> add(2, 3)\n 5\n >>> add(5, 7)\n 12\n \"\"\"" } ] }
22ea1616ebcf
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def same_chars(s0: str, s1: str):\n \"\"\"\n Check if two words have the same characters.\n >>> same_chars('eabcdzzzz', 'dddzzzzzzzddeddabc')\n True\n >>> same_chars('abcd', 'dddddddabc')\n True\n >>> same_chars('...
ea4e2227f554
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def fib(n: int):\n \"\"\"Return n-th Fibonacci number.\n >>> fib(10)\n 55\n >>> fib(1)\n 1\n >>> fib(8)\n 21\n \"\"\"" } ] }
1a3c8f2b5d11
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def correct_bracketing(brackets: str):\n \"\"\" brackets is a string of \"<\" and \">\".\n return True if every opening bracket has a corresponding closing bracket.\n\n >>> correct_bracketing(\"<\")\n False\n >>> correc...
655bc4590fc6
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def monotonic(l: list):\n \"\"\"Return True is list elements are monotonically increasing or decreasing.\n >>> monotonic([1, 2, 4, 20])\n True\n >>> monotonic([1, 20, 4, 10])\n False\n >>> monotonic([4, 1, 0, -10])\n...
2502c1f9144c
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def common(l1: list, l2: list):\n \"\"\"Return sorted unique common elements for two lists.\n >>> common([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121])\n [1, 5, 653]\n >>> common([5, 3, 2, 8], [3, 2])\n [2, 3]\n\n...
b4f835ba8d88
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def largest_prime_factor(n: int):\n \"\"\"Return the largest prime factor of n. Assume n > 1 and is not a prime.\n >>> largest_prime_factor(13195)\n 29\n >>> largest_prime_factor(2048)\n 2\n \"\"\"" } ] }
71b9705d2ee4
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def sum_to_n(n: int):\n \"\"\"sum_to_n is a function that sums numbers from 1 to n.\n >>> sum_to_n(30)\n 465\n >>> sum_to_n(100)\n 5050\n >>> sum_to_n(5)\n 15\n >>> sum_to_n(10)\n 55\n >>> sum_to_n(1)\n ...
7cb8044ebaf5
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def correct_bracketing(brackets: str):\n \"\"\" brackets is a string of \"(\" and \")\".\n return True if every opening bracket has a corresponding closing bracket.\n\n >>> correct_bracketing(\"(\")\n False\n >>> correc...
c8a84d67e942
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def derivative(xs: list):\n \"\"\" xs represent coefficients of a polynomial.\n xs[0] + xs[1] * x + xs[2] * x^2 + ....\n Return derivative of this polynomial in the same form.\n >>> derivative([3, 1, 2, 4, 5])\n [1, 4,...
f2e414dec369
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def fibfib(n: int):\n \"\"\"The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n fibfib(0) == 0\n fibfib(1) == 0\n fibfib(2) == 1\n fibfib(n) == fibfib(n-1) + fibfib(n...
27e93671223a
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "FIX = \"\"\"\nAdd more test cases.\n\"\"\"\n\ndef vowels_count(s):\n \"\"\"Write a function vowels_count which takes a string representing\n a word as input and returns the number of vowels in the string.\n Vowels in this cas...
5bc2ce00111f
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def circular_shift(x, shift):\n \"\"\"Circular shift the digits of the integer x, shift the digits right by shift\n and return the result as a string.\n If shift > number of digits, return digits reversed.\n >>> circular_s...
4eee385642a4
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def digitSum(s):\n \"\"\"Task\n Write a function that takes a string as input and returns the sum of the upper characters only'\n ASCII codes.\n\n Examples:\n digitSum(\"\") => 0\n digitSum(\"abAB\") => 131\n...
e7c881649e21
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def fruit_distribution(s,n):\n \"\"\"\n In this task, you will be given a string that represents a number of apples and oranges \n that are distributed in a basket of fruit this basket contains \n apples, oranges, and mang...
12fc1502a5a2
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def pluck(arr):\n \"\"\"\n \"Given an array representing a branch of a tree that has non-negative integer nodes\n your task is to pluck one of the nodes and return it.\n The plucked node should be the node with the smalles...
ad4a7d41115c
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def search(lst):\n '''\n You are given a non-empty list of positive integers. Return the greatest integer that is greater than \n zero, and has a frequency greater than or equal to the value of the integer itself. \n The f...
f35350eee88f
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def strange_sort_list(lst):\n '''\n Given list of integers, return list in strange order.\n Strange sorting, is when you start with the minimum value,\n then maximum of the remaining integers, then minimum and so on.\n\n ...
208ef87f9c99
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def triangle_area(a, b, c):\n '''\n Given the lengths of the three sides of a triangle. Return the area of\n the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n Otherwise return -1\n Th...
9c0eb3c4d382
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def will_it_fly(q,w):\n '''\n Write a function that returns True if the object q will fly, and False otherwise.\n The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or e...
d39cbe026bd6
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def smallest_change(arr):\n \"\"\"\n Given an array arr of integers, find the minimum number of elements that\n need to be changed to make the array palindromic. A palindromic array is an array that\n is read the same back...
4c3ae7bce2a8
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def total_match(lst1, lst2):\n '''\n Write a function that accepts two lists of strings and returns the list that has \n total number of chars in the all strings of the list less than the other list.\n\n if the two lists h...
e5ad5a270f43
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def is_multiply_prime(a):\n \"\"\"Write a function that returns true if the given number is the multiplication of 3 prime numbers\n and false otherwise.\n Knowing that (a) is less then 100. \n Example:\n is_multiply_pri...
850f001e289f
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def is_simple_power(x, n):\n \"\"\"Your task is to write a function that returns true if a number x is a simple\n power of n and false in other cases.\n x is a simple power of n if n**int=x\n For example:\n is_simple_po...
10b7b44285ca
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def iscube(a):\n '''\n Write a function that takes an integer a and returns True \n if this ingeger is a cube of some integer number.\n Note: you may assume the input is always valid.\n Examples:\n iscube(1) ==> True...
aa8c1f8106ec
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def hex_key(num):\n \"\"\"You have been tasked to write a function that receives \n a hexadecimal number as a string and counts the number of hexadecimal \n digits that are primes (prime number, or a prime, is a natural numbe...
3847a0fb6c8d
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def decimal_to_binary(decimal):\n \"\"\"You will be given a number in decimal form and your task is to convert it to\n binary format. The function should return a string, with each character representing a binary\n number. Ea...
9415e4722304
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def is_happy(s):\n \"\"\"You are given a string s.\n Your task is to check if the string is happy or not.\n A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n For example:\n is_...
1bf20e9da9ca
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def numerical_letter_grade(grades):\n \"\"\"It is the last week of the semester and the teacher has to give the grades\n to students. The teacher has been making her own algorithm for grading.\n The only problem is, she has l...
b74bbe086ec3
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def prime_length(string):\n \"\"\"Write a function that takes a string and returns True if the string\n length is a prime number or False otherwise\n Examples\n prime_length('Hello') == True\n prime_length('abcdcba') ==...
238c8b2b1d13
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def starts_one_ends(n):\n \"\"\"\n Given a positive integer n, return the count of the numbers of n-digit\n positive integers that start or end with 1.\n \"\"\"" } ] }
34a6004759a4
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def solve(N):\n \"\"\"Given a positive integer N, return the total sum of its digits in binary.\n \n Example\n For N = 1000, the sum of digits will be 1 the output should be \"1\".\n For N = 150, the sum of digi...
b3e92a1e1059
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def add(lst):\n \"\"\"Given a non-empty list of integers lst. add the even elements that are at odd indices..\n\n\n Examples:\n add([4, 2, 6, 7]) ==> 2 \n \"\"\"" } ] }
f0b5ca0de63e
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def anti_shuffle(s):\n \"\"\"\n Write a function that takes a string and returns an ordered version of it.\n Ordered version of string, is a string where all words (separated by space)\n are replaced by a new word where al...
48d406e95b17
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def get_row(lst, x):\n \"\"\"\n You are given a 2 dimensional data, as a nested lists,\n which is similar to matrix, however, unlike matrices,\n each row may contain a different number of columns.\n Given lst, and integ...
271a6f498a4f
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def sort_array(array):\n \"\"\"\n Given an array of non-negative integers, return a copy of the given array after sorting,\n you will sort the given array in ascending order if the sum( first index value, last index value) is...
dc0f42393e85
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def encrypt(s):\n \"\"\"Create a function encrypt that takes a string as an argument and\n returns a string encrypted with the alphabet being rotated. \n The alphabet should be rotated in a manner such that the letters \n ...
04fcc14f6bb4
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def next_smallest(lst):\n \"\"\"\n You are given a list of integers.\n Write a function next_smallest() that returns the 2nd smallest element of the list.\n Return None if there is no such element.\n \n next_smallest...
bb14a9a1d53b
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def is_bored(S):\n \"\"\"\n You'll be given a string of words, and your task is to count the number\n of boredoms. A boredom is a sentence that starts with the word \"I\".\n Sentences are delimited by '.', '?' or '!'.\n ...
bc5a5f4f0746
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def any_int(x, y, z):\n '''\n Create a function that takes 3 numbers.\n Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n Returns false in any other cases.\n \n ...
1ff54a2da443
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def encode(message):\n \"\"\"\n Write a function that takes a message, and encodes in such a \n way that it swaps case of all letters, replaces all vowels in \n the message with the letter that appears 2 places ahead of th...
d767023b3df0
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def skjkasdkd(lst):\n \"\"\"You are given a list of integers.\n You need to find the largest prime value and return the sum of its digits.\n\n Examples:\n For lst = [0,3,2,1,3,5,7,4,5,5,5,2,181,32,4,32,3,2,32,324,4,3] the ...
063589ff2a63
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def check_dict_case(dict):\n \"\"\"\n Given a dictionary, return True if all keys are strings in lower \n case or all keys are strings in upper case, else return False.\n The function should return False is the given dicti...
ebb74c541c2d
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def count_up_to(n):\n \"\"\"Implement a function that takes an non-negative integer and returns an array of the first n\n integers that are prime numbers and less than n.\n for example:\n count_up_to(5) => [2,3]\n count...
7df830747b0b
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def multiply(a, b):\n \"\"\"Complete the function that takes two integers and returns \n the product of their unit digits.\n Assume the input is always valid.\n Examples:\n multiply(148, 412) should return 16.\n mult...
70d135eb5105
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def count_upper(s):\n \"\"\"\n Given a string s, count the number of uppercase vowels in even indices.\n \n For example:\n count_upper('aBCdEf') returns 1\n count_upper('abcdefg') returns 0\n count_upper('dBBE') r...
e827a6babc15
POST
/v1/chat/completions
{ "model": "[MODEL]", "messages": [ { "role": "user", "content": "def closest_integer(value):\n '''\n Create a function that takes a value (string) representing a number\n and returns the closest integer to it. If the number is equidistant\n from two integers, round it away from zero.\n\...
End of preview. Expand in Data Studio

openai-humaneval-prompt-only

Prompt-only eval extraction from openai/openai_humaneval.

  • Generic Doubleword requests: 164
  • Request model placeholder: [MODEL]
Downloads last month
35

Collection including jamesdborin/openai-humaneval-prompt-only