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 creating a Python package management system that generates console scripts from a given dictionary of entry points. You need to implement a function `generate_console_scripts(entry_points: dict) -> List[str]` that takes in an `entry_points` dictionary. This ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_console_scripts({'console_scripts': ['openodia=openodia.__main__:main']}) == ['openodia=openodia.__main__:main']\", \"assert generate_console_scripts({'console_scripts': ['testscript=testmodule.run:execute']}) == ['testscript=testmodule.run:execute'... | {
"split": "train",
"index": 1300,
"acecode_id": "oss_22120",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `parse_arguments` that simulates the behavior of parsing command-line arguments. The function should take two optional parameters: `username` (a string) and `repositories` (a list of strings). If no parameters are provided, the function s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_arguments() == {'username': 'Luzkan', 'repositories': ['DeveloperEnvironment', 'PythonCourse']}\", \"assert parse_arguments('Alice') == {'username': 'Alice', 'repositories': ['DeveloperEnvironment', 'PythonCourse']}\", \"assert parse_arguments(reposito... | {
"split": "train",
"index": 1301,
"acecode_id": "bigcode_python_fns_38334",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `find_comments(python_code: str) -> List[str]` that takes a string representing a segment of Python code and returns a list of all comments in that code. A comment is defined as a line that starts with the `#` character. The function should only return the comm... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_comments('def square(x):\\\\n# return square of x\\\\nreturn x * x') == ['# return square of x']\", \"assert find_comments('def add(a, b):\\\\n# This function adds two numbers\\\\nreturn a + b') == ['# This function adds two numbers']\", \"assert find_c... | {
"split": "train",
"index": 1302,
"acecode_id": "evol_31330",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `displace_svg(original: str, displacement: str, scale_x: int, scale_y: int) -> None` that takes the file names of two SVG images and parameters for the displacement map filter. The function should simulate applying the <feDisplacementMap> filter primitive t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert displace_svg('image1.svg', 'image2.svg', 10, 15) == 'Applied <feDisplacementMap> to image1.svg with image2.svg at scale_x=10, scale_y=15.'\", \"assert displace_svg('test.svg', 'offset.svg', 5, 5) == 'Applied <feDisplacementMap> to test.svg with offset.svg at... | {
"split": "train",
"index": 1303,
"acecode_id": "evol_33301",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a triangle represented as a list of lists, where each list represents a row of the triangle. The triangle has a total of n rows. Your task is to find the minimum path sum from the top to the bottom of the triangle. Each step allows you to move to adjacent numbers ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert minimumTotal([[2]]) == 2\", \"assert minimumTotal([[2], [3, 4]]) == 5\", \"assert minimumTotal([[2], [3, 4], [6, 5, 7], [4, 1, 8, 3]]) == 11\", \"assert minimumTotal([[1], [2, 3], [4, 2, 3], [6, 5, 4, 1]]) == 8\", \"assert minimumTotal([[1], [1, 1], [1, 1, 1... | {
"split": "train",
"index": 1304,
"acecode_id": "oss_14636",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that returns a new list containing the squares of each number from the input list, sorted in ascending order. The input list may contain both positive and negative integers. Your function should handle an empty list by returning an emp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sorted_squares([-4, -1, 0, 3, 10]) == [0, 1, 9, 16, 100]\", \"assert sorted_squares([-7, -3, 2, 3, 11]) == [4, 9, 9, 49, 121]\", \"assert sorted_squares([1, 2, 3]) == [1, 4, 9]\", \"assert sorted_squares([-2, -1, 0, 1, 2]) == [0, 1, 1, 4, 4]\", \"assert sort... | {
"split": "train",
"index": 1305,
"acecode_id": "bigcode_python_fns_48000",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a registration system for a fictional online platform. The system should allow users to register for different types of actions, such as creating a new account, making a purchase, or subscribing to a service. Each action is represented by an enu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert register(Action.CREATE_ACCOUNT, lambda message: message) is None\", \"assert register(Action.MAKE_PURCHASE, lambda message: message) is None\", \"assert register(Action.SUBSCRIBE_SERVICE, lambda message: message) is None\", \"assert register(Action.CREATE_AC... | {
"split": "train",
"index": 1306,
"acecode_id": "oss_10789",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a string `text` which contains multiple lines of code, your task is to determine whether the last line of the code is a valid function definition. A valid function definition starts with the keyword 'def' followed by a function name, parameters enclosed in parentheses, an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_function_definition('def my_function(param1, param2):\\\\n') == True\", \"assert is_valid_function_definition(' def indented_func():\\\\n') == True\", \"assert is_valid_function_definition('def 123invalid_func():\\\\n') == False\", \"assert is_va... | {
"split": "train",
"index": 1307,
"acecode_id": "bigcode_python_fns_44725",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple messaging interaction. The function should perform the following actions: send messages, reply to the last received message, and retrieve the last 'count' messages sent by a specific sender. Your task is to impleme... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert message_interaction([('Hello there!', 'friend1'), ('How are you?', 'friend2')], [('friend1', 'Hey!'), ('friend2', 'I am good, thanks!')], 'Nice to hear that', 'friend1', 1) == ['Hey!']\", \"assert message_interaction([('Hi!', 'friend1')], [('friend1', 'Hello... | {
"split": "train",
"index": 1308,
"acecode_id": "oss_665",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You have been given a function that checks if a specific comment has already been posted on a Pull Request (PR). Your task is to implement a function `post_lgtm_comment(pr_comments: List[str]) -> str` that takes a list of existing comments on the PR and returns a comment string... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert post_lgtm_comment(['This Pull request Passed all of clang-tidy tests. :+1:']) == ''\", \"assert post_lgtm_comment(['This Pull request Passed all of clang-tidy tests. :+1:', 'Another comment']) == ''\", \"assert post_lgtm_comment(['This Pull request Passed al... | {
"split": "train",
"index": 1309,
"acecode_id": "bigcode_python_fns_2791",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a login process for a user. The function `login_user` takes in several parameters: `host`, `port`, `identityName`, `password`, `serviceName`, and `perspectiveName`. It should return a string indicating whether the login was... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert login_user('localhost', 8080, 'admin', 'password123', 'myService', 'myPerspective') == 'Login Successful'\", \"assert login_user('localhost', 8080, 'user', 'password123', 'myService', 'myPerspective') == 'Login Failed'\", \"assert login_user('localhost', 808... | {
"split": "train",
"index": 1310,
"acecode_id": "bigcode_python_fns_5392",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string `status_id` which represents a transaction status identifier for a fund transfer request. Your task is to implement a function `get_status(status_id: str) -> str` that returns the status identifier appended with the prefix 'Transaction Status: '. The func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_status('1491819372_186_81_l73c003_VDP_ARM') == 'Transaction Status: 1491819372_186_81_l73c003_VDP_ARM'\", \"assert get_status('1234567890_123_45_l12c003_VDP_ARM') == 'Transaction Status: 1234567890_123_45_l12c003_VDP_ARM'\", \"assert get_status('98765432... | {
"split": "train",
"index": 1311,
"acecode_id": "bigcode_python_fns_4984",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that registers a system component. The function should simulate the registration process by simply returning a string indicating that the component has been successfully registered. The function does not take any input parameters. Impleme... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert register_component() == 'Component registered successfully.'\", \"assert register_component() == 'Component registered successfully.'\", \"assert register_component() == 'Component registered successfully.'\", \"assert register_component() == 'Component regi... | {
"split": "train",
"index": 1312,
"acecode_id": "bigcode_python_fns_2325",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a simple command execution system. Implement a function `execute_command(command: str) -> Tuple[int, str]` that takes a command as a string and simulates its execution. The function should return a tuple containing two values: the exit status of t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert execute_command('success') == (0, 'Command executed successfully')\", \"assert execute_command('failure') == (1, 'Command failed to execute')\", \"assert execute_command('invalid') == (2, 'Unknown command')\", \"assert execute_command('test') == (2, 'Unknown... | {
"split": "train",
"index": 1313,
"acecode_id": "bigcode_python_fns_33018",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of integers: `list1` and `list2`. Remove the elements from `list1` starting from index `a` to index `b` (inclusive), and insert all elements of `list2` in their place. After performing the merge operation, check if the final list is sorted in ascending o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert mergeInBetween([0,1,2,3,4,5,6], 2, 5, [1000004,1000003,1000002,1000001,1000000]) == 'The final list is not sorted'\", \"assert mergeInBetween([1,3,5,7,9], 0, 2, [2,4,6]) == [2,4,6,7,9]\", \"assert mergeInBetween([1,2,3,4,5], 1, 3, [5,4,3]) == 'The final list... | {
"split": "train",
"index": 1314,
"acecode_id": "evol_32771",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a positive integer n. Write a function that returns a string consisting of the digits '0' through '9' repeated enough times to create a final string of length n. If n is less than 10, the string should contain the first n digits from '0123456789'. If n is greater ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_string(5) == '01234'\", \"assert generate_string(10) == '0123456789'\", \"assert generate_string(15) == '012345678901234'\", \"assert generate_string(1) == '0'\", \"assert generate_string(2) == '01'\", \"assert generate_string(3) == '012'\", \"asser... | {
"split": "train",
"index": 1315,
"acecode_id": "bigcode_python_fns_18492",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the generation of a shaded relief plot based on a series of input parameters. Write a function `generate_shaded_relief_plot` that takes the following parameters: `DataDirectory` (str), `Base_file` (str), `Drape_prefix` (str... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_shaded_relief_plot('data/', 'base', 'drape', 'jet', 'right', 'Elevation', 'big', 'png', 300, '', 'UTM_km', False, 'none', []) == 'Generated plot with DataDirectory=data/, Base_file=base, Drape_prefix=drape, cmap=jet, cbar_loc=right, cbar_label=Eleva... | {
"split": "train",
"index": 1316,
"acecode_id": "bigcode_python_fns_46071",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that stores an SMS verification code and a send flag for a mobile number. The function should take the following parameters: a mobile number (string), an SMS verification code (string), an expiration time for the SMS code in se... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert store_sms_code_and_flag('1234567890', '1234', 300, 60) == {'sms_1234567890': '1234', 'send_flag_1234567890': 1}\", \"assert store_sms_code_and_flag('0987654321', '5678', 600, 120) == {'sms_0987654321': '5678', 'send_flag_0987654321': 1}\", \"assert store_sms... | {
"split": "train",
"index": 1317,
"acecode_id": "oss_11602",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes two inputs: a server address (a string) and an image name (also a string). The function should simulate fetching a list of tags associated with a given image name from a Docker registry server. Instead of actually making a netw... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_tags_list('server1.com', 'imageA') == ['v1.0', 'v1.1']\", \"assert get_tags_list('server1.com', 'imageB') == ['latest', 'stable']\", \"assert get_tags_list('server2.com', 'imageA') == ['v2.0', 'v2.1', 'v2.2']\", \"assert get_tags_list('server2.com', 'ima... | {
"split": "train",
"index": 1318,
"acecode_id": "bigcode_python_fns_28218",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves configuration information for a web application. The function should return a tuple containing the web application's base URL, connection timeout, and read timeout. The base URL is formed by concatenating a base URL with a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_app_config('http://example.com', '/api', 5, 10) == ('http://example.com/api', 5, 10)\", \"assert get_app_config('http://myapp.com', '/v1', 3, 8) == ('http://myapp.com/v1', 3, 8)\", \"assert get_app_config('https://service.org', '/data', 4, 12) == ('https... | {
"split": "train",
"index": 1319,
"acecode_id": "bigcode_python_fns_5783",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a given repository name and its associated stars range. The function should take in a string representing the repository name and stars range in the format \"<reponame><gh_stars>10-100\" and return a dictionary conta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_repo_info('ajayiagbebaku/NFL-Model<gh_stars>10-100') == {'repository_name': 'ajayiagbebaku/NFL-Model', 'stars_range': (10, 100)}\", \"assert extract_repo_info('xyz/Project<gh_stars>5-50') == {'repository_name': 'xyz/Project', 'stars_range': (5, 50)}\... | {
"split": "train",
"index": 1320,
"acecode_id": "oss_14586",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a dictionary representing cloud instance configuration settings. The function should validate the dictionary and return a modified version with specific changes applied. You are given a dictionary `instance_config` with... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_instance_config({'instance_type': 't2.micro', 'security_group_ids': ['sg-12345678'], 'subnet_id': 'subnet-12345678', 'ebs_optimized': True, 'ebs_encrypted': False, 'ebs_kms_key_id': 'default', 'tags': {'Name': 'MyInstance', 'Environment': 'Production... | {
"split": "train",
"index": 1321,
"acecode_id": "oss_37545",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of books, where each book is represented as a dictionary containing an 'id', 'title', and 'author'. Your task is to implement a function `get_books()` that returns the list of books as described. Each book should maintain its original order in the list. The... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_books() == [{'id': 1, 'title': 'Python Programming', 'author': 'Guido van Rossum'}, {'id': 2, 'title': 'Clean Code', 'author': 'Robert C. Martin'}, {'id': 3, 'title': 'Design Patterns', 'author': 'Erich Gamma'}]\", \"assert get_books() != []\", \"assert ... | {
"split": "train",
"index": 1322,
"acecode_id": "oss_8240",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing the execution times of various processes in milliseconds, write a function that computes the percentage of time spent in MPI (Message Passing Interface) and returns both the percentage and the breakdown of that time for each process. The fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_mpi_time_percentages([100, 200, 300], [10, 40, 90]) == ([10.0, 20.0, 30.0], [10, 40, 90])\", \"assert get_mpi_time_percentages([0, 150, 300], [0, 50, 150]) == ([0.0, 33.33333333333333, 50.0], [0, 50, 150])\", \"assert get_mpi_time_percentages([50, 0, 200... | {
"split": "train",
"index": 1323,
"acecode_id": "bigcode_python_fns_15988",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an original list of n integers and an additional list of m integers, implement a function that calculates the median of the original list and then calculates the median of the list after each element from the additional list is added one by one. The function should return... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_medians([10, 20, 30], []) == [20.0]\", \"assert calculate_medians([1], [2]) == [1.0, 1.5]\", \"assert calculate_medians([1, 1, 1], [1]) == [1.0, 1.0]\", \"assert calculate_medians([4, 2], [1]) == [3.0, 2.0]\", \"assert calculate_medians([20, 10], [... | {
"split": "train",
"index": 1324,
"acecode_id": "evol_34243",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes results from a scientific computation. The function should take a dictionary representing the results as input and return a new dictionary containing the processed results. The processing involves the following s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_and_harmonize_results({'fun': 0.5, 'nfev': 10, 'status': 'initial'}) == {'fitness': 0.5, 'n_evaluations': 10, 'status': 'success'}\", \"assert process_and_harmonize_results({'fun': 0.2, 'status': 'initial'}) == {'fitness': 0.2, 'n_evaluations': None,... | {
"split": "train",
"index": 1325,
"acecode_id": "oss_27016",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a recursive binary search function that finds the start and end indices of a given number in a sorted list. If the number occurs multiple times, return a list with the start and end indices. If the number is not found, return an empty list. The function should handle ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binary_search([1, 2, 2, 2, 3], 2) == [1, 3]\", \"assert binary_search([1, 2, 3, 4, 5], 6) == []\", \"assert binary_search([], 1) == []\", \"assert binary_search([3, 3, 3], 3) == [0, 2]\", \"assert binary_search([1, 1, 1, 2], 1) == [0, 2]\", \"assert binary_s... | {
"split": "train",
"index": 1326,
"acecode_id": "evol_12604",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the behavior of an API endpoint that retrieves a file from a storage system. The function should take a filename as input and return a response indicating whether the file exists or not. If the file exists, the response sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_file_retrieval('file1.txt') == {'status_code': 200, 'message': 'File retrieved successfully'}\", \"assert simulate_file_retrieval('file2.txt') == {'status_code': 200, 'message': 'File retrieved successfully'}\", \"assert simulate_file_retrieval('fil... | {
"split": "train",
"index": 1327,
"acecode_id": "bigcode_python_fns_43418",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that determines if two given strings are anagrams of each other. An anagram is a word formed by rearranging the letters of a different word, using all the original letters exactly once. The function should return true if the strings are anagrams and false other... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert are_anagrams('listen', 'silent') == True\", \"assert are_anagrams('triangle', 'integral') == True\", \"assert are_anagrams('apple', 'papel') == True\", \"assert are_anagrams('rat', 'tar') == True\", \"assert are_anagrams('night', 'thing') == True\", \"assert... | {
"split": "train",
"index": 1328,
"acecode_id": "evol_3721",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a boolean condition and two lists of tasks. Your goal is to determine the status of each task based on the condition. If the condition is True, all tasks in the first list should return a status of 'Success', and the task in the second list should be skipped. If t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate_tasks(True, ['Task1', 'Task2'], 'Task3') == {'Task1': 'Success', 'Task2': 'Success', 'Task3': 'Skipped'}\", \"assert evaluate_tasks(False, ['Task1', 'Task2'], 'Task3') == {'Task1': 'Skipped', 'Task2': 'Skipped', 'Task3': 'Success'}\", \"assert evalu... | {
"split": "train",
"index": 1329,
"acecode_id": "bigcode_python_fns_16785",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists, `categories` and `values`, write a function `generate_bar_plot_data(categories, values)` that takes in these two parameters and returns a dictionary where the keys are the categories and the values are the corresponding numerical values from the `values` list. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_bar_plot_data(['A', 'B', 'C'], [10, 20, 30]) == {'A': 10, 'B': 20, 'C': 30}\", \"assert generate_bar_plot_data(['X', 'Y'], [5, 15]) == {'X': 5, 'Y': 15}\", \"assert generate_bar_plot_data(['Cat', 'Dog'], [7, 3]) == {'Cat': 7, 'Dog': 3}\", \"assert g... | {
"split": "train",
"index": 1330,
"acecode_id": "oss_17531",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of absolute limits for various users represented as a list of dictionaries. Each dictionary contains the user's name and their associated value. Your task is to implement a function that takes this list of dictionaries and returns a formatted string that li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_limits([]) == 'No limits available.'\", \"assert format_limits([{'Name': 'User1', 'Value': 10}]) == 'User1: 10'\", \"assert format_limits([{'Name': 'User1', 'Value': 10}, {'Name': 'User2', 'Value': 20}]) == 'User1: 10\\\\nUser2: 20'\", \"assert format... | {
"split": "train",
"index": 1331,
"acecode_id": "bigcode_python_fns_1133",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `multiplication_table(start: int, end: int) -> str` that generates a multiplication table for all integer pairs (i, j) where i and j are in the inclusive range from `start` to `end`. The function should return the multiplication table formatted as a string, wit... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multiplication_table(1, 1) == '1 x 1 = 1\\\\n'\", \"assert multiplication_table(1, 2) == '1 x 1 = 1\\\\n1 x 2 = 2\\\\n\\\\n2 x 1 = 2\\\\n2 x 2 = 4\\\\n'\", \"assert multiplication_table(1, 3) == '1 x 1 = 1\\\\n1 x 2 = 2\\\\n1 x 3 = 3\\\\n\\\\n2 x 1 = 2\\\\n2... | {
"split": "train",
"index": 1332,
"acecode_id": "evol_27147",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that receives a list of integers and returns the maximum sum of any contiguous subarray within that list. A contiguous subarray is defined as a sequence of elements that are adjacent in the array. Implement a function `max_subarray_sum(ar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_subarray_sum([-2, -3, -1]) == -1\", \"assert max_subarray_sum([5, 4, -1, 7, 8]) == 23\", \"assert max_subarray_sum([-1, -2, -3, -4]) == -1\", \"assert max_subarray_sum([0, 0, 0, 0]) == 0\", \"assert max_subarray_sum([2, 3, -2, 5]) == 8\", \"assert max_su... | {
"split": "train",
"index": 1333,
"acecode_id": "bigcode_python_fns_9128",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of numbers, implement a function that finds the two non-consecutive elements with the greatest difference between them. The function should return these two elements in ascending order. If the list contains fewer than two elements, the function should return None.\... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_furthest_elements([1, 2, 3, 4, 5]) == (1, 5)\", \"assert find_furthest_elements([5, 1, 3, 2, 4]) == (1, 5)\", \"assert find_furthest_elements([10, 20, 30, 40, 50]) == (10, 50)\", \"assert find_furthest_elements([5, 5, 5, 5]) == (5, 5)\", \"assert find_f... | {
"split": "train",
"index": 1334,
"acecode_id": "evol_28803",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary containing the results of a machine learning model training execution. Your task is to create a function `process_training_results` that takes this dictionary as input and returns a formatted string containing the training execution details. The forma... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_training_results({'training_execution_id': '123e4567-e89b-12d3-a456-426614174000', 'accuracy': 0.95, 'global_step': 10000}) == 'Training Execution ID: 123e4567-e89b-12d3-a456-426614174000\\\\nAccuracy: 95.00%\\\\nGlobal Step: 10000'\", \"assert proce... | {
"split": "train",
"index": 1335,
"acecode_id": "oss_23401",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with checking the presence of specific environment variables required for a web application deployment. You are given a list of attributes that represent the environment variables needed for both remote and local configurations. Your function should take a list o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_environment_variables(['remote_url', 'remote_db_name', 'remote_db_user']) == [True, True, True]\", \"assert check_environment_variables(['remote_db_pass', 'local_wp_path', 'local_sql_snapshot']) == [True, False, False]\", \"assert check_environment_var... | {
"split": "train",
"index": 1336,
"acecode_id": "bigcode_python_fns_37164",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function `random_int_between(a: int, b: int) -> int` that takes two distinct integers, `a` and `b`, as input and returns a random integer between the two boundaries inclusive. The function should ensure that the smaller integer is treated as the lower boundary and t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert random_int_between(10, 100) in range(10, 101)\", \"assert random_int_between(5, 15) in range(5, 16)\", \"assert random_int_between(-10, 10) in range(-10, 11)\", \"assert random_int_between(0, 1) in range(0, 2)\", \"assert random_int_between(7, 3) in range(3,... | {
"split": "train",
"index": 1337,
"acecode_id": "evol_11099",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `extract_comments` that parses and extracts information from code comments. The function should handle comments for attributes, methods, and functions based on the provided input strings. The function should take three parameters: `at... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_comments('attribute docstring\\\\n attribute docstring 2', 'class_record().method_record', ['function_line 1', 'function_line 2']) == {'attribute': 'attribute docstring\\\\n attribute docstring 2', 'method': 'class_record().method_record', 'functio... | {
"split": "train",
"index": 1338,
"acecode_id": "oss_1648",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of various bars in a histogram, where each bar has a width of 1. Your task is to implement a function `get_bounding_box(heights: List[int]) -> Tuple[int, int]` that returns the minimum and maximum height of the bars in t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_bounding_box([1, 3, 2, 5, 4]) == (1, 5)\", \"assert get_bounding_box([0, 0, 0]) == (0, 0)\", \"assert get_bounding_box([7]) == (7, 7)\", \"assert get_bounding_box([]) == (0, 0)\", \"assert get_bounding_box([3, 1, 4, 1, 5, 9, 2]) == (1, 9)\", \"assert get... | {
"split": "train",
"index": 1339,
"acecode_id": "bigcode_python_fns_13946",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a positive integer n, implement a function that returns the nth number in the Fibonacci sequence. The Fibonacci sequence is defined as follows: F(1) = 1, F(2) = 1, and F(n) = F(n-1) + F(n-2) for n > 2. Your solution should handle arbitrarily large numbers efficiently.\nPl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(1) == 1\", \"assert fibonacci(2) == 1\", \"assert fibonacci(3) == 2\", \"assert fibonacci(4) == 3\", \"assert fibonacci(5) == 5\", \"assert fibonacci(6) == 8\", \"assert fibonacci(7) == 13\", \"assert fibonacci(8) == 21\", \"assert fibonacci(9) == ... | {
"split": "train",
"index": 1340,
"acecode_id": "evol_20774",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string called 'builder' which represents a pricing scheme in a specific format. Your task is to implement a function `start_pricing(builder: str) -> str` that returns a new string based on the following rules: \n\n1. If the string 'builder' starts with 'PRE-', r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert start_pricing('PRE-PriceScheme') == 'START-PriceScheme'\", \"assert start_pricing('PriceScheme-END') == 'FINISH-PriceScheme'\", \"assert start_pricing('PriceScheme') == 'DEFAULT-PriceScheme'\", \"assert start_pricing('PRE-') == 'START-'\", \"assert start_pri... | {
"split": "train",
"index": 1341,
"acecode_id": "bigcode_python_fns_22360",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that calculates the last number in the Fibonacci sequence up to a given index. The Fibonacci sequence is a series of numbers in which each number is the sum of the two preceding ones, usually starting with 0 and 1. Your functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert last_fibonacci(0) == 0\", \"assert last_fibonacci(1) == 1\", \"assert last_fibonacci(2) == 1\", \"assert last_fibonacci(3) == 2\", \"assert last_fibonacci(4) == 3\", \"assert last_fibonacci(5) == 5\", \"assert last_fibonacci(6) == 8\", \"assert last_fibonacc... | {
"split": "train",
"index": 1342,
"acecode_id": "oss_26284",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that determines the magnetic field configuration based on the given era and current. The function should return a configuration string based on the following rules: If the era is '2016' and the current is less than or equal to 100,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_magnetic_field_configuration('2016', 50) == 'LowField_2016'\", \"assert get_magnetic_field_configuration('2016', 150) == 'HighField_2016'\", \"assert get_magnetic_field_configuration('2017', 75) == 'LowField_2017'\", \"assert get_magnetic_field_configura... | {
"split": "train",
"index": 1343,
"acecode_id": "oss_15812",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two RGB color values represented as lists of three integers, where each integer is in the range [0, 255]. Your task is to implement a function that calculates the Euclidean distance between these two colors. The Euclidean distance between two colors (r1, g1, b1) a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert abs(color_distance([255, 0, 0], [0, 255, 0]) - 360.624458) < 1e-6\", \"assert abs(color_distance([0, 0, 0], [255, 255, 255]) - 441.672955) < 1e-6\", \"assert abs(color_distance([100, 150, 200], [100, 150, 200]) - 0.0) < 1e-6\", \"assert abs(color_distance([1... | {
"split": "train",
"index": 1344,
"acecode_id": "bigcode_python_fns_43824",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You need to create a function that takes a string key, a string value, and an optional string delimiter. The function should return a dictionary where the key is formatted by surrounding the original key with the given delimiter, and the value is set to the provided value. If n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert build_param_obj('username', 'john_doe') == {'username': 'john_doe'}\", \"assert build_param_obj('username', 'john_doe', '*') == {'*username*': 'john_doe'}\", \"assert build_param_obj('age', '30') == {'age': '30'}\", \"assert build_param_obj('age', '30', '#')... | {
"split": "train",
"index": 1345,
"acecode_id": "bigcode_python_fns_29018",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates a list of user inputs for a command-line application. The function should check if a list of required arguments is provided by the user. If any required argument is missing, the function should raise a `ValueError` with a s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_arguments(['--workspace_id'], ['--workspace_id']) is None\", \"assert validate_arguments(['--user_id'], ['--user_id']) is None\", \"assert validate_arguments(['--token'], ['--token']) is None\"]}"
} | {
"split": "train",
"index": 1346,
"acecode_id": "oss_19546",
"num_tests": 3
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simplified version of a task execution framework. Your task is to implement a function named `execute_task` that takes a callback function as input and returns the result of executing that function. The function should handle the execution of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert execute_task(lambda: 1 + 1) == 2\", \"assert execute_task(lambda: 'Hello, World!') == 'Hello, World!'\", \"assert execute_task(lambda: 5 * 5) == 25\", \"assert execute_task(lambda: sum([1, 2, 3, 4, 5])) == 15\", \"assert execute_task(lambda: [x for x in rang... | {
"split": "train",
"index": 1347,
"acecode_id": "oss_8097",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that verifies if a specific network interface of a device is in the expected operational state. Given a dictionary representing the status of various interfaces of a device, your function should check if a specified interface matches the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_interface_status({'eth0': 'up', 'eth1': 'down'}, 'eth0', 'up') == True\", \"assert check_interface_status({'eth0': 'up', 'eth1': 'down'}, 'eth1', 'up') == False\", \"assert check_interface_status({'eth0': 'up', 'eth1': 'down'}, 'eth1', 'down') == True\... | {
"split": "train",
"index": 1348,
"acecode_id": "bigcode_python_fns_31054",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a nested dictionary structure, implement a function `add_sibling(data: dict, node_path: List[str], new_key: str, new_data: Any) -> None` that adds a new sibling key-value pair to the specified node in the nested dictionary. The `node_path` is a list of keys that indicates... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_sibling({'a': {'b': {'c': 1}}}, ['a', 'b'], 'd', 2) == None and {'a': {'b': {'c': 1, 'd': 2}}} == {'a': {'b': {'c': 1, 'd': 2}}}\", \"assert add_sibling({'x': {'y': {'z': 3}}}, ['x', 'y'], 'w', 4) == None and {'x': {'y': {'z': 3, 'w': 4}}} == {'x': {'y':... | {
"split": "train",
"index": 1349,
"acecode_id": "bigcode_python_fns_2687",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes two unique floating point values as input and returns their division result. The function should handle cases where the second number is zero by returning None. The function should also ensure that both input values are of type float. If any inpu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert divide_numbers(10.0, 2.0) == 5.0\", \"assert divide_numbers(5.5, 2.0) == 2.75\", \"assert divide_numbers(-10.0, 2.0) == -5.0\", \"assert divide_numbers(0.0, 3.0) == 0.0\", \"assert divide_numbers(10.0, 0.0) == None\", \"assert divide_numbers(1.0, 2.0) == 0.5... | {
"split": "train",
"index": 1350,
"acecode_id": "evol_26658",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a dictionary of key-value pairs and returns a new dictionary. The new dictionary should only include key-value pairs where the value is an integer and greater than a specified threshold. The function should take two par... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_integer_values({'a': 1, 'b': 2, 'c': 3}, 1) == {'b': 2, 'c': 3}\", \"assert filter_integer_values({'x': 10, 'y': 'hello', 'z': 5}, 6) == {'x': 10}\", \"assert filter_integer_values({'one': 1, 'two': 2, 'three': 3}, 3) == {}\", \"assert filter_integer_... | {
"split": "train",
"index": 1351,
"acecode_id": "oss_28",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, implement a function `get_flattened_list` that takes a list containing nested lists of strings and returns a flattened list of strings. The input may contain strings as well as other lists, and your task is to concatenate all strings into a single list ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_flattened_list(['a', ['b', 'c'], 'd', ['e', ['f', 'g']]]) == ['a', 'b', 'c', 'd', 'e', 'f', 'g']\", \"assert get_flattened_list(['hello', ['world', 'from'], 'the', ['nested', ['list', 'test']]]) == ['hello', 'world', 'from', 'the', 'nested', 'list', 'tes... | {
"split": "train",
"index": 1352,
"acecode_id": "bigcode_python_fns_35402",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes a list of integers as input and returns the count of unique elements in the list.\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 count_unique_elements([1, 2, 3, 2, 1, 4, 7, 8, 9, 8]) == 7\", \"assert count_unique_elements([1, 1, 1, 1]) == 1\", \"assert count_unique_elements([]) == 0\", \"assert count_unique_elements([1, 2, 3, 4, 5]) == 5\", \"assert count_unique_elements([5, 5, 5, 5, ... | {
"split": "train",
"index": 1353,
"acecode_id": "evol_16650",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the initialization of a server environment for a project. Your function should take in a boolean for each of the following services: MongoDB, Redis, RabbitMQ, and Celery, indicating whether each service should be started. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_services(True, False, False, False) == ['mongod --auth --dbpath /path/to/db']\", \"assert initialize_services(False, True, False, False) == ['redis-server']\", \"assert initialize_services(False, False, True, False) == ['rabbitmq-server']\", \"ass... | {
"split": "train",
"index": 1354,
"acecode_id": "bigcode_python_fns_27266",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that analyzes a list of suspected revisions in a software project and saves potential culprits responsible for any identified issues. The function should take a single argument, a list of strings representing suspected revisions. The ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_revisions(['rev1', 'rev2', 'rev1', 'rev3']) == ['rev1', 'rev2', 'rev3']\", \"assert analyze_revisions(['rev2', 'rev2', 'rev4', 'rev3', 'rev1']) == ['rev1', 'rev2', 'rev3', 'rev4']\", \"assert analyze_revisions(['revA', 'revB', 'revC', 'revA']) == ['r... | {
"split": "train",
"index": 1355,
"acecode_id": "bigcode_python_fns_24537",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of a series of buildings. Your task is to determine the maximum height of the buildings that can be reached from the first building by jumping to adjacent buildings, considering that you can only jump to a building with ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_reachable_height([1, 2, 3, 4, 5]) == 1\", \"assert max_reachable_height([5, 5, 5, 5, 5]) == 5\", \"assert max_reachable_height([2, 3, 1, 0]) == 2\", \"assert max_reachable_height([5]) == 5\", \"assert max_reachable_height([1, 2, 3]) == 1\", \"assert max_... | {
"split": "train",
"index": 1356,
"acecode_id": "bigcode_python_fns_46929",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a string `word` and a list of prefixes. Your task is to implement a function that removes all occurrences of the specified prefixes from the beginning of the `word`. The function should return the modified `word` after all prefixes have been removed. If the `word`... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_prefixes('hello', ['he', 'lo']) == 'llo'\", \"assert remove_prefixes('leetcode', ['leet', 'code']) == ''\", \"assert remove_prefixes('testcase', ['test', 'case']) == ''\", \"assert remove_prefixes('prefixes', ['prefix', 'es']) == ''\", \"assert remove... | {
"split": "train",
"index": 1357,
"acecode_id": "bigcode_python_fns_15936",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary that represents a mapping of items to their quantities. Your task is to implement a function that takes this dictionary and returns a new dictionary with only those items that have a quantity greater than zero. If an item has a quantity of zero or les... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_positive_quantities({'apple': 5, 'banana': 0, 'orange': 3}) == {'apple': 5, 'orange': 3}\", \"assert filter_positive_quantities({'watermelon': 0, 'grape': -1, 'kiwi': 2}) == {'kiwi': 2}\", \"assert filter_positive_quantities({'mango': 1, 'peach': 0, '... | {
"split": "train",
"index": 1358,
"acecode_id": "bigcode_python_fns_32427",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function that converts all lowercase letters in a given string to their uppercase equivalents. Additionally, the function should identify and replace any specified symbols present within the string with their corresponding names in a foreign language, such as replacing... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert symbol_translator('hello & world', {'&': {'french': 'et'}}, 'french') == 'HELLO et WORLD'\", \"assert symbol_translator('a@b$c', {'@': {'french': 'arobase'}, '$': {'french': 'dollar'}}, 'french') == 'AarobaseBdollarC'\", \"assert symbol_translator('test @ sy... | {
"split": "train",
"index": 1359,
"acecode_id": "evol_25638",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are required to implement a function that simulates the creation of a stage runner in a project. The function, `create_stage_runner`, will take four parameters: `filename` (a string), `bank_size` (an integer), `bank_num` (an integer), and `master_pid` (an integer). The func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_stage_runner('example_file.txt', 1024, 5, 1234) == {'filename': 'example_file.txt', 'bank_size': 1024, 'bank_num': 5, 'master_pid': 1234}\", \"assert create_stage_runner('test_file.txt', 512, 3, 5678) == {'filename': 'test_file.txt', 'bank_size': 512,... | {
"split": "train",
"index": 1360,
"acecode_id": "oss_19095",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string that may contain SQL-like queries. Your task is to implement a function `format_query(str_sql: str) -> str` that processes this string by performing the following steps: 1. Replace all newline characters with a single space. 2. Remove any excess whitespac... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_query('SELECT * FROM users\\\\nWHERE id = 1') == 'SELECT * FROM users WHERE id = 1'\", \"assert format_query('\\\\nSELECT name, age FROM persons \\\\n\\\\n') == 'SELECT name,age FROM persons'\", \"assert format_query('DELETE FROM test\\\\nWH... | {
"split": "train",
"index": 1361,
"acecode_id": "bigcode_python_fns_10494",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates user login information. Write a function called 'validate_login' that takes in three parameters: a dictionary 'args' containing 'username' and 'password', and a dictionary 'provider' with a method 'validate_login(username, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_login({'username': 'user1', 'password': 'pass1'}, {'validate_login': lambda u, p: u == 'user1' and p == 'pass1'}) == True\", \"assert validate_login({'username': 'user2', 'password': 'pass2'}, {'validate_login': lambda u, p: u == 'user2' and p == 'w... | {
"split": "train",
"index": 1362,
"acecode_id": "bigcode_python_fns_29001",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers `x` and an array of probabilities `y` corresponding to each integer in `x`, write a function `sample(x: List[int], y: List[float], numSamples: int) -> List[int]` that returns `numSamples` samples from the array `x`, where the selection of each integer... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sample([5, 10, 15], [0.1, 0.1, 0.8], 3) == [15, 15, 10]\", \"assert sample([4, 5, 6], [0.3, 0.3, 0.4], 4) == [6, 5, 4, 6]\", \"assert sample([10, 20, 30], [0.0, 1.0, 0.0], 2) == [20, 20]\", \"assert sample([1, 1, 1], [0.33, 0.33, 0.34], 10) == [1, 1, 1, 1, 1... | {
"split": "train",
"index": 1363,
"acecode_id": "bigcode_python_fns_1582",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Write a function in Python that calculates the area of a circle given its radius. The function should also handle invalid inputs, such as when the radius is negative or non-numeric. If the input is valid, return the area of the circle. If the input is invalid, return a message ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert circle_area(-5) == 'Invalid input: radius must be non-negative'\", \"assert circle_area('a') == 'Invalid input: radius must be a number'\", \"assert circle_area(0) == 0.0\", \"assert circle_area(1) == 3.141592653589793\", \"assert circle_area(2) == 12.566370... | {
"split": "train",
"index": 1364,
"acecode_id": "evol_23204",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `factorial(num: int) -> int` that takes a non-negative integer `num` as input and returns its factorial. The factorial of a non-negative integer n is the product of all positive integers less than or equal to n, and is denoted as n!. For example, factorial(5) s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert factorial(0) == 1\", \"assert factorial(1) == 1\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", \"assert factorial(5) == 120\", \"assert factorial(6) == 720\", \"assert factorial(7) == 5040\", \"assert factorial(... | {
"split": "train",
"index": 1365,
"acecode_id": "evol_24618",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that accepts a string and returns the first non-repeated character. If every character is repeated, return 'All are Repeated'. Consider case sensitivity - for example, 'a' and 'A' are considered different characters.\nPlease reason step by step, then write a se... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert first_non_repeated_char('swiss') == 'w'\", \"assert first_non_repeated_char('level') == 'v'\", \"assert first_non_repeated_char('aabbcc') == 'All are Repeated'\", \"assert first_non_repeated_char('a') == 'a'\", \"assert first_non_repeated_char('') == 'All ar... | {
"split": "train",
"index": 1366,
"acecode_id": "evol_634",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to implement a function `sum_of_evens(nums)` that returns the sum of all even integers in the list. If there are no even integers, the function should return 0. \n\nFunction Signature: `def sum_of_evens(nums: List[int]) -> int:` \n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([10, 21, 32, 43, 54]) == 96\", \"assert sum_of_evens([-2, -4, -6]) == -12\", \"assert sum_of_evens([1, 3, 5]) == 0\", \"assert sum_of_evens([]) == 0\", \"assert sum_of_evens([2, 4, 6, 8]) == 20\", \... | {
"split": "train",
"index": 1367,
"acecode_id": "bigcode_python_fns_27735",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a sequence of integers `seq` and a substitute value `sub_value`. Your task is to write a function `substitute_sequence(seq, sub_value)` that generates a new sequence `out1` by substituting elements of `seq` with `sub_value` under the following conditions: 1. The l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert substitute_sequence([3, 5, 8, 2, 7, 4], 10) == [10, 10, 10, 10, 10]\", \"assert substitute_sequence([1, 2, 3, 4, 5], 3) == []\", \"assert substitute_sequence([10, 20, 30], 40) == [40, 40]\", \"assert substitute_sequence([5, 10, 15], 20) == [20, 20]\", \"asse... | {
"split": "train",
"index": 1368,
"acecode_id": "oss_16412",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given four integers r, g, b, and a representing the red, green, blue, and alpha (opacity) channels of a color, where each value is in the range of 0 to 255, write a function that converts these RGBA values to their equivalent in the range of 0 to 1. The function should return a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert normalize_rgba(255, 0, 0, 255) == (1.0, 0.0, 0.0, 1.0)\", \"assert normalize_rgba(0, 255, 0, 255) == (0.0, 1.0, 0.0, 1.0)\", \"assert normalize_rgba(0, 0, 255, 255) == (0.0, 0.0, 1.0, 1.0)\", \"assert normalize_rgba(255, 255, 255, 255) == (1.0, 1.0, 1.0, 1.0... | {
"split": "train",
"index": 1369,
"acecode_id": "bigcode_python_fns_49926",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a tensor represented as a list of numbers and a bias value, implement a function `apply_bias(tensor: List[float], bias: float, data_format: str) -> List[float]` that applies the bias to each element of the tensor. The bias should be multiplied with each element of the ten... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert apply_bias([1.0, 2.0, 3.0], 2.0, 'NHWC') == [2.0, 4.0, 6.0]\", \"assert apply_bias([1.5, 2.5, 3.5], 0.5, 'NCHW') == [0.75, 1.25, 1.75]\", \"assert apply_bias([0.0, 0.0, 0.0], 3.0, 'NHWC') == [0.0, 0.0, 0.0]\", \"assert apply_bias([-1.0, -2.0, -3.0], 1.0, 'NC... | {
"split": "train",
"index": 1370,
"acecode_id": "bigcode_python_fns_12317",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Construct a function that checks for the existence of a distinct element within a nested collection (which can include lists, tuples, sets, and dictionaries) and calculates various statistics about its occurrences. The function should return a tuple consisting of: 1) a boolean ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_element([], 1) == (False, 0, 0, 0)\", \"assert count_element([1, 2, 3], 2) == (True, 1, 1, 1)\", \"assert count_element([1, 2, [3, 4, 2]], 2) == (True, 2, 2, 1)\", \"assert count_element([1, {2, 3}, (4, 5, 2)], 2) == (True, 2, 2, 1)\", \"assert count_e... | {
"split": "train",
"index": 1371,
"acecode_id": "evol_2716",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given two lists of 2D coordinates, determine if they have the same set of coordinates regardless of the order. Each coordinate is represented as a tuple of two integers (x, y). Write a function `are_coordinates_identical(coords1: List[Tuple[int, int]], coords2: List[Tuple[int, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert are_coordinates_identical([(1, 2), (3, 4)], [(3, 4), (1, 2)]) == True\", \"assert are_coordinates_identical([(1, 2), (3, 4)], [(3, 5), (1, 2)]) == False\", \"assert are_coordinates_identical([(0, 0), (1, 1)], [(1, 1), (0, 0)]) == True\", \"assert are_coordin... | {
"split": "train",
"index": 1372,
"acecode_id": "bigcode_python_fns_32395",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates setting up a component for a home automation system. The function should take a configuration dictionary as input and return a boolean value indicating whether the setup was successful or not. The configuration dictionary c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert setup_component({'key': 'value'}) == True\", \"assert setup_component({'name': 'light', 'status': 'on'}) == True\", \"assert setup_component({'sensor': 'temperature'}) == True\", \"assert setup_component({'device': 'thermostat', 'model': 'T1000'}) == True\",... | {
"split": "train",
"index": 1373,
"acecode_id": "bigcode_python_fns_11952",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function to sort an array of integers and characters in ascending order using Selection Sort. The sorting should consider the following rules: numerical characters (e.g., '1', '2') are treated as less than alphabetical characters (e.g., 'a', 'b'), and characters ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert SelectionSort(['x', 'y', 'z', 1, 2, 3]) == [1, 2, 3, 'x', 'y', 'z']\", \"assert SelectionSort(['1', '0', '2', 'a']) == ['0', '1', '2', 'a']\", \"assert SelectionSort([]) == []\", \"assert SelectionSort(['a', 'A', 'b', 'B']) == ['A', 'B', 'a', 'b']\", \"asser... | {
"split": "train",
"index": 1374,
"acecode_id": "evol_22920",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves the HTTP proxy settings from a configuration. The function should return the host and port of the HTTP proxy. The host is represented as a string and the port as an integer. Implement a function `get_http_proxy()` that retu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_http_proxy() == ('proxy.example.com', 8080)\", \"assert isinstance(get_http_proxy()[0], str)\", \"assert isinstance(get_http_proxy()[1], int)\", \"assert get_http_proxy()[0] == 'proxy.example.com'\", \"assert get_http_proxy()[1] == 8080\", \"assert len(g... | {
"split": "train",
"index": 1375,
"acecode_id": "bigcode_python_fns_18854",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two arrays, arr1 and arr2, determine if arr2 is a reversed version of arr1. Implement a function that takes in two arrays and returns True if arr2 is the reverse of arr1, and False otherwise.\nPlease reason step by step, then write a self-contained Python solution. Give y... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_mirror([1, 2, 3], [3, 2, 1]) == True\", \"assert is_mirror([4, 5, 6], [6, 5, 4]) == True\", \"assert is_mirror([7, 8], [8, 7]) == True\", \"assert is_mirror([10], [10]) == True\", \"assert is_mirror([], []) == True\", \"assert is_mirror([1, 2], [2, 1]) ==... | {
"split": "train",
"index": 1376,
"acecode_id": "evol_18187",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the probability of a geometric distribution. Given the number of trials `n` and the probability of success `p`, implement a function `geometric_probability(n: int, p: float) -> float` that calculates the probability of the first success occurring... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert geometric_probability(1, 0.5) == 0.5\", \"assert geometric_probability(2, 0.5) == 0.25\", \"assert geometric_probability(3, 0.5) == 0.125\", \"assert geometric_probability(4, 0.5) == 0.0625\", \"assert geometric_probability(1, 0.0) == 0.0\", \"assert geometr... | {
"split": "train",
"index": 1377,
"acecode_id": "bigcode_python_fns_43156",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function `describe_animal(input_string: str) -> str` that takes a string as input and returns a description based on the following criteria: If the input string is 'Felis catus', return 'This is a scientific name for a domestic cat'. If the input string is 'Canis lu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert describe_animal('Felis catus') == 'This is a scientific name for a domestic cat'\", \"assert describe_animal('Canis lupus') == 'This is a scientific name for a gray wolf'\", \"assert describe_animal('Equus caballus') == 'This is a scientific name for a horse... | {
"split": "train",
"index": 1378,
"acecode_id": "evol_13875",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that serializes an 'Article' instance for a custom indexing system. The 'Article' model has the following fields: 'title', 'author', 'content', and 'published_date'. Your function should take an instance of 'Article' and return a dictiona... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert serialize_article(Article(title='Hello World', author='John Doe', content='This is a test article.', published_date='2023-10-01')) == {'title': 'Hello World', 'author': 'John Doe', 'content': 'This is a test article.', 'published_date': '2023-10-01'}\", \"as... | {
"split": "train",
"index": 1379,
"acecode_id": "oss_18350",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a string as input and alternates the casing of each alphabetic character, starting with uppercase for the first alphabetic character. Non-alphabetic characters should remain unchanged and should not affect the casing of subsequent alphabetic characte... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert alternate_case('Python Programming') == 'PyThOn PrOgRaMmInG'\", \"assert alternate_case('aBcDeFg') == 'AbCdEfG'\", \"assert alternate_case('') == ''\", \"assert alternate_case('1234!@#$') == '1234!@#$'\", \"assert alternate_case('abcdef') == 'AbCdEf'\", \"as... | {
"split": "train",
"index": 1380,
"acecode_id": "evol_17924",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function called `decode_text`. The function takes a string `text` representing a sequence of characters and an integer `threshold` (default value is 10). Your task is to perform the following operations:\n\n1. Count the frequency of each chara... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decode_text('aabbcc', 3) == 'aabbcc'\", \"assert decode_text('a' * 11, 10) == ''\", \"assert decode_text('aabbccdd', 1) == ''\", \"assert decode_text('abcde', 5) == 'abcde'\", \"assert decode_text('abccba', 2) == 'abccba'\", \"assert decode_text('!@#$%^&*()'... | {
"split": "train",
"index": 1381,
"acecode_id": "bigcode_python_fns_9606",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing user roles within groups. Each key in the dictionary is a group name, and the value is a list of tuples, where each tuple contains a group name and a user's name. Your task is to implement a function that takes this dictionary and a speci... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_users_with_roles({'group': [('group', 'user'), ('group', 'user2'), ('group', 'user3')]}, 'group') == ['user', 'user2', 'user3']\", \"assert get_users_with_roles({'group': [('group', 'user')], 'admin': [('admin', 'admin_user')]}, 'admin') == ['admin_user'... | {
"split": "train",
"index": 1382,
"acecode_id": "bigcode_python_fns_27380",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that validates file formats for a web application. The function should take a list of allowed file formats and a file format to validate as input. If the file format is not in the allowed list, the function should raise a `ValidationE... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_file_format(['jpg', 'png', 'gif'], 'jpg') is None\", \"assert validate_file_format(['jpg', 'png', 'gif'], 'png') is None\", \"assert validate_file_format(['jpg', 'png', 'gif'], 'gif') is None\", \"assert validate_file_format(['txt', 'csv'], 'txt') i... | {
"split": "train",
"index": 1383,
"acecode_id": "oss_52",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Write a function `count_primes(num: int) -> int` that takes an integer `num` and returns the number of prime numbers less than `num`. A prime number is a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. For example, the first few p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_primes(0) == 0\", \"assert count_primes(1) == 0\", \"assert count_primes(2) == 0\", \"assert count_primes(3) == 1\", \"assert count_primes(4) == 2\", \"assert count_primes(10) == 4\", \"assert count_primes(20) == 8\", \"assert count_primes(50) == 15\",... | {
"split": "train",
"index": 1384,
"acecode_id": "evol_16215",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `initialize_data_processor` that takes several parameters and returns a dictionary representing the attributes of a data processing module. The function should initialize the dictionary with the following attributes: `dir_data`, `split`, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_data_processor() == {'dir_data': 'data/vqa2', 'split': 'train', 'batch_size': 10, 'nb_threads': 4, 'pin_memory': False, 'shuffle': False, 'nans': 1000, 'minwcount': 10}\", \"assert initialize_data_processor(split='test') == {'dir_data': 'data/vqa2... | {
"split": "train",
"index": 1385,
"acecode_id": "oss_25142",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of sets, implement a function `find_connected_components(unmerged: List[Set[str]]) -> List[List[str]]` that returns a list of connected components. Two sets are considered connected if they share at least one element. Each connected component should be returned as ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_connected_components([{'a','b'}, {'a','c'}, {'d'}]) == [['a', 'b', 'c'], ['d']]\", \"assert find_connected_components([{'x'}, {'y'}, {'z'}]) == [['x'], ['y'], ['z']]\", \"assert find_connected_components([{'a'}, {'a', 'b'}, {'b', 'c'}, {'d'}]) == [['a',... | {
"split": "train",
"index": 1386,
"acecode_id": "bigcode_python_fns_13540",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that generates a unique code name for a user based on their input name. The code name should be created by replacing any spaces in the input name with hyphens and converting the entire name to lowercase. Your task is to implement t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_code_name('John Doe') == 'john-doe'\", \"assert generate_code_name('Alice Smith') == 'alice-smith'\", \"assert generate_code_name('Hello World') == 'hello-world'\", \"assert generate_code_name('Multiple Spaces') == 'multiple---spaces'\", \"assert ... | {
"split": "train",
"index": 1387,
"acecode_id": "oss_30954",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a message passing algorithm for a factor graph. In this algorithm, a message is passed from one node to another. Each node has certain attributes that represent its state. Specifically, the `from_node` has a boolean attribute `passed`, which ind... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert (a:=type('Node', (object,), {'passed': False})) is not None\", \"assert (b:=type('Node', (object,), {'incoming_messages_number': 0})) is not None\", \"assert b.incoming_messages_number == 1\", \"assert (x:=type('Node', (object,), {'passed': False})) is not N... | {
"split": "train",
"index": 1388,
"acecode_id": "oss_15356",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that finds the latest episode release from a given list of episodes based on specified criteria. Each episode has a season number, an episode number, a release date, and a downloaded status. Your function should take in a list of episodes ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_latest_episode([{'season': 1, 'number': 1, 'release_date': '2021-01-01', 'downloaded': True}, {'season': 1, 'number': 2, 'release_date': '2021-01-02', 'downloaded': True}], season=1, downloaded=True) == {'season': 1, 'number': 2, 'release_date': '2021-0... | {
"split": "train",
"index": 1389,
"acecode_id": "bigcode_python_fns_20295",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that takes a list of schema names (strings) and returns a list of unique schema names sorted in alphabetical order. Write a function `get_unique_sorted_schemas(schemas: List[str]) -> List[str]` that implements this functionality. The input... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_sorted_schemas(['schema1', 'schema2', 'schema1']) == ['schema1', 'schema2']\", \"assert get_unique_sorted_schemas(['b', 'a', 'c', 'b']) == ['a', 'b', 'c']\", \"assert get_unique_sorted_schemas(['a', 'A', 'b', 'B', 'c', 'C']) == ['A', 'B', 'C', 'a'... | {
"split": "train",
"index": 1390,
"acecode_id": "bigcode_python_fns_1509",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `is_user_connected(user_id: int, clients: List[int]) -> bool` that determines if a given user is connected to a list of clients. The function should return `True` if the `user_id` is present in the `clients` list, and `False` otherwise. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_user_connected(5, [1, 2, 3, 4, 5]) == True\", \"assert is_user_connected(10, [1, 2, 3, 4, 5]) == False\", \"assert is_user_connected(3, [3, 4, 5]) == True\", \"assert is_user_connected(1, []) == False\", \"assert is_user_connected(0, [0, 1, 2]) == True\",... | {
"split": "train",
"index": 1391,
"acecode_id": "bigcode_python_fns_24190",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the total encoded size of a given data type based on its specifications. The types can either be primitive types (like 'int', 'float', 'string') with predefined sizes or complex types defined within packages. Each pack... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_encoded_len_value('int', [{'definitions': [{'identifier': 'int', 'fields': []}]}]) == PRIMITIVE_SIZES['int']\", \"assert get_encoded_len_value('string', [{'definitions': [{'identifier': 'string', 'fields': []}]}]) == PRIMITIVE_SIZES['string']\", \"assert... | {
"split": "train",
"index": 1392,
"acecode_id": "bigcode_python_fns_40842",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Implement a function that computes the highest common factor (HCF) of two integers using recursion. Do not use any built-in functions. The function should take two integers as parameters and return their HCF.\nPlease reason step by step, then write a self-contained Python solut... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_HCF(48, 18) == 6\", \"assert compute_HCF(101, 10) == 1\", \"assert compute_HCF(27, 36) == 9\", \"assert compute_HCF(100, 75) == 25\", \"assert compute_HCF(14, 28) == 14\", \"assert compute_HCF(0, 5) == 5\", \"assert compute_HCF(5, 0) == 5\", \"assert... | {
"split": "train",
"index": 1393,
"acecode_id": "evol_26412",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, where each string may contain numeric values mixed with special characters (e.g., '$', '%', '€', etc.). Write a function `clean_numeric_strings(strings: List[str]) -> List[float]` that removes all special characters from each string and converts... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert clean_numeric_strings(['$100.50', '200%', '300.00\\u20ac', 'not_a_number']) == [100.5, 200.0, 300.0]\", \"assert clean_numeric_strings(['$-50.20', '100$']) == [-50.2, 100.0]\", \"assert clean_numeric_strings(['\\u20ac0.99', '$1.00', '%2.00']) == [0.99, 1.0, ... | {
"split": "train",
"index": 1394,
"acecode_id": "bigcode_python_fns_11872",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers, implement a function `list_intersection(l1: list, l2: list) -> list` that identifies their intersection without using inherent list functions. You should build a binary search tree to find common elements and return them in an ascending, deduplicate... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert list_intersection([], []) == []\", \"assert list_intersection([], [1, 2, 3]) == []\", \"assert list_intersection([1, 2, 3], []) == []\", \"assert list_intersection([1], [1]) == [1]\", \"assert list_intersection([5, 5, 5], [5, 5, 5]) == [5]\", \"assert list_i... | {
"split": "train",
"index": 1395,
"acecode_id": "evol_26565",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `classify_numbers` that classifies each number as 'odd' or 'even'. The function should return a dictionary where the keys are the numbers from the list and the values are their corresponding classifications ('odd' or 'even').\nPlease r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert classify_numbers([1, 2, 3, 4]) == {1: 'odd', 2: 'even', 3: 'odd', 4: 'even'}\", \"assert classify_numbers([0, 1, 2, 3, 4]) == {0: 'even', 1: 'odd', 2: 'even', 3: 'odd', 4: 'even'}\", \"assert classify_numbers([-1, -2, -3, -4]) == {-1: 'odd', -2: 'even', -3: ... | {
"split": "train",
"index": 1396,
"acecode_id": "evol_19561",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that calculates the age of a person given their exact date of birth (day, month, year), considering leap years and age down-to-the-minute precision. The function should take two strings in the format 'YYYY-MM-DD HH:MM:SS': one for the date of birth and another ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_age('2000-01-01 12:00:00', '2023-10-01 12:00:00') == 'Years: 23, Months: 9, Days: 0, Hours: 0, Minutes: 0, Seconds: 0'\", \"assert calculate_age('2010-11-01 00:00:00', '2023-10-31 23:59:59') == 'Years: 12, Months: 11, Days: 30, Hours: 23, Minutes: ... | {
"split": "train",
"index": 1397,
"acecode_id": "evol_27260",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the total score of an assessment part based on the scores of its questions. Each question has a score that can be retrieved using a method called `get_score`. Your function should take a list of question objects as inp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_score([]) == 0\", \"assert calculate_total_score([QuestionMock(1), QuestionMock(2)]) == 3\", \"assert calculate_total_score([QuestionMock(5), QuestionMock(5), QuestionMock(5)]) == 15\", \"assert calculate_total_score([QuestionMock(0), Questio... | {
"split": "train",
"index": 1398,
"acecode_id": "oss_7615",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of user objects, each represented as a dictionary containing 'id', 'domain', and 'active' status, write a function that retrieves all user IDs for a specified domain, regardless of whether the user is active or inactive. The function should be defined as `def get_u... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_user_ids_by_domain([{'id': 'user1', 'domain': 'example.com', 'active': True}, {'id': 'user2', 'domain': 'example.com', 'active': False}], 'example.com') == ['user1', 'user2']\", \"assert get_user_ids_by_domain([{'id': 'user3', 'domain': 'example.com', 'a... | {
"split": "train",
"index": 1399,
"acecode_id": "bigcode_python_fns_48602",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.