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": "You are tasked with implementing a function to calculate the cumulative completion score for a 2D list (matrix). The cumulative completion score for each row is defined as the ratio of non-null (non-zero) values in that row to the total number of columns in the row. Your functi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_cumulative_score([[None, None], [1, 2], [None, 3], [4, 5]]) == {'cumulative_score': [0.0, 1.0, 0.5, 1.0], 'sub_score': []}\", \"assert calculate_cumulative_score([[None, None, None], [1, None, 1], [2, 2, 2]]) == {'cumulative_score': [0.0, 0.67, 1.0...
{ "split": "train", "index": 83600, "acecode_id": "oss_30897", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to update the wireless configuration settings. The function `updateWirelessConfig` takes two dictionaries as input: `new_config` and `old_config`. The `new_config` dictionary contains the new wireless settings, while the `old_config` ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert updateWirelessConfig({'ssid': 'NewSSID', 'password': 'NewPassword'}, {'ssid': 'OldSSID', 'password': 'OldPassword'}) == {'ssid': 'NewSSID', 'password': 'NewPassword'}\", \"assert updateWirelessConfig({'ssid': 'SSID1'}, {'ssid': 'SSID2', 'encryption': 'WPA2'}...
{ "split": "train", "index": 83601, "acecode_id": "oss_12816", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes an array of numeric values and returns the standard deviation of these values. The standard deviation is a measure of the amount of variation or dispersion of a set of values. You may assume that the input array will contain at least one number. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert abs(calculate_std_dev([1, 2, 3, 4, 5]) - 1.4142135623730951) < 1e-9\", \"assert abs(calculate_std_dev([1, 1, 1, 1]) - 0.0) < 1e-9\", \"assert abs(calculate_std_dev([100, 200, 300]) - 81.64965809277261) < 1e-9\", \"assert abs(calculate_std_dev([0, 0, 0]) - 0....
{ "split": "train", "index": 83602, "acecode_id": "evol_7362", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Write a function `encrypt_message(message: str) -> str` that takes a string message containing lowercase English letters and spaces. The function should first convert all lowercase letters to uppercase and then encrypt the message using a basic Caesar cipher with a shift of 3 p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert encrypt_message('hello world') == 'KHOOR ZRUOG'\", \"assert encrypt_message('abc def') == 'DEF GHI'\", \"assert encrypt_message('python programming') == 'SBWKRQ SURJUDPPLQJ'\", \"assert encrypt_message('test case') == 'WHVW FDVH'\", \"assert encrypt_message(...
{ "split": "train", "index": 83603, "acecode_id": "evol_16005", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function `compare_numbers(num1, num2)` that takes in two integers, `num1` and `num2`. The function should return: 0 if `num1` is equal to `num2`, -1 if `num1` is less than `num2`, and 1 if `num1` is greater than `num2`.\nPlease reason step by step, then write a self...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compare_numbers(5, 10) == -1\", \"assert compare_numbers(10, 5) == 1\", \"assert compare_numbers(0, 0) == 0\", \"assert compare_numbers(-1, 1) == -1\", \"assert compare_numbers(1, -1) == 1\", \"assert compare_numbers(100, 100) == 0\", \"assert compare_number...
{ "split": "train", "index": 83604, "acecode_id": "evol_290", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing a list of interrupt service routines (ISRs) represented as strings in the format 'NVIC_<PERIPHERAL_NAME>_IRQ'. Your goal is to implement a function `manage_isrs(operations: List[Tuple[str, str]]) -> List[str]` that processes a sequence of operations...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_isrs([('register', 'NVIC_CAN1_RX1_IRQ'), ('register', 'NVIC_TIM2_IRQ')]) == ['NVIC_CAN1_RX1_IRQ', 'NVIC_TIM2_IRQ']\", \"assert manage_isrs([('register', 'NVIC_CAN1_RX1_IRQ'), ('invoke', 'NVIC_CAN1_RX1_IRQ'), ('unregister', 'NVIC_CAN1_RX1_IRQ')]) == []...
{ "split": "train", "index": 83605, "acecode_id": "oss_19672", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers, where each integer represents a variable's state (0 for uninitialized, 1 for initialized). Write a function `ensure_variables_initialized(variables: List[int]) -> List[int]` that returns a new list where all uninitialized variables (0s) are set...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert ensure_variables_initialized([0, 1, 0]) == [1, 1, 1]\", \"assert ensure_variables_initialized([1, 1, 1]) == [1, 1, 1]\", \"assert ensure_variables_initialized([0, 0, 0]) == [1, 1, 1]\", \"assert ensure_variables_initialized([]) == []\", \"assert ensure_varia...
{ "split": "train", "index": 83606, "acecode_id": "bigcode_python_fns_43562", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that performs basic arithmetic operations (addition, subtraction, multiplication, and division) on two complex numbers. The function should handle potential exceptions such as division by zero. The input will be two complex numbers, and the function should ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert complex_arithmetic(complex(0, 0), complex(0, 0)) == {'addition': 0j, 'subtraction': 0j, 'multiplication': 0j, 'division': 'undefined'}\", \"assert complex_arithmetic(complex(1, 2), complex(3, 4)) == {'addition': (4+6j), 'subtraction': (-2-2j), 'multiplicatio...
{ "split": "train", "index": 83607, "acecode_id": "evol_31389", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Given a float number b representing the velocity as a fraction of the speed of light, calculate the pair production cross section using the formula: \n\n sigma_pp(b) = (sigma_T * 3.0 / 16.0) * (1 - b^2) * (2 * b * (b^2 - 2) + (3 - b^4) * log((1 + b) / (1 - b))) \n\nWhere sig...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert abs(sigma_pp(0.1) - 5.1130493028e-30) < 1e-10\", \"assert abs(sigma_pp(0.2) - 1.1859832729e-29) < 1e-10\", \"assert abs(sigma_pp(0.3) - 2.1722071762e-29) < 1e-10\", \"assert abs(sigma_pp(0.4) - 3.4287251542e-29) < 1e-10\", \"assert abs(sigma_pp(0.5) - 4.9238...
{ "split": "train", "index": 83608, "acecode_id": "bigcode_python_fns_34196", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the number of pickles in jars. Your task is to write a function that determines if the number of pickles in each jar is greater than a specified threshold. The function should return a list of boolean values, where each boolean indi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_pickles_above_threshold([3, 4, 5], 2) == [True, True, True]\", \"assert check_pickles_above_threshold([1, 2, 1], 1) == [False, True, False]\", \"assert check_pickles_above_threshold([10, 20, 30], 15) == [False, True, True]\", \"assert check_pickles_abo...
{ "split": "train", "index": 83609, "acecode_id": "bigcode_python_fns_17181", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a message represented as a dictionary containing a 'data' key. Your task is to implement a function that processes this message and returns the value associated with the 'data' key. If the message does not contain a 'data' key or if the value is not a string, the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_message({'data': 'valid data'}) == 'valid data'\", \"assert process_message({'data': 123}) == 'Data not in expected format'\", \"assert process_message({'data': ''}) == ''\", \"assert process_message({'other_key': 'some data'}) == 'Data not in expect...
{ "split": "train", "index": 83610, "acecode_id": "evol_10166", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a Python function that takes in a temperature in Kelvin and a boolean value indicating whether the output should be rounded. If the boolean value is true, the function should return the corresponding temperature in Fahrenheit, rounded to the nearest whole number. If the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert kelvin_to_fahrenheit(273.15, True) == 32\", \"assert kelvin_to_fahrenheit(273.15, False) == 32.0\", \"assert kelvin_to_fahrenheit(300, True) == 80\", \"assert kelvin_to_fahrenheit(500, True) == 440\", \"assert kelvin_to_fahrenheit(-10, True) == 'Invalid inpu...
{ "split": "train", "index": 83611, "acecode_id": "evol_22960", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a list of states (strings) and returns a list of tuples. Each tuple should contain a state and its corresponding hash value. Your function should efficiently compute the hash values for each state using Python's built-in `h...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert states_and_hashes([]) == []\", \"assert states_and_hashes(['state1']) == [('state1', hash('state1'))]\", \"assert states_and_hashes(['state2', 'state3']) == [('state2', hash('state2')), ('state3', hash('state3'))]\", \"assert states_and_hashes(['stateA', 'st...
{ "split": "train", "index": 83612, "acecode_id": "oss_16428", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given three parameters: `coord_system` (a string representing the coordinate system), `bldg_north` (a float representing the building's north axis in degrees), and `zone_rel_north` (a float representing the zone's direction of relative north in degrees). Your task is to...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert true_azimuth('Cartesian', 0, 0) == 0.0\", \"assert true_azimuth('Cartesian', 90, 0) == 90.0\", \"assert true_azimuth('Cartesian', 180, 0) == 180.0\", \"assert true_azimuth('Cartesian', 270, 0) == 270.0\", \"assert true_azimuth('Cartesian', 0, 90) == 90.0\", ...
{ "split": "train", "index": 83613, "acecode_id": "bigcode_python_fns_16923", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Implement a function `create_class` that takes in a class name and a dictionary of attributes. The function should return a new class with the specified name and attributes using a metaclass. The metaclass should simply pass the attributes as they are. The signature of the func...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_class('MyClass', {'attr1': 1, 'attr2': 2})().attr1 == 1\", \"assert create_class('Test', {'x': 10, 'y': 20})().y == 20\", \"assert create_class('Example', {'name': 'Python'})().name == 'Python'\", \"assert create_class('Demo', {'value': 100})().value ...
{ "split": "train", "index": 83614, "acecode_id": "evol_12527", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that performs linear interpolation on a given list of numerical data points. The function should take an input list of known data points and an integer specifying the number of interpolated points to generate. The output should...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert linear_interpolation([1, 2, 3, 4], 5) == [1.0, 1.75, 2.5, 3.25, 4.0]\", \"assert linear_interpolation([10, 20, 30, 40, 50], 3) == [10.0, 30.0, 50.0]\", \"assert linear_interpolation([5, 15], 3) == [5.0, 10.0, 15.0]\", \"assert linear_interpolation([0, 100], ...
{ "split": "train", "index": 83615, "acecode_id": "oss_30837", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates a simple logging system. The function should set up a logging configuration with levels of logging: ERROR, WARNING, INFO, and DEBUG. After setting up, the function should log a series of predefined messages at each l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert log_messages() == ['Debugging information', 'Informational message', 'Warning issued', 'Error encountered']\", \"assert log_messages() != []\", \"assert log_messages()[0] == 'Debugging information'\", \"assert log_messages()[1] == 'Informational message'\", ...
{ "split": "train", "index": 83616, "acecode_id": "oss_8683", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given three numerical entities object1, object2, and object3, which can be any real number or a decimal point number, implement a function that returns an integer based on the following logic: \n- Return 0 if all entities are equivalent. \n- Return -1 if object1 is the least am...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert analyze_objects(5.0, 5.0, 5.0) == 0\", \"assert analyze_objects(3.0, 4.0, 5.0) == -1\", \"assert analyze_objects(7.0, 6.0, 5.0) == 1\", \"assert analyze_objects(5.0, 5.0, 4.0) == 2\", \"assert analyze_objects(1.5, 2.5, 3.5) == -1\", \"assert analyze_objects(...
{ "split": "train", "index": 83617, "acecode_id": "evol_15360", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the creation of a web application. The function `create_app` takes three optional parameters: `app_name`, `blueprints`, and `config`. If `app_name` is not provided, it should default to the string 'default_app'. If `bluepri...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_app() == {'app_name': 'default_app', 'blueprints': ['default_blueprint1', 'default_blueprint2'], 'config': None}\", \"assert create_app('my_app') == {'app_name': 'my_app', 'blueprints': ['default_blueprint1', 'default_blueprint2'], 'config': None}\", ...
{ "split": "train", "index": 83618, "acecode_id": "bigcode_python_fns_28426", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given a list of sorted lists, where each sublist contains integers. Your task is to implement a function `merge_sorted_lists(list_of_lists)` that merges these sorted lists into a single sorted list. The merged list should maintain the relative order of the elements from...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_sorted_lists([[1, 4, 7], [2, 5, 8], [3, 6]]) == [1, 2, 3, 4, 5, 6, 7, 8]\", \"assert merge_sorted_lists([[2, 3, 4], [1], [0, 5, 6]]) == [0, 1, 2, 3, 4, 5, 6]\", \"assert merge_sorted_lists([[10, 20], [5, 15, 25], [12]]) == [5, 10, 12, 15, 20, 25]\", \"...
{ "split": "train", "index": 83619, "acecode_id": "bigcode_python_fns_30434", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates a simple game where a player moves in a grid. The function should take the current position of the player as input, represented as a tuple of integers `(x, y)`, and return the next direction in which the player shoul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_movement((0, 0)) == 'Stay'\", \"assert simulate_movement((1, 0)) == 'East'\", \"assert simulate_movement((-1, 0)) == 'West'\", \"assert simulate_movement((0, 1)) == 'North'\", \"assert simulate_movement((0, -1)) == 'South'\", \"assert simulate_movem...
{ "split": "train", "index": 83620, "acecode_id": "oss_9842", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary where the keys are strings and the values are integers. Write a function `summarize_dict(data: Dict[str, int], verbose: bool) -> Union[str, Dict[str, Any]]` that takes in this dictionary and a boolean flag `verbose`. The function should return a summa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert summarize_dict({'x': 10, 'y': 20, 'z': 30}, True) == {'length': 3, 'keys': ['x', 'y', 'z'], 'value_types': ['int']}\", \"assert summarize_dict({'name': 42, 'age': 30}, True) == {'length': 2, 'keys': ['age', 'name'], 'value_types': ['int']}\", \"assert summar...
{ "split": "train", "index": 83621, "acecode_id": "bigcode_python_fns_187", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function called `calculate_average` that takes in a list of numerical values and returns the average of those values. If the input list is empty, the function should return 0. Your implementation should handle both integers and floats. Ensure ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average([1, 2, 3, 4, 5]) == 3.0\", \"assert calculate_average([-1, -2, -3, -4, -5]) == -3.0\", \"assert calculate_average([0, 0, 0]) == 0.0\", \"assert calculate_average([1.5, 2.5, 3.5]) == 2.5\", \"assert calculate_average([1, 2, 3, 4, 5, 6, 7, 8,...
{ "split": "train", "index": 83622, "acecode_id": "oss_29899", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of bars in a histogram. Your task is to implement a function that calculates the maximum area of a rectangle that can be formed within the histogram. The rectangle must be entirely contained within the histogram and can ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert maxHistogramArea([2, 1, 5, 6, 2, 3]) == 10\", \"assert maxHistogramArea([1, 1, 1, 1]) == 4\", \"assert maxHistogramArea([0, 1, 0, 1, 0]) == 1\", \"assert maxHistogramArea([1, 2, 3, 4, 5]) == 9\", \"assert maxHistogramArea([5, 4, 3, 2, 1]) == 9\", \"assert ma...
{ "split": "train", "index": 83623, "acecode_id": "oss_11817", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Write a function `find_char_indices(s: str, ch: str) -> List[int]` that takes a string `s` and a character `ch`, and returns a list of indices where the character `ch` occurs in the string `s`. If the character does not occur in the string, return an empty list.\nPlease reason ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_char_indices('hello world', 'o') == [4, 7]\", \"assert find_char_indices('abcdefg', 'z') == []\", \"assert find_char_indices('test case', 't') == [0, 3]\", \"assert find_char_indices('hello hello', 'h') == [0, 6]\", \"assert find_char_indices('123456789...
{ "split": "train", "index": 83624, "acecode_id": "evol_14757", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function `error_management(command: str) -> bool` that takes a shell command as a string, executes it, and returns True if the command executed successfully (return code 0) and False otherwise. The function should handle any errors that occur during the command exec...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert error_management('ls non_existing_directory') == False\", \"assert error_management('invalid_command') == False\", \"assert error_management('false') == False\", \"assert error_management('exit 1') == False\", \"assert error_management('grep something /non_e...
{ "split": "train", "index": 83625, "acecode_id": "evol_3807", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with writing a Python function that validates an IP address by checking specific conditions. The function should take an IP address as a string and return a dictionary containing the results of the following checks: 1) whether the given IP address matches the spe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_ip('192.168.1.1') == {'matches_specified_ip': True, 'contains_substring': True, 'does_not_contain_substring': True}\", \"assert validate_ip('192.168.0.1') == {'matches_specified_ip': False, 'contains_substring': True, 'does_not_contain_substring': T...
{ "split": "train", "index": 83626, "acecode_id": "oss_9315", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of several buildings in a city. Your task is to implement a function that calculates the maximum area of a rectangle that can be formed between these buildings. The rectangle can extend from one building to another, and ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_area([2,1,5,6,2,3]) == 10\", \"assert max_area([1,1]) == 1\", \"assert max_area([]) == 0\", \"assert max_area([2,3,4,5]) == 6\", \"assert max_area([10,8,6,4,2,0]) == 12\"]}" }
{ "split": "train", "index": 83627, "acecode_id": "oss_7507", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a command for a virtual machine management tool. The function should take in a virtual machine configuration file path and a name for the replay session, and return a list of command-line arguments that would be used to...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert begin_replay('/tmp/first/some.vmx', 'a_name') == ['/tmp/vmrun', '-T', 'ws', 'beginReplay', '/tmp/first/some.vmx', 'a_name']\", \"assert begin_replay('/tmp/second/another.vmx', 'session1') == ['/tmp/vmrun', '-T', 'ws', 'beginReplay', '/tmp/second/another.vmx'...
{ "split": "train", "index": 83628, "acecode_id": "bigcode_python_fns_22173", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are asked to create a function that extracts the copyright notice from a given source code string. The copyright notice is typically found in comments at the beginning of the source code and follows a specific format. Your task is to implement a function `extract_copyright_...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_copyright_notice('# Copyright 2010-2019 Global Solutions') == 'Copyright 2010-2019 Global Solutions'\", \"assert extract_copyright_notice('# Copyright 2021 XYZ Technologies - All Rights Reserved') == 'Copyright 2021 XYZ Technologies - All Rights Rese...
{ "split": "train", "index": 83629, "acecode_id": "oss_20816", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with selecting questions from a list of quizzes based on a given ratio. You have three quizzes with a specific number of questions to select from each quiz: 10 from the first quiz, 7 from the second quiz, and 3 from the third quiz. Given a list of questions from ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert select_questions_from_quizzes(['Q1', 'Q2', 'Q3', 'Q4', 'Q5', 'Q6', 'Q7', 'Q8', 'Q9', 'Q10'], ['Q11', 'Q12', 'Q13', 'Q14', 'Q15', 'Q16', 'Q17'], ['Q18', 'Q19', 'Q20']) == ['Q1', 'Q2', 'Q3', 'Q4', 'Q5', 'Q6', 'Q7', 'Q8', 'Q9', 'Q10', 'Q11', 'Q12', 'Q13', 'Q14'...
{ "split": "train", "index": 83630, "acecode_id": "bigcode_python_fns_28113", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple calculator function that takes in two integers, `n1` and `n2`, and returns their sum, product, and division. The function should perform the following operations: 1. Calculate the sum of `n1` and `n2`. 2. Calculate the product of `n1` and `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simple_calculator(4, 2) == (6, 8, 2.0)\", \"assert simple_calculator(10, 5) == (15, 50, 2.0)\", \"assert simple_calculator(-3, -7) == (-10, 21, 0.42857142857142855)\", \"assert simple_calculator(0, 5) == (5, 0, 0.0)\", \"assert simple_calculator(5, 0) == (5,...
{ "split": "train", "index": 83631, "acecode_id": "oss_6129", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a rectangle's dimensions in a specific ratio represented as a tuple (a, b, diagonal), where a and b are the ratio of the rectangle's sides and diagonal is the length of the diagonal in cm, implement a function called rectangle_area that calculates and returns the area of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rectangle_area((4, 3, 25)) == 300.0\", \"assert rectangle_area((5, 12, 13)) == 60.0\", \"assert rectangle_area((8, 6, 10)) == 48.0\", \"assert rectangle_area((7, 24, 25)) == 168.0\", \"assert rectangle_area((10, 10, 14)) == 98.0\", \"assert rectangle_area((6...
{ "split": "train", "index": 83632, "acecode_id": "evol_5612", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Implement a function `count_vowels(words)` that computes the total number of vowels in a given list of words. You should only consider words that start with a vowel and contain only alphabetic characters. Words that start with a consonant or contain non-alphabetic characters sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_vowels(['apple', 'banana', 'orange']) == 5\", \"assert count_vowels(['pear', 'kiwi', 'avocado']) == 4\", \"assert count_vowels(['cat', 'dog', 'elephant']) == 3\", \"assert count_vowels(['hello', 'world', 'python']) == 0\", \"assert count_vowels(['islan...
{ "split": "train", "index": 83633, "acecode_id": "evol_23606", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a list of integers representing the scores of a game, write a function `calculate_average_score(scores: List[int]) -> float` that calculates the average score of the game, excluding the highest and lowest scores. If there are less than three scores in the list, return 0.0...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average_score([1, 2, 3, 4, 5, 6, 7, 8, 9]) == 5.00\", \"assert calculate_average_score([3, 3, 3, 3, 3]) == 3.00\", \"assert calculate_average_score([100, 200, 300, 400]) == 250.00\", \"assert calculate_average_score([-1, -2, -3, -4, -5]) == -3.00\"...
{ "split": "train", "index": 83634, "acecode_id": "oss_11263", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `sparse_5d_array` that simulates a sparse 5D array of dimensions 5 x 5 x 5 x 5 x 5. The function should take two parameters: a list of tuples where each tuple consists of a 5-dimensional index (as a tuple of 5 integers) and an integer value. The function sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sparse_5d_array([]) == {}\", \"assert sparse_5d_array([((0, 0, 0, 0, 0), 1)]) == { (0, 0, 0, 0, 0): 1 }\", \"assert sparse_5d_array([((1, 1, 1, 1, 1), 5), ((1, 1, 1, 1, 1), 10)]) == { (1, 1, 1, 1, 1): 10 }\", \"assert sparse_5d_array([((2, 2, 2, 2, 2), 0)]) ...
{ "split": "train", "index": 83635, "acecode_id": "evol_246", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple communication system that sends and receives messages between devices using a mock network. Your goal is to implement a function called `communicate` that simulates sending and receiving messages. The function should take the following para...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert communicate(['hello', 'world', 'error message', 'test'], 'response') == [True, True, False, True]\", \"assert communicate(['error', 'valid message'], 'response') == [False, True]\", \"assert communicate(['another valid message', 'error occurred'], 'response'...
{ "split": "train", "index": 83636, "acecode_id": "oss_5746", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `make_palindrome(string: str) -> str` that constructs the shortest possible palindrome by appending characters to the end of the given string. The function should return the resulting palindrome. If the input string is already a palindrome, return it unchan...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert make_palindrome('') == ''\", \"assert make_palindrome('a') == 'a'\", \"assert make_palindrome('ab') == 'aba'\", \"assert make_palindrome('abc') == 'abcba'\", \"assert make_palindrome('civic') == 'civic'\", \"assert make_palindrome('level') == 'level'\", \"as...
{ "split": "train", "index": 83637, "acecode_id": "evol_17511", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of strings representing lines of text, implement a function `beginning_next_non_empty_line(lines: List[str], index: int) -> int` that finds the index of the first non-empty line after a given index. The function should return the index of the first line that is not...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert beginning_next_non_empty_line(['', ' ', 'Hello', 'World'], 0) == 2\", \"assert beginning_next_non_empty_line(['Line1', ' ', '', 'Line2'], 1) == 3\", \"assert beginning_next_non_empty_line(['First', 'Second', ' ', 'Third'], 2) == 3\", \"assert beginning_next_...
{ "split": "train", "index": 83638, "acecode_id": "bigcode_python_fns_2605", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `filter_entries(entries: List[Dict[str, Any]], width: int, count: bool, parsable: bool) -> str` that filters and formats a given set of dictionary entries. The function should take the following parameters: \n- `entries`: A list of dictio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_entries([{'name': 'Charlie', 'age': 35}], 15, False, True) == '[{\\\"name\\\": \\\"Charlie\\\", \\\"age\\\": 35}]'\", \"assert filter_entries([], 10, True, False) == 'Total entries: 0'\", \"assert filter_entries([{'name': 'Dave', 'age': 40}, {'name': ...
{ "split": "train", "index": 83639, "acecode_id": "bigcode_python_fns_49646", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given a byte string `mm` representing a sequence of 4-byte long blocks of data. Your task is to implement a function `unpack_mmap_block(mm: bytes, n: int) -> int` that decodes the nth 4-byte long block from the byte string. Each block is represented by 4 consecutive byt...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unpack_mmap_block(b'\\\\x01\\\\x00\\\\x00\\\\x00\\\\x02\\\\x00\\\\x00\\\\x00', 0) == 1\", \"assert unpack_mmap_block(b'\\\\x01\\\\x00\\\\x00\\\\x00\\\\x02\\\\x00\\\\x00\\\\x00', 1) == 2\", \"assert unpack_mmap_block(b'\\\\xFF\\\\xFF\\\\xFF\\\\xFF\\\\x00\\\\x...
{ "split": "train", "index": 83640, "acecode_id": "bigcode_python_fns_31012", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function that classifies a given string 's' as 'sad', 'happy', or returns an error. The string is classified as 'sad' if it contains more than three characters, each unique letter only appears once or consecutively, and any group of three or four consecutive letters...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert string_analyzer('abcdef') == 'sad'\", \"assert string_analyzer('aabab') == 'error'\", \"assert string_analyzer('xyzx') == 'error'\", \"assert string_analyzer('aabbcc') == 'sad'\", \"assert string_analyzer('abcd') == 'sad'\", \"assert string_analyzer('abcabc'...
{ "split": "train", "index": 83641, "acecode_id": "evol_6464", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a list of strings, write a function `extract_stackstrings(strings: List[str]) -> List[str]` that identifies and returns a list of strings that contain the substring 'stack'. Each identified string should be returned in the same order it appeared in the input list. If no s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_stackstrings(['this is a test', 'stack overflow', 'another string']) == ['stack overflow']\", \"assert extract_stackstrings(['no stack here', 'just some text', 'another stack example']) == ['no stack here', 'another stack example']\", \"assert extrac...
{ "split": "train", "index": 83642, "acecode_id": "bigcode_python_fns_31306", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the total distance of a route defined by a list of waypoints. Each waypoint is represented as a tuple of coordinates (x, y). The total distance is calculated using the Euclidean distance formula, which is defined as: distance = sqrt((x2 - x1)^2 +...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_route_distance(1, [(0, 0), (3, 4), (6, 8)]) == 10.0\", \"assert calculate_route_distance(1, [(1, 1), (1, 2), (1, 3)]) == 2.0\", \"assert calculate_route_distance(1, [(0, 0)]) == 0.0\", \"assert calculate_route_distance(1, [(0, 0), (0, 0), (0, 0)]) ...
{ "split": "train", "index": 83643, "acecode_id": "oss_22160", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of integers and returns the second smallest unique number in the list. If there is no second smallest number, return None.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```pyt...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_second_smallest([3, 1, 2, 1, 4]) == 2\", \"assert find_second_smallest([5, 5, 5, 5]) == None\", \"assert find_second_smallest([10]) == None\", \"assert find_second_smallest([1, 2, 3, 4, 5]) == 2\", \"assert find_second_smallest([0, 0, 0, 1]) == 1\", \"a...
{ "split": "train", "index": 83644, "acecode_id": "evol_9814", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple cache management system for a file system. Your implementation should support read and write operations. You need to create a function that takes the following parameters: a list of cache operations, where each operation is either a rea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cache_operations([('write', 'file1', 'data1'), ('read', 'file1'), ('read', 'file2')]) == ['data1', None]\", \"assert cache_operations([('write', 'file2', 'data2'), ('read', 'file2'), ('read', 'file1')]) == ['data2', None]\", \"assert cache_operations([('writ...
{ "split": "train", "index": 83645, "acecode_id": "oss_4474", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of floating-point numbers representing the loss values for each batch in a training epoch of a neural network. Your task is to implement a function that calculates the average loss for the epoch and returns the average loss rounded to two decimal places. Th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_loss([0.0, 1.0, 2.0]) == 1.0\", \"assert average_loss([1.5, 2.5, 3.5]) == 2.5\", \"assert average_loss([0.1, 0.2, 0.3, 0.4]) == 0.25\", \"assert average_loss([5.0, 10.0]) == 7.5\", \"assert average_loss([0.1, 0.1, 0.1, 0.1]) == 0.1\", \"assert averag...
{ "split": "train", "index": 83646, "acecode_id": "oss_8652", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the execution of a series of configuration files in a specific order. Implement a function `execute_simulation_config(location: str)` that takes the location of configuration files as input and returns a list of the names o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert execute_simulation_config('/path/to/config/files/') == ['setSteadyStateSelectionList.py', 'setTempFolder.py', 'setTimeEnd.py', 'setTimeStart.py', 'setValue.py']\", \"assert execute_simulation_config('/configs/') == ['setSteadyStateSelectionList.py', 'setTemp...
{ "split": "train", "index": 83647, "acecode_id": "oss_23604", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are required to find the smallest subset of a given matrix where the sum of its elements equals a specified value. Your function should take in the matrix and the target value as parameters. In case there are multiple subsets with the same number of elements satisfying the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_smallest_subset([[1, 1], [1, 1]], 2) == [([1, 1], [(0, 0), (0, 1)])]\", \"assert find_smallest_subset([[1, 2, 3], [4, 5, 6]], 10) == [([4, 6], [(1, 0), (1, 2)])]\", \"assert find_smallest_subset([[1]], 2) == 'No subset found'\", \"assert find_smallest_s...
{ "split": "train", "index": 83648, "acecode_id": "evol_11675", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a list of text strings. Your task is to implement a function that takes a list of strings and a function that converts a string into a list of integers (tokenization process). The function should return a new list of lists, where each inner list consists of the to...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert preprocess_texts(['hello', 'world'], lambda x: [ord(c) for c in x], [1, 2]) == [[1, 2, 104, 101, 108, 108, 111], [1, 2, 119, 111, 114, 108, 100]]\", \"assert preprocess_texts(['python', 'code'], lambda x: [len(x)], [0]) == [[0, 6], [0, 4]]\", \"assert prepro...
{ "split": "train", "index": 83649, "acecode_id": "bigcode_python_fns_31355", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a dictionary called `settings` that contains two types of keys: regular settings and a nested dictionary under the key 'SETTINGS_DEFAULTS'. Your task is to implement a function `get_secret_setting_names(settings: dict) -> Set[str]` that returns a set of keys that ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_secret_setting_names({'SETTINGS_DEFAULTS': {'key1': 'PLACEHOLDER_FOR_SECRET', 'key2': 'value2'}}) == {'key1'}\", \"assert get_secret_setting_names({'SETTINGS_DEFAULTS': {}}) == set()\", \"assert get_secret_setting_names({'SETTINGS_DEFAULTS': {'key1': 'PL...
{ "split": "train", "index": 83650, "acecode_id": "bigcode_python_fns_14259", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a dictionary called `branch_file_score` where each key is a string representing a branch name and each value is a list of integers representing the scores of that branch in various files. Your task is to implement a function `report(branch_file_score)` that return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert report({'branchA': [80, 90, 70], 'branchB': [100, 95], 'branchC': []}) == {'branchA': 80.0, 'branchB': 97.5}\", \"assert report({'branchX': [50], 'branchY': [75, 85, 95]}) == {'branchX': 50.0, 'branchY': 85.0}\", \"assert report({'branchA': [], 'branchB': []...
{ "split": "train", "index": 83651, "acecode_id": "bigcode_python_fns_45918", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function `detail_stats(l: list)` that returns a dictionary containing the first quartile, median, third quartile, mode, range, and interquartile range of elements in the list `l` without using built-in functions. The function should handle positive numbers, negative...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert detail_stats([1, 2, 3, 4, 5]) == {'first quartile': 1.5, 'median': 3, 'third quartile': 4.5, 'mode': 1, 'range': 4, 'interquartile range': 3}\", \"assert detail_stats([1, 1, 2, 3, 3, 4, 5]) == {'first quartile': 1, 'median': 3, 'third quartile': 4, 'mode': 1...
{ "split": "train", "index": 83652, "acecode_id": "evol_5281", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Implement the function `quick_sort(arr)` that takes a list of integers as input and returns a new list containing the same integers sorted in ascending order using the QuickSort algorithm. You should use the divide-and-conquer strategy to partition the list around a pivot and r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert quick_sort([]) == []\", \"assert quick_sort([1]) == [1]\", \"assert quick_sort([2, 1]) == [1, 2]\", \"assert quick_sort([3, 2, 1]) == [1, 2, 3]\", \"assert quick_sort([1, 2, 3]) == [1, 2, 3]\", \"assert quick_sort([3, 1, 2]) == [1, 2, 3]\", \"assert quick_so...
{ "split": "train", "index": 83653, "acecode_id": "evol_33557", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string 'token' which represents a JSON Web Token (JWT). Your task is to implement a function that verifies the token's signature using a provided public key. The function should return the parsed token data if the signature is valid, otherwise, it should return ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert verify('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c', 'invalidkey') == None\", \"assert verify('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxM...
{ "split": "train", "index": 83654, "acecode_id": "bigcode_python_fns_33130", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a list of geometric shapes represented as strings and a corresponding list of values. Your task is to write a function that extracts and formats these shapes along with their associated values into a list of tuples. Each tuple should contain a shape and its corres...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_shapes(['circle', 'square', 'triangle'], [1, 2, 3]) == [('circle', 1), ('square', 2), ('triangle', 3)]\", \"assert get_shapes(['rectangle', 'oval'], ['A', 'B']) == [('rectangle', 'A'), ('oval', 'B')]\", \"assert get_shapes(['hexagon', 'pentagon', 'octago...
{ "split": "train", "index": 83655, "acecode_id": "bigcode_python_fns_49252", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `check_anagram(a_list)` that takes an array of strings `a_list` and determines if all the strings in the array are anagrams of each other. An anagram is defined as a word or phrase that is formed by rearranging the letters of a different word or phrase, typ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_anagram(['listen', 'silent', 'enlist']) == True\", \"assert check_anagram(['hello', 'world']) == False\", \"assert check_anagram(['evil', 'vile', 'live']) == True\", \"assert check_anagram(['abc', 'bca', 'cab']) == True\", \"assert check_anagram(['pota...
{ "split": "train", "index": 83656, "acecode_id": "evol_1210", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two dictionaries, `source` and `target`, and a list of keys `attributes`. Your task is to update the `target` dictionary by copying values from the `source` dictionary for each key specified in `attributes`. If a key in `attributes` does not exist in `source`, you...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_target({'a': 1, 'b': 2}, {'a': 0, 'b': 0}, ['a']) == None and {'a': 1, 'b': 0} == {'a': 1, 'b': 0}\", \"assert update_target({'a': 1, 'b': 2}, {'a': 0, 'b': 0}, ['b']) == None and {'a': 0, 'b': 2} == {'a': 0, 'b': 2}\", \"assert update_target({'a': 1,...
{ "split": "train", "index": 83657, "acecode_id": "bigcode_python_fns_7940", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of logical forms represented as strings. Your task is to determine how many unique logical forms are present in the list, considering two logical forms to be equivalent if they have the same structure. Implement a function that takes a list of logical forms...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_unique_logical_forms(['X', 'Y', 'Z', 'x', 'y', 'z']) == 3\", \"assert count_unique_logical_forms(['1 + 2', '1 + 2', '1 + 2']) == 1\", \"assert count_unique_logical_forms(['A', 'B', 'C', 'D']) == 4\", \"assert count_unique_logical_forms(['True', 'False'...
{ "split": "train", "index": 83658, "acecode_id": "bigcode_python_fns_49793", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with generating an authentication token for a user based on their username and password. Implement a function `generate_token(username: str, password: str) -> str` that takes a username and password, concatenates them with a colon, and encodes the resulting strin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_token('user1', 'pass1') == 'dXNlcjE6cGFzczE='\", \"assert generate_token('admin', '1234') == 'YWRtaW46MTIzNA=='\", \"assert generate_token('testuser', 'mypassword') == 'dGVzdHVzZXI6bXlwYXNzd29yZA=='\", \"assert generate_token('alice', 'secret') == '...
{ "split": "train", "index": 83659, "acecode_id": "bigcode_python_fns_31608", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function for a linear layer in a neural network framework that supports dynamic slimming. Write a function `create_slimmable_linear(in_features: int, out_features: int, bias: bool, non_slimmable_out: bool, non_slimmable_in: bool) -> dict` whic...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_slimmable_linear(128, 64, True, False, True) == {'max_in_features': 128, 'in_features': 128, 'out_features': 64, 'bias': True, 'non_slimmable_out': False, 'non_slimmable_in': True}\", \"assert create_slimmable_linear(256, 128, False, True, False) == {...
{ "split": "train", "index": 83660, "acecode_id": "oss_17989", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a recursive function in Python that calculates the factorial of a non-negative integer. The function should raise a ValueError if the input is negative or not an integer. Ensure that the function handles large inputs gracefully to defend against stack overflow. The fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert factorial(0) == 1\", \"assert factorial(1) == 1\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", \"assert factorial(5) == 120\", \"assert factorial(6) == 720\", \"assert factorial(7) == 5040\", \"assert factorial(...
{ "split": "train", "index": 83661, "acecode_id": "evol_20419", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates copying data from a list of rows (represented as lists) into a theoretical database table. Your function should take the following parameters: a list of rows (`values`), a list of field names (`field_names`), and a list of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_table([], ['name', 'age'], ['string', 'int']) == 'Empty Table'\", \"assert create_table([[1, 'John'], [2, 'Doe']], ['id', 'name'], ['int', 'string']) == 'Table Created'\", \"assert create_table([[1]], ['name', 'age'], ['string']) == 'Field mismatch'\"...
{ "split": "train", "index": 83662, "acecode_id": "bigcode_python_fns_19067", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes an array of integers and floats, and returns the sign of the product of all unique, non-zero elements in the array. If the product is positive, return 'Positive'. If it is negative, return 'Negative'. If there are no non-zero elements, return 'Ze...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert prod_signs([1, 2, 3]) == 'Positive'\", \"assert prod_signs([-1, -2, -3]) == 'Negative'\", \"assert prod_signs([0, 0, 0]) == 'Zero'\", \"assert prod_signs([1.5, -2.5, 3.0]) == 'Negative'\", \"assert prod_signs([0, 1.5, -2.5, 3.0]) == 'Negative'\", \"assert pr...
{ "split": "train", "index": 83663, "acecode_id": "evol_27118", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary representing a change, which includes a key 'ResourceType' that indicates the type of resource being referenced. You are also provided with a list of stateful resources. Write a function `is_stateful(change: Dict[str, str], stateful_resources: List[st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_stateful({'ResourceType': 'EC2'}, ['EC2', 'RDS', 'Lambda']) == True\", \"assert is_stateful({'ResourceType': 'S3'}, ['EC2', 'RDS', 'Lambda']) == False\", \"assert is_stateful({'ResourceType': 'RDS'}, ['EC2', 'RDS', 'Lambda']) == True\", \"assert is_statef...
{ "split": "train", "index": 83664, "acecode_id": "bigcode_python_fns_38209", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to resize an image to a specified width while maintaining its aspect ratio. The function should take two parameters: the current width and height of the image, and the new width to resize the image to. The function should return the n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert resize_image(800, 600, 400) == 300\", \"assert resize_image(1920, 1080, 960) == 540\", \"assert resize_image(1000, 500, 250) == 125\", \"assert resize_image(640, 480, 320) == 240\", \"assert resize_image(300, 200, 150) == 100\", \"assert resize_image(1200, 9...
{ "split": "train", "index": 83665, "acecode_id": "oss_8819", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function that takes two integer parameters, `base` and `exponent`, and returns true if `exponent` is a power of `base`. The function should return a custom error message if either input is not an integer. Additionally, handle the special cases where the base is 0, 1, o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_power(2, 8) == True\", \"assert is_power(0, 0) == True\", \"assert is_power(1, 1) == True\", \"assert is_power(-2, 4) == True\", \"assert is_power(-2, 8) == False\", \"assert is_power(-1, 1) == True\", \"assert is_power(-1, 2) == False\", \"assert is_powe...
{ "split": "train", "index": 83666, "acecode_id": "evol_7659", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a string `tex` that represents a TeX document. Your task is to implement a function that modifies this document to make it more compilable using TeX. Specifically, you need to perform the following transformations: 1. Remove any occurrence of the substring '\\usep...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compilable('Text with multiple spaces.') == 'Text with multiple spaces.'\", \"assert compilable('No modifications needed here.') == 'No modifications needed here.'\", \"assert compilable('Normal text without any commands.') == 'Normal text without any...
{ "split": "train", "index": 83667, "acecode_id": "bigcode_python_fns_48296", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the viscosity of a liquid based on its temperature. Write a function `calculate_viscosity(temperature: float) -> float` that takes a single parameter `temperature`, representing the temperature in Kelvin. The function should return the viscosity ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_viscosity(150.0) == -1\", \"assert calculate_viscosity(59.0) == -1\", \"assert calculate_viscosity(0.0) == -1\", \"assert calculate_viscosity(-10.0) == -1\", \"assert calculate_viscosity(200.0) == -1\", \"assert calculate_viscosity(130.1) == -1\", ...
{ "split": "train", "index": 83668, "acecode_id": "bigcode_python_fns_41224", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with developing a function to calculate the total cost of a heat load based on various fluid properties. Implement a function `calculate_total_cost` that takes the following parameters: \n- `heat_load` (float): The heat load in watts. \n- `cost` (float): The cost...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_total_cost(1000.0, 0.1, 'oil', 'liquid', True) == 100.0\", \"assert calculate_total_cost(1500.0, 0.2, 'oil', 'liquid', True) == 300.0\", \"assert calculate_total_cost(500.0, 0.1, 'water', 'gas', True) == 50.0\", \"assert calculate_total_cost(800.0,...
{ "split": "train", "index": 83669, "acecode_id": "oss_21043", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple language translation system. Write a function `translate(lang: str, key: str) -> str` that takes a language code and a string key as input and returns the corresponding translated string from a predefined dictionary of translations. If ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert translate('en', 'greeting') == 'Hello'\", \"assert translate('en', 'farewell') == 'Goodbye'\", \"assert translate('es', 'greeting') == 'Hola'\", \"assert translate('es', 'farewell') == 'Adi\\u00f3s'\", \"assert translate('fr', 'greeting') == 'Bonjour'\", \"a...
{ "split": "train", "index": 83670, "acecode_id": "oss_18463", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a coin counting game. The function should accept an integer input representing the total number of coins a user has and calculate the total value of the coins based on the input provided. Each coin is worth 1 cent. Your fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_coin_value(10) == 0.1\", \"assert calculate_coin_value(0) == 0.0\", \"assert calculate_coin_value(100) == 1.0\", \"assert calculate_coin_value(50) == 0.5\", \"assert calculate_coin_value(25) == 0.25\", \"assert calculate_coin_value(-5) == 0\", \"as...
{ "split": "train", "index": 83671, "acecode_id": "oss_27670", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a weighted undirected graph represented as a dictionary of dictionaries. Each key in the outer dictionary represents a node, and the value is another dictionary where keys are neighboring nodes and values are the weights (lengths) of the edges connecting them. You...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert shortest_path_length({0: {1: 5, 2: 10}, 1: {0: 5, 2: 2}, 2: {0: 10, 1: 2}}, 0, 2) == 7\", \"assert shortest_path_length({0: {1: 1}, 1: {0: 1, 2: 2}, 2: {1: 2}}, 0, 2) == 3\", \"assert shortest_path_length({0: {1: 10}, 1: {0: 10, 2: 10}, 2: {1: 10}}, 0, 2) ==...
{ "split": "train", "index": 83672, "acecode_id": "oss_30831", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of command flavours represented as strings. Your task is to determine the parameters associated with each flavour. Implement a function `get_parameters(command_flavours: List[str]) -> List[Dict[str, Union[str, List[int]]]]` that takes a list of command flav...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_parameters(['posix']) == [{'Command flavour': 'posix', 'String termination': [0, 10]}]\", \"assert get_parameters(['unix']) == [{'Command flavour': 'unix', 'Include backspaces': True, 'String termination': [0, 10]}]\", \"assert get_parameters(['unix:v10'...
{ "split": "train", "index": 83673, "acecode_id": "bigcode_python_fns_35424", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that returns the longest strictly increasing subsequence from that list. Each number in the list may be repeated, and repetitions should be treated as distinct elements in the subsequence. For example, in the list [10, 22, 9, 33, 2...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longest_increasing_subsequence([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert longest_increasing_subsequence([0, 0, 0, 0, 0]) == [0]\", \"assert longest_increasing_subsequence([1, 2, 1, 2, 1, 2, 1]) == [1, 2]\", \"assert longest_increasing_subsequence([5, 1...
{ "split": "train", "index": 83674, "acecode_id": "evol_9511", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks if a department update task can be initiated based on the current status of tasks in a queue. Given a list of currently active tasks and a list of reserved tasks, each represented as dictionaries containing a 'args' key wi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_initiate_task(1, [{'args': [1]}, {'args': [2]}], [{'args': [1]}]) == False\", \"assert can_initiate_task(2, [{'args': [3]}, {'args': [4]}], [{'args': [5]}]) == True\", \"assert can_initiate_task(5, [{'args': [4]}, {'args': [5]}], [{'args': [6]}]) == Fals...
{ "split": "train", "index": 83675, "acecode_id": "bigcode_python_fns_34281", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to implement a function that simulates user login tracking for a social media platform. The function should accept a list of login events and return a dictionary that maps each user ID to their last login timestamp. The login events will be represented as tuples, where...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert track_logins([('user1', 1.0), ('user2', 2.0), ('user1', 3.0)]) == {'user1': 3.0, 'user2': 2.0}\", \"assert track_logins([('user3', 5.0), ('user4', 6.0), ('user3', 7.0), ('user4', 8.0)]) == {'user3': 7.0, 'user4': 8.0}\", \"assert track_logins([('user5', 10.0...
{ "split": "train", "index": 83676, "acecode_id": "oss_22091", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the content of a personal blog's different pages. The function should take a page type as input and return the corresponding content for that page. The valid page types are 'home', 'about', 'contact', 'jokes', 'ranting', an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_blog_content('home') == 'Welcome to my blog!'\", \"assert get_blog_content('about') == 'About the author of this blog.'\", \"assert get_blog_content('home') != 'About the author of this blog.'\", \"assert get_blog_content('contact') != 'Welcome to my blo...
{ "split": "train", "index": 83677, "acecode_id": "oss_5486", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Implement a function `generate_unique_sorted_numbers(start: int, end: int, count: int) -> List[int]` that generates a specified number of unique random integers within a given range (inclusive) and returns them sorted in ascending order. If the count of requested numbers is gre...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_unique_sorted_numbers(0, 0, 1) == [0]\", \"assert generate_unique_sorted_numbers(1, 5, 5) == [1, 2, 3, 4, 5]\", \"assert generate_unique_sorted_numbers(1, 5, 0) == []\", \"assert generate_unique_sorted_numbers(1, 5, -1) == []\", \"assert generate_un...
{ "split": "train", "index": 83678, "acecode_id": "evol_34022", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simple data stream operation. The function `insert_and_read` takes an integer `n` as input, which represents the number of elements to insert into the stream, followed by a series of integers. The function should inse...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert insert_and_read(5, 5, 6, 7, 8, 9) == 9\", \"assert insert_and_read(1, 895) == 895\", \"assert insert_and_read(3, 1, 2, 3) == 3\", \"assert insert_and_read(4, 10, 20, 30, 40) == 40\", \"assert insert_and_read(2, 100, 200) == 200\", \"assert insert_and_read(6,...
{ "split": "train", "index": 83679, "acecode_id": "bigcode_python_fns_32458", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `is_numeric_string(s: str) -> bool` that determines if the given string `s` consists entirely of numerical digits (0-9). The function should return `True` if the string is composed solely of digits and `False` otherwise.\nPlease reason step by step, then write ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_numeric_string('12345') == True\", \"assert is_numeric_string('0') == True\", \"assert is_numeric_string('9876543210') == True\", \"assert is_numeric_string('123abc') == False\", \"assert is_numeric_string('abc') == False\", \"assert is_numeric_string('12...
{ "split": "train", "index": 83680, "acecode_id": "evol_32000", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Develop a function that accepts two number strings as parameters and checks if all digits of the second number string appear in the first number string in the same order, but not necessarily consecutively. Return True if the order is maintained, and False otherwise.\nPlease rea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_order('123456789', '13579') == True\", \"assert check_order('9876543210', '543') == True\", \"assert check_order('111222333444', '123') == True\", \"assert check_order('123123123', '321') == True\", \"assert check_order('123456', '246') == True\", \"as...
{ "split": "train", "index": 83681, "acecode_id": "evol_29585", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with validating the actions supported by a target based on a predefined list of targets and their supported actions. Write a function `validate_target_action(target_name: str, action: str) -> bool` that takes in two parameters: `target_name` (a string representin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_target_action('TargetA', 'create') == True\", \"assert validate_target_action('TargetB', 'read') == True\", \"assert validate_target_action('TargetC', 'create') == True\", \"assert validate_target_action('TargetA', 'update') == True\", \"assert vali...
{ "split": "train", "index": 83682, "acecode_id": "bigcode_python_fns_45352", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with defining a function `modify_mohs_scale()` that takes no parameters. This function should return a dictionary representing the new characteristics of the `mohs_scale` field in a `MineralType` model. The `mohs_scale` field should be defined as a string with a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert modify_mohs_scale() == {'max_length': 10, 'null': True}\", \"assert modify_mohs_scale()['max_length'] == 10\", \"assert modify_mohs_scale()['null'] is True\", \"assert isinstance(modify_mohs_scale(), dict)\", \"assert 'max_length' in modify_mohs_scale()\", \...
{ "split": "train", "index": 83683, "acecode_id": "oss_22813", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of computer group names and a template string. The function should replace any occurrences of the placeholder '{group_name}' in the template string with each computer group name from the list. The function should return ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert replace_group_names('Group: {group_name}', ['Admins', 'Users']) == ['Group: Admins', 'Group: Users']\", \"assert replace_group_names('Welcome to {group_name} group', ['Guests']) == ['Welcome to Guests group']\", \"assert replace_group_names('The {group_name}...
{ "split": "train", "index": 83684, "acecode_id": "bigcode_python_fns_876", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple Python function that generates a greeting message. The function should take a string as input, which represents a name, and return a greeting message in the format 'Hello, [name]!', where [name] is the name provided as input. If the input n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_greeting('Alice') == 'Hello, Alice!'\", \"assert generate_greeting('Bob') == 'Hello, Bob!'\", \"assert generate_greeting('') == 'Hello, World!'\", \"assert generate_greeting('Charlie') == 'Hello, Charlie!'\", \"assert generate_greeting('Diana') == '...
{ "split": "train", "index": 83685, "acecode_id": "oss_1749", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of variable names, implement a function that returns a sorted list of their corresponding values from a predefined configuration mapping. If no names are provided, the function should return all values from the configuration mapping in sorted order. If any variable...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_variable_values([]) == [1, 2, 3, 4, 5]\", \"assert get_variable_values(['alpha']) == [1]\", \"assert get_variable_values(['beta', 'gamma']) == [2, 3]\", \"assert get_variable_values(['delta']) == [4]\", \"assert get_variable_values(['epsilon']) == [5]\",...
{ "split": "train", "index": 83686, "acecode_id": "bigcode_python_fns_36711", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that determines if a rule is active based on its attributes. A rule is represented by its case status, team, queue, tier number, and a boolean indicating whether the rule should only show active rules. Your function should take these ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_rule_active('Open', 'TeamA', 'Queue1', 1, True) == True\", \"assert is_rule_active('Closed', 'TeamB', 'Queue2', 2, False) == False\", \"assert is_rule_active('Pending', 'TeamC', 'Queue3', 3, True) == True\", \"assert is_rule_active('Resolved', 'TeamD', 'Q...
{ "split": "train", "index": 83687, "acecode_id": "oss_813", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given an array of `n` strings `strs`, all of the same length. You can choose any deletion indices to delete all the characters in those indices for each string. Your objective is to determine the minimum number of deletion indices needed such that the remaining strings ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert minDeletionSize(['ca','bb','ac']) == (1, ['a', 'b', 'c'])\", \"assert minDeletionSize(['zyx','wvu','tsr']) == (3, ['', '', ''])\", \"assert minDeletionSize(['abc','def','ghi']) == (0, ['abc', 'def', 'ghi'])\", \"assert minDeletionSize(['a','b','c']) == (0, [...
{ "split": "train", "index": 83688, "acecode_id": "evol_31372", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given a list of rescue objects, each with the following properties: `active` (a boolean indicating if the rescue is active), `rats` (a list of assigned rats), `unidentified_rats` (a list of unidentified rats), and `platform` (a string representing the platform of the re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_rescues({'filter_unassigned_rescues': True, 'filter_active_rescues': False, 'filter_inactive_rescues': False}, None, [{'active': False, 'rats': [], 'unidentified_rats': [], 'platform': 'B'}]) == [True]\", \"assert filter_rescues({'filter_unassigned_re...
{ "split": "train", "index": 83689, "acecode_id": "bigcode_python_fns_8539", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given a numerical array and a predetermined total, write a Python function that computes the count of unique triplets in the array whose sum is equal to the total. A triplet is considered unique if its elements are distinct regardless of their order. Your function should return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_unique_triplets([1, 2, 3, 4, 5], 6) == (1, {(1, 2, 3)})\", \"assert find_unique_triplets([0, -1, 2, -3, 1], 0) == (2, {(-1, 0, 1), (-3, 1, 2)})\", \"assert find_unique_triplets([1, 1, 1, 1], 3) == (1, {(1, 1, 1)})\", \"assert find_unique_triplets([], 0)...
{ "split": "train", "index": 83690, "acecode_id": "evol_8572", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given a dictionary representing a query structure for a search operation. The structure contains a key 'searches' which maps to another dictionary, each containing a 'tree' key that represents the format of the query. Additionally, there is a 'selectedtemplate' key that...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert construct_advanced_query({'searches': {'template1': {'tree': {'id': 1}}, 'template2': {'tree': {'id': 2}}}, 'selectedtemplate': 'template1'}) == {'id': 1}\", \"assert construct_advanced_query({'searches': {'template1': {'tree': {'name': 'Alice'}}, 'template2...
{ "split": "train", "index": 83691, "acecode_id": "bigcode_python_fns_29997", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a dictionary representing a request, implement a function `get_tracer(request: dict) -> object` that retrieves the tracer from the nested attribute `__datadog_request_span` in the request dictionary. If the required attribute does not exist or is not in the expected forma...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_tracer({'__datadog_request_span': {'_tracer': 'tracer_object'}}) == 'tracer_object'\", \"assert get_tracer({'__datadog_request_span': {'_tracer': None}}) == None\", \"assert get_tracer({'__datadog_request_span': {}}) == None\", \"assert get_tracer({'__da...
{ "split": "train", "index": 83692, "acecode_id": "bigcode_python_fns_44004", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that generates the Fibonacci sequence up to a given number n using Binet's Formula. The function should return a list containing the Fibonacci numbers from 0 up to the largest Fibonacci number that does not exceed n. Ensure to account for rounding errors that m...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci(4) == [0, 1, 1, 2, 3]\", \"assert fibonacci(5) == [0, 1, 1, 2, 3, 5]\", \"assert fibonacci(6) == [0, 1, 1, 2, 3, 5]\", \"assert fibonacci(7) == [0, 1, 1, 2, 3, 5]\", \"assert fibonacci(8) == [0, 1, 1, 2, 3, 5, 8]\", \"assert fibonacci(9) == [0, 1, ...
{ "split": "train", "index": 83693, "acecode_id": "evol_5717", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that takes a string as input, representing a mathematical expression containing non-negative integers and basic arithmetic operators (+, -, *, /). Your function should evaluate the expression and return the result as a float. The e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert evaluate_expression('3 + 5') == 8.0\", \"assert evaluate_expression('10 - 2') == 8.0\", \"assert evaluate_expression('4 * 2') == 8.0\", \"assert evaluate_expression('16 / 2') == 8.0\", \"assert evaluate_expression('7 + 3 - 2') == 8.0\", \"assert evaluate_exp...
{ "split": "train", "index": 83694, "acecode_id": "oss_25040", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of temperatures and their corresponding pressures. Your task is to generate a list of color-coded tuples for the pressure-temperature pairs. Each temperature value should be associated with a color based on its index in the list, using the following color m...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_color_coded_list([{'Pressure': 1, 'Temperature': 1000}, {'Pressure': 2, 'Temperature': 1100}, {'Pressure': 3, 'Temperature': 1200}, {'Pressure': 4, 'Temperature': 1300}, {'Pressure': 5, 'Temperature': 1400}, {'Pressure': 6, 'Temperature': 1500}]) ==...
{ "split": "train", "index": 83695, "acecode_id": "bigcode_python_fns_12695", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function in Python that calculates the product of two non-negative integers without using any built-in multiplication operators or functions. The input integers will be provided in decimal format. The function should return the product as an integer.\nPlease reason ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert multiply_binary_nums_binary_shifts(0, 0) == 0\", \"assert multiply_binary_nums_binary_shifts(0, 5) == 0\", \"assert multiply_binary_nums_binary_shifts(5, 0) == 0\", \"assert multiply_binary_nums_binary_shifts(1, 1) == 1\", \"assert multiply_binary_nums_binar...
{ "split": "train", "index": 83696, "acecode_id": "evol_20458", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string representing a software version in the format 'X.Y.Z', where X, Y, and Z are non-negative integers, implement a function that increments the version number according to semantic versioning rules. The rules for incrementing the version are as follows: if Z (the pa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert increment_version('1.2.3') == '1.2.4'\", \"assert increment_version('1.2.9') == '1.3.0'\", \"assert increment_version('1.9.9') == '2.0.0'\", \"assert increment_version('0.0.0') == '0.0.1'\", \"assert increment_version('2.3.4') == '2.3.5'\", \"assert incremen...
{ "split": "train", "index": 83697, "acecode_id": "bigcode_python_fns_40648", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the processing of a collection of files based on their types. The function should take in a list of file types and return the state of the processing as follows: If all files are of type 'GWO', the state should be 'comp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_files(['GWO', 'GWO', 'GWO']) == ('completed', '')\", \"assert process_files(['GWO', 'NON-GWO', 'GWO']) == ('failed', 'Unknown file type detected')\", \"assert process_files(['NON-GWO', 'NON-GWO']) == ('failed', 'Unknown file type detected')\", \"asse...
{ "split": "train", "index": 83698, "acecode_id": "bigcode_python_fns_35196", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string, write a function that finds and returns the first floating-point number in the string. A floating-point number is defined as a sequence of digits that includes a decimal point (for example, '3.14', '0.001', '123.456'). If there is no floating-point number in the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_float('The price is 12.99 dollars') == '12.99'\", \"assert parse_float('No numbers here!') == None\", \"assert parse_float('3.14159 is a great approximation of pi') == '3.14159'\", \"assert parse_float('abc 1.23 xyz') == '1.23'\", \"assert parse_float(...
{ "split": "train", "index": 83699, "acecode_id": "bigcode_python_fns_6778", "num_tests": 16 }