data_source
large_stringclasses
1 value
prompt
listlengths
1
1
ability
large_stringclasses
1 value
reward_model
dict
extra_info
dict
acecode
[ { "role": "user", "content": "You are given a dictionary `ds` that represents a dataset. Your task is to implement a function that checks if the dictionary contains specific keys and their associated types. The function should verify the following conditions: The dictionary must have the key 'lead_time' as ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_dataset({'lead_time': [1, 2], 'forecast_time': [3, 4], 'valid_time': [5]}) == True\", \"assert check_dataset({'lead_time': [1, 2], 'forecast_time': [3, 4], 'valid_time': [5], 'other_key': [6]}) == True\", \"assert check_dataset({'forecast_time': [1, 2]...
{ "split": "train", "index": 73300, "acecode_id": "bigcode_python_fns_43180", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with reloading a module in Python. Write a function `reload_google_module()` that checks if the 'google' module is already loaded in the system. If it is loaded, the function should reload the 'google' module. If it is not loaded, the function should do nothing. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reload_google_module() is None\", \"assert reload_google_module() is None\", \"assert reload_google_module() is None\", \"assert reload_google_module() is None\", \"assert reload_google_module() is None\", \"assert reload_google_module() is None\", \"assert ...
{ "split": "train", "index": 73301, "acecode_id": "bigcode_python_fns_24451", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `find_max_index` that takes a list of integers as input and returns the index of the maximum value in the list. If there are multiple occurrences of the maximum value, return the index of the first occurrence.\nPlease reason step by step, then write a self-...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_max_index([4, 7, 9, 2, 10]) == 4\", \"assert find_max_index([1, 2, 3, 4, 5]) == 4\", \"assert find_max_index([-1, -2, -3, -4, -5]) == 0\", \"assert find_max_index([10, 10, 10]) == 0\", \"assert find_max_index([0, 0, 0, 0, 0]) == 0\", \"assert find_max_i...
{ "split": "train", "index": 73302, "acecode_id": "evol_24195", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a given string by replacing specific characters with underscores. Your function should replace all occurrences of '(', ')', and '/' in the input string with '_'. The modified string should be returned as the output. Imp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_id('abc(def)/ghi') == 'abc_def__ghi'\", \"assert process_id('no_change') == 'no_change'\", \"assert process_id('abc/def/ghi') == 'abc_def_ghi'\", \"assert process_id('/start/and/end/') == '_start_and_end_'\", \"assert process_id('no_special_chars') =...
{ "split": "train", "index": 73303, "acecode_id": "oss_1132", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given two lists of strings, `sheet_one_names` and `sheet_two_names`, which represent the names of sheets in an Excel file. You also have a destination file name `destfile`. Your task is to create a function `write_sheets(sheet_one_names: List[str], sheet_two_names: List...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert write_sheets(['Sheet'], [], 'output.xlsx') == ['Writing to output.xlsx: Sheet']\", \"assert write_sheets(['Sheet1', 'Sheet2'], ['Sheet', 'SheetB'], 'output.xlsx') == ['Writing to output.xlsx: Sheet1', 'Writing to output.xlsx: Sheet2', 'Writing to output.xlsx...
{ "split": "train", "index": 73304, "acecode_id": "bigcode_python_fns_11003", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Write a function that returns the total number of unique keys in a dictionary. The keys should be constructed by computing the SHA256 hash of the first three letters of the names of the first five Fibonacci numbers. The values are the corresponding full names of those Fibonacci...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_unique_keys() == 5\", \"assert count_unique_keys() == len(set(['0e9b8fb0c1fe5e209f3838c0c4d273261d0e6ccfe73f6b510e8dba58464b0cb7', '3e0b3e6d4d8b2e8e2e8d8b8c7c5e9dcd4d0dbdb577b5d0e12f2a6d4d8f1c3e0', '0c0c9b9f9b5b7c5a3f3a8f5e3d2a4a3f4e5f2c3e3e6b9b7e1c4b1...
{ "split": "train", "index": 73305, "acecode_id": "evol_13180", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that modifies a given list of integers based on a specific set of rules. The function should take in a list of integers and return a new list with the following modifications: 1. If the integer is even, it should be divided by 2. 2...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert modify_list([3, 4, 7, 10]) == [10, 2, 22, 5]\", \"assert modify_list([1, 2, 3, 4, 5]) == [4, 1, 10, 2, 16]\", \"assert modify_list([0, 1, 2, 3]) == [0, 4, 1, 10]\", \"assert modify_list([8, 9, 10]) == [4, 28, 5]\", \"assert modify_list([100, 101, 102]) == [5...
{ "split": "train", "index": 73306, "acecode_id": "oss_18931", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of non-negative integers. For each integer in the list, you need to determine the remainder when the count of set bits (1s) in its binary representation is divided by 3. The count of set bits in a binary number is the number of 1s present in its binary repr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remainder_of_set_bits([0]) == [0]\", \"assert remainder_of_set_bits([1]) == [1]\", \"assert remainder_of_set_bits([2]) == [1]\", \"assert remainder_of_set_bits([4]) == [1]\", \"assert remainder_of_set_bits([16]) == [1]\", \"assert remainder_of_set_bits([32])...
{ "split": "train", "index": 73307, "acecode_id": "oss_2731", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a list of integers, your task is to write a function that increments each element of the list by 1 and returns the modified list. The function should handle an empty list correctly and return it as is. Write a function named `increment_list` that takes a list of integers ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert increment_list([1, 2, 3]) == [2, 3, 4]\", \"assert increment_list([0]) == [1]\", \"assert increment_list([-1, -2, -3]) == [0, -1, -2]\", \"assert increment_list([]) == []\", \"assert increment_list([10, 20, 30, 40]) == [11, 21, 31, 41]\", \"assert increment_...
{ "split": "train", "index": 73308, "acecode_id": "oss_12033", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given three integers `n`, `min_val`, and `max_val`, write a function `count_values_in_range(n, min_val, max_val)` that calculates how many integers raised to the power of `n` lie within the inclusive range from `min_val` to `max_val`. The function should return an integer repre...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_values_in_range(2, 1, 10) == 3\", \"assert count_values_in_range(3, 1, 100) == 4\", \"assert count_values_in_range(4, 0, 256) == 4\", \"assert count_values_in_range(2, 0, 50) == 7\", \"assert count_values_in_range(3, 0, 30) == 3\", \"assert count_value...
{ "split": "train", "index": 73309, "acecode_id": "oss_4383", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a list of jobs and their corresponding layers. Each job can depend on another job's specific layer and frame. Write a function `create_dependency` that takes in the following parameters: \n- `job`: a string representing the name of the dependent job \n- `layer`:...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_dependency('JobA', 'Layer1', 'JobB', 'Layer2', 1) == ['Dependency from JobA/Layer1 to JobB/Layer2-1']\", \"assert create_dependency('JobX', 'LayerY', 'JobZ', 'LayerW', 0) == ['Dependency from JobX/LayerY to JobZ/LayerW-0']\", \"assert create_dependenc...
{ "split": "train", "index": 73310, "acecode_id": "bigcode_python_fns_28119", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `find_max_and_prime(numbers)` that takes a list of integers as input. The function should return a tuple containing the maximum number in the list, its index position, and a boolean indicating whether the maximum number is a prime number or not. If the list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_max_and_prime([24, 5, 40, 15]) == (40, 2, False)\", \"assert find_max_and_prime([1, 2, 3, 4]) == (4, 3, False)\", \"assert find_max_and_prime([7, 3, 2, 5]) == (7, 0, True)\", \"assert find_max_and_prime([10, 20, 30, 40]) == (40, 3, False)\", \"assert fi...
{ "split": "train", "index": 73311, "acecode_id": "evol_11125", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two 2D points, pos1 and pos2, represented as lists of two integers [x, y]. Your task is to calculate the cosine similarity between these two points based on their coordinates. The cosine similarity is defined as the dot product of the two vectors divided by the pr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert abs(cosine_similarity([1, 0], [1, 0]) - 1.0) < 1e-9\", \"assert abs(cosine_similarity([1, 0], [0, 1]) - 0.0) < 1e-9\", \"assert abs(cosine_similarity([1, 1], [1, 1]) - 1.0) < 1e-9\", \"assert abs(cosine_similarity([1, 1], [2, 2]) - 1.0) < 1e-9\", \"assert ab...
{ "split": "train", "index": 73312, "acecode_id": "bigcode_python_fns_47021", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string representing a YouTube video URL, implement a function `extract_video_id` that extracts and returns the video ID from the URL. The video ID is the part of the URL that comes after 'v=' and before any '&' character. If the URL does not contain a valid video ID, th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_video_id('https://www.youtube.com/watch?v=dQw4w9WgXcQ') == 'dQw4w9WgXcQ'\", \"assert extract_video_id('https://youtu.be/dQw4w9WgXcQ') == 'dQw4w9WgXcQ'\", \"assert extract_video_id('https://www.youtube.com/watch?v=dQw4w9WgXcQ&t=30s') == 'dQw4w9WgXcQ'\...
{ "split": "train", "index": 73313, "acecode_id": "oss_19652", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of pairs of points representing the start and end points of lines in a 2D space. Each line is defined by its start point (x1, y1) and end point (x2, y2). Your task is to calculate the lengths of these lines and return them in a list. The length of a line se...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_line_lengths([((-1, -1), (1, 1)), ((2, 3), (5, 7))]) == [2.83, 5.0]\", \"assert calculate_line_lengths([((0, 0), (0, 0)), ((10, 10), (10, 10))]) == [0.0, 0.0]\", \"assert calculate_line_lengths([((1, 2), (3, 4)), ((5, 5), (5, 5)), ((-1, -1), (1, 1)...
{ "split": "train", "index": 73314, "acecode_id": "bigcode_python_fns_6930", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the area and perimeter of a rectangle. The rectangle is defined by its width and height, which are both positive integers. Your function should take two parameters, width and height, and return a tuple containing the a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_rectangle_properties(5, 10) == (50, 30)\", \"assert calculate_rectangle_properties(3, 4) == (12, 14)\", \"assert calculate_rectangle_properties(1, 1) == (1, 4)\", \"assert calculate_rectangle_properties(7, 2) == (14, 18)\", \"assert calculate_recta...
{ "split": "train", "index": 73315, "acecode_id": "oss_29477", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of version strings in the format 'vX.Y.Z', where X, Y, and Z are non-negative integers, write a function `latest_version(versions: List[str]) -> str` that returns the latest version string based on semantic versioning. The latest version is determined by comparing ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert latest_version(['v1.0.0', 'v1.0.1', 'v1.0.2']) == 'v1.0.2'\", \"assert latest_version(['v1.0.0', 'v1.0.0', 'v1.0.0']) == 'v1.0.0'\", \"assert latest_version(['v2.0.0', 'v1.9.9', 'v2.0.1']) == 'v2.0.1'\", \"assert latest_version(['v3.1.0', 'v3.0.9', 'v3.1.0']...
{ "split": "train", "index": 73316, "acecode_id": "bigcode_python_fns_22845", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a 2D grid represented as a list of lists, where each element is an integer indicating the height of that cell, write a function `reshape_grid(grid: List[List[int]], new_rows: int, new_cols: int) -> List[List[int]]` that reshapes the grid into a new grid with the specified...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reshape_grid([[1, 2], [3, 4]], 4, 1) == [[1], [2], [3], [4]]\", \"assert reshape_grid([[1, 2]], 1, 2) == [[1, 2]]\", \"assert reshape_grid([[1, 2], [3, 4]], 2, 2) == [[1, 2], [3, 4]]\", \"assert reshape_grid([], 0, 0) == []\", \"assert reshape_grid([[1]], 1,...
{ "split": "train", "index": 73317, "acecode_id": "bigcode_python_fns_24615", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function `generate_bimodal_random` that accepts two integers, `peak1` and `peak2`, as parameters. The function should generate a random integer between 0 and 10 following a bimodal distribution with peaks at `peak1` and `peak2`. The distribution should be uniform be...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_bimodal_random(3, 7) in {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}\", \"assert generate_bimodal_random(1, 9) in {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}\", \"assert generate_bimodal_random(2, 8) in {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}\", \"assert generate_bimodal_r...
{ "split": "train", "index": 73318, "acecode_id": "evol_32940", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves the name of the first connected instrument of a specified type from a given dictionary of instruments. The function should take in two parameters: a dictionary of instruments where the keys are instrument types and the valu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_instrument_name({'DMM': {'name': 'Multimeter'}, 'Oscilloscope': {'name': 'Scope'}}, 'DMM') == 'Multimeter'\", \"assert get_instrument_name({'DMM': {'name': 'Multimeter'}, 'Oscilloscope': {'name': 'Scope'}}, 'Oscilloscope') == 'Scope'\", \"assert get_inst...
{ "split": "train", "index": 73319, "acecode_id": "bigcode_python_fns_46556", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function `advanced_geometric_mean_in_range(l: List[int], min_val: int, max_val: int) -> bool` that checks if the geometric mean of a list of integers falls within a specified range defined by `min_val` and `max_val`. The function should return False if the input ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert advanced_geometric_mean_in_range([], 1, 10) == False\", \"assert advanced_geometric_mean_in_range([0], 1, 10) == False\", \"assert advanced_geometric_mean_in_range([-1], 1, 10) == False\", \"assert advanced_geometric_mean_in_range([1], 1, 10) == True\", \"as...
{ "split": "train", "index": 73320, "acecode_id": "evol_26125", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with analyzing a coverage summary represented as a string. Your function should take two parameters: a string containing the coverage summary and an integer representing the minimum coverage threshold. The function should perform the following steps: 1. If the co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_coverage_values('80 90 75 85', 80) == ['80', '90', '85']\", \"assert filter_coverage_values('100 95 65 70 80', 75) == ['100', '95', '80']\", \"assert filter_coverage_values('', 80) == 'ERROR: Coverage summary is empty.'\", \"assert filter_coverage_val...
{ "split": "train", "index": 73321, "acecode_id": "oss_13967", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that generates a list of all possible combinations of hyperparameters for training neural network models. The function should take in a list of optimization algorithms, a list of network sizes, and a list of devices, and return a l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_hyperparameter_combinations(['ADAM'], [64], ['CPU']) == [{'optimization_algorithm': 'ADAM', 'network_size': 64, 'device': 'CPU'}]\", \"assert generate_hyperparameter_combinations(['SGD'], [128], ['GPU']) == [{'optimization_algorithm': 'SGD', 'networ...
{ "split": "train", "index": 73322, "acecode_id": "oss_28845", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes an audit export based on given settings and an audit JSON object. The function should take the following parameters: a list of export formats, an audit JSON, and a settings dictionary. The export formats will dictate how to...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_audit_export(['pdf', 'json'], {'audit_id': '12345'}, {}) == ['Successfully exported as pdf', 'Successfully exported as json']\", \"assert process_audit_export(['csv'], {'audit_id': '12345'}, {}) == ['Initiating CSV export']\", \"assert process_audit_...
{ "split": "train", "index": 73323, "acecode_id": "bigcode_python_fns_17479", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Given a string `input`, write a function `is_valid_ipv6_addr` that determines whether the given string is a valid IPv6 address. An IPv6 address consists of eight groups of four hexadecimal digits, separated by colons (:). Each group can contain a number from 0 to 65535, represe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_ipv6_addr('2001:0db8:85a3:0000:0000:8a2e:0370:7334') == True\", \"assert is_valid_ipv6_addr('2001:0db8::8a2e:0370:7334') == True\", \"assert is_valid_ipv6_addr('::1') == True\", \"assert is_valid_ipv6_addr('::') == True\", \"assert is_valid_ipv6_add...
{ "split": "train", "index": 73324, "acecode_id": "bigcode_python_fns_48035", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, implement a function called bubble_sort that sorts the array in ascending order using the bubble sort algorithm. The function should modify the input array in place and return nothing. You can assume the input array will not be empty.\nPlease reason ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bubble_sort([2, 3, 1, 7, 5]) == None and [1, 2, 3, 5, 7] == [1, 2, 3, 5, 7]\", \"assert bubble_sort([5, 4, 3, 2, 1]) == None and [1, 2, 3, 4, 5] == [1, 2, 3, 4, 5]\", \"assert bubble_sort([1]) == None and [1] == [1]\", \"assert bubble_sort([3, 2]) == None an...
{ "split": "train", "index": 73325, "acecode_id": "evol_36176", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the posting of manual decisions based on user input. The function should accept a string parameter representing the decision type, which can either be 'a' or 'b'. If the decision type is 'a', the function should return ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert post_manual_decision('a') == 'Manual Decision Version A posted successfully.'\", \"assert post_manual_decision('b') == 'Manual Decision Version B posted successfully.'\", \"assert post_manual_decision('c') == 'Error: Invalid decision type.'\", \"assert post_...
{ "split": "train", "index": 73326, "acecode_id": "bigcode_python_fns_10590", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list `v` containing integers, where the list has at least two elements. Your task is to implement a function `calculate_input_size(v)` that takes this list `v` as input and returns the value of `input_size`, which is calculated as twice the value of the second e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_input_size([1, 2, 3]) == 4\", \"assert calculate_input_size([0, 10]) == 20\", \"assert calculate_input_size([-1, 5]) == 10\", \"assert calculate_input_size([7, 8, 9]) == 16\", \"assert calculate_input_size([10, 20]) == 40\", \"assert calculate_inpu...
{ "split": "train", "index": 73327, "acecode_id": "oss_30803", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a string containing multiple quotes separated by '%' and returns a list of individual quotes. Each quote may contain leading and trailing whitespace, which should be removed in the output list. If the input string is empty or c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_quotes(' Hello World % Good Morning % Happy Coding ') == ['Hello World', 'Good Morning', 'Happy Coding']\", \"assert extract_quotes(' Quote 1 % Quote 2 % ') == ['Quote 1', 'Quote 2']\", \"assert extract_quotes('%%%') == []\", \"assert extr...
{ "split": "train", "index": 73328, "acecode_id": "bigcode_python_fns_29715", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function to validate a user's profile information. The function should check if the provided username, email, and date of birth meet the specified criteria. The criteria are as follows: \n1. The username must be a string with a maximum length of 5...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_user_profile('john_doe', 'john@example.com', '2005-01-15') == True\", \"assert validate_user_profile('a'*51, 'john@example.com', '2005-01-15') == False\", \"assert validate_user_profile('john_doe', 'invalid_email', '2005-01-15') == False\", \"assert...
{ "split": "train", "index": 73329, "acecode_id": "oss_7672", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the number of messages received by different Kafka consumers throughout the day. Each consumer can receive messages only from specific topics, and the total number of messages for each consumer is recorded in the list. Your task is ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert total_messages([10, 20, 30]) == 60\", \"assert total_messages([0, 0, 0]) == 0\", \"assert total_messages([100]) == 100\", \"assert total_messages([5, 15, 25, 35, 45]) == 125\", \"assert total_messages([1000, 2000, 3000]) == 6000\", \"assert total_messages([1...
{ "split": "train", "index": 73330, "acecode_id": "bigcode_python_fns_16097", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes audio data from a list of audio samples represented as integers. Your function should calculate the energy of the audio signal, which is defined as the average of the squared absolute values of the audio samples. The...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_audio_energy([1, 2, 3, 4]) == 7.5\", \"assert calculate_audio_energy([-1, -2, -3, -4]) == 7.5\", \"assert calculate_audio_energy([0, 0, 0, 0]) == 0.0\", \"assert calculate_audio_energy([]) == 0.0\", \"assert calculate_audio_energy([-1, 1]) == 1.0\"...
{ "split": "train", "index": 73331, "acecode_id": "oss_34951", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that calculates the distance between two geographical points given their latitude and longitude. The function should take four parameters: latitude1 (float), longitude1 (float), latitude2 (float), and longitude2 (float). The function shou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_distance(0, 0, -90, 0) == 10007.54\", \"assert calculate_distance(0, 0, 90, 0) == 10007.54\", \"assert calculate_distance(51.5074, -0.1278, 51.5074, -0.1278) == 0.00\", \"assert calculate_distance(0, 0, 0, 90) == 10007.54\", \"assert calculate_dist...
{ "split": "train", "index": 73332, "acecode_id": "bigcode_python_fns_13759", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given a list of domain names in the form of strings. Your task is to implement a function that takes this list of domain names and returns a string that lists the valid domain names, formatted in a specific way. A valid domain name must contain at least one character be...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list_valid_domains(['valid-domain.com', 'another-valid.net']) == 'Valid Domains: valid-domain.com, another-valid.net'\", \"assert list_valid_domains(['a.co', 'b.com', 'c.org']) == 'Valid Domains: a.co, b.com, c.org'\", \"assert list_valid_domains(['singlewor...
{ "split": "train", "index": 73333, "acecode_id": "bigcode_python_fns_22549", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Write a function `convert_markdown_to_html` that takes a string input `code` representing markdown text and returns the corresponding HTML representation of that markdown. The markdown can include headers, lists, bold text, italics, and links. You can assume that the input will...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_markdown_to_html('# Header 1') == '<h1>Header 1</h1>'\", \"assert convert_markdown_to_html('## Header 2') == '<h2>Header 2</h2>'\", \"assert convert_markdown_to_html('### Header 3') == '<h3>Header 3</h3>'\", \"assert convert_markdown_to_html('A parag...
{ "split": "train", "index": 73334, "acecode_id": "bigcode_python_fns_10061", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Implement a function that simulates the execution of a series of function calls, tracking exceptions that occur during the calls. The function should log errors for function calls numbered from 12 to 24, inclusive. Each function call will have a chance to raise an exception. If...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert my_function(30) == None\", \"assert my_function(15) == None\", \"assert my_function(25) == None\", \"assert my_function(24) == None\", \"assert my_function(12) == None\", \"assert my_function(10) == None\", \"assert my_function(35) == None\", \"assert my_fun...
{ "split": "train", "index": 73335, "acecode_id": "evol_9785", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the auto-update process of a media library. The function should take two parameters: `sync_with_mylist` (a boolean indicating whether to synchronize the library with a list of media items) and `silent` (a boolean indicating...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert auto_update_library(True, False) == ['add:movie1', 'add:movie2', 'remove:movie3']\", \"assert auto_update_library(True, True) == ['add:movie1', 'add:movie2', 'remove:movie3']\", \"assert auto_update_library(False, False) == []\", \"assert auto_update_library...
{ "split": "train", "index": 73336, "acecode_id": "bigcode_python_fns_36233", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a 2D array (list of lists) as input and returns a deep copy of that array. Your implementation should ensure that modifications to the copied array do not affect the original array. Additionally, your function should handle...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert copy2D([[1, 2, 3], [4, 5, 6]]) == [[1, 2, 3], [4, 5, 6]]\", \"assert copy2D([[], []]) == [[], []]\", \"assert copy2D([]) == []\", \"assert copy2D([[1, 2], [3, [4, 5]]]) == [[1, 2], [3, [4, 5]]]\", \"assert copy2D([[None, True], [False, 'string']]) == [[None,...
{ "split": "train", "index": 73337, "acecode_id": "evol_35565", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating the process of committing changes from a container to an image. Write a function `commit_changes(image: str) -> str` that takes a single string argument `image`. If the `image` is not equal to the string 'None', the function should return a messag...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert commit_changes('my_image') == 'Changes committed to my_image.'\", \"assert commit_changes('None') == 'No image provided for committing changes.'\", \"assert commit_changes('test_image') == 'Changes committed to test_image.'\", \"assert commit_changes('produc...
{ "split": "train", "index": 73338, "acecode_id": "bigcode_python_fns_7250", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two dictionaries, merge them and return a list of tuples representing the merged dictionary items sorted in decreasing order of the lengths of their values. Each tuple should contain the key and the value from the merged dictionary.\nPlease reason step by step, then write...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_dict({'a': 'apple', 'b': 'banana'}, {'c': 'cat', 'd': 'dog'}) == [('b', 'banana'), ('a', 'apple'), ('c', 'cat'), ('d', 'dog')]\", \"assert sort_dict({'x': 'x-ray', 'y': 'yellow'}, {'z': 'zebra', 'a': 'apple'}) == [('y', 'yellow'), ('x', 'x-ray'), ('z', ...
{ "split": "train", "index": 73339, "acecode_id": "evol_9177", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to convert GPS coordinates from decimal degrees to degrees, minutes, and seconds format. The input will be a float representing the coordinate in decimal degrees, and the output should be a tuple containing the degrees, minutes, and s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert dd_GPS_dms(0) == (0, 0, 0.0)\", \"assert dd_GPS_dms(45.0) == (45, 0, 0.0)\", \"assert dd_GPS_dms(180.0) == (180, 0, 0.0)\", \"assert dd_GPS_dms(30.5) == (30, 30, 0.0)\", \"assert dd_GPS_dms(-90.0) == (-90, 0, 0.0)\"]}" }
{ "split": "train", "index": 73340, "acecode_id": "oss_16301", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a dictionary where the keys are command line options and the values are lists of options that are implied by the corresponding key. Your task is to implement a function `resolve_options(implies, opts)` that takes this dictionary and a list of specified options, an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert resolve_options({'--debug': ['--verbose'], '--verbose': ['--info']}, ['--debug']) == {'--debug', '--verbose', '--info'}\", \"assert resolve_options({'--a': ['--b', '--c'], '--b': ['--d']}, ['--a']) == {'--a', '--b', '--c', '--d'}\", \"assert resolve_options(...
{ "split": "train", "index": 73341, "acecode_id": "bigcode_python_fns_33625", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with processing media sessions in a media processing system. Implement a function `process_media_session` that takes two parameters: `session` (a dictionary representing the current session with keys 'state' and 'payload') and `payload` (a string representing the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_media_session({'state': 'start', 'payload': 'media1', 'media_changed': True, 'media_finished': False}, 'media1') == [('stop', 'media1')]\", \"assert process_media_session({'state': 'pause', 'payload': 'media1', 'media_changed': False, 'media_finished...
{ "split": "train", "index": 73342, "acecode_id": "oss_7591", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that instantiates an object of either `SqrtGGNExact` or `SqrtGGNMC` based on the given parameters. The function should take in a list of integers (which may be None) representing the indices of active samples and an integer representing t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert instantiate_sqrt_ggn(None, 0) == SqrtGGNExact(subsampling=None)\", \"assert instantiate_sqrt_ggn([1, 2, 3], 0) == SqrtGGNExact(subsampling=[1, 2, 3])\", \"assert instantiate_sqrt_ggn([0], 5) == SqrtGGNMC(subsampling=[0], mc_samples=5)\", \"assert instantiate...
{ "split": "train", "index": 73343, "acecode_id": "bigcode_python_fns_16876", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `is_odd_cubed_root(num: int) -> bool` that determines if the cubed root of a given integer `num` is an odd integer. The function should return `True` if the cubed root is an odd integer, and `False` otherwise. Note that the cubed root should be a perfect cube f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_odd_cubed_root(64) == False\", \"assert is_odd_cubed_root(27) == True\", \"assert is_odd_cubed_root(8) == False\", \"assert is_odd_cubed_root(1) == True\", \"assert is_odd_cubed_root(0) == False\", \"assert is_odd_cubed_root(125) == True\", \"assert is_od...
{ "split": "train", "index": 73344, "acecode_id": "evol_33543", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a list of image file paths. The function should take two parameters: a list of image file paths (strings) and a review mode (integer). The review mode can be either 1 or 2. If the review mode is 1, the function should retur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_images(['img1.jpg', 'img2.jpg'], 1) == ['img1.jpg', 'img2.jpg']\", \"assert process_images(['img1.jpg', 'img2.jpg'], 2) == ['img1.jpg', 'img2.jpg']\", \"assert process_images([], 1) == []\", \"assert process_images([], 2) == []\", \"assert process_im...
{ "split": "train", "index": 73345, "acecode_id": "oss_34410", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a nested list of integers and a comparer function, implement a function `median(lst: list, comparer: callable) -> float` that computes the median of the flattened list. The comparer function takes two values and returns a positive number if the first is greater, a negativ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert median([[1, 2], [3, 4]], lambda x, y: x - y) == 2.5\", \"assert median([1, [2, 3], 4], lambda x, y: x - y) == 2.5\", \"assert median([[1, 2, 3], [4, 5, 6]], lambda x, y: x - y) == 3.5\", \"assert median([10, [20, 30], 40], lambda x, y: x - y) == 25.0\", \"as...
{ "split": "train", "index": 73346, "acecode_id": "evol_4418", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a 2D list of integers, where each sublist represents a row of a matrix. Your task is to implement a function that returns the transpose of the given matrix. The transpose of a matrix is obtained by swapping its rows with columns. For example, if the input matrix i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]\", \"assert transpose([[1]]) == [[1]]\", \"assert transpose([[1, 2], [3, 4], [5, 6]]) == [[1, 3, 5], [2, 4, 6]]\", \"assert transpose([[1, 2, 3]]) == [[1], [2], [3]]\", \"assert transpose([[1, 2],...
{ "split": "train", "index": 73347, "acecode_id": "oss_13165", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that calculates the health percentage of a unit in a strategy game. The function takes in four parameters: `health`, `health_max`, `map_type`, and `unit_type`, representing the current health, maximum health of the unit, the type of map, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_health_percentage(100, 200, 'MMM', 'medivac') == 0.5\", \"assert calculate_health_percentage(150, 300, 'GMMM', 'medivac') == 0.5\", \"assert calculate_health_percentage(150, 300, 'GMM', 'medivac') == 0.25\", \"assert calculate_health_percentage(100...
{ "split": "train", "index": 73348, "acecode_id": "oss_10706", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that computes the nth value of the modified Fibonacci sequence (Fibonacci sequence modulo m) in a memory-efficient manner. The function should be able to handle very large values of n up to 10^18 and m up to 10^5. The function signature is: def fibonacci_mo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci_mod(10, 2) == 1\", \"assert fibonacci_mod(7, 3) == 1\", \"assert fibonacci_mod(60, 10) == 0\", \"assert fibonacci_mod(0, 10) == 0\", \"assert fibonacci_mod(1, 5) == 1\", \"assert fibonacci_mod(2, 7) == 1\", \"assert fibonacci_mod(5, 6) == 5\", \"as...
{ "split": "train", "index": 73349, "acecode_id": "evol_18845", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Implement a function that takes a date string formatted as 'DD MMM YYYY' (where 'MMM' is the three-letter abbreviation for the month) and returns the corresponding day, month, and year as a tuple of integers. For example, given the input '01 Jan 2018', the output should be (1, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert decode_date('01 Jan 2018') == (1, 1, 2018)\", \"assert decode_date('15 Feb 2020') == (15, 2, 2020)\", \"assert decode_date('31 Mar 1999') == (31, 3, 1999)\", \"assert decode_date('07 Apr 2021') == (7, 4, 2021)\", \"assert decode_date('25 Dec 2022') == (25, 1...
{ "split": "train", "index": 73350, "acecode_id": "evol_4869", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that determines whether to update a user's profile settings based on their input. The function takes two boolean parameters: `path_update` and `completion_update`, which represent whether the user wants to update their path and enable com...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_profile_settings(None, None) == (True, True)\", \"assert update_profile_settings(None, False) == (True, False)\", \"assert update_profile_settings(True, None) == (True, True)\", \"assert update_profile_settings(False, None) == (False, True)\", \"asser...
{ "split": "train", "index": 73351, "acecode_id": "bigcode_python_fns_40340", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes search results based on a query and a filter. Your function, `process_search_results`, will take two inputs: a query string and a filter string. The function should simulate the retrieval of search results using a predefine...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_search_results('Python', 'Programming') == ['Python Programming by John Doe']\", \"assert process_search_results('Web', 'Web Development') == ['Web Development with Django by Bob White']\", \"assert process_search_results('Algorithms', 'Computer Scie...
{ "split": "train", "index": 73352, "acecode_id": "oss_11413", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of tenant names represented as strings. Your task is to implement a function that takes this list and returns a list of unique tenant names sorted in alphabetical order. Write a function `get_unique_tenants(tenant_list: List[str]) -> List[str]` that perform...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_tenants(['Alice', 'Bob', 'Alice', 'Charlie']) == ['Alice', 'Bob', 'Charlie']\", \"assert get_unique_tenants(['Tenant1', 'Tenant2', 'Tenant1', 'Tenant3', 'Tenant2']) == ['Tenant1', 'Tenant2', 'Tenant3']\", \"assert get_unique_tenants([]) == []\", \...
{ "split": "train", "index": 73353, "acecode_id": "bigcode_python_fns_40615", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with updating the version of a library in a given string representation of the library version file. The library versions are represented as a string where each line contains a version declaration in the format 'val {name} = Version(\"{version}\")'. Your job is t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_version('val LIB_A = Version(\\\"1.0.0\\\")\\\\nval LIB_B = Version(\\\"1.0.1\\\")\\\\n', 'com.example', 'LIB_A', '1.0.0') == True\", \"assert update_version('val LIB_A = Version(\\\"1.0.0\\\")\\\\nval LIB_B = Version(\\\"1.0.1\\\")\\\\n', 'com.exampl...
{ "split": "train", "index": 73354, "acecode_id": "bigcode_python_fns_35058", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a representation of a 2D grid where each cell can either be empty (0) or occupied (1). Your task is to implement a function `clear_grid(grid: List[List[int]]) -> List[List[int]]` that clears the grid by setting all occupied cells to empty. The function should retu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert clear_grid([[1, 1], [1, 1]]) == [[0, 0], [0, 0]]\", \"assert clear_grid([[0, 0], [0, 0]]) == [[0, 0], [0, 0]]\", \"assert clear_grid([[1, 0], [0, 0]]) == [[0, 0], [0, 0]]\", \"assert clear_grid([[0, 1], [0, 1]]) == [[0, 0], [0, 0]]\", \"assert clear_grid([[1...
{ "split": "train", "index": 73355, "acecode_id": "bigcode_python_fns_18555", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `extract_nested_list(array)` that takes a three-dimensional list (array) as input and returns a new nested list. Each inner list in the output must consist of the first and last integer values of each subarray found within the three-dimensional array. The funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_nested_list([[[], [None], []], [[None]], [[None]]]) == []\", \"assert extract_nested_list([[[None], [None], [None]], [[None]]]) == []\", \"assert extract_nested_list([[[1, 2, 3]], [[4, 5], [None, 'string']]]) == [[1, 3], [4, 5]]\", \"assert extract_n...
{ "split": "train", "index": 73356, "acecode_id": "evol_1113", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Implement a function `fibonacci(n: int) -> List[int]` that generates the first `n` numbers of the Fibonacci sequence. The Fibonacci sequence is defined as follows: the first two numbers are 0 and 1, and each subsequent number is the sum of the previous two. If `n` is less than ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci(0) == []\", \"assert fibonacci(1) == [0]\", \"assert fibonacci(2) == [0, 1]\", \"assert fibonacci(3) == [0, 1, 1]\", \"assert fibonacci(4) == [0, 1, 1, 2]\", \"assert fibonacci(5) == [0, 1, 1, 2, 3]\", \"assert fibonacci(6) == [0, 1, 1, 2, 3, 5]\",...
{ "split": "train", "index": 73357, "acecode_id": "evol_2730", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a custom data structure called `BDFCard`, which behaves like a list with a default value for out-of-range indices. Your task is to implement a function `create_bdf_card(size: int, default_value: Any) -> Tuple[Callable[[int], Any], Callable[[int,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get(0) == 0\", \"assert get(4) == 0\", \"assert get(5) == 0\", \"assert get(-1) == 0\", \"assert get(6) == 0\", \"assert get(6) == 0\", \"assert get(-1) == 0\", \"assert get(10) == 0\", \"assert get(3) == 0\"]}" }
{ "split": "train", "index": 73358, "acecode_id": "oss_6896", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Develop a function `evaluate_text(input_text: str) -> str` that accepts a sentence or a block of text as input. The function should evaluate if it contains any uncommon punctuation marks. If uncommon punctuation marks are found, it should indicate their frequency and respective...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert evaluate_text('Hello, world!') == 'Hello, world!'\", \"assert evaluate_text('This is a test sentence with \\u00a1uncommon punctuation!') == 'This is a test sentence with !uncommon punctuation!'\", \"assert evaluate_text('\\u00bfHow are you?') == '?How are yo...
{ "split": "train", "index": 73359, "acecode_id": "evol_19500", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a string `h`, write a function `ensure_hash_valid(h)` that checks if the string represents a valid hash. A valid hash is defined as a string that consists only of the characters '0'-'9', 'a'-'f', '-', and 'u'. The function should raise a `ValueError` with the message 'Inv...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert ensure_hash_valid('123abc-def-u') == True\", \"assert ensure_hash_valid('abcdef123-u') == True\", \"assert ensure_hash_valid('1234567890abcdef-u') == True\", \"assert ensure_hash_valid('a-b1c2d3e4-u') == True\", \"assert ensure_hash_valid('1a2b3c4d5e6f-u') =...
{ "split": "train", "index": 73360, "acecode_id": "bigcode_python_fns_1883", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a version comparison function that takes two version strings as input and returns whether the first version is greater than, equal to, or less than the second version according to semantic versioning rules. A version string is a series of number...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compare_versions('1.2.3', '1.2.4') == '-1'\", \"assert compare_versions('0.8.0', '0.7.9') == '1'\", \"assert compare_versions('2.0.0', '2.0.0') == '0'\", \"assert compare_versions('1.0.0', '1.0') == '0'\", \"assert compare_versions('1.0.1', '1.0') == '1'\", ...
{ "split": "train", "index": 73361, "acecode_id": "oss_18371", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a dictionary where each key maps to a sub-dictionary, write a function that retrieves the sub-dictionary associated with a specified key. If the key does not exist, the function should return None. Implement the function 'get_sub_dictionary(data: dict, key: str) -> dict' ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_sub_dictionary({'first': {'A': 1, 'B': 2}, 'second': {'C': 3, 'D': 4}}, 'second') == {'C': 3, 'D': 4}\", \"assert get_sub_dictionary({'first': {'A': 1, 'B': 2}, 'second': {'C': 3, 'D': 4}}, 'first') == {'A': 1, 'B': 2}\", \"assert get_sub_dictionary({'fi...
{ "split": "train", "index": 73362, "acecode_id": "evol_15907", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `resolve_hunks` that handles the resolution of rejected hunks during the patch application process for a version control system. The function should take in a string `patch_data` representing the patch content and a dictionary `variables`...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert resolve_hunks('This is a test patch. <<REJECTED_HUNK>>', {'T': 'value'}) == 'This is a test patch. value'\", \"assert resolve_hunks('No rejected hunks here.', {'T': 'value'}) == 'No rejected hunks here.'\", \"assert resolve_hunks('Apply this change. <<REJECT...
{ "split": "train", "index": 73363, "acecode_id": "oss_14130", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `process_words(s: str) -> Tuple[List[str], bool]`. The function takes a string `s` as input, which may contain a mix of valid words and Unicode characters. Your goal is to strip any Unicode characters from the input string and split i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_words('Hello, world!') == (['Hello,', 'world!'], False)\", \"assert process_words('Python3.8 is fun!') == (['Python3.8', 'is', 'fun!'], False)\", \"assert process_words('12345') == (['12345'], False)\", \"assert process_words('Normal text with no uni...
{ "split": "train", "index": 73364, "acecode_id": "oss_25704", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given a Python object, your task is to implement a function that checks if the object can be serialized to JSON and then deserialized back to its original form. The function should take one argument: the object to be tested. If the object can be successfully serialized and dese...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_roundtrip({'key': 'value'}) == True\", \"assert can_roundtrip([1, 2, 3]) == True\", \"assert can_roundtrip('hello') == True\", \"assert can_roundtrip(42) == True\", \"assert can_roundtrip(True) == True\", \"assert can_roundtrip(None) == True\", \"assert ...
{ "split": "train", "index": 73365, "acecode_id": "bigcode_python_fns_16414", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simple process management system. You need to implement a function `manage_processes(operations)` that takes a list of operations and returns a list of results based on the following operations: \n\n1. `'create'`: Cre...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_processes([('create', 'process1'), ('create', 'process1')]) == ['Created process process1', 'Error: Process already exists']\", \"assert manage_processes([('start', 'process1')]) == ['Error: Process does not exist']\", \"assert manage_processes([('cre...
{ "split": "train", "index": 73366, "acecode_id": "oss_25110", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Implement a function `remove_duplicates(text: str) -> str` that takes a string `text` as input and removes all duplicate words from it, preserving their first occurrence while maintaining the original casing. Words that only differ in casing (e.g., 'Word' and 'word') should not...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_duplicates('Hello world hello World') == 'Hello world hello World'\", \"assert remove_duplicates('A quick brown fox jumps over the lazy dog A quick brown fox') == 'A quick brown fox jumps over the lazy dog'\", \"assert remove_duplicates('One two three...
{ "split": "train", "index": 73367, "acecode_id": "evol_29257", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `string_sequence(n: int) -> str` that takes an integer n as input and returns a string containing all integers from 0 to n inclusive, separated by spaces. For example, if n is 5, the function should return '0 1 2 3 4 5'.\nPlease reason step by step, then write ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert string_sequence(0) == '0'\", \"assert string_sequence(1) == '0 1'\", \"assert string_sequence(2) == '0 1 2'\", \"assert string_sequence(3) == '0 1 2 3'\", \"assert string_sequence(4) == '0 1 2 3 4'\", \"assert string_sequence(5) == '0 1 2 3 4 5'\", \"assert ...
{ "split": "train", "index": 73368, "acecode_id": "evol_34692", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a custom decorator `skipMPI` that allows you to skip certain test cases based on the version of the Message Passing Interface (MPI) library being used. The `skipMPI` decorator takes a single argument, which is a string representing the version o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compare_versions('msmpi<8.1.0', 'msmpi<8.1.0') == True\", \"assert compare_versions('msmpi<8.1.0', 'msmpi<8.1.0') == True\", \"assert compare_versions('msmpi<8.2.0', 'msmpi<8.2.0') == True\", \"assert compare_versions('msmpi<9.0.0', 'msmpi<8.9.9') == True\",...
{ "split": "train", "index": 73369, "acecode_id": "oss_17892", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function `classify_numbers` that identifies and returns a tuple containing two lists: the first list should contain all perfect numbers from the input list, and the second list should contain all deficient numbers from the input list. A per...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert classify_numbers([1, 2, 3, 4, 5]) == ([], [1, 2, 3, 4, 5])\", \"assert classify_numbers([6, 28, 496]) == ([6, 28, 496], [])\", \"assert classify_numbers([]) == ([], [])\", \"assert classify_numbers([28, 6]) == ([28, 6], [])\", \"assert classify_numbers([1, 2...
{ "split": "train", "index": 73370, "acecode_id": "evol_17050", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function `calculate_shape_properties` that takes in a shape type ('triangle' or 'pentagon') and a side length (a positive integer) as input. The function should return a tuple containing the perimeter and area of the specified shape. The area of a triangle is given ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_shape_properties('triangle', 10) == (30, 43.30127018922193)\", \"assert calculate_shape_properties('pentagon', 5) == (25, 43.01193501472417)\", \"assert calculate_shape_properties('pentagon', 10) == (50, 172.0477400588967)\", \"assert calculate_sha...
{ "split": "train", "index": 73371, "acecode_id": "evol_22833", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a list of image filenames and a pattern string, write a function that identifies and returns a sorted list of filenames that match the given pattern. The pattern can contain wildcard characters: '*' which matches any sequence of characters and '?' which matches exactly on...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert identify_matching_images(['image1.jpg', 'img2.png', 'sample.jpg', 'test.png'], 'img?.png') == ['img2.png']\", \"assert identify_matching_images(['a.jpg', 'b.jpg', 'c.jpg'], '?.jpg') == ['a.jpg', 'b.jpg', 'c.jpg']\", \"assert identify_matching_images(['abc.jp...
{ "split": "train", "index": 73372, "acecode_id": "bigcode_python_fns_19764", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of services, where each service is represented as a dictionary containing a 'title' and an 'id'. Implement a function `return_signal_by_title(services: List[Dict[str, str]], reqid: str) -> str` that takes in a list of services and a service title (reqid) an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert return_signal_by_title([{'title': 'ECU Reset', 'id': '11'}, {'title': 'Security Access', 'id': '27'}], 'ECU Reset') == '11'\", \"assert return_signal_by_title([{'title': 'ECU Reset', 'id': '11'}, {'title': 'Security Access', 'id': '27'}], 'Security Access') ...
{ "split": "train", "index": 73373, "acecode_id": "bigcode_python_fns_15278", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string token and a preceding string preceding_token, implement a function that determines if the token ends an Akkadian sign based on the following rules: 1) If preceding_token is empty, return False. 2) If the token contains either a hyphen '-' or a period '.', return ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert end_of_sign_found('token1', 'preceding1') == True\", \"assert end_of_sign_found('token2-', 'preceding2') == True\", \"assert end_of_sign_found('token3.', 'preceding3') == True\", \"assert end_of_sign_found('##token4', 'preceding4') == False\", \"assert end_o...
{ "split": "train", "index": 73374, "acecode_id": "bigcode_python_fns_33942", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 3D matrix where each element is a ternary (three-valued) variable represented by integers 0, 1, and 2, write a function that transforms the values as follows: 0 should be converted to 'Yes', 1 should be converted to 'No', and 2 should be converted to 'Maybe'. Your funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert most_common_output([[[0,0,0], [0,0,0]], [[0,0,0], [0,0,0]], [[0,0,0], [0,0,0]]]) == 'Yes'\", \"assert most_common_output([[[1,1,1], [1,1,1]], [[1,1,1], [1,1,1]], [[1,1,1], [1,1,1]]]) == 'No'\", \"assert most_common_output([[[2,2,2], [2,2,2]], [[2,2,2], [2,2,...
{ "split": "train", "index": 73375, "acecode_id": "evol_26820", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function called `parse_params` that parses a dictionary of input parameters based on a given specification. The function should handle the parsing of input parameters according to the provided specification and return a new dictionary w...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_params({'u': 'http://example.com'}, NIF_PARAMS) == {'urischeme': 'http://example.com'}\", \"assert parse_params({}, NIF_PARAMS) == {'urischeme': 'RFC5147String'}\", \"assert parse_params({'u': 'http://example.com'}, NIF_PARAMS) == {'urischeme': 'http:/...
{ "split": "train", "index": 73376, "acecode_id": "oss_5743", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with organizing a list of function names based on their prefixes, which indicate the type of geometric data structure they operate on. Implement a function `organize_functions(functions: List[str]) -> Dict[str, List[str]]` that takes a list of function names as i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert organize_functions(['crs_function1']) == {'crs': ['crs_function1'], 'poly_clip': [], 'poly_seam': [], 'poly_clipper': [], 'mesh_fine': [], 'mesh_coarse': [], 'jig_buffer_mesh': [], 'jig_clip_hires': [], 'jig_clip_lowres': [], 'jig_combined_mesh': [], 'buffer...
{ "split": "train", "index": 73377, "acecode_id": "oss_8358", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `median(l: list)` that returns the median of elements in the list `l` without sorting it. The function should handle tuples with diverse element lengths and should be able to process both negative integers and floating point numbers. If the list has an even...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert median([1, 2, 3]) == 2\", \"assert median([1.5, 2.5, 3.5]) == 2.5\", \"assert median([-1, -2, -3, -4]) == -2.5\", \"assert median([5, 3, 8, 9, 7]) == 7\", \"assert median([2.2, 3.3, 4.4]) == 3.3\", \"assert median([]) == 'No median exists'\", \"assert median...
{ "split": "train", "index": 73378, "acecode_id": "evol_25745", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two arrays of integers, implement a function that checks if the two arrays contain the same unique elements and have the same length. The function should return True if both conditions are met, and False otherwise. For example, given arr1 = [1, 2, 3, 4, 5] and arr2 = [5, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compare([1, 2, 3, 4, 5], [5, 4, 3, 2, 1]) == True\", \"assert compare([1, 2, 3], [3, 2, 1]) == True\", \"assert compare([1, 2, 2], [1, 2]) == False\", \"assert compare([1, 2, 3], [1, 2, 3, 4]) == False\", \"assert compare([], []) == True\", \"assert compare(...
{ "split": "train", "index": 73379, "acecode_id": "evol_4858", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two integers, `a` and `b`, and a desired precision `p`. Your task is to create a function `full_mul_modifier(a: int, b: int, p: int) -> int` that multiplies the two integers `a` and `b` after converting both of them to the specified precision `p`. The function sho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert full_mul_modifier(3, 4, 8) == 12\", \"assert full_mul_modifier(2, 5, 8) == 10\", \"assert full_mul_modifier(2, 3, 4) == 6\", \"assert full_mul_modifier(7, 8, 8) == 56\", \"assert full_mul_modifier(15, 15, 8) == 225\", \"assert full_mul_modifier(1, 1, 1) == 1...
{ "split": "train", "index": 73380, "acecode_id": "bigcode_python_fns_38339", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a mock HTML content string and extracts a specific URL from it. The function should take a string representing HTML content as input and extract the href attribute value from the first anchor tag found within a div w...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_and_join_url('<html><body><div class=\\\"repository\\\"><a href=\\\"/example-page\\\">Link</a></div></body></html>', 'https://example.com') == 'https://example.com/example-page'\", \"assert extract_and_join_url('<html><body><div class=\\\"repository\...
{ "split": "train", "index": 73381, "acecode_id": "oss_2227", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function `apply_decorator` that takes the list and a decorator function as input. The decorator function should modify each integer in the list by multiplying it by 2. The function should return a new list containing the modified integers. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert apply_decorator([1, 2, 3], lambda x: x * 2) == [2, 4, 6]\", \"assert apply_decorator([-1, -2, -3], lambda x: x * 2) == [-2, -4, -6]\", \"assert apply_decorator([0], lambda x: x * 2) == [0]\", \"assert apply_decorator([], lambda x: x * 2) == []\", \"assert ap...
{ "split": "train", "index": 73382, "acecode_id": "bigcode_python_fns_21382", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a graph represented by nodes, where each node has a list of neighboring nodes. Your task is to implement a function that takes a current node as input and returns a list of all neighboring nodes of that current node which are not already visited (i.e., not in the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert traverse_graph(Node('A')) == []\", \"assert traverse_graph(Node('B')) == []\", \"assert traverse_graph(Node('C')) == []\"]}" }
{ "split": "train", "index": 73383, "acecode_id": "oss_35520", "num_tests": 3 }
acecode
[ { "role": "user", "content": "Given a string `text`, implement a function `embed(text: str) -> List[int]` that simulates embedding the text sequence using a hypothetical tokenizer. The tokenizer splits the text into tokens based on spaces and punctuation, and then converts each token to a corresponding inte...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert embed('hello world') == [1, 2]\", \"assert embed('hello') == [1]\", \"assert embed('world') == [2]\", \"assert embed('hello hello') == [1, 1]\", \"assert embed('Hello world') == [0, 2]\", \"assert embed('') == []\", \"assert embed('hello world') == [1, 2]\"...
{ "split": "train", "index": 73384, "acecode_id": "bigcode_python_fns_37398", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a logging function for a multiplayer online game. The logging function needs to record the creation of new player profiles. Write a function `log_player_creation(user_id, player_id)` that takes two string inputs: `user_id` and `player_id`. The f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert log_player_creation('user1', 'player1') == 'Player for user user1 has been created with player_id player1'\", \"assert log_player_creation('user2', 'player2') == 'Player for user user2 has been created with player_id player2'\", \"assert log_player_creation(...
{ "split": "train", "index": 73385, "acecode_id": "oss_36497", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates a simple banking operation. The function should take in three parameters: the account balance, the amount to deposit, and the amount to withdraw. Your function will perform the deposit and withdrawal operations and r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert banking_operations(100, 50, 30) == 120\", \"assert banking_operations(200, 0, 50) == 150\", \"assert banking_operations(0, 100, 50) == 50\", \"assert banking_operations(50, 30, 100) == 80\", \"assert banking_operations(100, 100, 0) == 200\", \"assert banking...
{ "split": "train", "index": 73386, "acecode_id": "oss_36499", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of buildings in a city. Your task is to implement a function that returns the maximum height among the buildings that are visible from the left side of the city. A building is considered visible from the left if it is ta...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_visible_height([1, 3, 2, 5, 4]) == 5\", \"assert max_visible_height([5, 4, 3, 2, 1]) == 5\", \"assert max_visible_height([1, 2, 3, 4, 5]) == 5\", \"assert max_visible_height([2, 1, 3, 2, 5]) == 5\", \"assert max_visible_height([3, 3, 3, 3, 3]) == 3\", \"...
{ "split": "train", "index": 73387, "acecode_id": "bigcode_python_fns_39537", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes two integers as input and returns their sum. The function should be named `add_two_numbers`. You need to ensure that the function can handle both positive and negative integers, as well as zero. The function signature shoul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_two_numbers(1, 2) == 3\", \"assert add_two_numbers(-1, 1) == 0\", \"assert add_two_numbers(0, 0) == 0\", \"assert add_two_numbers(5, 5) == 10\", \"assert add_two_numbers(-5, -5) == -10\", \"assert add_two_numbers(100, 200) == 300\", \"assert add_two_numb...
{ "split": "train", "index": 73388, "acecode_id": "oss_4948", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a Python dictionary `state_dict` containing information about the states in a country. Each key-value pair in the dictionary represents a state and its corresponding attributes. Your task is to write a function that extracts and returns the names of the states who...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert states_with_letter_a({'California': {}, 'Texas': {}, 'New York': {}, 'Florida': {}}) == ['California', 'Texas', 'Florida']\", \"assert states_with_letter_a({'Alabama': {}, 'Georgia': {}, 'Ohio': {}, 'Utah': {}}) == ['Alabama', 'Georgia', 'Utah']\", \"assert ...
{ "split": "train", "index": 73389, "acecode_id": "oss_5328", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a string that may contain both lowercase and uppercase letters as well as special characters, write a function to generate a list of all possible unique character combinations in which the order of selection matters. Implement the function with an option to limit the maxi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert combinations('abc', 2) == ['ab', 'ac', 'ba', 'bc', 'ca', 'cb']\", \"assert combinations('ab', 1) == ['a', 'b']\", \"assert combinations('', 3) == []\", \"assert combinations('xyz', 3) == ['xyz', 'xzy', 'yxz', 'yzx', 'zxy', 'zyx']\", \"assert combinations('!@...
{ "split": "train", "index": 73390, "acecode_id": "evol_36185", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given a directory path as a string, implement a function `create_new_profile(config_dir: str) -> dict` that simulates the creation of a configuration profile. The function should return a dictionary containing the following keys and their respective values: 'okta_url', 'api_tok...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_new_profile('some/path') == {'okta_url': 'https://example.com', 'api_token': '1234567890abcdef', 'id': 'profile-1'}\", \"assert create_new_profile('another/path') == {'okta_url': 'https://example.com', 'api_token': '1234567890abcdef', 'id': 'profile-1...
{ "split": "train", "index": 73391, "acecode_id": "bigcode_python_fns_16770", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the output channels for each stage of a neural network module called ShuffleNetV2 based on given parameters. The function should take two lists: `stages_repeats` and `stages_out_channels`, where `stages_repeats` repres...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_output_channels([2, 3], [16, 32]) == [16, 32]\", \"assert calculate_output_channels([1], [24]) == [24]\", \"assert calculate_output_channels([], []) == []\", \"assert calculate_output_channels([4], [64]) == [64]\", \"assert calculate_output_channel...
{ "split": "train", "index": 73392, "acecode_id": "oss_30190", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Design a function that searches for a specific word and its variations within a given text. The variations include case-insensitive matches and patterns that use regular expressions. The function should return the count of matches found. For the variations, consider words like ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_variations('The Felis cat is a small cat family member', 'Felis') == 1\", \"assert count_variations('Felis is known for its agility and grace', 'felis') == 1\", \"assert count_variations('F.lis and Felis123 are different', 'F.lis') == 1\", \"assert cou...
{ "split": "train", "index": 73393, "acecode_id": "evol_18810", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of integers as input and returns a sorted version of the list in ascending order. You must implement your own sorting algorithm instead of using built-in Python methods for sorting. Your solution should be able to handle negative integers ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert quick_sort([5, 2, -9, 0, 5, 6]) == [-9, 0, 2, 5, 5, 6]\", \"assert quick_sort([3, 1, 4, 1, 5, 9, 2]) == [1, 1, 2, 3, 4, 5, 9]\", \"assert quick_sort([0, -1, -2, -3]) == [-3, -2, -1, 0]\", \"assert quick_sort([10, 20, 30]) == [10, 20, 30]\", \"assert quick_so...
{ "split": "train", "index": 73394, "acecode_id": "evol_773", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a directed acyclic graph (DAG) represented as a list of edges. Each edge is a tuple of two nodes (u, v) indicating a directed edge from node u to node v. Your task is to transform this DAG into a bidirected graph by adding an opposing edge for every existing edge....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bidirected([(1, 2), (1, 3), (2, 4)]) == [(1, 2), (2, 1), (1, 3), (3, 1), (2, 4), (4, 2)]\", \"assert bidirected([(0, 1), (1, 2)]) == [(0, 1), (1, 0), (1, 2), (2, 1)]\", \"assert bidirected([(5, 6), (6, 7), (7, 5)]) == [(5, 6), (6, 5), (6, 7), (7, 6), (7, 5),...
{ "split": "train", "index": 73395, "acecode_id": "bigcode_python_fns_40852", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Define a Python function that converts a JSON string containing personal details into a Python dictionary. The JSON string will include keys for 'name', 'age', 'city', 'job_title', and 'employer'. If any of these keys are missing in the JSON data, your function should add them ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert json_to_dict('{\\\"name\\\": \\\"Alice\\\", \\\"age\\\": 28, \\\"city\\\": \\\"Los Angeles\\\", \\\"job_title\\\": \\\"Data Scientist\\\", \\\"employer\\\": \\\"Tech Corp\\\"}') == {'name': 'Alice', 'age': 28, 'city': 'Los Angeles', 'job_title': 'Data Scient...
{ "split": "train", "index": 73396, "acecode_id": "evol_36155", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two integers base and exponent, write a function that computes the remainder when the sum of base raised to the power of exponent and a given integer addend is divided by a specified divisor.\nPlease reason step by step, then write a self-contained Python solution. Give y...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_remainder(5, 3, 4, 10) == 9\", \"assert calculate_remainder(4, 4, 5, 6) == 3\", \"assert calculate_remainder(1, 100, 5, 3) == 0\", \"assert calculate_remainder(0, 5, 4, 3) == 1\", \"assert calculate_remainder(12, 2, 4, 10) == 8\", \"assert calculat...
{ "split": "train", "index": 73397, "acecode_id": "evol_6520", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Given a point represented as a tuple of two integers (x, y) and a list of points where each point is also represented as a tuple of two integers (x, y), write a function `closest(point: Tuple[int, int], points: List[Tuple[int, int]]) -> int` that returns the index of the point ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert closest((0, 0), [(1, 1), (2, 2), (3, 3)]) == 0\", \"assert closest((0, 0), [(0, 0), (1, 1), (2, 2)]) == 0\", \"assert closest((10, 10), [(10, 10), (10, 11), (11, 10)]) == 0\", \"assert closest((-1, -1), [(1, 1), (-1, 2), (-2, -2)]) == 2\", \"assert closest((...
{ "split": "train", "index": 73398, "acecode_id": "bigcode_python_fns_1226", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function `fibonacci_product(start: int, end: int) -> int` that calculates the product of all Fibonacci numbers in the inclusive range from `start` to `end`. The Fibonacci sequence is defined as follows: F(0) = 0, F(1) = 1, and F(n) = F(n-1) + F(n-2) for n >= 2. The ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci_product(0, 0) == 0\", \"assert fibonacci_product(1, 1) == 1\", \"assert fibonacci_product(0, 1) == 0\", \"assert fibonacci_product(2, 3) == 2\", \"assert fibonacci_product(3, 5) == 15\", \"assert fibonacci_product(2, 5) == 30\", \"assert fibonacci_...
{ "split": "train", "index": 73399, "acecode_id": "evol_15140", "num_tests": 9 }