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 dictionary representing COCO data, which contains various attributes related to images, annotations, and categories. Your task is to implement a function that takes this dictionary as input and returns a formatted JSON string representation of the data. The JSON...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_coco_data({'images': [], 'annotations': [], 'categories': []}) == '{\\\\n \\\"images\\\": [],\\\\n \\\"annotations\\\": [],\\\\n \\\"categories\\\": []\\\\n}'\", \"assert format_coco_data({'images': [{'id': 1, 'file_name': 'image1.jpg'}], 'an...
{ "split": "train", "index": 1600, "acecode_id": "bigcode_python_fns_26713", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with determining if a given integer N qualifies as a confusing number. A number is considered confusing if, when its digits are rotated 180 degrees, it transforms into a different valid number. The valid rotations for the digits are as follows: 0, 1, 6, 8, and 9 ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert confusingNumber(6) == True\", \"assert confusingNumber(89) == True\", \"assert confusingNumber(11) == False\", \"assert confusingNumber(25) == False\", \"assert confusingNumber(101) == False\", \"assert confusingNumber(808) == False\", \"assert confusingNumb...
{ "split": "train", "index": 1601, "acecode_id": "evol_21186", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `select_region(available_regions: List[str]) -> str` that allows a user to select a region from a list of available regions. The function should return the selected region based on the user's choice. For this exercise, you can simulate th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert select_region(['us-east', 'us-west', 'eu-central']) == 'us-east'\", \"assert select_region(['ap-south', 'ap-northeast']) == 'ap-south'\", \"assert select_region(['eu-west', 'eu-north', 'me-south']) == 'eu-west'\", \"assert select_region(['sa-east']) == 'sa-e...
{ "split": "train", "index": 1602, "acecode_id": "bigcode_python_fns_31152", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a summary report for a physics experiment based on several input parameters. The function should take in the following parameters: a string 'style' representing the style of the report, a dictionary 'tempInfo' containing 'l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_summary('Standard', {'logFile': 'log.txt', 'workDir': '/tmp'}, '1.0', 'Frame_A', [0.0, 0.1, 0.2], [1.0, 2.0, 3.0], 1) == 'Version: 1.0\\\\nProcess: Physics Experiment Summary\\\\nCommon Data: logFile: log.txt, workDir: /tmp\\\\nAngular Data: 0.0, 0....
{ "split": "train", "index": 1603, "acecode_id": "bigcode_python_fns_6769", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks user authentication for a router. The function should take four parameters: `stored_user` (a string representing the stored username), `stored_password` (a string representing the stored password), `input_username` (a stri...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert authenticate('admin', '1234', 'admin', '1234') == True\", \"assert authenticate('admin', '1234', 'admin', 'wrongpassword') == False\", \"assert authenticate('admin', '1234', 'wronguser', '1234') == False\", \"assert authenticate('admin', '1234', 'wronguser',...
{ "split": "train", "index": 1604, "acecode_id": "oss_8360", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple data structure to represent a blog post. Each blog post has a title, content, and an author. Your objective is to implement a function `serialize_blog_post` that takes in a dictionary representing a blog post with the keys 'title', 'content...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert serialize_blog_post({'title': 'First Post', 'content': 'This is the content of the first post.', 'author': 'Alice'}) == 'Title: First Post, Content: This is the content of the first post., Author: Alice'\", \"assert serialize_blog_post({'title': 'Second Post...
{ "split": "train", "index": 1605, "acecode_id": "oss_6669", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function `get_greeting_message(ip: str) -> str` that accepts a user's IP address as a string and returns a greeting message in the language corresponding to the user's country. The greeting message should be 'Hello!' for users from the United States (country code 'U...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_greeting_message('192.168.1.1') == 'Hello, World!'\", \"assert get_greeting_message('8.8.8.8') == 'Hello!'\", \"assert get_greeting_message('100.100.100.100') == 'Hello, World!'\", \"assert get_greeting_message('180.100.100.100') == 'Hello, World!'\", \"...
{ "split": "train", "index": 1606, "acecode_id": "evol_16677", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a schema represented as a dictionary, along with a version number as a string. Your task is to create a function `export_schema_to_json(schema: dict, version: str) -> str` that converts the schema into a JSON Schema format and returns it as a string. The JSON Sche...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert export_schema_to_json({'name': 'string', 'age': 'integer'}, '1.0') == '{\\\"$schema\\\": \\\"http://json-schema.org/draft-07/schema#\\\", \\\"version\\\": \\\"1.0\\\", \\\"properties\\\": {\\\"name\\\": {\\\"type\\\": \\\"string\\\"}, \\\"age\\\": {\\\"type\...
{ "split": "train", "index": 1607, "acecode_id": "bigcode_python_fns_22145", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes text and knowledge base (KB) sequences along with their corresponding labels. The function should take in two lists of new sequences and their associated labels, and concatenate these with existing sequences and labels....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_sequences([], [], [], ['Hello'], ['Greeting'], [1]) == (None, (['Hello'], ['Greeting'], [1]))\", \"assert process_sequences(['Existing text.'], ['Existing KB.'], [0], ['New text.'], ['New KB.'], [1]) == (None, (['Existing text.', 'New text.'], ['Exis...
{ "split": "train", "index": 1608, "acecode_id": "oss_8079", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of complex numbers and returns the complex number with the largest magnitude. The magnitude of a complex number a + bi is defined as the square root of (a^2 + b^2).\nPlease reason step by step, then write a self-contained Python solution. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert largest_magnitude([1+2j, 3+4j, 0+0j, 1+1j]) == 3+4j\", \"assert largest_magnitude([-1-1j, -2-2j, -3-3j]) == -3-3j\", \"assert largest_magnitude([2+3j, 2-3j, -2+3j]) == 2+3j\", \"assert largest_magnitude([1+1j, 1-1j, -1+1j, -1-1j]) == 1+1j\", \"assert largest...
{ "split": "train", "index": 1609, "acecode_id": "evol_23618", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a configuration dictionary representing the settings of a software application. The configuration contains a key 'PermitRootLogin' which can take values 'yes', 'no', or 'prohibit-password'. Your task is to implement a function `is_root_login_permitted(config: Dict...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_root_login_permitted({'PermitRootLogin': 'yes'}) == True\", \"assert is_root_login_permitted({'PermitRootLogin': 'no'}) == False\", \"assert is_root_login_permitted({'PermitRootLogin': 'prohibit-password'}) == False\", \"assert is_root_login_permitted({'P...
{ "split": "train", "index": 1610, "acecode_id": "bigcode_python_fns_39912", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integer differences `diffs`. Your task is to write a function to find the maximum sum of a subsequence of `diffs` such that no two elements in the subsequence are adjacent in the original list. In other words, you need to find the maximum sum of non-adja...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_non_adjacent_sum([]) == 0\", \"assert max_non_adjacent_sum([5]) == 5\", \"assert max_non_adjacent_sum([5, 1]) == 5\", \"assert max_non_adjacent_sum([1, 2, 3]) == 4\", \"assert max_non_adjacent_sum([3, 2, 5, 10, 7]) == 15\", \"assert max_non_adjacent_sum(...
{ "split": "train", "index": 1611, "acecode_id": "oss_8674", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that extracts the names of all the intents from a given code snippet. Each intent is represented by a class name that ends with 'Intent'. Write a function called `extract_intents` that takes no parameters. The function should retur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_intents() == ['EpisodeFactIntent', 'PersonFactIntent', 'WoWGroupsMemberIntent']\", \"assert extract_intents() == ['EpisodeFactIntent', 'PersonFactIntent', 'WoWGroupsMemberIntent']\", \"assert extract_intents() == ['EpisodeFactIntent', 'PersonFactInte...
{ "split": "train", "index": 1612, "acecode_id": "oss_23396", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of lowercase letters and a target lowercase letter, implement a function `next_greatest_letter(letters, target)` that returns the smallest letter in the list that is greater than the target letter. If the target letter is greater than or equal to the largest letter...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert next_greatest_letter(['a', 'b', 'c'], 'a') == 'b'\", \"assert next_greatest_letter(['x', 'y', 'z'], 'y') == 'z'\", \"assert next_greatest_letter(['d', 'e', 'f', 'g'], 'g') == 'd'\", \"assert next_greatest_letter(['m', 'n', 'o', 'p'], 'm') == 'n'\", \"assert ...
{ "split": "train", "index": 1613, "acecode_id": "evol_17221", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `process_string(data: str) -> str` that takes a string as input and returns a new string with all characters converted to uppercase. Your function should handle any string input, including empty strings. For example, if the input is '...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_string('hello world') == 'HELLO WORLD'\", \"assert process_string('Python is awesome') == 'PYTHON IS AWESOME'\", \"assert process_string('') == ''\", \"assert process_string('123 abc') == '123 ABC'\", \"assert process_string('LeetCode') == 'LEETCODE'...
{ "split": "train", "index": 1614, "acecode_id": "oss_9605", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representation of a dictionary-like XML structure that contains oversight information. Your task is to extract specific oversight attributes from this XML string. The oversight information includes the following keys: 'has_dmc', 'is_fda_regulated_drug', '...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_oversight('<oversight_info><has_dmc>yes</has_dmc><is_fda_regulated_drug>no</is_fda_regulated_drug><is_fda_regulated_device>yes</is_fda_regulated_device><is_unapproved_device>no</is_unapproved_device><is_ppsd>yes</is_ppsd><is_us_export>no</is_us_export></...
{ "split": "train", "index": 1615, "acecode_id": "bigcode_python_fns_29849", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that processes a list of strings representing file names and returns a dictionary containing the count of files with each unique file extension. The file extension is defined as the substring following the last occurrence of th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_file_extensions(['file1.txt', 'file2.py', 'file3.txt', 'file4', 'file5.py', 'file6.py']) == {'txt': 2, 'py': 3, '': 1}\", \"assert count_file_extensions(['a.b.c.d', 'e.f', 'g.h.i', 'j']) == {'d': 1, 'f': 1, 'i': 1, '': 1}\", \"assert count_file_extensi...
{ "split": "train", "index": 1616, "acecode_id": "oss_23143", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two 2D arrays, `pp1` and `pp2`, representing precipitation data at different time intervals. Each array has the same dimensions, where each element is a float that represents the amount of precipitation (in mm) recorded at specific latitude and longitude points. W...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_precipitation_change([[1.0, 2.0], [3.0, 4.0]], [[2.0, 3.0], [4.0, 5.0]]) == [[1.0, 1.0], [1.0, 1.0]]\", \"assert calculate_precipitation_change([[1.0, 2.0]], [[2.0, 3.0]]) == [[1.0, 1.0]]\", \"assert calculate_precipitation_change([[1.0]], [[2.0]] ...
{ "split": "train", "index": 1617, "acecode_id": "bigcode_python_fns_40036", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a learner goals model represented as a dictionary with the following keys: 'id', 'topic_ids_to_learn', and 'topic_ids_to_master'. Write a function `get_learner_goals(learner_goals_model: Dict[str, Union[int, List[int]]]) -> Tuple[int, List[int], List[int]]` that t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_learner_goals({'id': 1, 'topic_ids_to_learn': [101, 102], 'topic_ids_to_master': [201]}) == (1, [101, 102], [201])\", \"assert get_learner_goals({'id': 2, 'topic_ids_to_learn': [], 'topic_ids_to_master': [202, 203]}) == (2, [], [202, 203])\", \"assert ge...
{ "split": "train", "index": 1618, "acecode_id": "bigcode_python_fns_49105", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing migration statuses for different database groups. Write a function `track_migration_status(databases: List[str], groups: Dict[str, str], migrations: List[Tuple[str, str, str]]) -> Dict[str, List[Dict[str, str]]]` that takes a list of database names,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert track_migration_status(['db1', 'db2'], {'group1': 'dir1', 'group2': 'dir2'}, [('group1', 'migration1', 'completed'), ('group1', 'migration2', 'pending'), ('group2', 'migration3', 'completed')]) == {'group1': [{'name': 'migration1', 'status': 'completed'}, {'...
{ "split": "train", "index": 1619, "acecode_id": "oss_17458", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function `fibonacci(n: int) -> int` that returns the nth Fibonacci number using an optimized recursive approach with memoization. The Fibonacci sequence is defined as follows: F(0) = 0, F(1) = 1, and F(n) = F(n-1) + F(n-2) for n >= 2. Your function should handle val...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci(0) == 0\", \"assert fibonacci(1) == 1\", \"assert fibonacci(2) == 1\", \"assert fibonacci(3) == 2\", \"assert fibonacci(4) == 3\", \"assert fibonacci(5) == 5\", \"assert fibonacci(6) == 8\", \"assert fibonacci(7) == 13\", \"assert fibonacci(8) == 2...
{ "split": "train", "index": 1620, "acecode_id": "evol_32794", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates saving the UUID of a processed image for a user based on their username. The function should take two parameters: a string `username` representing the user's email and a string `uuid` representing the UUID4 of the processed...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert save_processed_image_uuid('user@example.com', '123e4567-e89b-12d3-a456-426614174000') == {'username': 'user@example.com', 'processed_image': '123e4567-e89b-12d3-a456-426614174000'}\", \"assert save_processed_image_uuid('test@domain.com', 'a0eeb1f2-6f3e-4b8e-...
{ "split": "train", "index": 1621, "acecode_id": "bigcode_python_fns_44919", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary `data` which contains a top-level key `dict_name`. Your task is to implement a function `validate_dict_structure(data: dict, dict_name: str, check_str_values: bool) -> bool` that checks the following conditions: \n\n1. The top-level dictionary must co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_dict_structure({'my_dict': {'key1': 'value1', 'key2': 'value2'}}, 'my_dict', True) == True\", \"assert validate_dict_structure({'my_dict': {'key1': 'value1', 'key2': 2}}, 'my_dict', True) == False\", \"assert validate_dict_structure({'my_dict': {'':...
{ "split": "train", "index": 1622, "acecode_id": "bigcode_python_fns_16537", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of words. Your task is to sort these words in lexicographical order, but if a word begins with a vowel (a, e, i, o, u), those words should be sorted in reverse lexicographical order. Implement a function that takes this list of words as input and returns th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert lex_sort(['umbrella', 'banana', 'orange', 'grape', 'kiwi']) == ['banana', 'grape', 'kiwi', 'umbrella', 'orange']\", \"assert lex_sort(['grape', 'apple', 'banana', 'kiwi', 'orange']) == ['banana', 'grape', 'kiwi', 'orange', 'apple']\", \"assert lex_sort(['sta...
{ "split": "train", "index": 1623, "acecode_id": "evol_28277", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a type `tp`, write a function `get_fully_qualified_name(tp, assumed_globals=None, update_assumed_globals=None)` that returns the fully qualified name of the type. If `assumed_globals` is provided, it can be a set of globally available types. If `update_assumed_globals` is...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_fully_qualified_name(int) == 'int'\", \"assert get_fully_qualified_name(str) == 'str'\", \"assert get_fully_qualified_name(list) == 'list'\", \"assert get_fully_qualified_name(dict) == 'dict'\", \"assert get_fully_qualified_name(set) == 'set'\", \"assert...
{ "split": "train", "index": 1624, "acecode_id": "bigcode_python_fns_10842", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `obliterate_alpha_at_index(string: str, index: int) -> Tuple[str, int]` that removes the first alphabetic character found at or after the specified index in a given string. The function should ignore special characters and spaces while searching for an alph...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert obliterate_alpha_at_index('123!@#abc', 0) == ('123!@#bc', 6)\", \"assert obliterate_alpha_at_index('abcd', 0) == ('bcd', 0)\", \"assert obliterate_alpha_at_index('1234', 0) == ('1234', -1)\", \"assert obliterate_alpha_at_index('!@#$%^', 0) == ('!@#$%^', -1)\...
{ "split": "train", "index": 1625, "acecode_id": "evol_1245", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes an API response represented as a dictionary. The function should extract and return two specific attributes from the response: a list of categories and a success status. If the response contains a key 'categorys', the funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_api_response({'categorys': ['A', 'B', 'C'], 'success': True}) == (['A', 'B', 'C'], True)\", \"assert process_api_response({'categorys': [], 'success': False}) == ([], False)\", \"assert process_api_response({'categorys': ['X', 'Y'], 'success': None})...
{ "split": "train", "index": 1626, "acecode_id": "oss_29718", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that initializes a policy enforcer. The function `init_enforcer` takes the following parameters: \n1. `policy_file` (str or None): A custom policy file to use. If None is specified, a default policy file will be used. \n2. `rules` (di...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert init_enforcer(None, None, None, True) == None\", \"assert init_enforcer('custom_policy.json', {'rule1': 'allow'}, 'rule1', False) == None\", \"assert init_enforcer(None, {'rule2': 'deny'}, 'rule2', True) == None\", \"assert init_enforcer('another_policy.json...
{ "split": "train", "index": 1627, "acecode_id": "bigcode_python_fns_31029", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates dispatching a task based on a given protocol. Implement a function `dispatch_task` that takes in the following parameters: `host`, `hostname`, `proto`, `sysinfo`, `extra`, and `kwargs` (as a dictionary). The function should...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert dispatch_task('192.168.1.1', 'myhost', 'HTTP', 'sysinfo', 'extra', {}) == {'host': '192.168.1.1', 'status': 'success', 'data': {'protocol': 'HTTP', 'message': 'Task completed successfully'}}\", \"assert dispatch_task('192.168.1.1', 'myhost', 'FTP', 'sysinfo'...
{ "split": "train", "index": 1628, "acecode_id": "bigcode_python_fns_4738", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Build a function to extract specific data from a given string. The function should take a single string as input and return a list of words separated by either commas or colons. If neither a comma nor a colon exists in the string, return the count of lower-case alphabetic chara...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert retrieve_info('how,are,you') == ['how', 'are', 'you']\", \"assert retrieve_info('how:are:you') == ['how', 'are', 'you']\", \"assert retrieve_info('abcdef') == 3\", \"assert retrieve_info('hello,world') == ['hello', 'world']\", \"assert retrieve_info('test:th...
{ "split": "train", "index": 1629, "acecode_id": "evol_24405", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Write a Python function that accepts a list of strings and returns a list of booleans indicating whether each corresponding string is a valid email address. The email address must conform to the following guidelines: 1. It should have a local part and a domain part separated by...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_emails(['test@example.com']) == [True]\", \"assert check_emails(['user.name@sub.domain.com']) == [True]\", \"assert check_emails(['user_name@domain.co']) == [True]\", \"assert check_emails(['invalid-email@.com']) == [False]\", \"assert check_emails(['@...
{ "split": "train", "index": 1630, "acecode_id": "evol_16074", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, your task is to implement a function `maximum_subarray_efficient(data)` that returns the maximum subarray sum, which is the largest possible sum of a contiguous subarray within the input array. A subarray is a contiguous part of the array. For exampl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert maximum_subarray_efficient([-2, 1, -3, 4, -1, 2, 1, -5, 4]) == 6\", \"assert maximum_subarray_efficient([1, 2, 3, 4]) == 10\", \"assert maximum_subarray_efficient([-1, -2, -3, -4]) == -1\", \"assert maximum_subarray_efficient([5, -1, 3, 4, -2]) == 11\", \"as...
{ "split": "train", "index": 1631, "acecode_id": "oss_12344", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that performs a Caesar cipher encryption on a given string. The function should take two parameters: the input string `text` and an integer `shift`. The function should shift each alphabetical character in the string by the given `shift` amount while preser...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert caesar_cipher('abc', 1) == 'bcd'\", \"assert caesar_cipher('xyz', 3) == 'abc'\", \"assert caesar_cipher('Hello, World!', 5) == 'Mjqqt, Btwqi!'\", \"assert caesar_cipher('Caesar Cipher!', 2) == 'Ecguct Ekrjgt!'\", \"assert caesar_cipher('Shift by 26', 26) == ...
{ "split": "train", "index": 1632, "acecode_id": "evol_10896", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a list of n-dimensional points (each point represented as a list of coordinates), write a function that calculates the centroid of these points. The centroid is the arithmetic mean position of all the points in the dataset. You should return the centroid as a list of coor...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_centroid([[1, 2], [3, 4], [5, 6]]) == [3.0, 4.0]\", \"assert calculate_centroid([[0, 0], [0, 0], [0, 0]]) == [0.0, 0.0]\", \"assert calculate_centroid([[1, 1], [2, 2], [3, 3], [4, 4]]) == [2.5, 2.5]\", \"assert calculate_centroid([[1.5, 2.5], [3.5,...
{ "split": "train", "index": 1633, "acecode_id": "bigcode_python_fns_4505", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string that represents a stream of characters. Your task is to implement a function that extracts the first valid XML string from this stream. The function should skip any characters until it finds a '<' character, which marks the beginning of a valid XML string...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_xml_string('random text <xml>content</xml>') == '<xml>content</xml>'\", \"assert extract_xml_string('no xml here') == 'No valid XML found'\", \"assert extract_xml_string(' <tag>data</tag>') == '<tag>data</tag>'\", \"assert extract_xml_string('text...
{ "split": "train", "index": 1634, "acecode_id": "bigcode_python_fns_3761", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function called 'showAuthorDetails' that returns the author's name, birth date, and birth place from a given Novel object. If the birth date or birth place is not available, the function should return a message indicating that the specific detail is not available. Y...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert showAuthorDetails(Novel('J. K. Rowling', '31 July 1965', 'Yate, Gloucestershire, England')) == 'Author: J. K. Rowling\\\\nBirth Date: 31 July 1965\\\\nBirth Place: Yate, Gloucestershire, England\\\\n'\", \"assert showAuthorDetails(Novel('Stephen King')) == '...
{ "split": "train", "index": 1635, "acecode_id": "evol_20928", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `identify_numbers(numbers: List[int]) -> List[Tuple[int, str]]` that takes a list of integers as input and returns a list of tuples. Each tuple should contain an integer from the original list and a string indicating whether the integer is 'prime', 'composite',...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert identify_numbers([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == [(1, 'neither'), (2, 'prime'), (3, 'prime'), (4, 'composite'), (5, 'prime'), (6, 'composite'), (7, 'prime'), (8, 'composite'), (9, 'composite'), (10, 'composite')]\", \"assert identify_numbers([0, 1, 2, 3]...
{ "split": "train", "index": 1636, "acecode_id": "evol_28822", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple layout system for graphical elements. Each element can have a parent, width (w), height (h), and a list of conditions that define its position relative to its parent. The conditions can include `Left2Left()`, `Right2Right()`, `Top2Top()...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_clip_path(100, 100, 500, 500, ['Left2Left', 'Top2Top']) == [(0, 0), (100, 0), (100, 100), (0, 100)]\", \"assert get_clip_path(100, 100, 500, 500, ['Right2Right', 'Bottom2Bottom']) == [(400, 400), (500, 400), (500, 500), (400, 500)]\", \"assert get_clip_p...
{ "split": "train", "index": 1637, "acecode_id": "oss_5536", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates adding a webhook to a service. The function should accept a dictionary representing an API response and a dictionary representing the webhook details. Your function should extract the 'auth_key' from the API response an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_webhook({'status_code': 200, 'auth_key': 'abc123'}, {}) == 'Webhook added successfully.'\", \"assert add_webhook({'status_code': 404, 'auth_key': 'xyz789'}, {}) == 'Could not activate Mandrill Integration'\", \"assert add_webhook({'status_code': 200, 'au...
{ "split": "train", "index": 1638, "acecode_id": "bigcode_python_fns_13382", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings, where each string represents a webpage content. Your task is to create a function that processes this list and returns a dictionary. The keys of the dictionary should be the indices of the list, and the values should be the processed content of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_webpages(['home', 'about', 'contact']) == {0: 'HOME - PROCESSED', 1: 'ABOUT - PROCESSED', 2: 'CONTACT - PROCESSED'}\", \"assert process_webpages(['page1', 'page2']) == {0: 'PAGE1 - PROCESSED', 1: 'PAGE2 - PROCESSED'}\", \"assert process_webpages(['he...
{ "split": "train", "index": 1639, "acecode_id": "bigcode_python_fns_29884", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with validating a given password based on specific blacklisted substrings. The password is considered valid if it does not contain any of the following substrings: 'ab', 'cd', 'pq', or 'xy'. Write a function `validate_password(password: str) -> bool` that takes a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_password('password123') == True\", \"assert validate_password('hello_world') == True\", \"assert validate_password('xylo') == False\", \"assert validate_password('abcd') == False\", \"assert validate_password('pqrs') == False\", \"assert validate_pa...
{ "split": "train", "index": 1640, "acecode_id": "bigcode_python_fns_18436", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that parses a given string containing metadata information and extracts specific key-value pairs. The metadata string follows a specific format where each key-value pair is separated by a comma and space. The keys and values are se...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_metadata(\\\"version='1.0', description='Test description.', url='https://test.url'\\\") == {'version': '1.0', 'description': 'Test description.', 'url': 'https://test.url'}\", \"assert parse_metadata(\\\"version='0.1.2', description='Initial version.'...
{ "split": "train", "index": 1641, "acecode_id": "oss_36627", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two lists of integers, 'input' and 'output', write a function that returns a list containing all unique integers that appear in either the 'input' list or the 'output' list, including any integers that are common to both lists. The output list should be sorted in ascendin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_numbers([1, 2, 3], [3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert unique_numbers([-1, 0, 1], [1, 2, 3]) == [-1, 0, 1, 2, 3]\", \"assert unique_numbers([5, 5, 5], [5, 5, 5]) == [5]\", \"assert unique_numbers([], []) == []\", \"assert unique_numbers([1], [])...
{ "split": "train", "index": 1642, "acecode_id": "bigcode_python_fns_13338", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that formats a log message based on a specified verbosity label. The function should take two parameters: a string message and a boolean label. If the label is True, the function should prepend the message with 'cm verbose: '. If the labe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_log_message('Initialization complete', True) == 'cm verbose: Initialization complete'\", \"assert format_log_message('Error occurred', True) == 'cm verbose: Error occurred'\", \"assert format_log_message('File saved successfully', False) == 'File save...
{ "split": "train", "index": 1643, "acecode_id": "bigcode_python_fns_38151", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that generates a deprecation warning message for a class instance. The function should take in three parameters: `instance`, `version`, and `alt`. The `instance` parameter represents the name of the deprecated class instance, `vers...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_deprecation_message('OldClass', '2.0', 'NewClass') == 'OldClass will be deprecated in version 2.0. Use NewClass instead.'\", \"assert generate_deprecation_message('LegacyModule', '1.5', 'ModernModule') == 'LegacyModule will be deprecated in version ...
{ "split": "train", "index": 1644, "acecode_id": "oss_16389", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simple thermostat system. The thermostat has a temperature setting and a status indicator. The status can be set to one of three values: 'OFF', 'HEATING', or 'COOLING'. Your task is to implement a function `determine_...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert determine_thermostat_status(50) == 'HEATING'\", \"assert determine_thermostat_status(55) == 'HEATING'\", \"assert determine_thermostat_status(60) == 'OFF'\", \"assert determine_thermostat_status(65) == 'OFF'\", \"assert determine_thermostat_status(70) == 'OF...
{ "split": "train", "index": 1645, "acecode_id": "oss_34532", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes an integer as input and returns the integer with its digits reversed. The function should not convert the integer to a string. If the input integer is negative, the output should also be negative. For example, if the input is -123, the output should ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert invert_num(123) == 321\", \"assert invert_num(-123) == -321\", \"assert invert_num(0) == 0\", \"assert invert_num(100) == 1\", \"assert invert_num(-100) == -1\", \"assert invert_num(1001) == 1001\", \"assert invert_num(-1001) == -1001\", \"assert invert_num(...
{ "split": "train", "index": 1646, "acecode_id": "evol_25260", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the installation of a software package. The function should take a boolean parameter `force`, which indicates whether to force the installation even if the package is already installed. If `force` is `True`, the installatio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert install_package(True) == 'Package installed successfully.'\", \"assert install_package(True) == 'Package installed successfully.'\", \"assert install_package(True) == 'Package installed successfully.'\", \"assert install_package(True) == 'Package installed s...
{ "split": "train", "index": 1647, "acecode_id": "bigcode_python_fns_49078", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a tree represented as a matrix and two integers representing nodes within the tree. Your task is to write a function that determines the distance between the two nodes in the tree. The distance between two nodes in a tree is defined as the number of edges on the p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert distance_between_nodes([[0, 1], [1, 0]], 0, 0, 1) == 1\", \"assert distance_between_nodes([[0, 1, 0], [1, 0, 1], [0, 1, 0]], 0, 0, 2) == 2\", \"assert distance_between_nodes([[0, 1, 0, 0], [1, 0, 1, 0], [0, 1, 0, 1], [0, 0, 1, 0]], 0, 0, 3) == 3\", \"assert ...
{ "split": "train", "index": 1648, "acecode_id": "oss_29831", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function called `divide_numbers` that takes two integers as input and returns the result of dividing the first integer by the second integer. If the second integer is zero, the function should raise a custom exception named `CustomError` with ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert divide_numbers(10, 2) == 5.0\", \"assert divide_numbers(-10, 2) == -5.0\", \"assert divide_numbers(10, -2) == -5.0\", \"assert divide_numbers(0, 1) == 0.0\", \"assert divide_numbers(1, 1) == 1.0\", \"assert divide_numbers(10, 5) == 2.0\", \"assert divide_num...
{ "split": "train", "index": 1649, "acecode_id": "oss_7700", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given an array of strings 'emails' where each string represents an email address. Each valid email consists of a local name and a domain name, separated by the '@' sign. The local name may contain one or more '.' or '+' characters. When counting unique email addresses, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert numUniqueEmails(['test.email+alex@leetcode.com', 'test.e.mail+bob.cathy@leetcode.com', 'testemail+david@lee.tcode.com']) == (2, 'leetcode.com')\", \"assert numUniqueEmails(['a@leetcode.com', 'b@leetcode.com', 'c@leetcode.com']) == (3, 'leetcode.com')\", \"as...
{ "split": "train", "index": 1650, "acecode_id": "evol_14663", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function that generates a diamond shape made of asterisks (*) given the width of the diamond. The width will be an odd integer, and the diamond should be symmetric. The function should return a list of strings, where each string represents a row of the diamond. The ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert draw_diamond(1) == ['*']\", \"assert draw_diamond(3) == [' * ', '***', ' * ']\", \"assert draw_diamond(5) == [' * ', ' *** ', '*****', ' *** ', ' * ']\", \"assert draw_diamond(7) == [' * ', ' *** ', ' ***** ', '*******', ' ***** ', ' *** ', ' *...
{ "split": "train", "index": 1651, "acecode_id": "evol_26453", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Implement a function that calculates the Least Common Multiple (LCM) of four integers (a, b, c, d). The function should leverage an efficient algorithm, and the input integers must satisfy the constraint: 1 <= a, b, c, d <= 10^9. Write a single function: lcm(a: int, b: int, c: ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert lcm(4, 6, 8, 12) == 24\", \"assert lcm(21, 14, 7, 14) == 42\", \"assert lcm(10, 25, 5, 20) == 100\", \"assert lcm(12, 15, 3, 9) == 180\", \"assert lcm(9, 3, 1, 6) == 18\", \"assert lcm(5, 10, 15, 20) == 60\", \"assert lcm(7, 14, 21, 28) == 84\", \"assert lcm...
{ "split": "train", "index": 1652, "acecode_id": "evol_32042", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a string as input and returns the string in uppercase. The function should be named 'convert_to_uppercase' and should ignore any non-alphabetic characters while converting. For example, 'Hello, World!' should return 'HELLO WORLD'.\nPlease reason ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_uppercase('Hello, World!') == 'HELLO WORLD'\", \"assert convert_to_uppercase('1234') == ''\", \"assert convert_to_uppercase('abc!@#') == 'ABC'\", \"assert convert_to_uppercase('Upper and Lower Case!') == 'UPPER AND LOWER CASE'\", \"assert convert_...
{ "split": "train", "index": 1653, "acecode_id": "evol_33774", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two arrays of integers, write a function called `intersection` that returns a list of integers representing the intersection of the two arrays. The intersection should contain only unique elements and be returned in any order. For example, given arr1 = [1, 2, 3, 4] and ar...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert intersection([1, 2, 3, 4], [3, 4, 5, 6]) == [3, 4]\", \"assert intersection([1, 2, 3], [4, 5, 6]) == []\", \"assert intersection([1, 2, 2, 3], [3, 3, 4]) == [3]\", \"assert intersection([7, 8, 9], [10, 11, 12]) == []\", \"assert intersection([1], [1]) == [1]...
{ "split": "train", "index": 1654, "acecode_id": "evol_7736", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `get_subarray(start, end, nums)` that returns a subarray of the list `nums` from index `start` to index `end` (inclusive). If the start or end index is out of bounds, return an empty list. The function should handle cases where the sta...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_subarray(1, 3, [1, 2, 3, 4, 5]) == [2, 3, 4]\", \"assert get_subarray(0, 2, [10, 20, 30, 40]) == [10, 20, 30]\", \"assert get_subarray(2, 2, [5, 6, 7, 8]) == [7]\", \"assert get_subarray(1, 5, [1, 2, 3, 4]) == []\", \"assert get_subarray(-1, 2, [1, 2, 3]...
{ "split": "train", "index": 1655, "acecode_id": "bigcode_python_fns_28463", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the creation of a new variable type in a hypothetical system. The function should take in four parameters: `parent_node`, `node_id`, `browse_name`, and `data_type`. The `node_id` should be a string representing the identifi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_variable_type('parent', 'node1', 'Variable1', 1) == {'node_id': 'node1', 'browse_name': 'Variable1', 'data_type': 1}\", \"assert create_variable_type('parent', 'node2', 'Variable2', 'int') == {'node_id': 'node2', 'browse_name': 'Variable2', 'data_type...
{ "split": "train", "index": 1656, "acecode_id": "bigcode_python_fns_9484", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing the names of columns in a dataset. Your task is to implement a function that removes specific useless column names from this list. The column names that need to be removed are: 'agency_id', 'agency_name', 'agency_short_name', 'transp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert drop_useless_columns(['agency_id', 'agency_name', 'data', 'value']) == ['data', 'value']\", \"assert drop_useless_columns(['transportation_type', 'line_id', 'city', 'country']) == ['city', 'country']\", \"assert drop_useless_columns(['agency_short_name', 'ci...
{ "split": "train", "index": 1657, "acecode_id": "bigcode_python_fns_27932", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to simulate the loading of a model from a repository. The loading process can fail for a variety of reasons. Your function should attempt to load the model up to a maximum number of retries. If the model loading fails due to a `Runtim...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert load_model('repo1', 'modelA', 3) == 'Model loaded successfully'\", \"assert load_model('repo3', 'modelC', 1) == 'Model loaded successfully'\", \"assert load_model('repo4', 'modelD', 5) == 'Model loaded successfully'\", \"assert load_model('repo6', 'modelF', ...
{ "split": "train", "index": 1658, "acecode_id": "bigcode_python_fns_12011", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a function `get_next_number(numbers, last_number)` that takes in a list of integers `numbers` and an integer `last_number`. Your task is to determine the next number in the sequence based on the following rules: If the `last_number` is not present in the list `num...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_next_number([1, 1, 2, 2, 3, 2], 2) == 1\", \"assert get_next_number([1, 2, 3, 4, 5, 6], 6) == 0\", \"assert get_next_number([7, 8, 9, 8, 7, 8], 8) == 1\", \"assert get_next_number([5, 5, 5, 5, 5, 5], 5) == 0\", \"assert get_next_number([], 1) == 0\", \"a...
{ "split": "train", "index": 1659, "acecode_id": "oss_35571", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function `palindromeChecker(value)` that checks if the given input value is a palindrome. The input can be either a string or an integer. The function should return `True` if the value is a palindrome and `False` otherwise. A palindrome is defined as a value that re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert palindromeChecker('racecar') == True\", \"assert palindromeChecker('hello') == False\", \"assert palindromeChecker(121) == True\", \"assert palindromeChecker(12321) == True\", \"assert palindromeChecker('A man a plan a canal Panama') == False\", \"assert pal...
{ "split": "train", "index": 1660, "acecode_id": "evol_22986", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer n, write a function that returns a list of all prime numbers up to n. A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. Your function should handle cases where n is less than 2 by returning an empty list. I...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_primes(0) == []\", \"assert find_primes(1) == []\", \"assert find_primes(2) == [2]\", \"assert find_primes(3) == [2, 3]\", \"assert find_primes(4) == [2, 3]\", \"assert find_primes(5) == [2, 3, 5]\", \"assert find_primes(10) == [2, 3, 5, 7]\", \"assert ...
{ "split": "train", "index": 1661, "acecode_id": "oss_14627", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of barriers in a quantum circuit, where each barrier is represented by an integer indicating the number of qubits it operates on. Your task is to implement a function called `optimize_circuit` that takes a list of integers (representing the number of qubits...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert optimize_circuit([]) == []\", \"assert optimize_circuit([2]) == [2]\", \"assert optimize_circuit([2, 2]) == [4]\", \"assert optimize_circuit([1, 1, 1]) == [3]\", \"assert optimize_circuit([2, 3, 2]) == [2, 3, 2]\", \"assert optimize_circuit([2, 2, 3, 2]) == ...
{ "split": "train", "index": 1662, "acecode_id": "oss_32699", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function that creates a synchronized duplicate of a given list. Any changes made to the original list should be reflected in the duplicate list and vice versa. The function should also handle input errors by throwing a custom exception if the input is not a list....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_synchronized_list(['a', 'b', 'c']) == ['a', 'b', 'c']\", \"assert create_synchronized_list([]) == []\", \"assert create_synchronized_list(['x', 'y', 'z']) == ['x', 'y', 'z']\"]}" }
{ "split": "train", "index": 1663, "acecode_id": "evol_18455", "num_tests": 3 }
acecode
[ { "role": "user", "content": "Implement a function that computes the power of a number x raised to the exponent n. The function should handle cases where n can be zero or negative and should ensure that the time complexity is O(log n). Your function should be defined as follows: def power(x: float, n: int) ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert power(2, 3) == 8.0\", \"assert power(2, 0) == 1.0\", \"assert power(2, -2) == 0.25\", \"assert power(5, 1) == 5.0\", \"assert power(3, 4) == 81.0\", \"assert power(10, -1) == 0.1\", \"assert power(7, 0) == 1.0\", \"assert power(-2, 3) == -8.0\", \"assert pow...
{ "split": "train", "index": 1664, "acecode_id": "evol_16217", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries, where each dictionary represents a target with the following keys: 'subscription_id' (an integer), '_id' (a string), and 'data' (a dictionary containing additional information). Your task is to group the targets by their 'subscription_id' a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert group_targets([{'subscription_id': 1, '_id': 'a', 'data': {}}, {'subscription_id': 1, '_id': 'b', 'data': {}}]) == {1: ['a', 'b']}\", \"assert group_targets([{'subscription_id': 2, '_id': 'c', 'data': {}}, {'subscription_id': 2, '_id': 'd', 'data': {}}, {'su...
{ "split": "train", "index": 1665, "acecode_id": "bigcode_python_fns_6659", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are required to complete a certain number of courses, denoted as `numCourses`, which are labeled from `0` to `numCourses - 1`. You are provided with an array `prerequisites` where each element `prerequisites[i] = [ai, bi]` signifies that course `bi` must be completed before...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert canFinish(2, [[1, 0]]) == True\", \"assert canFinish(2, [[1, 0], [0, 1]]) == False\", \"assert canFinish(3, [[0, 1], [1, 2]]) == True\", \"assert canFinish(3, [[0, 1], [1, 2], [2, 0]]) == False\", \"assert canFinish(4, [[1, 0], [2, 1], [3, 2]]) == True\", \"...
{ "split": "train", "index": 1666, "acecode_id": "evol_25146", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `distinct_lexemes_count(text: str) -> int` that takes a string `text` as input and returns the count of distinct lexemes present in the text. A lexeme is defined as a word that consists only of alphabetic characters. The function should ignore any non-alphabeti...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert distinct_lexemes_count('Hello world! This is a test.') == 6\", \"assert distinct_lexemes_count('Python programming and Python scripting.') == 4\", \"assert distinct_lexemes_count('The quick brown fox jumps over the lazy dog.') == 8\", \"assert distinct_lexem...
{ "split": "train", "index": 1667, "acecode_id": "evol_2761", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that extracts the names of facial landmarks from a given input string formatted in HTML. The input string contains multiple HTML elements, each with a 'name' attribute that specifies a unique index for the landmark. Your goal is to pa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_facial_landmarks('<div name=\\\"1\\\">Landmark A</div><div name=\\\"2\\\">Landmark B</div>', 1, 2) == ['Landmark A', 'Landmark B']\", \"assert extract_facial_landmarks('<div name=\\\"3\\\">Landmark C</div><div name=\\\"4\\\">Landmark D</div>', 1, 4) ...
{ "split": "train", "index": 1668, "acecode_id": "oss_33512", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dataset represented as a list of dictionaries, where each dictionary contains three keys: 'Contribution_ID', 'Value', and 'Parameter_ID'. You are also given an inventory list, which is a dictionary where each key is a catalog name and the value is a dictionary m...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert collect_inventory_values([{'Contribution_ID': 'A', 'Value': 100, 'Parameter_ID': 'P1'}, {'Contribution_ID': 'B', 'Value': 200, 'Parameter_ID': 'P2'}], {'Catalog1': {'P1': ['A'], 'P2': ['B']}}, {'P1': {'unicode': 'A_unicode', 'bipa': 'A_bipa'}, 'P2': {'unicod...
{ "split": "train", "index": 1669, "acecode_id": "bigcode_python_fns_9293", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a type hint in Python, return a tuple containing the origin of the type hint and a tuple of its arguments. The origin can be determined using the `get_origin` function, and the arguments can be determined using the `get_args` function. Implement a function `destructure` t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert destructure(List[int]) == (list, (int,))\", \"assert destructure(int) == (None, ())\", \"assert destructure(Tuple[str, int]) == (tuple, (str, int))\", \"assert destructure(Union[int, str]) == (Union, (int, str))\", \"assert destructure(Any) == (None, ())\", ...
{ "split": "train", "index": 1670, "acecode_id": "bigcode_python_fns_22270", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a list of performance records for runners. Each performance record is represented as a dictionary containing information about the runner's ID and their performance score. Your goal is to extract and return a list of al...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_runner_ids([{'id': 1, 'score': 10.5}, {'id': 2, 'score': 12.0}, {'id': 1, 'score': 11.5}]) == [1, 2]\", \"assert get_runner_ids([{'id': 5, 'score': 15.5}, {'id': 6, 'score': 16.0}, {'id': 5, 'score': 15.0}, {'id': 7, 'score': 17.2}]) == [5, 6, 7]\", \"as...
{ "split": "train", "index": 1671, "acecode_id": "oss_6417", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that compares two version numbers represented as tuples and returns whether the first version is greater than, equal to, or less than the second version. The version numbers are represented as tuples of integers, where each integer...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compare_versions((1, 0, 0), (0, 9, 9)) == 1\", \"assert compare_versions((1, 2, 3), (1, 2, 3)) == 0\", \"assert compare_versions((0, 1, 0), (0, 1, 1)) == -1\", \"assert compare_versions((2, 0, 0), (1, 9, 9)) == 1\", \"assert compare_versions((1, 2, 3), (1, 2...
{ "split": "train", "index": 1672, "acecode_id": "oss_32821", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers and a target integer. Write a function that determines whether any two distinct numbers in the list add up to the target integer. The function should return True if such a pair exists, and False otherwise. The function signature is: `def has_pai...
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([0, -1, 2, -3, 1], -2) == True\", \"assert has_pair_with_sum([1, 1, 1, 1], 2) == True\", \"assert has_pair_with_sum([], 1)...
{ "split": "train", "index": 1673, "acecode_id": "bigcode_python_fns_16054", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function to compute the shortest sequence of k elements within an NxN bi-dimensional matrix, where N is at least 2, and the elements within the matrix are distinct integers from 1 through N^2. The function should start from any point in the matrix and move to the ne...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert minPath([[1,2],[3,4]], 2) == [1, 2]\", \"assert minPath([[1,2],[3,4]], 1) == [1]\", \"assert minPath([[1,2,3],[4,5,6],[7,8,9]], 3) == [1, 2, 3]\", \"assert minPath([[1]], 1) == [1]\", \"assert minPath([[1,2,3],[4,5,6],[7,8,9]], 2) == [1, 2]\", \"assert minPa...
{ "split": "train", "index": 1674, "acecode_id": "evol_6577", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given a string representing a color in hexadecimal format (e.g., '#f77f00'), write a function `hex_2_hsv(hex_col)` that converts this hex color to the HSV color space. The function should return a tuple of three floats representing the hue, saturation, and value (brightness) in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert hex_2_hsv('#ff0000') == (0.0, 1.0, 1.0)\", \"assert hex_2_hsv('#00ff00') == (0.3333333333333333, 1.0, 1.0)\", \"assert hex_2_hsv('#0000ff') == (0.6666666666666666, 1.0, 1.0)\", \"assert hex_2_hsv('#ffffff') == (0.0, 0.0, 1.0)\", \"assert hex_2_hsv('#000000')...
{ "split": "train", "index": 1675, "acecode_id": "bigcode_python_fns_44050", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Implement a recursive function to compute the factorial of a non-negative integer n using memoization to optimize the calculation. The function should take an integer n as input and return its factorial. Ensure that each calculation is only performed once to enhance efficiency....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert factorial_memoization(0) == 1\", \"assert factorial_memoization(1) == 1\", \"assert factorial_memoization(2) == 2\", \"assert factorial_memoization(3) == 6\", \"assert factorial_memoization(4) == 24\", \"assert factorial_memoization(5) == 120\", \"assert fac...
{ "split": "train", "index": 1676, "acecode_id": "evol_25761", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that sets a new offset for a ping cycle based on a given input string. The input string will contain a command followed by an integer value, which represents the new offset to be set. Your function should extract this integer value, valid...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_ping_offset('/set_offset 10') == 'Offset set to 10'\", \"assert set_ping_offset('/set_offset 0') == 'Offset set to 0'\", \"assert set_ping_offset('/set_offset -5') == 'Offset set to -5'\", \"assert set_ping_offset('/set_offset 100') == 'Offset set to 100...
{ "split": "train", "index": 1677, "acecode_id": "bigcode_python_fns_28389", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, find the maximum product of any three distinct numbers in the array. The array can contain both positive and negative numbers. Implement the function `max_product` to take in a list of integers `arr` and return the maximum product. The array will hav...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_product([1, 2, 3, 4]) == 24\", \"assert max_product([-10, -10, 5, 2]) == 500\", \"assert max_product([1, 0, 2, 3]) == 6\", \"assert max_product([3, 5, -2, 7, -1]) == 105\", \"assert max_product([5, 5, 5, 5]) == 125\", \"assert max_product([-1, -2, -3, -4...
{ "split": "train", "index": 1678, "acecode_id": "evol_8033", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the ages of a group of people. Your task is to implement a function that returns the average age of the group. If the list is empty, return 0. The function should be defined as follows: `def average_age(ages: List[int]) -> float:` w...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_age([25, 30, 35, 40]) == 32.5\", \"assert average_age([20, 22, 24]) == 22.0\", \"assert average_age([18]) == 18.0\", \"assert average_age([]) == 0\", \"assert average_age([1, 2, 3, 4, 5]) == 3.0\", \"assert average_age([10, 20, 30, 40, 50]) == 30.0\"...
{ "split": "train", "index": 1679, "acecode_id": "oss_13933", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `cycpattern_check(a, b)` that checks if the string `b` or any of its cyclic permutations are present as a substring in the string `a`. The function should ignore case and any punctuation marks. The input strings may contain characters from different languag...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cycpattern_check('abcde', 'deabc') == True\", \"assert cycpattern_check('aB!ab', 'BAa') == True\", \"assert cycpattern_check('EfEF', 'EeFf') == False\", \"assert cycpattern_check('Whas$sup', 'pSUs') == False\", \"assert cycpattern_check('Hi^mensS', 'sImen') ...
{ "split": "train", "index": 1680, "acecode_id": "evol_11232", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates a basic k-means clustering algorithm on a given dataset without using any external libraries. The function should take the dataset in the form of a list of lists, the indices of the variables to be used for clusterin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert perform_kmeans_clustering([[1, 1], [2, 2], [3, 3], [10, 10], [11, 11], [12, 12]], [0, 1], 2) == {'silhouette_score': 0.0, 'cluster_assignments': [0, 0, 0, 1, 1, 1]}\", \"assert perform_kmeans_clustering([[0, 0], [1, 1], [2, 2], [3, 3]], [0, 1], 2) == {'silho...
{ "split": "train", "index": 1681, "acecode_id": "oss_33196", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are given a function that accepts another function as an input and measures the time it takes for that function to execute. Your task is to implement a function `measure_time(func: Callable) -> Callable` that acts as a decorator. When applied to a function, it should return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert measure_time(lambda: 1 + 2)() == 3\", \"assert measure_time(lambda: sum(range(100)))() == 4950\", \"assert measure_time(lambda: 'Hello' + ' World')() == 'Hello World'\", \"assert measure_time(lambda: [x**2 for x in range(10)])() == [0, 1, 4, 9, 16, 25, 36, 4...
{ "split": "train", "index": 1682, "acecode_id": "bigcode_python_fns_5873", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that returns a new list containing only the even integers from the input list. The order of the even integers in the output list should be the same as their order in the input list. If there are no even integers, return an empty list. ...
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, 4, 6, 8]) == [2, 4, 6, 8]\", \"assert filter_even_num...
{ "split": "train", "index": 1683, "acecode_id": "bigcode_python_fns_47508", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string representation of a C-style for-loop, implement a function that checks whether the for-loop contains an initialization statement. The for-loop is represented as a string with the following format: 'for(initialization; condition; increment) { ... }'. Your task is ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_for_loop_initialization('for(int i = 0; i < 10; i++) { ... }') == True\", \"assert check_for_loop_initialization('for(int i = 0; i < 5; i++) { ... }') == True\", \"assert check_for_loop_initialization('for(; i < 10; i++) { ... }') == False\", \"assert ...
{ "split": "train", "index": 1684, "acecode_id": "bigcode_python_fns_47714", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `calculate_expression(x: float, y: float, z: float) -> float` that computes the value of the trigonometric expression `2 * sin(x) + 3 * cos(y) - 4 * tan(z^2)`. The input parameters x, y, and z will be given in radians.\nPlease reason step by step, then writ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_expression(math.pi/4, math.pi/4, math.pi/4) == 2*math.sin(math.pi/4) + 3*math.cos(math.pi/4) - 4*math.tan((math.pi/4)**2)\", \"assert calculate_expression(math.pi/6, math.pi/3, math.pi/6) == 2*math.sin(math.pi/6) + 3*math.cos(math.pi/3) - 4*math.ta...
{ "split": "train", "index": 1685, "acecode_id": "evol_29276", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given a pattern and a symbolic expression (sexp). Your task is to write a function `match(pattern: Any, sexp: Any, known_bindings: Optional[Dict[str, Any]] = None) -> Optional[Dict[str, Any]]` that determines if the given sexp matches the provided pattern, considering a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert match('A', 'B') == None\", \"assert match('A', ['A', 'B']) == None\", \"assert match('($ . $)', ['C', 'D']) == None\", \"assert match('A', [1]) == None\", \"assert match('(A . B)', ('X', 'Y'), {'B': 'Z'}) == None\", \"assert match('($ . $)', ('X', 'Y')) == N...
{ "split": "train", "index": 1686, "acecode_id": "bigcode_python_fns_8432", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are given a list of grocery items as strings. Write a function that takes this list as input and returns a new list that contains only the unique items from the original list, preserving the order of their first appearance. The function should not modify the original list. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_grocery_items(['apple', 'banana', 'apple', 'orange', 'banana']) == ['apple', 'banana', 'orange']\", \"assert unique_grocery_items(['milk', 'eggs', 'milk', 'bread']) == ['milk', 'eggs', 'bread']\", \"assert unique_grocery_items(['apple', 'apple', 'appl...
{ "split": "train", "index": 1687, "acecode_id": "bigcode_python_fns_27131", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that takes a list of integers and returns the sum of all the even integers in the list. Implement the function `sum_of_even_numbers` which takes a single parameter `numbers`, a list of integers, and returns the sum of all even inte...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_even_numbers([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_even_numbers([2, 4, 6, 8]) == 20\", \"assert sum_of_even_numbers([1, 3, 5, 7]) == 0\", \"assert sum_of_even_numbers([-2, -4, -6]) == -12\", \"assert sum_of_even_numbers([0, 1, 2]) == 2\", \"assert ...
{ "split": "train", "index": 1688, "acecode_id": "oss_29729", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to extract a specific identifier, 'broker_id', from a list of strings. The identifier is in the format 'broker_id=123456', where '123456' represents a numerical value. Your function should return the numerical value of the 'broker_id'...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert search_broker_id(['broker_id=123456']) == 123456\", \"assert search_broker_id(['broker_id=987654']) == 987654\", \"assert search_broker_id(['xbroker.id=1', 'broker_id=123456']) == 123456\", \"assert search_broker_id(['broker.id=123456']) == None\", \"assert ...
{ "split": "train", "index": 1689, "acecode_id": "oss_12248", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes two strings as arguments and checks if the two strings are anagrams of each other. The function should ignore capitalization, punctuation, and whitespace, ensuring that it returns true for strings like \"Astronomer\" and \"Moon starer\". The func...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert are_anagrams('Listen!', 'Silent') == True\", \"assert are_anagrams('Astronomer', 'Moon starer') == True\", \"assert are_anagrams('Hello, World!', 'dlroW ,olleH') == True\", \"assert are_anagrams('The Morse Code', 'Here come dots') == True\", \"assert are_ana...
{ "split": "train", "index": 1690, "acecode_id": "evol_12392", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `predict_labels` that predicts the output labels for each integer in the list based on the following rules: if an integer is even, the predicted label should be 1, and if it is odd, the predicted label should be 0. The function should ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert predict_labels([1, 2, 3, 4]) == [0, 1, 0, 1]\", \"assert predict_labels([5, 6, 7, 8]) == [0, 1, 0, 1]\", \"assert predict_labels([0, 1, 2]) == [1, 0, 1]\", \"assert predict_labels([-1, -2, -3, -4]) == [0, 1, 0, 1]\", \"assert predict_labels([10, 15, 20, 25])...
{ "split": "train", "index": 1691, "acecode_id": "bigcode_python_fns_38357", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a generator function that yields the first n numbers of the Fibonacci sequence. The function should take an integer n as input and return the Fibonacci numbers sequentially using the yield keyword. Your implementation should not return a list or any other collection t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list(fibonacci(1)) == [0]\", \"assert list(fibonacci(2)) == [0, 1]\", \"assert list(fibonacci(3)) == [0, 1, 1]\", \"assert list(fibonacci(4)) == [0, 1, 1, 2]\", \"assert list(fibonacci(5)) == [0, 1, 1, 2, 3]\", \"assert list(fibonacci(6)) == [0, 1, 1, 2, 3, ...
{ "split": "train", "index": 1692, "acecode_id": "evol_23492", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of target objects, each representing a feature with a specific kind and status. Each target has a 'name' and a 'kind' attribute. Your task is to implement a function that takes a list of targets, an optional name string, and returns the first target from th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_offline_target([{'name': 'FeatureA', 'kind': 'offline', 'status': 'active'}, {'name': 'FeatureB', 'kind': 'online', 'status': 'inactive'}], 'FeatureA') == {'name': 'FeatureA', 'kind': 'offline', 'status': 'active'}\", \"assert find_offline_target([{'nam...
{ "split": "train", "index": 1693, "acecode_id": "bigcode_python_fns_24781", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the normalized score for employees based on their contract type and work-related metrics. Implement a function `calculate_employee_score(contract_type: str, hours_per_week: int, additional_hours: int, responsibilities: int, projects: int) -> floa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_employee_score('full_time', 0, 0, 0, 0) == 0.0\", \"assert calculate_employee_score('contract', 45, 3, 4, 1) == 53.6\", \"assert calculate_employee_score('full_time', 40, 0, 2, 5) == 52.0\", \"assert calculate_employee_score('contract', 20, 0, 0, 0...
{ "split": "train", "index": 1694, "acecode_id": "evol_20757", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a list of field of study dictionaries, each containing an 'Id', 'name', 'level', 'parent_ids', and 'child_ids', write a function that processes this list to return a new list of dictionaries. Each dictionary in the new list should only include the 'Id', 'name', and 'level...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_fields_of_study([]) == []\", \"assert process_fields_of_study([{'Id': 1, 'name': 'Physics', 'level': 0, 'parent_ids': [], 'child_ids': []}]) == [{'Id': 1, 'name': 'Physics', 'level': 0}]\", \"assert process_fields_of_study([{'Id': 2, 'name': 'Chemist...
{ "split": "train", "index": 1695, "acecode_id": "bigcode_python_fns_23632", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Write a function that accepts a 2D array of integers as input and returns a 2D list containing only the distinct sub-lists, sorted in ascending order. Each sub-list should be treated as a distinct entity based on the values it contains, regardless of the order of those values. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_sublists([[1, 2], [2, 1], [3], [1, 2]]) == [[1, 2], [3]]\", \"assert unique_sublists([[1, 1], [1, 2], [2, 1], [3, 3]]) == [[1, 1], [1, 2], [3, 3]]\", \"assert unique_sublists([[5, 4], [4, 5], [5, 6], [6, 5], [4, 4]]) == [[4, 4], [4, 5], [5, 6]]\", \"a...
{ "split": "train", "index": 1696, "acecode_id": "evol_11815", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes an array as input and appends the string \"hello world\" to the end of the array. The function should ensure that the input is a list and raise a TypeError if it is not. The function should return the modified list after appending the string.\nPl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert append_hello_world([]) == ['hello world']\", \"assert append_hello_world(['test']) == ['test', 'hello world']\", \"assert append_hello_world(['a', 'b', 'c']) == ['a', 'b', 'c', 'hello world']\", \"assert append_hello_world(['x']) == ['x', 'hello world']\", \...
{ "split": "train", "index": 1697, "acecode_id": "evol_3709", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that serializes and deserializes a custom data structure representing a device. The device has the following attributes: 'url', 'registration_id', 'name', 'device_id', and 'active'. Your goal is to implement a function called `device_seri...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert device_serializer({'url': 'http://example.com', 'registration_id': '12345', 'name': 'Device1', 'device_id': 'abcde', 'active': True}) == '{\\\"url\\\": \\\"http://example.com\\\", \\\"registration_id\\\": \\\"12345\\\", \\\"name\\\": \\\"Device1\\\", \\\"dev...
{ "split": "train", "index": 1698, "acecode_id": "oss_13155", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the total monetary value of a merchandise item based on its quantity and individual price. The function should take four parameters: an identifier (string), a description (string), a quantity (integer), and a price (fl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_total_value('001', 'T-shirt', 10, 15.99) == 159.9\", \"assert calculate_total_value('002', 'Mug', 5, 9.99) == 49.95\", \"assert calculate_total_value('003', 'Hat', 0, 12.50) == 0.0\", \"assert calculate_total_value('004', 'Notebook', 20, 3.50) == 7...
{ "split": "train", "index": 1699, "acecode_id": "evol_21699", "num_tests": 16 }