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 given a string representing a Content-Type header, which specifies the media type of the resource. Your task is to implement a function `parse(content_type: str) -> str` that returns a human-readable description of the media type. The function should extract the type an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse('text/html') == 'Type: text, Subtype: html'\", \"assert parse('application/json') == 'Type: application, Subtype: json'\", \"assert parse('image/png') == 'Type: image, Subtype: png'\", \"assert parse('audio/mpeg') == 'Type: audio, Subtype: mpeg'\", \"a...
{ "split": "train", "index": 700, "acecode_id": "bigcode_python_fns_42955", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of floating-point numbers, write a function `find_modal_value(lst)` that returns the most frequently occurring float (modal value) from the provided list. If there are multiple values with the same frequency, return the one that appears first in the list.\nPlease r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_modal_value([1.1, 2.2, 3.3, 2.2, 4.4]) == 2.2\", \"assert find_modal_value([1.5, 2.5, 1.5, 3.5, 2.5, 1.5]) == 1.5\", \"assert find_modal_value([4.0, 4.0, 5.0, 5.0, 6.0]) == 4.0\", \"assert find_modal_value([10.1, 10.2, 10.1, 10.3, 10.2]) == 10.1\", \"as...
{ "split": "train", "index": 701, "acecode_id": "evol_20276", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that verifies the authenticity of a mathematical notation represented as a string. The function should check if the parentheses are well-balanced and if the mathematical operations are in the correct order, meaning no two consecutive operations are allowed....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_math_notation('((8/4)*3+(3-2))') == 'Correct'\", \"assert check_math_notation('((8/4)*3+(3-2)') == 'Unbalanced'\", \"assert check_math_notation('((8/4)*3+(3-2))') == 'Correct'\", \"assert check_math_notation('8/4*3+(3-2)') == 'Correct'\", \"assert chec...
{ "split": "train", "index": 702, "acecode_id": "evol_9733", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a log entry for a given URL. The function should accept a string representing a URL and return a formatted log entry based on the URL's hostname and the default port associated with its protocol. If the URL uses 'https', th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_log_entry('http://example.com') == 'http example.com:80'\", \"assert generate_log_entry('https://secure-site.org') == 'http secure-site.org:443'\", \"assert generate_log_entry('http://localhost') == 'http localhost:80'\", \"assert generate_log_entry...
{ "split": "train", "index": 703, "acecode_id": "bigcode_python_fns_5728", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a floating-point number p, which represents the probability of applying one of three Pauli gates (X, Y, Z) in a depolarizing channel. The remaining probability (1 - p) represents the identity operation. The probability p must be a valid probability, meaning it sho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_probability(0.0) == True\", \"assert validate_probability(0.5) == True\", \"assert validate_probability(1.0) == True\", \"assert validate_probability(-0.1) == False\", \"assert validate_probability(1.1) == False\", \"assert validate_probability(0.25...
{ "split": "train", "index": 704, "acecode_id": "bigcode_python_fns_38764", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the power loss in a powertrain simulation program. Given the load power, output power, and efficiency of the powertrain, implement a function `calculate_power_loss(load_power: float, output_power: float, efficiency: float) -> float` that calculat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_power_loss(100.0, 75.0, 0.9) == 27.77777777777778\", \"assert calculate_power_loss(150.0, 100.0, 0.85) == 58.82352941176471\", \"assert calculate_power_loss(100.0, 100.0, 1.0) == 0.0\", \"assert calculate_power_loss(50.0, 25.0, 0.5) == 50.0\", \"as...
{ "split": "train", "index": 705, "acecode_id": "oss_21139", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes input data related to aircraft design and outputs a modified version of the input data. The input data is represented as a dictionary where the keys are strings representing variable names and the values are the corr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_aircraft_data({'Sample # parameter': 'value', 'UseAeromap': True}) == {'Sample # parameter': 'value_modified', 'UseAeromap': True}\", \"assert process_aircraft_data({'Sample # parameter': 'value', 'UseAeromap': False}) == {'Sample # parameter': 'valu...
{ "split": "train", "index": 706, "acecode_id": "oss_26003", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating the import process of traffic accident data into a database. Create a function `simulate_accident_import` that takes the following parameters: \n- `provider_code` (string): The code representing the provider of the accident data. \n- `files_from_c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_accident_import('provider1', {'file1': [{'id': 6}, {'id': 7}]}, 2) == 2\", \"assert simulate_accident_import('provider2', {'file2': [{'id': 1}, {'id': 8}]}, 2) == 1\", \"assert simulate_accident_import('provider3', {'file3': [{'id': 9}, {'id': 10}]}...
{ "split": "train", "index": 707, "acecode_id": "oss_18647", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing a list of C++ include statements. Implement a function `manage_cpp_includes` that takes a list of strings representing file paths to C++ files and returns a list of tuples. Each tuple should contain the file path and a boolean indicating whether the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_cpp_includes(['\\\"myfile.h\\\"', '<myfile.h>']) == [('\\\"myfile.h\\\"', False), ('<myfile.h>', True)]\", \"assert manage_cpp_includes(['\\\"another_file.cpp\\\"', '<another_file.h>']) == [('\\\"another_file.cpp\\\"', False), ('<another_file.h>', Tru...
{ "split": "train", "index": 708, "acecode_id": "oss_15894", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function that, given two input values 'a' and 'b', computes the product of 'b' and the value of 'a' raised to the power of 3. If the result is negative, return its absolute value.\nPlease reason step by step, then write a self-contained Python solution. Give your final...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert function(2, 3) == 24\", \"assert function(-2, 3) == 24\", \"assert function(0, 5) == 0\", \"assert function(4, -1) == 64\", \"assert function(-4, -1) == 64\", \"assert function(1, 1) == 1\", \"assert function(-1, 1) == 1\", \"assert function(2, 0) == 0\", \"...
{ "split": "train", "index": 709, "acecode_id": "evol_21172", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string that may contain various types of whitespaces (spaces, tabs, newline characters) and punctuation marks. Your task is to implement a function that counts the number of distinct words in the string. A 'word' is defined as a sequence of letters or numbers un...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_distinct_words('Hello, world! Hello') == 2\", \"assert count_distinct_words('This is a test. This test is only a test.') == 5\", \"assert count_distinct_words('One two three. One two.') == 3\", \"assert count_distinct_words('') == 0\", \"assert count_d...
{ "split": "train", "index": 710, "acecode_id": "evol_35385", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a string that contains several lines of module configurations. Each line can either be a module declaration that starts with a '#' character (indicating it is commented out), or it can be an active module declaration without the '#' character. Your task is to impl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert enable_modules('#zlib zlibmodule.c\\\\n#_ssl _ssl.c\\\\nxxsubtype xxsubtype.c') == 'zlib zlibmodule.c\\\\n_ssl _ssl.c\\\\n#xxsubtype xxsubtype.c'\", \"assert enable_modules('#array arraymodule.c\\\\n#_contextvars _contextvarsmodule.c\\\\n#xxsubtype xxsubtype...
{ "split": "train", "index": 711, "acecode_id": "bigcode_python_fns_21347", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given an array of integers `nums` and a value `val`. Your task is to implement a function `removeElement` that removes all occurrences of `val` in the array in-place and returns the new length of the array. Additionally, after removing the specified elements, the functi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert removeElement([3, 2, 2, 3], 3) == 2\", \"assert removeElement([1, 1, 1, 1], 1) == 0\", \"assert removeElement([4, 5, 6, 7], 8) == 4\", \"assert removeElement([], 1) == 0\", \"assert removeElement([1, 2, 3, 4, 5], 3) == 4\", \"assert removeElement([1, 2, 3, 4...
{ "split": "train", "index": 712, "acecode_id": "oss_27215", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of events represented as strings and a list of event types. Write a function that filters the list of events to include only those events that contain any of the specified event types in their string representation. The function should take in a list of eve...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_events(['Music|Concert', 'Sports|Football', 'Music|Festival', 'Conference|Tech', 'Sports|Basketball'], ['Music', 'Sports']) == ['Music|Concert', 'Sports|Football', 'Music|Festival', 'Sports|Basketball']\", \"assert filter_events(['Art|Exhibition', 'Sp...
{ "split": "train", "index": 713, "acecode_id": "oss_16319", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `detect_unicode_version(terminal_string: str) -> str` that detects the Unicode version supported by a given terminal string. The terminal string can contain characters from various Unicode versions. Your function should return the highest...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert detect_unicode_version('\\ud83d\\ude00') == 'Unicode 14.0'\", \"assert detect_unicode_version('Hello, \\ud83d\\ude00') == 'Unicode 14.0'\", \"assert detect_unicode_version('Hello, \\ud834\\udd1e') == 'Unicode 14.0'\", \"assert detect_unicode_version('\\ud835...
{ "split": "train", "index": 714, "acecode_id": "bigcode_python_fns_8357", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a string 'raw_seg' that contains a sequence of characters. Your task is to implement a function 'parse_match_results' that takes a string as input and returns the number of occurrences of the substring 'match' in the input string. The function should be case-sensi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_match_results('match') == 1\", \"assert parse_match_results('matchmatch') == 2\", \"assert parse_match_results('no match here') == 1\", \"assert parse_match_results('matchmatchmatch') == 3\", \"assert parse_match_results('MATCH') == 0\", \"assert parse...
{ "split": "train", "index": 715, "acecode_id": "bigcode_python_fns_30907", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary of continents, where each key is a continent ID and its value is a dictionary containing information about that continent, including a list of labels. Each continent ID starts with either 'r' (for relations) or 'n' (for nodes). Your task is to impleme...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_continent_node_membership({'r1': {'labels': ['n1']}, 'n1': {'labels': []}}, 'n1') == ['Node n1 represents the same continent as relation r1 but is not its label']\", \"assert check_continent_node_membership({'r1': {'labels': ['n1']}, 'n2': {'labels': [...
{ "split": "train", "index": 716, "acecode_id": "bigcode_python_fns_40653", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple game inventory system in Python. You need to create an `Item` class that represents an item in the game. Each item has a position (x, y), a collision ID, and a type. The type of the item is represented by an index, where 0 corresponds t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert Item(0, 0, 0, 0).check_collision(Item(0, 0, 0, 1)) == True\", \"assert Item(0, 0, 0, 0).check_collision(Item(1, 1, 1, 1)) == False\", \"assert Item(0, 0, 0, 0).check_collision(Item(0, 0, 1, 1)) == True\", \"assert Item(0, 0, 0, 0).check_collision(Item(0, 0, ...
{ "split": "train", "index": 717, "acecode_id": "oss_6120", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that scans for open ports on a given list of IP addresses. The function should take a list of IP addresses and a range of ports to scan as input. For each IP address, the function should scan all the ports in the specified range and retur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert port_scan(['192.168.1.1', '192.168.1.2'], range(1, 5)) == [('192.168.1.1', 2), ('192.168.1.2', 3)]\", \"assert port_scan(['10.0.0.1'], range(20, 25)) == [('10.0.0.1', 21)]\", \"assert port_scan([], range(1, 10)) == []\", \"assert port_scan(['255.255.255.255'...
{ "split": "train", "index": 718, "acecode_id": "oss_36400", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that optimizes an array of parameters for a quantum algorithm. The function `optimize_parameters` takes two parameters: `new_param` (a list of float values representing the parameters) and `shots` (an integer representing the number o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert optimize_parameters([0.1, 0.2, 0.3], 100) == [3.141592653589793, 3.141592653589793, 3.141592653589793]\", \"assert optimize_parameters([1.0, 1.5, 2.0], 50) == [3.141592653589793, 3.141592653589793, 3.141592653589793]\", \"assert optimize_parameters([3.0, 2.5...
{ "split": "train", "index": 719, "acecode_id": "oss_17224", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary that maps language codes to their corresponding strings. Your task is to serialize this dictionary into a formatted string representation where each entry is wrapped in XML-like tags. The outermost tag should be specified by the input parameter 'tag'....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert serialize_to_xml_string({'en': 'Hello', 'es': 'Hola'}, 'translations') == '<translations><langString lang=\\\"en\\\">Hello</langString><langString lang=\\\"es\\\">Hola</langString></translations>'\", \"assert serialize_to_xml_string({'fr': 'Bonjour', 'de': '...
{ "split": "train", "index": 720, "acecode_id": "bigcode_python_fns_3918", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a command-line interface (CLI) for generating machine learning operation (MLOps) archetypes. The function should accept a project directory name as a string and any number of additional arguments and keyword arguments. The ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_archetype('my_project', 'arg1', 'arg2') == 'MLOps archetype generated successfully.'\", \"assert generate_archetype('valid_project_dir', key1='value1', key2='value2') == 'MLOps archetype generated successfully.'\", \"assert generate_archetype('', 'a...
{ "split": "train", "index": 721, "acecode_id": "bigcode_python_fns_27598", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a list of choices for a multiple select field and a checkbox field for a web application form. The function should return a dictionary containing two keys: 'multiple_select' and 'checkbox'. The 'multiple_select' key should ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_form_fields() == {'multiple_select': [(0, 'choice 0'), (1, 'choice 1'), (2, 'choice 2'), (3, 'choice 3'), (4, 'choice 4')], 'checkbox': {'label': 'BooleanField'}}\", \"assert generate_form_fields()['multiple_select'][0] == (0, 'choice 0')\", \"asser...
{ "split": "train", "index": 722, "acecode_id": "oss_33177", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing a DNA sequence composed of the characters 'A', 'C', 'G', and 'T'. Your task is to implement a function that computes the frequency of each character in the string. The function should return a dictionary where the keys are the characters ('A'...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_nucleotides('ACGTACGT') == {'A': 2, 'C': 2, 'G': 2, 'T': 2}\", \"assert count_nucleotides('AAAA') == {'A': 4, 'C': 0, 'G': 0, 'T': 0}\", \"assert count_nucleotides('CCCC') == {'A': 0, 'C': 4, 'G': 0, 'T': 0}\", \"assert count_nucleotides('GGGG') == {'A...
{ "split": "train", "index": 723, "acecode_id": "bigcode_python_fns_24440", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a string `s`, an integer `k`, and an integer `m`, implement a function that returns the length of the longest substring of `s` such that the frequency of each character in this substring is greater than or equal to `k` and the number of unique characters in the substring ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longest_substring('abcabc', 1, 3) == 6\", \"assert longest_substring('aabbcc', 2, 3) == 6\", \"assert longest_substring('a', 1, 1) == 1\", \"assert longest_substring('abc', 1, 2) == 2\", \"assert longest_substring('aabb', 2, 2) == 4\", \"assert longest_subst...
{ "split": "train", "index": 724, "acecode_id": "evol_4362", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that generates a unique class representation based on the inputs provided for a mention subclass. The function should take a class name, an optional cardinality (which defines the number of possible values), optional values that the m...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert mention_subclass('NewMention') is not None\", \"assert mention_subclass('TestMention', 2, [True, False]) is not None\", \"assert mention_subclass('AnotherMention', 3, [0, 1, 2]) is not None\", \"assert mention_subclass('SampleMention', values=[True, False]) ...
{ "split": "train", "index": 725, "acecode_id": "bigcode_python_fns_41411", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of compound bioactivity values and a feature matrix. Your task is to split the bioactivity values into training and testing sets based on a specified test size ratio. Implement a function `split_data(bioactivity: List[float], features: List[List[float]], te...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert split_data([1.0, 2.0, 3.0, 4.0, 5.0], [[1.0], [2.0], [3.0], [4.0], [5.0]], 0.2) == ([1.0, 2.0, 3.0, 4.0], [5.0], [[1.0], [2.0], [3.0], [4.0]])\", \"assert split_data([10.0, 20.0, 30.0, 40.0], [[1.0], [2.0], [3.0], [4.0]], 0.25) == ([10.0, 20.0, 30.0], [40.0]...
{ "split": "train", "index": 726, "acecode_id": "bigcode_python_fns_1611", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string and a specific substring, write a function `calculate_occurrence_sequence(string: str, substring: str) -> Dict[str, List[int]]` that calculates the occurrence frequency of the specified substring within the main string. The function must account for overlapping i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_occurrence_sequence('ababcabc', 'abc') == {'count': 2, 'positions': [2, 5]}\", \"assert calculate_occurrence_sequence('aaaaaa', 'aa') == {'count': 5, 'positions': [0, 1, 2, 3, 4]}\", \"assert calculate_occurrence_sequence('hello world', 'lo') == {'...
{ "split": "train", "index": 727, "acecode_id": "evol_23410", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a deeply nested list that may contain integers or other lists. Write a function `calculate_sum` that computes the summation of the reciprocal of each integer within this nested structure. The function should take a single parameter, `nested_list`, which can be a l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_sum([[1, 2], [3, 4]]) == 1 + 1/2 + 1/3 + 1/4\", \"assert calculate_sum([1, 2, 3, 4]) == 1 + 1/2 + 1/3 + 1/4\", \"assert calculate_sum([[[5]]]) == 1/5\", \"assert calculate_sum([]) == 0\", \"assert calculate_sum([[[]]]) == 0\", \"assert calculate_su...
{ "split": "train", "index": 728, "acecode_id": "evol_10241", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a number and a range defined by a starting and ending value, implement a function `multiplication_table(number, start, end)` that returns a list containing the multiplication table for the given number within the specified range. If the starting value is greater than the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert multiplication_table(5, 1, 5) == [5, 10, 15, 20, 25]\", \"assert multiplication_table(3, 2, 4) == [6, 9, 12]\", \"assert multiplication_table(1, 0, 5) == [0, 1, 2, 3, 4, 5]\", \"assert multiplication_table(7, 1, 3) == [7, 14, 21]\", \"assert multiplication_t...
{ "split": "train", "index": 729, "acecode_id": "evol_2052", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a value, implement a function `template_check` that checks if the value is a string that equals 'true' (case-insensitive). If the value is a string, return `True` if it equals 'true' (case insensitive), otherwise return `False`. If the value is not a string, return the va...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert template_check('true') == True\", \"assert template_check('TRUE') == True\", \"assert template_check('True') == True\", \"assert template_check('false') == False\", \"assert template_check('FALSE') == False\", \"assert template_check(1) == 1\", \"assert temp...
{ "split": "train", "index": 730, "acecode_id": "bigcode_python_fns_2005", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of comma-separated values (CSV) as a string. Your task is to implement a function that parses this string and returns a list of individual values. The input string may contain leading or trailing spaces around the values. Your function should ignore any emp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_csv('apple, banana, orange') == ['apple', 'banana', 'orange']\", \"assert parse_csv(' apple, banana , , orange ') == ['apple', 'banana', 'orange']\", \"assert parse_csv(' , , , ') == []\", \"assert parse_csv('') == []\", \"assert parse_csv(' ') == []...
{ "split": "train", "index": 731, "acecode_id": "bigcode_python_fns_29649", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a simplified OpenAPI specification represented as a dictionary. The function should take two parameters: \n1. `anonymous_access` (boolean): A boolean value indicating whether anonymous access is enabled or not. \n2. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_openapi_spec(True, {'security': 'some_security', 'info': {}}) == {'info': {}}\", \"assert process_openapi_spec(False, {'security': 'some_security', 'info': {}}) == {'security': 'some_security', 'info': {}}\", \"assert process_openapi_spec(True, {'inf...
{ "split": "train", "index": 732, "acecode_id": "oss_22725", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers and strings representing integers, implement a function `find_max(arr)` that returns the maximum integer value from the array. If the array is empty or contains no valid integers, return 0. You must convert string representations of integers to actual...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_max([18, '25', 3, 21, '9', 12]) == 25\", \"assert find_max([]) == 0\", \"assert find_max(['a', 'b', 'c']) == 0\", \"assert find_max([10, 'a', 20, 'b', 30, 'c']) == 30\", \"assert find_max(['1', '2', '3', '4']) == 4\", \"assert find_max(['100', 200, '300...
{ "split": "train", "index": 733, "acecode_id": "evol_34608", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing a list of instruments used for data acquisition. Each instrument has a unique identifier and can have multiple associated metadata sources and channels. Write a function `insert_instrument` that takes in a dictionary representing an instrument and i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert insert_instrument({'Name': 'Instrument1', 'description': 'Test instrument', 'email': 'test@example.com', 'files': []}) == 'done'\", \"assert insert_instrument({'Name': 'Instrument3', 'description': 'Another test instrument', 'email': 'test3@example.com', 'fi...
{ "split": "train", "index": 734, "acecode_id": "bigcode_python_fns_5393", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with validating a credit card number. A valid credit card number must meet the following criteria: it must be a string of exactly 16 alphanumeric characters, it must not end with a hyphen ('-'), and the last character must be a valid check digit that can be calcu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_credit_card('1234567812345670') == True\", \"assert validate_credit_card('abcdefghabcdefgh') == True\", \"assert validate_credit_card('abcdefghabcdefg-') == False\", \"assert validate_credit_card('123456789012345') == False\", \"assert validate_cred...
{ "split": "train", "index": 735, "acecode_id": "bigcode_python_fns_7224", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Design and implement a function `manage_set(operations: List[Tuple[str, int]]) -> List[bool]` that processes a list of operations on a set of integers. Each operation is represented as a tuple where the first element is a string indicating the operation ('add', 'remove', 'conta...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_set([('add', 1), ('contains', 1)]) == [True]\", \"assert manage_set([('add', 2), ('remove', 2), ('contains', 2)]) == [False]\", \"assert manage_set([('add', 3), ('add', 3), ('contains', 3)]) == [True]\", \"assert manage_set([('remove', 4), ('contains'...
{ "split": "train", "index": 736, "acecode_id": "evol_24843", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a specific greeting message based on the provided name. Write a function named `generate_greeting` that takes a single string argument `name` and returns a greeting message in the format 'Hello, {name}! Welcome!'. If the in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_greeting('Alice') == 'Hello, Alice! Welcome!'\", \"assert generate_greeting('Bob') == 'Hello, Bob! Welcome!'\", \"assert generate_greeting('Charlie') == 'Hello, Charlie! Welcome!'\", \"assert generate_greeting('') == 'Hello, Guest! Welcome!'\", \"as...
{ "split": "train", "index": 737, "acecode_id": "oss_32679", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `data` and two integers `seq_length` and `seq_step`, implement a function that reformats the string into input and target sequences for a hypothetical RNN model. The input sequences should be created by taking slices of the `data` string of length `seq_length`, s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_sequences('xyz', 4, 1) == ([], [])\", \"assert create_sequences('abcdefgh', 1, 1) == (['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'], ['b', 'c', 'd', 'e', 'f', 'g', 'h', ''])\", \"assert create_sequences('', 5, 1) == ([], [])\", \"assert create_sequences('s...
{ "split": "train", "index": 738, "acecode_id": "bigcode_python_fns_23493", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Develop a Python function that identifies Fibonacci numbers from a provided list of integers. The function should handle exceptions for non-numerical inputs and empty lists. The output should be a tuple containing two components: a list of Fibonacci numbers in ascending order a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_fibonacci_numbers([]) == ('', 0)\", \"assert find_fibonacci_numbers(['a', 1, 2]) == ('', 0)\", \"assert find_fibonacci_numbers([1, 2, 3, 5, 8]) == ([1, 2, 3, 5, 8], 19)\", \"assert find_fibonacci_numbers([0, 1, 2, 3, 4, 5, 6, 7, 8, 13]) == ([0, 1, 2, 3,...
{ "split": "train", "index": 739, "acecode_id": "evol_2680", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given an array of integers and a target sum, write a function that returns the starting and ending index of the longest contiguous subarray that sums up to the target sum. If there are multiple longest subarrays, return the one that appears first. If no such subarray exists, re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longest_subarray_with_sum([1, 2, 3, 4, 5], 15) == (0, 4)\", \"assert longest_subarray_with_sum([1, 1, 1, 1], 2) == (0, 1)\", \"assert longest_subarray_with_sum([], 5) == (-1, -1)\", \"assert longest_subarray_with_sum([1, 2, 3], 6) == (0, 2)\", \"assert longe...
{ "split": "train", "index": 740, "acecode_id": "evol_14902", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the average value of a feature across three distinct phases: 'train', 'val', and 'test'. The feature values for each phase are provided in a single list, where the first third of the list corresponds to the 'train' pha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_feature_values([3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0]) == {'train': 4.0, 'val': 7.0, 'test': 10.0}\", \"assert average_feature_values([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0]) == {'train': 2.0, 'val': 5.0, 'test': 8.0}\", \"assert avera...
{ "split": "train", "index": 741, "acecode_id": "oss_36113", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a simple banking system. The function should take an initial account holder's name and a series of transactions, which can be either deposits or withdrawals. The function should return the final balance of the account after...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bank_account_balance('Alice', [('deposit', 100), ('withdraw', 50)]) == 50\", \"assert bank_account_balance('Bob', [('deposit', 200), ('withdraw', 250)]) == 200\", \"assert bank_account_balance('Charlie', [('withdraw', 100)]) == 0\", \"assert bank_account_bal...
{ "split": "train", "index": 742, "acecode_id": "oss_3263", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `sum_nums(lst)` that takes a list of integers as input and returns the sum of all the integers in the list. Do not use any built-in functions that directly compute the sum. Instead, implement the function using a loop to iterate through the list and accumulate ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_nums([1, 2, 3, 4, 5]) == 15\", \"assert sum_nums([-1, -2, -3]) == -6\", \"assert sum_nums([0, 0, 0]) == 0\", \"assert sum_nums([10, 20, 30]) == 60\", \"assert sum_nums([100, 200, -50]) == 250\", \"assert sum_nums([1, 1, 1, 1]) == 4\", \"assert sum_nums([...
{ "split": "train", "index": 743, "acecode_id": "evol_4587", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string that represents HTML content and a regular expression pattern. Your task is to implement a function `extract_matches(html_content: str, pattern: str) -> List[str]` that takes the HTML content and a regular expression pattern as input and returns a list of...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_matches('<p>Contact us at info@example.com or call 123-456-7890.</p>', r'\\\\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\\\.[A-Z|a-z]{2,}\\\\b') == ['info@example.com']\", \"assert extract_matches('<div>Reach out at support@test.com</div>', r'\\\\b[A-Za-z0-9....
{ "split": "train", "index": 744, "acecode_id": "oss_24426", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are given a list of calendars, each represented as a dictionary with the following keys: 'primary' (a boolean indicating if it's the primary calendar), 'selected' (a boolean indicating if it's selected), and 'summary' (a string representing the summary of the calendar). You...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_calendars([{'primary': True, 'selected': True, 'summary': 'Work'}, {'primary': False, 'selected': True, 'summary': 'Personal'}, {'primary': False, 'selected': False, 'summary': 'Holidays'}]) == [{'primary': True, 'selected': True, 'summary': 'Work'}, {'...
{ "split": "train", "index": 745, "acecode_id": "bigcode_python_fns_30392", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `add_student(students: List[List[Union[str, int, List[str]]]], name: str, age: int, subjects: List[str]) -> None` that takes a list of students and adds a new student to the list. Each student is represented as a list containing the student's name (string), age...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_student([], 'Sam', 19, ['Math', 'Chemistry']) == None\", \"assert add_student([], 'Alice', 20, ['English', 'Physics']) == None\", \"assert add_student([], 'Linda', 21, ['Biology', 'Chemistry']) == None\", \"assert add_student([], 'John123', 22, ['History...
{ "split": "train", "index": 746, "acecode_id": "evol_7179", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to implement a function `extract_answer_from_text(text: str) -> str` that takes a string input `text` and returns an answer based on the following rules: 1. If the text contains the word 'question' and ends with a question mark, the answer should be 'Yes'. 2. If the te...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_answer_from_text('Is this a question?') == 'Yes'\", \"assert extract_answer_from_text('The weather seems nice.') == 'It looks cloudy'\", \"assert extract_answer_from_text('What is your question?') == 'Yes'\", \"assert extract_answer_from_text('The qu...
{ "split": "train", "index": 747, "acecode_id": "oss_5515", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a list of file names in a directory. Your task is to implement a function that filters and returns a list of file names that end with a specified suffix. The filtering should be case insensitive. If the input list is empty, the function should return an empty list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_files(['file1.txt', 'file2.txt', 'file3.doc'], 'txt') == ['file1.txt', 'file2.txt']\", \"assert filter_files(['report.pdf', 'summary.pdf', 'data.xlsx'], 'pdf') == ['report.pdf', 'summary.pdf']\", \"assert filter_files([], 'txt') == []\", \"assert filt...
{ "split": "train", "index": 748, "acecode_id": "bigcode_python_fns_3834", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Implement a function `triangle_properties(side1: float, side2: float, side3: float) -> Tuple[float, float]` that takes the lengths of the three sides of a triangle as input and returns a tuple containing the area and perimeter of the triangle. If the sides do not form a valid t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert triangle_properties(3, 4, 5) == (6.0, 12.0)\", \"assert triangle_properties(7, 8, 9) == (26.832815729997478, 24.0)\", \"assert triangle_properties(10, 10, 10) == (43.30127018922193, 30.0)\", \"assert triangle_properties(6, 8, 10) == (24.0, 24.0)\", \"assert ...
{ "split": "train", "index": 749, "acecode_id": "evol_730", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given an array of strings, implement a function that filters out all non-repeating string elements from the array. The function should be case sensitive and ignore leading and trailing spaces. Numeric strings should be treated as valid strings. The function should return a list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_non_repeating_strings(['apple', 'banana', 'apple', 'orange', 'banana', 'grape']) == ['orange', 'grape']\", \"assert filter_non_repeating_strings(['hello', 'world', 'hello', 'hello']) == ['world']\", \"assert filter_non_repeating_strings(['test', 'test...
{ "split": "train", "index": 750, "acecode_id": "evol_13344", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that takes a list of dictionaries as input, where each dictionary represents a configuration. Each dictionary contains key-value pairs that need to be merged into a single configuration dictionary. Your function should handle mergi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_configurations([]) == {}\", \"assert merge_configurations([{'a': 1}]) == {'a': 1}\", \"assert merge_configurations([{'a': 1}, {'b': 2}]) == {'a': 1, 'b': 2}\", \"assert merge_configurations([{'a': 1}, {'a': 2}]) == {'a': 2}\", \"assert merge_configurat...
{ "split": "train", "index": 751, "acecode_id": "oss_9175", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of tuples where each tuple contains four elements: (label, col, value, code). Your task is to process this list according to specific rules based on the value of 'label'. Implement a function `process_data(data: List[Tuple[str, str, int, str]]) -> List[Tupl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_data([('A', 'col1', 5, 'code1'), ('B', 'col2', 3, 'code2'), ('C', 'col3', 7, 'code3'), ('D', 'col4', 10, 'code4'), ('E', 'col5', 1, 'code5')]) == [('col1', 10), ('col2', 13), ('col3', 2), ('col4', 5.0), ('col5', 1)]\", \"assert process_data([('A', 'c...
{ "split": "train", "index": 752, "acecode_id": "oss_369", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of raw XYZ color values represented as a 2D array (where each row corresponds to a color and each column corresponds to the XYZ components). Your task is to implement a function that normalizes these XYZ values based on a given illuminant's white point. The...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert normalize_xyz([[0.0, 0.0, 0.0]]) == [[0.0, 0.0, 0.0]]\", \"assert normalize_xyz([[0.95047, 1.0, 1.08883]]) == [[1.0, 1.0, 1.0]]\", \"assert normalize_xyz([[0.95047, 0.0, 0.0]]) == [[1.0, 0.0, 0.0]]\", \"assert normalize_xyz([[0.0, 1.0, 0.0]]) == [[0.0, 1.0, ...
{ "split": "train", "index": 753, "acecode_id": "bigcode_python_fns_46332", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a list of strings where each string represents a filename with its associated labels separated by commas. Your task is to implement a function `save_annotations(index_value: int, annotations: str, filenames: List[str]) -> List[str]` that simulates saving annotatio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert save_annotations(0, 'LabelA,LabelB,LabelC,LabelD', ['file1.wav', 'file2.wav']) == ['Filename,Label1,Label2,Label3,Label4', 'file1.wav,LabelA,LabelB,LabelC,LabelD']\", \"assert save_annotations(1, 'Label1,Label2,Label3,Label4', ['audio1.wav', 'audio2.wav']) =...
{ "split": "train", "index": 754, "acecode_id": "bigcode_python_fns_36771", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that validates the input data for a user profile. The function should ensure that the provided ethnicity and gender values are valid according to specific predefined choices. The valid choices for the 'ethnicity' field are: 'None',...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_profile_data('White', 'Male') == True\", \"assert validate_profile_data('Hispanic', 'Female') == True\", \"assert validate_profile_data('Black', 'Other') == True\", \"assert validate_profile_data('Middle Eastern', 'None') == True\", \"assert validat...
{ "split": "train", "index": 755, "acecode_id": "oss_21706", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dataset represented as a list of lists, where each inner list corresponds to a data point with multiple dimensions (axes). Your task is to implement a function that takes this dataset and a boolean parameter `remove_axis`. If `remove_axis` is True, return a new ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert copy_dataset([[1, 2, 3], [4, 5, 6]], True) == [[1], [4]]\", \"assert copy_dataset([[1, 2], [3, 4]], False) == [[1, 2], [3, 4]]\", \"assert copy_dataset([[7, 8, 9]], True) == [[7]]\", \"assert copy_dataset([[10]], False) == [[10]]\", \"assert copy_dataset([[1...
{ "split": "train", "index": 756, "acecode_id": "bigcode_python_fns_11466", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string 'builder' representing a JSON-like structure and a string 'schemaVersion' representing a version number, implement a function that adds the schemaVersion to the builder string as a new key-value pair. The schemaVersion should be added under the key 'version'. If ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_schema_version('{\\\"name\\\": \\\"schema\\\"}', '1.0') == '{\\\"name\\\": \\\"schema\\\", \\\"version\\\": \\\"1.0\\\"}'\", \"assert add_schema_version('{\\\"version\\\": \\\"0.9\\\"}', '1.0') == '{\\\"version\\\": \\\"1.0\\\"}'\", \"assert add_schema_v...
{ "split": "train", "index": 757, "acecode_id": "bigcode_python_fns_8423", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, return a new list that contains only the even numbers from the original list. The order of the even numbers should be preserved. If there are no even numbers, return an empty list. You should implement the function `filter_even_numbers(nums: List[int])...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 15, 20, 25, 30]) == [10, 20, 30]\", \"assert filter_even_numbers([1, 3, 5, 7]) == []\", \"assert filter_even_numbers([-2, -1, 0, 1]) == [-2, 0]\", \"assert filter_even_number...
{ "split": "train", "index": 758, "acecode_id": "bigcode_python_fns_41456", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a list of integers and a target integer. Your goal is to determine if any two distinct integers in the list sum up to the target integer. If such a pair exists, return True; otherwise, return False. The function signature s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert has_pair_with_sum([1, 2, 3, 4, 5], 9) == True\", \"assert has_pair_with_sum([1, 2, 3, 4, 5], 10) == False\", \"assert has_pair_with_sum([-1, -2, -3, -4, -5], -8) == True\", \"assert has_pair_with_sum([-1, -2, -3, -4, -5], -6) == True\", \"assert has_pair_wit...
{ "split": "train", "index": 759, "acecode_id": "bigcode_python_fns_20239", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of audio sample values represented as floats in the range of [-1, 1], write a function that calculates the peak dBFS (decibels relative to full scale) based on the maximum absolute sample value. The function should return the dBFS value as a float. The formula for ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert peak_dbfs([-1.0, 0.0, 1.0]) == 0.0\", \"assert peak_dbfs([-1.0, 0.8, 0.5]) == 0.0\", \"assert peak_dbfs([0.0]) == -float('inf')\", \"assert peak_dbfs([0.0, 0.0, 0.0]) == -float('inf')\", \"assert peak_dbfs([1.0, -1.0]) == 0.0\", \"assert peak_dbfs([0.1, 0.5]...
{ "split": "train", "index": 760, "acecode_id": "bigcode_python_fns_18501", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Write a function that takes a dictionary of words and their respective frequencies and returns a new dictionary organized in alphabetical order of the words. The values associated with the words should remain unchanged.\nPlease reason step by step, then write a self-contained P...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_dict({'the': 10, 'at': 3, 'hello': 5, 'cat': 1, 'counter': 2}) == {'at': 3, 'cat': 1, 'counter': 2, 'hello': 5, 'the': 10}\", \"assert sort_dict({'apple': 4, 'banana': 2, 'cherry': 7}) == {'apple': 4, 'banana': 2, 'cherry': 7}\", \"assert sort_dict({}) ...
{ "split": "train", "index": 761, "acecode_id": "evol_21258", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a positive integer `number`. Your task is to find the maximum number that can be formed by rearranging the digits of this integer. Write a function `find_max_number` that takes in the integer `number` and returns the maximum number that can be formed by rearrangin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_max_number(325) == 532\", \"assert find_max_number(1234) == 4321\", \"assert find_max_number(987) == 987\", \"assert find_max_number(0) == 0\", \"assert find_max_number(100) == 100\", \"assert find_max_number(222) == 222\", \"assert find_max_number(5432...
{ "split": "train", "index": 762, "acecode_id": "oss_3814", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that constructs a Docker command string based on a given set of parameters. The function should take in several arguments representing different aspects of the Docker command and return a formatted string representing the compl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert construct_docker_command('myhost', True, False, False, '/app', 'mycontainer') == 'docker run --hostname myhost -d --workdir /app --name mycontainer'\", \"assert construct_docker_command('myhost', False, True, False, '/app', 'mycontainer') == 'docker run --ho...
{ "split": "train", "index": 763, "acecode_id": "oss_4871", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the execution of a command-line program and captures its output. The function should take a list of strings as input, where the first string is the command to execute, followed by its arguments. Your function should return ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_command_output(['echo', 'Hello']) == ('Hello\\\\n', '')\", \"assert simulate_command_output(['ls']) == ('file1.txt\\\\nfile2.txt\\\\n', '')\", \"assert simulate_command_output(['mkdir', 'test']) == ('', 'Command not found')\", \"assert simulate_comm...
{ "split": "train", "index": 764, "acecode_id": "bigcode_python_fns_33518", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the predicted classes and another list representing the true classes for a set of samples. Your task is to implement a function that generates a list of tuples for each sample. Each tuple should contain the following elements: the i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_classification_report([1, 0, 2], [1, 1, 0]) == [(1, True, True), (2, False, True), (3, True, False)]\", \"assert generate_classification_report([0, 0, 0], [0, 0, 0]) == [(1, False, False), (2, False, False), (3, False, False)]\", \"assert generate_c...
{ "split": "train", "index": 765, "acecode_id": "bigcode_python_fns_24652", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that prints all integers from 1 to a given integer x (exclusive). Write a function named `print_numbers` that takes a single integer x as input and prints the numbers in ascending order from 1 to x-1. For example, if x is 5, the funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert print_numbers(1) == None\", \"assert print_numbers(2) == None\", \"assert print_numbers(3) == None\", \"assert print_numbers(4) == None\", \"assert print_numbers(5) == None\", \"assert print_numbers(6) == None\", \"assert print_numbers(7) == None\", \"assert...
{ "split": "train", "index": 766, "acecode_id": "evol_12476", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string containing a sequence of characters. Your task is to implement a function that processes this string to count the number of occurrences of each character and returns a dictionary with the characters as keys and their counts as values. The function should ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_string('Hello World!') == {'h': 1, 'e': 1, 'l': 3, 'o': 2, 'w': 1, 'r': 1, 'd': 1}\", \"assert process_string('Python 3.8') == {'p': 1, 'y': 1, 't': 1, 'h': 1, 'o': 1, 'n': 1}\", \"assert process_string('!@#$$%^&*()') == {}\", \"assert process_string...
{ "split": "train", "index": 767, "acecode_id": "bigcode_python_fns_11257", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates basic banking operations. The function should take a series of operations as input and return the final balance after performing all operations. The operations can include deposits, withdrawals, and interest application...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert final_balance([('deposit', 100), ('withdraw', 50), ('apply_interest', None)]) == 52.5\", \"assert final_balance([('deposit', 200), ('withdraw', 150), ('apply_interest', None)]) == 52.5\", \"assert final_balance([('deposit', 300), ('apply_interest', None)]) =...
{ "split": "train", "index": 768, "acecode_id": "oss_9957", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given two lists: `x` and `v`, where `x` represents a sequence of x-coordinates and `v` represents the corresponding y-coordinates. Implement a function `interpolate(x: List[float], v: List[float], x_new: float) -> float` that performs linear interpolation to find the co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert interpolate([1, 2, 3], [10, 20, 30], 1) == 10.0\", \"assert interpolate([1, 2, 3], [10, 20, 30], 3) == 30.0\", \"assert interpolate([1, 2, 3], [10, 20, 30], 4) == None\", \"assert interpolate([1, 2], [10, 20], 1.5) == 15.0\", \"assert interpolate([1, 2], [10...
{ "split": "train", "index": 769, "acecode_id": "evol_16312", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with counting the number of free hugepages in a memory information dataset. Given a list of strings, where each string represents a line from a memory info file, write a function that counts and returns the total number of free hugepages. Each line can be in the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_free_hugepages(['HugePages_Free: 256', 'MemAvailable: 512', 'HugePages_Free: 128']) == 384\", \"assert count_free_hugepages(['HugePages_Free: 512']) == 512\", \"assert count_free_hugepages(['HugePages_Free: 0']) == 0\", \"assert count_free_hugepages(['...
{ "split": "train", "index": 770, "acecode_id": "bigcode_python_fns_28635", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing configurations for a robotic arm. Each joint configuration is represented as a 6-dimensional array of joint angles. Implement a function `robot_configuration_manager` that takes a list of operations to perform on the configurations. The operations c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert robot_configuration_manager([('add', 'q1', [1, 2, 3, 4, 5, 6])]) == [None]\", \"assert robot_configuration_manager([('get', 'qs')]) == [[0, 0, -1.5707963267948966, 0, 0, 0]]\", \"assert robot_configuration_manager([('get', 'qn')]) == [[0, 0.7853981633974483,...
{ "split": "train", "index": 771, "acecode_id": "oss_13062", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a dictionary of string keys and integer values, implement a function that returns a new dictionary containing only the entries whose keys start with a specified alphabetical symbol. The function should take two parameters: the dictionary and the symbol, which is a single ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert isolate_dict_elements({'cat': 1, 'dog': 2, 'mouse': 3}, 'c') == {'cat': 1}\", \"assert isolate_dict_elements({'apple': 5, 'banana': 10, 'apricot': 15}, 'a') == {'apple': 5, 'apricot': 15}\", \"assert isolate_dict_elements({'grape': 7, 'orange': 8, 'pear': 9}...
{ "split": "train", "index": 772, "acecode_id": "evol_19346", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates a simple banking system. The function should be able to handle basic banking operations such as account creation, deposit, withdrawal, and balance inquiry. Your task is to implement a function called `bank_operations...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bank_operations([('create', 'John Doe', 1000)]) == []\", \"assert bank_operations([('create', 'John Doe', 1000), ('deposit', 1, 500), ('balance', 1)]) == [1500]\", \"assert bank_operations([('create', 'John Doe', 1000), ('withdraw', 1, 200), ('balance', 1)])...
{ "split": "train", "index": 773, "acecode_id": "oss_13636", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists of integers, `begin_event_data` and `end_event_data`, representing precipitation data collected at two different times. Your task is to implement a function `calculate_precipitation_difference(begin_event_data: List[int], end_event_data: List[int]) -> Li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_precipitation_difference([1, 2, 3], [4, 5, 6]) == [3, 3, 3]\", \"assert calculate_precipitation_difference([0, 0, 0], [0, 0, 0]) == [0, 0, 0]\", \"assert calculate_precipitation_difference([10, 20, 30], [10, 20, 30]) == [0, 0, 0]\", \"assert calcul...
{ "split": "train", "index": 774, "acecode_id": "bigcode_python_fns_42870", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the creation of a session for a client credential grant in an OAuth2 authentication process. The function should accept the following parameters: `access_token` (str): a token used to authorize the session, `expires_in_seco...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_session('token123', 3600, {'read', 'write'}) == {'oauth2credential': {'client_id': None, 'redirect_url': None, 'access_token': 'token123', 'expires_in_seconds': 3600, 'scopes': {'read', 'write'}, 'grant_type': 'Client Credential Grant', 'client_secret...
{ "split": "train", "index": 775, "acecode_id": "bigcode_python_fns_37600", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function called `compare_file_system_versions(version1: str, version2: str) -> bool`. This function will compare two file system interface version strings and determine if they are equal. The function should return True if both version strings...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compare_file_system_versions('NFSV3_0', 'NFSV3_0') == True\", \"assert compare_file_system_versions('NFSV4_1', 'NFSV4_1') == True\", \"assert compare_file_system_versions('NFSV4_0', 'NFSV4_1') == False\", \"assert compare_file_system_versions('NFSV3_0', 'NFS...
{ "split": "train", "index": 776, "acecode_id": "oss_13227", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a list of strings representing topics and returns a dictionary containing the frequency of each topic, while ignoring case sensitivity. For example, 'Python' and 'python' should be considered as the same topic. Implemen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_topic_frequency(['Python', 'java', 'Python', 'C++', 'Java']) == {'python': 2, 'java': 2, 'c++': 1}\", \"assert count_topic_frequency([]) == {}\", \"assert count_topic_frequency(['python', 'Python']) == {'python': 2}\", \"assert count_topic_frequency(['...
{ "split": "train", "index": 777, "acecode_id": "oss_22812", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a secure vault for storing sensitive data. The function should allow setting a key and retrieving the key. The key should only be retrievable if it has been previously set. If an attempt is made to retrieve the key with...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert vault_operations([('set', 'my_secret_key'), ('get', '')]) == ['Key set', 'my_secret_key']\", \"assert vault_operations([('get', '')]) == ['Key is not set']\", \"assert vault_operations([('set', 'key1'), ('get', ''), ('set', 'key2'), ('get', '')]) == ['Key se...
{ "split": "train", "index": 778, "acecode_id": "oss_15596", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a string variable `message` containing a sentence. Implement a function `reverse_words(message: str) -> str` that reverses each word in the `message` individually without reversing the entire string. The words are separated by spaces. For example, if the input is ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_words('Hello World') == 'olleH dlroW'\", \"assert reverse_words('Python Programming') == 'nohtyP gnimmargorP'\", \"assert reverse_words('Test case') == 'tseT esac'\", \"assert reverse_words('Reverse each word') == 'esreveR hcae drow'\", \"assert reve...
{ "split": "train", "index": 779, "acecode_id": "evol_22974", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a list of bank account balances represented as integers, implement a function that returns the total sum of all the account balances in the list. The function should be able to handle an empty list and return 0 in such cases. You need to write a function named `sum_bank_a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_bank_account_balances([100, 200, 300]) == 600\", \"assert sum_bank_account_balances([-100, -200, -300]) == -600\", \"assert sum_bank_account_balances([-100, 200, 300]) == 400\", \"assert sum_bank_account_balances([0, 0, 0]) == 0\", \"assert sum_bank_acco...
{ "split": "train", "index": 780, "acecode_id": "bigcode_python_fns_16007", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the number of shots made by a basketball player in different games. Your task is to implement a function `calculate_accuracy(shots: List[int], targets: List[int]) -> float` that calculates the player's shooting accuracy. The accurac...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_accuracy([1, 2, 3], [1, 1, 1]) == 1.0\", \"assert calculate_accuracy([1, 2, 3], [1, 0, 1]) == 0.666667\", \"assert calculate_accuracy([1, 1, 1], [0, 0, 0]) == 0.0\", \"assert calculate_accuracy([], []) == 0.0\", \"assert calculate_accuracy([1, 1, 1...
{ "split": "train", "index": 781, "acecode_id": "bigcode_python_fns_37107", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Write a Python function that rotates an NxN 2D matrix counterclockwise by a specified degree that is a multiple of 90. The function should return an error if the degree is not a multiple of 90. Additionally, if the matrix is empty or not square, the function should return an ap...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rotate_2D_matrix([[1,2,3],[4,5,6],[7,8,9]], 180) == [[9,8,7],[6,5,4],[3,2,1]]\", \"assert rotate_2D_matrix([[1,2,3],[4,5,6],[7,8,9]], 360) == [[1,2,3],[4,5,6],[7,8,9]]\", \"assert rotate_2D_matrix([[1,2],[3,4]], 90) == [[3,1],[4,2]]\", \"assert rotate_2D_mat...
{ "split": "train", "index": 782, "acecode_id": "evol_26898", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes in information about a book and returns the total number of pages in that book. The input to the function should be the title of the book (a string), the author of the book (a string), and the number of pages in the book (an in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_page_count('1984', 'George Orwell', 328) == 328\", \"assert get_page_count('To Kill a Mockingbird', 'Harper Lee', 281) == 281\", \"assert get_page_count('The Great Gatsby', 'F. Scott Fitzgerald', 180) == 180\", \"assert get_page_count('Moby Dick', 'Herma...
{ "split": "train", "index": 783, "acecode_id": "oss_21687", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers representing the weights of different items, write a function `find_compression_point(weights: List[int], slope: int = 1, compression: int = 1, extrapolation_point: Optional[int] = None, axis: int = -1) -> int` that calculates and returns the compressio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_compression_point([1, 2, 3, 4, 5], slope=2, compression=10) == 4\", \"assert find_compression_point([10, 10, 10, 10], slope=1, compression=10) == -1\", \"assert find_compression_point([0, 0, 0, 0], slope=1, compression=0) == -1\", \"assert find_compress...
{ "split": "train", "index": 784, "acecode_id": "bigcode_python_fns_30461", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a simple data transformation prompt. The function `choose_transformations(name: str) -> Dict[str, Any]` should take a string parameter `name` and return a dictionary containing the user's responses to two questions about da...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert choose_transformations('Alice') == {'confirm_transformations': False, 'transformations': []}\", \"assert choose_transformations('Bob') == {'confirm_transformations': False, 'transformations': []}\", \"assert choose_transformations('Charlie') == {'confirm_tra...
{ "split": "train", "index": 785, "acecode_id": "bigcode_python_fns_32209", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of dictionaries and a specific key as inputs. The function should return a new list of dictionaries, ensuring that the dictionaries in the output list have unique values for the specified key. The first occurrence of each unique value shou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert uniqueDictsByKey([{ 'id': 1, 'name': 'Jane' }, { 'id': 2, 'name': 'Jane'}, { 'id': 3, 'name': 'Bob'}], 'name') == [{ 'id': 1, 'name': 'Jane'}, { 'id': 3, 'name': 'Bob'}]\", \"assert uniqueDictsByKey([{ 'id': 1, 'name': 'Alice' }, { 'id': 2, 'name': 'Bob'}, {...
{ "split": "train", "index": 786, "acecode_id": "evol_29750", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `rearrange_list(arr: List[int], pattern: str) -> List[int]` that rearranges the elements of the list according to the specified pattern. The pattern is a string that describes how to group and rearrange the elements. In the pattern, yo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rearrange_list([1, 2, 3, 4], '(0 1)=2') == [3, 4, 1, 2]\", \"assert rearrange_list([10, 20, 30, 40, 50], '(0 1)=2') == [30, 40, 10, 20, 50]\", \"assert rearrange_list([], '(0)=0') == []\", \"assert rearrange_list([1, 2, 3], '(0 1)=2') == [3, 1, 2]\", \"asser...
{ "split": "train", "index": 787, "acecode_id": "bigcode_python_fns_27809", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with normalizing attribute names to ensure they can be used as valid Python identifiers. An attribute name is considered valid if it satisfies two conditions: it must be a valid identifier (consisting of letters, digits, and underscores, and cannot start with a d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert normalize_attribute_name('class') == 'class_'\", \"assert normalize_attribute_name('1abc') == 'attr_1abc'\", \"assert normalize_attribute_name('def') == 'def_'\", \"assert normalize_attribute_name('valid_name') == 'valid_name'\", \"assert normalize_attribute...
{ "split": "train", "index": 788, "acecode_id": "bigcode_python_fns_20776", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given two lists of integers, write a function that takes these two lists as input and returns a new list containing the product of corresponding elements from both lists. The input lists will have the same length. Implement a function called `multiply_lists` that takes two para...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert multiply_lists([1, 2, 3], [4, 5, 6]) == [4, 10, 18]\", \"assert multiply_lists([0, 1, 2], [3, 4, 5]) == [0, 4, 10]\", \"assert multiply_lists([-1, -2, -3], [1, 2, 3]) == [-1, -4, -9]\", \"assert multiply_lists([1, 0, 3], [0, 2, 4]) == [0, 0, 12]\", \"assert ...
{ "split": "train", "index": 789, "acecode_id": "evol_24635", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a function signature represented by a return type annotation, determine whether the return type is one of the specified allowed types. If the return type is not annotated, and unannotated types are not allowed, raise an exception. The function should take the return type ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_return_type(int, [int, str]) == True\", \"assert check_return_type(str, [int, str]) == True\", \"assert check_return_type(float, [int, float]) == True\", \"assert check_return_type(None, [int, str], allow_unannotated=True) == True\", \"assert check_ret...
{ "split": "train", "index": 790, "acecode_id": "bigcode_python_fns_16661", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function `analyze_sentences(paragraph: str) -> List[str]` that takes a paragraph as input and classifies each sentence in the paragraph as 'positive', 'negative', or 'neutral'. The function should handle cases such as negations (e.g., 'not bad' should be classified ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert analyze_sentences('The weather is very nice today.') == ['positive']\", \"assert analyze_sentences('I hate it when it rains.') == ['negative']\", \"assert analyze_sentences('This is not bad at all.') == ['positive']\", \"assert analyze_sentences('He is bette...
{ "split": "train", "index": 791, "acecode_id": "evol_1192", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given two numbers, `dividend` and `divisor`, write a function `divide_with_zero_divisor(dividend: float, divisor: float) -> float` that returns the result of the division of `dividend` by `divisor`. If `divisor` is zero, the function should return 0 instead. The inputs are guar...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert divide_with_zero_divisor(10, 2) == 5.0\", \"assert divide_with_zero_divisor(10, 0) == 0\", \"assert divide_with_zero_divisor(0, 10) == 0.0\", \"assert divide_with_zero_divisor(-10, 2) == -5.0\", \"assert divide_with_zero_divisor(10, -2) == -5.0\", \"assert d...
{ "split": "train", "index": 792, "acecode_id": "bigcode_python_fns_48927", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Your task is to implement a function that calculates and returns the sum of all the integers in the list. You need to ensure that the function handles both positive and negative integers correctly. The input list may be empty, in which case the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_sum([]) == 0\", \"assert calculate_sum([1, 2, 3]) == 6\", \"assert calculate_sum([-1, -2, -3]) == -6\", \"assert calculate_sum([1, -1, 2, -2]) == 0\", \"assert calculate_sum([10, 20, 30, 40]) == 100\", \"assert calculate_sum([-10, -20, -30, -40]) =...
{ "split": "train", "index": 793, "acecode_id": "oss_6761", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that determines the nullable type of a given hypothetical type in a simplified type system. The function should handle both nullable and non-nullable types according to the following rules:\n- If the input type is represented as 'NonN...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_nullable_type('NonNull(ObjectType)') == 'ObjectType'\", \"assert get_nullable_type('NonNull(String)') == 'String'\", \"assert get_nullable_type('NonNull(Int)') == 'Int'\", \"assert get_nullable_type('NonNull(Float)') == 'Float'\", \"assert get_nullable_t...
{ "split": "train", "index": 794, "acecode_id": "oss_7649", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that returns a list of the prime numbers located at odd indices in a given list of integers. The function should handle a list of arbitrary length and must be optimized for efficiency. For example, given the list [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], your function s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert print_odd_indexed_prime_numbers([4, 6, 8, 10, 12]) == []\", \"assert print_odd_indexed_prime_numbers([1, 3, 5, 7, 11]) == [3, 7]\", \"assert print_odd_indexed_prime_numbers([]) == []\", \"assert print_odd_indexed_prime_numbers([10, 15, 20, 25, 30, 35]) == []...
{ "split": "train", "index": 795, "acecode_id": "evol_19077", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the selection and copying of a specific burst from a given list of bursts. Each burst is represented by a dictionary containing its properties such as 'id', 'parameter', and 'data'. The function should take a list of bu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert select_burst([{'id': 1, 'parameter': 'param1', 'data': 10}, {'id': 2, 'parameter': 'param2', 'data': 20}], 1, 0) == {'id': 2, 'parameter': 'param2', 'data': 20}\", \"assert select_burst([{'id': 1, 'parameter': 'param1', 'data': 10}, {'id': 2, 'parameter': 'p...
{ "split": "train", "index": 796, "acecode_id": "bigcode_python_fns_25073", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string representing a nickname, you need to clear the nickname by performing the following operations: 1. If the nickname starts with either a '+' or '!', remove that character. 2. If the nickname ends with a '#', remove that character. 3. If the nickname contains paren...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cleared_nickname('+JohnDoe#') == 'JohnDoe'\", \"assert cleared_nickname('!JaneDoe()') == 'JaneDoe'\", \"assert cleared_nickname('UserName123(#ExtraInfo)') == 'UserName123'\", \"assert cleared_nickname('Alice') == 'Alice'\", \"assert cleared_nickname('!Bob!')...
{ "split": "train", "index": 797, "acecode_id": "bigcode_python_fns_9225", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a list of tags, implement a function that removes all occurrences of a specified tag from the list. The function should take two parameters: the list of tags and the tag to be removed. If the tag does not exist in the list and the 'not_exist_ok' flag is set to False, the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_tag(['apple', 'banana', 'apple', 'orange'], 'apple') == ['banana', 'orange']\", \"assert remove_tag(['apple', 'banana', 'orange'], 'grape') == ['apple', 'banana', 'orange']\", \"assert remove_tag(['apple', 'banana', 'orange'], 'banana') == ['apple', '...
{ "split": "train", "index": 798, "acecode_id": "bigcode_python_fns_6509", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists of numerical vectors, each represented as a list of floats. Your task is to normalize each vector in both lists using L2 normalization. L2 normalization scales each vector to have a unit norm, which means that the sum of the squares of the vector element...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert normalize_vectors([[1]], [[0], [0]]) == ([[1.0]], [[0], [0]])\", \"assert normalize_vectors([[1, 1]], [[1, 1], [0, 0]]) == ([[0.7071067811865475, 0.7071067811865475]], [[0.7071067811865475, 0.7071067811865475], [0, 0]])\", \"assert normalize_vectors([[3, 4]]...
{ "split": "train", "index": 799, "acecode_id": "bigcode_python_fns_16547", "num_tests": 9 }