data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "Given a string 's', write a function 'extract_captures' that captures all substrings of 's' that match a given pattern 'p'. The function should return a list of tuples, where each tuple contains the starting index of the match and the matched substring. The pattern 'p' is a sim... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_captures('abcde', 'a*e') == [(0, 'abcde')]\", \"assert extract_captures('pattern matching', 'p*g') == [(0, 'pattern matching')]\", \"assert extract_captures('123456789', '1*9') == [(0, '123456789')]\", \"assert extract_captures('xyz', 'x*') == [(0, '... | {
"split": "train",
"index": 69300,
"acecode_id": "bigcode_python_fns_41057",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a list of residues and a corresponding list of numbers. Your task is to implement a function that takes an integer n and returns the corresponding number from the list if n exists in the residues list. If n does not exist in the residues list, your function should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_number(1, [1, 2, 3], [10, 20, 30]) == 10\", \"assert get_number(2, [1, 2, 3], [10, 20, 30]) == 20\", \"assert get_number(3, [1, 2, 3], [10, 20, 30]) == 30\", \"assert get_number(4, [4, 5, 6], [40, 50, 60]) == 40\", \"assert get_number(5, [4, 5, 6], [40, ... | {
"split": "train",
"index": 69301,
"acecode_id": "bigcode_python_fns_47663",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a parser for a custom rule format. The rules are provided as a list of strings, where each string represents a rule. Your task is to write a Python function `parse_rules_list` that takes a list of rule strings as input and returns a list of pars... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_rules_list(['# This is a comment', 'valid_rule1', 'valid_rule2', 'invalid_rule3', 'valid_rule4']) == ['valid_rule1', 'valid_rule2', 'valid_rule4']\", \"assert parse_rules_list(['# Comment', '', 'valid_rule']) == ['valid_rule']\", \"assert parse_rules_l... | {
"split": "train",
"index": 69302,
"acecode_id": "oss_37281",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of file names as strings. Your task is to create a function that takes this list and returns a list of dictionaries, where each dictionary contains the following keys: 'file_name', 'length', and 'is_empty'. The 'file_name' should be the name of the file, 'l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert file_info(['']) == [{'file_name': '', 'length': 0, 'is_empty': True}]\", \"assert file_info(['singlefile.txt']) == [{'file_name': 'singlefile.txt', 'length': 14, 'is_empty': False}]\", \"assert file_info([]) == []\", \"assert file_info(['a', 'b', 'c']) == [{... | {
"split": "train",
"index": 69303,
"acecode_id": "bigcode_python_fns_10429",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates basic banking operations. The function should take a list of operations, where each operation is a tuple containing the operation type and the amount. The operation types can be 'deposit' or 'withdraw'. The function sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bank_account([('deposit', 100.0), ('withdraw', 50.0)]) == 50.0\", \"assert bank_account([('deposit', 200.0), ('withdraw', 300.0)]) == 200.0\", \"assert bank_account([('deposit', 150.0), ('withdraw', 150.0), ('withdraw', 10.0)]) == 0.0\", \"assert bank_accoun... | {
"split": "train",
"index": 69304,
"acecode_id": "oss_26896",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple game engine for a turn-based game. In this game, each character can perform different actions on their turn, such as moving in a direction or turning to face another direction. You need to implement a function `perform_action` that take... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert perform_action('STEP', 'north') == (0, 1)\", \"assert perform_action('STEP', 'east') == (1, 0)\", \"assert perform_action('STEP', 'south') == (0, -1)\", \"assert perform_action('STEP', 'west') == (-1, 0)\", \"assert perform_action('STEP', 'east') == (1, 0)\"... | {
"split": "train",
"index": 69305,
"acecode_id": "oss_35579",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of insertion sites and a corresponding list of binned counts. Your task is to create a function that generates a histogram-like representation of these insertion sites based on their counts. The function should return a list of tuples, where each tuple cont... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_insertion_histogram([1, 2, 3], [10, 20, 30]) == [(1, 10), (2, 20), (3, 30)]\", \"assert generate_insertion_histogram([5, 10, 15], [5, 0, 15]) == [(5, 5), (10, 0), (15, 15)]\", \"assert generate_insertion_histogram([], []) == []\", \"assert generate_... | {
"split": "train",
"index": 69306,
"acecode_id": "bigcode_python_fns_34235",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a grid-like object represented by a list of coordinate pairs, where each pair consists of (y, x) values. Your task is to implement a function `get_grid_coordinates(input_grid)` that takes in this grid-like object and returns the same structure as the input. The fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_grid_coordinates([(1, 2), (3, 4)]) == [(1, 2), (3, 4)]\", \"assert get_grid_coordinates([(0, 0), (1, 1), (2, 2)]) == [(0, 0), (1, 1), (2, 2)]\", \"assert get_grid_coordinates([(5, 6), (7, 8)]) == [(5, 6), (7, 8)]\", \"assert get_grid_coordinates([(-1, -1... | {
"split": "train",
"index": 69307,
"acecode_id": "oss_4495",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of numbers, `vec1` and `vec2`, representing two vectors, implement a function `cos_sim(vec1: List[float], vec2: List[float]) -> float` that returns the cosine similarity between them. The cosine similarity is calculated as the dot product of the two vectors divi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cos_sim([1, 2, 3], [4, 5, 6]) == 0.9746318461970762\", \"assert cos_sim([1, 0, 0], [0, 1, 0]) == 0.0\", \"assert cos_sim([], [1, 2]) == 0.0\", \"assert cos_sim([0, 0, 0], [0, 0, 0]) == 0.0\", \"assert cos_sim([3, 4], [4, 3]) == 0.96\", \"assert cos_sim([1], ... | {
"split": "train",
"index": 69308,
"acecode_id": "bigcode_python_fns_41965",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function `power(n: float, m: float) -> float` that calculates the result of raising a base `n` to an exponent `m` using recursion. The function should handle both positive and negative values for `m`, as well as fractional exponents. You should not use Python's `**`... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert power(3, 7) == 2187.0\", \"assert power(3, 0) == 1.0\", \"assert power(3, -2) == 0.1111111111111111\", \"assert power(2, 3) == 8.0\", \"assert power(2, -3) == 0.125\", \"assert power(0, 3) == 0.0\", \"assert power(-2, 3) == -8.0\", \"assert power(-2, 2) == 4... | {
"split": "train",
"index": 69309,
"acecode_id": "evol_23188",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function that creates a custom hash table from two given sets of strings, where the first set contains keys and the second set contains corresponding values. The function should handle basic operations such as inserting elements, deleting elements, and retrieving va... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_hash_table({'apple', 'banana'}, {'fruit', 'tasty'}) == {'apple': 'fruit', 'banana': 'tasty'}\", \"assert create_hash_table({'cherry', 'date'}, {'healthy', 'sweet'}) == {'cherry': 'healthy', 'date': 'sweet'}\", \"assert create_hash_table({'orange'}, {'... | {
"split": "train",
"index": 69310,
"acecode_id": "evol_5801",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Write a function `print_with_line_numbers(text: str) -> str` that takes a string `text`, which contains multiple lines of code, and returns a string where each line of the original text is prefixed with its corresponding line number, starting from 1. Each line number should be ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert print_with_line_numbers('print(\\\"Hello, World!\\\")\\\\nfor i in range(5):') == '1: print(\\\"Hello, World!\\\")\\\\n2: for i in range(5):'\", \"assert print_with_line_numbers('def hello():\\\\n pass') == '1: def hello():\\\\n2: pass'\", \"assert pr... | {
"split": "train",
"index": 69311,
"acecode_id": "evol_17113",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes two lists of integers and merges them into one list, ensuring that all duplicate entries are removed. The resultant list should be sorted in descending order, and you must implement the sorting without using Python's built-in sorting functions. The f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merged_list([1, 4, 3, 3, 2, 5], [5, 7, 1, 5, 9, 4]) == [9, 7, 5, 4, 3, 2, 1]\", \"assert merged_list([5, 3, 2], [3, 2, 8]) == [8, 5, 3, 2]\", \"assert merged_list([], []) == []\", \"assert merged_list([1, 2, 3], []) == [3, 2, 1]\", \"assert merged_list([], [... | {
"split": "train",
"index": 69312,
"acecode_id": "evol_13143",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Construct a Python function that takes in two lists and an integer denoted as k. The function's responsibility is to create a new list that includes all elements from both lists, excluding the k'th element from each list. If k exceeds the length of either list, the function sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_kth_element([1, 2, 3], [4, 5, 6], 5) == [6, 5, 4, 3, 2, 1]\", \"assert remove_kth_element([1, 2, 3], [4, 5, 6], -1) == [1, 2, 4, 5]\", \"assert remove_kth_element([], [], 3) == [3]\", \"assert remove_kth_element([1, 2], [], 0) == [2]\", \"assert remov... | {
"split": "train",
"index": 69313,
"acecode_id": "evol_12462",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing names of items in a queue. Your task is to implement a function that removes all occurrences of a specified item from the queue. The function should return a new list containing only the items that are not equal to the specified item... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_item_from_queue(['apple', 'banana', 'orange', 'banana'], 'banana') == ['apple', 'orange']\", \"assert remove_item_from_queue(['apple', 'banana', 'orange'], 'grape') == ['apple', 'banana', 'orange']\", \"assert remove_item_from_queue(['apple', 'apple',... | {
"split": "train",
"index": 69314,
"acecode_id": "bigcode_python_fns_30937",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a mathematical function that simulates the behavior of a custom neural network layer. This function takes an input list of numbers and a list of learnable parameters, with the same length as the input list. The function should compute the elemen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert custom_layer([-1.0, 2.0, -3.0], [0.0, 0.5, 0.5], 'relu') == [0.0, 1.0, 0.0]\", \"assert custom_layer([0.0, 0.5, 1.0], [1.0, 1.0, 1.0], 'sigmoid') == [0.5, 0.6224593312018546, 0.7310585786300049]\", \"assert custom_layer([2.0, 3.0], [0.5, 0.5], 'relu') == [1.... | {
"split": "train",
"index": 69315,
"acecode_id": "oss_29335",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a list of balloons represented by their coordinates in a three-dimensional space. Each balloon is defined by four integers: `xstart`, `xend`, `ystart`, and `yend`, which represent the start and end of the horizontal and vertical diameters of the balloon. An arrow ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert findMinArrowShots([[1,2,1,2],[3,4,3,4],[5,6,5,6],[7,8,7,8]]) == 4\", \"assert findMinArrowShots([[1,2,1,2],[2,3,2,3],[3,4,3,4],[4,5,4,5]]) == 2\", \"assert findMinArrowShots([[1,5,1,5],[2,6,2,6],[3,7,3,7]]) == 1\", \"assert findMinArrowShots([[1,2,1,2]]) == ... | {
"split": "train",
"index": 69316,
"acecode_id": "evol_9254",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple dictionary for storing words and their meanings. The function should accept a word and its meaning as inputs, and a list of existing words. If the word does not already exist in the list of existing words, it shoul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_word('hello', 'a greeting', []) == {'hello': 'a greeting'}\", \"assert add_word('world', 'the earth', [('hello', 'a greeting')]) == {'hello': 'a greeting', 'world': 'the earth'}\", \"assert add_word('hello', 'a greeting', [('hello', 'a greeting')]) == {'... | {
"split": "train",
"index": 69317,
"acecode_id": "bigcode_python_fns_22692",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `find_leap_years(start_year: int, end_year: int) -> List[int]` that takes two integers representing the start and end years (inclusive) and returns a list of all leap years within that range. A leap year is defined as a year that is divisible by 4, except for y... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_leap_years(1900, 2000) == [1904, 1908, 1912, 1916, 1920, 1924, 1928, 1932, 1936, 1940, 1944, 1948, 1952, 1956, 1960, 1964, 1968, 1972, 1976, 1980, 1984, 1988, 1992, 1996, 2000]\", \"assert find_leap_years(1980, 1990) == [1980, 1984, 1988]\", \"assert fi... | {
"split": "train",
"index": 69318,
"acecode_id": "evol_35541",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Write a function `text_value(s: bytes) -> bytes` that converts a raw byte string representing a text value into a properly formatted byte string. The function should interpret escape characters and perform whitespace mapping according to the following rules: \n\n- Convert lineb... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert text_value(b'Hello\\\\nWorld') == b'Hello\\\\nWorld'\", \"assert text_value(b'Hello\\\\rWorld') == b'Hello\\\\nWorld'\", \"assert text_value(b'Hello\\\\r\\\\nWorld') == b'Hello\\\\nWorld'\", \"assert text_value(b'Hello\\\\n\\\\tWorld') == b'Hello\\\\n World'... | {
"split": "train",
"index": 69319,
"acecode_id": "bigcode_python_fns_14865",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function `get_data_from_list(data_list: List[float], start: int, end: int) -> List[float]`. The function takes a list of floating point numbers and returns a sublist containing elements from the `start` index to the `end` index (inclusive). If the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_data_from_list([1.0, 2.5, 3.7, 4.1], 1, 2) == [2.5, 3.7]\", \"assert get_data_from_list([1.0, 2.5, 3.7, 4.1], 0, 3) == [1.0, 2.5, 3.7, 4.1]\", \"assert get_data_from_list([1.0, 2.5, 3.7, 4.1], 2, 5) == [3.7, 4.1]\", \"assert get_data_from_list([-1.0, 0.0... | {
"split": "train",
"index": 69320,
"acecode_id": "bigcode_python_fns_27031",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of 5 integers representing the values of a pie chart, implement a function that calculates the percentage distribution of each integer in relation to the total sum of the integers. The function should return a list of percentages rounded to one decimal place. The i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_percentages([250, 250, 250, 250, 250]) == [20.0, 20.0, 20.0, 20.0, 20.0]\", \"assert calculate_percentages([150, 150, 150, 150, 150]) == [20.0, 20.0, 20.0, 20.0, 20.0]\", \"assert calculate_percentages([300, 300, 300, 300, 300]) == [20.0, 20.0, 20.... | {
"split": "train",
"index": 69321,
"acecode_id": "evol_7765",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given an integer year, write a function to determine if it is a leap year. A leap year is defined as a year that is evenly divisible by 4, except for end-of-century years, which must be divisible by 400 to be considered a leap year. Implement the function `is_leap_year(year)` t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_leap_year(2020) == True\", \"assert is_leap_year(1900) == False\", \"assert is_leap_year(2000) == True\", \"assert is_leap_year(2021) == False\", \"assert is_leap_year(1600) == True\", \"assert is_leap_year(1700) == False\", \"assert is_leap_year(1800) ==... | {
"split": "train",
"index": 69322,
"acecode_id": "oss_22332",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating the creation of a new extension package. Write a function `make_pkg(pkgname: str, context: Dict[str, str]) -> Union[bool, Tuple[bool, str]]` that takes a package name and a context mapping as input. The function should return True if the package c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert make_pkg('valid_package', {}) == True\", \"assert make_pkg('anotherValidPackage', {'key': 'value'}) == True\", \"assert make_pkg('package123', {}) == True\", \"assert make_pkg('package_with_underscore', {}) == True\", \"assert make_pkg('', {}) == (False, 'In... | {
"split": "train",
"index": 69323,
"acecode_id": "bigcode_python_fns_36297",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a greeting message. Implement a function `create_greeting(phrase: str, name: str) -> str` that takes two parameters: a greeting phrase and a name. The function should return a string that combines the phrase and the name into a complete greeting in ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_greeting('Bonjour', 'Alice') == 'Bonjour, Alice!'\", \"assert create_greeting('Hello', 'Bob') == 'Hello, Bob!'\", \"assert create_greeting('Hi', '') == 'Hi'\", \"assert create_greeting('Greetings', 'Charlie') == 'Greetings, Charlie!'\", \"assert creat... | {
"split": "train",
"index": 69324,
"acecode_id": "bigcode_python_fns_35294",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to implement a function named `find_maximum` that returns the maximum integer from the list. If the list is empty, the function should return None. You can assume that the input list will only contain integers (both positive and ne... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_maximum([1, 2, 3]) == 3\", \"assert find_maximum([-1, -2, -3]) == -1\", \"assert find_maximum([0, 0, 0]) == 0\", \"assert find_maximum([]) == None\", \"assert find_maximum([-1, 0, 1]) == 1\", \"assert find_maximum([5]) == 5\", \"assert find_maximum([3, ... | {
"split": "train",
"index": 69325,
"acecode_id": "oss_19109",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the inventory management of a game character. The function should take a list of operations, where each operation is represented as a string. The operations can be one of the following: \"give_item:item\", \"take_item:i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_inventory(['give_item:sword', 'give_item:shield', 'check_inventory']) == ['sword', 'shield']\", \"assert manage_inventory(['give_item:health_potion', 'take_item:health_potion', 'check_inventory']) == []\", \"assert manage_inventory(['give_item:gold', ... | {
"split": "train",
"index": 69326,
"acecode_id": "oss_2322",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that checks if a given number is a prime number. A prime number is defined as a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. Implement the function `is_prime(n)` where `n` is the number to be checked. The funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_prime(2) == True\", \"assert is_prime(3) == True\", \"assert is_prime(4) == False\", \"assert is_prime(5) == True\", \"assert is_prime(10) == False\", \"assert is_prime(11) == True\", \"assert is_prime(13) == True\", \"assert is_prime(14) == False\", \"as... | {
"split": "train",
"index": 69327,
"acecode_id": "evol_23888",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python context manager that ensures a resource is properly managed after its usage. Your task is to implement the `ResourceManager` context manager class, which should handle the opening and closing of a resource. The class should be used in a way... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert ResourceManager('test_resource').__enter__() == 'Resource acquired'\", \"assert ResourceManager('test_resource').__exit__(None, None, None) == 'Resource released'\", \"assert ResourceManager('test_resource').__enter__() == 'Resource acquired'\", \"assert Res... | {
"split": "train",
"index": 69328,
"acecode_id": "oss_16026",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that modifies a given input string by surrounding it with question marks. Implement a function `add_question_marks(instr: str) -> str` that takes a string `instr` and returns a new string with a question mark added at the beginning and at... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_question_marks('Hello') == '? Hello ?'\", \"assert add_question_marks('Test') == '? Test ?'\", \"assert add_question_marks('LeetCode') == '? LeetCode ?'\", \"assert add_question_marks('Python') == '? Python ?'\", \"assert add_question_marks('') == '? ?'... | {
"split": "train",
"index": 69329,
"acecode_id": "bigcode_python_fns_6078",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a Python function that computes the nth element in the Fibonacci sequence. The Fibonacci sequence starts with 0 and 1, and each subsequent number is the sum of the previous two numbers. Specifically, the sequence is as follows: F(1) = 0, F(2) = 1, F(3) = 1, F(4) = 2, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(1) == 0\", \"assert fibonacci(2) == 1\", \"assert fibonacci(3) == 1\", \"assert fibonacci(4) == 2\", \"assert fibonacci(5) == 3\", \"assert fibonacci(6) == 5\", \"assert fibonacci(7) == 8\", \"assert fibonacci(8) == 13\", \"assert fibonacci(9) == 2... | {
"split": "train",
"index": 69330,
"acecode_id": "evol_4658",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a worker's behavior based on the availability of tasks in a database. The function `do_work` should take a configuration parameter and a logger object. The function will check if there are any tasks to be done. If there... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert do_work({}, logger_mock) == False\", \"assert do_work({'tasks': []}, logger_mock) == False\", \"assert do_work({'tasks': ['task1']}, logger_mock) == True\", \"assert do_work({'tasks': ['task1', 'task2']}, logger_mock) == True\", \"assert do_work({'tasks': ['... | {
"split": "train",
"index": 69331,
"acecode_id": "bigcode_python_fns_17622",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the final price of a product after applying a discount and adding Value Added Tax (VAT) to it. The VAT rate in the United Kingdom is 20%. The function should take two parameters: the original price of the product and t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_final_price(100, 20) == 96.0\", \"assert calculate_final_price(50, 0) == 60.0\", \"assert calculate_final_price(150, 50) == 90.0\", \"assert calculate_final_price(300, 25) == 270.0\", \"assert calculate_final_price(0, 20) == 0.0\", \"assert calcula... | {
"split": "train",
"index": 69332,
"acecode_id": "oss_1431",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes an array of numbers as input and returns a new array containing the absolute values of these numbers, sorted in ascending order. The input array must contain between 5 and 100 elements, inclusive. If the input does not meet these criteria, or if ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sorted_absolute_values([-5, 3, -2, 2, 3, -3, 9, 0, -123]) == [0, 2, 2, 3, 3, 3, 5, 9, 123]\", \"assert sorted_absolute_values([1, -1, 2, -2, 0]) == [0, 1, 1, 2, 2]\", \"assert sorted_absolute_values([5, -10, 3, 8, -5]) == [3, 5, 5, 8, 10]\", \"assert sorted_... | {
"split": "train",
"index": 69333,
"acecode_id": "evol_15047",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python program to manage a contact list. You need to implement a function `modify_contact_by_id(modified_contact: Contact, contact_list: List[Contact]) -> None`. This function updates the details of a contact based on the provided `modified_contac... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert modify_contact_by_id(Contact('Doe', 'John', '123 Main St'), [Contact('Doe', 'John', '123 Main St')]) == None\", \"assert modify_contact_by_id(Contact('Doe', 'John', '123 Main St', 'john.doe@example.com'), [Contact('Doe', 'John', '123 Main St')]) == None\", \... | {
"split": "train",
"index": 69334,
"acecode_id": "oss_7164",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a nested list where each inner list contains exactly two elements. The function should return a new nested list containing two separate lists: the first list should contain all the first elements from each inner list, and the second list should c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert split_pairs([[1, 2], [3, 4], [5, 6]]) == [[1, 3, 5], [2, 4, 6]]\", \"assert split_pairs([['a', 'b'], ['c', 'd'], ['e', 'f']]) == [['a', 'c', 'e'], ['b', 'd', 'f']]\", \"assert split_pairs([[10, 20], [30, 40]]) == [[10, 30], [20, 40]]\", \"assert split_pairs(... | {
"split": "train",
"index": 69335,
"acecode_id": "evol_19407",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a simple job queue. Your goal is to implement a function `foo(identifier)` that takes a unique identifier (an integer) as input and returns a string indicating that the worker with that identifier is performing its task. The function must format t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert foo(0) == 'Worker 0 is performing its task'\", \"assert foo(1) == 'Worker 1 is performing its task'\", \"assert foo(2) == 'Worker 2 is performing its task'\", \"assert foo(3) == 'Worker 3 is performing its task'\", \"assert foo(4) == 'Worker 4 is performing ... | {
"split": "train",
"index": 69336,
"acecode_id": "oss_15070",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that validates the structure of a given response object from an API call. The function should be named `validate_api_response(response)` and take a `response` object as input. Your function should perform the following checks: 1. A... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_api_response(MockResponse(content_type='application/json', json=[{'team': {'id': 1}, 'user': {'id': 2}, 'is_leader': True}])) is None\", \"assert validate_api_response(MockResponse(content_type='application/json', json=[{'team': {'id': 1}, 'user': {... | {
"split": "train",
"index": 69337,
"acecode_id": "oss_30460",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simplified version of a context manager for managing resources in Python. Your function should take a string representing a resource name, an optional mode for accessing the resource, and any additional keyword argume... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_resource('test_resource').__enter__() == 'Opened resource: test_resource'\", \"assert manage_resource('test_resource', mode='read').__enter__() == 'Opened resource: test_resource'\", \"assert manage_resource('another_resource').__enter__() == 'Opened ... | {
"split": "train",
"index": 69338,
"acecode_id": "oss_34244",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function named `greeting` that takes two parameters: `name` (a string) and `role` (a string). The function should return a greeting message in the format: 'Hello, my name is {name} and I am a {role}.'\nPlease reason step by step, then write a self-contained Python s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert greeting('Alice', 'Data Scientist') == 'Hello, my name is Alice and I am a Data Scientist.'\", \"assert greeting('Bob', 'Product Manager') == 'Hello, my name is Bob and I am a Product Manager.'\", \"assert greeting('Charlie', 'Software Engineer') == 'Hello, ... | {
"split": "train",
"index": 69339,
"acecode_id": "evol_643",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the number of pages in different sections of a document. Your task is to implement a function that takes this list of integers and returns a tuple containing two items: a list of strings, where each string represents a section with ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_sections([10, 20, 30]) == (['Section 1: 10 pages', 'Section 2: 20 pages', 'Section 3: 30 pages'], {'total_pages': 60})\", \"assert transform_sections([0]) == (['Section 1: 0 pages'], {'total_pages': 0})\", \"assert transform_sections([]) == ([], {'... | {
"split": "train",
"index": 69340,
"acecode_id": "bigcode_python_fns_7037",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a sorted array of integers that can be in either non-increasing or non-decreasing order, implement a function that finds the smallest positive integer that is not present in the array. The array may contain negative numbers or zeros. You must achieve this with a time comp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert findSmallest([-1, -2, -3]) == 1\", \"assert findSmallest([1, 2, 3]) == 4\", \"assert findSmallest([3, 2, 1]) == 4\", \"assert findSmallest([0, 0, 0]) == 1\", \"assert findSmallest([-5, -3, -1]) == 1\", \"assert findSmallest([1, 2, 0]) == 3\", \"assert findSm... | {
"split": "train",
"index": 69341,
"acecode_id": "evol_691",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that constructs a profile for a user. The function should take in a variable number of keyword arguments representing different attributes of the user profile. The function should return a dictionary containing the provided att... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_user_profile(name='Alice', age=30, location='Wonderland') == {'name': 'Alice', 'age': 30, 'location': 'Wonderland'}\", \"assert create_user_profile(email='bob@example.com', is_active=True) == {'email': 'bob@example.com', 'is_active': True}\", \"assert... | {
"split": "train",
"index": 69342,
"acecode_id": "oss_35133",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple task scheduler that manages a queue of tasks based on their priority. Each task has a name and a priority level. Your goal is to implement the scheduling logic for the tasks using a function called `schedule_tasks(tasks: List[Tuple[str, int... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert schedule_tasks([]) == []\", \"assert schedule_tasks([('Task1', 3), ('Task2', 1), ('Task3', 2)]) == ['Task2', 'Task3', 'Task1']\", \"assert schedule_tasks([('TaskA', 2), ('TaskB', 2), ('TaskC', 1)]) == ['TaskC', 'TaskA', 'TaskB']\", \"assert schedule_tasks([(... | {
"split": "train",
"index": 69343,
"acecode_id": "oss_35513",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `get_sum(*args)` that takes a variable number of integer arguments and returns their sum. The function should be able to handle any number of arguments, including zero. If no arguments are provided, the function should return 0.\nPlease reason step by step,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_sum() == 0\", \"assert get_sum(1) == 1\", \"assert get_sum(1, 2) == 3\", \"assert get_sum(5, 10, 15) == 30\", \"assert get_sum(-1, -2, -3) == -6\", \"assert get_sum(-5, 5) == 0\", \"assert get_sum(0, 0, 0) == 0\", \"assert get_sum(100, 200, 300, 400) == ... | {
"split": "train",
"index": 69344,
"acecode_id": "evol_11058",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of strings and removes any trailing whitespace from each string. Your function should return the list of processed strings after trimming the trailing whitespace. Implement the function `trim_trailing_whitespace(stri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert trim_trailing_whitespace(['hello ', 'world', ' goodbye ']) == ['hello', 'world', ' goodbye']\", \"assert trim_trailing_whitespace([' sample', 'test ', ' ']) == [' sample', 'test', '']\", \"assert trim_trailing_whitespace(['no trailing whitespace', '... | {
"split": "train",
"index": 69345,
"acecode_id": "oss_17191",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a segment length in milliseconds and a fragment length in milliseconds, implement a function `get_number_of_fragments(segment_length_ms: int, frag_length_ms: int) -> int` that calculates the number of fragments that can be created from the segment. The rules for calculati... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_number_of_fragments(1000, 500) == 2\", \"assert get_number_of_fragments(1000, 1000) == 1\", \"assert get_number_of_fragments(999, 500) == 2\", \"assert get_number_of_fragments(500, 1000) == 0\", \"assert get_number_of_fragments(1500, 500) == 3\", \"asser... | {
"split": "train",
"index": 69346,
"acecode_id": "evol_30360",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of categorical values representing different categories. Your task is to implement a function that transforms this list into a one-hot encoded format. The one-hot encoded representation should replace each category with a binary indicator vector, where each... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert one_hot_encode(['single']) == [[1]]\", \"assert one_hot_encode(['a', 'a', 'b', 'b', None]) == [[1, 0], [1, 0], [0, 1], [0, 1], [1, 0]]\", \"assert one_hot_encode([]) == []\", \"assert one_hot_encode(['alpha', 'beta', 'beta']) == [[1, 0], [0, 1], [0, 1]]\", \... | {
"split": "train",
"index": 69347,
"acecode_id": "bigcode_python_fns_47867",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing order IDs from a database, and you need to implement a function that retrieves these order IDs in batches. Your function should take two parameters: the list of order IDs and a batch size. The function should return a list of lists,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fetch_batches([1, 2, 3, 4, 5, 6], 2) == [[1, 2], [3, 4], [5, 6]]\", \"assert fetch_batches([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\", \"assert fetch_batches([10, 20, 30, 40], 3) == [[10, 20, 30], [40]]\", \"assert fetch_batches([7, 8, 9, 10, 11, 12, 13]... | {
"split": "train",
"index": 69348,
"acecode_id": "bigcode_python_fns_15047",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an array of objects where each object contains a property \"keywords\" which is a list of strings. Your task is to implement a function that checks these keywords according to the following rules: 1. If the keywords array contains at least one string, and none of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_keywords([{'keywords': ['keyword1', 'keyword2']}]) == 2\", \"assert check_keywords([{'keywords': ['keyword1, keyword2']}]) == 1\", \"assert check_keywords([{'keywords': []}]) == 0\", \"assert check_keywords([]) == 0\", \"assert check_keywords([{'keywor... | {
"split": "train",
"index": 69349,
"acecode_id": "bigcode_python_fns_21778",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of variant data represented as lists of integers, where each inner list contains the values for a variant. You also have a list of sample IDs and two integers: variants_per_block and sample_block_count. Your task is to create a function that returns a tuple... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert block_variants_and_samples([[1, 2], [3, 4], [5, 6], [7, 8]], ['sample1', 'sample2'], 1, 2) == ([[1, 2], [3, 4], [5, 6], [7, 8]], {'sample1': ['sample1', 'sample1'], 'sample2': ['sample2', 'sample2']})\", \"assert block_variants_and_samples([[1, 2, 3], [4, 5,... | {
"split": "train",
"index": 69350,
"acecode_id": "bigcode_python_fns_32354",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a chessboard represented by an 8x8 grid, where each cell can either be empty ('.') or occupied by a queen ('*'). Your task is to determine if there are exactly 8 queens placed on the board such that no two queens can attack each other. Two queens can attack each o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_place_queens(['........', '........', '........', '.*......', '.....*..', '......*.', '...*....', '......*.']) == False\", \"assert can_place_queens(['*......*', '......*.', '...*....', '........', '........', '........', '........', '.*......']) == Fals... | {
"split": "train",
"index": 69351,
"acecode_id": "bigcode_python_fns_38233",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings called `vocab`, a boolean `separate_domains`, an integer `crop`, and a string `vocab_filename`. Your task is to create a function `generate_vocab_file_content(vocab: List[str], separate_domains: bool, crop: int, vocab_filename: str) -> List[str]`... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_vocab_file_content(['apple', 'banana', 'cherry'], False, 1, 'vocab.txt') == ['0. apple', '1. banana', '2. cherry']\", \"assert generate_vocab_file_content(['cat', 'dog'], False, 0, 'vocab.txt') == ['0. cat', '1. dog']\", \"assert generate_vocab_file... | {
"split": "train",
"index": 69352,
"acecode_id": "bigcode_python_fns_36641",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a language code as a string (e.g., 'en-US', 'pt-BR', 'de', 'es'), write a function that returns the appropriate quotation marks for that language. If the exact language is not found, the function should try to find the quotation marks for the generic language (e.g., 'de-D... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_quotation_marks('en-US') == ('\\\"', '\\\"')\", \"assert get_quotation_marks('pt-BR') == ('\\\"', '\\\"')\", \"assert get_quotation_marks('de') == ('\\u201e', '\\u201c')\", \"assert get_quotation_marks('es') == ('\\u00ab', '\\u00bb')\", \"assert get_quot... | {
"split": "train",
"index": 69353,
"acecode_id": "bigcode_python_fns_246",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a variable number of lists of unique integers, return all possible combinations of one integer from each list. Each combination should be represented as a tuple. If no lists are provided, return an empty list. You may assume that all input lists will contain unique intege... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert combine([1, 2], [3, 4]) == [(1, 3), (1, 4), (2, 3), (2, 4)]\", \"assert combine([1, 2]) == [(1,), (2,)]\", \"assert combine([]) == []\", \"assert combine([1], [2], [3]) == [(1, 2, 3)]\", \"assert combine([1, 2], [3]) == [(1, 3), (2, 3)]\", \"assert combine([... | {
"split": "train",
"index": 69354,
"acecode_id": "bigcode_python_fns_16658",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two integers 'c' and 'd', implement a function that returns the absolute difference between 'c' and 'd'.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block."
}
] | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bar(5, 3) == 2\", \"assert bar(-1, -5) == 4\", \"assert bar(0, 0) == 0\", \"assert bar(10, 10) == 0\", \"assert bar(-10, 10) == 20\", \"assert bar(7, -3) == 10\", \"assert bar(15, 20) == 5\", \"assert bar(100, 200) == 100\", \"assert bar(-50, -100) == 50\", ... | {
"split": "train",
"index": 69355,
"acecode_id": "evol_33438",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function `roll_dice()` that simulates rolling two six-sided dice. The function should return a tuple containing the results of the two dice rolls, where each die can show a number between 1 and 6 (inclusive).\nPlease reason step by step, then write a self-contained Pyt... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert roll_dice() in [(1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (1, 6), (2, 1), (2, 2), (2, 3), (2, 4), (2, 5), (2, 6), (3, 1), (3, 2), (3, 3), (3, 4), (3, 5), (3, 6), (4, 1), (4, 2), (4, 3), (4, 4), (4, 5), (4, 6), (5, 1), (5, 2), (5, 3), (5, 4), (5, 5), (5, 6), (6... | {
"split": "train",
"index": 69356,
"acecode_id": "evol_27102",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of geographical points defined by their latitude and longitude coordinates and a polygon specified by its vertices, return a list of points that lie within the given polygon. The points are represented as tuples of (latitude, longitude), and the polygon is represen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert points_in_polygon([(1, 1), (3, 3), (2, 2)], [(0, 0), (4, 0), (4, 4), (0, 4)]) == [(1, 1), (3, 3), (2, 2)]\", \"assert points_in_polygon([(2, 2), (2, 5), (1, 1)], [(1, 1), (1, 4), (4, 4), (4, 1)]) == [(2, 2)]\", \"assert points_in_polygon([(5, 5)], [(0, 0), (... | {
"split": "train",
"index": 69357,
"acecode_id": "bigcode_python_fns_47495",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Create a function that takes a single integer n and returns the sum of all the multiples of 3 and 5 between 0 and n (exclusive).\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block."
}
] | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_multiples_3_5(10) == 23\", \"assert sum_multiples_3_5(0) == 0\", \"assert sum_multiples_3_5(1) == 0\", \"assert sum_multiples_3_5(3) == 0\", \"assert sum_multiples_3_5(5) == 3\", \"assert sum_multiples_3_5(6) == 8\", \"assert sum_multiples_3_5(15) == 45\... | {
"split": "train",
"index": 69358,
"acecode_id": "evol_33811",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing the lengths of different sticks, write a function `calculate_total_length(sticks: List[int]) -> int` that calculates the total length of the sticks. The function should return the total length of all sticks combined. The input list will con... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_length([1, 2, 3]) == 6\", \"assert calculate_total_length([5, 5, 5, 5]) == 20\", \"assert calculate_total_length([10, 20, 30, 40]) == 100\", \"assert calculate_total_length([1]) == 1\", \"assert calculate_total_length([1000]) == 1000\", \"ass... | {
"split": "train",
"index": 69359,
"acecode_id": "bigcode_python_fns_29534",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the nth Fibonacci number. The Fibonacci sequence is defined as follows: F(0) = 0, F(1) = 1, and F(n) = F(n-1) + F(n-2) for n > 1. Your function should take an integer n as input and return the nth Fibonacci number. If n is less than 0, retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(0) == 0\", \"assert fibonacci(1) == 1\", \"assert fibonacci(2) == 1\", \"assert fibonacci(3) == 2\", \"assert fibonacci(4) == 3\", \"assert fibonacci(5) == 5\", \"assert fibonacci(6) == 8\", \"assert fibonacci(7) == 13\", \"assert fibonacci(8) == 2... | {
"split": "train",
"index": 69360,
"acecode_id": "evol_33209",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a role-based access control system for a web application. The system should allow users to define permissions for various HTTP methods on specific resources. Your task is to implement a function that allows the 'DELETE' HTTP method on all subres... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert allow_delete_subresources('/api/v1/users', ['/api/v1/users', '/api/v1/users/123', '/api/v1/users/123/details']) == ['/api/v1/users/123', '/api/v1/users/123/details']\", \"assert allow_delete_subresources('/api/v1/products', ['/api/v1/products', '/api/v1/prod... | {
"split": "train",
"index": 69361,
"acecode_id": "oss_15725",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to implement a function that checks whether the number of even and odd integers in the list meets the following criteria: the number of even integers must be less than or equal to a specified maximum number and greater than or equa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_even_count([1, 2, 3, 4, 5], 3, 1) == True\", \"assert check_even_count([2, 4, 6, 8], 5, 2) == True\", \"assert check_even_count([1, 3, 5, 7], 1, 1) == False\", \"assert check_even_count([1, 2, 3, 4, 5, 6, 7], 4, 2) == True\", \"assert check_even_count(... | {
"split": "train",
"index": 69362,
"acecode_id": "bigcode_python_fns_28461",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that validates a set of loss records against a reference array using specified relative and absolute tolerances. The function should compare each element in the loss records list with the corresponding element in the reference ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_loss_records([0.1, 0.2, 0.3], [0.1, 0.2, 0.3], 0.1, 0.1) is None\", \"assert validate_loss_records([0.1, 0.2, 0.3], [0.15, 0.25, 0.35], 0.1, 0.05) is None\", \"assert validate_loss_records([0.1, 0.2, 0.3], [0.1, 0.2, 0.31], 0.1, 0.01) is None\", \"a... | {
"split": "train",
"index": 69363,
"acecode_id": "oss_1177",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given an unordered 2D array of integers, implement a function `find_min` that returns the minimum element in the array without using any built-in Python functions like min() or sorting algorithms. The input will be a list of lists, where each inner list represents a row of inte... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_min([[17, 21, 4, 7], [29, 34, 11, 8], [13, 21, 9, 15]]) == 4\", \"assert find_min([[5, 2], [3, 1], [4, 6]]) == 1\", \"assert find_min([[10, 20, 30], [5, 15, 25], [0, 50, 100]]) == 0\", \"assert find_min([[99]]) == 99\", \"assert find_min([[1, 2, 3], [4,... | {
"split": "train",
"index": 69364,
"acecode_id": "evol_27961",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function that converts a given number of minutes into a more understandable format of years, days, hours, and minutes, while considering leap years. The function should accurately calculate the number of leap years that occur within the total number of minutes provided... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert time_converter(527040) == '1 years (1 leap years and 0 common years), 0 days, 0 hours, 0 minutes'\", \"assert time_converter(1440) == '0 years (0 leap years and 0 common years), 1 days, 0 hours, 0 minutes'\", \"assert time_converter(720) == '0 years (0 leap ... | {
"split": "train",
"index": 69365,
"acecode_id": "evol_11243",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes bounding boxes for an object detection model. The function takes in a list of bounding boxes represented as (x, y, width, height) and rescales them to fit within an 800x800 image. Your goal is to implement the function ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_bounding_boxes([(0, 0, 100, 100)], 100, 100) == [[0, 0, 800, 800]]\", \"assert process_bounding_boxes([(50, 50, 200, 200)], 400, 400) == [[100, 100, 400, 400]]\", \"assert process_bounding_boxes([(0, 0, 800, 800)], 800, 800) == [[0, 0, 800, 800]]\", ... | {
"split": "train",
"index": 69366,
"acecode_id": "oss_27351",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a dataset containing information about mobile apps, including their names, ratings, prices, and more. Write a Python function `app_data_query` that takes in two parameters: `dataset` (list of lists): A list of lists ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert app_data_query([['1', 'Facebook', '389879808', '0.0', '2974676', '212', '3.5', '3.5', 'Social Networking'], ['2', 'Instagram', '113954816', '0.0', '2161558', '1289', '4.5', '4.0', 'Photo & Video']], 'app_count') == 2\", \"assert app_data_query([['1', 'Facebo... | {
"split": "train",
"index": 69367,
"acecode_id": "oss_30532",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a file filtering system that ignores specific file entities based on predefined patterns. Your goal is to implement a function called `file_filter` which takes two inputs: a list of file names and a list of regular expression patterns. The funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert file_filter(['file1.txt', 'image.png', 'document.pdf', 'archive.zip', 'notes.cat'], ['\\\\.cat$']) == ['file1.txt', 'image.png', 'document.pdf', 'archive.zip']\", \"assert file_filter(['file1.txt', 'image.png', 'document.pdf', 'archive.zip', 'notes.cat'], ['... | {
"split": "train",
"index": 69368,
"acecode_id": "oss_30956",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `disassociate_qos_spec` that simulates the disassociation of a Quality of Service (QoS) specification from a volume type in a storage system. The function takes three parameters: `project_id`, `qos_spec_id`, and `volume_type_id`, whic... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert disassociate_qos_spec('fake_project_id', 'fake_qos_spec_id', 'fake_volume_type_id') == 'Disassociated QoS spec fake_qos_spec_id from volume type fake_volume_type_id in project fake_project_id'\", \"assert disassociate_qos_spec('project_1', 'qos_1', 'vol_type... | {
"split": "train",
"index": 69369,
"acecode_id": "oss_27019",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that accepts two parameters: a dataset name and a processing type. The function should return a string that indicates the dataset being processed along with the processing type applied to it. The dataset name and processing type are provi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_data('sales_data', 'aggregate') == 'Processing dataset: sales_data with type: aggregate'\", \"assert process_data('customer_data', 'filter') == 'Processing dataset: customer_data with type: filter'\", \"assert process_data('transactions', 'summarize'... | {
"split": "train",
"index": 69370,
"acecode_id": "oss_28519",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of tasks and an options string. The function should log messages for each task in the format 'Task apply' along with the associated task and options. Each task is represented as a string, and the options are also a s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_tasks(['Task1', 'Task2'], 'Option1') == ['Task apply: Task1, Options: Option1', 'Task apply: Task2, Options: Option1']\", \"assert log_tasks(['TaskA'], 'OptionB') == ['Task apply: TaskA, Options: OptionB']\", \"assert log_tasks([], 'NoOptions') == []\", ... | {
"split": "train",
"index": 69371,
"acecode_id": "oss_30977",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given the root of a binary tree, find the most frequent subtree sum. The subtree sum of a node is defined as the sum of all the node values formed by the subtree rooted at that node (including the node itself). If there is a tie, return all the values with the highest frequency... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert findFrequentTreeSum(TreeNode(5, TreeNode(2), TreeNode(-3))) == [2, -3, 4]\", \"assert findFrequentTreeSum(TreeNode(5, TreeNode(2), TreeNode(-5))) == [2]\", \"assert findFrequentTreeSum(TreeNode(1)) == [1]\", \"assert findFrequentTreeSum(TreeNode(0, TreeNode(... | {
"split": "train",
"index": 69372,
"acecode_id": "evol_26614",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, each representing a line of code that may include inline comments starting with '//' and ending at the end of the line. Your task is to implement a function that processes this list of strings and returns a new list containing only the complete ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_statements(['let x = 5;', '// this is a comment', 'let y = 10;']) == ['let x = 5', 'let y = 10']\", \"assert extract_statements(['// comment line', '', 'let a = 1;', 'let b = 2;']) == ['let a = 1', 'let b = 2']\", \"assert extract_statements(['let c ... | {
"split": "train",
"index": 69373,
"acecode_id": "bigcode_python_fns_34605",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a JSON object that represents a collection of anatomical terms and their corresponding URLs. Your task is to implement a function that takes this JSON object and a key as inputs. The function should traverse the JSON object and return the URL associated with the s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_url({'anatomy_terms': [{'med_fma': 'http://purl.obolibrary.org/obo/FMA_84666', 'med_uberon': 'http://purl.obolibrary.org/obo/UBERON_0000955'}, {'med_fma': 'http://purl.obolibrary.org/obo/FMA_12345', 'med_uberon': 'http://purl.obolibrary.org/obo/UBERO... | {
"split": "train",
"index": 69374,
"acecode_id": "oss_26059",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes a list of strings and a specific string value as input, removes the first occurrence of that string from the list if it exists, and returns the modified list. If the string is not found, return the list unchanged. The function should be named ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_string(['apple', 'banana', 'cherry', 'durian'], 'banana') == ['apple', 'cherry', 'durian']\", \"assert remove_string(['apple', 'banana', 'cherry', 'durian'], 'apple') == ['banana', 'cherry', 'durian']\", \"assert remove_string(['apple', 'banana', 'che... | {
"split": "train",
"index": 69375,
"acecode_id": "evol_31742",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with analyzing the academic performance of students based on their marks in three different tests. Given a list of students, where each student is represented by a list containing their name, roll number, and their marks in three tests, you need to implement a fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_students_in_greatest_cluster([['John', 101, 85, 90, 88], ['Alice', 102, 78, 92, 85], ['Bob', 103, 90, 88, 92], ['Eve', 104, 82, 79, 95], ['Mike', 105, 88, 86, 89]], 240) == [['John', 101, 85, 90, 88], ['Bob', 103, 90, 88, 92], ['Mike', 105, 88, 86, 89]]\... | {
"split": "train",
"index": 69376,
"acecode_id": "oss_37744",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of cryptocurrency transaction data, where each transaction is represented as a list containing the following elements: cryptocurrency type (string), passphrase (string), intermediate point (string), encrypted private key (string), address (string), decrypte... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_transactions([['btc', 'TestingOneTwoThree', 'passphrasepxFy57B9v8HtUsszJYKReoNDV6VHjUSGt8EVJmux9n1J3Ltf1gRxyDGXqnf9qm', '6PfQu77ygVyJLZjfvMLyhLMQbYnu5uguoJJ4kMCLqWwPEdfpwANVS76gTX', '1PE6TQi6HTVNz5DLwB1LcpMBALubfuN2z2', '5K4caxezwjGCGfnoPTZ8tMcJBLB7... | {
"split": "train",
"index": 69377,
"acecode_id": "bigcode_python_fns_25418",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representation of a JSON object that contains a dictionary of file names as keys and their corresponding hashes as values. Write a function `parse_registry(registry: str) -> Dict[str, str]` that takes this string as input and returns the dictionary of fil... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_registry('{\\\"file1.txt\\\": \\\"hash1\\\", \\\"file2.txt\\\": \\\"hash2\\\"}') == {'file1.txt': 'hash1', 'file2.txt': 'hash2'}\", \"assert parse_registry('{\\\"fileA.txt\\\": \\\"hashA\\\"}') == {'fileA.txt': 'hashA'}\", \"assert parse_registry('null... | {
"split": "train",
"index": 69378,
"acecode_id": "bigcode_python_fns_2825",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the edges of a directed graph. Each integer represents a directed edge from the node at the index of that integer to another node. Your task is to implement a function that checks if the graph contains exactly one outgoing edge from... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert single_outgoing_edge([1, -1, -1]) == 1\", \"assert single_outgoing_edge([-1, 2, 3]) == -1\", \"assert single_outgoing_edge([-1, -1]) == -1\", \"assert single_outgoing_edge([1, 1, 3]) == -1\", \"assert single_outgoing_edge([1]) == 1\", \"assert single_outgoin... | {
"split": "train",
"index": 69379,
"acecode_id": "bigcode_python_fns_5321",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given an array containing negative numbers, zeros, rational numbers, and the integers 1 and 2, write a function that sorts this array such that all negative numbers are at the beginning in ascending order, followed by all zeros, then all rational numbers in ascending order, and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert special_sort([1, -2, 0, 2, 2, -1, 0.5, 1, 0.3, 0, 2, -3, 1]) == [-3, -2, -1, 0, 0, 0.3, 0.5, 2, 2, 2, 1, 1, 1]\", \"assert special_sort([-1, 2, -3, 0, 0, 1, 0.5, 0.3]) == [-3, -1, 0, 0, 0.3, 0.5, 2, 1]\", \"assert special_sort([0, 0, 0, 0]) == [0, 0, 0, 0]\"... | {
"split": "train",
"index": 69380,
"acecode_id": "evol_20452",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of integers and returns a new list containing only the even integers from the original list. Your function should filter out all odd integers and return the resulting list in the same order as they appeared in the input ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 15, 20, 25, 30]) == [10, 20, 30]\", \"assert filter_even_numbers([-2, -1, 0, 1, 2]) == [-2, 0, 2]\", \"assert filter_even_numbers([]) == []\", \"assert filter_even_numbers([1... | {
"split": "train",
"index": 69381,
"acecode_id": "oss_6620",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, each representing a word. Your task is to implement a function that counts the number of unique words in the list. A unique word is defined as a word that appears exactly once in the list. The function should return an integer representing the c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_words(['apple', 'banana', 'apple', 'orange']) == 2\", \"assert count_unique_words(['hello', 'world', 'hello']) == 1\", \"assert count_unique_words(['a', 'b', 'c', 'a', 'b']) == 1\", \"assert count_unique_words(['cat', 'dog', 'cat', 'CAT']) == 2\... | {
"split": "train",
"index": 69382,
"acecode_id": "bigcode_python_fns_15985",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `convert_data` that takes in a nested dictionary `data` and returns a flattened dictionary `output` based on the following rules: If a value in the input dictionary is a dictionary itself, it should be processed based on specific cond... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_data({'name': 'John', 'age': 30}) == {'name': 'John', 'age': 30}\", \"assert convert_data({'address': {'street': '123 Main St', 'city': 'New York'}}) == {'address': 'street, city'}\", \"assert convert_data({'building': {'type': 'Apartment', 'size': '... | {
"split": "train",
"index": 69383,
"acecode_id": "oss_20556",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of floating point numbers, implement a function that returns a new list containing the largest integers not greater than each of the input numbers. The function should round down each number to its nearest integer using the floor function. The input list will conta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert floor_list([1.2, 2.5, 3.7]) == [1, 2, 3]\", \"assert floor_list([-1.2, -2.5, -3.7]) == [-2, -3, -4]\", \"assert floor_list([0.0, 0.1, 0.9]) == [0, 0, 0]\", \"assert floor_list([10.0, 10.5, 10.9]) == [10, 10, 10]\", \"assert floor_list([5.5]) == [5]\", \"asse... | {
"split": "train",
"index": 69384,
"acecode_id": "bigcode_python_fns_26674",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a Python function that takes in a list of integers and returns a new list containing only the even integers from the original list. Your function should preserve the order of the even integers as they appear in the original list. Define a function na... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 15, 20, 25]) == [10, 20]\", \"assert filter_even_numbers([0, 1, 2, 3, 4]) == [0, 2, 4]\", \"assert filter_even_numbers([-2, -1, 0, 1, 2]) == [-2, 0, 2]\", \"assert filter_eve... | {
"split": "train",
"index": 69385,
"acecode_id": "oss_17551",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the unemployment rate for each month over a period of time. Your task is to implement a function that calculates and returns the average unemployment rate over the given months. The function should take a list of integers as input a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_unemployment([5, 6, 7, 8]) == 6.5\", \"assert average_unemployment([10, 20, 30]) == 20.0\", \"assert average_unemployment([0, 0, 0]) == 0.0\", \"assert average_unemployment([-1, -2, -3]) == -2.0\", \"assert average_unemployment([1]) == 1.0\", \"asser... | {
"split": "train",
"index": 69386,
"acecode_id": "bigcode_python_fns_8953",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a two-letter country code (ISO 3166-1 alpha-2), return the corresponding full country name in English. If the code does not match any country, return 'Unknown Country'. The input string will always consist of exactly two uppercase letters. You can as... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert country_name_from_code('US') == 'United States'\", \"assert country_name_from_code('CA') == 'Canada'\", \"assert country_name_from_code('GB') == 'United Kingdom'\", \"assert country_name_from_code('DE') == 'Germany'\", \"assert country_name_from_code('FR') =... | {
"split": "train",
"index": 69387,
"acecode_id": "bigcode_python_fns_49264",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given the position of a labware on a deck and the definition of a well within that labware. Each well has a specific x, y, and z position relative to the labware's origin. Your task is to calculate the absolute position of the top of a well given its labware ID, well na... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_well_position('labware-id', 'A1', (0, 0, 0), (0, 0, 0), {'A1': (0, 0, 0)}) == (0, 0, 0)\", \"assert get_well_position('labware-id', 'C3', (-1, -1, -1), (2, 2, 2), {'C3': (3, 3, 3)}) == (4, 4, 4)\", \"assert get_well_position('labware-id', 'E5', (0, 0, 0)... | {
"split": "train",
"index": 69388,
"acecode_id": "bigcode_python_fns_10461",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a list of wave speeds represented as floating-point numbers. Write a function that takes this list and a coefficient, and returns a new list where each speed is multiplied by the coefficient. The function should handle both positive and negative speeds, and the co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert adjust_speeds([], 1.25) == []\", \"assert adjust_speeds([1.0], 1.25) == [1.25]\", \"assert adjust_speeds([-1.0], 1.25) == [-1.25]\", \"assert adjust_speeds([0.0], 1.25) == [0.0]\", \"assert adjust_speeds([2.0, 3.0, 4.0], 1.5) == [3.0, 4.5, 6.0]\", \"assert a... | {
"split": "train",
"index": 69389,
"acecode_id": "bigcode_python_fns_43880",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes two strings as input, removes all white spaces from both strings, concatenates them, and returns the number of unique characters in the resulting string. For example, if the input strings are ' Hello World ! ' and ' Goodbye! ', the function should re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_chars(' a b c ', ' d e f ') == 6\", \"assert unique_chars('123 456', '7890') == 10\", \"assert unique_chars(' ', ' ') == 0\", \"assert unique_chars('abc', 'abc') == 3\", \"assert unique_chars('a', ' ') == 1\", \"assert unique_chars('!@# $%^', '&*(... | {
"split": "train",
"index": 69390,
"acecode_id": "evol_15953",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that applies a blur effect to a given image represented as a 2D array of pixels. Each pixel is represented by its red, green, and blue color values. The blur effect is achieved by averaging the color values of the pixel and its neighb... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert blur_image([[Pixel(100, 150, 200)]]) == [[Pixel(100, 150, 200)]]\", \"assert blur_image([[Pixel(255, 255, 255), Pixel(0, 0, 0)], [Pixel(0, 0, 0), Pixel(255, 255, 255)]]) == [[Pixel(127, 127, 127), Pixel(127, 127, 127)], [Pixel(127, 127, 127), Pixel(127, 127,... | {
"split": "train",
"index": 69391,
"acecode_id": "bigcode_python_fns_3662",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Write a function `fibonacci(n: int) -> List[int]` that generates the first `n` integers of the Fibonacci sequence. The Fibonacci sequence starts with 0 and 1, and every subsequent number is the sum of the two preceding ones. The function should return a list containing these nu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(1) == [0]\", \"assert fibonacci(2) == [0, 1]\", \"assert fibonacci(3) == [0, 1, 1]\", \"assert fibonacci(4) == [0, 1, 1, 2]\", \"assert fibonacci(5) == [0, 1, 1, 2, 3]\", \"assert fibonacci(6) == [0, 1, 1, 2, 3, 5]\", \"assert fibonacci(7) == [0, 1... | {
"split": "train",
"index": 69392,
"acecode_id": "evol_29265",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of votes cast by members of a legislative body on a particular bill. Each vote is represented as a string, where the first character indicates the party affiliation of the member ('D' for Democrat, 'R' for Republican), and the second character indicates the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert democrat_yea_fraction(['DY', 'DY', 'DY', 'RY']) == 0.75\", \"assert democrat_yea_fraction(['RY', 'RN', 'RN', 'RY']) == 0.00\", \"assert democrat_yea_fraction(['DY', 'DN', 'DN', 'DN']) == 0.25\", \"assert democrat_yea_fraction(['RY', 'RY', 'RY', 'RY']) == 0.0... | {
"split": "train",
"index": 69393,
"acecode_id": "oss_18637",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `negative_list(numbers)` that returns a new list containing only the negative integers from the input list. The function should utilize a list comprehension to achieve this.\nPlease reason step by step, then write a self-contained ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert negative_list([1, -2, 3, -4, 5]) == [-2, -4]\", \"assert negative_list([-1, -2, -3, -4]) == [-1, -2, -3, -4]\", \"assert negative_list([0, 1, 2, 3]) == []\", \"assert negative_list([-10, 0, 10]) == [-10]\", \"assert negative_list([]) == []\", \"assert negati... | {
"split": "train",
"index": 69394,
"acecode_id": "evol_16699",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simplified file locking mechanism. The function should take two parameters: a list of strings `keys` representing the keys for the files, and a string `path` representing the directory path where the lock files would ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_acquire_locks(['file1', 'file2', 'file3'], '/lock/path') == [True, True, True]\", \"assert can_acquire_locks(['file1', 'file1', 'file2'], '/lock/path') == [True, False, True]\", \"assert can_acquire_locks(['file1', 'file2', 'file2', 'file3'], '/lock/path... | {
"split": "train",
"index": 69395,
"acecode_id": "oss_22862",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of daily temperatures recorded over a period of time, implement a function that calculates the minimum, average, and maximum temperature over a specified range of days. The function should take in a list of temperatures and two indices representing the start and en... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calc_temps([70, 75, 80, 85, 90], 0, 4) == (70, 80.0, 90)\", \"assert calc_temps([60, 65, 70, 75, 80], 1, 3) == (65, 70.0, 75)\", \"assert calc_temps([80, 85, 90, 95, 100], 2, 4) == (90, 95.0, 100)\", \"assert calc_temps([50, 55, 60, 65, 70], 0, 2) == (50, 55... | {
"split": "train",
"index": 69396,
"acecode_id": "bigcode_python_fns_48255",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of ground motion parameters, each defined by a dictionary containing the keys 'Magnitude', 'SourceIndex', 'RuptureIndex', and 'GroundMotions', which is a list of dictionaries containing 'Location' (with 'Latitude' and 'Longitude') and 'SiteData' (with 'Value'), ext... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_ground_motion_data([]) == ([], [], [], [], [], [])\", \"assert extract_ground_motion_data([{ 'Magnitude': 6.5, 'SourceIndex': 1, 'RuptureIndex': 0, 'GroundMotions': [{'Location': {'Latitude': 34.0, 'Longitude': -118.0}, 'SiteData': [{'Value': 760}]}]... | {
"split": "train",
"index": 69397,
"acecode_id": "bigcode_python_fns_39418",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a filename and a list of attribute names. Each attribute is defined in a text file with key-value pairs separated by a tab character. Your task is to implement a function that retrieves the value of each specified attribute from the file. If an attribute does not ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_attributes_from_file('tasks.txt', [('due_date', '2023-11-01'), ('assigned_to', 'user1'), ('label', 'urgent')]) == {'due_date': '2023-11-01', 'assigned_to': 'user1', 'label': 'urgent'}\", \"assert get_attributes_from_file('tasks.txt', [('deadline', '2023-... | {
"split": "train",
"index": 69398,
"acecode_id": "bigcode_python_fns_2061",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a function that simulates a model configuration for a neural network. The function takes an integer parameter 'classes' which denotes the number of classification classes. Your task is to implement a function `model_configuration(classes: int) -> str` that returns... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert model_configuration(200) == 'Model: SE-ResNet-101, Classes: 200'\", \"assert model_configuration(1) == 'Model: SE-ResNet-101, Classes: 1'\", \"assert model_configuration(100) == 'Model: SE-ResNet-101, Classes: 100'\", \"assert model_configuration(300) == 'Mo... | {
"split": "train",
"index": 69399,
"acecode_id": "bigcode_python_fns_44709",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.