data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "You are tasked with developing a function that manages a blog system. The function `manage_blog` should handle two operations: displaying all blog posts in descending order of their publication time and deleting a specified blog post based on its ID. You are given a list of blo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_blog([{'id': 1, 'post_time': '2023-10-01'}, {'id': 2, 'post_time': '2023-10-02'}], 2) == [{'id': 1, 'post_time': '2023-10-01'}]\", \"assert manage_blog([{'id': 1, 'post_time': '2023-10-01'}, {'id': 2, 'post_time': '2023-10-02'}], 3) == [{'id': 2, 'pos... | {
"split": "train",
"index": 74700,
"acecode_id": "bigcode_python_fns_22550",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers, merge them into a single list without any duplicates. The merged list should contain elements from the first list followed by elements from the second list, while ensuring that the order of elements is based on their frequency in the first list. If ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_lists([1, 1, 1], [2, 2, 2]) == [1, 2]\", \"assert merge_lists([], [1, 2, 3]) == [1, 2, 3]\", \"assert merge_lists([5, 5, 5, 6], [6, 7, 8]) == [5, 6, 7, 8]\", \"assert merge_lists([1, 2, 3], [1, 2, 3]) == [1, 2, 3]\", \"assert merge_lists([1], [2]) == [... | {
"split": "train",
"index": 74701,
"acecode_id": "evol_1052",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a dictionary of query parameters and returns a structured dictionary containing lists of user-related data. The input is a dictionary called `GET_params`, which may contain keys corresponding to different data types. Your f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_user_data({}) == {'orthographies': ['Orthography1', 'Orthography2'], 'roles': ['Admin', 'User'], 'markup_languages': ['HTML', 'Markdown']}\", \"assert get_user_data({'orthographies': 'update'}) == {'orthographies': ['Orthography1', 'Orthography2'], 'role... | {
"split": "train",
"index": 74702,
"acecode_id": "bigcode_python_fns_39117",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given two positive integers a and b (a <= b), a starting number (start), and an operation (either '+' or '*'). Your task is to perform the operation on all the numbers from a through b (inclusive), starting with the 'start' number. Then, convert the operation result int... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert operation_result(7, 5, 2, '+', 2) == -1\", \"assert operation_result(1, 1, 0, '+', 2) == '0b1'\", \"assert operation_result(3, 3, 3, '+', 5) == '0b110'\", \"assert operation_result(4, 6, -1, '+', 2) == -1\", \"assert operation_result(5, 5, 0, '*', 2) == '0b0... | {
"split": "train",
"index": 74703,
"acecode_id": "evol_11350",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that validates if a given input string follows a specific structure defined by a sequence of expected tokens. Each expected token is represented by a tuple consisting of a token type and an optional attribute. The function should retu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_tokens('spec($PYSYN_CDBS//calspec/gd71_mod_005.fits)', [('IDENTIFIER', 'spec'), ('LPAREN', None), ('IDENTIFIER', '$PYSYN_CDBS//calspec/gd71_mod_005.fits'), ('RPAREN', None)]) == True\", \"assert validate_tokens('invalid(input)', [('IDENTIFIER', 'spe... | {
"split": "train",
"index": 74704,
"acecode_id": "oss_27878",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string `date_range` in the format 'YYYY-MM-DD to YYYY-MM-DD', a float `resolution`, and an integer `ensemble_size`. Your task is to write a function `simulate_crops(date_range: str, resolution: float, ensemble_size: int) -> str` that simulates crop growth from t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_crops('2023-01-01 to 2023-01-10', 0.5, 5) == 'Simulation successful for 9 crops with a resolution of 0.5 and ensemble size of 5'\", \"assert simulate_crops('2023-05-01 to 2023-05-05', 1.0, 10) == 'Simulation successful for 4 crops with a resolution ... | {
"split": "train",
"index": 74705,
"acecode_id": "bigcode_python_fns_21756",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers and returns a list of their corresponding squares. Your function should handle both positive and negative integers, as well as zero. The output list should maintain the same order as the input list. Imple... | 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([4, -4, 0]) == [16, 16, 0]\", \"assert square_numbers([]) == []\", \"assert square_numbers([1]) == ... | {
"split": "train",
"index": 74706,
"acecode_id": "bigcode_python_fns_19001",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `sum_of_squares(nums: List[int]) -> int` that calculates and returns the sum of the squares of the integers in the list. The input list may contain both positive and negative integers as well as zero. Your function should handle an emp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_squares([1, 2, 3]) == 14\", \"assert sum_of_squares([-1, -2, -3]) == 14\", \"assert sum_of_squares([0]) == 0\", \"assert sum_of_squares([]) == 0\", \"assert sum_of_squares([1, 0, -1]) == 2\", \"assert sum_of_squares([4, 5, 6]) == 77\", \"assert sum_of... | {
"split": "train",
"index": 74707,
"acecode_id": "oss_4912",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a data processing pipeline for environmental data analysis. Your function should take the following parameters: a list of models (strings), a list of variables (strings), a list of pressure values (strings), a start time (s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_environment_data(['model1_var1', 'model2_var2'], ['temperature', 'humidity'], ['1013', '1020'], '20230101', '20230201', '10.0', '20.0', '30.0', '40.0') == {'nVar': 2, 'center': ['model1', 'model2'], 'model': ['model1_var1', 'model2_var2'], 'varName':... | {
"split": "train",
"index": 74708,
"acecode_id": "bigcode_python_fns_10458",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a list of date-time strings in the format 'YYYY-MM-DDTHH:MM:SS', write a function that returns the count of date-time strings that have a length greater than 10 characters. The input list is guaranteed to contain at least one date-time string. The function should only imp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_long_date_times(['2023-01-01T12:00:00', '2022-12-31T23:59:59', '2023-01-05T00:00:00']) == 3\", \"assert count_long_date_times(['2023-01-01T12:00:00', '2022-12-31']) == 1\", \"assert count_long_date_times(['2023-01-01', '2022-12-31T23:59:59']) == 1\", \... | {
"split": "train",
"index": 74709,
"acecode_id": "bigcode_python_fns_12426",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string 'text' which represents a shell script. Write a function 'execute_script' that simulates the execution of this shell script. The function should return a string indicating the exit status of the script. If the script contains the command 'exit 0', return ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert execute_script('exit 0') == 'Success'\", \"assert execute_script('exit 1') == 'Failure'\", \"assert execute_script('echo Hello World') == 'Unknown command'\", \"assert execute_script('exit 0; echo done') == 'Success'\", \"assert execute_script('exit 1; echo ... | {
"split": "train",
"index": 74710,
"acecode_id": "bigcode_python_fns_1015",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `manage_stack(operations: List[Tuple[str, Union[int, None]]]) -> List[Union[int, None]]` that simulates a stack data structure based on a list of operations. The operations are represented as a list of tuples where the first element is a string indicating t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_stack([('push', 1), ('push', 2), ('peek', None)]) == [2]\", \"assert manage_stack([('push', 5), ('pop', None), ('pop', None)]) == [5, None]\", \"assert manage_stack([('pop', None)]) == [None]\", \"assert manage_stack([('push', 3), ('push', 4), ('push'... | {
"split": "train",
"index": 74711,
"acecode_id": "oss_1560",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of car manufacturers and their respective car models, and returns a list of car models for a specific manufacturer. The function should accept two parameters: a list of dictionaries where each dictionary contains 'manufa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_car_models_by_manufacturer([{'manufacturer': 'Toyota', 'car_models': ['Camry', 'Corolla']}, {'manufacturer': 'Honda', 'car_models': ['Civic', 'Accord']}], 'Toyota') == ['Camry', 'Corolla']\", \"assert get_car_models_by_manufacturer([{'manufacturer': 'For... | {
"split": "train",
"index": 74712,
"acecode_id": "oss_36833",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with developing a function that computes the average latency from a list of latency measurements in milliseconds. Your function should handle cases where the input list may be empty. If the list is empty, your function should return 0. Write a Python function `ca... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_latency([10.0, 20.0, 30.0]) == 20.0\", \"assert calculate_average_latency([1.5, 2.5, 3.5, 4.5]) == 3.0\", \"assert calculate_average_latency([0.0, 0.0, 0.0]) == 0.0\", \"assert calculate_average_latency([]) == 0.0\", \"assert calculate_aver... | {
"split": "train",
"index": 74713,
"acecode_id": "oss_5323",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary that describes configurations for a sequence of layers in a neural network, where each layer has specific hyper-parameters including its type. Your task is to implement a function `create_layer_sequence(layer_configs, input_shape)` that takes in two p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_layer_sequence({'layer1': {'layer_type': 'Dense', 'units': 128}}, [1, 256]) == [('layer1', [1, 128])]\", \"assert create_layer_sequence({'layer1': {'layer_type': 'Dense', 'units': 256}}, [1, 512]) == [('layer1', [1, 256])]\", \"assert create_layer_seq... | {
"split": "train",
"index": 74714,
"acecode_id": "bigcode_python_fns_15866",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given two lists, `da_u` and `da_v`, representing the values of u-point and v-point data arrays respectively. Each list is a 2D array-like structure containing numerical values. Your task is to write a function `add_border_to_data_arrays(da_u: List[List[float]], da_v: Li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_border_to_data_arrays([[1, 2], [3, 4]], [[5], [6, 7]]) == [[1, 2, 5], [3, 4, 6]]\", \"assert add_border_to_data_arrays([[1]], [[2]]) == [[1, 2]]\", \"assert add_border_to_data_arrays([[1, 2]], [[5, 6]]) == [[1, 2, 5]]\", \"assert add_border_to_data_array... | {
"split": "train",
"index": 74715,
"acecode_id": "bigcode_python_fns_33496",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Construct a function that yields the unique members present in two provided arrays in ascending order. The solution must bypass the usage of Python's default functions intended for sorting outcomes and duplicates elimination. The function should be implemented in a linear-logar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shared_elements([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]) == [1, 5, 653]\", \"assert shared_elements([5, 3, 2, 8], [3, 2]) == [2, 3]\", \"assert shared_elements([1, 2, 3], [4, 5, 6]) == []\", \"assert shared_elements([1, 1, 1], [1, 1, 1]) == [1]\"... | {
"split": "train",
"index": 74716,
"acecode_id": "evol_8621",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `remove_duplicates` that removes duplicate integers from the list while preserving the original order of the elements. The function should return a new list containing only the unique integers. The input list may contain both positive ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_duplicates([1, 2, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert remove_duplicates([5, 5, 5, 5]) == [5]\", \"assert remove_duplicates([]) == []\", \"assert remove_duplicates([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert remove_duplicates([-1, -1, 0, 1, 1]) =... | {
"split": "train",
"index": 74717,
"acecode_id": "bigcode_python_fns_34271",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function that accepts two parameters: a numeric input value 'y' and an arbitrary base 'b'. The function should perform multiplication of 'y' by 'b', and if 'b' is not provided, it should default to multiplying 'y' by 2. Additionally, implement error handling to ensure ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert base_operation(5) == 10\", \"assert base_operation(5, 3) == 15\", \"assert base_operation(-5) == -10\", \"assert base_operation(-5, 4) == -20\", \"assert base_operation(0) == 0\", \"assert base_operation(0, 5) == 0\", \"assert base_operation(10.5) == 21.0\",... | {
"split": "train",
"index": 74718,
"acecode_id": "evol_3014",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a 2D grid of size m x n where each cell can be either 0 (water) or 1 (land), write a function `count_islands(grid: List[List[int]]) -> int` that returns the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vert... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_islands([[0, 0, 0, 0], [0, 1, 1, 0], [0, 0, 0, 0]]) == 1\", \"assert count_islands([[1, 1, 0, 0], [1, 0, 0, 1], [0, 0, 1, 1], [0, 0, 0, 0]]) == 2\", \"assert count_islands([[0, 0], [0, 0]]) == 0\", \"assert count_islands([[1, 1], [1, 1]]) == 1\", \"ass... | {
"split": "train",
"index": 74719,
"acecode_id": "bigcode_python_fns_3988",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes an integer n (where n is greater than or equal to 0) and returns the sum of all integers from 1 to n, inclusive. You must use a recursive approach. For example, given n = 5, the function should return 15, since 1 + 2 + 3 + 4 + 5 = 15.\nPlease rea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert accumulate_numbers(0) == 0\", \"assert accumulate_numbers(1) == 1\", \"assert accumulate_numbers(2) == 3\", \"assert accumulate_numbers(3) == 6\", \"assert accumulate_numbers(4) == 10\", \"assert accumulate_numbers(5) == 15\", \"assert accumulate_numbers(6) ... | {
"split": "train",
"index": 74720,
"acecode_id": "evol_13112",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a dictionary representing metadata of an uploaded file and returns a formatted log message string containing the file name, size, content type, and creation time. The input dictionary will have the following keys: 'name' (str), 'size' (int), 'con... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_file_metadata({'name': 'example.txt', 'size': 2048, 'content_type': 'text/plain', 'time_created': '2023-10-01T10:00:00Z'}) == 'File: example.txt, Size: 2048, Content Type: text/plain, Created On: 2023-10-01T10:00:00Z'\", \"assert format_file_metadata(... | {
"split": "train",
"index": 74721,
"acecode_id": "evol_34669",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing HTTP headers. Your task is to implement a function that extracts specific link headers based on a list of target header relations. The function should return a dictionary where each key is a relation from the target headers and the value ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_links({'link': '<https://example.com>; rel=\\\"next\\\"', 'x-pingback': 'invalid-url'}, ['next']) == {'next': {'url': 'https://example.com', 'mime_type': ''}}\", \"assert extract_links({'link': '<https://example.com>; rel=\\\"next\\\"', 'x-pingback':... | {
"split": "train",
"index": 74722,
"acecode_id": "bigcode_python_fns_8668",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a value which can either be a string or a list of strings, determine if the value is considered 'unchanged'. The term 'unchanged' is defined as one of the following: a constant string 'UNCHANGED', the string representation of that constant, the first element of a predefin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_unchanged('UNCHANGED') == (True, ['UNCHANGED', 'MODIFIED'])\", \"assert parse_unchanged('UNCHANGED') == (True, ['UNCHANGED', 'MODIFIED'])\", \"assert parse_unchanged(str('UNCHANGED')) == (True, ['UNCHANGED', 'MODIFIED'])\", \"assert parse_unchanged(SET... | {
"split": "train",
"index": 74723,
"acecode_id": "bigcode_python_fns_23734",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the reading of hardware information from a hypothetical system. The function should accept a list of hardware field names and return a dictionary containing the names as keys and their respective simulated values. Each fiel... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_hardware_info(['bios_version', 'product_serial']) == {'bios_version': '1.0.0', 'product_serial': 'ABC123456'}\", \"assert get_hardware_info(['manufacturer']) == {'manufacturer': 'SampleCorp'}\", \"assert get_hardware_info(['product_name']) == {'product_n... | {
"split": "train",
"index": 74724,
"acecode_id": "bigcode_python_fns_35588",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a formatted string for a property listing. The function should take the following parameters: district (str), area (str), name (str), price (float), and on_sale (bool). The function should return a string that concatenates ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert property_listing('Downtown', '1000 sqft', 'Luxury Apartment', 250000.00, True) == 'Downtown,1000 sqft,Luxury Apartment,250000.0,True'\", \"assert property_listing('Suburb', '1500 sqft', 'Cozy House', 350000.50, False) == 'Suburb,1500 sqft,Cozy House,350000.5... | {
"split": "train",
"index": 74725,
"acecode_id": "oss_27867",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of numbers, implement a function that returns their median. If the list is empty, raise a ValueError with the message 'The given list is empty'.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_median([1, 3, 3, 6, 7, 8, 9]) == 6\", \"assert find_median([1, 2, 3, 4, 5]) == 3\", \"assert find_median([5, 3, 1, 2, 4]) == 3\", \"assert find_median([1, 2]) == 1.5\", \"assert find_median([2, 1]) == 1.5\", \"assert find_median([1]) == 1\", \"assert fi... | {
"split": "train",
"index": 74726,
"acecode_id": "evol_30869",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the amounts to be paid out. Your task is to implement a function `calculate_total_payout(amounts: List[int]) -> int` that calculates the total payout amount by summing all the integers in the list. The list may contain both positive... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_payout([100, 200, 300]) == 600\", \"assert calculate_total_payout([-100, 50, 50]) == 0\", \"assert calculate_total_payout([]) == 0\", \"assert calculate_total_payout([1, 2, 3, 4]) == 10\", \"assert calculate_total_payout([-1, -2, -3]) == -6\"... | {
"split": "train",
"index": 74727,
"acecode_id": "bigcode_python_fns_27025",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function `get_documentation_summary` that takes in the following parameters: a string `class_name` representing the name of a Java class, a string `method_name` representing the name of a method, and a string `package_name` representing the name of the package. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_documentation_summary('ExampleClass', 'getField1', 'example.package') == 'Help on class ExampleClass in package example.package. The method getField1 is documented.'\", \"assert get_documentation_summary('TestClass', 'calculate', 'test.package') == 'Help... | {
"split": "train",
"index": 74728,
"acecode_id": "oss_7590",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary `uniforms` containing the names of students as keys and their corresponding uniform numbers as values. Each uniform number is represented as a string. Write a function that takes two student names as input, retrieves their uniform numbers from the `un... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_uniform_sum({'Thelma': '4', 'Twi': '21', 'Dottie': '9'}, 'Thelma', 'Twi') == 25\", \"assert calculate_uniform_sum({'Thelma': '4', 'Twi': '21', 'Dottie': '9'}, 'Thelma', 'Dottie') == 13\", \"assert calculate_uniform_sum({'Thelma': '4', 'Twi': '21', ... | {
"split": "train",
"index": 74729,
"acecode_id": "oss_8400",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function called `generate_fibonacci` that takes an integer `n` as input and returns a list containing the first `n` numbers in the Fibonacci sequence. The Fibonacci sequence is defined as follows: the first two numbers are 0 and 1, and each subsequent number is t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_fibonacci(1) == [0]\", \"assert generate_fibonacci(2) == [0, 1]\", \"assert generate_fibonacci(3) == [0, 1, 1]\", \"assert generate_fibonacci(4) == [0, 1, 1, 2]\", \"assert generate_fibonacci(5) == [0, 1, 1, 2, 3]\", \"assert generate_fibonacci(6) =... | {
"split": "train",
"index": 74730,
"acecode_id": "evol_25933",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `min_moves_tower_of_hanoi(n: int) -> int` that calculates the minimum number of moves required to solve the Tower of Hanoi puzzle for `n` disks. The function should return an integer representing the minimum moves needed to transfer all disks from the sourc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert min_moves_tower_of_hanoi(1) == 1\", \"assert min_moves_tower_of_hanoi(2) == 3\", \"assert min_moves_tower_of_hanoi(3) == 7\", \"assert min_moves_tower_of_hanoi(4) == 15\", \"assert min_moves_tower_of_hanoi(5) == 31\", \"assert min_moves_tower_of_hanoi(6) == ... | {
"split": "train",
"index": 74731,
"acecode_id": "evol_20695",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `enroll_student(courses: List[str], course: str) -> List[str]` that takes a list of current courses and a new course as input. The function should return a new list of courses with the new course added at the end, ensuring no duplicates are present in the f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert enroll_student(['Math101', 'CS102'], 'CS103') == ['Math101', 'CS102', 'CS103']\", \"assert enroll_student(['Math101', 'CS102'], 'Math101') == ['Math101', 'CS102']\", \"assert enroll_student([], 'Physics101') == ['Physics101']\", \"assert enroll_student(['Bio... | {
"split": "train",
"index": 74732,
"acecode_id": "evol_12076",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_ascending(arr: List[int]) -> bool` that determines if the elements in the given list of integers `arr` are in strictly ascending order. The function should return `True` if the elements are in strictly ascending order, otherwise return `False`. Note tha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_ascending([]) == True\", \"assert is_ascending([1]) == True\", \"assert is_ascending([1, 2, 3, 4, 5]) == True\", \"assert is_ascending([1, 2, 2, 4]) == False\", \"assert is_ascending([5, 4, 3, 2, 1]) == False\", \"assert is_ascending([-3, -2, -1, 0, 1]) =... | {
"split": "train",
"index": 74733,
"acecode_id": "evol_29176",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary that represents a configuration. Your task is to implement a function `get_config_value(config: Dict[str, Any], key: str) -> Any` that retrieves the value associated with the provided key from the dictionary. If the key does not exist in the dictionar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_config_value({'name': 'Alice', 'age': 30}, 'name') == 'Alice'\", \"assert get_config_value({'name': 'Alice', 'age': 30}, 'age') == 30\", \"assert get_config_value({'name': 'Alice', 'age': 30}, 'gender') == None\", \"assert get_config_value({'x': 10, 'y':... | {
"split": "train",
"index": 74734,
"acecode_id": "bigcode_python_fns_42016",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that performs a binary search on a potentially unsorted array of integers to find the index of a target number. If the array is not sorted, sort it first before performing the binary search. Return the index of the target if found, otherwise return -1.\nPle... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binary_search([3, 2, 1, 4, 5], 4) == 3\", \"assert binary_search([10, 3, 5, 8, 6], 10) == 4\", \"assert binary_search([1, 2, 3, 4, 5], 1) == 0\", \"assert binary_search([99, 100, 101, 102], 100) == 1\", \"assert binary_search([3, 6, 2, 8, 4], 6) == 3\", \"as... | {
"split": "train",
"index": 74735,
"acecode_id": "evol_24258",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function `fibonacci(n: int) -> int` that returns the nth Fibonacci number. Use memoization to optimize the calculation of Fibonacci numbers. The Fibonacci sequence is defined as follows: F(0) = 0, F(1) = 1, and F(n) = F(n-1) + F(n-2) for n > 1.\nPlease reason step b... | 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": 74736,
"acecode_id": "evol_15403",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to generate prime numbers using the Sundaram sieve algorithm. The Sundaram sieve is an ancient algorithm for finding prime numbers up to a specified limit. The algorithm works by eliminating numbers of the form i + j + 2ij, where 1 ≤ ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert gen_primes_sundaram_sieve(10) == {2, 3, 5, 7}\", \"assert gen_primes_sundaram_sieve(15) == {2, 3, 5, 7, 11, 13}\", \"assert gen_primes_sundaram_sieve(20) == {2, 3, 5, 7, 11, 13, 17, 19}\", \"assert gen_primes_sundaram_sieve(5) == {2, 3, 5}\", \"assert gen_pr... | {
"split": "train",
"index": 74737,
"acecode_id": "oss_8779",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers and returns a new list containing only the unique integers from the original list in the order they first appeared. Write a function called `unique_integers` that takes in a list of integers `nums` and re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_integers([1, 2, 2, 3, 4, 1]) == [1, 2, 3, 4]\", \"assert unique_integers([5, 5, 5, 5]) == [5]\", \"assert unique_integers([]) == []\", \"assert unique_integers([1, 3, 2, 1, 2, 3, 4]) == [1, 3, 2, 4]\", \"assert unique_integers([10, 20, 10, 30, 20]) ==... | {
"split": "train",
"index": 74738,
"acecode_id": "bigcode_python_fns_12482",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_redundant_pairs(data)` that takes a multi-dimensional data structure (a list of lists) and returns a set of tuples representing redundant pairs found within the structure. A redundant pair is defined as a unique combination of indices and values that ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_redundant_pairs([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == set()\", \"assert find_redundant_pairs([[1], [1], [1]]) == {(0, 0), (1, 0), (2, 0)}\", \"assert find_redundant_pairs([[1, 2], [1, 2], [1, 2]]) == {(0, 0), (0, 1), (1, 0), (1, 1), (2, 0), (2, 1)}\", \... | {
"split": "train",
"index": 74739,
"acecode_id": "evol_16385",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that identifies the least frequent character in a given string. The function should ignore spaces and be case-insensitive. If there are multiple characters with the least frequency, return them in a list sorted in alphabetical order.\nPlease reason step ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert least_frequent_char('aabbccddeeffgg') == ['a', 'b', 'c', 'd', 'e', 'f', 'g']\", \"assert least_frequent_char('abcde') == ['a', 'b', 'c', 'd', 'e']\", \"assert least_frequent_char('aaaa') == ['a']\", \"assert least_frequent_char('abc abc') == ['a', 'b', 'c']\... | {
"split": "train",
"index": 74740,
"acecode_id": "evol_15728",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that counts the occurrences of each word in a given string. The function should ignore punctuation and consider words with different capitalizations as the same word. The function should return the word count for each unique word in alpha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_words('This is a sample text. This text contains sample words.') == [('a', 1), ('contains', 1), ('is', 1), ('sample', 2), ('text', 2), ('this', 2), ('words', 1)]\", \"assert count_words('Hello world! Hello again.') == [('again', 1), ('hello', 2), ('wor... | {
"split": "train",
"index": 74741,
"acecode_id": "oss_14512",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a number of percentage coverage. Your task is to implement a function that returns the corresponding color based on the coverage percentage. The mapping is as follows: 'brightgreen' for 97% and above, 'green' for 93% to 96%, 'yellowgreen' for... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_colour('97') == 'brightgreen'\", \"assert get_colour('93') == 'green'\", \"assert get_colour('80') == 'yellowgreen'\", \"assert get_colour('65') == 'yellow'\", \"assert get_colour('45') == 'orange'\", \"assert get_colour('15') == 'red'\", \"assert get_co... | {
"split": "train",
"index": 74742,
"acecode_id": "bigcode_python_fns_3170",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a Python function that performs a specific mathematical operation. Your function should take an integer `a` as input and return the result of the expression `a * 465546 + 2342`. Implement a function `calculate_result(a)` that accomplishes this task. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_result(0) == 2342\", \"assert calculate_result(1) == 467888\", \"assert calculate_result(-1) == -463204\", \"assert calculate_result(100) == 46554600 + 2342\", \"assert calculate_result(-100) == -46554600 + 2342\", \"assert calculate_result(1000) =... | {
"split": "train",
"index": 74743,
"acecode_id": "oss_17418",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates moving an arrow across a coordinate plane and displaying a message at a specific position. The function should take the following parameters: an arrow represented by a string (for simplicity), a start point as a tuple o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert move_arrow_and_display('Arrow', (0, 0), (3, 4), 5, 'Hello!', (2, 2)) == ['Moving Arrow to (3, 4) over 5 seconds', 'Display message: Hello! at (2, 2)']\", \"assert move_arrow_and_display('Arrow', (1, 1), (4, 5), 3, 'Goodbye!', (3, 3)) == ['Moving Arrow to (4,... | {
"split": "train",
"index": 74744,
"acecode_id": "oss_25784",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of tuples where each tuple represents a point in 2D space (e.g., (x, y)), implement a function that processes a source shape and a target shape and returns a dictionary containing information about the source shape, a variable representing source area, a variable r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_shapes([(0, 0), (1, 1)], 1.0, 4.0, [(2, 2), (3, 3)]) == {'src_shape': [(0, 0), (1, 1)], 'src_A': 1.0, 'src_P': 4.0, 'tgt_shape': [(2, 2), (3, 3)]}\", \"assert process_shapes([(1, 1), (2, 2)], 2.0, 8.0, [(3, 3), (4, 4)]) == {'src_shape': [(1, 1), (2, ... | {
"split": "train",
"index": 74745,
"acecode_id": "oss_2445",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, each representing a document, and a corresponding list of metadata, write a function `process_documents(documents: List[str], metadata: List[Dict[str, Any]]) -> List[Dict[str, Any]]` that processes these documents and their metadata into a structured fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_documents(['doc1', 'doc2'], [{'author': 'A'}, {'author': 'B'}]) == [{'content': 'doc1', 'metadata': {'author': 'A'}}, {'content': 'doc2', 'metadata': {'author': 'B'}}]\", \"assert process_documents(['doc1'], [{'author': 'A'}, {'author': 'B'}]) == []\... | {
"split": "train",
"index": 74746,
"acecode_id": "bigcode_python_fns_14266",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple pattern matching system. The function should have the following signature: `def match_pattern(pattern: str, input_str: str) -> bool`. The function takes two parameters: `pattern`, a string consisting of only '1... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert match_pattern('111111111111', '101010101010') == False\", \"assert match_pattern('111111111111', '111111111111') == True\", \"assert match_pattern('111111111', '111111111') == True\", \"assert match_pattern('000000', '000000') == True\", \"assert match_patte... | {
"split": "train",
"index": 74747,
"acecode_id": "oss_4810",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary `results` that contains various schemes and their corresponding results. Each scheme is represented as a key in the dictionary, and the value is another dictionary that contains a list of rewards under the key `reward_key`. Your task is to write a fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_of_the_best({'scheme1': {'reward_key': [10, 20, 30]}, 'scheme2': {'reward_key': [10, 20, 30]}}, 'reward_key') == 20.0\", \"assert average_of_the_best({'scheme1': {'reward_key': [1, 2, 3]}, 'scheme2': {'reward_key': [4, 5, 6]}, 'scheme3': {'reward_key... | {
"split": "train",
"index": 74748,
"acecode_id": "oss_11128",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that converts a number from a given base to its binary representation. The input will be a string representing the number and an integer representing the base, which can be 8 (octal), 10 (decimal), or 16 (hexadecimal). Your function s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert number_to_binary('0', 10) == '0'\", \"assert number_to_binary('1', 10) == '1'\", \"assert number_to_binary('2', 10) == '10'\", \"assert number_to_binary('3', 10) == '11'\", \"assert number_to_binary('4', 10) == '100'\", \"assert number_to_binary('7', 8) == '... | {
"split": "train",
"index": 74749,
"acecode_id": "evol_27122",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary that may contain two specific keys: 'GeneratedAt' and 'IDs'. Your task is to implement a function called `getTimestampAndIDs(data_map)` that takes this dictionary as input and returns a tuple. The first element of the tuple should be the value associa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert getTimestampAndIDs({'GeneratedAt': '2023-10-01T12:00:00Z', 'IDs': '1,2,3'}) == ('2023-10-01T12:00:00Z', '1,2,3')\", \"assert getTimestampAndIDs({'GeneratedAt': '2023-10-01T12:00:00Z'}) == ('2023-10-01T12:00:00Z', '')\", \"assert getTimestampAndIDs({'IDs': '1... | {
"split": "train",
"index": 74750,
"acecode_id": "oss_24513",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary of configuration settings for multiple repositories, where each key is the repository name and the value is another dictionary containing specific settings for that repository. Additionally, there is a global settings dictionary that contains default ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_config_setting({'repo1': {'setting1': 'value1'}, 'repo2': {'setting1': 'value2'}}, {'setting1': 'global_value'}, 'repo1', 'setting1') == 'value1'\", \"assert get_config_setting({'repo1': {'setting1': 'value1'}, 'repo2': {}}, {'setting1': 'global_value'},... | {
"split": "train",
"index": 74751,
"acecode_id": "bigcode_python_fns_24722",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with validating a string based on the constraints of an NCName (Non-Colonized Name) in XML. An NCName must start with a letter or underscore, cannot contain any spaces, and must not include colons or hyphens. Additionally, the length of the NCName must be at leas... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_ncname('validName') == True\", \"assert is_valid_ncname('_underscoreStart') == True\", \"assert is_valid_ncname('name123') == True\", \"assert is_valid_ncname('anotherValidName') == True\", \"assert is_valid_ncname('1InvalidStart') == False\", \"ass... | {
"split": "train",
"index": 74752,
"acecode_id": "bigcode_python_fns_36995",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_divisible_by_4_not_8(n: int) -> bool` that checks if a given integer `n` is divisible by 4 but not divisible by 8. The function should return True if the condition is met, and False otherwise.\nPlease reason step by step, then write a self-contained Pyt... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_divisible_by_4_not_8(4) == True\", \"assert is_divisible_by_4_not_8(8) == False\", \"assert is_divisible_by_4_not_8(12) == True\", \"assert is_divisible_by_4_not_8(16) == False\", \"assert is_divisible_by_4_not_8(0) == False\", \"assert is_divisible_by_4_... | {
"split": "train",
"index": 74753,
"acecode_id": "evol_22705",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of events, where each event is represented by a dictionary with the following keys: 'code' (a string), 'enabled' (a boolean), 'valid_from' (a datetime string in ISO format), and 'valid_until' (a datetime string in ISO format). Write a function `get_valid_ev... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_valid_event([{'code': 'ABC123', 'enabled': True, 'valid_from': '2023-09-01T00:00:00Z', 'valid_until': '2023-10-31T23:59:59Z'}], 'ABC123') == 'ABC123'\", \"assert get_valid_event([{'code': 'XYZ789', 'enabled': True, 'valid_from': '2023-10-02T00:00:00Z', '... | {
"split": "train",
"index": 74754,
"acecode_id": "bigcode_python_fns_20185",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a representation of a book with its status, completion in progress flag, and release date. Your task is to implement a function `is_completed` that determines if the book is completed based on the following criteria: the book is considered completed if its status ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_completed({'status': 'active', 'complete_in_progress': False, 'release_date': '2023-01-01'}) == True\", \"assert is_completed({'status': 'inactive', 'complete_in_progress': False, 'release_date': '2023-01-01'}) == False\", \"assert is_completed({'status':... | {
"split": "train",
"index": 74755,
"acecode_id": "bigcode_python_fns_22724",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that sets a custom exception handler for Python's built-in exception handling mechanism. Your function should take no parameters and return nothing. When an exception occurs, it should call a predefined function, `handleMyException`, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert installExceptionHandler() is None\", \"assert sys.excepthook is not None\", \"assert callable(sys.excepthook)\", \"assert handleMyException is not None\", \"assert callable(handleMyException)\", \"assert 'handleMyException' in globals()\", \"assert handleMyE... | {
"split": "train",
"index": 74756,
"acecode_id": "bigcode_python_fns_4409",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a list of floating-point numbers representing the brightness levels of various sources in a coronagraphic image. Your task is to rescale these brightness levels based on a given scaling factor. The scaling factor is a floating-point number that represents how much... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rescale_brightness([1.0, 2.0, 3.0], 2.0) == [2.0, 4.0, 6.0]\", \"assert rescale_brightness([1.5, 0.5, -1.0], 1.5) == [2.25, 0.75, -1.5]\", \"assert rescale_brightness([0.0, 0.0], 3.0) == [0.0, 0.0]\", \"assert rescale_brightness([], 5.0) == []\", \"assert re... | {
"split": "train",
"index": 74757,
"acecode_id": "bigcode_python_fns_11148",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that saves a list of status messages to a string in a specific format. The function should take a filename and a list of status messages as inputs. The status messages should be appended to the string, each on a new line, with the for... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert save_status_to_string('test.txt', ['Started', 'In Progress', 'Completed']) == 'Status: Started\\\\nStatus: In Progress\\\\nStatus: Completed'\", \"assert save_status_to_string('test.txt', ['Error', 'Retrying', 'Success']) == 'Status: Error\\\\nStatus: Retryi... | {
"split": "train",
"index": 74758,
"acecode_id": "bigcode_python_fns_27603",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the total price of products in a shopping cart. The function should take a list of products where each product is represented as a dictionary containing the keys 'name' (a string) and 'price' (a float). Your function s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_cart_total([]) == 0.0\", \"assert calculate_cart_total([{'name': 'Laptop', 'price': 1000.0}]) == 1000.0\", \"assert calculate_cart_total([{'name': 'Headphones', 'price': 100.0}]) == 100.0\", \"assert calculate_cart_total([{'name': 'Mouse', 'price':... | {
"split": "train",
"index": 74759,
"acecode_id": "oss_15680",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of floating point numbers representing individual losses from a machine learning model's regularization terms. Your task is to implement a function that calculates the total regularization loss. If the list is empty, the function should return 0.0. Write a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_total_regularization_loss([1.0, 2.0, 3.0]) == 6.0\", \"assert get_total_regularization_loss([-1.0, -2.0, -3.0]) == -6.0\", \"assert get_total_regularization_loss([0.0, 0.0, 0.0]) == 0.0\", \"assert get_total_regularization_loss([]) == 0.0\", \"assert get... | {
"split": "train",
"index": 74760,
"acecode_id": "bigcode_python_fns_31286",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a model loading system that supports different types of models based on their file formats. Create a function `load_model(file_path: str, model_type: str) -> object` that takes a file path and a model type as inputs and returns the loaded model ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert load_model('tokenizer.h5', 'keras_tokenizer') == 'Loaded Keras tokenizer from tokenizer.h5'\", \"assert load_model('outlier_detection_model.pkl', 'ape_outlier_detection') == 'Loaded APE outlier detection model from outlier_detection_model.pkl'\", \"assert lo... | {
"split": "train",
"index": 74761,
"acecode_id": "oss_35869",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with verifying the existence of prerequisite Python scripts in specific directories. Implement a function `run_main_script()` that checks for the existence of two required scripts: `ports/extract_metadata.py` and `ships/extract_metadata.py`. If either of these sc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert run_main_script(True, True) == 'Scripts are ready to run'\", \"assert run_main_script(True, False) == 'You need to run ports/extract_metadata.py and ships/extract_metadata.py first'\", \"assert run_main_script(False, True) == 'You need to run ports/extract_m... | {
"split": "train",
"index": 74762,
"acecode_id": "oss_22973",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `combine_data` that takes two lists of tuples, `data1` and `data2`, and returns a single list of tuples that contains the concatenated data. Each tuple in the input lists represents a row of data. The function should concatenate the two lists and return the res... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert combine_data([(1, 'a'), (2, 'b')], [(3, 'c'), (4, 'd')]) == [(1, 'a'), (2, 'b'), (3, 'c'), (4, 'd')]\", \"assert combine_data([], [(3, 'c'), (4, 'd')]) == [(3, 'c'), (4, 'd')]\", \"assert combine_data([(1, 'a'), (2, 'b')], []) == [(1, 'a'), (2, 'b')]\", \"as... | {
"split": "train",
"index": 74763,
"acecode_id": "evol_24317",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a function that removes all words from a given list that contain a specific letter. The function should take in a list of strings and a letter, and return a new list containing only the words that do not contain the specified letter.\nPlease reason step by step, then wr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert eliminate_words(['one', 'two', 'three'], 'e') == ['two']\", \"assert eliminate_words([], 'a') == []\", \"assert eliminate_words(['abc', 'def', 'ghi'], 'z') == ['abc', 'def', 'ghi']\", \"assert eliminate_words(['a', 'b', 'c', 'd'], 'a') == ['b', 'c', 'd']\", ... | {
"split": "train",
"index": 74764,
"acecode_id": "evol_3388",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a command line argument parser. The function `parse_args` should take a list of strings representing command line arguments and return a dictionary that maps each argument to its corresponding value. The valid arguments are... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_args(['--task', 'seg']) == {'task': 'seg'}\", \"assert parse_args(['--task', 'det', '--gt', 'path/to/gt']) == {'task': 'det', 'gt': 'path/to/gt'}\", \"assert parse_args(['--result', 'path/to/results', '--task', 'drivable']) == {'result': 'path/to/resul... | {
"split": "train",
"index": 74765,
"acecode_id": "bigcode_python_fns_35578",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating various metrics related to lattice observables in a theoretical physics simulation. Write a function `calculate_lattice_metrics(x: List[float], beta: Optional[float] = None) -> Dict[str, Any]` that takes a list of floating-point numbers `x` repre... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_lattice_metrics([1.0, 2.0, 3.0]) == {'plaqs': [6.0], 'intQ': [1, 2, 3], 'sinQ': [0.8415, 0.9093, 0.1411]}\", \"assert calculate_lattice_metrics([0.0, 0.0, 0.0]) == {'plaqs': [0.0], 'intQ': [0, 0, 0], 'sinQ': [0.0, 0.0, 0.0]}\", \"assert calculate_l... | {
"split": "train",
"index": 74766,
"acecode_id": "oss_12150",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that extracts and counts the number of URLs from a given text string. A URL is defined as any valid web address that starts with 'http://' or 'https://' and ends with a top-level domain such as '.com', '.org', '.net', etc. Write a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_urls('Visit our site at http://example.com and https://example.org') == 2\", \"assert count_urls('No URLs here! Just text.') == 0\", \"assert count_urls('Check https://www.google.com and http://www.example.net') == 2\", \"assert count_urls('Only one UR... | {
"split": "train",
"index": 74767,
"acecode_id": "oss_31405",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are driving a delivery truck that has a certain `capacity` for packages and a `weight_limit` for the total weight it can carry. Given a list of `deliveries`, where each `delivery[i]` represents a delivery with the format `[num_packages, start_location, end_location, weight_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert deliveries_possible([[2,1,5,1],[3,3,7,2]], 5, 30) == True\", \"assert deliveries_possible([[2,1,5,1],[3,5,7,2]], 3, 15) == True\", \"assert deliveries_possible([[3,2,7,1],[3,7,9,2],[8,3,9,3]], 11, 60) == True\", \"assert deliveries_possible([[1,0,10,1],[1,10... | {
"split": "train",
"index": 74768,
"acecode_id": "evol_4879",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of integers, `ai_s` and `hrf`. Your task is to implement a function that performs a convolution operation between the two lists using the linear convolution method. The function should return a new list that represents the convolution result. Please note... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert linear_convolve([1, 2, 3], [0, 1]) == [0, 1, 2, 3]\", \"assert linear_convolve([1, 2], [3, 4]) == [3, 10, 8]\", \"assert linear_convolve([1], [1]) == [1]\", \"assert linear_convolve([1, 1], [1, 1]) == [1, 2, 1]\", \"assert linear_convolve([2, 3, 4], [1]) == ... | {
"split": "train",
"index": 74769,
"acecode_id": "bigcode_python_fns_27476",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a simple banking system. Implement a function `bank_account_operations(operations: List[Tuple[str, int]]) -> int` that processes a list of operations on a bank account. Each operation is represented as a tuple, where the first element is a string ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bank_account_operations([('deposit', 100), ('withdraw', 50)]) == 50\", \"assert bank_account_operations([('deposit', 200), ('deposit', 300), ('withdraw', 150)]) == 350\", \"assert bank_account_operations([('withdraw', 100)]) == 0\", \"assert bank_account_ope... | {
"split": "train",
"index": 74770,
"acecode_id": "oss_21322",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that generates a non-uniformly distributed random integer within the boundary conditions of 0 and 10. The function should accept a list of probabilities corresponding to the integers in this range and return a randomly selected integer based on those probab... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert custom_random([1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) == 0\", \"assert custom_random([0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0]) == 1\", \"assert custom_random([0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0]) == 2\", \"assert custom_random([0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0]) == 3\", \"a... | {
"split": "train",
"index": 74771,
"acecode_id": "evol_19513",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of addresses represented as strings. Each address string may contain various components such as street number, street name, city, state, and zip code. Your task is to implement a function that updates each address in the list by appending the string ' - Upd... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_addresses(['123 Main St', '456 Elm St']) == ['123 Main St - Updated', '456 Elm St - Updated']\", \"assert update_addresses(['789 Maple Ave']) == ['789 Maple Ave - Updated']\", \"assert update_addresses([]) == []\", \"assert update_addresses(['1 First ... | {
"split": "train",
"index": 74772,
"acecode_id": "bigcode_python_fns_14891",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary `solution` where each key is an integer representing a color and each value is a list of integers representing node IDs, and a dictionary `node_ids_to_nodes` that maps node IDs to their respective positions in a grid (represented as integers), implement a fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_solution_table({0: [0, 1, 2]}, {0: 0, 1: 1, 2: 2}, 3) == {0: 'A0 B0 C0'}\", \"assert format_solution_table({1: [3, 4]}, {3: 3, 4: 4}, 3) == {1: 'A1 B1'}\", \"assert format_solution_table({3: [8]}, {8: 8}, 4) == {3: 'A2'}\", \"assert format_solution_ta... | {
"split": "train",
"index": 74773,
"acecode_id": "bigcode_python_fns_30499",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the volume of a right rectangular prism given its length, width, and height. The function should take three numerical arguments: length, width, and height, and return the computed volume. For example, if the length is 10, width is 15, and he... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_volume(10, 15, 20) == 3000\", \"assert calculate_volume(5, 5, 5) == 125\", \"assert calculate_volume(1, 1, 1) == 1\", \"assert calculate_volume(0, 10, 10) == 0\", \"assert calculate_volume(10, 0, 10) == 0\", \"assert calculate_volume(10, 10, 0) == ... | {
"split": "train",
"index": 74774,
"acecode_id": "evol_16689",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates basic transactions in a banking system. The function should take a list of transactions as input, where each transaction is represented as a tuple containing an account number, a transaction type ('deposit' or 'withdraw'), ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bank_transactions([('A1', 'deposit', 100), ('A1', 'withdraw', 50)]) == {'A1': 50}\", \"assert bank_transactions([('A1', 'deposit', 200), ('A1', 'withdraw', 300)]) == {'A1': 200}\", \"assert bank_transactions([('A1', 'deposit', 100), ('A1', 'withdraw', 50), (... | {
"split": "train",
"index": 74775,
"acecode_id": "oss_31462",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a generator expression that takes a list of integers and yields only the prime numbers from that list. You should define a function called `yield_primes` that accepts a list of integers as an argument and returns a generator that yields the prime numbers. For the purp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert list(yield_primes([23, 45, 7, 18, 9, 11, 14, 39, 22])) == [23, 7, 11]\", \"assert list(yield_primes([2, 3, 5, 7, 11, 13, 17, 19, 23])) == [2, 3, 5, 7, 11, 13, 17, 19, 23]\", \"assert list(yield_primes([4, 6, 8, 9, 10])) == []\", \"assert list(yield_primes([1... | {
"split": "train",
"index": 74776,
"acecode_id": "evol_5639",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of sections, where each section is represented as a string. Your task is to write a function that checks if a specific section exists in the list. The function should take two parameters: a list of strings 'sections' and a string 'section_to_find'. The func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert section_exists(['core', 'config', 'user'], 'core') == True\", \"assert section_exists(['core', 'config', 'user'], 'admin') == False\", \"assert section_exists([], 'core') == False\", \"assert section_exists(['core'], 'core') == True\", \"assert section_exist... | {
"split": "train",
"index": 74777,
"acecode_id": "bigcode_python_fns_7026",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are working on a genetics research project and need to implement a function to analyze inheritance patterns of alleles. Your task is to create a function called `inheritance_pattern` that takes two allele sequences as input: a `parent_sequence` and a `child_sequence`. The f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert inheritance_pattern('A', 'A') == 'Co-dominant'\", \"assert inheritance_pattern('A', 'AA') == 'Dominant'\", \"assert inheritance_pattern('A', 'B') == 'Recessive'\", \"assert inheritance_pattern('ATCG', 'ATCG') == 'Co-dominant'\", \"assert inheritance_pattern(... | {
"split": "train",
"index": 74778,
"acecode_id": "oss_10520",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of bars in a histogram. Your task is to implement a function `max_area_histogram(heights: List[int]) -> int` that returns the maximum rectangular area that can be formed within the histogram. The area of a rectangle is d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_area_histogram([]) == 0\", \"assert max_area_histogram([1]) == 1\", \"assert max_area_histogram([1, 1]) == 2\", \"assert max_area_histogram([2, 1, 5, 6, 2, 3]) == 10\", \"assert max_area_histogram([0, 2, 0, 1, 0]) == 2\", \"assert max_area_histogram([5, ... | {
"split": "train",
"index": 74779,
"acecode_id": "oss_19403",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Define a function `calculate_distances(point1: List[float], point2: List[float]) -> Tuple[float, float]` that takes two points in N-dimensional space represented as lists of floats and returns a tuple containing the Euclidean distance and the Manhattan distance between these tw... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_distances([1, 2], [4, 6]) == (5.0, 7.0)\", \"assert calculate_distances([0, 0], [0, 0]) == (0.0, 0.0)\", \"assert calculate_distances([-1, -1], [1, 1]) == (2.8284271247461903, 4.0)\", \"assert calculate_distances([1.5, 2.5], [3.5, 4.5]) == (2.82842... | {
"split": "train",
"index": 74780,
"acecode_id": "evol_35955",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing stock prices on consecutive days. Write a function `max_profit(prices: List[int]) -> int` that calculates the maximum profit you can achieve by buying on one day and selling on another day. If no profit can be made, return 0. Note t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_profit([7, 1, 5, 3, 6, 4]) == 5\", \"assert max_profit([7, 6, 4, 3, 1]) == 0\", \"assert max_profit([1, 2, 3, 4, 5]) == 4\", \"assert max_profit([5]) == 0\", \"assert max_profit([3, 2, 6, 5, 0, 0]) == 4\", \"assert max_profit([2, 1]) == 0\", \"assert max... | {
"split": "train",
"index": 74781,
"acecode_id": "bigcode_python_fns_418",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a recursive function to compute the product of all non-zero elements in a matrix. The function should be able to handle matrices of different shapes and should return 1 if the matrix is empty or contains only zeros.\nPlease reason step by step, then write a self-contained... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert product_of_elements([[0, 0, 0], [0, 0, 0]]) == 1\", \"assert product_of_elements([[0]]) == 1\", \"assert product_of_elements([]) == 1\", \"assert product_of_elements([[5, 0], [0, 0]]) == 5\", \"assert product_of_elements([[1], [2], [3], [4]]) == 24\", \"asse... | {
"split": "train",
"index": 74782,
"acecode_id": "evol_22527",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a list of floating-point numbers representing a 1-dimensional signal. Implement a function `fitter(sig1d)` that returns the index of the first element in the list that is greater than the average of all the elements in the list. If no element is greater than the a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fitter([1, 2, 3, 4, 5]) == 3\", \"assert fitter([10.5, 20.5, 30.5]) == 2\", \"assert fitter([5, 5, 5, 5]) == -1\", \"assert fitter([2, 3, 4, 5, 1]) == 2\", \"assert fitter([0, 0, 0, 1]) == 3\", \"assert fitter([1, 1, 1, 2]) == 3\", \"assert fitter([100, 100,... | {
"split": "train",
"index": 74783,
"acecode_id": "oss_36668",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks whether a given file meets certain criteria based on its name, line count, and character count. The function should take the following inputs: a string representing the file name, an integer representing the number of lines in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert file_validator('example.txt', 10, 500) == True\", \"assert file_validator('example.doc', 10, 500) == False\", \"assert file_validator('example.txt', 9, 500) == False\", \"assert file_validator('example.txt', 10, 1001) == False\", \"assert file_validator('exa... | {
"split": "train",
"index": 74784,
"acecode_id": "oss_3075",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a response message based on an input command. The function `generate_response(command: str) -> str` should take a command string as input and return a specific response based on the command. If the command is 'color_image',... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_response('color_image') == 'Here is your color image~'\", \"assert generate_response('black_and_white_image') == 'Here is your black and white image~'\", \"assert generate_response('landscape') == 'Unknown command~'\", \"assert generate_response('po... | {
"split": "train",
"index": 74785,
"acecode_id": "bigcode_python_fns_25865",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of items where each item can have dependencies on other items. Your task is to write a function that computes the set of direct dependencies for a given item. The input will be a dictionary representing the items, where the keys are the item names (strings)... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_dependencies({'A': ['B', 'C'], 'B': ['C'], 'C': []}, 'A') == {'B', 'C'}\", \"assert compute_dependencies({'A': ['B'], 'B': ['C'], 'C': []}, 'B') == {'C'}\", \"assert compute_dependencies({'A': [], 'B': [], 'C': []}, 'A') == set()\", \"assert compute_... | {
"split": "train",
"index": 74786,
"acecode_id": "bigcode_python_fns_6803",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing a rotated version of a sorted array. Your task is to write a function to find the maximum element in this rotated array. The rotated array is formed by splitting the original sorted array into two non-empty subarrays and reversing t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_maximum_in_rotated_array([4, 5, 6, 7, 0, 1, 2]) == 7\", \"assert find_maximum_in_rotated_array([3, 4, 5, 1, 2]) == 5\", \"assert find_maximum_in_rotated_array([1, 2, 3, 4, 5]) == 5\", \"assert find_maximum_in_rotated_array([7, 0, 1, 2, 3, 4, 5, 6]) == 7... | {
"split": "train",
"index": 74787,
"acecode_id": "oss_19118",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that filters a list of project candidates based on specific criteria. Each project candidate is represented as a tuple containing a derived data path and a source path. The function `filterProjects(candidates: List[Tuple[str, str]], i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filterProjects([('path/to/active_project1', 'source1'), ('path/to/inactive_project', 'source2')], True) == [('path/to/active_project1', 'source1'), ('path/to/inactive_project', 'source2')]\", \"assert filterProjects([], True) == []\", \"assert filterProjects... | {
"split": "train",
"index": 74788,
"acecode_id": "oss_16344",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to normalize a list of values representing error deltas. The function should take a list of error deltas as input and return a new list with the error deltas normalized to a specific range of 0 to 1. The normalization process involves... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert normalize_deltas([1, 2, 3]) == [0.0, 0.5, 1.0]\", \"assert normalize_deltas([10, 20, 30]) == [0.0, 0.5, 1.0]\", \"assert normalize_deltas([-5, 0, 5]) == [0.0, 0.5, 1.0]\", \"assert normalize_deltas([1]) == [0.0]\", \"assert normalize_deltas([3, 3, 3]) == [0.... | {
"split": "train",
"index": 74789,
"acecode_id": "oss_16968",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of classifiers, where each classifier is a string formatted as 'Category :: Subcategory'. Your task is to create a function `count_classifiers(classifiers)` that takes this list as input and returns a dictionary containing the count of each unique main cate... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_classifiers(['Development Status :: 5 - Production/Stable', 'License :: OSI Approved :: MIT License']) == {'Development Status': 1, 'License': 1}\", \"assert count_classifiers(['Programming Language :: Python :: 3.6', 'Programming Language :: Python ::... | {
"split": "train",
"index": 74790,
"acecode_id": "oss_12933",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of transactions, each represented by a dictionary containing a 'Type' and a 'Hash', write a function that processes these transactions and returns the count of invoke transactions. An invoke transaction is identified by its 'Type' being equal to 'INVOKE_TX_TYPE', a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_invoke_transactions([{'Type': 'INVOKE_TX_TYPE', 'Hash': b'abc'}, {'Type': 'OTHER_TX_TYPE', 'Hash': b'def'}, {'Type': 'INVOKE_TX_TYPE', 'Hash': b'ghi'}]) == 2\", \"assert count_invoke_transactions([{'Type': 'OTHER_TX_TYPE', 'Hash': b'abc'}, {'Type': 'OT... | {
"split": "train",
"index": 74791,
"acecode_id": "bigcode_python_fns_38896",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to read the instability transformation graph from given parameters. Write a function `read_instability_transformation` that takes the following inputs: \n- `spc_dct`: A dictionary containing species information (e.g., {'species1': 'da... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert read_instability_transformation({'species1': 'data1', 'species2': 'data2'}, 'species1', 'theory1', 'prefix1', ['loc1', 'loc2']) == ('transformation_data_species1', 'prefix1_species1_path')\", \"assert read_instability_transformation({'species1': 'data1', 'sp... | {
"split": "train",
"index": 74792,
"acecode_id": "oss_16093",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple memory storage system. The system should allow you to perform two operations: 1) store an integer in memory and 2) retrieve all stored integers in sorted order. Implement a function `store_and_retrieve(numbers:... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert store_and_retrieve([3, 1, 2, 3]) == [1, 2, 3, 3]\", \"assert store_and_retrieve([5, 4, 3, 2, 1]) == [1, 2, 3, 4, 5]\", \"assert store_and_retrieve([]) == []\", \"assert store_and_retrieve([-1, -2, -3, -1]) == [-3, -2, -1, -1]\", \"assert store_and_retrieve([... | {
"split": "train",
"index": 74793,
"acecode_id": "bigcode_python_fns_56",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers and a target integer, implement a function that returns the first index of the target integer in the array. If the target integer is not found in the array, return -1. The function signature should be: `def find_index(arr: List[int], target: int) -> i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_index([1, 7, 9, 8, 5], 7) == 1\", \"assert find_index([1, 7, 9, 8, 5], 9) == 2\", \"assert find_index([1, 7, 9, 8, 5], 5) == 4\", \"assert find_index([1, 7, 9, 8, 5], 1) == 0\", \"assert find_index([1, 7, 9, 8, 5], 10) == -1\", \"assert find_index([], 1... | {
"split": "train",
"index": 74794,
"acecode_id": "evol_15668",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates making a REST API call using a provided API key. The function should handle the following parameters: \n- `endpoint` (string): The API endpoint to make the call to. \n- `action_result` (object): An object that has a met... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_api_call('https://api.example.com/success', action_result, None, None, 'get', False) == 'success'\", \"assert simulate_api_call('https://api.example.com/failure', action_result, None, None, 'get', False) == 'error'\", \"assert simulate_api_call('htt... | {
"split": "train",
"index": 74795,
"acecode_id": "oss_27153",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to implement a function that takes this list and returns a new list containing only the unique integers from the original list, preserving the order of their first occurrence. Write a function `unique_integers(arr: List[int]) -> Li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_integers([1, 2, 2, 3, 4, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert unique_integers([1, 1, 1, 1]) == [1]\", \"assert unique_integers([]) == []\", \"assert unique_integers([5, 4, 3, 2, 1]) == [5, 4, 3, 2, 1]\", \"assert unique_integers([1, 2, 3, 1, 2, 3]) =... | {
"split": "train",
"index": 74796,
"acecode_id": "bigcode_python_fns_13071",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of tuples, each containing a set of dimensions and a 2D array, implement a function that concatenates these arrays along a newly created feature dimension. The input will be a list of tuples where each tuple consists of a tuple of dimensions (as strings) and a 2D a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert concat_features([(('dim1', 'dim2'), [[1, 2], [3, 4]]), (('dim3', 'dim4'), [[5, 6], [7, 8]])]) == [[[1, 2], [3, 4]], [[5, 6], [7, 8]]]\", \"assert concat_features([(('a', 'b'), [[1]]), (('c', 'd'), [[2]])]) == [[[1]], [[2]]]\", \"assert concat_features([(('x'... | {
"split": "train",
"index": 74797,
"acecode_id": "bigcode_python_fns_7745",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes two strings as input and returns True if they are anagrams of each other, and False otherwise. An anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once. For ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert are_anagrams('listen', 'silent') == True\", \"assert are_anagrams('triangle', 'integral') == True\", \"assert are_anagrams('apple', 'papel') == True\", \"assert are_anagrams('rat', 'tar') == True\", \"assert are_anagrams('evil', 'vile') == True\", \"assert a... | {
"split": "train",
"index": 74798,
"acecode_id": "evol_1408",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing bank transactions (deposits are positive integers and withdrawals are negative integers), implement a function `below_zero(operations: List[int]) -> Tuple[bool, int, int]`. The function should return a tuple containing three values: a boole... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert below_zero([5, 10, -3]) == (False, None, 12)\", \"assert below_zero([-1, -2, -3]) == (True, -1, -1)\", \"assert below_zero([10, -5, 2, -8]) == (True, -8, -1)\", \"assert below_zero([0, 0, 0]) == (False, None, 0)\", \"assert below_zero([-1, -2, 1]) == (True, ... | {
"split": "train",
"index": 74799,
"acecode_id": "evol_19405",
"num_tests": 12
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.