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 that processes predictions from a machine learning model. The function should take a machine learning model, a set of input data, and a threshold value as parameters. The function combines the predictions made by the model with the th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_predictions(MockModel([0.8, 0.4, 0.9]), [0, 0, 0], 0.75) == [1, 0, 1]\", \"assert process_predictions(MockModel([0.7, 0.8, 0.9]), [0, 0, 0], 0.6) == [1, 1, 1]\", \"assert process_predictions(MockModel([0.5, 0.3]), [0, 0], 0.4) == [1, 0]\", \"assert p...
{ "split": "train", "index": 76200, "acecode_id": "oss_36968", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that calculates the average grade for each student based on a list of grade entries. Each entry in the list contains a student's ID and their corresponding grade. You need to write a function `calculate_average_grades(grades_li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average_grades([(1, 85), (2, 90), (1, 75), (2, 80)]) == {1: 80.0, 2: 85.0}\", \"assert calculate_average_grades([(3, 100), (3, 90), (3, 80)]) == {3: 90.0}\", \"assert calculate_average_grades([(4, 70), (4, 80), (4, 90)]) == {4: 80.0}\", \"assert ca...
{ "split": "train", "index": 76201, "acecode_id": "oss_29058", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes a string as input and returns the count of valid positive integers present in the string. A valid positive integer is defined as a sequence of digits that does not start with '0' (except for the digit '0' itself). Numbers are considered valid if they...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_valid_numbers_in_string('no numbers here') == 0\", \"assert count_valid_numbers_in_string('123 456 789') == 3\", \"assert count_valid_numbers_in_string('hello 1 world 2') == 2\", \"assert count_valid_numbers_in_string('123abc456def789') == 3\", \"asser...
{ "split": "train", "index": 76202, "acecode_id": "evol_8206", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a string `template` which represents a template for rendering and a dictionary `kwargs` containing key-value pairs, implement a function `render_template(template: str, kwargs: Dict[str, Any]) -> str` that simulates a simple rendering process. The function should replace ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert render_template('Hello, {{ name }}!', {'name': 'Alice'}) == 'Hello, Alice!'\", \"assert render_template('Your score is {{ score }}.', {'score': 90}) == 'Your score is 90.'\", \"assert render_template('{{ greeting }}, {{ name }}!', {'greeting': 'Hi', 'name': ...
{ "split": "train", "index": 76203, "acecode_id": "bigcode_python_fns_34820", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of vertices in a 3D space represented as a list of tuples, and a list of edges defined by pairs of vertex indices, write a function `get_edge_lengths(vertices: List[Tuple[float, float, float]], edge_points: List[Tuple[int, int]]) -> List[float]` that returns the sq...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_edge_lengths([(1,2,3), (4,5,6), (7,8,9)], [(0, 1), (1, 2)]) == [27.0, 27.0]\", \"assert get_edge_lengths([(1,1,1), (1,1,1), (1,1,1)], [(0, 1), (1, 2), (0, 2)]) == [0.0, 0.0, 0.0]\", \"assert get_edge_lengths([(0,0,0), (0,0,0), (0,0,0), (0,0,0)], [(0, 1)]...
{ "split": "train", "index": 76204, "acecode_id": "bigcode_python_fns_32573", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a list of scores ranging from 0 to 100, implement a function that groups these scores into bins of 10 points each (0-9, 10-19, ..., 90-99) and returns a dictionary with the count of scores in each bin, the percentage of scores in each bin, the cumulative count, and the cu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert score_bins([10, 20, 30, 40, 50]) == {'0-9': {'count': 0, 'percentage': 0.0, 'cumulative_count': 0, 'cumulative_percentage': 0.0}, '10-19': {'count': 1, 'percentage': 20.0, 'cumulative_count': 1, 'cumulative_percentage': 20.0}, '20-29': {'count': 1, 'percenta...
{ "split": "train", "index": 76205, "acecode_id": "bigcode_python_fns_36578", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to group a list of transactions by their cart ID. Each transaction is represented as a dictionary with the following keys: \"cart_id\", \"product_id\", and \"quantity\". The function should take a list of transactions as input and ret...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert group_transactions([]) == {}\", \"assert group_transactions([{'cart_id': 1, 'product_id': 'A', 'quantity': 2}]) == {1: [{'cart_id': 1, 'product_id': 'A', 'quantity': 2}]}\", \"assert group_transactions([{'cart_id': 1, 'product_id': 'A', 'quantity': 1}, {'car...
{ "split": "train", "index": 76206, "acecode_id": "oss_22273", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function `bidirectional_search(arr: List[int], target: int) -> int` that performs a bidirectional search on the given list `arr` to find the index of the `target` element. If the target is found, return its index; otherwise, return -1. The search should start from b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bidirectional_search([1, 2, 3, 4, 5], 3) == 2\", \"assert bidirectional_search([1, 2, 3, 4, 5], 1) == 0\", \"assert bidirectional_search([1, 2, 3, 4, 5], 5) == 4\", \"assert bidirectional_search([1, 2, 3, 4, 5], 6) == -1\", \"assert bidirectional_search([10,...
{ "split": "train", "index": 76207, "acecode_id": "evol_13707", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of positive integers, write a function in Python that does the following: 1. Construct a new list containing all the even integers from the original list. 2. If two consecutive numbers in the new list are multiples of 6, discard the smaller one and keep the larger ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert modify_list([10, 20, 30, 40, 50]) == ([10, 20, 30, 40, 50], 30.0, 30.0)\", \"assert modify_list([2, 4, 6]) == ([2, 4, 6], 4.0, 4.0)\", \"assert modify_list([10, 15, 20, 25, 30]) == ([10, 20, 30], 20.0, 20.0)\", \"assert modify_list([3, 5, 15, 2]) == ([2], 2....
{ "split": "train", "index": 76208, "acecode_id": "evol_9657", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Implement a function that takes a floating point number as input, converts it to a string and then back to a float. The function should return True if the original floating point number and the recreated floating point number are exactly identical, otherwise return False. Make ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert float_conversion(123.45) == True\", \"assert float_conversion(1.0) == True\", \"assert float_conversion(-123.45) == True\", \"assert float_conversion(3.14159) == True\", \"assert float_conversion(2.71828) == True\", \"assert float_conversion(0.0) == True\", ...
{ "split": "train", "index": 76209, "acecode_id": "evol_31674", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a custom error handling mechanism similar to a web framework. The function `custom_error_handler(exc: Exception, debug: bool) -> dict` takes an exception and a boolean indicating if the application is in debug mode. If ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert custom_error_handler(ValueError('Invalid input'), True) == {'detail': 'Invalid input', 'status_code': 500}\", \"assert custom_error_handler(KeyError('Key not found'), False) == {'detail': 'Internal Server Error', 'status_code': 500}\", \"assert custom_error_...
{ "split": "train", "index": 76210, "acecode_id": "bigcode_python_fns_42124", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a list of integers representing daily activity counts, write a function `ridge_line` that takes the list of integers and returns a representation of the activity distribution across those days as a list of formatted strings. Each string should indicate the average activit...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert ridge_line([10, 20, 30, 40]) == ['Average: 25.0 (Max: 40, Min: 10)']\", \"assert ridge_line([5, 15, 25, 35]) == ['Average: 20.0 (Max: 35, Min: 5)']\", \"assert ridge_line([0, 0, 0, 0]) == ['Average: 0.0 (Max: 0, Min: 0)']\", \"assert ridge_line([1, 2, 3, 4, ...
{ "split": "train", "index": 76211, "acecode_id": "bigcode_python_fns_11008", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two positive integers, determine their greatest common divisor (GCD). Implement a function that takes two integers as parameters and returns their GCD. For example, given the input (8, 12), the output should be 4.\nPlease reason step by step, then write a self-contained P...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert gcd(8, 12) == 4\", \"assert gcd(54, 24) == 6\", \"assert gcd(101, 10) == 1\", \"assert gcd(15, 5) == 5\", \"assert gcd(28, 14) == 14\", \"assert gcd(17, 19) == 1\", \"assert gcd(100, 80) == 20\", \"assert gcd(21, 14) == 7\", \"assert gcd(0, 5) == 5\", \"asse...
{ "split": "train", "index": 76212, "acecode_id": "evol_34266", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two sorted lists of integers, you are asked to write a function that merges the two lists into a single sorted list. However, you must ensure that the input lists are sorted before merging. If either of the lists is not sorted, raise a ValueError. Implement a function mer...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert mergeSorted([1, 3, 5], [2, 4, 6]) == [1, 2, 3, 4, 5, 6]\", \"assert mergeSorted([1, 3, 5], [0, 2, 4]) == [0, 1, 2, 3, 4, 5]\", \"assert mergeSorted([], [1, 2, 3]) == [1, 2, 3]\", \"assert mergeSorted([1, 2, 3], []) == [1, 2, 3]\", \"assert mergeSorted([1], [...
{ "split": "train", "index": 76213, "acecode_id": "evol_23522", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `find_max_in_nested_dict(d)` that takes a nested Python dictionary as input and returns the maximum value found within the dictionary. The function should handle any exceptions that might occur during execution, such as accessing non-numeric values. Assume that...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_max_in_nested_dict({'a': 10, 'b': {'ba': 5, 'bb': 24, 'bc': {'bca': 12, 'bcb': 41}}, 'c': 40, 'd': 30}) == 41\", \"assert find_max_in_nested_dict({'x': 1, 'y': {'z': 2}}) == 2\", \"assert find_max_in_nested_dict({'key1': -1, 'key2': -5}) == -1\", \"asse...
{ "split": "train", "index": 76214, "acecode_id": "evol_35324", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a simplified error handling mechanism for a hypothetical application when redirecting between two processes identified by their PIDs (Process IDs). Your function should take two dictionaries as input, where each dictionary ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert handle_pid_redirect({'pid_value': 1, 'pid_type': 'typeA'}, {'pid_value': 2, 'pid_type': 'typeA'}) == {'status': 301, 'message': 'Moved Permanently.', 'location': '/records/2'}\", \"assert handle_pid_redirect({'pid_value': 1, 'pid_type': 'typeB'}, {'pid_value...
{ "split": "train", "index": 76215, "acecode_id": "bigcode_python_fns_11782", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to remove all zone modifiers from a given lot represented as a dictionary. The lot dictionary contains a key 'lot_traits' which is a list of zone modifier IDs. Your function should remove all zone modifier IDs from the 'lot_traits' li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_all_zone_modifiers({'lot_traits': [1, 2, 3]}) == {'lot_traits': []}\", \"assert remove_all_zone_modifiers({'lot_traits': [10, 20, 30]}) == {'lot_traits': []}\", \"assert remove_all_zone_modifiers({'lot_traits': []}) == {'lot_traits': []}\", \"assert r...
{ "split": "train", "index": 76216, "acecode_id": "oss_28274", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two classes, Rotation2D and Gaussian1D, which represent different types of mathematical models. Each model has specific parameters that must be consistent with one another to perform mathematical operations such as addition and rotation. Your task is to implement ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_operations(Rotation2D(90), Rotation2D(45)) == True\", \"assert validate_operations(Gaussian1D(1, 0, 0.1), Gaussian1D(2, 1, 0.2)) == True\", \"assert validate_operations(Rotation2D(90), Gaussian1D(1, 0, 0.1)) == False\", \"assert validate_operations(...
{ "split": "train", "index": 76217, "acecode_id": "bigcode_python_fns_19084", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, implement a function `replace_entity(array, position, new_entity)` that replaces the element at the specified `position` in the `array` with `new_entity`. If the `position` is out of bounds (i.e., greater than or equal to the length of the array), th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert replace_entity([10, 20, 30, 40, 50], 2, 100) == [10, 20, 100, 40, 50]\", \"assert replace_entity([10, 20, 30, 40, 50], 0, 5) == [5, 20, 30, 40, 50]\", \"assert replace_entity([10, 20, 30, 40, 50], 4, -1) == [10, 20, 30, 40, -1]\", \"assert replace_entity([10...
{ "split": "train", "index": 76218, "acecode_id": "evol_17407", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a project code in the format 'NNNNN-NNNN' where N represents a digit, write a function that takes a project code as input and returns the project number by extracting the digits before the first hyphen. If the input code does not match the required format, the function sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_project_number('00002-2011') == '00002'\", \"assert extract_project_number('12345-6789') == '12345'\", \"assert extract_project_number('00000-0000') == '00000'\", \"assert extract_project_number('98765-4321') == '98765'\", \"assert extract_project_nu...
{ "split": "train", "index": 76219, "acecode_id": "bigcode_python_fns_2455", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a string containing multiple sentences, write a function `classify_sentences(text)` that classifies each sentence into one of four types: 'Declarative' (statement), 'Imperative' (command), 'Interrogative' (question), or 'Exclamatory' (exclamation). The function should ret...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert classify_sentences('Hello there! Are you okay?') == [('Hello there!', 'Exclamatory'), ('Are you okay?', 'Interrogative')]\", \"assert classify_sentences('This is amazing!') == [('This is amazing!', 'Exclamatory')]\", \"assert classify_sentences('What is your...
{ "split": "train", "index": 76220, "acecode_id": "evol_14650", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the retrieval of a UTF-8 encoded HTML string representing a product page. The function should return a predefined UTF-8 string that contains the product details, including its name, price, and description. Write a function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_product_page() == '<html><head><title>Product Page</title></head><body><h1>Sample Product</h1><p>Price: $19.99</p><p>Description: This is a sample product description.</p></body></html>'\", \"assert isinstance(get_product_page(), str)\", \"assert len(get...
{ "split": "train", "index": 76221, "acecode_id": "bigcode_python_fns_48503", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simple image upload process for a web application. The function `upload_image` takes in a string representing the image file name and returns a response message based on the status of the upload. The upload is conside...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert upload_image('image.jpg') == 'Upload successful!'\", \"assert upload_image('photo.png') == 'Upload successful!'\", \"assert upload_image('graphic.gif') == 'Upload successful!'\", \"assert upload_image('picture.jpeg') == 'Upload successful!'\", \"assert uploa...
{ "split": "train", "index": 76222, "acecode_id": "bigcode_python_fns_14001", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a dictionary where the keys are strings and the values are integers, write a function `find_duplicates` that returns a list of values that appear more than once in the dictionary. The return list should contain only unique duplicate values, in the order they first appeare...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_duplicates({'a': 1, 'b': 2, 'c': 2, 'd': 3, 'e': 4, 'f': 4, 'g': 5}) == [2, 4]\", \"assert find_duplicates({'x': 10, 'y': 20, 'z': 10, 'w': 30}) == [10]\", \"assert find_duplicates({'m': 5, 'n': 5, 'o': 6, 'p': 7, 'q': 6}) == [5, 6]\", \"assert find_dup...
{ "split": "train", "index": 76223, "acecode_id": "evol_29739", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `first_n_primes(n: int) -> List[int]` that returns the first `n` prime numbers as a list. The function should raise a ValueError if `n` is less than or equal to zero. Ensure to include proper documentation for your function.\nPlease reason step by step, then wr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert first_n_primes(6) == [2, 3, 5, 7, 11, 13]\", \"assert first_n_primes(1) == [2]\", \"assert first_n_primes(10) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29]\", \"assert first_n_primes(2) == [2, 3]\", \"assert first_n_primes(3) == [2, 3, 5]\", \"assert first_n_prime...
{ "split": "train", "index": 76224, "acecode_id": "evol_23357", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given the head of a singly linked list, implement a function `hasCycle(head)` that determines whether the linked list has a cycle in it. A cycle occurs when a node's next pointer points back to a previous node in the list. If there is a cycle, return True; otherwise, return Fal...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert hasCycle(None) == False\", \"assert hasCycle(Node(1)) == False\", \"assert hasCycle(Node(1, Node(2))) == False\", \"assert hasCycle(Node(1, Node(2, Node(3)))) == False\"]}" }
{ "split": "train", "index": 76225, "acecode_id": "evol_4341", "num_tests": 4 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the transcription of audio files. The function should take in a file path, a provider name, and an access token, and return a simulated transcribed text based on the provider. The function signature should be: `def transcri...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transcribe_audio('audio1.wav', 'REV', 'token123') == 'Transcribed from audio1.wav using REV with token token123'\", \"assert transcribe_audio('audio2.mp3', 'GOOGLE', 'token456') == 'Transcribed from audio2.mp3 using GOOGLE with token token456'\", \"assert tr...
{ "split": "train", "index": 76226, "acecode_id": "oss_11938", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that receives a list of integers representing account balances and a boolean indicating whether a report should be sent. Your function should return a list of strings: for each account balance, if the balance is greater than zero, return ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert audit_accounts([100, 0, -50], False) == ['Active', 'Inactive', 'Overdrawn']\", \"assert audit_accounts([-10, -20, -30], True) == ['Overdrawn', 'Overdrawn', 'Overdrawn']\", \"assert audit_accounts([0, 0, 0], False) == ['Inactive', 'Inactive', 'Inactive']\", \...
{ "split": "train", "index": 76227, "acecode_id": "bigcode_python_fns_26996", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of integers and performs a specific transformation on the data. The function should take in a list of integers and return a modified list based on the following rules: 1. If the input list is empty, the functi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transform_list([]) == []\", \"assert transform_list([5]) == [25]\", \"assert transform_list([1]) == [1]\", \"assert transform_list([0]) == [0]\", \"assert transform_list([-1]) == [1]\", \"assert transform_list([1, 2]) == [3, 3]\", \"assert transform_list([2,...
{ "split": "train", "index": 76228, "acecode_id": "oss_3852", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a command execution system that can rerun a series of commands based on provided parameters. Implement a function `simulate_rerun(dry_run: bool, sources: List[str], paths: List[str], provider: str, config: Dict[str, str]) -> Union[None, List[str]]...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_rerun(True, ['fileA.txt'], ['pathX'], 'provider2', {'key2': 'value2'}) == ['Activity: fileA.txt, Modified Input: pathX']\", \"assert simulate_rerun(False, ['file1.txt'], ['path1'], 'provider1', {'key1': 'value1'}) == None\", \"assert simulate_rerun(...
{ "split": "train", "index": 76229, "acecode_id": "bigcode_python_fns_41458", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a Python function that searches for all occurrences of a specified regex pattern within a given text string. The function should return a list of tuples, where each tuple contains the matching substring and its starting and ending indices in the format (match, (start,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert pattern_search('abc123xyz', '\\\\d+') == [('123', (3, 6))]\", \"assert pattern_search('hello world', 'o') == [('o', (4, 5)), ('o', (7, 8))]\", \"assert pattern_search('no matches here', '\\\\d+') == []\", \"assert pattern_search('abcabcabc', 'abc') == [('abc...
{ "split": "train", "index": 76230, "acecode_id": "evol_22390", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists, `seed` and `mask`, both containing non-negative integers. Your task is to implement a function that reconstructs a new list by applying a specific rule. For each element in `seed`, if the corresponding element in `mask` is greater than the element in `s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reconstruction([0, 0, 0], [0, 0, 0]) == [0, 0, 0]\", \"assert reconstruction([1, 1, 1], [1, 1, 1]) == [1, 1, 1]\", \"assert reconstruction([10, 20, 30], [30, 20, 10]) == [10, 10, 10]\", \"assert reconstruction([0, 1, 2, 3], [1, 2, 3, 4]) == [0, 1, 2, 3]\", \...
{ "split": "train", "index": 76231, "acecode_id": "bigcode_python_fns_44741", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Implement a function `predict_next_value(sequence: List[int]) -> int` that takes a list of integers representing a numerical sequence and predicts the next integer in the sequence based on a simple linear regression model. The input list will always contain at least two integer...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert predict_next_value([1, 2, 3, 4]) == 5\", \"assert predict_next_value([10, 20, 30]) == 40\", \"assert predict_next_value([5, 7, 9]) == 11\", \"assert predict_next_value([-1, 0, 1]) == 2\", \"assert predict_next_value([2, 4, 6]) == 8\", \"assert predict_next_v...
{ "split": "train", "index": 76232, "acecode_id": "evol_17653", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of strings and returns a new list containing only the strings that do not include the substring 'moreover'.\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 filter_strings(['Nothing to see here', 'Just a simple string']) == ['Nothing to see here', 'Just a simple string']\", \"assert filter_strings(['First string', 'Second string', 'Third string']) == ['First string', 'Second string', 'Third string']\", \"assert ...
{ "split": "train", "index": 76233, "acecode_id": "evol_11012", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Implement a function `vowel_count(s: str) -> int` that counts the number of vowels in the input string. The function should count both uppercase and lowercase vowels (a, e, i, o, u) and ignore all other characters, including numbers and special characters. The function should r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert vowel_count('') == 0\", \"assert vowel_count('world') == 1\", \"assert vowel_count('Hello, World!') == 3\", \"assert vowel_count('aeiouAEIOU') == 10\", \"assert vowel_count('1234567890') == 0\", \"assert vowel_count('This is a test.') == 4\", \"assert vowel_...
{ "split": "train", "index": 76234, "acecode_id": "evol_27213", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with calculating performance metrics for a binary classification model. Implement a function `calculate_performance_metrics(data: List[Tuple[int, int]]) -> Tuple[int, int, int, int]` that takes a list of tuples, where each tuple contains two integers: `true` and ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_performance_metrics([(1, 1), (0, 0), (0, 1), (1, 0)]) == (1, 1, 1, 1)\", \"assert calculate_performance_metrics([(1, 1), (1, 1), (1, 1), (1, 1)]) == (4, 0, 0, 0)\", \"assert calculate_performance_metrics([(0, 0), (0, 0), (0, 0), (0, 0)]) == (0, 4, ...
{ "split": "train", "index": 76235, "acecode_id": "oss_25068", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing pixel values of a grayscale image (values ranging from 0 to 255). Write a function that takes this list as input and returns a new list where each pixel value is inverted. The inverted pixel value is calculated as 255 minus the orig...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert invert_grayscale_image([0, 0, 0]) == [255, 255, 255]\", \"assert invert_grayscale_image([255, 255, 255]) == [0, 0, 0]\", \"assert invert_grayscale_image([128, 128, 128]) == [127, 127, 127]\", \"assert invert_grayscale_image([0, 255]) == [255, 0]\", \"assert ...
{ "split": "train", "index": 76236, "acecode_id": "oss_29933", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a message parsing algorithm for a specific communication protocol. The protocol uses a custom message format where each message consists of a format identifier and the message data. Your goal is to extract and process individual messages from a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_messages('abcdefghij') == [('LongFormat', 'abcdefghij')]\", \"assert parse_messages('abc') == [('ShortFormat', 'abc')]\", \"assert parse_messages('') == []\", \"assert parse_messages('1234567890') == [('LongFormat', '1234567890')]\", \"assert parse_mes...
{ "split": "train", "index": 76237, "acecode_id": "oss_33961", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function called `add_one` that takes an integer as input and returns the input integer incremented by 1. Implement this function such that it correctly handles both positive and negative integers. Write a function that can be tested with vario...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_one(5) == 6\", \"assert add_one(-3) == -2\", \"assert add_one(0) == 1\", \"assert add_one(100) == 101\", \"assert add_one(-100) == -99\", \"assert add_one(999) == 1000\", \"assert add_one(-1) == 0\", \"assert add_one(1) == 2\", \"assert add_one(-50) == -...
{ "split": "train", "index": 76238, "acecode_id": "oss_36510", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function that receives a string, a list of characters, a list of integers representing their corresponding frequencies, and a boolean flag. The function should check whether each character from the list appears in the string exactly the number of times specified in the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_string('aabbcc', ['a', 'b', 'c'], [2, 2, 2], True) == True\", \"assert check_string('aabbc', ['a', 'b', 'c'], [2, 2, 1], True) == True\", \"assert check_string('abcabc', ['a', 'b', 'c'], [2, 2, 2], False) == True\", \"assert check_string('aabbcc', ['a'...
{ "split": "train", "index": 76239, "acecode_id": "evol_3297", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `if_else(cond: bool, a: int, b: int) -> int` that takes in a boolean condition `cond`, and two integers `a` and `b`. The function should return `a` if `cond` is True, and return `b` if `cond` is False. Implement the function without using any external resources...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert if_else(True, 5, 10) == 5\", \"assert if_else(False, 5, 10) == 10\", \"assert if_else(True, -1, 0) == -1\", \"assert if_else(False, -1, 0) == 0\", \"assert if_else(True, 100, 200) == 100\", \"assert if_else(False, 100, 200) == 200\", \"assert if_else(True, 0...
{ "split": "train", "index": 76240, "acecode_id": "bigcode_python_fns_6122", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `is_monotone_increase` that takes a list of integers as input and returns `True` if the list is monotonically increasing, meaning each element is greater than or equal to the previous one. Otherwise, return `False`. A list is considered monotonically increa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_monotone_increase([1, 2, 3, 4, 5]) == True\", \"assert is_monotone_increase([5, 5, 5, 5]) == True\", \"assert is_monotone_increase([1, 2, 2, 3]) == True\", \"assert is_monotone_increase([1, 3, 3, 7]) == True\", \"assert is_monotone_increase([]) == True\",...
{ "split": "train", "index": 76241, "acecode_id": "oss_18311", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a 2D list (matrix) of integers where each row represents a sequence of numbers. Your task is to implement a function that shifts each row of the matrix to the right by one position. The first element of each row should be replaced with a zero, and the last element...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert shift_right([[1, 2, 3], [4, 5, 6]]) == [[0, 1, 2], [0, 4, 5]]\", \"assert shift_right([[0, 0, 0], [1, 2, 3]]) == [[0, 0, 0], [0, 1, 2]]\", \"assert shift_right([[1], [2]]) == [[0], [0]]\", \"assert shift_right([]) == []\", \"assert shift_right([[5, 10, 15]])...
{ "split": "train", "index": 76242, "acecode_id": "bigcode_python_fns_4633", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that reverses the order of a given list of integers using recursion, without using any built-in functions or auxiliary data structures. Your function should be able to handle very large lists efficiently. Edge cases to consider include empty lists and singl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse([]) == []\", \"assert reverse([1]) == [1]\", \"assert reverse([1, 2]) == [2, 1]\", \"assert reverse([1, 2, 3]) == [3, 2, 1]\", \"assert reverse([4, 5, 6, 7, 8]) == [8, 7, 6, 5, 4]\", \"assert reverse([10, 20, 30, 40, 50]) == [50, 40, 30, 20, 10]\", \...
{ "split": "train", "index": 76243, "acecode_id": "evol_33089", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of predicted class indices and a list of actual class indices for a batch of samples. Your task is to implement a function `compute_accuracy(predictions: List[int], targets: List[int], top_k: List[int]) -> List[float]` that computes the accuracy of the pred...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_accuracy([1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 3]) == [100.0, 100.0]\", \"assert compute_accuracy([1, 2, 3, 4, 5], [5, 4, 3, 2, 1], [1]) == [20.0]\", \"assert compute_accuracy([1, 1, 1, 1], [1, 1, 1, 1], [1]) == [100.0]\", \"assert compute_accuracy([...
{ "split": "train", "index": 76244, "acecode_id": "bigcode_python_fns_26635", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function `get_primes_descending(n)` that takes an integer n as input and returns a list of all prime numbers between 1 and n in descending order. A prime number is defined as a natural number greater than 1 that cannot be formed by multiplying two smaller natural nu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_primes_descending(50) == [47, 43, 41, 37, 31, 29, 23, 19, 17, 13, 11, 7, 5, 3, 2]\", \"assert get_primes_descending(1) == []\", \"assert get_primes_descending(10) == [7, 5, 3, 2]\", \"assert get_primes_descending(2) == [2]\", \"assert get_primes_descendi...
{ "split": "train", "index": 76245, "acecode_id": "evol_19901", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of activities where each activity is represented by a dictionary containing 'category' and 'duration', implement a function that sums the durations of activities by their categories. The function should take a list of activities as input and return a dictionary tha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_category_hours([{'category': 'work', 'duration': 3}, {'category': 'exercise', 'duration': 2}, {'category': 'work', 'duration': 5}]) == {'work': 8, 'exercise': 2}\", \"assert sum_category_hours([{'category': 'study', 'duration': 4}, {'category': 'study', ...
{ "split": "train", "index": 76246, "acecode_id": "bigcode_python_fns_44669", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a user management system in an ORM (Object-Relational Mapping). The function should take in a list of user data represented as tuples, where each tuple contains a username (string), an email (string), and an active status (...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_users([('john_doe', 'john@example.com', True)], [('update_email', 'john_doe', 'john_new@example.com')]) == [{'username': 'john_doe', 'email': 'john_new@example.com', 'is_active': True}]\", \"assert manage_users([('john_doe', 'john@example.com', True)]...
{ "split": "train", "index": 76247, "acecode_id": "oss_35501", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given two strings, `s1` and `s2`, write a function `label_presence(s1: str, s2: str, label: str) -> float` that returns 1.0 if the presence of the substring `label` is the same in both strings (i.e., either both contain the substring or both do not contain it). Otherwise, retur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert label_presence('hello world', 'hello there', 'world') == 0.0\", \"assert label_presence('foo bar', 'foo bar', 'foo') == 1.0\", \"assert label_presence('test case', 'test case', 'case') == 1.0\", \"assert label_presence('example', 'sample', 'ex') == 0.0\", \"...
{ "split": "train", "index": 76248, "acecode_id": "bigcode_python_fns_33385", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are working on a network packet processing system that involves handling various events related to packet transmission and reception. Your task is to implement a function `check_event_rules(events)` that takes a list of events and returns True if the events adhere to the fo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_event_rules([{'event_type': 'snd', 'packet': 'packet1', 'dport': 80, 'sport': 1024, 'origin': 'A', 'src_P': 'process1', 'dst_P': 'process2'}]) == True\", \"assert check_event_rules([{'event_type': 'snd', 'packet': 'packet1', 'dport': 80, 'sport': 1024,...
{ "split": "train", "index": 76249, "acecode_id": "oss_12240", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are given a string that represents a sequence of prices or volumes, and an integer representing the number of levels. Your task is to generate a list of indices for 'prices' or 'volumes' based on the input. If the input type is 'prices', the indices should be formulated as ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_order_book_indices('prices', 3) == ['askprc.3', 'askprc.2', 'askprc.1', 'bidprc.1', 'bidprc.2', 'bidprc.3']\", \"assert generate_order_book_indices('volumes', 2) == ['askvol.2', 'askvol.1', 'bidvol.1', 'bidvol.2']\", \"assert generate_order_book_ind...
{ "split": "train", "index": 76250, "acecode_id": "bigcode_python_fns_33910", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks if a given password is valid based on specific criteria. A password is considered valid if it contains at least one uppercase letter, one lowercase letter, one digit, and one special character (such as !@#$%^&*). Additionally,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_password('Password1!') == True\", \"assert is_valid_password('pass') == False\", \"assert is_valid_password('PASSWORD123') == False\", \"assert is_valid_password('password123') == False\", \"assert is_valid_password('Pass123') == False\", \"assert i...
{ "split": "train", "index": 76251, "acecode_id": "bigcode_python_fns_26171", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of application command interaction data options, represented by different classes: `_ApplicationCommandInteractionDataOptionString`, `_ApplicationCommandInteractionDataOptionInteger`, `_ApplicationCommandInteractionDataOptionSubcommand`, and `_ApplicationCo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_interaction_data_options([]) == {'String': 0, 'Integer': 0, 'Subcommand': 0, 'Boolean': 0}\", \"assert count_interaction_data_options([_ApplicationCommandInteractionDataOptionString()]) == {'String': 1, 'Integer': 0, 'Subcommand': 0, 'Boolean': 0}\", \...
{ "split": "train", "index": 76252, "acecode_id": "oss_19651", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `are_anagrams(lexeme_collection)` that takes a list of strings called `lexeme_collection` and returns `True` if all the strings in the list are anagrams of each other, and `False` otherwise. An anagram is defined as a word formed by rearranging the letters of a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert are_anagrams(['listen', 'silent', 'enlist']) == True\", \"assert are_anagrams(['hello', 'world']) == False\", \"assert are_anagrams(['race', 'care', 'acer']) == True\", \"assert are_anagrams(['python', 'typhon']) == True\", \"assert are_anagrams(['apple', 'p...
{ "split": "train", "index": 76253, "acecode_id": "evol_34713", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with validating a software version based on a predefined list of supported versions. Implement a function `validate_version_argument(version: str, hint: int) -> str` that takes a requested version and a hint for the major revision. If the requested version is in ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_version_argument('2.14', 4) == '2.14'\", \"assert validate_version_argument('5.0', 3) == '5.0'\", \"assert validate_version_argument('3.30', 2) == '3.30'\", \"assert validate_version_argument('4.20', 2) == '4.20'\", \"assert validate_version_argumen...
{ "split": "train", "index": 76254, "acecode_id": "bigcode_python_fns_15452", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates displaying a leaderboard for a gaming competition. The leaderboard is represented as a list of tuples, where each tuple contains a player's name and their score. Your function should return a list of strings that represent ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert display_leaderboard([('Player1', 1500), ('Player2', 1200), ('Player3', 1800)]) == ['1\\u00ba place: Player3 with 1800 points!', '2\\u00ba place: Player1 with 1500 points!', '3\\u00ba place: Player2 with 1200 points!']\", \"assert display_leaderboard([('Alice...
{ "split": "train", "index": 76255, "acecode_id": "oss_2836", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries representing diff files. Each dictionary contains the following keys: 'filediff', 'interfilediff', 'force_interdiff', and an optional 'base_filediff'. Your task is to implement a function `populate_diff_chunks(files: List[Dict[str, Any]], en...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert populate_diff_chunks([{'filediff': 'a', 'interfilediff': 'b', 'force_interdiff': True, 'base_filediff': None}]) == None\", \"assert populate_diff_chunks([{'filediff': 'x', 'interfilediff': 'y', 'force_interdiff': False, 'base_filediff': 'z'}]) == None\", \"a...
{ "split": "train", "index": 76256, "acecode_id": "bigcode_python_fns_28936", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing a filename and a dictionary containing data. Your task is to create a function that simulates writing the dictionary to a JSON file. The function should return a dictionary that contains the filename as a key and the dictionary data as its va...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert write_json_to_dict('data.json', {'key1': 'value1', 'key2': 'value2'}) == {'data.json': {'key1': 'value1', 'key2': 'value2'}}\", \"assert write_json_to_dict('empty.json', {}) == {'empty.json': {}}\", \"assert write_json_to_dict('test.json', {'a': 1, 'b': 2, '...
{ "split": "train", "index": 76257, "acecode_id": "bigcode_python_fns_7434", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a Python function that computes the Fibonacci number for a given non-negative integer n using recursion. The function should return the nth Fibonacci number, where the Fibonacci series is defined as follows: F(0) = 0, F(1) = 1, and F(n) = F(n-1) + F(n-2) for n > 1. The f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fib(0) == 0\", \"assert fib(1) == 1\", \"assert fib(2) == 1\", \"assert fib(3) == 2\", \"assert fib(4) == 3\", \"assert fib(5) == 5\", \"assert fib(6) == 8\", \"assert fib(7) == 13\", \"assert fib(8) == 21\", \"assert fib(9) == 34\", \"assert fib(10) == 55\"...
{ "split": "train", "index": 76258, "acecode_id": "evol_25505", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two lists: a list of tempos `f_tempo` representing beats per minute (BPM) at specific time points and a list of time points `t_beat`, write a function `calculate_average_tempo(f_tempo, t_beat)` that calculates the average tempo over the provided time points. The average t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average_tempo([120, 130, 140], [0, 1, 2]) == 130.0\", \"assert calculate_average_tempo([100, 100, 100, 100], [0, 1, 2, 3]) == 100.0\", \"assert calculate_average_tempo([60, 70, 80, 90], [0, 1, 2, 3]) == 75.0\", \"assert calculate_average_tempo([150...
{ "split": "train", "index": 76259, "acecode_id": "bigcode_python_fns_22302", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a function `target_select(data, key)` that takes a list of dictionaries and a string as input. Your task is to extract the values associated with the specified key from each dictionary in the list and return these values in a new list. If the key does not exist in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert target_select([{'name': 'Alice', 'age': 25}, {'name': 'Bob', 'age': 30}, {'name': 'Charlie', 'age': 28}], 'name') == ['Alice', 'Bob', 'Charlie']\", \"assert target_select([{'name': 'Alice', 'age': 25}, {'age': 30}, {'name': 'Charlie'}], 'name') == ['Alice', ...
{ "split": "train", "index": 76260, "acecode_id": "oss_15723", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a list of strings representing file names and a target string representing a file name to search for. The function should return the index of the target file name in the list if it exists, otherwise return -1. The search sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_file_index(['document.txt', 'image.png', 'video.mp4'], 'image.png') == 1\", \"assert find_file_index(['document.txt', 'image.png', 'video.mp4'], 'document.txt') == 0\", \"assert find_file_index(['document.txt', 'image.png', 'video.mp4'], 'video.mp4') ==...
{ "split": "train", "index": 76261, "acecode_id": "bigcode_python_fns_2756", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer `element` representing an element ID and a tuple `vector` representing a 3D point (x, y, z), implement a function that returns the element ID if the z-coordinate of the vector is greater than 1000. Otherwise, return -1. The function signature is `def extrude_su...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extrude_surface_to_beam_vector(1, (0, 0, 1200)) == 1\", \"assert extrude_surface_to_beam_vector(2, (1, 2, 800)) == -1\", \"assert extrude_surface_to_beam_vector(3, (0, 0, 1001)) == 3\", \"assert extrude_surface_to_beam_vector(4, (5, 5, 999)) == -1\", \"asser...
{ "split": "train", "index": 76262, "acecode_id": "bigcode_python_fns_48112", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string representing a filesystem path, implement a function that removes all trailing empty segments from the path. A segment is considered empty if it is defined by two consecutive slashes ('//'). The function should return the cleaned path. For example, if the input i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_trailing_empty_segments('/duck///') == '/duck'\", \"assert remove_trailing_empty_segments('/cat//') == '/cat'\", \"assert remove_trailing_empty_segments('/a/b/c/') == '/a/b/c'\", \"assert remove_trailing_empty_segments('/foo/bar') == '/foo/bar'\", \"a...
{ "split": "train", "index": 76263, "acecode_id": "bigcode_python_fns_10990", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with analyzing a series of experiments logged in a list. Each experiment is represented as a tuple containing four elements: the package name (a string), the time of the experiment (an integer), the test case identifier (a string), and the log folder (a string). ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert analyze_experiments([('packageA', 123, 'test1', '/logs/folder1'), ('packageB', 456, 'test2', '/logs/folder2')]) == ['Package: packageA, Time: 123, Test Case: test1, Log Folder: /logs/folder1', 'Package: packageB, Time: 456, Test Case: test2, Log Folder: /log...
{ "split": "train", "index": 76264, "acecode_id": "bigcode_python_fns_10053", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a list of objects and a specific channel. Your task is to implement a function that determines whether a particular object can be read from that channel based on certain flags. The function should return True if the object can be read from the channel with the spe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_read_image(['image1', 'image2', 'image3'], 'image1', 0) == True\", \"assert can_read_image(['image1', 'image2', 'image3'], 'image4', 0) == False\", \"assert can_read_image(['image1', 'image2'], 'image2', 1) == True\", \"assert can_read_image(['image3', '...
{ "split": "train", "index": 76265, "acecode_id": "bigcode_python_fns_8038", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 2D list (matrix) of integers, write a function that returns the maximum integer value present in the matrix. The matrix is guaranteed to be non-empty and contains at least one integer.\nPlease reason step by step, then write a self-contained Python solution. Give your f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_max_value([[1, 12, -8], [21, -15, 2], [-5, 8, 16]]) == 21\", \"assert find_max_value([[0, 0], [0, 0]]) == 0\", \"assert find_max_value([[5]]) == 5\", \"assert find_max_value([[-1, -2, -3], [-4, -5, -6]]) == -1\", \"assert find_max_value([[1, 2, 3], [4, ...
{ "split": "train", "index": 76266, "acecode_id": "evol_8911", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a function that takes in a dictionary `data` and a list `per`. The `data` dictionary contains the following keys: 'x2' (a list of float values), 'flag' (a boolean value), 'idx1' (an integer), 'idx2' (an integer), 'ransacT' (a float value), 'ransacDelta' (a float v...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_value({'x2': [1.0, 2.0, 3.0], 'flag': True, 'idx1': 0, 'idx2': 1, 'ransacT': 2.0, 'ransacDelta': 0.5, 'fgrDelta': 0.5}, [0.1, 0.2, 0.3]) == 4.0\", \"assert calculate_value({'x2': [4.0, 5.0], 'flag': False, 'idx1': 2, 'idx2': 1, 'ransacT': 3.0, 'ran...
{ "split": "train", "index": 76267, "acecode_id": "oss_22149", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a string, ignoring all white spaces and punctuation, write a function that determines the least common character and its frequency. The input string can include alphanumeric characters. If multiple characters have the least frequency, return them all in a list along with ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert least_common_char('Hello World!!!') == (['h', 'e', 'w', 'r', 'd'], 1)\", \"assert least_common_char('') == ([], 0)\", \"assert least_common_char('aaaaaa') == (['a'], 6)\", \"assert least_common_char('AABBCC') == (['a', 'b', 'c'], 2)\", \"assert least_common_...
{ "split": "train", "index": 76268, "acecode_id": "evol_24093", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Write a function `f(k: int, λ: float) -> float` that calculates the cumulative distribution function (CDF) for a given integer value 'k' in a Poisson distribution with parameter λ. The function should return the cumulative probability up to 'k'. You can assume that 'k' is a non...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert f(0, 1) == 0.36787944117144233\", \"assert f(1, 1) == 0.7357588823428847\", \"assert f(0, 0) == 1.0\", \"assert f(1, 0) == 1.0\", \"assert f(2, 0) == 1.0\", \"assert f(3, 0) == 1.0\"]}" }
{ "split": "train", "index": 76269, "acecode_id": "evol_12414", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are given a configuration dictionary representing a manifest with potential recursive definitions. A recursive definition occurs when a key in the dictionary references another key that eventually leads back to itself. Your task is to implement a function `check_recursive_d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_recursive_definition({'manifest': { '$BASE': '/path/to/base', '$TMP': '/path/to/tmp' }}) == False\", \"assert check_recursive_definition({'manifest': { 'key1': 'value1', 'key2': 'value2' }}) == False\", \"assert check_recursive_definition({'manifest': ...
{ "split": "train", "index": 76270, "acecode_id": "bigcode_python_fns_37166", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Given a list of file paths, you need to determine if each file path is valid or not. A valid file path is defined as a string that starts with a '/' and contains only alphanumeric characters, underscores, hyphens, and forward slashes. Write a function `validate_file_paths(file_...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_file_paths(['/valid/path', '/invalid/path!', '/another/valid_path']) == [True, False, True]\", \"assert validate_file_paths(['/valid/path/', '/another-valid/path', '/valid_path_123']) == [True, True, True]\", \"assert validate_file_paths(['/invalid ...
{ "split": "train", "index": 76271, "acecode_id": "bigcode_python_fns_28673", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `bubble_sort(arr: List[int]) -> List[int]` that sorts an array of integers in ascending order using the bubble sort algorithm. The function should take a list of integers as input and return a new list containing the sorted integers.\nPlease reason step by ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bubble_sort([64, 34, 25, 12, 22, 11, 90]) == [11, 12, 22, 25, 34, 64, 90]\", \"assert bubble_sort([5, 1, 4, 2, 8]) == [1, 2, 4, 5, 8]\", \"assert bubble_sort([]) == []\", \"assert bubble_sort([3]) == [3]\", \"assert bubble_sort([2, 1]) == [1, 2]\", \"assert ...
{ "split": "train", "index": 76272, "acecode_id": "evol_21790", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that constructs a transaction request for a financial system. The function should be able to create a transaction request with specific details such as the transaction amount, recipient, and any additional notes. The function should a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_transaction_request(100, 'RecipientName', 'Payment for services') == 'Transaction request submitted successfully'\", \"assert create_transaction_request(0, 'RecipientName', 'Payment for services') == 'Invalid transaction request'\", \"assert create_tr...
{ "split": "train", "index": 76273, "acecode_id": "oss_23417", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing file names in a directory. Each file name may have a file extension. Write a function `filter_python_files(filenames: List[str]) -> List[str]` that filters and returns a list of all the Python file names (those that end with '.py') f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_python_files(['script.py', 'image.png', 'README.md', 'app.py']) == ['script', 'app']\", \"assert filter_python_files(['test.txt', 'example.py', 'document.pdf']) == ['example']\", \"assert filter_python_files(['notes.py', 'notes.txt', 'folder']) == ['n...
{ "split": "train", "index": 76274, "acecode_id": "bigcode_python_fns_36798", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two images represented as 2D lists of integers, where each integer represents a pixel value. Your task is to overlay one image on top of another using a specified opacity value. The opacity value (alpha) is a float between 0 and 1, where 0 means the overlay is com...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert overlay_images([[0, 0], [0, 0]], [[255, 255], [255, 255]], 0.5) == [[127, 127], [127, 127]]\", \"assert overlay_images([[100, 150], [200, 250]], [[50, 50], [50, 50]], 1) == [[50, 50], [50, 50]]\", \"assert overlay_images([[100, 150], [200, 250]], [[50, 50], ...
{ "split": "train", "index": 76275, "acecode_id": "bigcode_python_fns_31143", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Implement a function that takes two boolean values, a and b, and returns the result of the XNOR operation using only three NOR logical gates. You should define a helper function to implement the NOR operation.\nPlease reason step by step, then write a self-contained Python solu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert XNOR(True, True) == True\", \"assert XNOR(False, True) == False\", \"assert XNOR(True, True) == True\", \"assert XNOR(False, True) == False\", \"assert XNOR(True, True) == True\", \"assert XNOR(False, True) == False\", \"assert XNOR(True, True) == True\", \"...
{ "split": "train", "index": 76276, "acecode_id": "evol_33448", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that summarizes a given text input. The function should accept two parameters: a string `text` representing the content to be summarized, and an integer `length` specifying the desired length of the summary. The function should return a s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert summarize_text('Hello world!', 5) == 'Hello'\", \"assert summarize_text('', 10) == ''\", \"assert summarize_text('Short text.', 20) == 'Short text.'\", \"assert summarize_text('The quick brown fox jumps over the lazy dog.', 15) == 'The quick brown'\", \"asse...
{ "split": "train", "index": 76277, "acecode_id": "oss_17996", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a string that contains arbitrary characters and integers, implement a function that extracts all the integer values from the string and returns their summation. It is guaranteed that the input string will contain at least one integer, and these integers may consist of mul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_and_sum('abc12de34fg5') == 51\", \"assert extract_and_sum('1a2b3c') == 6\", \"assert extract_and_sum('no numbers here!') == 0\", \"assert extract_and_sum('100 apples and 200 oranges') == 300\", \"assert extract_and_sum('abc123') == 123\", \"assert ex...
{ "split": "train", "index": 76278, "acecode_id": "evol_35513", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with counting the occurrences of specific words in a given text. The input is a string of text and a list of common stop words. Your program should tokenize the words from the input text, count the occurrences of each word, and exclude any words that appear in th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_words('The quick brown fox jumps over the lazy dog.', ['the', 'over']) == {'brown': 1, 'dog': 1, 'fox': 1, 'jumps': 1, 'lazy': 1, 'quick': 1}\", \"assert count_words('Hello world hello', ['hello']) == {'world': 1}\", \"assert count_words('Python is gre...
{ "split": "train", "index": 76279, "acecode_id": "oss_34042", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function `check_for_repeated_tuples(matrix)` that takes a two-dimensional list of tuples as input and returns `True` if there are any duplicated tuples in the matrix, and `False` otherwise. The matrix will be represented as a list of lists, where each inner list con...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_for_repeated_tuples([[(1, 2), (3, 4)], [(5, 6), (7, 8)], [(1, 2), (9, 10)]]) == True\", \"assert check_for_repeated_tuples([[(1, 2), (3, 4)], [(5, 6), (7, 8)], [(11, 12), (9, 10)]]) == False\", \"assert check_for_repeated_tuples([[(1, 1), (2, 2)], [(3,...
{ "split": "train", "index": 76280, "acecode_id": "evol_31413", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `fibonacci(n: int) -> int` that returns the Fibonacci number at the nth position, where the Fibonacci sequence is defined as follows: F(1) = 0, F(2) = 1, and F(n) = F(n-1) + F(n-2) for n > 2. The function should handle cases where n is less than or equal to...
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": 76281, "acecode_id": "evol_28914", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that counts the frequency of each word from a given list of words and outputs the word along with its frequency in descending order of frequency. The input to the function is a list of strings, where each string represents a word. The out...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert word_frequency(['apple', 'banana', 'apple', 'orange', 'banana', 'banana']) == [('banana', 3), ('apple', 2), ('orange', 1)]\", \"assert word_frequency(['hello', 'world', 'hello', 'hello', 'world', 'test']) == [('hello', 3), ('world', 2), ('test', 1)]\", \"ass...
{ "split": "train", "index": 76282, "acecode_id": "oss_28858", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a JSON object representing a notebook, which contains various cells. Each cell can be of type 'code' and has outputs that include text lines. Your task is to implement a function that takes a notebook JSON object and a project root string. The function should stri...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert strip_project_paths({'cells':[{'cell_type':'code', 'outputs':[{'text':['/home/user/project/file1.py', '/home/user/project/file2.py']}]},{'cell_type':'markdown', 'outputs':[]}]}, '/home/user/project/') == ({'cells':[{'cell_type':'code', 'outputs':[{'text':['f...
{ "split": "train", "index": 76283, "acecode_id": "bigcode_python_fns_27623", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a simple service management utility. The function should accept a single string argument representing an action to be performed on the service. The valid actions are 'start', 'stop', 'restart', and 'status'. If an invalid a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert service_action('start') == 'Starting the service...'\", \"assert service_action('stop') == 'Stopping the service...'\", \"assert service_action('restart') == 'Restarting the service...'\", \"assert service_action('status') == 'Checking the status of the serv...
{ "split": "train", "index": 76284, "acecode_id": "oss_37210", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two lists of integers where each list represents the digits of two non-negative integers in reverse order, implement a function that multiplies the two integers and returns the result. Each list's digits are stored as individual elements in the order of least significant ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert multiply_two_numbers([3, 2, 1], [6, 7, 8]) == 123 * 876\", \"assert multiply_two_numbers([0], [1]) == 0\", \"assert multiply_two_numbers([1], [0]) == 0\", \"assert multiply_two_numbers([4, 3, 2, 1], [1, 2, 3, 4]) == 1234 * 4321\", \"assert multiply_two_numbe...
{ "split": "train", "index": 76285, "acecode_id": "evol_4303", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function to format a 10-digit phone number into the format '(XXX) XXX-XXXX'. The function should take a string representing the phone number as input and return the formatted string. If the input is not exactly 10 digits long or contains non-digit characters, return 'I...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_phone_number('2025550141') == '(202) 555-0141'\", \"assert format_phone_number('1234567890') == '(123) 456-7890'\", \"assert format_phone_number('9876543210') == '(987) 654-3210'\", \"assert format_phone_number('0000000000') == '(000) 000-0000'\", \"a...
{ "split": "train", "index": 76286, "acecode_id": "evol_35015", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the scores of a group of students. Your task is to implement a function `calculate_average_score(scores: List[int]) -> float` that calculates the average score of the students. If the list is empty, the function should return 0.0. T...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average_score([90, 80, 70]) == 80.0\", \"assert calculate_average_score([100, 90]) == 95.0\", \"assert calculate_average_score([50]) == 50.0\", \"assert calculate_average_score([]) == 0.0\", \"assert calculate_average_score([60, 70, 80, 90]) == 75....
{ "split": "train", "index": 76287, "acecode_id": "oss_11398", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes in a list of integers and a target integer. The function should return a list of all unique pairs of integers from the input list that sum up to the target integer. Each pair should be represented as a tuple of integers, and th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_pairs([1, 2, 3, 4, 3], 6) == [(2, 4), (3, 3)]\", \"assert find_pairs([0, -1, 2, -3, 1], -2) == [(-3, 1)]\", \"assert find_pairs([], 5) == []\", \"assert find_pairs([1, 2, 3], 7) == []\", \"assert find_pairs([1, 1, 1, 1], 2) == [(1, 1)]\", \"assert find_...
{ "split": "train", "index": 76288, "acecode_id": "oss_12175", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with managing access control for various clients. Implement a function `process_clients` that takes a list of client names as input and returns a set of allowed clients after applying the following operations: 1. If the client name contains a forward slash ('/'),...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_clients(['client1', 'client2/subclient', 'client3', 'client4/subclient']) == {'modified_client2:*', 'client1:*', 'client3:*', 'modified_client4:*'}\", \"assert process_clients(['client2', 'client4']) == {'modified_client2:*', 'modified_client4:*'}\",...
{ "split": "train", "index": 76289, "acecode_id": "oss_36319", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of 3D curve types represented as strings, write a function that checks if each curve type is valid. The valid curve types are: 'line', 'circle', 'ellipse', 'hyperbola', 'parabola', 'Bezier curve', and 'BSpline curve'. The function should return a list of booleans w...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_curve_types(['line', 'circle', 'triangle']) == [True, True, False]\", \"assert check_curve_types(['ellipse', 'hyperbola', 'square']) == [True, True, False]\", \"assert check_curve_types(['parabola', 'Bezier curve', 'octagon']) == [True, True, False]\",...
{ "split": "train", "index": 76290, "acecode_id": "bigcode_python_fns_13627", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the behavior of a four-legged robotic cat. The function should be able to create a robotic cat, turn it on, perform various movements (walk, run, sit, jump), interact with a human, check its status, and then turn it off...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_robotic_cat('Fluffy') == 'Fluffy is now on. Fluffy performed movements: walk, run, sit, jump. Fluffy interacted with a human. Status checked. Fluffy is now off.'\", \"assert simulate_robotic_cat('Whiskers') == 'Whiskers is now on. Whiskers performed...
{ "split": "train", "index": 76291, "acecode_id": "evol_28753", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of tasks, where each task is represented as a tuple containing a string (the task name) and an integer (the task's priority). Your task is to implement a function that takes the following inputs: a list of tasks and an integer K. The function should return ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert top_k_tasks([('Task1', 5), ('Task2', 3), ('Task3', 8)], 2) == [('Task3', 8), ('Task1', 5)]\", \"assert top_k_tasks([('TaskA', 10), ('TaskB', 15)], 1) == [('TaskB', 15)]\", \"assert top_k_tasks([('TaskX', 1), ('TaskY', 2)], 5) == [('TaskY', 2), ('TaskX', 1)]\...
{ "split": "train", "index": 76292, "acecode_id": "oss_18033", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of coordinates and the shape of a map defined by its dimensions (rows and columns). Write a function that determines whether each coordinate is within the bounds of the map. A coordinate is represented as a list of two integers [x, y], where x is the row in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_coords_in_bounds([[0, 0], [1, 1]], (2, 2)) == [True, True]\", \"assert check_coords_in_bounds([[2, 2], [1, 1]], (2, 2)) == [False, True]\", \"assert check_coords_in_bounds([[0, -1], [1, 1]], (2, 2)) == [False, True]\", \"assert check_coords_in_bounds([...
{ "split": "train", "index": 76293, "acecode_id": "bigcode_python_fns_9766", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a nested array that can contain integers, floats, complex numbers, None, and booleans, write a function `find_min_disparity(arr)` that returns the minimum disparity between any two valid numeric values in the flattened version of the array. The disparity between two numbe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_min_disparity([[], [], []]) == 'Input array is empty or contains only one valid numeric value'\", \"assert find_min_disparity([None, None]) == 'Input array is empty or contains only one valid numeric value'\", \"assert find_min_disparity([[None, None], ...
{ "split": "train", "index": 76294, "acecode_id": "evol_29146", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a 2D list of integers representing a heatmap. Your task is to create a function that annotates the heatmap with the values from the list, formatting them according to a specified format string. Additionally, the text color for each annotation should depend on whet...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert annotate_heatmap([[1, 2], [3, 4]], 2, '{x}') == ['white', 'black', 'black', 'black']\", \"assert annotate_heatmap([[10, 20], [30, 40]], 25, '{x}') == ['white', 'white', 'black', 'black']\", \"assert annotate_heatmap([[5, 15, 25], [35, 45, 55]], 30, '{x:.2f}'...
{ "split": "train", "index": 76295, "acecode_id": "bigcode_python_fns_49092", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer n, generate a square matrix of size n x n filled with consecutive numbers in a spiral order, starting from the top-left corner and moving right initially. If you reach a cell that is already filled or out of bounds, change direction to the right. Implement a fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generateSpiralMatrix(1) == [[1]]\", \"assert generateSpiralMatrix(2) == [[1, 2], [4, 3]]\", \"assert generateSpiralMatrix(3) == [[1, 2, 3], [8, 9, 4], [7, 6, 5]]\", \"assert generateSpiralMatrix(4) == [[1, 2, 3, 4], [12, 13, 14, 5], [11, 16, 15, 6], [10, 9, ...
{ "split": "train", "index": 76296, "acecode_id": "oss_30092", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Implement a function that multiplies two numbers. If either of the inputs is not a number (i.e., not an instance of int or float), the function should return the string 'Not a number'.\nPlease reason step by step, then write a self-contained Python solution. Give your final pro...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert multiply(10, 5) == 50\", \"assert multiply(0, 5) == 0\", \"assert multiply(-2, 3) == -6\", \"assert multiply(2.5, 4) == 10.0\", \"assert multiply(7, -3.5) == -24.5\", \"assert multiply('a', 5) == 'Not a number'\", \"assert multiply(10, 'b') == 'Not a number'...
{ "split": "train", "index": 76297, "acecode_id": "evol_1442", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `findMedian(nums: List[int]) -> float` that takes a list of integers `nums` and returns the median of the numbers in the list. The function should handle both odd and even numbers of elements in the list. If the list is empty, return 0.0. The median should ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert findMedian([1, 2, 3]) == 2.0\", \"assert findMedian([1, 2, 3, 4]) == 2.5\", \"assert findMedian([5, 3, 1, 2, 4]) == 3.0\", \"assert findMedian([1]) == 1.0\", \"assert findMedian([]) == 0.0\", \"assert findMedian([1, 1, 1, 1]) == 1.0\", \"assert findMedian([1...
{ "split": "train", "index": 76298, "acecode_id": "evol_18184", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the total fantasy football points scored by players based on their weekly performance. The scoring rules are as follows: Each passing yard by a quarterback (QB) is worth 0.04 points, each passing touchdown by a QB is worth 4 points, each rushing ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_points(0, 0, 0, 0, 0, 0) == 0.0\", \"assert calculate_points(0, 0, 0, 1, 0, 0) == 6.0\", \"assert calculate_points(0, 1, 0, 0, 0, 0) == 4.0\", \"assert calculate_points(0, 0, 0, 0, 0, 3) == 18.0\", \"assert calculate_points(0, 2, 0, 0, 0, 0) == 8.0...
{ "split": "train", "index": 76299, "acecode_id": "oss_35001", "num_tests": 5 }