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 that may contain a mix of lowercase and uppercase letters. Your task is to implement a function `count_case(s: str) -> Tuple[int, int]` that returns the number of lowercase letters and the number of uppercase letters in the string. The function should tak...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_case('Hello World!') == (8, 2)\", \"assert count_case('abcDEF') == (3, 3)\", \"assert count_case('') == (0, 0)\", \"assert count_case('Python3') == (5, 1)\", \"assert count_case('ALLUPPER') == (0, 8)\", \"assert count_case('alllower') == (8, 0)\", \"as...
{ "split": "train", "index": 63900, "acecode_id": "bigcode_python_fns_22505", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of strings representing years, you need to implement a function that takes this list and returns a new list with all leading and trailing whitespace removed from each year string. The years should be returned in the same order as they were inputted. If a year is an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert clean_years([' 1990 ', '2000', ' 2020 ', ' ', '2021 ']) == ['1990', '2000', '2020', '2021']\", \"assert clean_years([' 1985 ', ' 1995', ' 2005 ', ' ']) == ['1985', '1995', '2005']\", \"assert clean_years([' ', ' ', ' ']) == []\", \"assert cle...
{ "split": "train", "index": 63901, "acecode_id": "bigcode_python_fns_33756", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of dictionaries representing projects, each containing 'projectName' and 'remark', implement a function that takes this list and returns a new list of project names that have a remark containing the word 'important'. The input will be a list of dictionaries where e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_important_projects([{'projectName': 'Project C', 'remark': 'Important milestone'}, {'projectName': 'Project D', 'remark': 'Keep it up'}]) == ['Project C']\", \"assert filter_important_projects([{'projectName': 'Project E', 'remark': 'Urgent task'}, {'...
{ "split": "train", "index": 63902, "acecode_id": "bigcode_python_fns_4333", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that validates a United States postal zip code. The function should accept a string representing the zip code and return True if it is valid according to the following rules: it must be either a five-digit zip code (e.g., '12345') or a nine-digit zip code i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_zip('12345') == True\", \"assert validate_zip('12345-6789') == True\", \"assert validate_zip('1234') == False\", \"assert validate_zip('123456') == False\", \"assert validate_zip('12345-123') == False\", \"assert validate_zip('12345-67890') == False...
{ "split": "train", "index": 63903, "acecode_id": "evol_8892", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a sorted singly linked list, write a function to insert a new value into the list while maintaining the sorted order. The function should handle edge cases such as inserting into an empty list or inserting at the beginning or end of the list. You need to implement a funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert insert_into_sorted_linked_list(Node(1), 0).data == 0\", \"assert insert_into_sorted_linked_list(Node(1), 1).data == 1\", \"assert insert_into_sorted_linked_list(Node(1), 2).next.data == 2\", \"assert insert_into_sorted_linked_list(Node(3), 2).data == 2\", \"...
{ "split": "train", "index": 63904, "acecode_id": "evol_18138", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the contributions of outbound links from a page to the rank of other pages. The contribution of each outbound link is determined by dividing the rank of the page by the total number of outbound links. Implement the function `computeContribs(urls:...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert computeContribs(['a.com', 'b.com'], 10.0) == [('a.com', 5.0), ('b.com', 5.0)]\", \"assert computeContribs(['example.com'], 20.0) == [('example.com', 20.0)]\", \"assert computeContribs(['link1.com', 'link2.com', 'link3.com'], 15.0) == [('link1.com', 5.0), ('l...
{ "split": "train", "index": 63905, "acecode_id": "oss_8113", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of bars in a histogram. Your task is to write a function that calculates the maximum area of a rectangle that can be formed in the histogram. The width of each bar is 1. The function should return an integer value repres...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_histogram_area([2, 1, 5, 6, 2, 3]) == 10\", \"assert max_histogram_area([1, 1, 1, 1]) == 4\", \"assert max_histogram_area([5, 4, 1, 2]) == 8\", \"assert max_histogram_area([0]) == 0\", \"assert max_histogram_area([1, 0, 1]) == 1\", \"assert max_histogram...
{ "split": "train", "index": 63906, "acecode_id": "oss_1118", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes two lists of numbers. The function should calculate the mean and standard deviation of each list and return a tuple containing the mean and standard deviation of both lists in the format: (list1_mean, list1_std, list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_validation_arrays([0, 0, 0], [1, 1, 1]) == (0.0, 0.0, 1.0, 0.0)\", \"assert process_validation_arrays([-1, -2, -3], [1, 2, 3]) == (-2.0, 0.816496580927726, 2.0, 0.816496580927726)\", \"assert process_validation_arrays([1, 1, 1, 1], [2, 2, 2, 2]) == (...
{ "split": "train", "index": 63907, "acecode_id": "oss_28630", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks if a given user ID is in a predefined list of contributors. The function should take two inputs: a user ID (as a string) and a list of contributor IDs (also as strings). The function should return True if the user ID is in the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_contributor('123', ['123', '456', '789']) == True\", \"assert check_contributor('456', ['123', '456', '789']) == True\", \"assert check_contributor('789', ['123', '456', '789']) == True\", \"assert check_contributor('abc', ['abc', 'def', 'ghi']) == Tru...
{ "split": "train", "index": 63908, "acecode_id": "bigcode_python_fns_43373", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Create a function called `employee_description` that takes three parameters: `full_name` (a string representing the employee's complete legal name), `years_experience` (an integer representing the cumulative years of professional experience), and `department` (a string represen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert employee_description('John Doe', 5, 'Engineering') == 'Employee Name: John Doe, Years of Experience: 5, Department: Engineering'\", \"assert employee_description('Jane Smith', 10, 'Marketing') == 'Employee Name: Jane Smith, Years of Experience: 10, Departmen...
{ "split": "train", "index": 63909, "acecode_id": "evol_24135", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a boolean value indicating whether debugging is enabled, implement a function `debug_error_message(msg: str, debug: bool) -> Optional[str]` that returns the error message `msg` if debugging is enabled (`debug` is True). If debugging is not enabled (`debug` is False), the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert debug_error_message('An error occurred', True) == 'An error occurred'\", \"assert debug_error_message('An error occurred', False) == None\", \"assert debug_error_message('File not found', True) == 'File not found'\", \"assert debug_error_message('Invalid inp...
{ "split": "train", "index": 63910, "acecode_id": "bigcode_python_fns_40910", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that transforms a quantum operator using a given projection operator. The transformation is defined as applying the projection operator to the operator in a specified manner. Your function should take two parameters: a list of project...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transform([1.0, 0.5, 0.0], [2.0, 3.0, 4.0]) == [2.0, 1.5, 0.0]\", \"assert transform([0.0, 1.0, 2.0], [1.0, 1.0, 1.0]) == [0.0, 1.0, 2.0]\", \"assert transform([], []) == []\", \"assert transform([0.5], [10.0]) == [5.0]\", \"assert transform([1.0, 2.0], [3.0...
{ "split": "train", "index": 63911, "acecode_id": "oss_4657", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `text`, you need to implement a function `raw(text: str) -> str` that returns a new string where specific characters are replaced by their corresponding escape sequences based on a predefined mapping. The mapping is as follows: `{'a': '@', 'e': '3', 'i': '1', 'o'...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert raw('hello') == 'h3ll0'\", \"assert raw('python') == 'pyth0n'\", \"assert raw('abc') == '@bc'\", \"assert raw('is it') == '1$ 1t'\", \"assert raw('no') == 'n0'\", \"assert raw('hello world') == 'h3ll0 w0rld'\", \"assert raw('abcde') == '@bcd3'\", \"assert ra...
{ "split": "train", "index": 63912, "acecode_id": "bigcode_python_fns_48770", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with parsing a JSON string containing a list of objects with keys 'name' and 'age'. Implement a function that filters the objects based on a minimum age threshold, sorts the filtered objects by a specified key ('name' or 'age') in either ascending or descending o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert json_parser('[{\\\"name\\\": \\\"alice\\\", \\\"age\\\": 30}, {\\\"name\\\": \\\"bob\\\", \\\"age\\\": 22}]', 25, 'age', 'descending') == (1, [{\\\"name\\\": \\\"alice\\\", \\\"age\\\": 30}])\", \"assert json_parser('[{\\\"name\\\": \\\"charlie\\\", \\\"age\...
{ "split": "train", "index": 63913, "acecode_id": "evol_31202", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a simple bank account operation. Implement a function `bank_account_operations` that takes in three parameters: an initial balance (a float), a deposit amount (a float), and a withdrawal amount (a float). The function should perform the following ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bank_account_operations(500, 200, 50) == 650.0\", \"assert bank_account_operations(500, 0, 50) == 450.0\", \"assert bank_account_operations(200, 100, 100) == 200.0\", \"assert bank_account_operations(400, 50, 300) == 150.0\", \"assert bank_account_operations...
{ "split": "train", "index": 63914, "acecode_id": "oss_35262", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Implement a function that decodes a given string encrypted with Base64 encoding. The function should correct any padding issues with the input string and return the decoded result as a UTF-8 string. If the input string cannot be decoded, return an error message. The function sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert decode_base64('SGVsbG8gd29ybGQ=') == 'Hello world'\", \"assert decode_base64('U29tZSBzZWNyZXQgdGV4dA==') == 'Some secret text'\", \"assert decode_base64('VGVzdCBzdHJpbmc=') == 'Test string'\", \"assert decode_base64('QmFzZTY0IGVuY29kaW5n') == 'Base64 encodin...
{ "split": "train", "index": 63915, "acecode_id": "evol_10905", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `createList` that takes in a list of parameters and returns a new list based on the following rules: 1. If the parameter is a positive integer, add it to the new list. 2. If the parameter is a string, add its length to the new list. 3...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert createList([5, 'hello', [3, 'world']]) == [5, 5, 3, 5]\", \"assert createList([1, 2, 3]) == [1, 2, 3]\", \"assert createList(['a', 'b', 'c']) == [1, 1, 1]\", \"assert createList([]) == []\", \"assert createList([10, 'test', [1, 'a', [2, 'b']]]) == [10, 4, 1,...
{ "split": "train", "index": 63916, "acecode_id": "oss_12366", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with updating a device configuration based on new security keys and a new device ID. Write a function `update_device_config(old_config: Dict[str, Any], new_device: str, new_keys: Dict[str, str]) -> Dict[str, Any]` that takes an old configuration dictionary, a new...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_device_config({'usb_path': 'device1', 's0_legacy_key': 'old_key1', 's2_access_control_key': 'old_key2', 's2_authenticated_key': 'old_key3', 's2_unauthenticated_key': 'old_key4'}, 'device2', {'s0_legacy_key': 'new_key1', 's2_access_control_key': 'new_k...
{ "split": "train", "index": 63917, "acecode_id": "bigcode_python_fns_2714", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a string `sentence`, write a function `separate_sentences` that takes a sentence as input and returns a list of sentences separated by any of the following punctuation marks: comma (`,`), colon (`:`), or semicolon (`;`). If there are no such punctuation marks in the sente...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert separate_sentences('Hello, world; how are you: today?') == ['Hello', ' world', ' how are you', ' today?']\", \"assert separate_sentences('This is a test sentence.') == ['This is a test sentence.']\", \"assert separate_sentences('First part, second part: and ...
{ "split": "train", "index": 63918, "acecode_id": "bigcode_python_fns_17849", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the configuration of an application based on the provided settings. The function should take two boolean parameters, `testing` and `cli`. If `testing` is True, the function should return the string 'Application is in testin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert configure_app(False, False) == 'Application is in normal mode.'\", \"assert configure_app(True, False) == 'Application is in testing mode.'\", \"assert configure_app(False, True) == 'Application is running in command-line interface mode.'\", \"assert configu...
{ "split": "train", "index": 63919, "acecode_id": "bigcode_python_fns_21865", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `rounded_avg_custom_base(n, m, base)` that calculates the divisor-weighted average of all integers from n to m (inclusive). The average should be rounded to the nearest integer and returned in a unique base system specified by the inp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rounded_avg_custom_base(1, 5, 2) == '0b11'\", \"assert rounded_avg_custom_base(1, 5, 10) == '3'\", \"assert rounded_avg_custom_base(3, 7, 2) == '0b101'\", \"assert rounded_avg_custom_base(3, 7, 10) == '5'\", \"assert rounded_avg_custom_base(10, 20, 2) == '0b...
{ "split": "train", "index": 63920, "acecode_id": "evol_15625", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Write a function that takes a string as input and splits it into words. The function should return a dictionary containing the frequency of each word in the string and a list of unique palindromic words found in the string.\nPlease reason step by step, then write a self-contain...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert analyze_string('madam arora teaches malayalam') == ({'madam': 1, 'arora': 1, 'teaches': 1, 'malayalam': 1}, ['madam', 'arora', 'malayalam'])\", \"assert analyze_string('hello world') == ({'hello': 1, 'world': 1}, [])\", \"assert analyze_string('level civic r...
{ "split": "train", "index": 63921, "acecode_id": "evol_2719", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a list of quads representing a fictional instance in a system. Each quad is a tuple consisting of four elements: (type, name, identifier, state). The function should take a string parameter 'slug' and return a list of quads...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_instance_quads('oka') == [('INSTANCE', 'Oka Instance', 'oka', 'ACTIVE')]\", \"assert generate_instance_quads('test') == [('INSTANCE', 'Test Instance', 'test', 'ACTIVE')]\", \"assert generate_instance_quads('sample') == [('INSTANCE', 'Sample Instance...
{ "split": "train", "index": 63922, "acecode_id": "bigcode_python_fns_23708", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers `num_list` and a target integer `target_num`, implement a function `find_nearest(num_list, target_num)` that returns the nearest whole number from `num_list` to `target_num`. If there are two numbers equally close to `target_num`, return the smaller num...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_nearest([3, 6, 9, 12, 15], 10) == 9\", \"assert find_nearest([1, 2, 3, 4], 2.5) == 2\", \"assert find_nearest([10, 20, 30], 25) == 20\", \"assert find_nearest([-5, -2, 0, 3, 6], 1) == 0\", \"assert find_nearest([100, 200, 300], 250) == 200\", \"assert f...
{ "split": "train", "index": 63923, "acecode_id": "evol_20630", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of dictionaries representing SSH keys, each containing a 'label' and a 'uuid', write a function `list_ssh_keys(keys: List[Dict[str, str]], label_filter: Optional[str] = None) -> List[str]` that returns a list of strings formatted as 'label: {label}, uuid: {uuid}' f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list_ssh_keys([{'label': 'key1', 'uuid': '123'}, {'label': 'key2', 'uuid': '456'}]) == ['label: key1, uuid: 123', 'label: key2, uuid: 456']\", \"assert list_ssh_keys([{'label': 'key1', 'uuid': '123'}, {'label': 'key2', 'uuid': '456'}], 'key1') == ['label: ke...
{ "split": "train", "index": 63924, "acecode_id": "bigcode_python_fns_29186", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are working on a machine learning project that requires generating configuration strings based on a template. Your task is to write a Python function that takes specific parameters and replaces placeholders in a template string with the provided values. The placeholders in ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_config_string('@dropout, @lr, @batchnorm, @batchsize, @scheduler', 0.5, 0.001, True, 32, False) == '0.5, 0.001, True, 32, False'\", \"assert generate_config_string('Configuration: @dropout, @lr, Batch Size: @batchsize', 0.3, 0.005, True, 16, False) ...
{ "split": "train", "index": 63925, "acecode_id": "oss_32286", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that checks if a given variable is a string. If it is a string and it can be converted to an integer, typecast it to an integer. If it cannot be converted to an integer, return the original string. If the variable is not a string, return it unchanged.\nPlease r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert string_to_integer('42') == 42\", \"assert string_to_integer('hello') == 'hello'\", \"assert string_to_integer('1000') == 1000\", \"assert string_to_integer('3.14') == '3.14'\", \"assert string_to_integer('NaN') == 'NaN'\", \"assert string_to_integer('123abc'...
{ "split": "train", "index": 63926, "acecode_id": "evol_24833", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a list of integers as input and returns the sum of the squares of all the even numbers in the list. Your function should be named `sum_of_squares_of_even_numbers` and should accept a single parameter: - `numbers`: a list of...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_squares_of_even_numbers([1, 2, 3, 4, 5, 6]) == 56\", \"assert sum_of_squares_of_even_numbers([0, 1, 2, 3, 4]) == 20\", \"assert sum_of_squares_of_even_numbers([7, 9, 11]) == 0\", \"assert sum_of_squares_of_even_numbers([]) == 0\", \"assert sum_of_squa...
{ "split": "train", "index": 63927, "acecode_id": "oss_2935", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that organizes a list of module imports into a hierarchical structure. Each module import is represented as a string, and the hierarchy is determined by the dot-separated segments of the import path. Write a Python function called ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert organize_imports(['a.b.c', 'a.b', 'a.c.d']) == {'a': {'b': {'c': {}}, 'c': {'d': {}}}}\", \"assert organize_imports(['x.y.z', 'x.y', 'x.p.q']) == {'x': {'y': {'z': {}}, 'p': {'q': {}}}}\", \"assert organize_imports(['single.level']) == {'single': {'level': {...
{ "split": "train", "index": 63928, "acecode_id": "oss_15315", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `is_sha3_256_hash(value: str) -> bool` that checks if the input string `value` is a valid SHA-3 256 hash. A valid SHA-3 256 hash is a string that consists of exactly 64 characters, and all characters must be hexadecimal digits (0-9, a-f, A-F). The function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_sha3_256_hash('a3f3c8d7e0f6b3f245c1cd1cfa1c9c3a7f5d5a2b4cfc3e4e5c4a0f6b8d7e2a1a') == True\", \"assert is_sha3_256_hash('1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef') == True\", \"assert is_sha3_256_hash('G3f3c8d7e0f6b3f245c1cd1cfa1c9c...
{ "split": "train", "index": 63929, "acecode_id": "bigcode_python_fns_4042", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that simulates loading binary data from a given filename. The function should take a single parameter, `filename`, which is a string representing the name of the file. The function should return a string that represents the content of the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert load_data('file1') == '48656c6c6f2c20576f726c6421'\", \"assert load_data('file2') == '54686973206973206120746573742e'\", \"assert load_data('file3') == 'File not found'\", \"assert load_data('file4') == 'File not found'\", \"assert load_data('file5') == 'Fil...
{ "split": "train", "index": 63930, "acecode_id": "bigcode_python_fns_49928", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `validate_postal_code(postal_code: str) -> bool` that checks if a given postal code is valid according to the USA format. A valid postal code can either be a 5-digit number (e.g., '12345') or a 10-digit number formatted as '12345-6789'. Your function should...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_postal_code('12345') == True\", \"assert validate_postal_code('12345-6789') == True\", \"assert validate_postal_code('1234') == False\", \"assert validate_postal_code('123456') == False\", \"assert validate_postal_code('12345-') == False\", \"assert...
{ "split": "train", "index": 63931, "acecode_id": "evol_25315", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that takes a list of integers and returns the sum of all even numbers in the list. The function should only accept lists of integers and return a single integer representing the sum. If the list is empty, the function should return 0. Impl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([10, 15, 20, 25]) == 30\", \"assert sum_of_evens([0, 2, 4, 6]) == 12\", \"assert sum_of_evens([-2, -4, -6]) == -12\", \"assert sum_of_evens([-1, -3, -5]) == 0\", \"assert sum_of_evens([]) == 0\", \"...
{ "split": "train", "index": 63932, "acecode_id": "oss_4572", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 9-digit number, determine if it is pandigital. A number is classified as pandigital if it incorporates all the digits from 1 to 9 precisely once. Your task is to implement a function that checks if a given 9-digit number is pandigital. The function should return True if...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_pandigital(123456789) == True\", \"assert is_pandigital(987654321) == True\", \"assert is_pandigital(123123456) == False\", \"assert is_pandigital(123456780) == False\", \"assert is_pandigital(111111111) == False\", \"assert is_pandigital(12345678) == Fal...
{ "split": "train", "index": 63933, "acecode_id": "evol_33104", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a time in 12-hour format (hh:mm) as a string, return the time in AP style format (hh:mm) without the leading zero for the hour. The input will always be a valid string representing a time in the format 'hh:mm'. For example, '01:30' should return '1:30', and '12:45' should...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert ap_time_filter('01:30') == '1:30'\", \"assert ap_time_filter('12:00') == '12:00'\", \"assert ap_time_filter('03:15') == '3:15'\", \"assert ap_time_filter('10:45') == '10:45'\", \"assert ap_time_filter('11:59') == '11:59'\", \"assert ap_time_filter('12:01') =...
{ "split": "train", "index": 63934, "acecode_id": "bigcode_python_fns_37180", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that processes a dictionary containing various configuration parameters for a cloud service. Your function should remove any key-value pairs where the value is `None` and return the modified dictionary. Given a dictionary of pa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_config_params({'key1': 'value1', 'key2': None, 'key3': 'value3'}) == {'key1': 'value1', 'key3': 'value3'}\", \"assert process_config_params({'a': None, 'b': None}) == {}\", \"assert process_config_params({'x': 1, 'y': None, 'z': 3}) == {'x': 1, 'z': ...
{ "split": "train", "index": 63935, "acecode_id": "oss_28648", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks if two competitions are identical based on their attributes: the number of participants, the duration in minutes, and the prize amount in dollars. Your function should take two tuples as input, where each tuple contains th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert are_competitions_equal((10, 30, 5000), (10, 30, 5000)) == True\", \"assert are_competitions_equal((5, 15, 2000), (10, 30, 5000)) == False\", \"assert are_competitions_equal((8, 60, 3000), (8, 60, 3000)) == True\", \"assert are_competitions_equal((1, 5, 100),...
{ "split": "train", "index": 63936, "acecode_id": "oss_26031", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given an object called `args` which can contain various attributes representing different sample identifiers. Your task is to implement a function `has_sample(args)` that checks if any of the following attributes in the `args` object are truthy: `sample`, `samples`, or ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert has_sample(type('Args', (object,), {'sample': None, 'samples': None, 'sample_tag': None})) == False\", \"assert has_sample(type('Args', (object,), {'sample': '', 'samples': None, 'sample_tag': None})) == False\", \"assert has_sample(type('Args', (object,), {...
{ "split": "train", "index": 63937, "acecode_id": "bigcode_python_fns_13398", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes and validates car data received from a web request. The function should take in three parameters: `body_type`, `mileage`, and `mileage_unit`. The `body_type` parameter represents the type of car body (e.g., sedan, SU...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_car_data('sedan', 100, 'miles') == {'body_type': 'sedan', 'mileage': 160}\", \"assert process_car_data('hatchback', 300, 'kilometers') == {'body_type': 'hatchback', 'mileage': 300}\", \"assert process_car_data('coupe', 75, 'miles') == {'body_type': '...
{ "split": "train", "index": 63938, "acecode_id": "oss_8668", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of tasks, each represented as a dictionary containing the task's ID, status, and status message. Your task is to implement a function that checks the status of tasks and determines which tasks have fully failed (exceeded the number of retries) or are cancel...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_task_status([{'task-id': 1, 'task-status': 'SUCCESS', 'status-message': 'Task completed successfully.'}, {'task-id': 2, 'task-status': 'FAILURE', 'status-message': 'Error occurred.'}, {'task-id': 3, 'task-status': 'CANCELED', 'status-message': 'Task wa...
{ "split": "train", "index": 63939, "acecode_id": "bigcode_python_fns_42248", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `check_domain_status(host: str, publish: str = 'off', start_new: str = 'on', all: str = 'done', ignoreMismatch: str = 'on') -> dict` that simulates the behavior of requesting a scan for a target domain. The function should take in a s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_domain_status('example.com') == {'status': 'READY'}\", \"assert check_domain_status('example.com', 'on') == {'status': 'READY'}\", \"assert check_domain_status('example.com', 'off', 'off') == {'status': 'READY'}\", \"assert check_domain_status('example...
{ "split": "train", "index": 63940, "acecode_id": "bigcode_python_fns_32468", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a basic notification system. Your goal is to create a notifier that allows for sending different types of messages (email, SMS, and push notifications) to a specified recipient. You need to implement a single function called `send_notification` ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert send_notification('user@example.com', 'email', {'subject': 'Hello', 'body': 'This is a test email'}) == 'Email notification sent to user@example.com'\", \"assert send_notification('user@example.com', 'sms', {'text': 'This is a test SMS'}) == 'SMS notificatio...
{ "split": "train", "index": 63941, "acecode_id": "oss_33633", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes train requests for a transportation system. Each train request is defined by three pieces of data: `request_data`, `docs_data`, and `groundtruth_data`. Your function should accept these three inputs and return a formatt...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_train_request('Train A', 'Doc A', 'GT A') == 'Request: Train A, Documentation: Doc A, Ground Truth: GT A'\", \"assert process_train_request('Train B', 'Doc B', 'GT B') == 'Request: Train B, Documentation: Doc B, Ground Truth: GT B'\", \"assert proces...
{ "split": "train", "index": 63942, "acecode_id": "oss_28063", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list that may contain elements of any data type. Implement a function that counts the total number of elements in the list and finds the frequency of each unique element in the list. The function should return a dictionary where the keys are the unique elements ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_and_frequency([1, 2, 2, 3]) == {1: 1, 2: 2, 3: 1}\", \"assert count_and_frequency(['a', 'b', 'a']) == {'a': 2, 'b': 1}\", \"assert count_and_frequency([1, 1, 1, 1]) == {1: 4}\", \"assert count_and_frequency([]) == {}\", \"assert count_and_frequency(['a...
{ "split": "train", "index": 63943, "acecode_id": "evol_23411", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates waiting for a user event based on a given mask. The function should take an integer mask, an optional key represented as a string, an optional mouse position represented as a tuple of (x, y) coordinates, and a boolean i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert wait_event(0, None, None, False) == 0\", \"assert wait_event(1, 'A', None, False) == 1\", \"assert wait_event(2, None, (100, 200), False) == 2\", \"assert wait_event(3, None, None, True) == 3\", \"assert wait_event(4, 'B', (150, 250), True) == 1\", \"assert ...
{ "split": "train", "index": 63944, "acecode_id": "bigcode_python_fns_20427", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `inorder_traversal(root)` that returns the values of a binary search tree (BST) in ascending order as a list. The function takes the root of the BST as input and assumes that the input tree is valid. The nodes in the BST have unique v...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert inorder_traversal(TreeNode(7, TreeNode(3), TreeNode(15, TreeNode(9), TreeNode(20)))) == [3, 7, 9, 15, 20]\", \"assert inorder_traversal(TreeNode(5, TreeNode(2, TreeNode(1), TreeNode(3)), TreeNode(8))) == [1, 2, 3, 5, 8]\", \"assert inorder_traversal(TreeNode...
{ "split": "train", "index": 63945, "acecode_id": "evol_11421", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that determines the incoming mail server port based on the protocol (IMAP or POP3) and whether SSL is used. The function should take in a dictionary object `doc` containing the attributes `use_ssl` (a boolean indicating SSL usage) ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_incoming_mail_port({'use_ssl': True, 'protocol': 'IMAP'}) == 993\", \"assert get_incoming_mail_port({'use_ssl': False, 'protocol': 'IMAP'}) == 143\", \"assert get_incoming_mail_port({'use_ssl': True, 'protocol': 'POP3'}) == 995\", \"assert get_incoming_m...
{ "split": "train", "index": 63946, "acecode_id": "oss_34787", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a simple online store's functionality with a focus on managing a list of products. Write a function `manage_store` that takes a list of product dictionaries and a list of cart operations. Each product dictionary has the keys 'name', 'price', and '...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_store([{'name': 'Product 1', 'price': 10.0, 'quantity': 100}, {'name': 'Product 2', 'price': 20.0, 'quantity': 50}], [('add', 'Product 1', 2)]) == ['Product added to cart successfully']\", \"assert manage_store([{'name': 'Product 1', 'price': 10.0, 'q...
{ "split": "train", "index": 63947, "acecode_id": "oss_17652", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Write a function `sum_of_primes(arr)` that takes an array of integers as input and returns the sum of all the prime numbers in that array. For example, given the array [2, 3, 4, 5, 6, 7], the function should return 17, since 2, 3, 5, and 7 are prime numbers and their sum is 17....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_primes([2, 3, 4, 5, 6, 7]) == 17\", \"assert sum_of_primes([10, 15, 20]) == 0\", \"assert sum_of_primes([1, 2, 3, 4, 5]) == 10\", \"assert sum_of_primes([-5, -3, 0, 1, 2]) == 2\", \"assert sum_of_primes([11, 13, 17]) == 41\", \"assert sum_of_primes([4...
{ "split": "train", "index": 63948, "acecode_id": "evol_13861", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `find_duplicates` that takes the root of a binary tree and returns a list of duplicate values found in the tree, using preorder traversal. The values in the returned list should be unique and in any order.\nPlease reason step by step, then write a self-cont...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_duplicates(None) == []\", \"assert find_duplicates(TreeNode(1)) == []\", \"assert find_duplicates(TreeNode(1, TreeNode(1), TreeNode(2))) == [1]\", \"assert find_duplicates(TreeNode(1, TreeNode(2), TreeNode(1))) == [1]\", \"assert find_duplicates(TreeNod...
{ "split": "train", "index": 63949, "acecode_id": "evol_7703", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `calculate_dice_coefficient(sentence1: str, sentence2: str) -> float` that calculates the Dice's coefficient for two given sentences. The Dice's coefficient is a statistical measure of the similarity between two sets, calculated as `2 * |A ∩ B| / (|A| + |B|...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_dice_coefficient('Hello world', 'Hello there') == 0.5\", \"assert calculate_dice_coefficient('The quick brown fox', 'The quick blue hare') == 0.5\", \"assert calculate_dice_coefficient('Data science', 'Science data') == 1.0\", \"assert calculate_di...
{ "split": "train", "index": 63950, "acecode_id": "evol_3135", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple user account management system. Write a function `manage_accounts(operations: List[Tuple[str, str, str]]) -> List[str]` where `operations` is a list of tuples representing user account operations. Each tuple contains three elements: an ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_accounts([('create', 'user1', 'pass1'), ('create', 'user2', 'pass2'), ('update', 'user1', 'new_pass1'), ('delete', 'user2', '')]) == ['Account created', 'Account created', 'Account updated', 'Account deleted']\", \"assert manage_accounts([('create', '...
{ "split": "train", "index": 63951, "acecode_id": "oss_10824", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two 2-dimensional matrices `a` and `b` of shape (n, m_a) and (n, m_b) respectively, where both matrices have the same number of rows (n). Your task is to implement a function `tensor_product(a: List[List[float]], b: List[List[float]], reshape: bool = True) -> List...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert tensor_product([[1]], [[2]], True) == [[2]]\", \"assert tensor_product([[1]], [[2]], False) == [[[2]]]\", \"assert tensor_product([[1, 0], [0, 1]], [[1, 1], [1, 1]], True) == [[1, 1, 0, 0], [0, 0, 1, 1]]\", \"assert tensor_product([[1, 2]], [[3, 4]], True) =...
{ "split": "train", "index": 63952, "acecode_id": "bigcode_python_fns_42632", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Given an iterator of integers, implement a function `first_item(iterator)` that returns the first item from the iterator. If the iterator is empty, the function should return `None`. You may assume that the iterator can only contain integers. Your implementation should handle t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert first_item(iter([])) == None\", \"assert first_item(iter([1, 2, 3])) == 1\", \"assert first_item(iter([0])) == 0\", \"assert first_item(iter([-1, -2, -3])) == -1\", \"assert first_item(iter([5, 10, 15, 20])) == 5\", \"assert first_item(iter([])) == None\", \...
{ "split": "train", "index": 63953, "acecode_id": "bigcode_python_fns_24519", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `find_divisible_numbers()` that returns the first 10 numbers that are divisible by both a prime number greater than 10 and its square. The function should not take any parameters and should return a list of the first 10 such numbers.\nPlease reason step by step...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_divisible_numbers() != []\", \"assert len(find_divisible_numbers()) == 10\", \"assert all(x > 10 for x in find_divisible_numbers())\", \"assert find_divisible_numbers()[0] == 121\", \"assert find_divisible_numbers()[1] == 169\", \"assert find_divisible_...
{ "split": "train", "index": 63954, "acecode_id": "evol_29600", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Write a function `calculate_circle_and_sphere_properties(radius)` that accepts a dynamic radius as input. The function should calculate and return the circumference and area of a circle with the given radius, as well as the total surface area and volume of a sphere with the sam...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_circle_and_sphere_properties(1) == (6.283185307179586, 3.141592653589793, 12.566370614359172, 4.1887902047863905)\", \"assert calculate_circle_and_sphere_properties(2) == (12.566370614359172, 12.566370614359172, 50.26548245743669, 33.51032163829112...
{ "split": "train", "index": 63955, "acecode_id": "evol_3638", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Implement a function `is_palindrome_string(s: str) -> bool` that checks if a given string forms a palindrome, while ignoring spaces, punctuation, and case sensitivity. The function should return True if the cleaned string is a palindrome and False otherwise. A palindrome is def...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_palindrome_string('A man, a plan, a canal: Panama') == True\", \"assert is_palindrome_string('race a car') == False\", \"assert is_palindrome_string(' ') == True\", \"assert is_palindrome_string('No lemon, no melon') == True\", \"assert is_palindrome_stri...
{ "split": "train", "index": 63956, "acecode_id": "evol_11401", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a 2D array (list of lists) representing an arena with different shapes denoted by integers. Your task is to implement a function `assign_shape(extent, x_pos, y_pos)` that takes in the extent (a floating-point number), and the coordinates (x_pos and y_pos) of a pos...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert assign_shape(0.5, 0, 0) == 3\", \"assert assign_shape(0.8, 1, 1) == 4\", \"assert assign_shape(0.3, 2, 2) == 3\", \"assert assign_shape(0.9, 3, 3) == 4\", \"assert assign_shape(0.7, 4, 4) == 3\", \"assert assign_shape(0.79, 0, 1) == 3\", \"assert assign_shap...
{ "split": "train", "index": 63957, "acecode_id": "oss_2513", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Implement a function that returns a list of all prime numbers up to a given integer 'n'. The function should optimize the search for prime numbers to enhance both time and space complexity. You may assume that 'n' is a non-negative integer.\nPlease reason step by step, then wri...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert search_prime_numbers(0) == []\", \"assert search_prime_numbers(1) == []\", \"assert search_prime_numbers(2) == [2]\", \"assert search_prime_numbers(3) == [2, 3]\", \"assert search_prime_numbers(4) == [2, 3]\", \"assert search_prime_numbers(5) == [2, 3, 5]\",...
{ "split": "train", "index": 63958, "acecode_id": "evol_23289", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that sets a user agent string for a web request. Given a user agent string, your function should return a formatted string that confirms the user agent has been set. The function signature should be: `def set_user_agent(user_agent: str) -...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_user_agent('Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3') == 'User agent set to: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 ...
{ "split": "train", "index": 63959, "acecode_id": "bigcode_python_fns_25839", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two arrays of integers, `X` and `centers`, and an integer `k`, write a function `find_k_nearest_indices(X: List[int], centers: List[int], k: int) -> List[List[int]]` that returns a list of indices representing the `k` nearest elements in `X` for each element in `centers`....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_k_nearest_indices([1, 3, 5, 7], [2, 6], 2) == [[0, 1], [2, 3]]\", \"assert find_k_nearest_indices([4, 1, 7, 3], [5], 1) == [[0]]\", \"assert find_k_nearest_indices([10, 20, 30], [15, 25], 2) == [[0, 1], [1, 2]]\", \"assert find_k_nearest_indices([1, 2, ...
{ "split": "train", "index": 63960, "acecode_id": "bigcode_python_fns_9790", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a string s, write a function that extracts the first sentence from the string. A sentence is defined as a sequence of characters that ends with a period (.), followed by a whitespace character (e.g., a space or newline). The function should also remove any carriage return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_first_sentence('Hello world. This is a test.') == 'Hello world. '\", \"assert extract_first_sentence('This is a sentence without a period') == ''\", \"assert extract_first_sentence('One. Two. Three.') == 'One. '\", \"assert extract_first_sentence('No...
{ "split": "train", "index": 63961, "acecode_id": "bigcode_python_fns_48428", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given a list of time intervals representing calibration periods for a product and a list of data columns with associated metadata. Each data column has a time series and calibration parameters. Your task is to determine how many data columns can be successfully calibrat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_calibrated_columns([{'time': [1, 2, 3], 'meta': {'PCF_CURTX': 1, 'NIXS': 1}, 'values': [10, 20, 30]}, {'time': [1, 2, 3], 'meta': {'PCF_CURTX': None, 'NIXS': 1}, 'values': [10, 20, 30]}, {'time': [1, 2, 3], 'meta': {'PCF_CURTX': 1, 'NIXS': None}, 'valu...
{ "split": "train", "index": 63962, "acecode_id": "bigcode_python_fns_22437", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a speech recognition command system. The function, `recognize_command`, should accept a list of spoken commands (strings) and return the recognized command in lowercase. If a command is not recognized (if it is an empty str...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert recognize_command(['Turn on the lights', 'Play music', '']) == 'play music'\", \"assert recognize_command(['', 'Open the door', 'Close the window']) == 'close the window'\", \"assert recognize_command(['Hello', 'How are you?', '']) == 'how are you?'\", \"ass...
{ "split": "train", "index": 63963, "acecode_id": "bigcode_python_fns_21567", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the management of snapshot files for a scientific computing application. The function should take a list of snapshot file names as input and perform the following actions: \n\n1. If 'wave.out' exists in the list of snap...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_snapshots(['snapshot0_1', 'snapshot0_2', 'wave.out', 'running']) == ('snapshot0_2', ['snapshot0_1', 'snapshot0_2'], [' '])\", \"assert manage_snapshots(['snapshot1', 'snapshot2', 'wave.out']) == (None, ['snapshot1', 'snapshot2'], [' '])\", \"assert ma...
{ "split": "train", "index": 63964, "acecode_id": "oss_13242", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Implement a Python function that calculates the maximum depth of a binary tree represented by a list of integers. The list contains values in a level-order traversal format, where 'None' represents empty nodes. The function should return the maximum depth of the binary tree. Fo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_depth([3, 9, 20, None, None, 15, 7]) == 3\", \"assert find_depth([1, 2, 3, None, None, 4, 5]) == 3\", \"assert find_depth([1, None, 2]) == 2\", \"assert find_depth([]) == 0\", \"assert find_depth([1, 2, 3, 4, None, None, 5]) == 3\", \"assert find_depth(...
{ "split": "train", "index": 63965, "acecode_id": "evol_28197", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that computes the Cross Entropy between two probability distributions. The function will take two inputs: the predicted probabilities (output from a model) and the true probabilities (target distribution). The predicted probabilities ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_cross_entropy([0.1, 0.9], [0.0, 1.0]) == 0.10536051565782628\", \"assert compute_cross_entropy([0.5, 0.5], [1.0, 0.0]) == 0.6931471805599453\", \"assert compute_cross_entropy([0.0, 1.0], [0.0, 1.0]) == 0.0\", \"assert compute_cross_entropy([1.0, 0.0]...
{ "split": "train", "index": 63966, "acecode_id": "bigcode_python_fns_27461", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks if a given string is a palindrome. A palindrome is a word, phrase, number, or other sequences of characters that reads the same forward and backward (ignoring spaces, punctuation, and capitalization). Write a function `is_pali...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_palindrome('A man, a plan, a canal: Panama') == True\", \"assert is_palindrome('racecar') == True\", \"assert is_palindrome('No lemon, no melon') == True\", \"assert is_palindrome('Hello, World!') == False\", \"assert is_palindrome('Was it a car or a cat ...
{ "split": "train", "index": 63967, "acecode_id": "oss_23761", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that takes a sentence as input and returns the number of unique words in that sentence. Your function should accept a single string parameter representing the input sentence and return an integer representing the count of uniqu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_unique_words('Hello world') == 2\", \"assert count_unique_words('Python is great and Python is fun') == 5\", \"assert count_unique_words('') == 0\", \"assert count_unique_words('Hello, hello! How are you?') == 5\", \"assert count_unique_words('One two ...
{ "split": "train", "index": 63968, "acecode_id": "oss_25682", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given a string, return a dictionary that contains the frequency of each unique character in the string. The keys of the dictionary should be the characters, and the values should be their respective counts in the string. The function should ignore case sensitivity, meaning 'a' ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert character_frequencies('Hello World') == {'h': 1, 'e': 1, 'l': 3, 'o': 2, ' ': 1, 'w': 1, 'r': 1, 'd': 1}\", \"assert character_frequencies('Python') == {'p': 1, 'y': 1, 't': 1, 'h': 1, 'o': 1, 'n': 1}\", \"assert character_frequencies('aaaAAAbbbB') == {'a': ...
{ "split": "train", "index": 63969, "acecode_id": "evol_19566", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the deletion of a message in a chat application. The function should take two parameters: a message string and a command string. If the command is not 'help', the function should return a confirmation message indicating tha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert delete_message('Hello, world!', 'delete') == 'Message deleted: Hello, world!'\", \"assert delete_message('Goodbye!', 'delete') == 'Message deleted: Goodbye!'\", \"assert delete_message('This is a test.', 'delete') == 'Message deleted: This is a test.'\", \"a...
{ "split": "train", "index": 63970, "acecode_id": "bigcode_python_fns_11388", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `find_max_sum_subarray(arr: List[int]) -> int` that returns the maximum sum of any contiguous subarray within the list. A subarray is a continuous portion of the array. You may assume that the input list will always have at least one e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_max_sum_subarray([-2, -3, -1, -5]) == -1\", \"assert find_max_sum_subarray([5, 4, -1, 7, 8]) == 23\", \"assert find_max_sum_subarray([1]) == 1\", \"assert find_max_sum_subarray([-1, -2, -3, 0]) == 0\", \"assert find_max_sum_subarray([2, 1, -5, 4, 3, -2]...
{ "split": "train", "index": 63971, "acecode_id": "bigcode_python_fns_11823", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given two lists of integers, `list_a` and `list_b`, write a function `calculate_density` that calculates the absolute difference between corresponding elements of the two lists. Then, compute the similarity score for each element in the resulting list by applying the formula: s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_density([0, 0], [1, 1]) == [0.5, 0.5]\", \"assert calculate_density([], []) == []\", \"assert calculate_density([1, 2, 3], [1, 2]) == []\", \"assert calculate_density([5, 10], [5, 10, 15]) == []\", \"assert calculate_density([5], [0]) == [0.1666666...
{ "split": "train", "index": 63972, "acecode_id": "bigcode_python_fns_195", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given a list of strings representing random variable distributions, write a function `format_distributions(distributions: List[str], formatting: str = 'plain') -> str` that formats the list into a human-readable string representation. The function should format each distributio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_distributions([], 'plain') == ''\", \"assert format_distributions(['X ~ Binomial(10, 0.5)', 'Y ~ Exponential(1)'], 'plain') == 'X ~ Binomial(10, 0.5)\\\\nY ~ Exponential(1)'\", \"assert format_distributions(['Height ~ Normal(170, 10)', 'Weight ~ Norma...
{ "split": "train", "index": 63973, "acecode_id": "bigcode_python_fns_4742", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Write a function that converts a hexadecimal string to its decimal equivalent. The input will be a valid hexadecimal string, which may include digits (0-9) and letters (a-f, A-F). The function should return the decimal integer representation of the hexadecimal string.\nPlease r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert hex_to_decimal('1A') == 26\", \"assert hex_to_decimal('FF') == 255\", \"assert hex_to_decimal('10') == 16\", \"assert hex_to_decimal('0') == 0\", \"assert hex_to_decimal('7E') == 126\", \"assert hex_to_decimal('100') == 256\", \"assert hex_to_decimal('ABCDEF...
{ "split": "train", "index": 63974, "acecode_id": "evol_24083", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating transactions in a simple banking system. Write a function named `transaction_summary` that takes a list of transactions and returns the final account balance after processing all transactions. Each transaction can either be a deposit (represented ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transaction_summary([-100]) == 0\", \"assert transaction_summary([50, -20, -10, 30]) == 50\", \"assert transaction_summary([30, -10, -20]) == 0\", \"assert transaction_summary([100, 50, 50, -200]) == 0\", \"assert transaction_summary([]) == 0\", \"assert tra...
{ "split": "train", "index": 63975, "acecode_id": "oss_3455", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a custom function that processes a list of integers and returns a list of their squares. The function should also sort the resulting list in ascending order before returning it. Your implementation should handle the following: \n\n- Input: A lis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sorted_squares([-4, -1, 0, 3, 10]) == [0, 1, 9, 16, 100]\", \"assert sorted_squares([-7, -3, 2, 3, 11]) == [4, 9, 9, 49, 121]\", \"assert sorted_squares([0]) == [0]\", \"assert sorted_squares([-5]) == [25]\", \"assert sorted_squares([]) == []\", \"assert sor...
{ "split": "train", "index": 63976, "acecode_id": "oss_21325", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a sequence of integers from 1 to m (inclusive) with one outlier, write a function that identifies the outlier, determines the next best number to replace it (the missing number in the sequence), and counts the total number of replacements made. The function should return ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fix_outlier([1, 2, 3, 5], 5) == {'outlier_index': 3, 'replace_with': 4, 'total_changes': 1}\", \"assert fix_outlier([1, 2, 4, 5], 5) == {'outlier_index': 2, 'replace_with': 3, 'total_changes': 1}\", \"assert fix_outlier([1, 3, 4, 5], 5) == {'outlier_index': ...
{ "split": "train", "index": 63977, "acecode_id": "evol_28276", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Implement a function that takes a date string in the format 'DDMMYYYY' and returns the corresponding day of the week. The function should also validate the date, ensuring it accounts for different numbers of days in each month and leap years. If the date is invalid, the functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert solve('01012020') == 'Wednesday'\", \"assert solve('29022020') == 'Saturday'\", \"assert solve('31012021') == 'Sunday'\", \"assert solve('01022021') == 'Monday'\", \"assert solve('29022021') == 'Invalid date'\", \"assert solve('30042021') == 'Friday'\", \"as...
{ "split": "train", "index": 63978, "acecode_id": "evol_915", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a date string in the format YYYYMMDD, write a function that returns the corresponding ISO week number as a string prefixed with 'w'. For example, if the input date is '20200713', the output should be 'w29'. The week number should follow the ISO 8601 standard, where the fi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert to_weeknr('20200713') == 'w29'\", \"assert to_weeknr('20230101') == 'w52'\", \"assert to_weeknr('20221231') == 'w52'\", \"assert to_weeknr('20210510') == 'w19'\", \"assert to_weeknr('20210601') == 'w22'\", \"assert to_weeknr('20220401') == 'w13'\", \"assert ...
{ "split": "train", "index": 63979, "acecode_id": "bigcode_python_fns_6927", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are working on a software system for an electric vehicle (EV) and need to implement a function that detects the pedal position at which the vehicle experiences zero torque. The function should take the current pedal position and the vehicle control system data as input and ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert detectPedalForZeroTorque(0.5, ControlSystem(12.0, 1.5)) is None\", \"assert detectPedalForZeroTorque(1.0, ControlSystem(10.0, 0.5)) is None\", \"assert detectPedalForZeroTorque(1.5, ControlSystem(9.0, 2.0)) is None\", \"assert detectPedalForZeroTorque(2.0, C...
{ "split": "train", "index": 63980, "acecode_id": "oss_22013", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that receives an array of integers and an integer, and returns true if the integer exists in the array; otherwise, return false. The array can contain both positive and negative integers, as well as duplicates.\nPlease reason step by step, then write a self...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_exist([12, 54, 92, 21], 54) == True\", \"assert check_exist([3, 5, 7, 9], 1) == False\", \"assert check_exist([-1, -2, -3, -4], -2) == True\", \"assert check_exist([10, 20, 30, 40, 50], 25) == False\", \"assert check_exist([1, 2, 3, 4, 5, 5], 5) == Tru...
{ "split": "train", "index": 63981, "acecode_id": "evol_7681", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `shuffle_array(arr: List[int]) -> List[int]` that takes a list of integers as input and returns a new list that is a pseudo-random shuffle of the original list, without using any built-in shuffle or random functions. The algorithm should ensure the executio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert shuffle_array([1, 2, 3, 4, 5]) != [1, 2, 3, 4, 5]\", \"assert len(shuffle_array([10, 20, 30, 40, 50])) == 5\", \"assert sorted(shuffle_array([5, 4, 3, 2, 1])) == [1, 2, 3, 4, 5]\", \"assert shuffle_array([]) == []\", \"assert shuffle_array([1]) == [1]\", \"a...
{ "split": "train", "index": 63982, "acecode_id": "evol_19318", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer L, which represents the length of a wire, return the number of possible integer-sided equilateral triangles that can be formed with exactly one unique triangle configuration. An equilateral triangle can only be formed if the length of the wire is a multiple of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_num_wires(20) == 0\", \"assert calculate_num_wires(120) == 0\", \"assert calculate_num_wires(3) == 1\", \"assert calculate_num_wires(6) == 1\", \"assert calculate_num_wires(9) == 1\", \"assert calculate_num_wires(15) == 1\", \"assert calculate_num_...
{ "split": "train", "index": 63983, "acecode_id": "evol_20525", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given two square matrices, `covar` and `noise`, represented as lists of lists. Write a function `check_dimension_mismatch(covar: List[List[float]], noise: List[List[float]]) -> bool` that checks if the dimensions of the two matrices are the same. The function should ret...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_dimension_mismatch([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == True\", \"assert check_dimension_mismatch([[1, 2, 3], [4, 5, 6]], [[7, 8], [9, 10]]) == False\", \"assert check_dimension_mismatch([[1]], [[2]]) == True\", \"assert check_dimension_mismatch([[1,...
{ "split": "train", "index": 63984, "acecode_id": "bigcode_python_fns_23409", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that constructs a self-balancing binary search tree (an AVL tree) from a list of integers. After inserting each integer from the list into the tree, you need to check if the tree remains balanced. A tree is considered balanced if for ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_balanced_after_insertions([1, 5, 7, 9, 11, 16]) == [True, True, True, True, True, True]\", \"assert check_balanced_after_insertions([3, 2, 1]) == [True, True, True]\", \"assert check_balanced_after_insertions([5, 3, 7, 2, 4, 6, 8]) == [True, True, True...
{ "split": "train", "index": 63985, "acecode_id": "evol_5043", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a string representing Python source code, return a list of all unique module names that are required (imported) by the given source code. The input string may contain various import statements, and you should extract the module names from them. The import statements can b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_imports('import os\\\\nimport sys') == ['os', 'sys']\", \"assert find_imports('') == []\", \"assert find_imports('print(42)') == []\", \"assert find_imports('import module1\\\\nimport module2\\\\nimport module1') == ['module1', 'module2']\", \"assert fi...
{ "split": "train", "index": 63986, "acecode_id": "bigcode_python_fns_44627", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Write a function `mark_time(times: List[float], msg: Optional[str] = None) -> None` that measures the execution time between subsequent calls and adds the elapsed time to the `times` list. If the `msg` argument is provided and there is more than one recorded time, the function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert mark_time([], None) is None\", \"assert mark_time([0.1], 'elapsed') is None\", \"assert mark_time([0.1, 0.05], 'elapsed again') is None\", \"assert mark_time([0.1, 0.05, 0.2], None) is None\", \"assert mark_time([0.15], 'first call') is None\", \"assert mark...
{ "split": "train", "index": 63987, "acecode_id": "bigcode_python_fns_37852", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of strings, where each string represents a line of text. The function should iterate through each line and perform a transformation on the content of each line by removing any trailing newline characters. The ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_lines(['Hello, world!\\\\n', 'This is a sample file.\\\\n', 'Programming problems are fun.\\\\n']) == ['Hello, world!', 'This is a sample file.', 'Programming problems are fun.']\", \"assert process_lines(['First line\\\\n', 'Second line\\\\n', 'Thir...
{ "split": "train", "index": 63988, "acecode_id": "oss_3841", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of numbers. Write a function `sum_numbers(numbers, divisor=None)` that returns the sum of the numbers in the list. If a second optional parameter `divisor` is provided, the function should only sum those numbers in the list that are divisible by the `diviso...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_numbers([10, 20, 30]) == 60\", \"assert sum_numbers([10, 20, 30], 10) == 60\", \"assert sum_numbers([1.5, 2.5, 3.5]) == 7.5\", \"assert sum_numbers([1, 2, 3, 4, 5], 2) == 6\", \"assert sum_numbers([-1, -2, -3, -4, -5]) == -15\", \"assert sum_numbers([-10...
{ "split": "train", "index": 63989, "acecode_id": "evol_9725", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Write a function that converts a hexadecimal number (as a string) to its binary representation and returns the binary result in reverse order. The input hexadecimal number will always be a valid string consisting of characters 0-9 and A-F (case insensitive).\nPlease reason step...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert hex_to_bin_inverse('FF') == '11111111'\", \"assert hex_to_bin_inverse('10') == '00001'\", \"assert hex_to_bin_inverse('0') == '0'\", \"assert hex_to_bin_inverse('7') == '111'\", \"assert hex_to_bin_inverse('0F') == '1111'\", \"assert hex_to_bin_inverse('5') ...
{ "split": "train", "index": 63990, "acecode_id": "evol_7439", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Design a function that takes in two binary strings as arguments and checks if the first binary string can be transformed into the second binary string by flipping exactly one bit. If exactly one bit needs to be flipped, the function should return the position of the bit that ne...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bit_flip('1100', '1101') == 'Bit at position 4 needs to be flipped'\", \"assert bit_flip('1010', '1110') == 'Bit at position 2 needs to be flipped'\", \"assert bit_flip('0000', '1111') == 'More than one bit needs flipping'\", \"assert bit_flip('1111', '1111'...
{ "split": "train", "index": 63991, "acecode_id": "evol_7188", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of food items represented as strings, where each item is separated by a newline character. Your task is to create a function that processes this list, tokenizes each item, and returns a list of tuples. Each tuple should contain the tokenized words and a lab...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_food_items(['apple', 'banana', 'grape']) == ([('apple', 'B-FOOD'), ('banana', 'B-FOOD'), ('grape', 'B-FOOD')], 3)\", \"assert process_food_items(['carrot', '123', 'onion']) == ([('carrot', 'B-FOOD'), ('onion', 'B-FOOD')], 2)\", \"assert process_food_...
{ "split": "train", "index": 63992, "acecode_id": "oss_31317", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating the behavior of a simple system that manipulates a variable `x_val`. The variable `x_val` is initially set to 3, and based on a given boolean parameter `condition`, it may either remain unchanged or be decreased by 4. Your goal is to implement a f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manipulate_value(True) == ['s1,3', 's2,3', 's3,3', 's4,3', 's5,3', 's6,3', 's7,3', 's8,3', 's9,3', 's10,3']\", \"assert manipulate_value(False) == ['s1,-1', 's2,-1', 's3,-1', 's4,-1', 's5,-1', 's6,-1', 's7,-1', 's8,-1', 's9,-1', 's10,-1']\", \"assert manipul...
{ "split": "train", "index": 63993, "acecode_id": "oss_30982", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that generates a list of 15 unique random prime numbers between 1 and 200. Each prime number must not be a member of the set of Fibonacci numbers. The function should return these numbers sorted in descending order based on the sum of their individual digits, a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_primes() != []\", \"assert len(generate_primes()) == 15\", \"assert all(1 <= num <= 200 for num in generate_primes())\", \"assert all(generate_primes().count(num) == 1 for num in generate_primes())\", \"assert len(set(generate_primes())) == 15\", \"...
{ "split": "train", "index": 63994, "acecode_id": "evol_12408", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a list of signals and returns the count of unique signals received. Each signal is represented as a string and may contain alphanumeric characters. The function should ignore case sensitivity, treating 'Signal1' and 'si...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_unique_signals([]) == 0\", \"assert count_unique_signals(['Signal1']) == 1\", \"assert count_unique_signals(['signal1', 'SIGNAL1']) == 1\", \"assert count_unique_signals(['Signal1', 'signal2', 'signal3']) == 3\", \"assert count_unique_signals(['abc', '...
{ "split": "train", "index": 63995, "acecode_id": "oss_26208", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string `options` that represents a bitfield of length 8, consisting only of the characters '0' and '1'. Your task is to implement a function `check_options(options: str) -> None` that verifies whether the input string is valid. A valid string must be of type str...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_options('00000000') is None\", \"assert check_options('11111111') is None\", \"assert check_options('01010101') is None\", \"assert check_options('00001111') is None\", \"assert check_options('11110000') is None\", \"assert check_options('10101010') is...
{ "split": "train", "index": 63996, "acecode_id": "bigcode_python_fns_41621", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given two tuples, t1 and t2. Your task is to implement a function that compares the two tuples element by element. If the elements are of the same type, you should subtract the second element from the first and store the result. If the elements are lists or tuples thems...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compare_tuples((1, 2, 3), (4, 5, 6)) == (-3, -3, -3)\", \"assert compare_tuples((1.5, 2.5), (2.0, 3.0)) == (-0.5, -0.5)\", \"assert compare_tuples((1, 2, 3), (1, 2, 3)) == (0, 0, 0)\", \"assert compare_tuples((1, 2, 3), (None, None, None)) == (1, 2, 3)\", \"...
{ "split": "train", "index": 63997, "acecode_id": "evol_14662", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Your task is to implement a function that calculates the sum of all even numbers in the list. If there are no even numbers, return 0. Write a function `sum_of_evens(nums: List[int]) -> int` where `nums` is the input list of integers. For exampl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4]) == 6\", \"assert sum_of_evens([0, 1, 2, 3, 4]) == 6\", \"assert sum_of_evens([1, 3, 5]) == 0\", \"assert sum_of_evens([2, 4, 6, 8]) == 20\", \"assert sum_of_evens([-2, -4, 1]) == -6\", \"assert sum_of_evens([]) == 0\", \"assert sum...
{ "split": "train", "index": 63998, "acecode_id": "bigcode_python_fns_43452", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two dictionaries, `Xs` and `Ys`, where `Xs` contains model identifiers as keys and their corresponding feature values as values, and `Ys` contains the same model identifiers as keys and their corresponding performance metrics as values, implement a function `convex_env_tr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convex_env_train({1: 2.5, 2: 3.0, 3: 3.5}, {1: 2.0, 2: 1.0, 3: 3.0}) == [1, 3]\", \"assert convex_env_train({1: 0.0, 2: 1.0, 3: 2.0}, {1: 1.0, 2: 1.5, 3: 0.5}) == [1, 2]\", \"assert convex_env_train({1: 1.0}, {1: 2.0}) == [1]\", \"assert convex_env_train({1:...
{ "split": "train", "index": 63999, "acecode_id": "bigcode_python_fns_10428", "num_tests": 5 }