data_source
large_stringclasses
1 value
prompt
listlengths
1
1
ability
large_stringclasses
1 value
reward_model
dict
extra_info
dict
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes an array of zeros and ones representing spikes. The function should remove adjacent spikes that are represented by consecutive ones, leaving only a single one at each location where multiple spikes occur consecutively. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_adjacent_spikes([1, 1, 1, 1]) == [1]\", \"assert remove_adjacent_spikes([1, 0, 1, 0, 1]) == [1, 0, 1, 0, 1]\", \"assert remove_adjacent_spikes([0, 1, 0, 1, 0]) == [0, 1, 0, 1, 0]\", \"assert remove_adjacent_spikes([1, 1, 0, 1]) == [1, 0, 1]\", \"asser...
{ "split": "train", "index": 71800, "acecode_id": "oss_11394", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two boolean expressions represented as strings, implement a function that evaluates the logical operation based on the given operator. The operator can either be 'AND' or 'OR'. The two expressions are provided as inputs, and your task is to evaluate the result of the oper...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert evaluate_expression('True', 'True', 'AND') == True\", \"assert evaluate_expression('True', 'False', 'AND') == False\", \"assert evaluate_expression('False', 'True', 'AND') == False\", \"assert evaluate_expression('False', 'False', 'AND') == False\", \"assert...
{ "split": "train", "index": 71801, "acecode_id": "bigcode_python_fns_8489", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of dictionaries, each representing a query result, and returns a list of titles from those dictionaries. Each dictionary will have a key 'title' that contains a string representing the title of the entry. Your function s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_titles([]) == []\", \"assert extract_titles([{ 'title': 'Title1' }]) == ['Title1']\", \"assert extract_titles([{ 'title': 'Title1' }, { 'title': 'Title2' }]) == ['Title1', 'Title2']\", \"assert extract_titles([{ 'title': 'SingleTitle' }]) == ['Single...
{ "split": "train", "index": 71802, "acecode_id": "bigcode_python_fns_30116", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that validates a given email address using regex. The email should have a top-level domain from a specific set, which includes .com, .net, and .edu. Additionally, ensure that the email does not contain consecutive special characters such as '.', '-', or '_'. Th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_email('test.email@example.com') == True\", \"assert validate_email('valid_email@example.net') == True\", \"assert validate_email('user-name@domain.edu') == True\", \"assert validate_email('user.name@domain.com') == True\", \"assert validate_email('u...
{ "split": "train", "index": 71803, "acecode_id": "evol_12271", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given the bit rate of an audio file in bits per second and the length of the audio in seconds, implement a function `compute_audio_quality(bit_rate: int, audio_length: int) -> int` that calculates the total amount of data (in bits) that represents the audio quality. The audio q...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_audio_quality(320000, 60) == 19200000\", \"assert compute_audio_quality(128000, 60) == 7680000\", \"assert compute_audio_quality(256000, 120) == 30720000\", \"assert compute_audio_quality(64000, 30) == 1920000\", \"assert compute_audio_quality(192000...
{ "split": "train", "index": 71804, "acecode_id": "evol_24447", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that counts the number of elements in a list. Your function should take a list of integers as input and return the count of integers present in the list. Implement the function `count_elements` that takes a list of integers and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_elements([1, 2, 3, 4]) == 4\", \"assert count_elements([10, 20, 30]) == 3\", \"assert count_elements([]) == 0\", \"assert count_elements([5]) == 1\", \"assert count_elements([1, 1, 1, 1, 1]) == 5\", \"assert count_elements([-1, -2, -3]) == 3\", \"asser...
{ "split": "train", "index": 71805, "acecode_id": "oss_15716", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python class that represents a configuration for a workflow application. Implement a class named `WorkflowConfig` that has two string attributes: `name` and `label`. The `name` attribute should be set to `'workflow'` and the `label` attribute shou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert WorkflowConfig().name == 'workflow'\", \"assert WorkflowConfig().label == 'workflow'\", \"assert isinstance(WorkflowConfig().name, str)\", \"assert isinstance(WorkflowConfig().label, str)\", \"assert WorkflowConfig().name != ''\", \"assert WorkflowConfig().l...
{ "split": "train", "index": 71806, "acecode_id": "oss_5750", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a non-negative integer representing a Unix timestamp, implement a function `timestamp_to_datetime` that converts this timestamp to a UTC datetime object. The Unix timestamp represents the number of seconds that have elapsed since 00:00:00 Coordinated Universal Time (UTC),...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert timestamp_to_datetime(0) == datetime.datetime(1970, 1, 1, 0, 0)\", \"assert timestamp_to_datetime(1672531199) == datetime.datetime(2022, 12, 31, 23, 59, 59)\", \"assert timestamp_to_datetime(315532800) == datetime.datetime(1980, 1, 1, 0, 0)\", \"assert times...
{ "split": "train", "index": 71807, "acecode_id": "oss_19375", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Write a function `sum_numbers(num1: int, num2: int) -> int` that takes two integers as input and returns their sum. The function should not prompt for user input but instead rely on the parameters passed to it to perform the calculation.\nPlease reason step by step, then write ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_numbers(10, 20) == 30\", \"assert sum_numbers(-5, 5) == 0\", \"assert sum_numbers(0, 0) == 0\", \"assert sum_numbers(1, 1) == 2\", \"assert sum_numbers(100, 200) == 300\", \"assert sum_numbers(-10, -20) == -30\", \"assert sum_numbers(50, 50) == 100\", \"...
{ "split": "train", "index": 71808, "acecode_id": "evol_35909", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of tuples, where each tuple contains two integers representing scores of agents who passed and who didn't pass a test in several experiments. Your task is to write a function that calculates the average score of agents for both groups (passed and failed) fo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average_scores([([85, 90, 78], [60, 55]), ([70, 75], [30, 35, 40])]) == [{'passed_avg': 84.33, 'failed_avg': 57.5}, {'passed_avg': 72.5, 'failed_avg': 35.0}]\", \"assert calculate_average_scores([([], []), ([100, 90], [])]) == [{'passed_avg': None,...
{ "split": "train", "index": 71809, "acecode_id": "bigcode_python_fns_31490", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a program that extracts specific information from a GitHub repository URL. The URL follows the format `<username>/<reponame><gh_stars>`, where `<username>` is the owner of the repository, `<reponame>` is the name of the repository, and `<gh_stars>` ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parseGitHubURL('rafaelbarretomg/Uninter0') == ('Uninter', 0)\", \"assert parseGitHubURL('johnsmith/MyRepo123') == ('MyRepo', 123)\", \"assert parseGitHubURL('alice/MyProject45') == ('MyProject', 45)\", \"assert parseGitHubURL('devteam/CodeBase999') == ('Code...
{ "split": "train", "index": 71810, "acecode_id": "oss_12854", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of task IDs and a project ID. Your task is to format each task ID into a string representation. If the project ID is present, each task ID should be formatted as '[#task_id](url)', where 'url' is constructed using the project ID and the task ID. If the proj...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_task_numbers_with_links([], 102) == ''\", \"assert format_task_numbers_with_links([7], 103) == '[#7](url_103_7)'\", \"assert format_task_numbers_with_links([10], None) == '#10'\", \"assert format_task_numbers_with_links([20], 107) == '[#20](url_107_20...
{ "split": "train", "index": 71811, "acecode_id": "bigcode_python_fns_22364", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given a list of integers, return a new list that contains only the unique elements from the original list while maintaining their original order. The function should ignore any duplicates that appear after their first occurrence. Implement a function `unique_elements(lst: List[...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_elements([1, 2, 3, 1, 2, 3]) == [1, 2, 3]\", \"assert unique_elements([4, 5, 6, 4, 5, 6]) == [4, 5, 6]\", \"assert unique_elements([7, 8, 9, 7, 8, 9, 10]) == [7, 8, 9, 10]\", \"assert unique_elements([1, 1, 1, 1, 1]) == [1]\", \"assert unique_elements...
{ "split": "train", "index": 71812, "acecode_id": "bigcode_python_fns_17902", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `hello_world_operations()` that performs the following tasks: 1. Returns the phrase 'hello world'. 2. Reverses the words in the phrase. 3. Encrypts the phrase using a Caesar cipher with a shift of 3. 4. Decrypts the encrypted phrase back to 'hello world'. D...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert hello_world_operations() == {'original': 'hello world', 'reversed': 'world hello', 'encrypted': 'khoor zruog', 'decrypted': 'hello world'}\", \"assert hello_world_operations()['original'] == 'hello world'\", \"assert hello_world_operations()['reversed'] == '...
{ "split": "train", "index": 71813, "acecode_id": "evol_25177", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string containing the name of a C/C++ file. Your task is to implement a function that checks if the file has a valid C/C++ file extension (.c, .cpp, .h, .hpp). The function should return True if the file has a valid extension, and False otherwise. The input will...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_cpp_file('example.c') == True\", \"assert is_valid_cpp_file('example.cpp') == True\", \"assert is_valid_cpp_file('example.h') == True\", \"assert is_valid_cpp_file('example.hpp') == True\", \"assert is_valid_cpp_file('example.txt') == False\", \"ass...
{ "split": "train", "index": 71814, "acecode_id": "bigcode_python_fns_41342", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of integers and returns a tuple containing the sum of the integers and the maximum integer from the list. If the input list is empty, the function should return (0, None). Your task is to complete the function...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_integer_list([1, 2, 3]) == (6, 3)\", \"assert process_integer_list([-1, -2, -3]) == (-6, -1)\", \"assert process_integer_list([]) == (0, None)\", \"assert process_integer_list([10]) == (10, 10)\", \"assert process_integer_list([5, 3, 9, 1]) == (18, 9...
{ "split": "train", "index": 71815, "acecode_id": "oss_24480", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string consisting of various nested groups of round, square, and curly brackets, your task is to categorize these bracket groups into distinct string parts and return them as a list. Each unique group must be balanced (every opening brace has a corresponding closing bra...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert separate_paren_groups('( ) (( )) {[()]} (( )( ))') == ['()', '(())', '{[()]}', '(()())']\", \"assert separate_paren_groups('(( )) {} []') == ['(())', '{}', '[]']\", \"assert separate_paren_groups('{[()]}') == ['{[()]}']\", \"assert separate_paren_groups('(((...
{ "split": "train", "index": 71816, "acecode_id": "evol_4663", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked to implement a function `timeout_check(time: int) -> str` that checks if the given `time` (in seconds) is a valid timeout value. The function should return 'Valid timeout' if the `time` is non-negative, and 'Invalid timeout' if the `time` is negative. Note that a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert timeout_check(30) == 'Valid timeout'\", \"assert timeout_check(0) == 'Valid timeout'\", \"assert timeout_check(-1) == 'Invalid timeout'\", \"assert timeout_check(15) == 'Valid timeout'\", \"assert timeout_check(-10) == 'Invalid timeout'\", \"assert timeout_c...
{ "split": "train", "index": 71817, "acecode_id": "bigcode_python_fns_5818", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a program that processes a list of employee records and generates a summary report. Each employee record is represented as a dictionary containing the employee's name, department, and salary. The program should calculate the average salary for each ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_salary_summary([{'name': 'Alice', 'department': 'Engineering', 'salary': 60000}, {'name': 'Bob', 'department': 'Sales', 'salary': 50000}, {'name': 'Charlie', 'department': 'Engineering', 'salary': 75000}, {'name': 'David', 'department': 'Sales', 'sa...
{ "split": "train", "index": 71818, "acecode_id": "oss_3546", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple configuration manager for a software project. The manager should allow the definition of configuration options with default values and the ability to retrieve these defaults based on different epochs. An epoch represents a specific peri...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_configuration_value('option1', 10, 'epoch1', {'epoch1': 20, 'epoch2': 30}) == 20\", \"assert get_configuration_value('option1', 10, 'epoch2', {'epoch1': 20, 'epoch2': 30}) == 30\", \"assert get_configuration_value('option1', 10, None, {'epoch1': 20, 'epo...
{ "split": "train", "index": 71819, "acecode_id": "oss_32379", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `extract_hyperlinks(html_content: str) -> List[str]` that takes a string representing the HTML content of a web page and extracts all the hyperlinks (i.e., the values of the href attributes of anchor tags) from it. The function should filter out any links t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_hyperlinks('<a href=\\\"https://www.example.com\\\">Example</a>') == ['https://www.example.com']\", \"assert extract_hyperlinks('<a href=\\\"https://www.example.com\\\">Example</a><a href=\\\"javascript:void(0)\\\">JS Link</a>') == ['https://www.exam...
{ "split": "train", "index": 71820, "acecode_id": "evol_2627", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers named `nums`, write a function that returns an array where each element at index `i` is the count of numbers in `nums` that are strictly less than `nums[i]`. Note that you must not include the element `nums[i]` itself in the count. For example, if `nu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert solve([8,1,2,2,3]) == [4,0,1,1,3]\", \"assert solve([6,5,4,8]) == [2,1,0,3]\", \"assert solve([7,7,7,7]) == [0,0,0,0]\", \"assert solve([1,2,3,4,5]) == [0,1,2,3,4]\", \"assert solve([5,4,3,2,1]) == [4,3,2,1,0]\", \"assert solve([10,9,8,7,6]) == [4,3,2,1,0]\"...
{ "split": "train", "index": 71821, "acecode_id": "evol_26367", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Write a function `calculate_factorial(n: int) -> int` that calculates the factorial of a given non-negative integer n. The function should raise a `TypeError` if the input is not an integer, and a `ValueError` if the input is a negative integer. If the input is valid, return th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_factorial(0) == 1\", \"assert calculate_factorial(1) == 1\", \"assert calculate_factorial(2) == 2\", \"assert calculate_factorial(3) == 6\", \"assert calculate_factorial(4) == 24\", \"assert calculate_factorial(5) == 120\", \"assert calculate_facto...
{ "split": "train", "index": 71822, "acecode_id": "evol_20759", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that computes the symmetric difference of two given lists of integers. The symmetric difference consists of the elements that are present in either of the lists but not in both. You should implement a function named `symmetric_difference` that takes two lists o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert symmetric_difference([1, 2, 3, 4], [3, 4, 5, 6, 7]) == [1, 2, 5, 6, 7]\", \"assert symmetric_difference([1, 2, 2, 3], [2, 3, 4]) == [1, 4]\", \"assert symmetric_difference([5, 6, 7], [7, 8, 9]) == [5, 6, 8, 9]\", \"assert symmetric_difference([], [1, 2]) == ...
{ "split": "train", "index": 71823, "acecode_id": "evol_9262", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing a document with multiple lines of text. Your task is to implement a function that retrieves the two words preceding the cursor's position in the document. The cursor's position is represented as a tuple (line_index, column_index), where line_...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert preceding_words('SingleWord\\\\nAnotherLine', (1, 6)) == None\", \"assert preceding_words('Test\\\\nCase\\\\nExample', (2, 0)) == None\", \"assert preceding_words('Just one line', (0, 1)) == None\", \"assert preceding_words('Hello\\\\nWorld', (0, 0)) == None...
{ "split": "train", "index": 71824, "acecode_id": "bigcode_python_fns_17965", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a rendered template from a provided dictionary of variables. Implement the function `render_template(template: str, variables: Dict[str, Any]) -> str`, where `template` is a string containing placeholders for variables in t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert render_template('Hello, {name}!', {'name': 'Alice'}) == 'Hello, Alice!'\", \"assert render_template('Your score is {score}.', {'score': 100}) == 'Your score is 100.'\", \"assert render_template('{greeting}, {name}!', {'greeting': 'Hi', 'name': 'Bob'}) == 'Hi...
{ "split": "train", "index": 71825, "acecode_id": "bigcode_python_fns_33132", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string, implement a function that returns a set of characters that appear more than once in the string. Do not use Python's built-in list or count functions. Instead, utilize a dictionary to keep track of character occurrences. The function should have the following sig...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert duplicate_characters('hello') == {'l'}\", \"assert duplicate_characters('abcdef') == set()\", \"assert duplicate_characters('aabbcc') == {'a', 'b', 'c'}\", \"assert duplicate_characters('') == set()\", \"assert duplicate_characters('123123') == {'1', '2', '3...
{ "split": "train", "index": 71826, "acecode_id": "evol_25100", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a list of compliance items, each represented as a dictionary with keys including 'ComplianceType', 'ResourceType', 'ResourceId', 'Id', 'Title', 'Status', 'Severity', and 'ExecutionSummary', write a function that takes a list of these compliance items and returns a list of...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_non_compliant_titles([{'ComplianceType': 'Patch', 'ResourceType': 'ManagedInstance', 'ResourceId': 'i-1234567890abcdef0', 'Id': 'KB4010320', 'Title': 'Security Update for Active Directory Federation Services', 'Status': 'NON_COMPLIANT', 'Severity': 'CRIT...
{ "split": "train", "index": 71827, "acecode_id": "bigcode_python_fns_41977", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that generates a valid instance of a custom data structure representing a person's profile. The function should take a dictionary definition of the profile schema and return a valid instance of that profile, ensuring that all requi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_valid_profile({'name': {'type': 'string', 'required': True}, 'age': {'type': 'integer', 'required': True}}) == {'name': 'Sample name', 'age': 1}\", \"assert create_valid_profile({'name': {'type': 'string', 'required': True}, 'age': {'type': 'integer',...
{ "split": "train", "index": 71828, "acecode_id": "oss_26905", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function `are_words_palindrome(word1: str, word2: str) -> bool` that checks if two words are palindromes of each other. Two words are considered palindromes of each other if they have the same length and the letters of one word can be spelled by reversing the letter...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert are_words_palindrome('diaper', 'repaid') == True\", \"assert are_words_palindrome('abc', 'cba') == True\", \"assert are_words_palindrome('hello', 'olleh') == True\", \"assert are_words_palindrome('world', 'dlrow') == True\", \"assert are_words_palindrome('ap...
{ "split": "train", "index": 71829, "acecode_id": "evol_210", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a simple banking system. The function should take a list of operations, where each operation is a tuple containing an operation type and its parameters. The operations include: creating a new account, depositing funds, with...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert banking_system([('create_account', 'Alice'), ('create_account', 'Bob'), ('deposit_funds', 1, 100)]) == [1, 2, 100]\", \"assert banking_system([('create_account', 'Charlie'), ('deposit_funds', 1, 50), ('withdraw_funds', 1, 30)]) == [1, 50, 20]\", \"assert ban...
{ "split": "train", "index": 71830, "acecode_id": "oss_28478", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the management of subprocesses by storing their process identifiers (PIDs) and ensuring they can be terminated as needed. Write a function `manage_subprocesses(commands: List[str], num_processes: int) -> List[int]` that ful...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_subprocesses(['echo Hello'], 3) == [1, 2, 3]\", \"assert manage_subprocesses(['sleep 1'], 5) == [1, 2, 3, 4, 5]\", \"assert manage_subprocesses(['ls'], 0) == []\", \"assert manage_subprocesses(['cat file.txt'], 1) == [1]\", \"assert manage_subprocesse...
{ "split": "train", "index": 71831, "acecode_id": "oss_12998", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers representing the lengths of line segments, write a function that determines whether it is possible to form a closed polygon with those segments. A polygon is closed if the sum of the lengths of the (n-1) segments is greater than the length of the remain...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_form_polygon([3, 4, 5]) == True\", \"assert can_form_polygon([1, 1, 2]) == False\", \"assert can_form_polygon([2, 3, 4, 5]) == True\", \"assert can_form_polygon([1, 2, 3, 10]) == False\", \"assert can_form_polygon([5, 5, 5, 5]) == True\", \"assert can_fo...
{ "split": "train", "index": 71832, "acecode_id": "bigcode_python_fns_27128", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `customized_median(l: list, cmp_func: callable) -> float` that returns the median of the elements in the list `l` without using sorting techniques or built-in functions. The function should handle tuples with both odd and even counts of elements, manage dup...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert customized_median([1, 2, 3, 200, 300, 400, 500], lambda a, b: a - b) == 200\", \"assert customized_median([4, 2, 5, 1, 3], lambda a, b: a - b) == 3\", \"assert customized_median([8, 3, 7, 5, 6], lambda a, b: a - b) == 6\", \"assert customized_median([1, 1, 1...
{ "split": "train", "index": 71833, "acecode_id": "evol_5151", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `classify_number(num)` that takes an integer `num` as input and returns a string indicating whether the number is 'Even Prime', 'Even Not Prime', 'Odd Prime', or 'Odd Not Prime'. A number is classified as 'Even' if it is divisible by 2, and 'Odd' if it is n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert classify_number(0) == 'Even Not Prime'\", \"assert classify_number(1) == 'Odd Not Prime'\", \"assert classify_number(2) == 'Even Prime'\", \"assert classify_number(3) == 'Odd Prime'\", \"assert classify_number(4) == 'Even Not Prime'\", \"assert classify_numb...
{ "split": "train", "index": 71834, "acecode_id": "evol_26732", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of boxes, each represented by an index. Each box has a status indicating whether it is open (1) or closed (0). When you open a box, it can contain candies and may also provide keys to open other boxes. Your task is to implement a function `maxCandies(status...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert maxCandies([1, 1, 0], [1, 2, 3], [[1], []], [[1], []], [0]) == 3\", \"assert maxCandies([1, 1, 1], [0, 0, 0], [[], [], []], [[1, 2], [], []], [0]) == 0\", \"assert maxCandies([0, 1, 0], [1, 2, 3], [[2], []], [[1], []], [1]) == 2\", \"assert maxCandies([1, 1,...
{ "split": "train", "index": 71835, "acecode_id": "evol_1422", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that parses a given list of command-line arguments and returns a dictionary with specific keys and their corresponding values. The function should handle the following arguments:\n\n1. A required argument '-d' or '--date' which specifies ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_args(['-d', '2023-10-01', '-fr', 'JFK', '-t', 'LAX']) == {'date': '2023-10-01', 'origin': 'JFK', 'destination': 'LAX', 'days_in_destination': 'oneway', 'bags': '0', 'verbose': False, 'sort': 'price'}\", \"assert parse_args(['-d', '2023-10-01', '-fr', '...
{ "split": "train", "index": 71836, "acecode_id": "bigcode_python_fns_31406", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks whether a user is logged in based on their session data. The function should take a dictionary `session` as input, which contains two keys: 'username' and 'token'. If the user is logged in (i.e., both keys exist in the diction...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_login({'username': 'user1', 'token': 'abc123'}) == {'name': 'user1', 'token': 'abc123'}\", \"assert check_login({'username': 'user2'}) == 'Log in to see this page'\", \"assert check_login({'token': 'xyz456'}) == 'Log in to see this page'\", \"assert ch...
{ "split": "train", "index": 71837, "acecode_id": "bigcode_python_fns_39019", "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 takes this list as input and returns a new list containing only the ages of people who are considered adults (i.e., ages 18 and above). The output list should ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_adults([15, 20, 17, 18, 30]) == [20, 18, 30]\", \"assert filter_adults([12, 14, 16]) == []\", \"assert filter_adults([18, 21, 25, 30]) == [18, 21, 25, 30]\", \"assert filter_adults([10, 11, 12, 13, 14]) == []\", \"assert filter_adults([22, 19, 15, 16,...
{ "split": "train", "index": 71838, "acecode_id": "bigcode_python_fns_6013", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that determines the largest number among three given integers. Your function should take three integer inputs as parameters and return a string indicating which number is the greatest in the format 'number X is greatest', where X i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_largest(5, 10, 3) == 'number 2 is greatest'\", \"assert find_largest(-1, -5, -3) == 'number 1 is greatest'\", \"assert find_largest(0, 0, 0) == 'number 1 is greatest'\", \"assert find_largest(1, 1, 2) == 'number 3 is greatest'\", \"assert find_largest(1...
{ "split": "train", "index": 71839, "acecode_id": "oss_36538", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a string as input and returns the string with its characters arranged in a reversed order. The function should utilize a more complex computational process to achieve this reversal. The input string may contain alphanumeric characters and spaces....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_string('hello') == 'olleh'\", \"assert reverse_string('world') == 'dlrow'\", \"assert reverse_string('python') == 'nohtyp'\", \"assert reverse_string('programming') == 'gnimmargorp'\", \"assert reverse_string('!@#123') == '321#@!'\", \"assert reverse...
{ "split": "train", "index": 71840, "acecode_id": "evol_24035", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a package management system's basic operations. Your function should be named `manage_packages` and take a list of operations as input. Each operation will be represented as a tuple, where the first element is a string that...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_packages([('remove', 'pkgC'), ('remove', 'pkgD')]) == []\", \"assert manage_packages([('add', 'pkg1'), ('add', 'pkg2'), ('remove', 'pkg1'), ('remove', 'pkg2'), ('add', 'pkg1')]) == ['pkg1']\", \"assert manage_packages([('add', 'pkgA'), ('add', 'pkgB')...
{ "split": "train", "index": 71841, "acecode_id": "oss_11491", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function `login_user(username: str, password: str) -> str` that simulates user login functionality. The function should take a username and a password as inputs. If the username is 'admin' and the password is 'secret', return 'logged in'. If the username is 'admin' ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert login_user('admin', 'secret') == 'logged in'\", \"assert login_user('admin', 'wrong_password') == 'Wrong password.'\", \"assert login_user('user123', 'secret') == 'Username not found.'\", \"assert login_user('', 'secret') == 'Username not found.'\", \"assert...
{ "split": "train", "index": 71842, "acecode_id": "evol_23937", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function to minimize a Deterministic Finite Automaton (DFA). The DFA is represented by its states, an alphabet, a transition function, a start state, and a set of accept states. The function should return a minimized version of the DFA. The minimization process invo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert dfa_minimize(['A', 'B'], ['0'], {'A': {'0': 'B'}, 'B': {'0': 'B'}}, 'A', ['B']) == (['A', 'B'], ['0'], {'A': {'0': 'B'}, 'B': {'0': 'B'}}, 'A', ['B'])\", \"assert dfa_minimize(['A', 'B', 'C'], ['0', '1'], {'A': {'0': 'B', '1': 'C'}, 'B': {'0': 'C', '1': 'A'}...
{ "split": "train", "index": 71843, "acecode_id": "evol_16514", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are working on a soccer analytics project and need to convert player position indices into abbreviated player positions. The formation dictionary maps position indices to their respective abbreviated forms. Write a function `add_abbreviated_position(players, formation_dict)...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_abbreviated_position([1, 4, 6, 11], {1: 'GK', 2: 'RB', 3: 'RCB', 4: 'CB', 5: 'LCB', 6: 'LB', 7: 'RWB', 8: 'CDM', 9: 'CM', 10: 'CAM', 11: 'LW', 12: 'RW', 13: 'CF', 14: 'ST'}) == ['GK', 'CB', 'LB', 'LW']\", \"assert add_abbreviated_position([2, 5, 7, 13], ...
{ "split": "train", "index": 71844, "acecode_id": "oss_33445", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that manages user information for a version control platform. The function should take the following parameters: gitee_id (int), gitee_login (str), gitee_name (str), phone (str), avatar_url (str), cla_email (str), and roles (list of s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_user_info(1, 'user1', 'User One', '1234567890', 'http://avatar.url', 'user1@example.com', ['admin', 'contributor']) == {'gitee_id': 1, 'gitee_login': 'user1', 'gitee_name': 'User One', 'phone': '1234567890', 'avatar_url': 'http://avatar.url', 'cla_ema...
{ "split": "train", "index": 71845, "acecode_id": "oss_23463", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a nested dictionary where each key is a string and its value can either be another dictionary or a string. Your task is to implement a function that flattens this nested dictionary into a specific string format. The output string should contain the keys and their ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert flatten_dict({'a': 'apple', 'b': 'banana'}) == 'a|apple|b|banana|'\", \"assert flatten_dict({'g': None, 'h': {'i': 'iguana'}}) == 'h|i|iguana|'\", \"assert flatten_dict({'j': {'k': None, 'l': 'lion'}}) == 'j|l|lion|'\", \"assert flatten_dict({'m': 'mango', '...
{ "split": "train", "index": 71846, "acecode_id": "bigcode_python_fns_29038", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that converts a dictionary to a JSON-formatted string. The function should take one parameter: a dictionary 'data'. Your goal is to implement the function 'to_json_string(data)' which returns the JSON string representation of the input di...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert to_json_string({'name': 'John', 'age': 30, 'city': 'New York'}) == '{\\\"name\\\": \\\"John\\\", \\\"age\\\": 30, \\\"city\\\": \\\"New York\\\"}'\", \"assert to_json_string({'key': 'value'}) == '{\\\"key\\\": \\\"value\\\"}'\", \"assert to_json_string({}) =...
{ "split": "train", "index": 71847, "acecode_id": "oss_11834", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of floats, implement a function `add_element` that adds a new float element at a specified integer index without using any built-in functions. The function should return a new list with the element inserted at the given index. If the index is out of bounds, the ele...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_element([2.1, 5.2, 7.3], 10.4, 1) == [2.1, 10.4, 5.2, 7.3]\", \"assert add_element([2.1, 5.2, 7.3], 10.4, 0) == [10.4, 2.1, 5.2, 7.3]\", \"assert add_element([2.1, 5.2, 7.3], 10.4, 3) == [2.1, 5.2, 7.3, 10.4]\", \"assert add_element([], 5.0, 0) == [5.0]\...
{ "split": "train", "index": 71848, "acecode_id": "evol_11674", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two images represented as 2D lists of integers, where each integer represents a pixel value. The first image is a panchromatic image (pan_img) and the second image is a multispectral image (ms_img). Your task is to implement a function that performs a simple pansh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert pansharpen_images([[255]], [[100]]) == [[177]]\", \"assert pansharpen_images([[0, 0], [0, 0]], [[255, 255], [255, 255]]) == [[127, 127], [127, 127]]\", \"assert pansharpen_images([[100, 200]], [[150, 250]]) == [[125, 225]]\", \"assert pansharpen_images([[0]]...
{ "split": "train", "index": 71849, "acecode_id": "bigcode_python_fns_14689", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simplifies a given sentence by replacing specific accented characters and certain character combinations with their simpler alternatives as per the Estonian alphabet. The function should take a string `sentence` as input and return a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simplify_unicode('Vo\\u00d8dka') == 'Vo\\u00d6dka'\", \"assert simplify_unicode('T\\u00f6y\\u00df') == 'T\\u00f6yss'\", \"assert simplify_unicode('D\\u00deragon') == 'DThragon'\", \"assert simplify_unicode('L\\u00f6we') == 'L\\u00f6we'\", \"assert simplify_u...
{ "split": "train", "index": 71850, "acecode_id": "bigcode_python_fns_8961", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Implement a function that accepts a tuple of numerical values (t_1,...,t_{N+1}) as its argument and returns a tuple of length N, where the i-th element of the output tuple is the sum of t_i and t_{i+1}. The function should be capable of processing negative numbers and zeros. If...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_tuple((2, 3)) == (5,)\", \"assert sum_tuple((1, -1, 2)) == (0, 1)\", \"assert sum_tuple((5, 5, 5, 5)) == (10, 10, 10)\", \"assert sum_tuple((-1, -2, -3)) == (-3, -5)\", \"assert sum_tuple((0, 0, 0)) == (0, 0)\", \"assert sum_tuple((3.5, 2.5)) == (6.0,)\"...
{ "split": "train", "index": 71851, "acecode_id": "evol_1041", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple HTML-like tag generator in Python. Your goal is to create a function `generate_html(tag, content=None, **attributes)` that takes an HTML tag name, optional content, and optional attributes, and returns a string representation of the HTM...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_html('div', 'Content', id='main') == \\\"<div id='main'>Content</div>\\\"\", \"assert generate_html('a', 'Click here', href='https://example.com') == \\\"<a href='https://example.com'>Click here</a>\\\"\", \"assert generate_html('span', ['One', 'Two...
{ "split": "train", "index": 71852, "acecode_id": "oss_4850", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a datetime object, implement a function that determines whether the datetime is timezone-aware or not. A datetime is considered timezone-aware if its tzinfo attribute is not None, and its utcoffset() method returns a valid timedelta indicating the difference between the l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_aware(datetime(2023, 10, 1, 12, 0, 0, tzinfo=timezone.utc)) == True\", \"assert is_aware(datetime(2023, 10, 1, 12, 0, 0)) == False\", \"assert is_aware(datetime(2023, 10, 1, 12, 0, 0, tzinfo=timezone(timedelta(hours=5)))) == True\", \"assert is_aware(date...
{ "split": "train", "index": 71853, "acecode_id": "bigcode_python_fns_34681", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two lists of integers, `y_true` and `y_pred`, your task is to implement a function `correct_predicted(y_true, y_pred)` that returns a list of indices where the predicted labels match the true labels. Additionally, the function should return the accuracy rate as a float, w...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert correct_predicted([1, 0, 1], [1, 1, 0]) == ([0], 0.3333333333333333)\", \"assert correct_predicted([1, 2, 3, 4], [1, 2, 3, 4]) == ([0, 1, 2, 3], 1.0)\", \"assert correct_predicted([0, 0, 1], [1, 0, 1]) == ([1, 2], 0.6666666666666666)\", \"assert correct_pred...
{ "split": "train", "index": 71854, "acecode_id": "bigcode_python_fns_45720", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `find_fibonacci_numbers(input_list)` that takes a list of numeric values and returns a tuple containing two elements: a list of unique Fibonacci numbers from the input list (sorted in ascending order) and the sum of these Fibonacci numbers. You must ensure ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_fibonacci_numbers([0, 1, 2, 3, 4, 5]) == ([0, 1, 2, 3, 5], 11)\", \"assert find_fibonacci_numbers([8, 13, 21]) == ([8, 13, 21], 42)\", \"assert find_fibonacci_numbers([34, 55, 89]) == ([34, 55, 89], 178)\", \"assert find_fibonacci_numbers([1.0, 2.0, 3.0...
{ "split": "train", "index": 71855, "acecode_id": "evol_816", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that takes a list of sentences and a list of corresponding entities, and prepares training data for a named entity recognition (NER) model. The function should return a list of tuples, where each tuple contains a sentence and a dictionary ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert prepare_training_data(['I love Paris', 'New York is great'], ['Paris', 'New York']) == [('I love Paris', {'entities': ['Paris']}), ('New York is great', {'entities': ['New York']})]\", \"assert prepare_training_data(['The Eiffel Tower is in Paris', 'I live i...
{ "split": "train", "index": 71856, "acecode_id": "evol_35894", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that represents a mathematical set of terms. The function should support various operations on the set, such as adding terms, removing terms, and retrieving the quadruples of unique terms in the set. The function should be defined as ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert term_set_operations([1, 2, 3, 4], [('add', 5)]) == [(1, 2, 3, 4), (1, 2, 3, 5), (1, 2, 4, 5), (1, 3, 4, 5), (2, 3, 4, 5)]\", \"assert term_set_operations([1, 2], [('add', 3)]) == []\", \"assert term_set_operations([], [('add', 1), ('add', 2), ('add', 3), ('a...
{ "split": "train", "index": 71857, "acecode_id": "oss_27806", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a dictionary `frame_data` where each key is a string in the format 'player_id_position' (e.g., '1_forward', '2_midfield') and the values are dictionaries containing player attributes such as 'velocity' and 'inframe', implement a function `initialise_players(frame_data, pa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert initialise_players({'1_forward': {'velocity': 5, 'inframe': False}, '2_midfield': {'velocity': 3, 'inframe': False}}, {}) == []\", \"assert initialise_players({'1_forward': {'velocity': 5, 'inframe': False}}, {}) == []\", \"assert initialise_players({}, {}) ...
{ "split": "train", "index": 71858, "acecode_id": "bigcode_python_fns_32911", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a caching mechanism for a function that performs expensive computations. The cache should store the results of previous function calls to avoid redundant computations. However, the cache has limited space, and if it becomes full, the least recen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert lru_cache([('put', 1, 'a'), ('put', 2, 'b'), ('get', 1)], 2) == ['a']\", \"assert lru_cache([('put', 1, 'a'), ('put', 2, 'b'), ('get', 2)], 2) == ['b']\", \"assert lru_cache([('put', 1, 'a'), ('put', 2, 'b'), ('put', 3, 'c'), ('get', 3)], 2) == ['c']\", \"as...
{ "split": "train", "index": 71859, "acecode_id": "oss_23088", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a list of integers as input and returns a new list containing only the unique elements from the input list in the order they first appeared. Write a function `unique_elements(arr: List[int]) -> List[int]` that accomplishes ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_elements([1, 2, 3, 1, 2, 3]) == [1, 2, 3]\", \"assert unique_elements([4, 5, 4, 6, 5, 7]) == [4, 5, 6, 7]\", \"assert unique_elements([]) == []\", \"assert unique_elements([0, -1, 0, -1]) == [0, -1]\", \"assert unique_elements([1, 1, 1, 1]) == [1]\", ...
{ "split": "train", "index": 71860, "acecode_id": "bigcode_python_fns_43280", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes an array of integers and returns a new array containing only the prime numbers that are also part of the Fibonacci sequence. The function should handle non-integer inputs gracefully by ignoring them. The function should be defined as follows: def...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert prime_fibonacci([2, 11, 9, 5, 4, 7, 13, 15]) == [2, 5, 13]\", \"assert prime_fibonacci([1, 2, 3, 4, 5, 6, 7]) == [2, 3, 5]\", \"assert prime_fibonacci([8, 13, 21, 34]) == [13]\", \"assert prime_fibonacci([0, 1, 4, 6, 8]) == []\", \"assert prime_fibonacci([-1...
{ "split": "train", "index": 71861, "acecode_id": "evol_17510", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the overall precision for a document processing system based on tolerance levels and their associated precision values per line. You need to implement a function `calculate_overall_precision` that takes in a list of tuples where each tuple contai...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_overall_precision([(0, 0, 1.0), (0, 1, 2.0), (0, 2, 3.0)]) == {0: 6.0}\", \"assert calculate_overall_precision([(1, 0, 1.5), (2, 0, 2.5), (1, 1, 3.5), (2, 1, 4.5)]) == {1: 5.0, 2: 7.0}\", \"assert calculate_overall_precision([(0, 0, 0.0), (1, 0, 0....
{ "split": "train", "index": 71862, "acecode_id": "oss_4547", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a command-line argument parser for a data analysis tool. The function `process_command_line(argv)` should accept a list of command-line arguments and return a tuple containing a settings object and an arguments list. The command-line arguments shoul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_command_line(['counts.txt', 'output']) == (Namespace(counts_files='counts.txt', output_head='output', seglen=100, counts=5), [])\", \"assert process_command_line(['counts.txt', 'output', '--seglen', '50']) == (Namespace(counts_files='counts.txt', out...
{ "split": "train", "index": 71863, "acecode_id": "bigcode_python_fns_40552", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a command-line argument parser for a machine learning training script. The function should accept a list of strings representing command-line arguments, where one of the arguments can specify the batch size for training...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_batch_size(['--batch_size', '64', '--learning_rate', '0.001']) == 64\", \"assert parse_batch_size(['--batch_size', '128']) == 128\", \"assert parse_batch_size(['--learning_rate', '0.001']) == 32\", \"assert parse_batch_size(['--batch_size', '1']) == 1\...
{ "split": "train", "index": 71864, "acecode_id": "oss_6655", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of items. Your task is to implement a function that checks if all the items in the list are of the same type and returns the list if they are. If the list is empty, or if the items are of different types, the function should raise a ValueError or TypeError ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_items([1, 2, 3]) == [1, 2, 3]\", \"assert validate_items(['a', 'b', 'c']) == ['a', 'b', 'c']\", \"assert validate_items([1.0, 2.0, 3.0]) == [1.0, 2.0, 3.0]\", \"assert validate_items([[1], [2], [3]]) == [[1], [2], [3]]\", \"assert validate_items([Tr...
{ "split": "train", "index": 71865, "acecode_id": "bigcode_python_fns_12972", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of input tuples, where each tuple consists of various parameters necessary for a model to process. Your task is to implement a function `featurize(inputs: List[Tuple]) -> List[Tuple]` that simulates the featurization process by appending a fixed tuple `(0, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert featurize([(1, 2), (3.5, 4.5)]) == [(1, 2, 0, 1), (3.5, 4.5, 0, 1)]\", \"assert featurize([]) == []\", \"assert featurize([(1,), (2.0,)]) == [(1, 0, 1), (2.0, 0, 1)]\", \"assert featurize([(0, 0)]) == [(0, 0, 0, 1)]\", \"assert featurize([(1, 2, 3)]) == [(1,...
{ "split": "train", "index": 71866, "acecode_id": "bigcode_python_fns_7610", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of predictions and returns a list of formatted strings for each prediction. Each prediction is represented as a tuple containing the following elements: `name` (string): The name of the predicted item, `top` (...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_predictions([('apple', (10, 20, 30, 40), 5.2, 3)]) == ['Found apple at (40, 10), distance=5.2, count=3']\", \"assert process_predictions([('banana', (15, 25, 35, 45), 6.1, 2)]) == ['Found banana at (45, 15), distance=6.1, count=2']\", \"assert proces...
{ "split": "train", "index": 71867, "acecode_id": "oss_37073", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to validate passport data based on specific rules. The function will take a dictionary representing passport data as input and return True if the passport data is valid according to the specified criteria, and False otherwise. The pas...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_passport_data({'byr': '2002', 'iyr': '2013', 'eyr': '2023', 'hgt': '74in', 'hcl': '#ae17e1', 'ecl': 'brn', 'pid': '076753729'}) == True\", \"assert validate_passport_data({'byr': '2003', 'iyr': '2013', 'eyr': '2023', 'hgt': '74in', 'hcl': '#ae17e1',...
{ "split": "train", "index": 71868, "acecode_id": "oss_28950", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a dictionary representing the dimensions of an object, where the keys are dimension names (strings) and the values are their respective lengths (integers). Implement a function `squeeze_dimensions(dimensions: Dict[str, int], dimension: Optional[Union[str, List[str...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert squeeze_dimensions({'x': 1, 'y': 2, 'z': 1}) == {'y': 2}\", \"assert squeeze_dimensions({'a': 3}) == {'a': 3}\", \"assert squeeze_dimensions({'width': 1, 'height': 1}) == {}\", \"assert squeeze_dimensions({'length': 1, 'breadth': 1, 'height': 1}) == {}\", \"...
{ "split": "train", "index": 71869, "acecode_id": "bigcode_python_fns_30045", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of contacts, where each contact is represented as a tuple containing a name and an email address. Your function should return a dictionary where the keys are the contact names and the values are their corresponding email...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_contact_dict([('Alice', 'alice@example.com'), ('Bob', 'bob@example.com')]) == {'Alice': 'alice@example.com', 'Bob': 'bob@example.com'}\", \"assert create_contact_dict([('Alice', 'alice@example.com'), ('Alice', 'alice_new@example.com')]) == {'Alice': '...
{ "split": "train", "index": 71870, "acecode_id": "oss_4733", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that formats a warning message. The function should take four parameters: a message (string), a category (type), a filename (string), and a line number (integer). The function should return a formatted string that includes the filename, l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_warning('An example warning', UserWarning, 'example.py', 42) == 'example.py:42: UserWarning: An example warning\\\\n'\", \"assert format_warning('File not found', FileNotFoundError, 'main.py', 10) == 'main.py:10: FileNotFoundError: File not found\\\\n...
{ "split": "train", "index": 71871, "acecode_id": "bigcode_python_fns_31423", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that reverses each alphanumeric word in a string individually while maintaining their positions. Special characters and spaces should be ignored, and only alphanumeric words should be reversed. The function should return the modified string with the reversed wo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_alphanumeric_words_in_string('Hello World!') == 'olleH dlroW!'\", \"assert reverse_alphanumeric_words_in_string('Python3 is fun! 321') == '3nohtyP si nuf! 123'\", \"assert reverse_alphanumeric_words_in_string('abc def ghi') == 'cba fed ihg'\", \"asse...
{ "split": "train", "index": 71872, "acecode_id": "evol_7473", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes three integers as input and returns the product of these three integers.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block." } ]
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert product_of_three_numbers(2, 3, 4) == 24\", \"assert product_of_three_numbers(1, 1, 1) == 1\", \"assert product_of_three_numbers(0, 5, 10) == 0\", \"assert product_of_three_numbers(-2, 3, 4) == -24\", \"assert product_of_three_numbers(-1, -1, -1) == -1\", \"a...
{ "split": "train", "index": 71873, "acecode_id": "evol_8043", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the total cost of items in a shopping cart. The shopping cart can have multiple items, each defined by its name, price, and quantity. Given a list of items in the cart, where each item is represented as a tuple contain...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_cart_total([('Laptop', 1000, 2), ('Phone', 500, 3)]) == 3500.0\", \"assert calculate_cart_total([('Laptop', 1000, 1)]) == 1000.0\", \"assert calculate_cart_total([('Book', 20.99, 3)]) == 62.97\", \"assert calculate_cart_total([('Shoes', 60, 1), ('T...
{ "split": "train", "index": 71874, "acecode_id": "oss_18322", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of words and two integers, start and end, representing the indices of the list. Your task is to implement a function that returns the text formed by joining the words from the 'start' index up to, but not including, the 'end' index, separated by spaces. If ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_text_from_span(['hello', 'world', 'this', 'is', 'python'], 1, 4) == 'world this is'\", \"assert get_text_from_span(['apple', 'banana', 'cherry'], 0, 2) == 'apple banana'\", \"assert get_text_from_span(['a', 'b', 'c', 'd'], 2, 4) == 'c d'\", \"assert get_...
{ "split": "train", "index": 71875, "acecode_id": "bigcode_python_fns_16075", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `count_even_numbers(nums)` that returns the count of even numbers in the list. The function should take one parameter: `nums`, which is a list of integers. The count of even numbers should be returned as an integer. Note that negative ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_even_numbers([1, 2, 3, 4, 5]) == 2\", \"assert count_even_numbers([10, 15, 20, 25]) == 2\", \"assert count_even_numbers([0, 2, 4, 6, 8]) == 5\", \"assert count_even_numbers([-2, -4, -6]) == 3\", \"assert count_even_numbers([-1, -3, -5]) == 0\", \"asser...
{ "split": "train", "index": 71876, "acecode_id": "bigcode_python_fns_36638", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a function called `calculate_rectangle_area` that takes two parameters, `length` and `breadth`, representing the dimensions of a rectangle. The function should return the area of the rectangle. If either dimension is negative, the function should return -1 to indicate an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_rectangle_area(5, 10) == 50\", \"assert calculate_rectangle_area(0, 0) == 0\", \"assert calculate_rectangle_area(12, 5) == 60\", \"assert calculate_rectangle_area(-1, 5) == -1\", \"assert calculate_rectangle_area(5, -1) == -1\", \"assert calculate_...
{ "split": "train", "index": 71877, "acecode_id": "evol_25090", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of volumes and a target path, write a function that determines if it is possible to stage all the volumes to the same target path. A volume can be staged to the target path if it does not exceed the maximum allowed volume. The function should return 'Yes' if all vo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_stage_volumes([1, 2], '/target/path', 3) == 'Yes'\", \"assert can_stage_volumes([1, 1, 1], '/target/path', 2) == 'Yes'\", \"assert can_stage_volumes([1, 2, 2], '/target/path', 3) == 'Yes'\", \"assert can_stage_volumes([3, 3, 3], '/target/path', 2) == 'No...
{ "split": "train", "index": 71878, "acecode_id": "bigcode_python_fns_22227", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `shutdown_api` that simulates the shutdown of an API server. The function does not take any parameters and returns a string indicating that the server is shutting down. The return value should be the string 'Server shutting down...' w...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert shutdown_api() == 'Server shutting down...'\", \"assert shutdown_api() == 'Server shutting down...'\", \"assert shutdown_api() == 'Server shutting down...'\", \"assert shutdown_api() == 'Server shutting down...'\", \"assert shutdown_api() == 'Server shutting...
{ "split": "train", "index": 71879, "acecode_id": "bigcode_python_fns_9122", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the scores of a group of students. Your task is to implement a function that calculates the cumulative average score at specific intervals. The function should take the following parameters: a list of integers 'scores', an integer '...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cumulative_average_at_intervals([1, 2, 3, 4, 5], 10, 5) == []\", \"assert cumulative_average_at_intervals([], 1, 5) == []\", \"assert cumulative_average_at_intervals([0, 0, 0, 0], 2, 4) == [0.0, 0.0, 0.0, 0.0]\", \"assert cumulative_average_at_intervals([1, ...
{ "split": "train", "index": 71880, "acecode_id": "bigcode_python_fns_13022", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given a list of user credentials, where each credential is represented as a dictionary containing the fields 'username', 'password', and 'role'. Implement a function `can_login_after_restart(credentials: List[Dict[str, str]], username: str, password: str) -> bool` that ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_login_after_restart([{'username': 'user1', 'password': 'user1', 'role': 'admin'}, {'username': 'user2', 'password': 'user2', 'role': 'user'}], 'user1', 'user1') == True\", \"assert can_login_after_restart([{'username': 'user1', 'password': 'user1', 'role...
{ "split": "train", "index": 71881, "acecode_id": "bigcode_python_fns_47515", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `find_primes(n: int) -> List[int]` that returns a list of all prime numbers in the range from 2 to n (inclusive). A prime number is a natural number greater than 1 that is not a product of two smaller natural numbers. If n is less than 2, return an empty li...
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": 71882, "acecode_id": "evol_19308", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the startup process of an application. The function, `app_startup`, takes two parameters: `app_scaffold` (a string representing the application scaffold) and `migrations_run` (a boolean indicating whether the migrations hav...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert app_startup('my_app', False) == 'Application startup failed: migrations not run.'\", \"assert app_startup('my_app', True) == 'Application started successfully.'\", \"assert app_startup('test_app', False) == 'Application startup failed: migrations not run.'\"...
{ "split": "train", "index": 71883, "acecode_id": "bigcode_python_fns_2750", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `term`, return the list of accepted synonyms for the CAZy class that matches the input term. The input term can be in various formats, including case variations, underscores, dashes, or spaces. If the input term does not match any CAZy class, return an empty list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_cazy_synonyms('Glycoside-Hydrolases') == ['Glycoside-Hydrolases', 'Glycoside_Hydrolases', 'GlycosideHydrolases', 'GLYCOSIDE-HYDROLASES', 'gh']\", \"assert get_cazy_synonyms('glycosyltransferases') == ['Glycosyl-Transferases', 'Glycosyl_Transferases', 'Gl...
{ "split": "train", "index": 71884, "acecode_id": "bigcode_python_fns_14389", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of tuples representing combinations of items and a list of integers representing the counts of those items, write a function that returns a list of combinations that have a support greater than or equal to a given minimum support threshold. The support for a combin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_valid_combinations([('apple', 'banana'), ('banana', 'mango'), ('apple',)], [3, 2, 5], 0.3) == [('apple', 'banana'), ('apple',)]\", \"assert get_valid_combinations([('orange', 'banana'), ('banana', 'grape'), ('kiwi',)], [1, 1, 3], 0.5) == [('kiwi',)]\", \...
{ "split": "train", "index": 71885, "acecode_id": "bigcode_python_fns_17122", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a function that calculates the residual values for a variable `x` based on a mathematical model. Your task is to implement the function `check_residual_within_tolerance` that takes a dictionary `residuals` containing a key 'x' representing the residual value for `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_residual_within_tolerance({'x': 0.00005}, 0.0001) == True\", \"assert check_residual_within_tolerance({'x': 0.0001}, 0.0001) == True\", \"assert check_residual_within_tolerance({'x': 0.0}, 0.0001) == True\", \"assert check_residual_within_tolerance({'x...
{ "split": "train", "index": 71886, "acecode_id": "oss_25619", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists of integers, one representing training data and another representing validation data. Your task is to implement a function `shuffle_train_data(train_data: List[int], val_data: List[int]) -> Tuple[List[int], List[int]]` that shuffles the training data in ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert shuffle_train_data([1, 2, 3, 4, 5], [6, 7, 8, 9, 10]) != [1, 2, 3, 4, 5]\", \"assert shuffle_train_data([1], [2]) == ([1], [2])\", \"assert shuffle_train_data([10, 20], [30, 40, 50]) != ([10, 20], [30, 40, 50])\", \"assert shuffle_train_data([1, 3, 5, 7, 9],...
{ "split": "train", "index": 71887, "acecode_id": "oss_22403", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function `has_supervisor()` that checks if a supervisor is available in the current environment. The function should return `True` if the string 'SUPERVISOR' is present in a predefined list of environment variables, otherwise it should return `Fals...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert has_supervisor(['USER', 'HOME', 'SUPERVISOR']) == True\", \"assert has_supervisor(['PATH', 'TEMP', 'SYSTEM']) == False\", \"assert has_supervisor(['SUPERVISOR', 'DB_HOST', 'API_KEY']) == True\", \"assert has_supervisor(['SUPERVISOR']) == True\", \"assert has...
{ "split": "train", "index": 71888, "acecode_id": "bigcode_python_fns_15648", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes two numerical parameters, which can be either integers or floating-point numbers, and returns the result of subtracting the second parameter from the first one.\nPlease reason step by step, then write a self-contained Python solution. Give your f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert subtract_numbers(17, 10) == 7\", \"assert subtract_numbers(5, 3) == 2\", \"assert subtract_numbers(0, 0) == 0\", \"assert subtract_numbers(-5, -3) == -2\", \"assert subtract_numbers(3.5, 2.1) == 1.4\", \"assert subtract_numbers(10.0, 2.5) == 7.5\", \"assert ...
{ "split": "train", "index": 71889, "acecode_id": "evol_34280", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the magnitude of a vector in a vector field. The vector field is represented as a list of components, and you need to calculate the magnitude of the vector using the formula: magnitude = sqrt(component1^2 + component2^...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert magnitude_of_vector([3, 4]) == 5.0\", \"assert magnitude_of_vector([1, 2, 2]) == 3.0\", \"assert magnitude_of_vector([0, 0, 0]) == 0.0\", \"assert magnitude_of_vector([-3, -4]) == 5.0\", \"assert magnitude_of_vector([1]) == 1.0\", \"assert magnitude_of_vecto...
{ "split": "train", "index": 71890, "acecode_id": "oss_22126", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks whether an instance of a resource already exists locally based on its type and UUID. If the instance exists, the function should return a message indicating that the instance already exists. If it does not exist, the funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sync_resource('type1', 'uuid1') == 'Instance created for type1 with UUID uuid1'\", \"assert sync_resource('type2', 'uuid2') == 'Instance created for type2 with UUID uuid2'\", \"assert sync_resource('type1', 'uuid3') == 'Instance created for type1 with UUID u...
{ "split": "train", "index": 71891, "acecode_id": "oss_37681", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Write a function `validate_email` that takes a single email address as its argument and returns `True` if the email address is valid according to common email formatting rules and `False` otherwise. The function should consider both local and internationalized domain names.\nPl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_email('test@email.com') == True\", \"assert validate_email('abc.def@gmail.co.uk') == True\", \"assert validate_email('invalid.email') == False\", \"assert validate_email('another_test@domain.info') == True\", \"assert validate_email('@nodomain.com')...
{ "split": "train", "index": 71892, "acecode_id": "evol_10378", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two mappings, `read` and `pair`, each represented as a list where the fourth element indicates the start position of the mapping, and the tenth element is a string representing the sequence of the mapping. You are also given a `region` represented as a list with t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_region([None, None, None, 5, None, None, None, None, None, 'ATGC'], [None, None, None, 10, None, None, None, None, None, 'ATGC'], [1, 15]) == True\", \"assert check_region([None, None, None, 20, None, None, None, None, None, 'ATGC'], [None, None, None,...
{ "split": "train", "index": 71893, "acecode_id": "bigcode_python_fns_23783", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a list of positive integers representing the lengths of different files. Your task is to merge these files into a single file. The cost of merging two files is equal to the sum of their lengths. You need to determine the minimum cost of merging all the files into ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert min_merge_length([1, 2, 3]) == 9\", \"assert min_merge_length([1]) == 0\", \"assert min_merge_length([5, 5]) == 10\", \"assert min_merge_length([2, 2, 2, 2]) == 16\", \"assert min_merge_length([8, 1]) == 9\"]}" }
{ "split": "train", "index": 71894, "acecode_id": "oss_11948", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Design a function to return a sorted list of unique elements that are found in both input lists of integers, including the ability to handle negative integers. The function should not utilize any built-in Python list features for its operations. Implement the function in such a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_common_elements([1, 2, 3], [3, 4, 5]) == [3]\", \"assert find_common_elements([-1, -2, -3], [-3, -4, -5]) == [-3]\", \"assert find_common_elements([1, 1, 2, 2], [2, 2, 3, 3]) == [2]\", \"assert find_common_elements([5, 6, 7], [8, 9, 10]) == []\", \"asse...
{ "split": "train", "index": 71895, "acecode_id": "evol_26752", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that manages the status of a remote control system based on a given mode. The function `set_remote_control_status(mode: int) -> str` should take an integer `mode` as input and return a string representing the status of the remote control....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_remote_control_status(0) == 'Local and locked'\", \"assert set_remote_control_status(1) == 'Remote and locked'\", \"assert set_remote_control_status(2) == 'Local and unlocked'\", \"assert set_remote_control_status(3) == 'Remote and unlocked'\", \"assert ...
{ "split": "train", "index": 71896, "acecode_id": "oss_26472", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given an XML string representation of a configuration file. Your task is to implement a function that extracts all unique XML namespace URIs from the child elements of the root node. The function should return a list of unique namespace URIs. If there are no child eleme...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_xml_namespaces('<config xmlns=\\\"urn:ietf:params:xml:ns:netconf:base:1.0\\\"><interfaces xmlns=\\\"urn:ietf:params:xml:ns:yang:ietf-interfaces\\\"></interfaces></config>') == ['urn:ietf:params:xml:ns:yang:ietf-interfaces']\", \"assert extract_xml_na...
{ "split": "train", "index": 71897, "acecode_id": "bigcode_python_fns_27176", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a list of strings representing field names that you want to sort by, implement a function that parses these field names and returns a formatted string indicating the sorting order. The sorting order should be ascending ('asc') by default, and if a field name starts with a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert ParseSortByArg(['name', '~age']) == 'name asc,age desc'\", \"assert ParseSortByArg(['height', 'weight']) == 'height asc,weight asc'\", \"assert ParseSortByArg(['~salary']) == 'salary desc'\", \"assert ParseSortByArg(['location', '~zipcode', 'country']) == 'l...
{ "split": "train", "index": 71898, "acecode_id": "bigcode_python_fns_9592", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a linked list containing integers from 0 to n-1, where n is a positive integer. Implement a function that checks if the linked list has been properly populated with these integers in sequential order. The function should return True if the linked list contains the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_linked_list_order(0) == True\", \"assert check_linked_list_order(1) == True\", \"assert check_linked_list_order(2) == True\", \"assert check_linked_list_order(3) == True\", \"assert check_linked_list_order(4) == True\", \"assert check_linked_list_order...
{ "split": "train", "index": 71899, "acecode_id": "bigcode_python_fns_37194", "num_tests": 16 }