data_source
large_stringclasses
1 value
prompt
listlengths
1
1
ability
large_stringclasses
1 value
reward_model
dict
extra_info
dict
acecode
[ { "role": "user", "content": "You are tasked with simulating a simple online game where users can register their player details. Create a function `register_and_display_player(username: str, level: int, score: int) -> str` that registers a player with the given username, level, and score, and then returns a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert register_and_display_player('player1', 5, 100) == 'Username: player1, Level: 5, Score: 100'\", \"assert register_and_display_player('player2', 3, 200) == 'Username: player2, Level: 3, Score: 200'\", \"assert register_and_display_player('player3', 10, 500) ==...
{ "split": "train", "index": 66900, "acecode_id": "oss_21345", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that manages a list of salutation choices. Your goal is to implement a function `add_salutation_choices(salutations)` that takes a list of salutations and returns a list of dictionaries, where each dictionary contains a 'label' and 'value...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_salutation_choices(['Mr', 'Mrs']) == [{'label': 'Mr', 'value': 'Mr'}, {'label': 'Mrs', 'value': 'Mrs'}]\", \"assert add_salutation_choices(['Dr', 'Prof', 'Ms']) == [{'label': 'Dr', 'value': 'Dr'}, {'label': 'Prof', 'value': 'Prof'}, {'label': 'Ms', 'valu...
{ "split": "train", "index": 66901, "acecode_id": "oss_34149", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function that categorizes a fruit based on its color and texture attributes. The function should receive a dictionary containing 'color' and 'texture' keys and return 'Mangifera indica' for Mango (if the color is 'yellow' and texture is 'smooth') or 'Malus domestica' f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert categorize_fruit({'color': 'yellow', 'texture': 'smooth'}) == 'Mangifera indica'\", \"assert categorize_fruit({'color': 'red', 'texture': 'smooth'}) == 'Malus domestica'\", \"assert categorize_fruit({'color': 'green', 'texture': 'smooth'}) == 'Unknown fruit'...
{ "split": "train", "index": 66902, "acecode_id": "evol_21158", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that takes a string as input and returns the number of vowels (a, e, i, o, u) in the string. The function should be case insensitive, meaning it should count both uppercase and lowercase vowels. Implement the function `count_vowels...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_vowels('Hello World') == 3\", \"assert count_vowels('Python Programming') == 4\", \"assert count_vowels('AEIOU') == 5\", \"assert count_vowels('aeiou') == 5\", \"assert count_vowels('') == 0\", \"assert count_vowels('12345') == 0\", \"assert count_vowe...
{ "split": "train", "index": 66903, "acecode_id": "oss_21640", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that formats a custom error message when an exception occurs. The function should take an optional parameter 'error' which can be any string representing the error message. If an exception occurs within the function, it should return the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_error_message() == 'No error occurred'\", \"assert get_error_message('Custom error message') == 'Custom error message'\", \"assert get_error_message('Another error') == 'Another error'\", \"assert get_error_message('Test error') == 'Test error'\", \"asse...
{ "split": "train", "index": 66904, "acecode_id": "bigcode_python_fns_36503", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the state change of a question in a quiz application. The states a question can have are: INCOMPLETE, COMPLETE, and FLAGGED. The initial state of a question is INCOMPLETE. Your task is to write a function `change_to_fla...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert change_to_flagged('INCOMPLETE') == 'FLAGGED'\", \"assert change_to_flagged('COMPLETE') == 'COMPLETE'\", \"assert change_to_flagged('FLAGGED') == 'FLAGGED'\", \"assert change_to_flagged('INCOMPLETE') == 'FLAGGED'\", \"assert change_to_flagged('COMPLETE') == '...
{ "split": "train", "index": 66905, "acecode_id": "oss_2369", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that extracts the version number from a given string. The input string is expected to follow a specific format, starting with 'FLASH v' followed by the version number. Your function should return just the version number as a string. If th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_version('FLASH v1.2.11') == '1.2.11'\", \"assert extract_version('FLASH v2.0.1') == '2.0.1'\", \"assert extract_version('FLASH v3.4.0') == '3.4.0'\", \"assert extract_version('FLASH v10.9.8') == '10.9.8'\", \"assert extract_version('Version FLASH v1....
{ "split": "train", "index": 66906, "acecode_id": "bigcode_python_fns_44583", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a string containing only lowercase letters and digits, write a function that generates a monoalphabetic cipher mapping for the characters in the string. The output should be a dictionary where each character from the input string is mapped to a unique character from a shu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_monoalpha_cipher('') == {}\", \"assert generate_monoalpha_cipher('a') == {'a': 'a'}\", \"assert generate_monoalpha_cipher('1111') == {'1': '1'}\", \"assert generate_monoalpha_cipher('aabbcc') == {'a': 'b', 'b': 'c', 'c': 'a'}\", \"assert generate_mo...
{ "split": "train", "index": 66907, "acecode_id": "bigcode_python_fns_38946", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a simple socket communication system. You need to implement a function called `select` that takes in three parameters: `receivers`, `senders`, and `timeout`. The `receivers` and `senders` are lists containing a single element, which is a simulated...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert select([{'buffers': ''}], [{'buffers': 'data'}], 0) == ([], [{'buffers': 'data'}], [])\", \"assert select([{'buffers': 'data1'}], [{'buffers': ''}], 0) == ([{'buffers': 'data1'}], [{'buffers': ''}], [])\", \"assert select([{'buffers': 'openai'}], [{'buffers'...
{ "split": "train", "index": 66908, "acecode_id": "bigcode_python_fns_4684", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that initializes a custom data structure representing a variant type. The variant type can hold different types of data, but for simplicity, we will only consider it to hold integers and strings. Your goal is to create a Python...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert initialize_variant() == {'int_value': 0, 'str_value': ''}\", \"assert initialize_variant()['int_value'] == 0\", \"assert initialize_variant()['str_value'] == ''\", \"assert isinstance(initialize_variant(), dict)\", \"assert 'int_value' in initialize_variant(...
{ "split": "train", "index": 66909, "acecode_id": "oss_12665", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings, where each string represents a line of text. Write a function that counts the number of lines in the provided list. Each line is separated by a newline character. Your task is to implement a function `count_lines(lines: List[str]) -> int` that t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_lines(['Hello, World!', 'This is a test.', 'Python is great!']) == 3\", \"assert count_lines([]) == 0\", \"assert count_lines(['Single line']) == 1\", \"assert count_lines(['First line', 'Second line', 'Third line']) == 3\", \"assert count_lines(['A', ...
{ "split": "train", "index": 66910, "acecode_id": "bigcode_python_fns_35438", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given an object, implement a function `is_collection(obj)` that returns `True` if the object is an iterable (excluding strings), and `False` otherwise. An iterable is any object that can return its members one at a time, allowing it to be used in a for loop or within a context ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_collection([]) == True\", \"assert is_collection(()) == True\", \"assert is_collection({}) == True\", \"assert is_collection({'key': 'value'}) == True\", \"assert is_collection(set()) == True\", \"assert is_collection('string') == False\", \"assert is_col...
{ "split": "train", "index": 66911, "acecode_id": "bigcode_python_fns_37408", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simplified backtrace of threads across multiple processors. Given a list of processor states where each processor has an active thread or is idle, your function should return a list of backtrace frames for all active ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert backtrace_all([{'active_thread': 1, 'threads': ['frame1', 'frame2']}, {'active_thread': None, 'threads': []}, {'active_thread': 2, 'threads': ['frame3']}]) == [['frame1', 'frame2'], ['frame3']]\", \"assert backtrace_all([{'active_thread': None, 'threads': []...
{ "split": "train", "index": 66912, "acecode_id": "bigcode_python_fns_18210", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with creating a fake version of the `datetime` module that allows a user to simulate the current date and time. Write a function called `get_fake_datetime` that takes a `datetime` object as input and returns a class `FakeDatetime`. This class should have two clas...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_fake_datetime(datetime(2023, 10, 1, 12, 30, 45)).now() == datetime(2023, 10, 1, 12, 30, 45)\", \"assert get_fake_datetime(datetime(2023, 1, 1, 0, 0, 0)).utcnow() == datetime(2023, 1, 1, 0, 0, 0)\", \"assert get_fake_datetime(datetime(2020, 2, 29, 23, 59,...
{ "split": "train", "index": 66913, "acecode_id": "bigcode_python_fns_31910", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `twin_primes_count(start: int, end: int) -> Tuple[List[Tuple[int, int]], int, float, int]` that finds all twin prime pairs within a given inclusive range defined by `start` and `end`. The function should return a tuple containing the following: a list of tw...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert twin_primes_count(30, 40) == ([], 0, 0.0, 0)\", \"assert twin_primes_count(3, 3) == ([], 0, 0.0, 0)\", \"assert twin_primes_count(4, 5) == ([], 0, 0.0, 0)\", \"assert twin_primes_count(5, 5) == ([], 0, 0.0, 0)\", \"assert twin_primes_count(1, 2) == ([], 0, 0...
{ "split": "train", "index": 66914, "acecode_id": "evol_22326", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `add_alpha_properties` that takes a list `numbers` and returns a dictionary containing the following properties: \n1. 'mean': The mean of the list, rounded to two decimal places. \n2. 'count': The total number of elements in the list. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_alpha_properties([1, 2, 3, 4, 5]) == {'mean': 3.0, 'count': 5, 'is_empty': False, 'max': 5, 'min': 1}\", \"assert add_alpha_properties([10, 20, 30]) == {'mean': 20.0, 'count': 3, 'is_empty': False, 'max': 30, 'min': 10}\", \"assert add_alpha_properties([...
{ "split": "train", "index": 66915, "acecode_id": "bigcode_python_fns_25196", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function called 'nested_multiple_lists_sum' that takes a list of lists containing numerical arrays and an ordering list. The function should calculate the cumulative total of all elements in the lists specified by the ordering, starting from the first element in the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert nested_multiple_lists_sum([[1, 2], [3, 4], [5]], [1, 3]) == 8\", \"assert nested_multiple_lists_sum([[10], [20, 30], [40]], [2]) == 50\", \"assert nested_multiple_lists_sum([[5, 5], [5, 5], [5]], [1, 2, 3]) == 25\", \"assert nested_multiple_lists_sum([[1], [...
{ "split": "train", "index": 66916, "acecode_id": "evol_5019", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that manages a simple task tracking system. The function, `update_task_time`, should take in a list of tasks, where each task is represented by a dictionary with an 'id' and 'changed_at' timestamp. If a task with the specified 'id' exists...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_task_time([], 1, '2023-10-01 12:00:00') == [{'id': 1, 'changed_at': '2023-10-01 12:00:00'}]\", \"assert update_task_time([{'id': 1, 'changed_at': '2023-10-01 12:00:00'}], 1, '2023-10-01 12:05:00') == [{'id': 1, 'changed_at': '2023-10-01 12:05:00'}]\",...
{ "split": "train", "index": 66917, "acecode_id": "bigcode_python_fns_33271", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing mentions in a document. Your task is to randomly create coreferring links between each mention and any preceding mention based on a given probability. For each mention, if a randomly generated number is less than the provided probab...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_coref_links([1, 2, 3, 4], 0.0) == [-1, -1, -1, -1]\", \"assert create_coref_links([], 0.03) == []\", \"assert create_coref_links([5], 0.5) == [-1]\", \"assert create_coref_links([1, 2, 3, 4, 5, 6], 0.01) == [-1, -1, -1, -1, -1, -1]\", \"assert create_...
{ "split": "train", "index": 66918, "acecode_id": "bigcode_python_fns_49282", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Implement a function `validate_email(email: str) -> bool` that checks if the provided email address is valid according to standard email format protocols. The email is considered valid if it follows the pattern: it starts with alphanumeric characters, may contain dots or unders...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_email('example@mail.com') == True\", \"assert validate_email('user.name@domain.co.uk') == True\", \"assert validate_email('user_name123@domain.org') == True\", \"assert validate_email('user@domain.com') == True\", \"assert validate_email('user@subdo...
{ "split": "train", "index": 66919, "acecode_id": "evol_6726", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of rental experiences, where each experience is represented as a dictionary containing a title, description, latitude, and longitude. The function should filter the experiences based on a specified latitude and longitude range (inclusive) ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_experiences([{'title': 'Beach House', 'description': 'Nice view', 'latitude': 34.0, 'longitude': -118.5}, {'title': 'Mountain Cabin', 'description': 'Cozy cabin', 'latitude': 35.0, 'longitude': -120.0}], (33.0, 36.0), (-119.0, -117.0)) == [{'title': '...
{ "split": "train", "index": 66920, "acecode_id": "evol_13084", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing a user's username. Your task is to determine if the username is valid based on the following criteria: A valid username must be between 3 and 20 characters long and can only contain alphanumeric characters (letters and numbers) as well as und...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_username('user123') == True\", \"assert is_valid_username('u') == False\", \"assert is_valid_username('username!') == False\", \"assert is_valid_username('valid_username') == True\", \"assert is_valid_username('us') == False\", \"assert is_valid_use...
{ "split": "train", "index": 66921, "acecode_id": "bigcode_python_fns_32951", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to determine the required scopes for accessing different resources and operations in an API. Implement a function `get_expected_scopes(resource, operation)` that takes in the resource name and operation as input and returns the expect...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_expected_scopes('example1', 'get_example1') == [{'apiKey1': []}, {'apiKey2': []}]\", \"assert get_expected_scopes('example2', 'create_example2') == [{'apiKey3': []}]\", \"assert get_expected_scopes('example3', 'delete_example3') == [{'apiKey4': ['admin']...
{ "split": "train", "index": 66922, "acecode_id": "oss_16889", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer representing an angle in degrees, write a function that normalizes the angle to fall within the range of [-90, 270). The function should take into account that angles can be negative or greater than 360 degrees. The input angle can be any integer, and the outpu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert optimizeAngle(450) == 90\", \"assert optimizeAngle(-100) == 260\", \"assert optimizeAngle(720) == 0\", \"assert optimizeAngle(-360) == 0\", \"assert optimizeAngle(360) == 0\", \"assert optimizeAngle(0) == 0\", \"assert optimizeAngle(180) == 180\", \"assert o...
{ "split": "train", "index": 66923, "acecode_id": "bigcode_python_fns_21264", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of annotations in the form of dictionaries, where each dictionary represents an annotation with a key '/T' representing the name of the annotation. Write a function `get_annotation_names(annotations: List[Dict[str, str]]) -> List[str]` that extracts and ret...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_annotation_names([{'key': 'value1', '/T': 'Annotation1'}, {'/T': 'Annotation2'}, {'/A': 'value3'}]) == ['Annotation1', 'Annotation2']\", \"assert get_annotation_names([{'/T': 'SingleAnnotation'}]) == ['SingleAnnotation']\", \"assert get_annotation_names(...
{ "split": "train", "index": 66924, "acecode_id": "bigcode_python_fns_43237", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a year Y and a month M, write a function that calculates the total number of days and the total number of weekdays (Monday to Friday) for that month in the specified year. The function should return a tuple with the total number of days and the total number of weekdays. T...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_days_weekdays(1992, 7) == (31, 23)\", \"assert count_days_weekdays(2000, 2) == (29, 21)\", \"assert count_days_weekdays(1900, 2) == (28, 20)\", \"assert count_days_weekdays(2019, 10) == (31, 23)\", \"assert count_days_weekdays(2008, 1) == (31, 23)\", \...
{ "split": "train", "index": 66925, "acecode_id": "evol_21310", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a 2D list of integers representing a grid, implement a function that identifies the maximum value in each row and returns a new list containing these maximum values. The grid will always have at least one row and at least one column. The function should take the grid as i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_values([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == [3, 6, 9]\", \"assert max_values([[10, 20], [30, 40], [50, 60]]) == [20, 40, 60]\", \"assert max_values([[5]]) == [5]\", \"assert max_values([[1, 0, 1], [1, 1, 1], [0, 1, 0]]) == [1, 1, 1]\", \"assert max_valu...
{ "split": "train", "index": 66926, "acecode_id": "bigcode_python_fns_13320", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You have a list of folder names represented as strings. Your task is to rename these folders in a sequential manner, starting from a given number. Each folder should be renamed to a zero-padded string of three digits. For example, if you start with the number 0, the first folde...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rename_folders(['FolderA', 'FolderB', 'FolderC'], 0) == ['000', '001', '002']\", \"assert rename_folders(['Documents', 'Photos', 'Music'], 1) == ['001', '002', '003']\", \"assert rename_folders(['Project1', 'Project2'], 5) == ['005', '006']\", \"assert renam...
{ "split": "train", "index": 66927, "acecode_id": "bigcode_python_fns_17808", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Develop a function that evaluates the maximum accumulated worth that can be obtained by traversing strictly k cells of a square grid of dimension N x N, where N must not be less than 2. Each movement is solely vertical or horizontal, adhering to the confines of the grid. Each c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert maxSumPath([[1, 10], [2, 9]], 2) == [10, 9]\", \"assert maxSumPath([[5, 1], [4, 2]], 2) == [5, 4]\", \"assert maxSumPath([[3, 3, 3], [3, 3, 3], [3, 3, 3]], 3) == [3, 3, 3]\", \"assert maxSumPath([[9, 1], [8, 2]], 2) == [9, 8]\", \"assert maxSumPath([[1, 1], ...
{ "split": "train", "index": 66928, "acecode_id": "evol_19337", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the process of deleting a cache folder associated with a given package. The function should take a string input representing the package name and return a boolean value indicating whether the deletion was successful. If the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert delete_cache('package1') == True\", \"assert delete_cache('package2') == True\", \"assert delete_cache('example_package') == True\", \"assert delete_cache('test_package') == True\", \"assert delete_cache('') == False\", \"assert delete_cache('cache_package')...
{ "split": "train", "index": 66929, "acecode_id": "bigcode_python_fns_49292", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing power readings from a model. Your task is to implement a function that calculates the average power from this list. The average power is defined as the sum of all the power readings divided by the number of readings. If the list is ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_power([10, 20, 30]) == 20.0\", \"assert average_power([5]) == 5.0\", \"assert average_power([-10, -20, -30]) == -20.0\", \"assert average_power([0, 0, 0]) == 0.0\", \"assert average_power([]) == 0.0\", \"assert average_power([1, 2, 3, 4, 5]) == 3.0\"...
{ "split": "train", "index": 66930, "acecode_id": "oss_11105", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a user ID represented as a string, implement a function that retrieves the corresponding username from a predefined mapping of user IDs to usernames. If the user ID does not exist in the mapping, the function should raise a custom exception called UserError, indicating th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert username('zx7gd1yx') == '1'\", \"assert username('7j477kvj') == 'AnInternetTroll'\", \"assert username('abc123') == 'JohnDoe'\", \"assert username('xyz789') == 'JaneSmith'\", \"assert username('zx7gd1yx') == '1'\", \"assert username('abc123') == 'JohnDoe'\",...
{ "split": "train", "index": 66931, "acecode_id": "bigcode_python_fns_16012", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a list of strings, where each string represents a device in the format 'Manufacturer - Serial_Number - Description'. Write a function `initialize_device_flow(devices: List[str]) -> Dict[str, str]` that accepts this list of devices. The function should return a dic...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert initialize_device_flow(['DeviceCo - 12345 - Device A']) == {'status': 'initialized', 'device': 'DeviceCo'}\", \"assert initialize_device_flow(['GadgetInc - 67890 - Gadget B', 'GadgetInc - 67891 - Gadget C']) == {'status': 'initialized', 'device': 'GadgetInc'...
{ "split": "train", "index": 66932, "acecode_id": "bigcode_python_fns_5776", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that validates and typecasts input values according to specified rules. Write a function `validate_value(name: str, default_value: Any, value: Optional[Any], annotation: Optional[type] = None) -> Any` that behaves as follows: \n\n- If `va...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_value('age', 18, 25, int) == 25\", \"assert validate_value('age', 18, None, int) == 18\", \"assert validate_value('name', 'default', 'John', str) == 'John'\", \"assert validate_value('name', 'default', None, str) == 'default'\", \"assert validate_va...
{ "split": "train", "index": 66933, "acecode_id": "oss_21909", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a directed graph represented as an adjacency list and a set of visited nodes. Your task is to implement a function to perform a depth-first search (DFS) traversal of the graph, starting from a given node, and return the nodes visited during the traversal in the or...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert dfs_traversal({'A': ['B', 'C'], 'B': ['D'], 'C': [], 'D': []}, 'A', set()) == ['A', 'B', 'D', 'C']\", \"assert dfs_traversal({'X': ['Y'], 'Y': [], 'Z': ['Y']}, 'X', set()) == ['X', 'Y']\", \"assert dfs_traversal({'1': ['2'], '2': ['3'], '3': []}, '1', set())...
{ "split": "train", "index": 66934, "acecode_id": "oss_34163", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that adjusts a list of incoming shortwave radiation flux values based on topographic conditions. Given a list of radiation values and a global missing value indicator, your function should replace any occurrences of the global missing val...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert adjust_radiation_flux([100.0, 200.0, -999.0, 300.0], -999.0) == [100.0, 200.0, 200.0, 300.0]\", \"assert adjust_radiation_flux([-999.0, -999.0, -999.0], -999.0) == []\", \"assert adjust_radiation_flux([150.0, 250.0, 350.0], -999.0) == [150.0, 250.0, 350.0]\"...
{ "split": "train", "index": 66935, "acecode_id": "bigcode_python_fns_17557", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of file sizes in megabytes, write a function `average_file_size(sizes: List[float]) -> float` that calculates the average size of the files. The function should return the average size rounded to two decimal places. If the list is empty, return 0.0.\nPlease reason ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_file_size([1.5, 2.0, 3.5]) == 2.33\", \"assert average_file_size([0.0, 0.0, 0.0]) == 0.0\", \"assert average_file_size([10.5]) == 10.5\", \"assert average_file_size([]) == 0.0\", \"assert average_file_size([1.1, 2.2, 3.3, 4.4, 5.5]) == 3.3\", \"asser...
{ "split": "train", "index": 66936, "acecode_id": "bigcode_python_fns_18410", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a Unicode character string, implement a function `extract_url(text)` that extracts all web addresses (HTTP/HTTPS) including domain suffixes (.com, .org, .info) and query parameters, while excluding any embedded username or password information. The function should also ac...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_url('Visit us at https://www.example.com for details.') == ['https://www.example.com']\", \"assert extract_url('Connect via http://192.168.0.1/login') == ['http://192.168.0.1/login']\", \"assert extract_url('Check out our site: http://example.org/pag...
{ "split": "train", "index": 66937, "acecode_id": "evol_12042", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Design a function that calculates the weighted average of an array of numbers using another array of equal length that gives the weights. The function should take two inputs: an array of numbers and an array containing the weights of each number. The weights must be non-negativ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert weighted_average([5, 5, 5], [1, 1, 1]) == 5.0\", \"assert weighted_average([0, 0, 0], [0.1, 0.1, 0.1]) == 0.0\", \"assert weighted_average([10, 20], [0.5, 0.5]) == 15.0\", \"assert weighted_average([1, 2], [1, 1]) == 1.5\", \"assert weighted_average([1, 2, 3...
{ "split": "train", "index": 66938, "acecode_id": "evol_28542", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a positive integer n, write a function `greatest_prime_factor(n)` that returns the greatest prime factor of n. A prime factor is a factor that is a prime number. You can assume that n is greater than 1.\nPlease reason step by step, then write a self-contained Python solut...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert greatest_prime_factor(2) == 2\", \"assert greatest_prime_factor(3) == 3\", \"assert greatest_prime_factor(4) == 2\", \"assert greatest_prime_factor(15) == 5\", \"assert greatest_prime_factor(28) == 7\", \"assert greatest_prime_factor(29) == 29\", \"assert gr...
{ "split": "train", "index": 66939, "acecode_id": "evol_3931", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that converts different time units into milliseconds. The function should take a string representing the time unit ('day', 'hour', or 'minute') as input and return the equivalent value in milliseconds. The function should return 86400...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_time_to_millis('day') == 86400000\", \"assert convert_time_to_millis('hour') == 3600000\", \"assert convert_time_to_millis('minute') == 60000\", \"assert convert_time_to_millis('second') == -1\", \"assert convert_time_to_millis('week') == -1\", \"ass...
{ "split": "train", "index": 66940, "acecode_id": "oss_32129", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing a file path. Your task is to implement a function that checks if the file has a '.yaml' extension. If it does, the function should return True. If it does not, the function should raise an exception called ETLInputError with the message 'Pipe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_yaml_file_path('pipeline_definition.yaml') == True\", \"assert is_yaml_file_path('config.yaml') == True\", \"assert is_yaml_file_path('data.yaml') == True\", \"assert is_yaml_file_path('folder/file.yaml') == True\", \"assert is_yaml_file_path('folder/subf...
{ "split": "train", "index": 66941, "acecode_id": "bigcode_python_fns_47980", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Implement a recursive function that retrieves an element from a given list at a specified index. If the index is out of bounds, the function should return a custom error message instead of raising an exception. Do not use the try-except clause in your implementation; instead, u...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_list_element([1, 2, 3], 0) == 1\", \"assert get_list_element([1, 2, 3], 1) == 2\", \"assert get_list_element([1, 2, 3], 2) == 3\", \"assert get_list_element(['a', 'b', 'c'], 0) == 'a'\", \"assert get_list_element(['a', 'b', 'c'], 2) == 'c'\", \"assert ge...
{ "split": "train", "index": 66942, "acecode_id": "evol_7678", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the creation of a spatial reference object based on a given spatial reference identifier (SRID). Your function should take an integer SRID as input and return a string representation of the spatial reference in the format '...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_spatial_reference(4326) == 'SpatialReference(SRID: 4326)'\", \"assert create_spatial_reference(3857) == 'SpatialReference(SRID: 3857)'\", \"assert create_spatial_reference(26910) == 'SpatialReference(SRID: 26910)'\", \"assert create_spatial_reference(...
{ "split": "train", "index": 66943, "acecode_id": "bigcode_python_fns_14068", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a user authentication function that simulates a login process using email and password. Write a Python function `jwt_login_with_email_and_password` that takes in a user's email and password as input and returns an HTTP status code based on the a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert jwt_login_with_email_and_password('user@example.com', 'securepassword') == 200\", \"assert jwt_login_with_email_and_password('user@example.com', 'wrongpassword') == 400\", \"assert jwt_login_with_email_and_password('wronguser@example.com', 'securepassword') ...
{ "split": "train", "index": 66944, "acecode_id": "oss_21087", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two strings, `query` and `database`, representing two sequences of DNA. Write a function `find_best_match(query: str, database: str, threads: int) -> str` that finds the best match of the `query` sequence in the `database` sequence using a simplified scoring syste...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_best_match('ATCG', 'ATCGATCG', 1) == 'ATCG'\", \"assert find_best_match('ATC', 'ATCGATCG', 1) == 'ATC'\", \"assert find_best_match('A', 'A', 1) == 'A'\", \"assert find_best_match('', 'ATCG', 1) == ''\", \"assert find_best_match('C', 'ATCG', 1) == 'C'\",...
{ "split": "train", "index": 66945, "acecode_id": "bigcode_python_fns_21135", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function `linear_search` that takes a list of integers and a target integer as inputs. The function should return a string indicating whether the target integer is present in the list and, if so, at which index. If the target integer is not found, return a message s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert linear_search([4, 5, 2, 3], 2) == 'The integer 2 is present in the list at position 2.'\", \"assert linear_search([1, 2, 3, 4], 3) == 'The integer 3 is present in the list at position 2.'\", \"assert linear_search([10, 20, 30, 40], 25) == 'The integer 25 is ...
{ "split": "train", "index": 66946, "acecode_id": "evol_4910", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a python function that receives a dictionary as input, where each key-value pair represents a name and its frequency. The function should return a list of names that correspond to the lowest frequency in the dictionary. If there are multiple names with the same lowest fr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_lowest_freq({'Jon': 3, 'Arya': 1, 'Tyrion': 1, 'Cersei': 1}) == ['Arya', 'Tyrion', 'Cersei']\", \"assert find_lowest_freq({'Alice': 2, 'Bob': 3, 'Charlie': 2}) == ['Alice', 'Charlie']\", \"assert find_lowest_freq({'X': 5}) == ['X']\", \"assert find_lowe...
{ "split": "train", "index": 66947, "acecode_id": "evol_15898", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `cubed_product(lst)` that computes the product of the cubed values of the individual integer elements in a given list. The list should only contain integers between -10 and 10 inclusive. If any element is not an integer or is out of the specified range, the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cubed_product([0, 1, -1]) == 0\", \"assert cubed_product([-10, 0, 10]) == 0\", \"assert cubed_product([10]) == 1000\", \"assert cubed_product([5]) == 125\", \"assert cubed_product([-5]) == -125\", \"assert cubed_product([9, 0]) == 0\", \"assert cubed_product...
{ "split": "train", "index": 66948, "acecode_id": "evol_25079", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Write a function `multiply_three_numbers(num1, num2, num3)` that accepts three distinct decimal numbers and returns their product. The function should ensure that the inputs are valid decimal numbers. If any of the inputs are not valid decimal numbers, it should return the stri...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert multiply_three_numbers(1.5, 2.0, 3.0) == 9.0\", \"assert multiply_three_numbers(-1.5, 2.0, 3.0) == -9.0\", \"assert multiply_three_numbers(0.0, 2.0, 3.0) == 0.0\", \"assert multiply_three_numbers(7.0, 6.0, 5.0) == 210.0\", \"assert multiply_three_numbers(1, ...
{ "split": "train", "index": 66949, "acecode_id": "evol_23825", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a string representing a video platform's URL pattern, where each video is represented by a sequence of characters. Your task is to implement a function that counts the total number of videos represented in the string. A video is defined as a sequence of non-empty ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_videos('video1,video2,video3') == 3\", \"assert count_videos('video1,video2') == 2\", \"assert count_videos('') == 0\", \"assert count_videos('video1') == 1\", \"assert count_videos('video1,') == 1\", \"assert count_videos(',video2') == 1\", \"assert c...
{ "split": "train", "index": 66950, "acecode_id": "bigcode_python_fns_42", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks if a given movie title can be added to a media management system. The function should take a movie title as input and return a boolean value indicating whether the movie title meets certain criteria. A movie title is considere...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_movie_title('Inception') == True\", \"assert is_valid_movie_title('A') == False\", \"assert is_valid_movie_title('AB') == False\", \"assert is_valid_movie_title('The Shawshank Redemption') == True\", \"assert is_valid_movie_title('') == False\", \"a...
{ "split": "train", "index": 66951, "acecode_id": "oss_16361", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string containing only parentheses '(', ')', '{', '}', '[' and ']', write a function that checks if the string is valid. An input string is valid if: 1. Open brackets must be closed by the same type of brackets. 2. Open brackets must be closed in the correct order. Retu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_parentheses('()[]{}') == True\", \"assert is_valid_parentheses('(}') == False\", \"assert is_valid_parentheses('{[()]}') == True\", \"assert is_valid_parentheses('[') == False\", \"assert is_valid_parentheses(']') == False\", \"assert is_valid_paren...
{ "split": "train", "index": 66952, "acecode_id": "bigcode_python_fns_44157", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that compares two unique wireless antenna numbers. The function should take two integers as input, representing the antenna numbers, and return a string that indicates their relationship. The possible return values are: 'equal' if the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compare_antennas(1, 1) == 'equal'\", \"assert compare_antennas(2, 2) == 'equal'\", \"assert compare_antennas(3, 1) == 'greater'\", \"assert compare_antennas(1, 3) == 'less'\", \"assert compare_antennas(5, 4) == 'greater'\", \"assert compare_antennas(4, 5) ==...
{ "split": "train", "index": 66953, "acecode_id": "oss_15148", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing a collection of button signals in a simple GUI application. You need to implement a function `manage_button_signals(buttons, signals, connections)` that takes three parameters: a list of buttons, a list of signals, and a list of connections. The `co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_button_signals(['button1', 'button2'], ['signal1'], [(0, 0)]) == ['button1']\", \"assert manage_button_signals(['button1'], ['signal1', 'signal2'], []) == []\", \"assert manage_button_signals(['button1'], ['signal1'], [(0, 0)]) == ['button1']\", \"ass...
{ "split": "train", "index": 66954, "acecode_id": "oss_11458", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Write a function to find the longest common suffix string amongst an array of strings. If there is no common suffix, return an empty string. The function should be case-sensitive when finding the common suffix if the boolean flag `ignoreCase` is set to false. If `ignoreCase` is...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longest_common_suffix([\\\"dog\\\", \\\"racecar\\\", \\\"car\\\"], True) == (\\\"\\\", 0)\", \"assert longest_common_suffix([\\\"abc!def\\\", \\\"def!ghi\\\", \\\"ghi!abc\\\"], False) == (\\\"\\\", 0)\", \"assert longest_common_suffix([], True) == (\\\"\\\",...
{ "split": "train", "index": 66955, "acecode_id": "evol_9904", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are given a string that represents an HTML element. Your task is to determine if the string is a valid HTML form element. A valid HTML form element is defined as any string that starts with '<form>' and ends with '</form>'. Implement a function that checks this condition. T...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_form_element('<form></form>') == True\", \"assert is_valid_form_element('<form>Content</form>') == True\", \"assert is_valid_form_element('<notform></notform>') == False\", \"assert is_valid_form_element('<form>Invalid</notform>') == False\", \"asse...
{ "split": "train", "index": 66956, "acecode_id": "bigcode_python_fns_9872", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that manipulates a list of user links based on a given page parameter. The function should order the list of user links by the 'created_on' field in descending order. If the page parameter is 'saved', only the links that are marked as...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert _user_links([], 'saved') == []\", \"assert _user_links([], 'recent') == []\", \"assert _user_links([], 'popular') == []\", \"assert _user_links([{'created_on': 1, 'saved': True, 'popularity_index': 5}], 'saved') == [{'created_on': 1, 'saved': True, 'populari...
{ "split": "train", "index": 66957, "acecode_id": "oss_1016", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of file names and extracts specific data from them based on their extension. Your function should iterate through the provided list of file names and print a message for each file that is not found. If a file ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_files(['file1.dds', 'file2.txt', 'file3.dds']) == ['Extracted data from file1.dds', 'file2.txt not found. Skipping', 'Extracted data from file3.dds']\", \"assert process_files(['file1.txt', 'file2.txt', 'file3.txt']) == ['file1.txt not found. Skippin...
{ "split": "train", "index": 66958, "acecode_id": "oss_13211", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Write a Python function that calculates the sum of all prime numbers up to a given integer n. The function should take an integer n (0 <= n <= 10^6) as input and return the sum of all prime numbers less than or equal to n.\nPlease reason step by step, then write a self-containe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_primes(0) == 0\", \"assert sum_of_primes(1) == 0\", \"assert sum_of_primes(2) == 2\", \"assert sum_of_primes(3) == 5\", \"assert sum_of_primes(10) == 17\", \"assert sum_of_primes(11) == 28\", \"assert sum_of_primes(20) == 77\", \"assert sum_of_primes(...
{ "split": "train", "index": 66959, "acecode_id": "evol_11702", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Write a python function that takes two integers, `num` and `divisor`, and returns the result of the modulo operation. If the `divisor` is zero, return the string 'Error: Divisor should not be zero'. If the `divisor` is negative, return the string 'Error: Divisor should not be n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert modulo(10, 2) == 0\", \"assert modulo(10, 3) == 1\", \"assert modulo(10, 5) == 0\", \"assert modulo(10, -2) == 'Error: Divisor should not be negative'\", \"assert modulo(10, 0) == 'Error: Divisor should not be zero'\", \"assert modulo(-10, -3) == 'Error: Div...
{ "split": "train", "index": 66960, "acecode_id": "evol_2663", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that maps logging levels to their corresponding integer values. You will be given a dictionary that contains different logging levels (e.g., 'INFO', 'DEBUG', 'ERROR', 'WARN') as keys, and their integer values as the values. Your goal ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_logging_level_value({'INFO': 20, 'DEBUG': 10, 'ERROR': 40, 'WARN': 30}, 'INFO') == 20\", \"assert get_logging_level_value({'INFO': 20, 'DEBUG': 10, 'ERROR': 40, 'WARN': 30}, 'DEBUG') == 10\", \"assert get_logging_level_value({'INFO': 20, 'DEBUG': 10, 'ER...
{ "split": "train", "index": 66961, "acecode_id": "oss_22196", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the behavior of a node in a distributed system during a view change. Each node has a property called `last_ordered_3pc`, which represents the last ordered 3-phase commit (3pc) of transactions as a tuple (view_no, order_...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reset_last_ordered_3pc([(1, 100), (1, 200), (1, 300)], 1) == [(0, 0), (0, 0), (0, 0)]\", \"assert reset_last_ordered_3pc([(0, 100), (0, 200)], 0) == [(0, 0), (0, 0)]\", \"assert reset_last_ordered_3pc([(3, 300), (2, 250), (3, 200)], 3) == [(0, 0), (2, 250), ...
{ "split": "train", "index": 66962, "acecode_id": "bigcode_python_fns_30792", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function called 'cipher' that takes a string as input and returns a ciphered version of that string. The ciphering should be done by rotating the English alphabet by three positions forward. The function must preserve the case of the letters and keep non-alphabetica...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cipher('Hello, World!') == 'Khoor, Zruog!'\", \"assert cipher('Python3.8') == 'Sbwkrq3.8'\", \"assert cipher('aBcDeFg') == 'dEfGhIj'\", \"assert cipher('Zebra!@#') == 'Cheud!@#'\", \"assert cipher('') == ''\", \"assert cipher('1234') == '1234'\", \"assert ci...
{ "split": "train", "index": 66963, "acecode_id": "evol_30034", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function `quaternion_add` that takes two quaternions represented as tuples of four real numbers (a, b, c, d) and returns their sum as a tuple. Each quaternion is represented as (a, b, c, d), where 'a' is the real part and 'b', 'c', 'd' are the coefficients of the im...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert quaternion_add((1, 2, 3, 4), (5, 6, 7, 8)) == (6, 8, 10, 12)\", \"assert quaternion_add((0, 0, 0, 0), (1, 1, 1, 1)) == (1, 1, 1, 1)\", \"assert quaternion_add((-1, -2, -3, -4), (5, 6, 7, 8)) == (4, 4, 4, 4)\", \"assert quaternion_add((1, 1, 1, 1), (2, 2, 2, ...
{ "split": "train", "index": 66964, "acecode_id": "evol_29919", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two arrays, `values` and `weights`, both of the same length, write a function `weighted_mean(values: List[float], weights: List[float]) -> float` that calculates the weighted mean of the values using the provided weights. The weighted mean is defined as the sum of the pro...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert weighted_mean([5], [1]) == 5.0\", \"assert weighted_mean([-1, 0, 1], [1, 1, 1]) == 0.0\", \"assert weighted_mean([0, 0, 0], [1, 1, 1]) == 0.0\", \"assert weighted_mean([1, 1, 1, 1], [1, 1, 1, 1]) == 1.0\", \"assert weighted_mean([3, 6, 9], [1, 1, 1]) == 6.0\...
{ "split": "train", "index": 66965, "acecode_id": "bigcode_python_fns_43274", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a string that represents the contents of an HTML document. Your task is to implement a function that takes this HTML string and a dictionary of options, and returns a formatted string that indicates whether the document has a header, a footer, and the number of im...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_html_report('<html>...</html>', {'header': True, 'footer': False, 'images': ['img1.png', 'img2.png']}) == 'Header: True, Footer: False, Image Count: 2'\", \"assert format_html_report('<html>...</html>', {'header': False, 'footer': True, 'images': []})...
{ "split": "train", "index": 66966, "acecode_id": "bigcode_python_fns_15840", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `text`, implement a function `transform_string_to_tuple(text: str) -> tuple` that transforms the input string into a tuple containing its individual characters. The characters in the tuple should appear in the same order as they were in the original string. You s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transform_string_to_tuple('') == ()\", \"assert transform_string_to_tuple('a') == ('a',)\", \"assert transform_string_to_tuple('abc') == ('a', 'b', 'c')\", \"assert transform_string_to_tuple('hello') == ('h', 'e', 'l', 'l', 'o')\", \"assert transform_string_...
{ "split": "train", "index": 66967, "acecode_id": "oss_16735", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer n, generate all unique combinations of its factors that fall within the range [2, n - 1]. Each combination must have a product that is a perfect square and the sum of the factors in the combination must be a prime number. Return a list of all such combinations....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert advanced_factor_combinations(10) == []\", \"assert advanced_factor_combinations(20) == []\", \"assert advanced_factor_combinations(30) == []\", \"assert advanced_factor_combinations(40) == []\", \"assert advanced_factor_combinations(100) == []\"]}" }
{ "split": "train", "index": 66968, "acecode_id": "evol_26356", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that calculates the L_p norm of the list. The L_p norm is defined as the p-th root of the sum of the absolute values of each element raised to the power of p. You need to implement the function `pnorm(x: List[int], p: int) -> float...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert abs(pnorm([1, 2, 3], 2) - 3.7416573867739413) < 1e-9\", \"assert abs(pnorm([-1, -2, -3], 2) - 3.7416573867739413) < 1e-9\", \"assert abs(pnorm([0, 0, 0], 1) - 0.0) < 1e-9\", \"assert abs(pnorm([3, 4], 2) - 5.0) < 1e-9\", \"assert abs(pnorm([1, 2, 3], 3) - 3....
{ "split": "train", "index": 66969, "acecode_id": "bigcode_python_fns_38146", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that calculates the sum of all integer values in a given nested dictionary. The dictionary can contain other dictionaries as values, and the depth can be up to 5 levels. The keys will always be strings, and the values can either be integers or other dictionarie...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_nested_dict_values({'a': 1, 'b': 2}) == 3\", \"assert sum_nested_dict_values({'a': 1, 'b': {'c': 3, 'd': 4}}) == 8\", \"assert sum_nested_dict_values({'x': {'y': {'z': 10}}, 'a': 5}) == 15\", \"assert sum_nested_dict_values({'level1': {'level2': {'level3...
{ "split": "train", "index": 66970, "acecode_id": "evol_6376", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `highest_common_factor(arr)` that takes a list of integers `arr` and returns the highest common factor (HCF) of the numbers in the list. The input list will contain at least two integers. For example, given the input `arr = [12, 18, 36]`, the function should re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert highest_common_factor([12, 18, 36]) == 6\", \"assert highest_common_factor([48, 64, 16]) == 16\", \"assert highest_common_factor([7, 14, 21]) == 7\", \"assert highest_common_factor([100, 25, 50]) == 25\", \"assert highest_common_factor([8, 12, 4]) == 4\", \"...
{ "split": "train", "index": 66971, "acecode_id": "evol_12954", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a speech recognition process. The function takes a string input representing the recognized speech and checks if it matches the specific phrase 'hello there'. If it matches, the function should return the response 'General ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_phrase('hello there') == 'General Kenobi!'\", \"assert check_phrase('Hello there') == 'Unrecognized phrase'\", \"assert check_phrase('hi there') == 'Unrecognized phrase'\", \"assert check_phrase('hello there!') == 'Unrecognized phrase'\", \"assert chec...
{ "split": "train", "index": 66972, "acecode_id": "oss_35035", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a 3x3 grid representing a tic-tac-toe board, where each cell can contain 'X', 'O', or an empty space (' '). Write a function `check_win(board)` that determines the outcome of the game. The function should return 'X' if player X has won, 'O' if player O has won, 'T...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_win([['X', 'X', 'X'], [' ', 'O', 'O'], [' ', ' ', ' ']]) == 'X'\", \"assert check_win([['O', 'O', 'O'], ['X', ' ', 'X'], [' ', ' ', ' ']]) == 'O'\", \"assert check_win([['X', 'O', 'X'], ['X', 'O', 'O'], ['O', 'X', 'X']]) == 'Tie'\", \"assert check_win(...
{ "split": "train", "index": 66973, "acecode_id": "oss_27990", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of words (tokens) and a dictionary containing the inverse document frequency (idf) for each word, implement a function that calculates the term frequency-inverse document frequency (tf-idf) score for each word in the list. The tf-idf score for a word is calculated ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert gen_tfidf(['a', 'b', 'c', 'a'], {'a': 1.0, 'b': 1.0, 'c': 1.0}) == {'a': 0.5, 'b': 0.25, 'c': 0.25}\", \"assert gen_tfidf(['one', 'two', 'three'], {'one': 0.0, 'two': 0.0}) == {'one': 0.0, 'two': 0.0, 'three': 0.0}\", \"assert gen_tfidf([], {'a': 1.0}) == {}...
{ "split": "train", "index": 66974, "acecode_id": "bigcode_python_fns_16352", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Your task is to write a function that determines if there are any duplicates in the list. The function should return True if there is at least one duplicate element, and False otherwise. Implement the function `has_duplicates(nums: List[int]) -...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert has_duplicates([1, 2, 3, 4, 5]) == False\", \"assert has_duplicates([1, 2, 3, 4, 5, 1]) == True\", \"assert has_duplicates([10, 20, 30, 40]) == False\", \"assert has_duplicates([10, 20, 30, 10]) == True\", \"assert has_duplicates([]) == False\", \"assert has...
{ "split": "train", "index": 66975, "acecode_id": "bigcode_python_fns_24908", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given an integer 'index' and two empty lists 'gate_seq_1' and 'gate_seq_2'. Your task is to populate these lists based on the value of 'index' using specific rules. The 'index' will determine how many operations to add to each list and which operations to add. The opera...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_iSWAP_like_twoQ_clifford(0, [], []) == ([0, 0, 0, 1], [0, 2, 0, 3])\", \"assert add_iSWAP_like_twoQ_clifford(1, [], []) == ([1, 0, 0, 1], [0, 2, 0, 3])\", \"assert add_iSWAP_like_twoQ_clifford(24, [], []) == ([0, 0, 1, 1], [1, 2, 0, 3])\", \"assert add_i...
{ "split": "train", "index": 66976, "acecode_id": "bigcode_python_fns_20351", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given a list of keys and a nested dictionary, your task is to extract corresponding values from the dictionary based on the provided keys. If a key does not exist in the nested dictionary, return None for that key. The keys can also include dot notation to access nested values....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_values(['message', 'count', 'nested.message'], {'message': '<message>', 'count': 42, 'nested': {'message': '<nested_message>'}}) == ['<message>', 42, '<nested_message>']\", \"assert extract_values(['unknown', 'count'], {'message': '<message>', 'count...
{ "split": "train", "index": 66977, "acecode_id": "bigcode_python_fns_9417", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given an integer 'month' representing a month of the year (from 1 to 12). Write a function that returns the number of conversation steps that took place in a chat system for the specified month. The function should return 0 if the month is less than 1 or greater than 12...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert conversation_steps(1) == 100\", \"assert conversation_steps(2) == 150\", \"assert conversation_steps(3) == 200\", \"assert conversation_steps(4) == 250\", \"assert conversation_steps(5) == 300\", \"assert conversation_steps(6) == 350\", \"assert conversation...
{ "split": "train", "index": 66978, "acecode_id": "bigcode_python_fns_13911", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two floating-point numbers x and y, implement a function `create_resolution(x: float, y: float) -> dict` that returns a dictionary representing a resolution with the keys 'x' and 'y', corresponding to the values of x and y respectively. The dictionary should be in the for...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_resolution(1920.0, 1080.0) == {'x': 1920.0, 'y': 1080.0}\", \"assert create_resolution(1280.5, 720.5) == {'x': 1280.5, 'y': 720.5}\", \"assert create_resolution(2560.0, 1440.0) == {'x': 2560.0, 'y': 1440.0}\", \"assert create_resolution(3840.0, 2160.0...
{ "split": "train", "index": 66979, "acecode_id": "bigcode_python_fns_17190", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `calculate_learning_rate` that computes the learning rate at a given `global_step`, based on an exponential decay schedule. The learning rate starts at `start` and decays to `end` over a specified number of `steps`. The function shoul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_learning_rate(500, 0.01, 0.001, 1000) > 0.005\", \"assert calculate_learning_rate(1000, 0.01, 0.001, 1000) == 0.001\", \"assert calculate_learning_rate(1500, 0.01, 0.001, 1000) == 0.001\", \"assert calculate_learning_rate(250, 0.05, 0.005, 500) > 0...
{ "split": "train", "index": 66980, "acecode_id": "oss_32545", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `has_overflow(input_list: List[int], limit: int) -> bool` that checks if the sum of the integers in the list exceeds a given limit. The function should return True if the sum exceeds the limit, and False otherwise. The list will contai...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert has_overflow([1, 2, 3], 6) == False\", \"assert has_overflow([1, 2, 3], 5) == True\", \"assert has_overflow([-1, -2, -3], -5) == False\", \"assert has_overflow([10, 20, 30], 59) == True\", \"assert has_overflow([0, 0, 0], 0) == False\", \"assert has_overflow...
{ "split": "train", "index": 66981, "acecode_id": "bigcode_python_fns_16581", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are developing a calibration tool for VFAT (VMM Frontend and Tracker) boards used in particle physics experiments. The calibration process involves scanning links on the VFAT board either individually or collectively based on a specific condition. Your task is to implement ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert performCalibrationProcess('arg1', 'calTree1', 'vfatBoard1', True) == 'Single link scan performed'\", \"assert performCalibrationProcess('arg2', 'calTree2', 'vfatBoard2', False) == 'All links scan performed'\", \"assert performCalibrationProcess('arg3', 'calT...
{ "split": "train", "index": 66982, "acecode_id": "oss_26258", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that builds a Convolutional Box Predictor based on specified parameters. The function should take the following parameters: is_training (boolean), num_classes (integer), min_depth (integer), max_depth (integer), num_layers_before_predicto...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert build_convolutional_box_predictor(True, 3, 5, 10, 2, True, 0.5, 3, 4, True, True, 0.1, False, (0, 1)) == {'is_training': True, 'num_classes': 3, 'box_prediction_head': {'box_code_size': 4, 'kernel_size': 3, 'use_depthwise': False, 'box_encodings_clip_range':...
{ "split": "train", "index": 66983, "acecode_id": "bigcode_python_fns_26683", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a list of tuples where each tuple contains two integers: the first integer represents the product ID and the second integer represents the quantity sold. Your task is to create a function that calculates the total sales for each product by multiplying the product ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_total_sales([(1, 10), (2, 5), (3, 8)]) == {1: 10, 2: 10, 3: 24}\", \"assert calculate_total_sales([(0, 10), (2, 0), (3, 8)]) == {0: 0, 2: 0, 3: 24}\", \"assert calculate_total_sales([(4, 2), (5, 3), (6, 1)]) == {4: 8, 5: 15, 6: 6}\", \"assert calcu...
{ "split": "train", "index": 66984, "acecode_id": "oss_11184", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that validates a list of templates and uploads them to an S3-like storage if they are valid. Each template has a `validate()` method that returns a boolean indicating whether the template is valid. You need to implement a single function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_and_upload_templates([Template(valid=True), Template(valid=True)], 'us-west-1') == None\", \"assert validate_and_upload_templates([Template(valid=True), Template(valid=False)], 'us-west-1') == None\", \"assert validate_and_upload_templates([Template...
{ "split": "train", "index": 66985, "acecode_id": "bigcode_python_fns_9812", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a file name in a file management application. The function, `process_file`, should take a string parameter `file_name`. If the `file_name` is empty (i.e., an empty string), the function should raise a ValueError with th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_file('document.txt') == 'Processing file: document.txt'\", \"assert process_file('image.png') == 'Processing file: image.png'\", \"assert process_file('audio.mp3') == 'Processing file: audio.mp3'\", \"assert process_file('video.mp4') == 'Processing f...
{ "split": "train", "index": 66986, "acecode_id": "oss_21961", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a circle represented as (radius, x_center, y_center) and a triangle represented as (x1, y1, x2, y2, x3, y3), where (x1, y1), (x2, y2), and (x3, y3) are the coordinates of the three vertices of the triangle. Return True if the circle and triangle overlap, otherwise return ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert circleAndTriangleOverlapping(1, 0, 0, -1, 0, 0, 1, 1, 0) == True\", \"assert circleAndTriangleOverlapping(1, 1, 1, -3, -3, 3, 3, 0, 0) == True\", \"assert circleAndTriangleOverlapping(1, 1, 1, 1, -3, 2, -1, 3, -2) == False\", \"assert circleAndTriangleOverla...
{ "split": "train", "index": 66987, "acecode_id": "evol_21891", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to determine the access level of a user based on their permissions. The function `access_level` takes in two parameters: `permissions`, a list of strings representing the user's permissions, and an optional integer `controller_id`. Th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert access_level(['execute']) == 'full'\", \"assert access_level(['write']) == 'partial'\", \"assert access_level(['read']) == 'limited'\", \"assert access_level([]) == 'no access'\", \"assert access_level(['read', 'write']) == 'partial'\", \"assert access_level...
{ "split": "train", "index": 66988, "acecode_id": "oss_23723", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are working on a natural language processing project and need to process evaluation metrics for machine translation models provided as strings. Each input string contains evaluation results in the following format: 'RESULT: baseline: BLEU: AVG: <value>' or 'RESULT: baseline...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_evaluation_scores(['RESULT: baseline: BLEU: AVG: 0.75', 'RESULT: baseline: METEOR: AVG: 0.68']) == {'BLEU': 0.75, 'METEOR': 0.68}\", \"assert extract_evaluation_scores(['RESULT: baseline: BLEU: AVG: 0.50']) == {'BLEU': 0.50}\", \"assert extract_evalu...
{ "split": "train", "index": 66989, "acecode_id": "oss_8658", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of email addresses, write a function that returns a list containing only the valid email addresses. An email address is considered valid if it contains exactly one '@' symbol and at least one '.' symbol following the '@' symbol. The function should ignore any inval...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_valid_emails(['test@example.com', 'invalid_email', 'user@domain', 'name@domain.com']) == ['test@example.com', 'name@domain.com']\", \"assert filter_valid_emails(['abc@xyz.com', 'test@domain.org', 'example@site']) == ['abc@xyz.com', 'test@domain.org']\...
{ "split": "train", "index": 66990, "acecode_id": "bigcode_python_fns_30836", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Devise a function that sorts a series of unique integers in a list, adhering to the given restrictions: You can perform the following operations: 1. Repeatedly reverse the order of any portion of the list. 2. Eliminate either one or two elements from the series. 3. Exchange any...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert advanced_sort([1, 2, 3, 5, 4]) == [1, 2, 3, 4, 5]\", \"assert advanced_sort([5, 4, 3, 1, 2]) == [5, 4, 3, 1, 2]\", \"assert advanced_sort([1, 3, 2]) in [[1, 2, 3], [1, 3]]\", \"assert advanced_sort([2, 1]) == [1, 2]\", \"assert advanced_sort([2]) == [2]\", \...
{ "split": "train", "index": 66991, "acecode_id": "evol_22045", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Write a function `generate_unique_id` that generates a unique identifier based on the current time in milliseconds. The function should return a string that represents a unique ID. The ID should be in the format `ID_<timestamp>`, where `<timestamp>` is the current time in milli...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_unique_id().startswith('ID_')\", \"assert len(generate_unique_id()) > 3\", \"assert generate_unique_id().count('_') == 1\", \"assert generate_unique_id().split('_')[0] == 'ID'\", \"assert isinstance(generate_unique_id(), str)\", \"assert len(generat...
{ "split": "train", "index": 66992, "acecode_id": "evol_16091", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that verifies if a given command string is valid based on a predefined list of allowed commands. Your function should take two parameters: a string `cmd` representing the command to be verified, and a list of strings `allowed_cmds` re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_command('start', ['start', 'stop', 'restart']) == True\", \"assert is_valid_command('stop', ['start', 'stop', 'restart']) == True\", \"assert is_valid_command('restart', ['start', 'stop', 'restart']) == True\", \"assert is_valid_command('pause', ['s...
{ "split": "train", "index": 66993, "acecode_id": "bigcode_python_fns_12075", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a mock function that simulates the successful encoding of a video job in a cloud-based video transcoding service. Your function should take no parameters and return a dictionary that contains the job ID and its status. The job ID should be a string ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert mock_successful_encode_job()['Status'] == 'Complete'\", \"assert isinstance(mock_successful_encode_job()['Id'], str)\", \"assert all(c.isalnum() for c in mock_successful_encode_job()['Id'][15:])\", \"assert mock_successful_encode_job()['Id'].count('-') == 1\...
{ "split": "train", "index": 66994, "acecode_id": "bigcode_python_fns_30652", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a 2D list (matrix) where each element represents a label corresponding to different regions in an image. Your task is to compute the relative size of each label in the image as a percentage of the total number of pixels. The output should be a list of floats where...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_label_percentages([[1, 1, 2], [2, 3, 3]]) == [0.0, 0.3333, 0.3333, 0.3333]\", \"assert compute_label_percentages([[0, 0], [0, 0]]) == [1.0]\", \"assert compute_label_percentages([[1, 2], [1, 2]]) == [0.0, 0.5, 0.5]\", \"assert compute_label_percentag...
{ "split": "train", "index": 66995, "acecode_id": "bigcode_python_fns_15492", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Implement a function that performs a binary search on a circularly sorted array to find the index of a given target number. The array may have been rotated at an unknown pivot, resulting in two sorted subarrays. If the target number is found, return its index; otherwise, return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert circular_binary_search([4, 5, 6, 7, 0, 1, 2], 0) == 4\", \"assert circular_binary_search([1, 3], 3) == 1\", \"assert circular_binary_search([2, 3, 4, 5, 1], 1) == 4\", \"assert circular_binary_search([8, 9, 1, 2, 3, 4, 5, 6, 7], 5) == 6\", \"assert circular_...
{ "split": "train", "index": 66996, "acecode_id": "evol_33849", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simple bank account. The function should accept three parameters: an initial balance, a minimum balance, and a list of transactions (where each transaction is either a deposit or a withdrawal). The function should ret...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_bank_account(1000, 500, [500, -2000]) == 'Warning: Account balance is below the minimum required.'\", \"assert simulate_bank_account(1000, 500, [500, -1000]) == 500\", \"assert simulate_bank_account(1000, 500, [-200]) == 800\", \"assert simulate_ban...
{ "split": "train", "index": 66997, "acecode_id": "oss_6337", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that determines whether a given session restore operation is classified as 'cold' or 'warm' based on a boolean input. A 'cold' session restore occurs when the input is True, while a 'warm' session restore occurs when the input is False. I...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_cold_session(True) == 'cold'\", \"assert is_cold_session(False) == 'warm'\", \"assert is_cold_session(True) == 'cold'\", \"assert is_cold_session(False) == 'warm'\", \"assert is_cold_session(True) == 'cold'\", \"assert is_cold_session(False) == 'warm'\", ...
{ "split": "train", "index": 66998, "acecode_id": "oss_10809", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a non-negative integer, implement a function that determines whether the most frequently occurring digit in that integer is odd or even. If there are multiple most frequently occurring digits, consider the smallest digit among them. The function should return 'Odd' if the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert odd_or_even(111223344) == 'Odd'\", \"assert odd_or_even(9876543210) == 'Even'\", \"assert odd_or_even(7777) == 'Odd'\", \"assert odd_or_even(22222) == 'Even'\", \"assert odd_or_even(12345) == 'Odd'\", \"assert odd_or_even(44445555) == 'Even'\", \"assert odd_...
{ "split": "train", "index": 66999, "acecode_id": "evol_29875", "num_tests": 16 }