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 need to create a function that simulates the process of filtering files based on their names and a specified date range. The function should accept a list of file names, a start date, an end date, and an optional file extension. Each file name contains a date in the format ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_files_by_date(['20210101_file.txt', '20210102_file.txt', '20210103_file.hdf5'], '20210101', '20210102') == ['20210101_file.txt', '20210102_file.txt']\", \"assert filter_files_by_date(['20220101_file.txt', '20220102_file.txt', '20220103_file.txt'], '20... | {
"split": "train",
"index": 74900,
"acecode_id": "bigcode_python_fns_15114",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes an integer `target_id` representing a user plugin toggle and disables it by setting its `enabled` attribute to `False`. Your function should return a string indicating whether the operation was successful or if the toggle w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert disable_user_plugin_toggle(1) == 'Toggle disabled successfully.'\", \"assert disable_user_plugin_toggle(2) == 'Toggle disabled successfully.'\", \"assert disable_user_plugin_toggle(5) == 'Toggle not found.'\", \"assert disable_user_plugin_toggle(7) == 'Toggl... | {
"split": "train",
"index": 74901,
"acecode_id": "oss_27770",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_element_present(arr: List[int], target: int) -> bool` that checks if a specific integer `target` exists within a given list of integers `arr`. The function should return `True` if the `target` is found in the list, and `False` otherwise.\nPlease reason ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_element_present([4, 1, 6, 9, 8], 8) == True\", \"assert is_element_present([4, 1, 6, 9, 8], 1) == True\", \"assert is_element_present([4, 1, 6, 9, 8], 6) == True\", \"assert is_element_present([4, 1, 6, 9, 8], 9) == True\", \"assert is_element_present([4,... | {
"split": "train",
"index": 74902,
"acecode_id": "evol_29305",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function to generate a 3D array of size l x m x n, where l represents the depth dimension, m and n represent the spatial dimensions. Fill the array with prime numbers from 1 to l*m*n in a zig-zag pattern. For each layer of the depth dimension, fill the numbers in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_3d_array(1, 1, 1) == [[[2]]]\", \"assert generate_3d_array(2, 1, 1) == [[[2]], [[3]]]\", \"assert generate_3d_array(1, 2, 1) == [[[2], [3]]]\", \"assert generate_3d_array(2, 2, 1) == [[[2], [3]], [[5], [7]]]\", \"assert generate_3d_array(1, 2, 2) ==... | {
"split": "train",
"index": 74903,
"acecode_id": "evol_18925",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a list of objects and a corresponding list of image paths, write a function that assigns an image sprite to each object based on its index in the list. The function should take two parameters: a list of objects `obj_list` and a list of strings `paths`, where each string r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert load_sprites(['obj1', 'obj2'], ['path1', 'path2']) == [('obj1', 'path1'), ('obj2', 'path2')]\", \"assert load_sprites(['item1', 'item2', 'item3'], ['img1', 'img2']) == []\", \"assert load_sprites([], []) == []\", \"assert load_sprites(['a'], ['b']) == [('a',... | {
"split": "train",
"index": 74904,
"acecode_id": "bigcode_python_fns_29969",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given parameters to define a masked 1-dimensional convolution layer. Your task is to implement a function that takes the following parameters and returns a dictionary representing the configuration of the convolution layer. The parameters are: `in_channels` (int): the n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_conv_layer(1, 1) == {'in_channels': 1, 'out_channels': 1, 'strides': 1, 'groups': 1, 'use_bias': False, 'data_format': 'channels_last'}\", \"assert create_conv_layer(2, 3) == {'in_channels': 2, 'out_channels': 3, 'strides': 1, 'groups': 1, 'use_bias':... | {
"split": "train",
"index": 74905,
"acecode_id": "bigcode_python_fns_22125",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of key-value pairs and a selector function. The function should apply the selector function to each key-value pair and return the results as a list, while maintaining the order of the keys as they were inserted. The sele... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert apply_selector([('a', 1), ('b', 2)], lambda k, v: k + str(v)) == ['a1', 'b2']\", \"assert apply_selector([('a', 1), ('b', 2), ('a', 3)], lambda k, v: (k, v)) == [('a', 1), ('b', 2)]\", \"assert apply_selector([], lambda k, v: k + str(v)) == []\", \"assert ap... | {
"split": "train",
"index": 74906,
"acecode_id": "oss_24575",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a retry mechanism for adding a user's information to a database. Your function should take the following parameters: - `user_id`: A string representing the ID of the user. - `user_info`: A string containing the user's information. - `max_attempt... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_user_info_to_db('user123', 'info123', 1) == 'Success: User info added for user user123'\", \"assert add_user_info_to_db('user789', 'info789', 2) == 'Success: User info added for user user789'\", \"assert add_user_info_to_db('user005', 'info005', 3) == 'S... | {
"split": "train",
"index": 74907,
"acecode_id": "oss_23713",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes command-line arguments to determine whether a specific exclusion flag has been provided. The function should accept a list of strings representing command-line arguments. If the exclusion flag (represented as the string 'EX... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_exclusion_value(['EXCLUDE', 'test_value']) == 'test_value'\", \"assert get_exclusion_value(['EXCLUDE']) == 'DEFAULT_EXCLUDE'\", \"assert get_exclusion_value(['random_arg', 'EXCLUDE', 'another_value']) == 'another_value'\", \"assert get_exclusion_value(['... | {
"split": "train",
"index": 74908,
"acecode_id": "bigcode_python_fns_41026",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a mock functionality for a payment processing system. Your function `mock_payment_processor` should take a `payment_system` object and a `method_name` string as parameters. The function will replace the specified method of the payment system object ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert mock_payment_processor(payment_system, 'process_payment').process_payment() == 'mocked_response'\", \"assert mock_payment_processor(payment_system, 'refund_payment').refund_payment() == 'mocked_response'\", \"assert mock_payment_processor(payment_system, 'ge... | {
"split": "train",
"index": 74909,
"acecode_id": "bigcode_python_fns_3682",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string that represents file metadata in JSON format. Your task is to implement a function called `get_file_extension(metadata: str) -> str` that extracts the file extension from the metadata. The function should parse the input string as JSON and return the valu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_file_extension('{\\\"ext\\\": \\\"txt\\\"}') == 'txt'\", \"assert get_file_extension('{\\\"ext\\\": \\\"jpg\\\"}') == 'jpg'\", \"assert get_file_extension('{\\\"name\\\": \\\"image\\\"}') == ''\", \"assert get_file_extension('{\\\"ext\\\": \\\"pdf\\\"}')... | {
"split": "train",
"index": 74910,
"acecode_id": "oss_29805",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings where each string represents a sentence containing various tags in square brackets. Your task is to remove all tags from each sentence. A tag is defined as any sequence of characters that appears inside square brackets. For example, the string 'H... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_tags(['Hello [world]', 'This is a [test] sentence.', 'No tags here!']) == ['Hello ', 'This is a sentence.', 'No tags here!']\", \"assert remove_tags(['[tag1]sample [tag2]text', '[tag3]another [tag4]example']) == ['sample text', 'another example']\", ... | {
"split": "train",
"index": 74911,
"acecode_id": "bigcode_python_fns_7259",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a function that simulates a retry mechanism, implement a function `retry_operation` that takes two parameters: a callable function `operation` and an integer `max_retries`. The function should attempt to execute `operation` up to `max_retries` times. If `operation` raises... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert retry_operation(lambda: 1/0, 3) is None\", \"assert retry_operation(lambda: 1, 3) == 1\", \"assert retry_operation(lambda: 2, 1) == 2\", \"assert retry_operation(lambda: 1/0, 0) is None\", \"assert retry_operation(lambda: 1/0, 5) is None\", \"assert retry_op... | {
"split": "train",
"index": 74912,
"acecode_id": "bigcode_python_fns_40869",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `merge_and_sort_sets(set1, set2)` that takes two distinct sets as input and merges them into one set without any recurring elements. After merging, the function should return a sorted list of the merged set. If either input is None or not a set, the function sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_and_sort_sets({1, 2, 3}, {3, 4, 5}) == [1, 2, 3, 4, 5]\", \"assert merge_and_sort_sets({10, 20}, {30, 40}) == [10, 20, 30, 40]\", \"assert merge_and_sort_sets({1}, {2}) == [1, 2]\", \"assert merge_and_sort_sets({5, 10}, {10, 15}) == [5, 10, 15]\", \"as... | {
"split": "train",
"index": 74913,
"acecode_id": "evol_28726",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function `is_perfect_square(n: int) -> bool` that determines if a given integer n is a perfect square. A perfect square is an integer that is the square of an integer. The function should return True if n is a perfect square, and False otherwise. If n is negative... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_perfect_square(0) == True\", \"assert is_perfect_square(1) == True\", \"assert is_perfect_square(4) == True\", \"assert is_perfect_square(9) == True\", \"assert is_perfect_square(16) == True\", \"assert is_perfect_square(25) == True\", \"assert is_perfect... | {
"split": "train",
"index": 74914,
"acecode_id": "evol_12655",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are playing a Flip Game with your friend. You are given a string `currentState` that contains only '+' and '-'. You and your friend take turns to flip two consecutive '++' into '--'. The game ends when a person can no longer make a move, and the other person is declared the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert canWin('++--') == (True, 1)\", \"assert canWin('+-+-') == (False, 0)\", \"assert canWin('++') == (True, 1)\", \"assert canWin('+-') == (False, 0)\", \"assert canWin('----') == (False, 0)\", \"assert canWin('+++') == (True, 1)\", \"assert canWin('++-+') == (T... | {
"split": "train",
"index": 74915,
"acecode_id": "evol_3913",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing the status of submissions, where each submission can have a status code as follows: 0 for 'pending-upload', 1 for 'uploaded', and 2 for 'error', implement a function `process_submissions(status_list: List[int]) -> List[str]` that processes ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_submissions([0, 1, 2]) == ['Processing submission', 'Submission processed successfully', 'Error processing submission']\", \"assert process_submissions([0, 0, 1, 2]) == ['Processing submission', 'Processing submission', 'Submission processed successf... | {
"split": "train",
"index": 74916,
"acecode_id": "bigcode_python_fns_22525",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a user is authorized based on their session data. The function should accept a dictionary representing the session and determine if the user is authorized by verifying if the key 'uid' is present. If the user is authorized ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_authorization({'uid': 'user123'}) == 'user123'\", \"assert check_authorization({'uid': 'admin'}) == 'admin'\", \"assert check_authorization({}) == None\", \"assert check_authorization({'name': 'John', 'age': 30}) == None\", \"assert check_authorization... | {
"split": "train",
"index": 74917,
"acecode_id": "oss_31421",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `sum_of_even_numbers(arr)` that returns the sum of all even numbers in the list. If there are no even numbers, return 0. The function should handle an empty list and should work with negative numbers as well. The input list can contain... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_even_numbers([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_even_numbers([10, 15, 20, 25]) == 30\", \"assert sum_of_even_numbers([0, -2, -4, -6]) == -12\", \"assert sum_of_even_numbers([-1, -3, -5]) == 0\", \"assert sum_of_even_numbers([]) == 0\", \"assert ... | {
"split": "train",
"index": 74918,
"acecode_id": "bigcode_python_fns_13093",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `open_browser(page: str, browser: str = None, force: bool = False) -> str` that simulates opening a web browser to a specified page. The function should follow these rules: If `force` is False and the page is not specified (None), rai... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert open_browser('http://example.com') == 'Opening browser system default for http://example.com'\", \"assert open_browser('http://example.com', 'chrome') == 'Opening browser chrome for http://example.com'\", \"assert open_browser('http://example.com', force=Tru... | {
"split": "train",
"index": 74919,
"acecode_id": "bigcode_python_fns_7564",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a date in ISO 8601 format (e.g., '2023-10-05T14:48:00'), write a function that converts this date into a specified format. If no format is provided, convert the date to the default format 'dd-mm-yyyy'. The function should take two parameters: a date ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_datetime('2023-10-05T14:48:00') == '05-10-2023'\", \"assert format_datetime('2023-10-05T14:48:00', '%Y/%m/%d') == '2023/10/05'\", \"assert format_datetime('2023-01-01T00:00:00') == '01-01-2023'\", \"assert format_datetime('2022-12-31T23:59:59') == '31... | {
"split": "train",
"index": 74920,
"acecode_id": "bigcode_python_fns_7788",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given the coordinates of two points (x1, y1) and (x2, y2) on a 2D plane, determine if the distance between these two points is less than or equal to a specified scale. Implement a function `is_within_distance(x1: int, y1: int, x2: int, y2: int, scale: float) -> bool` that retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_within_distance(0, 0, 3, 4, 5.0) == True\", \"assert is_within_distance(1, 1, 1, 1, 0.0) == True\", \"assert is_within_distance(0, 0, 6, 8, 10.0) == True\", \"assert is_within_distance(2, 3, 5, 7, 3.0) == False\", \"assert is_within_distance(-1, -1, 1, 1,... | {
"split": "train",
"index": 74921,
"acecode_id": "bigcode_python_fns_8425",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that calculates the average value of a list of numeric attribute values. The function should take in a list of floats representing the attribute values and return the average value of those attributes. The input list will alway... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_attribute_value([1.0, 2.0, 3.0]) == 2.0\", \"assert average_attribute_value([10.0, 20.0, 30.0]) == 20.0\", \"assert average_attribute_value([5.5, 6.5, 7.5]) == 6.5\", \"assert average_attribute_value([100.0]) == 100.0\", \"assert average_attribute_va... | {
"split": "train",
"index": 74922,
"acecode_id": "oss_126",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to merge two sets of publishers for a book distribution system. Each publisher has a name, and you need to return a sorted list of unique publisher names after merging the two sets. Write a function `merge_and_sort_publishers` that ta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_and_sort_publishers({Publisher('Publisher A'), Publisher('Publisher B')}, {Publisher('Publisher C'), Publisher('Publisher D')}) == ['Publisher A', 'Publisher B', 'Publisher C', 'Publisher D']\", \"assert merge_and_sort_publishers({Publisher('Publisher ... | {
"split": "train",
"index": 74923,
"acecode_id": "oss_1606",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a configuration list and returns a dictionary containing the count of each unique element in the list. The configuration list consists of various data types such as integers, strings, and tuples. Your task is to create ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_config([1, 1, 1]) == {1: 3}\", \"assert process_config(['test', 'test', 'example']) == {'test': 2, 'example': 1}\", \"assert process_config([]) == {}\", \"assert process_config([1, 2, 3, 4, 5]) == {1: 1, 2: 1, 3: 1, 4: 1, 5: 1}\", \"assert process_co... | {
"split": "train",
"index": 74924,
"acecode_id": "oss_19352",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple function that simulates saving and loading user data. Implement a function `save_user_data(username: str, birth: str, year: int) -> dict` that takes a username, birth date in the format 'YYYY-MM-DD', and year of birth as input. The function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert save_user_data('limodou', '2011-03-04', 2012) == {'username': 'limodou', 'birth': '2011-03-04', 'year': 2012}\", \"assert load_user_data({'username': 'limodou', 'birth': '2011-03-04', 'year': 2012}) == ('2011-03-04', 2012)\", \"assert save_user_data('john_do... | {
"split": "train",
"index": 74925,
"acecode_id": "bigcode_python_fns_35828",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simplified order processing system for an e-commerce platform. Your task is to create a function `process_order_authorization` that takes two parameters: `order_id` (a string representing the order ID), `total_amount` (a float representing the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_order_authorization('12345', 100.0, 'req_1') == True\", \"assert process_order_authorization('12346', 150.0, 'req_2') == True\", \"assert process_order_authorization('12348', 99.99, 'req_4') == False\", \"assert process_order_authorization('12350', 2... | {
"split": "train",
"index": 74926,
"acecode_id": "oss_5547",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates a welcome message in JSON format. The function should take no parameters and return a JSON object containing a single key-value pair. The key should be 'message' and the value should be 'Welcome to the Morepath web appl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_welcome_message() == {'message': 'Welcome to the Morepath web application!'}\", \"assert generate_welcome_message() == {'message': 'Welcome to the Morepath web application!'}\", \"assert generate_welcome_message() == {'message': 'Welcome to the More... | {
"split": "train",
"index": 74927,
"acecode_id": "oss_20821",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that checks if a list of numbers is monotonically non-decreasing or non-increasing. The function should handle integers, floating-point numbers, and negative numbers. If the second parameter 'strict' is set to True, the function should ensure that the eleme... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert monotonic([1, 2, 3, 4, 5]) == True\", \"assert monotonic([5, 4, 3, 2, 1]) == True\", \"assert monotonic([1, 2, 2, 3, 4], strict=False) == True\", \"assert monotonic([4, 3, 3, 2, 1], strict=False) == True\", \"assert monotonic([1, 1, 1, 1], strict=False) == T... | {
"split": "train",
"index": 74928,
"acecode_id": "evol_13748",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a dataset of integers and calculates the rate of occurrence of the number 1 within the dataset. Additionally, the function should return the dataset flipped in reverse order. The function signature is as follows: \n\n``... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_data([1, 2, 3, 4, 5, 1, 1, 2]) == (0.375, [2, 1, 1, 5, 4, 3, 2, 1])\", \"assert process_data([1, 1, 1, 1]) == (1.0, [1, 1, 1, 1])\", \"assert process_data([2, 2, 2, 2]) == (0.0, [2, 2, 2, 2])\", \"assert process_data([]) == (0.0, [])\", \"assert proc... | {
"split": "train",
"index": 74929,
"acecode_id": "oss_35403",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that performs a breadth-first traversal of a binary tree, returning the leaf nodes first followed by the intermediate nodes. The function should handle an empty tree gracefully. You may assume that the tree is represented using a TreeNode class, where each ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert BFS(None) == []\", \"assert BFS(TreeNode(1)) == [1]\", \"assert BFS(TreeNode(1, TreeNode(2), TreeNode(3))) == [2, 3, 1]\", \"assert BFS(TreeNode(1, TreeNode(2))) == [2, 1]\", \"assert BFS(TreeNode(1, None, TreeNode(3))) == [3, 1]\"]}"
} | {
"split": "train",
"index": 74930,
"acecode_id": "evol_14710",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing months (1 for January, 2 for February, ..., 12 for December), implement a function that returns a string indicating the corresponding season based on the input months. The seasons are defined as follows: DJF (December, January, February), M... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_season([1, 2, 12]) == 'DJF'\", \"assert get_season([3, 4, 5]) == 'MAM'\", \"assert get_season([6, 7, 8]) == 'JJA'\", \"assert get_season([9, 10, 11]) == 'SON'\", \"assert get_season([1, 3, 5]) == '1-3-5'\", \"assert get_season(None) == ''\", \"assert get... | {
"split": "train",
"index": 74931,
"acecode_id": "bigcode_python_fns_27744",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing answers for a quiz application. Implement a function that handles creating and updating answers based on the type of answer provided. The function should take a question object `q`, an answer object `a`, and an operation object `op`. The answer obje... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert handle_answer(Question('What is your favorite fruit?'), Answer(['Apple', 'Banana', 'Cherry']), Operation()) == None\", \"assert handle_answer(Question('What is your favorite book?'), Answer(['1984', 'Brave New World']), Operation()) == None\", \"assert handl... | {
"split": "train",
"index": 74932,
"acecode_id": "oss_37571",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the lengths of segments. Your task is to implement a function that calculates the maximum possible length of a single segment that can be formed by combining any number of segments from the list. You can combine segments in such a w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_combined_length([1, 2, 3, 4, 5]) == 15\", \"assert max_combined_length([0, 0, 0, 0]) == 0\", \"assert max_combined_length([-1, -2, -3]) == 0\", \"assert max_combined_length([1, 0, 2, 0, 3]) == 6\", \"assert max_combined_length([5, 5, 5]) == 15\", \"asser... | {
"split": "train",
"index": 74933,
"acecode_id": "bigcode_python_fns_43277",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two integer arrays A and B, implement a function `bool isSubset(int[], int[], int, int)` that checks if Array A is a subset of Array B. The function should take four arguments: two int arrays (Array A and Array B), the length of Array A, and the length of Array B. The fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isSubset([1, 2, 3], [1, 2, 3, 4, 5], 3, 5) == True\", \"assert isSubset([1, 2, 6], [1, 2, 3, 4, 5], 3, 5) == False\", \"assert isSubset([], [1, 2, 3], 0, 3) == True\", \"assert isSubset([1, 2, 3], [], 3, 0) == False\", \"assert isSubset([1, 1, 2], [1, 2, 3],... | {
"split": "train",
"index": 74934,
"acecode_id": "evol_34677",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates setting up an automation trigger for a smart home device. The function should take in three parameters: `device_id` (a string representing the unique identifier of the device), `trigger_type` (a string representing the type... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert setup_automation('device_1', 'motion', 'light') == {'trigger': {'platform': 'device', 'domain': 'light', 'device_id': 'device_1', 'type': 'motion'}, 'action': {'service': 'test.automation', 'data': 'automation triggered'}}\", \"assert setup_automation('devic... | {
"split": "train",
"index": 74935,
"acecode_id": "bigcode_python_fns_2037",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with developing a function that simulates the creation of a graphical window and setting its viewport dimensions. The function takes four parameters: `width`, `height`, `x`, and `y`. Implement the function `create_window_and_viewport(width: int, height: int, x: i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_window_and_viewport(800, 600, 0, 0) == 'Window created with dimensions 800x600. Viewport set to (0, 0) with dimensions 800x600.'\", \"assert create_window_and_viewport(1024, 768, 100, 100) == 'Window created with dimensions 1024x768. Viewport set to (... | {
"split": "train",
"index": 74936,
"acecode_id": "oss_27617",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an integer `total_memory_kb` representing the total memory of a virtual machine in kilobytes. You need to implement a function `calculate_test_size(total_memory_kb: int) -> int` that calculates the test size based on the following criteria: the test size should be... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_test_size(10000) == 1000\", \"assert calculate_test_size(100000) == 10000\", \"assert calculate_test_size(1000000) == 100000\", \"assert calculate_test_size(10000000) == 1000000\", \"assert calculate_test_size(9999999) == 999999\", \"assert calcula... | {
"split": "train",
"index": 74937,
"acecode_id": "bigcode_python_fns_32609",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a system for managing a university department where you can perform various operations on faculty members and students. Each faculty member has a name, age, gender, academic discipline, years of experience, a list of courses taught, and a list of research publications. E... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_department_operations([], [], []) == ([], [])\", \"assert manage_department_operations([], [], [('add_faculty', 'John Doe', 40, 'Male', 'Computer Science', 10, [], [])]) == ([{'name': 'John Doe', 'age': 40, 'gender': 'Male', 'discipline': 'Computer Sc... | {
"split": "train",
"index": 74938,
"acecode_id": "evol_1757",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a list of bounding box coordinates in the format (x1, y1, x2, y2), where (x1, y1) represents the top-left corner and (x2, y2) represents the bottom-right corner of the bounding box, write a function that converts these coordinates into the format (cx, cy, w, h). Here, 'cx... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_bboxes([(0, 0, 2, 2)]) == [(1.0, 1.0, 2.0, 2.0)]\", \"assert convert_bboxes([(1, 1, 3, 3)]) == [(2.0, 2.0, 2.0, 2.0)]\", \"assert convert_bboxes([(0, 0, 4, 4)]) == [(2.0, 2.0, 4.0, 4.0)]\", \"assert convert_bboxes([(0, 0, 1, 1), (1, 1, 3, 4)]) == [(0... | {
"split": "train",
"index": 74939,
"acecode_id": "bigcode_python_fns_47237",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two integers x and y, write a function that calculates the percentage of x with respect to y. The percentage is defined as (x / y) * 100. Your function should return the percentage as a float rounded to two decimal places. If y is zero, return 'undefined' as the percentag... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_percentage(50, 100) == 50.00\", \"assert calculate_percentage(0, 100) == 0.00\", \"assert calculate_percentage(25, 200) == 12.50\", \"assert calculate_percentage(75, 300) == 25.00\", \"assert calculate_percentage(99, 300) == 33.00\", \"assert calcu... | {
"split": "train",
"index": 74940,
"acecode_id": "bigcode_python_fns_17113",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a list of integers and returns the largest integer from that list. If the list is empty, return None.\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 find_max([3, 1, 6, 5, 7, 4]) == 7\", \"assert find_max([-1, -5, -3, -4, -2]) == -1\", \"assert find_max([10, 20, 30, 40, 50]) == 50\", \"assert find_max([0, 0, 0, 0]) == 0\", \"assert find_max([5]) == 5\", \"assert find_max([]) == None\", \"assert find_max([... | {
"split": "train",
"index": 74941,
"acecode_id": "evol_23903",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing words. Your task is to write a function that counts the frequency of each letter across all the words and returns the result as a dictionary. The function should take the list of words as input and return a dictionary where the keys ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_letter_frequencies(['dog', 'cat']) == {'d': 1, 'o': 1, 'g': 1, 'c': 1, 'a': 1, 't': 1}\", \"assert count_letter_frequencies(['hello', 'world']) == {'h': 1, 'e': 1, 'l': 3, 'o': 2, 'w': 1, 'r': 1, 'd': 1}\", \"assert count_letter_frequencies(['']) == {}... | {
"split": "train",
"index": 74942,
"acecode_id": "oss_5002",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Create a function called 'create_animal' that accepts two parameters: 'age' (an integer) and 'type' (a string). The function should return a dictionary representing an animal, where 'age' should be a positive integer and 'type' should contain only alphabetic characters. If the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_animal(2, 'Cat') == {'age': 2, 'type': 'Cat'}\", \"assert create_animal(5, 'Dog') == {'age': 5, 'type': 'Dog'}\", \"assert create_animal(10, 'Lion') == {'age': 10, 'type': 'Lion'}\", \"assert create_animal(1, 'Tiger') == {'age': 1, 'type': 'Tiger'}\",... | {
"split": "train",
"index": 74943,
"acecode_id": "evol_14970",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, write a function to find all duplicate prime numbers in the array. The function should return a list of duplicate prime numbers. If there are no duplicate prime numbers, return an empty list. You may assume that the input array will contain at least ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert duplicate_primes([1, 2, 3, 4, 2, 7, 5, 3, 11, 2]) == [2, 3]\", \"assert duplicate_primes([1, 4, 6, 8, 10]) == []\", \"assert duplicate_primes([2, 2, 3, 3, 5, 7]) == [2, 3]\", \"assert duplicate_primes([13, 11, 17, 13, 19]) == [13]\", \"assert duplicate_prime... | {
"split": "train",
"index": 74944,
"acecode_id": "evol_18274",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a function that takes in a name, a tuple path, and four numerical values (mean, sem, std, sestd), which may represent a statistical measure or may be None if absent. Your task is to implement a function that encodes these values into a list of strings. The string ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert encode_values('sample', ('a', 'b'), 1.0, None, 2.0, 3.0) == ['mean_sample_a_b = 1.0', 'std_sample_a_b = 2.0', 'sestd_sample_a_b = 3.0']\", \"assert encode_values('test', ('x', 'y'), None, None, None, None) == []\", \"assert encode_values('data', ('i', 'j'), ... | {
"split": "train",
"index": 74945,
"acecode_id": "bigcode_python_fns_43012",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of directory paths represented as strings. Each directory path is a string that may contain other directory names. Your task is to write a function `get_latest_directory(directories: List[str]) -> str` that returns the path of the latest directory alphabeti... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_latest_directory(['dir1', 'dir2', 'temp_dir', 'dir10']) == 'dir2'\", \"assert get_latest_directory(['temp', 'temp1', 'a', 'b', 'c']) == 'c'\", \"assert get_latest_directory(['temp', 'temp2', 'temp3']) == ''\", \"assert get_latest_directory(['folderA', 'f... | {
"split": "train",
"index": 74946,
"acecode_id": "bigcode_python_fns_3141",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string containing a serialized sequence of integers separated by semicolons, implement a function that identifies all the prime numbers from the sequence and returns them as a single string, with each prime number separated by a semicolon. For example, given the input s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_primes('11; 6; 13; 4; 7; 1; 9; 8; 15') == '11; 13; 7'\", \"assert find_primes('2; 3; 4; 5; 6; 7') == '2; 3; 5; 7'\", \"assert find_primes('10; 12; 14; 15; 16') == ''\", \"assert find_primes('17; 18; 19; 20; 21') == '17; 19'\", \"assert find_primes('22; ... | {
"split": "train",
"index": 74947,
"acecode_id": "evol_14186",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of non-negative integers, implement a function `optimalPluck(arr, cond_fn)` that selects the smallest node that fulfills a condition defined by the provided function `cond_fn`. If multiple nodes match the condition, select the one with the smallest index. If the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert optimalPluck([3, 5, 2, 4], lambda x: x % 2 == 0) == [2, 2]\", \"assert optimalPluck([1, 3, 5], lambda x: x % 2 == 0) == []\", \"assert optimalPluck([], lambda x: x > 0) == []\", \"assert optimalPluck([10, 20, 30], lambda x: x < 5) == []\", \"assert optimalPl... | {
"split": "train",
"index": 74948,
"acecode_id": "evol_16474",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a grid of buttons that can change colors when clicked. Create a function `change_button_color(current_color: str) -> str` that takes the current color of a button ('white' or 'blue') and returns the new color after a cl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert change_button_color('white') == 'blue'\", \"assert change_button_color('blue') == 'white'\", \"assert change_button_color('white') == 'blue'\", \"assert change_button_color('blue') == 'white'\", \"assert change_button_color('white') == 'blue'\", \"assert cha... | {
"split": "train",
"index": 74949,
"acecode_id": "evol_20667",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that calculates the sum of all even integers in a given list. The function should take a list of integers as input and return the sum of all the even integers present in that list. If there are no even integers, the function should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_even_numbers([1, 2, 3, 4, 5, 6]) == 12\", \"assert sum_even_numbers([10, 11, 12, 13, 14, 15]) == 36\", \"assert sum_even_numbers([2, 4, 6, 8, 10]) == 30\", \"assert sum_even_numbers([1, 3, 5, 7, 9]) == 0\", \"assert sum_even_numbers([-2, -4, -6]) == -12\... | {
"split": "train",
"index": 74950,
"acecode_id": "oss_36853",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that creates a shallow copy of a given object. The function should take one parameter, 'object', which can be of any data type, and return a new object that is a shallow copy of the original. Ensure the function does not mutate the original object.\nPlease ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shallow_copy([1, 2, [3, 4]]) == [1, 2, [3, 4]]\", \"assert shallow_copy({'a': 1, 'b': 2}) == {'a': 1, 'b': 2}\", \"assert shallow_copy((1, 2, 3)) == (1, 2, 3)\", \"assert shallow_copy('hello') == 'hello'\", \"assert shallow_copy(None) == None\", \"assert sha... | {
"split": "train",
"index": 74951,
"acecode_id": "evol_35120",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two matrices represented as 2D lists, implement a function `matrix_operations(mat1, mat2)` that performs the following operations: 1) Adds the two matrices if they have the same dimensions, 2) Subtracts the second matrix from the first if they have the same dimensions, 3)... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert matrix_operations([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == {'add': [[6, 8], [10, 12]], 'subtract': [[-4, -4], [-4, -4]], 'multiply': [[19, 22], [43, 50]]}\", \"assert matrix_operations([[1, 2]], [[3, 4]]) == {'add': [[4, 6]], 'subtract': [[-2, -2]], 'multiply'... | {
"split": "train",
"index": 74952,
"acecode_id": "oss_8134",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a list of tuples, each containing a student's name and their scores in five subjects represented as strings, write a Python function called `average_score` to calculate the average score for each student. The function should return a dictionary where the key is the studen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_score([('Alice', '90', '85', '80', '75', '70'), ('Bob', '60', '70', '80', '90', '100')]) == {'Alice': 80.0, 'Bob': 80.0}\", \"assert average_score([('Charlie', 'not_a_score', '50', '60', '70', '80')]) == {'Charlie': 65.0}\", \"assert average_score([(... | {
"split": "train",
"index": 74953,
"acecode_id": "evol_12406",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves information about different types of instances in a given region. You will receive a string representing the region and your function should return a dictionary with two keys: 'EC2' and 'RDS'. The value for 'EC2' should be ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_instance_info('us-east-1') == {'EC2': ['i-abc123', 'i-def456', 'i-ghi789'], 'RDS': ['db-xyz', 'db-uvw', 'db-rst']}\", \"assert get_instance_info('us-west-1') == {'EC2': ['i-abc123', 'i-def456', 'i-ghi789'], 'RDS': ['db-xyz', 'db-uvw', 'db-rst']}\", \"ass... | {
"split": "train",
"index": 74954,
"acecode_id": "bigcode_python_fns_23749",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the memory used by different processes in megabytes (MiB). Write a function that returns the total memory used by all processes in the list. If the list is empty, return 0. The function signature is: `def total_memory_used(memory_li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert total_memory_used([100, 200, 300]) == 600\", \"assert total_memory_used([0]) == 0\", \"assert total_memory_used([256, 512, 128]) == 896\", \"assert total_memory_used([1024, 2048]) == 3072\", \"assert total_memory_used([512, 256, 128, 64]) == 960\", \"assert ... | {
"split": "train",
"index": 74955,
"acecode_id": "bigcode_python_fns_11065",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a floating point number, implement a function `clean_float(number: float) -> str` that returns the number as a string. If the number is an integer (i.e., it has no decimal part), return it as an integer string without any decimal point. If the number is a non-integer, ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert clean_float(5.0) == '5'\", \"assert clean_float(5.5) == '5.5'\", \"assert clean_float(0.0) == '0'\", \"assert clean_float(-2.0) == '-2'\", \"assert clean_float(-3.5) == '-3.5'\", \"assert clean_float(10) == '10'\", \"assert clean_float(7.1) == '7.1'\", \"ass... | {
"split": "train",
"index": 74956,
"acecode_id": "bigcode_python_fns_24290",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes an integer input representing a user's choice of facial detection method. The function should return a string indicating the type of detection selected based on the following rules: if the choice is 1, return 'Live camera f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert facial_detection_method(1) == 'Live camera feed with facial detection'\", \"assert facial_detection_method(2) == 'Image with facial detection'\", \"assert facial_detection_method(3) == 'Live camera feed with eye detection'\", \"assert facial_detection_method... | {
"split": "train",
"index": 74957,
"acecode_id": "oss_31900",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that manages URL redirections for a web application. The function, `manage_redirects(entries: List[Tuple[str, str]]) -> List[str]`, should receive a list of URL redirection entries, where each entry is a tuple containing two strings: the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_redirects([('http://example.com', 'http://example.org')]) == ['Valid']\", \"assert manage_redirects([('http://example.com', 'http://example.com')]) == ['Invalid: Redirection URL cannot be the same as the original URL']\", \"assert manage_redirects([('... | {
"split": "train",
"index": 74958,
"acecode_id": "oss_15955",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of unique natural numbers, write a Python function that divides the array into two separate subsets such that the product of the elements in each subset is equal. If such a division is not possible, the function should return None. Your function should return a t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert divide_array([1, 2, 3, 6]) == ({6}, {1, 2, 3})\", \"assert divide_array([1, 3, 5, 15]) == ({15}, {1, 3, 5})\", \"assert divide_array([1, 2, 2, 8]) == None\", \"assert divide_array([2, 5, 25]) == None\", \"assert divide_array([6, 2, 3]) == ({6}, {2, 3})\"]}"
... | {
"split": "train",
"index": 74959,
"acecode_id": "evol_19136",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the configuration of a machine learning application. The function should accept a set of parameters that define the application's behavior and return a dictionary containing those parameters. The parameters for the function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_ml_config('path/to/upload') == {'upload_folder': 'path/to/upload', 'config_file': '/content/computer-vision-REST-API/MaskRCNN_finetune/configs/ResNet-101-FPN/balloon.yaml', 'weights': 'https://www.dropbox.com/s/otp52ccygc2t3or/ResNet101_FPN_model_fina... | {
"split": "train",
"index": 74960,
"acecode_id": "bigcode_python_fns_14796",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the n-th Fibonacci number in the sequence using the mathematical properties of Fibonacci numbers. The function should take a non-negative integer n as input and return the n-th Fibonacci number.\nPlease reason step by step, then write a self... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(0) == 0\", \"assert fibonacci(1) == 1\", \"assert fibonacci(2) == 1\", \"assert fibonacci(3) == 2\", \"assert fibonacci(4) == 3\", \"assert fibonacci(5) == 5\", \"assert fibonacci(6) == 8\", \"assert fibonacci(7) == 13\", \"assert fibonacci(8) == 2... | {
"split": "train",
"index": 74961,
"acecode_id": "evol_33733",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple substitution cipher that can encrypt and decrypt messages. The encryption process shifts each letter in the message by a fixed number of positions in the alphabet. Write a function `cipher(message: str, shift: int, mode: str) -> str` th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cipher('hello', 3, 'encrypt') == 'khoor'\", \"assert cipher('khoor', 3, 'decrypt') == 'hello'\", \"assert cipher('Hello, World!', 5, 'encrypt') == 'Mjqqt, Btwqi!'\", \"assert cipher('Mjqqt, Btwqi!', 5, 'decrypt') == 'Hello, World!'\", \"assert cipher('abc xy... | {
"split": "train",
"index": 74962,
"acecode_id": "oss_3957",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, where each string represents a unique identification label for a probe. Your task is to implement a function that removes a specified probe label from the list if it exists. If the label does not exist in the list, the function should return the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_probe_label(['probe1', 'probe2', 'probe3'], 'probe2') == ['probe1', 'probe3']\", \"assert remove_probe_label(['probeA', 'probeB', 'probeC'], 'probeD') == ['probeA', 'probeB', 'probeC']\", \"assert remove_probe_label(['probeX', 'probeY'], 'probeY') == ... | {
"split": "train",
"index": 74963,
"acecode_id": "bigcode_python_fns_15576",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to implement a function `report_results(data: List[int]) -> List[str]` that generates a report of the results based on the provided integers. The report should contain the following information for each integer in the list: if the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert report_results([1, 2, 3, 4]) == ['Odd Number: 1', 'Even Number: 2', 'Odd Number: 3', 'Even Number: 4']\", \"assert report_results([0, -1, -2]) == ['Even Number: 0', 'Odd Number: -1', 'Even Number: -2']\", \"assert report_results([]) == []\", \"assert report_... | {
"split": "train",
"index": 74964,
"acecode_id": "bigcode_python_fns_23703",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `cleanup_terminal_pool(term_pool: List[Dict[str, Any]]) -> List[str]`. This function takes a list of dictionaries representing terminals, where each dictionary contains an 'id' key representing the terminal's unique identifier. The fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cleanup_terminal_pool([{'id': 1}, {'id': 2}, {'id': 3}, {'id': 4}]) == ['2', '4']\", \"assert cleanup_terminal_pool([{'id': 2}, {'id': 4}, {'id': 6}, {'id': 8}]) == ['2', '4', '6', '8']\", \"assert cleanup_terminal_pool([{'id': 1}, {'id': 3}, {'id': 5}]) == ... | {
"split": "train",
"index": 74965,
"acecode_id": "bigcode_python_fns_37076",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of integers, `cs` and `lab`. Your task is to implement a function `calc_correlation(cs: List[int], lab: List[int]) -> float` that calculates the Spearman's rank correlation coefficient between the two lists. The Spearman's rank correlation coefficient is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calc_correlation([1, 2, 3], [1, 2, 3]) == 1.0\", \"assert calc_correlation([1, 2, 3], [3, 2, 1]) == -1.0\", \"assert calc_correlation([1, 2, 3, 4], [2, 3, 4, 5]) == 1.0\", \"assert calc_correlation([1, 2, 2], [2, 1, 1]) == -0.5\", \"assert calc_correlation([... | {
"split": "train",
"index": 74966,
"acecode_id": "bigcode_python_fns_40912",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates reading samples from a data acquisition device. The function should be able to take a specified number of samples and return a list of random integers simulating the sampled data. The sampled data should be generated wi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert read_samples(5, 1, 0, 10) == [3, 7, 1, 0, 9] or read_samples(5, 1, 0, 10) == [2, 4, 6, 8, 10] or ...\", \"assert len(read_samples(0, 1, 0, 10)) == 0\", \"assert len(read_samples(1, 1, 0, 10)) == 1\", \"assert all(0 <= sample <= 10 for sample in read_samples(... | {
"split": "train",
"index": 74967,
"acecode_id": "oss_2952",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of results from a series of games played by a specific team, along with their outcomes (win, lose, draw) and the year the game took place. Write a function `calculate_win_percentage(results: List[Tuple[str, str]], team_name: str) -> Dict[str, float]` that c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_win_percentage([('win', 2021), ('lose', 2021), ('draw', 2021)], 'Team A') == {'win_percentage': 33.33, 'loss_percentage': 33.33, 'draw_percentage': 33.33}\", \"assert calculate_win_percentage([('win', 2021), ('win', 2021), ('lose', 2021)], 'Team A'... | {
"split": "train",
"index": 74968,
"acecode_id": "bigcode_python_fns_5714",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a duration in a format such as '10m' for 10 minutes, '2h' for 2 hours, '30s' for 30 seconds, or a combination like '1h30m', write a function `duration_to_timedelta(duration: str) -> timedelta` that converts this duration string into a `timedelta` obj... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert duration_to_timedelta('10m') == timedelta(seconds=600)\", \"assert duration_to_timedelta('2h') == timedelta(seconds=7200)\", \"assert duration_to_timedelta('30s') == timedelta(seconds=30)\", \"assert duration_to_timedelta('1h30m') == timedelta(seconds=5400)\... | {
"split": "train",
"index": 74969,
"acecode_id": "bigcode_python_fns_28481",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `uint256_range_check` that checks whether a given integer value falls within the range of a 256-bit unsigned integer. The range of a 256-bit unsigned integer is defined from 0 to 2^256 - 1. Your function should take an integer as inpu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert uint256_range_check(0) == True\", \"assert uint256_range_check(1) == True\", \"assert uint256_range_check(2**256 - 1) == True\", \"assert uint256_range_check(2**256) == False\", \"assert uint256_range_check(-1) == False\", \"assert uint256_range_check(123456... | {
"split": "train",
"index": 74970,
"acecode_id": "oss_8856",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a message sending system for a messaging application. The system should allow users to send messages to specific topics. Each topic has a unique identifier (topic_id), and users can subscribe to these topics. Your goal is to implement a function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert send_message(1, 'Hello World') == []\", \"assert send_message(4, 'Important update') == []\", \"assert send_message(6, 'Just checking') == []\", \"assert send_message(4, 'Event invitation') == []\", \"assert send_message(7, 'Feedback request') == []\", \"ass... | {
"split": "train",
"index": 74971,
"acecode_id": "oss_11083",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a program to manage access control for a set of devices. The access control information is provided in a specific format: '# <NUMBER_OF_DEVICES> | <DEVICE_INFO_1> | <DEVICE_INFO_2> | ...', where '<DEVICE_INFO>' represents the details for each de... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_access('3 | 001 Door1 allowed | 002 Door2 allowed | 003 Door3 not allowed', '001 access') == True\", \"assert check_access('3 | 001 Door1 allowed | 002 Door2 allowed | 003 Door3 not allowed', '003 access') == False\", \"assert check_access('2 | 004 Lig... | {
"split": "train",
"index": 74972,
"acecode_id": "oss_14959",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a list of the first n perfect squares. A perfect square is an integer that is the square of an integer. Your function should take a single integer n as input and return a list containing the first n perfect squares, startin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_perfect_squares(1) == [1]\", \"assert generate_perfect_squares(2) == [1, 4]\", \"assert generate_perfect_squares(3) == [1, 4, 9]\", \"assert generate_perfect_squares(4) == [1, 4, 9, 16]\", \"assert generate_perfect_squares(5) == [1, 4, 9, 16, 25]\",... | {
"split": "train",
"index": 74973,
"acecode_id": "bigcode_python_fns_15905",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the annual depreciation of an asset using either the straight-line method or the declining balance method. The function should take the following parameters: initial_cost (float), salvage_value (float), useful_life_years (int), and an option... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_depreciation(10000, 1000, 5) == 1800.0\", \"assert compute_depreciation(10000, 1000, 5, method='straight-line') == 1800.0\", \"assert compute_depreciation(10000, 5000, 5) == 1000.0\", \"assert compute_depreciation(10000, 5000, 5, method='straight-lin... | {
"split": "train",
"index": 74974,
"acecode_id": "evol_25960",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of integers and returns a new list where each integer is squared. The input list may contain negative, zero, or positive integers. The function should return the squared values in the same order as they appear in the inp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert square_numbers([1, 2, 3]) == [1, 4, 9]\", \"assert square_numbers([-1, -2, -3]) == [1, 4, 9]\", \"assert square_numbers([0]) == [0]\", \"assert square_numbers([]) == []\", \"assert square_numbers([-1, 0, 1]) == [1, 0, 1]\", \"assert square_numbers([2, -2, 3,... | {
"split": "train",
"index": 74975,
"acecode_id": "bigcode_python_fns_16020",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a programming language, return a string that represents the path to the localization file for that language. The localization file path should follow the format '<language>/localization_<language>.json', where '<language>' is the input string. You ma... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_language_file_path('python') == 'python/localization_python.json'\", \"assert get_language_file_path('java') == 'java/localization_java.json'\", \"assert get_language_file_path('csharp') == 'csharp/localization_csharp.json'\", \"assert get_language_file_... | {
"split": "train",
"index": 74976,
"acecode_id": "bigcode_python_fns_6172",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `get_container_info` that retrieves information about a specified number of containers, starting from a given index. The function should take three parameters: an integer `start` representing the index from which to start retrieving conta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_container_info(0, 2, 'json') == '[{\\\"id\\\": 0, \\\"name\\\": \\\"Container 0\\\"}, {\\\"id\\\": 1, \\\"name\\\": \\\"Container 1\\\"}]'\", \"assert get_container_info(1, 3, 'dict') == {0: {'id': 1, 'name': 'Container 1'}, 1: {'id': 2, 'name': 'Contain... | {
"split": "train",
"index": 74977,
"acecode_id": "bigcode_python_fns_4425",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given an integer num_bins and two floating-point numbers t_start and t_stop, write a function that calculates the size of each bin. The size of the bin is computed as (t_stop - t_start) / num_bins. If t_stop is less than t_start, the function should raise a ValueError. Implemen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calc_binsize(5, 0.0, 10.0) == 2.0\", \"assert calc_binsize(1, 0.0, 10.0) == 10.0\", \"assert calc_binsize(10, 10.0, 20.0) == 1.0\", \"assert calc_binsize(2, 5.0, 15.0) == 5.0\", \"assert calc_binsize(3, 2.0, 11.0) == 3.0\", \"assert calc_binsize(4, 1.0, 9.0)... | {
"split": "train",
"index": 74978,
"acecode_id": "bigcode_python_fns_35293",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that extracts specific customer reviews from a dataset based on their indices. Write a function `select_reviews(indices, reviews)` that takes in two parameters: `indices` (a list of integers) representing the review indices to be selected... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert select_reviews([1, 2, 3, 5, 8], ['Great product!', 'Disappointed with the quality.', 'Highly recommended.', 'Average experience.', 'Best purchase ever!', 'Not worth the price.', 'Excellent customer service.', 'Very satisfied.', 'Poor packaging.', 'Amazing va... | {
"split": "train",
"index": 74979,
"acecode_id": "oss_19493",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with evaluating the performance of a sequence labeling model that segments sequences into two classes: 'E-SEG' and 'S-SEG'. Your task is to implement a function `evaluate_segments(flat_y_test, flat_y_pred)` that computes the following metrics based on the provide... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate_segments(['E-SEG', 'E-SEG', 'S-SEG'], ['S-SEG', 'S-SEG']) == (0, 2, 0)\", \"assert evaluate_segments(['E-SEG', 'S-SEG'], ['E-SEG']) == (1, 0, 0)\", \"assert evaluate_segments(['S-SEG'], ['E-SEG']) == (0, 0, 1)\", \"assert evaluate_segments([], ['E-S... | {
"split": "train",
"index": 74980,
"acecode_id": "oss_20221",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are required to implement a function that processes a list of macro definitions and returns a dictionary containing the last defined values of the macros. Each macro definition is represented as a tuple containing the macro name and its value. If a macro is defined multiple... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_macros([('A', '1'), ('B', '2'), ('A', '3')]) == {'A': '3', 'B': '2'}\", \"assert process_macros([('X', '100'), ('Y', '200'), ('X', '300'), ('Y', '400')]) == {'X': '300', 'Y': '400'}\", \"assert process_macros([('NAME', 'Alice'), ('NAME', 'Bob')]) == ... | {
"split": "train",
"index": 74981,
"acecode_id": "oss_34106",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a given specification represented as a dictionary and returns a list of command-line arguments based on certain conditions. Write a Python function `process_spec(spec)` that takes a dictionary `spec` as input and gen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_spec({'+stats': True, '+prof': True, 'jemalloc_prefix': {'value': 'none'}}) == ['--enable-stats', '--enable-prof']\", \"assert process_spec({'+stats': False, '+prof': False, 'jemalloc_prefix': {'value': 'none'}}) == []\", \"assert process_spec({'+sta... | {
"split": "train",
"index": 74982,
"acecode_id": "oss_1215",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `s`, implement a function `func(s)` that returns a list of unique characters in the order they first appeared in the string. The function should preserve the original order of characters while eliminating duplicates.\nPlease reason step by step, then write a self... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert func('abcdefghijklmnopqrstuvwxyz') == ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']\", \"assert func('hello') == ['h', 'e', 'l', 'o']\", \"assert func('aabbcc') == ['a', 'b'... | {
"split": "train",
"index": 74983,
"acecode_id": "evol_14835",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `execute_n_times(func, n, params, printExecutionTime=True)` that executes a given function `func` a specified number of times `n`. The function can accept variable types of parameters: it can take a list, tuple, dictionary, or a single value. If `printExecution... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert execute_n_times(lambda x: x + 1, 5, 2) == 3\", \"assert execute_n_times(lambda x: x * 2, 3, 4) == 8\", \"assert execute_n_times(lambda x, y: x + y, 2, (3, 5)) == 8\", \"assert execute_n_times(lambda x: x / 2, 4, 10) == 5.0\", \"assert execute_n_times(lambda ... | {
"split": "train",
"index": 74984,
"acecode_id": "evol_28512",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a name in the format 'Name_ID'. Your task is to extract the name and calculate its length. Return the name and its length as a formatted string in the following format: '{name} {length}'. For example, given the input 'Rosalind_0808', the outp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_name_and_length('Rosalind_0808') == 'Rosalind 8'\", \"assert extract_name_and_length('Alice_12345') == 'Alice 5'\", \"assert extract_name_and_length('Bob_999') == 'Bob 3'\", \"assert extract_name_and_length('Charlie_4567') == 'Charlie 7'\", \"assert ... | {
"split": "train",
"index": 74985,
"acecode_id": "bigcode_python_fns_10722",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that determines if there are three distinct integers in the list that sum up to a specified target value. Implement the function `find_three_numbers(array: List[int], target: int) -> bool` where `array` is the input list of integers an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_three_numbers([5, 3, 1, 8], 14) == True\", \"assert find_three_numbers([1, 2, 3, 4, 5], 9) == True\", \"assert find_three_numbers([1, 2, 3], 6) == True\", \"assert find_three_numbers([0, -1, 2, -3, 1], 0) == True\", \"assert find_three_numbers([1, 1, 1]... | {
"split": "train",
"index": 74986,
"acecode_id": "evol_6505",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a wallet object, determine if it is a compatible wallet for fusion by checking if it is an instance of the Standard_Wallet class. Implement a function `can_fuse_to(wallet)` that takes in a single wallet object and returns True if the wallet is a Standard_Wallet, and False... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_fuse_to(Standard_Wallet()) == True\", \"assert can_fuse_to(AnotherWallet()) == False\", \"assert can_fuse_to(Standard_Wallet()) == True\", \"assert can_fuse_to(Standard_Wallet()) == True\", \"assert can_fuse_to(Standard_Wallet()) == True\", \"assert can_... | {
"split": "train",
"index": 74987,
"acecode_id": "bigcode_python_fns_21535",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of strings, each representing the contents of a text file. Your goal is to extract and return a list of unique words from all the strings combined. The words should be case-insensitive and should not include any punctuat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_unique_words(['Hello world!', 'Hello there.']) == ['hello', 'there', 'world']\", \"assert extract_unique_words(['Python is great.', 'Python is fun!']) == ['fun', 'great', 'is', 'python']\", \"assert extract_unique_words(['This is a test.', 'This test... | {
"split": "train",
"index": 74988,
"acecode_id": "oss_7456",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given any object, implement a function `safe_str(obj)` that returns the string representation of the object. If the object is a Unicode string that cannot be directly converted to a byte string, return its Unicode escape encoding instead. The function should handle any type of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert safe_str(123) == '123'\", \"assert safe_str(45.67) == '45.67'\", \"assert safe_str(True) == 'True'\", \"assert safe_str(None) == 'None'\", \"assert safe_str('Hello, World!') == 'Hello, World!'\", \"assert safe_str('Unicode: \\u00fc') == 'Unicode: \\u00fc'\",... | {
"split": "train",
"index": 74989,
"acecode_id": "bigcode_python_fns_27907",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers and a pointer, which indicates a position in the list. Your task is to implement a function that retrieves the integer at the specified position (0-based index) in the list. If the pointer is out of bounds (either negative or greater than the le... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_integer_at_position([1, 2, 3, 4, 5], 2) == 3\", \"assert get_integer_at_position([10, 20, 30, 40], 0) == 10\", \"assert get_integer_at_position([5, 10, 15], 3) == -1\", \"assert get_integer_at_position([], 0) == -1\", \"assert get_integer_at_position([1]... | {
"split": "train",
"index": 74990,
"acecode_id": "bigcode_python_fns_46559",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of integers and returns a new list containing each integer incremented by one. The function should only operate on integers and ignore any non-integer values in the input list. If the input list is empty, return an empty... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert increment_integers([1, 2, 3]) == [2, 3, 4]\", \"assert increment_integers([]) == []\", \"assert increment_integers([5, 6, 7]) == [6, 7, 8]\", \"assert increment_integers(['a', 1, 2]) == [2, 3]\", \"assert increment_integers([None, 3]) == [4]\", \"assert incr... | {
"split": "train",
"index": 74991,
"acecode_id": "bigcode_python_fns_6199",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes in a list of file names (without extensions) and a destination file name. Your function should return a list of strings that represent the names of the files that would be zipped into a zip archive, appending the '.wav' extensi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert collect_files_to_zip('output', ['file1', 'file2', 'file3']) == ['file1.wav', 'file2.wav', 'file3.wav']\", \"assert collect_files_to_zip('archive', ['song1', 'song2']) == ['song1.wav', 'song2.wav']\", \"assert collect_files_to_zip('backup', ['recording1']) ==... | {
"split": "train",
"index": 74992,
"acecode_id": "bigcode_python_fns_47092",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that filters a list of integers based on whether they are even or not. The function should take in a list of integers as input and return a new list that contains only the even integers. If any integers are removed during this filteri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5, 6]) == [2, 4, 6]\", \"assert filter_even_numbers([10, 15, 20, 25, 30]) == [10, 20, 30]\", \"assert filter_even_numbers([7, 9, 11]) == []\", \"assert filter_even_numbers([]) == []\", \"assert filter_even_numbers([2, 4, 6, 8... | {
"split": "train",
"index": 74993,
"acecode_id": "oss_29547",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries, where each dictionary represents a graduate petition. Each petition contains the following keys: 'description' (a string), 'submitDate' (a string representing a date), 'decisionDate' (optional, a string representing a date), 'deptRecommend'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_petitions([{'description': 'Thesis Approval', 'submitDate': '2023-01-15', 'decisionDate': '2023-02-01', 'deptRecommend': ['Approved'], 'gradSchoolDecision': 'Accepted'}]) == [{'description': 'Thesis Approval', 'submit_date': '2023-01-15', 'decision_d... | {
"split": "train",
"index": 74994,
"acecode_id": "bigcode_python_fns_45334",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, your task is to implement a function `unique_elements(input_list)` that returns a new list containing only the unique elements from the input list, preserving their original order. The input list may contain duplicate integers. Your function should ens... | 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]\", \"assert unique_elements([]... | {
"split": "train",
"index": 74995,
"acecode_id": "oss_13086",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a string as input and determines whether the string is an anagram of its reverse. The comparison should be case-insensitive. Implement the function `is_anagram_of_reversed(word)` that returns True if the input string is an anagram of its reversed ver... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_anagram_of_reversed('listen') == True\", \"assert is_anagram_of_reversed('silent') == True\", \"assert is_anagram_of_reversed('Aba') == True\", \"assert is_anagram_of_reversed('Racecar') == True\", \"assert is_anagram_of_reversed('madam') == True\", \"ass... | {
"split": "train",
"index": 74996,
"acecode_id": "evol_9129",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a 2D array of integers representing image data, write a function that detects the coordinates of peaks in the image. A peak is defined as a value in the array that is greater than its immediate neighbors. The function should return a list of tuples, where each tuple conta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_peaks([[1]]) == [(0, 0)]\", \"assert find_peaks([[1, 2], [3, 4]]) == [(1, 1)]\", \"assert find_peaks([[9, 1, 2], [3, 4, 5], [8, 7, 6]]) == [(0, 0), (2, 0)]\", \"assert find_peaks([[1, 2], [3, 2], [2, 1]]) == [(1, 0)]\", \"assert find_peaks([[1, 2, 1], [... | {
"split": "train",
"index": 74997,
"acecode_id": "bigcode_python_fns_8561",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the win ratio for a list of players based on their historic game statistics. Each player is represented by a dictionary containing their name, the number of wins, and the total number of games played. Implement a function called `calculate_win_ra... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_win_ratios([{'name': 'Alice', 'wins': 10, 'total_games': 20}, {'name': 'Bob', 'wins': 5, 'total_games': 15}]) == [0.5, 0.3333333333333333]\", \"assert calculate_win_ratios([{'name': 'Charlie', 'wins': 0, 'total_games': 0}, {'name': 'Dave', 'wins': ... | {
"split": "train",
"index": 74998,
"acecode_id": "bigcode_python_fns_7179",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates establishing a TCP connection to a specified address and port. Your function should take in the following parameters: an address (a string representing the IP address), a port (an integer representing the port number), and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert establish_connection('192.168.1.1', 8080) == 'Connection to 192.168.1.1:8080 established using TCP.'\", \"assert establish_connection('10.0.0.1', 80) == 'Connection to 10.0.0.1:80 established using TCP.'\", \"assert establish_connection('localhost', 443) == ... | {
"split": "train",
"index": 74999,
"acecode_id": "bigcode_python_fns_45339",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.