data_source
large_stringclasses
1 value
prompt
listlengths
1
1
ability
large_stringclasses
1 value
reward_model
dict
extra_info
dict
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the behavior of setting up a client for a cloud service based on various input parameters. The function, `configure_client`, should accept the following parameters: `client_type` (a string representing the service client ty...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert configure_client('s3', 'http://localhost:4566', 'myAccessKey', 'mySecretKey', 'mySessionToken', 'us-west-2') == 'Local client configured for s3 at http://localhost:4566.'\", \"assert configure_client('ec2', None, 'myAccessKey', 'mySecretKey', 'mySessionToken...
{ "split": "train", "index": 67400, "acecode_id": "bigcode_python_fns_22190", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of visibility flags represented as a list of strings, where each string can either contain the name of the flag or 'Unnamed' if it is unlabeled. Your task is to clean this list by assigning predefined names to the unlabeled flags and removing any flags that...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert clean_visibility_flags(['Unnamed1', 'Unnamed2', 'Unnamed3', 'Unnamed4', '']) == ['Solar Presence', 'Lunar Presence', 'Near Side Target', 'Illuminated Target']\", \"assert clean_visibility_flags(['Unnamed1', 'Unnamed1', 'Unnamed2', 'Unnamed3', 'Unnamed4', '']...
{ "split": "train", "index": 67401, "acecode_id": "bigcode_python_fns_6651", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `generate_html_content(user_input: str) -> str` that takes a user input string and returns a string containing HTML content. The HTML content should include a heading with the text 'User Input' and a paragraph that displays the user input inside it. The out...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_html_content('Hello World') == '<h1>User Input</h1><p>Hello World</p>'\", \"assert generate_html_content('Test Input') == '<h1>User Input</h1><p>Test Input</p>'\", \"assert generate_html_content('') == '<h1>User Input</h1><p></p>'\", \"assert genera...
{ "split": "train", "index": 67402, "acecode_id": "evol_28840", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a recommendation system based on input data. The input will be a dictionary containing various keys that represent parameters for generating recommendations. Your function should process this input and return a result d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_recommendations({}) == {'recommendation': 'error'}\", \"assert generate_recommendations({'parameters': [], 'extra': 'value'}) == {'recommendation': 'error'}\", \"assert generate_recommendations({'valid': False}) == {'recommendation': 'error'}\", \"a...
{ "split": "train", "index": 67403, "acecode_id": "bigcode_python_fns_8575", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a program to calculate the plant cover factor based on a given soil evaporation value. The plant cover factor is defined as follows: Plant Cover Factor = (Soil Evaporation / 100) * 2.5. Your function should accept a single input, soil evaporation, a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculatePlantCoverFactor(0) == 0.0\", \"assert calculatePlantCoverFactor(100) == 2.5\", \"assert calculatePlantCoverFactor(2500) == 62.5\", \"assert calculatePlantCoverFactor(10000) == 250.0\", \"assert calculatePlantCoverFactor(448.240) == 11.206\", \"asse...
{ "split": "train", "index": 67404, "acecode_id": "oss_33452", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a 2D array of integers, your task is to implement a function that flattens the array, removes any duplicate numbers, and returns a list of the unique numbers sorted in descending order. Each sub-array can have a length of at most N, where N is less than or equal to 10. Wr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_array([[3, 2, 1], [5, 4, 6], [3, 4, 6]]) == [6, 5, 4, 3, 2, 1]\", \"assert process_array([[1, 1, 1], [1, 1, 1]]) == [1]\", \"assert process_array([[10, 20], [10, 30], [20, 40]]) == [40, 30, 20, 10]\", \"assert process_array([[0, 0, 0], [0, 0, 0]]) ==...
{ "split": "train", "index": 67405, "acecode_id": "evol_27578", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves a dictionary of agents based on their entry point names. Each agent is represented by a string name mapped to a unique identifier (which can be any integer). Your function should be called `get_agents_dict()`. The function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_agents_dict() == {'agent_a': 1, 'agent_b': 2, 'agent_c': 3}\", \"assert len(get_agents_dict()) == 3\", \"assert 'agent_a' in get_agents_dict()\", \"assert 'agent_b' in get_agents_dict()\", \"assert 'agent_c' in get_agents_dict()\", \"assert get_agents_di...
{ "split": "train", "index": 67406, "acecode_id": "bigcode_python_fns_39954", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes a string as input and returns a new string that is the original string reversed. For example, if the input string is 'Hello', the output should be 'olleH'.\nPlease reason step by step, then write a self-contained Python solution. Give your final prog...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_string('Hello') == 'olleH'\", \"assert reverse_string('Python') == 'nohtyP'\", \"assert reverse_string('a') == 'a'\", \"assert reverse_string('') == ''\", \"assert reverse_string('racecar') == 'racecar'\", \"assert reverse_string('12345') == '54321'\...
{ "split": "train", "index": 67407, "acecode_id": "evol_29952", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of integers and returns the sum of all the even numbers in the list. However, there's a catch - you must implement the function without using any conditional statements (if, else, etc.) or the modulo operator ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_even_numbers([1, 2, 3, 4, 5, 6]) == 12\", \"assert sum_even_numbers([0, 1, 2, 3, 4, 5]) == 6\", \"assert sum_even_numbers([-2, -1, 0, 1, 2]) == 0\", \"assert sum_even_numbers([7, 8, 9, 10]) == 18\", \"assert sum_even_numbers([]) == 0\", \"assert sum_even...
{ "split": "train", "index": 67408, "acecode_id": "oss_23245", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a command name and a prefix that represents an option. Write a function `get_option_completions(command: str, prefix: str) -> List[Tuple[str, str]]` that returns a list of completions for the option based on predefined command options. Each completion should be re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_option_completions('git', '--') == []\", \"assert get_option_completions('git', 'a') == []\", \"assert get_option_completions('docker', 'p') == []\", \"assert get_option_completions('unknown', '-') == []\", \"assert get_option_completions('git', '') == [...
{ "split": "train", "index": 67409, "acecode_id": "bigcode_python_fns_13299", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `orm_regression` that manages the execution status of a regression analysis. The function takes a boolean parameter `executed`. If `executed` is `True`, the function should return the string 'Results of regression analysis'. If `execu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert orm_regression(True) == 'Results of regression analysis'\", \"assert orm_regression(False) == 'Regression analysis initiated'\", \"assert orm_regression(True) == 'Results of regression analysis'\", \"assert orm_regression(False) == 'Regression analysis initi...
{ "split": "train", "index": 67410, "acecode_id": "oss_14779", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a tuple `candidate` consisting of unique integers, a list `expansion_set` containing integers, and two optional parameters: `murder_list` which is a list of integers that should be excluded, and `attempted` which is a list of previously attempted tuples. Your task...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_extra((1, 2), [3, 4], [5]) == [(1, 2, 3), (1, 2, 4)]\", \"assert generate_extra((0,), [0, 1], [0]) == [(0, 1)]\", \"assert generate_extra((3, 4), [5, 6], [7]) == [(3, 4, 5), (3, 4, 6)]\", \"assert generate_extra((1, 2, 3), [4, 5], None, [(1, 2, 3, 4...
{ "split": "train", "index": 67411, "acecode_id": "bigcode_python_fns_29012", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates an XML element for a given key. The function should accept three parameters: a string `key`, a boolean `attr_type`, and an optional dictionary `attr`. If `attr_type` is True, the function should add a key `type` with a valu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_xml_element('item', True, {}) == '<item type=\\\"null\\\"></item>'\", \"assert generate_xml_element('item', False, {}) == '<item></item>'\", \"assert generate_xml_element('item', True, {'class': 'example'}) == '<item class=\\\"example\\\" type=\\\"n...
{ "split": "train", "index": 67412, "acecode_id": "bigcode_python_fns_14409", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that formats a nomination string for an entity in a given category. Your function should take two parameters: the name of the nominated entity and the name of the category. The function should return a string representation of the nominat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_nomination('John Doe', 'Best Actor') == '\\\"John Doe\\\" on \\\"Best Actor\\\"'\", \"assert format_nomination('Jane Smith', 'Best Director') == '\\\"Jane Smith\\\" on \\\"Best Director\\\"'\", \"assert format_nomination('The Avengers', 'Best Movie') ...
{ "split": "train", "index": 67413, "acecode_id": "oss_8511", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the total mass of proppant used in a hydraulic fracturing job based on the type of hydraulic fluid and the volume fraction of proppant in the fluid. Write a function `calculate_proppant_mass(hyd_typ: str, frac: float, volume: float) -> float` tha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_proppant_mass('Water-based', 0.2, 500) == 150000.0\", \"assert calculate_proppant_mass('Water-based', 0.0, 1000) == 0.0\", \"assert calculate_proppant_mass('Water-based', 0.1, 800) == 120000.0\", \"assert calculate_proppant_mass('Water-based', 0.1,...
{ "split": "train", "index": 67414, "acecode_id": "oss_34749", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a dictionary that maps node depths to a list of node ids (depth_node_dict), a previous Hirsch index value (minimum_hirsch_value), and the depth of the latest node added to the tree (maximum_hirsch_value). Your task is to implement a function that calculates the Hi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_hirsch_index({0: [1], 1: [2], 2: [3]}, 2, 3) == 2\", \"assert update_hirsch_index({0: [1]}, 1, 1) == 1\", \"assert update_hirsch_index({0: [1], 1: [2, 3]}, 2, 1) == 2\", \"assert update_hirsch_index({0: [1], 1: [2], 2: []}, 0, 2) == 0\", \"assert upda...
{ "split": "train", "index": 67415, "acecode_id": "bigcode_python_fns_21730", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `get_compiled_model(model_name: str, recompile: bool) -> str` that simulates the process of compiling a machine learning model based on its name. The function should return a string indicating whether the model was compiled or loaded from...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_compiled_model('modelA', False) == 'Compiling modelA'\", \"assert get_compiled_model('modelA', True) == 'Compiling modelA'\", \"assert get_compiled_model('modelB', False) == 'Loading modelB from cache'\", \"assert get_compiled_model('modelB', True) == 'C...
{ "split": "train", "index": 67416, "acecode_id": "bigcode_python_fns_46890", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Develop a function called 'calculate_triangle_area' that computes the area of a triangle given the lengths of its three sides. The function should take three parameters, a, b, and c, representing the lengths of the sides of the triangle. You can assume that the input values wil...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_triangle_area(3, 4, 5) == 6.0\", \"assert calculate_triangle_area(5, 12, 13) == 30.0\", \"assert calculate_triangle_area(7, 8, 9) == 26.832815729997478\", \"assert calculate_triangle_area(10, 10, 10) == 43.30127018922193\", \"assert calculate_trian...
{ "split": "train", "index": 67417, "acecode_id": "evol_26779", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of census tracts, each represented by a tuple containing its ID, latitude, and longitude, implement a function `get_census_centroid(census_tract_id: str, tracts: List[Tuple[str, float, float]]) -> Tuple[float, float]` that returns the geographic center (centroid) o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_census_centroid('tract_1', [('tract_1', 34.0522, -118.2437), ('tract_2', 36.1699, -115.1398)]) == (34.0522, -118.2437)\", \"assert get_census_centroid('tract_2', [('tract_1', 34.0522, -118.2437), ('tract_2', 36.1699, -115.1398)]) == (36.1699, -115.1398)\...
{ "split": "train", "index": 67418, "acecode_id": "bigcode_python_fns_30820", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function `eager_no_dists` that takes a list of integers and a class type as input. The function should return the sum of the integers in the list if the class type is a subclass of a specified base class (e.g., `BaseClass`). If the class ty...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert eager_no_dists(BaseClass, [1, 2, 3]) == 6\", \"assert eager_no_dists(BaseClass, [4, 5]) == 9\", \"assert eager_no_dists(BaseClass, []) == 0\", \"assert eager_no_dists(BaseClass, [0]) == 0\", \"assert eager_no_dists(BaseClass, [-1, -2, -3]) == -6\", \"assert ...
{ "split": "train", "index": 67419, "acecode_id": "bigcode_python_fns_48893", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple function that manages a list of todos. Each todo is represented by a dictionary with the following keys: 'text', 'timestamp', and 'datetime'. Your function should accept a list of todos and perform various operations based on a given comman...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_todos([], 'CREATE', {'text': 'Buy milk', 'timestamp': 1639492801.10111, 'datetime': '14.12.2021-16:40:01'}) == [{'text': 'Buy milk', 'timestamp': 1639492801.10111, 'datetime': '14.12.2021-16:40:01'}]\", \"assert manage_todos([{'text': 'Buy milk', 'tim...
{ "split": "train", "index": 67420, "acecode_id": "oss_9366", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two strings, `sequence` and `word`, determine the minimum integer value `k` such that the concatenation of `word` repeated `k` times is not a substring of `sequence`. If `word` itself is a substring of `sequence`, return `0`.\nPlease reason step by step, then write a self...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert minNonRepeating('abcdef', 'gh') == 1\", \"assert minNonRepeating('hello', 'lo') == 0\", \"assert minNonRepeating('testing', 'test') == 0\", \"assert minNonRepeating('xyzxyz', 'xyz') == 0\", \"assert minNonRepeating('abababab', 'ab') == 0\", \"assert minNonRe...
{ "split": "train", "index": 67421, "acecode_id": "evol_25212", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of hydrogen atom definitions, a residue name, and an isomer index, create an XML representation of the hydrogen definitions for the specified residue. The hydrogen definitions should be structured such that each hydrogen atom is a child of the residue element, and ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_hydrogen_xml([('H1', 'C1'), ('H2', 'C1')], 'Ala', 0) == '<Residues><Residue name=\\\"Ala\\\"><H name=\\\"H1\\\" parent=\\\"C1\\\" /><H name=\\\"H2\\\" parent=\\\"C1\\\" /></Residue></Residues>'\", \"assert generate_hydrogen_xml([('H1', 'C1')], 'Gly'...
{ "split": "train", "index": 67422, "acecode_id": "bigcode_python_fns_5389", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the number of requests made to a server each second. Your task is to implement a function that calculates the maximum number of requests that were made in any single second. Write a function `max_requests(requests: List[int]) -> int...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_requests([1, 2, 3, 4, 5]) == 5\", \"assert max_requests([10, 20, 30]) == 30\", \"assert max_requests([0, 0, 0, 0]) == 0\", \"assert max_requests([100, 200, 300, 400, 500]) == 500\", \"assert max_requests([7, 8, 9, 10, 6]) == 10\", \"assert max_requests([...
{ "split": "train", "index": 67423, "acecode_id": "bigcode_python_fns_19666", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a 2D list `batch_cls` representing class targets for a batch of samples, where each sample is a list of integers. Each integer represents a class label, and a special integer `num_classes` represents the absence of an object. Your task is to implement a function `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert retrieve_obj_indices([[0, 1, 7], [7, 7, 7], [2, 3]], 7) == [[0, 1], [], [2, 3]]\", \"assert retrieve_obj_indices([[1, 2, 3], [7, 8, 9]], 10) == [[0, 1, 2], [3, 4, 5]]\", \"assert retrieve_obj_indices([[7, 7], [0, 1]], 7) == [[], [0, 1]]\", \"assert retrieve_...
{ "split": "train", "index": 67424, "acecode_id": "bigcode_python_fns_15183", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Write a function `get_positive_and_sort_dict(d: dict) -> dict` that takes a dictionary `d` as input. Each key in the dictionary maps to a list of integers. The function should return a new dictionary where each key maps to a list of only the positive integers from the original ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_positive_and_sort_dict({'a': [-1, 2, -4], 'b': [5, 6]}) == {'a': [2], 'b': [5, 6]}\", \"assert get_positive_and_sort_dict({'x': [5, 3, -5, 2, -3, 3, 9, 123, 1, -10], 'y': [-1, 0, -3]}) == {'x': [1, 2, 3, 3, 5, 9, 123], 'y': []}\", \"assert get_positive_a...
{ "split": "train", "index": 67425, "acecode_id": "evol_16147", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to implement a function `populate_data` that takes in multiple parameters to store data related to mass spectrometry analysis. The function should accept the following parameters: \n- `mzs`: A 1D list containing mass-to-charge (m/z) values of ion fragments. \n- `ppm`: ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert populate_data([100.5, 200.2], [1.5, 2.5], ['red', 'blue'], {'scan1': 0, 'scan2': 1}, 0, ['fragment1', 'fragment2'], {'peak1': 'annotation1'}) == {'mzs': [100.5, 200.2], 'ppm': [1.5, 2.5], 'colors': ['red', 'blue'], 'scanIDDict': {'scan1': 0, 'scan2': 1}, 'cu...
{ "split": "train", "index": 67426, "acecode_id": "oss_30155", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a role-based access control system for a gaming platform. The system should allow users to have different roles, such as player, moderator, or administrator, and restrict access to certain game-related functionalities based on these roles. Your task...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_role_permission({'player': ['play', 'pause'], 'moderator': ['ban', 'kick']}, 'player', 'play') == True\", \"assert check_role_permission({'player': ['play', 'pause'], 'moderator': ['ban', 'kick']}, 'player', 'ban') == False\", \"assert check_role_permi...
{ "split": "train", "index": 67427, "acecode_id": "oss_31744", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks if a given record ID exists in a list of valid record IDs. The function should take two inputs: a string `record_id` representing the ID to be checked, and a list of strings `valid_ids` containing the valid record IDs. The...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_record_exists('record_1', ['record_1', 'record_2', 'record_3']) == True\", \"assert check_record_exists('record_4', ['record_1', 'record_2', 'record_3']) == False\", \"assert check_record_exists('record_1', []) == False\", \"assert check_record_exists(...
{ "split": "train", "index": 67428, "acecode_id": "bigcode_python_fns_10826", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `func(x, y)` that takes two parameters. The function should perform the following tasks: 1) If either `x` or `y` is not an integer or a float, return a custom error message indicating that both inputs must be of integer or float type. 2) If both inputs are vali...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert func(5, 3) == 2\", \"assert func(5.5, 2.5) == 3.0\", \"assert func(10, 5) == 5\", \"assert func(0, 0) == 0\", \"assert func(-1, -1) == 0\", \"assert func(1.5, 2.5) == -1.0\", \"assert func(100, -100) == 200\", \"assert func('5', 3) == 'Error: Both inputs mus...
{ "split": "train", "index": 67429, "acecode_id": "evol_29733", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two sorted linked lists, each containing integer values. Your task is to implement a function that merges these two lists into a single sorted linked list while preserving the overall order of elements. The function should handle edge cases such as one of the list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_lists(None, None) == None\", \"assert merge_lists(Node(1), None).data == 1\", \"assert merge_lists(None, Node(2)).data == 2\", \"assert merge_lists(Node(1), Node(2)).data == 1\", \"assert merge_lists(Node(1), Node(1)).data == 1\", \"assert merge_lists(...
{ "split": "train", "index": 67430, "acecode_id": "evol_14025", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function `add_vectors(vector1: List[int], vector2: List[int]) -> List[int]` that takes two vectors represented as lists of integers and returns a new vector that is the element-wise sum of the two input vectors. The input vectors will have the same length. For examp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_vectors([1, 2, 3], [4, 5, 6]) == [5, 7, 9]\", \"assert add_vectors([-1, -2, -3], [-4, -5, -6]) == [-5, -7, -9]\", \"assert add_vectors([0, 0, 0], [0, 0, 0]) == [0, 0, 0]\", \"assert add_vectors([1, 2], [3, 4]) == [4, 6]\", \"assert add_vectors([10, 20, 3...
{ "split": "train", "index": 67431, "acecode_id": "evol_3084", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a deeply nested list of integers, implement a function `prime_geomean(l: list) -> float` that returns the geometric mean of all prime numbers in the list. If there are no prime numbers, the function should return None. You may assume that the input list may contain intege...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert prime_geomean([[1, 4], [6, [8]], [[10]]]) == None\", \"assert prime_geomean([[]]) == None\", \"assert prime_geomean([10, 20, 30]) == None\", \"assert prime_geomean([[4], [6], [8], [10]]) == None\", \"assert prime_geomean([[-2, -3], [-5, -7]]) == None\", \"as...
{ "split": "train", "index": 67432, "acecode_id": "evol_13726", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with processing pool configurations represented as a list of dictionaries. Each dictionary contains details about a pool, including its name, partition, and load balancing mode. Write a function `filter_pools(pools: List[Dict[str, Any]], load_balancing_mode: str)...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_pools([{'name': 'pool1', 'partition': 'mypartition', 'loadBalancingMode': 'round-robin'}, {'name': 'pool2', 'partition': 'mypartition', 'loadBalancingMode': 'least-connections'}], 'round-robin') == ['pool1']\", \"assert filter_pools([{'name': 'pool1',...
{ "split": "train", "index": 67433, "acecode_id": "bigcode_python_fns_5077", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer num_people and an integer k, implement a function numberOfWays(num_people, k) that calculates the number of ways to pair up num_people people into k pairs. The result should be returned modulo 10^9 + 7. If num_people is odd, return 0 because it's not possible t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert numberOfWays(0, 0) == 1\", \"assert numberOfWays(1, 1) == 0\", \"assert numberOfWays(3, 1) == 0\", \"assert numberOfWays(5, 2) == 0\", \"assert numberOfWays(7, 3) == 0\", \"assert numberOfWays(21, 10) == 0\"]}" }
{ "split": "train", "index": 67434, "acecode_id": "evol_16799", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the behavior of retrieving a list of subnets from a networking service. The function takes two parameters: an authentication token and a dictionary of parameters for the API call. It should return a list of subnets based on...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_subnets('token123', {'network_id': 'net3'}) == []\", \"assert get_subnets('token123', {'invalid_param': 'value'}) == []\", \"assert get_subnets('token456', {'network_id': 'net3'}) == []\", \"assert get_subnets('token456', {'invalid_param': 'value'}) == [...
{ "split": "train", "index": 67435, "acecode_id": "oss_30943", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a list of strings where each string represents a line from a file. Your task is to implement a function that processes this list and returns a new list containing only the non-empty lines. Each line in the input list can contain multiple words separated by spaces....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_non_empty_lines(['Hello world', '', 'This is a test', '']) == ['Hello world', 'This is a test']\", \"assert filter_non_empty_lines(['', '', '']) == []\", \"assert filter_non_empty_lines(['Line 1', 'Line 2', 'Line 3']) == ['Line 1', 'Line 2', 'Line 3']...
{ "split": "train", "index": 67436, "acecode_id": "bigcode_python_fns_12763", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates uploading a file to a cloud storage service. The function, `upload_to_bucket(bucket_name: str, file_name: str)`, should return the string 'Upload Successful' if the file exists and the upload is simulated successfully. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert upload_to_bucket('my_bucket', 'file.txt') == 'Upload Successful'\", \"assert upload_to_bucket('my_bucket', 'document.pdf') == 'Upload Successful'\", \"assert upload_to_bucket('test_bucket', 'image.png') == 'Upload Successful'\", \"assert upload_to_bucket('ex...
{ "split": "train", "index": 67437, "acecode_id": "evol_6845", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of file sizes in bytes and a maximum allowed size in bytes for a single upload operation. Your task is to implement a function that determines how many upload operations are needed to upload all the files without exceeding the maximum size in any operation....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_upload_operations([100, 200, 150, 300], 400) == 3\", \"assert count_upload_operations([100, 300, 200], 400) == 2\", \"assert count_upload_operations([50, 50, 50, 50], 100) == 2\", \"assert count_upload_operations([500], 500) == 1\", \"assert count_uplo...
{ "split": "train", "index": 67438, "acecode_id": "bigcode_python_fns_9861", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that processes a given URI and extracts specific components from it. The URI follows the format `ccnx:/<component1>/<component2>/.../<componentN>`, where each `<component>` is a string without any special characters. Write a fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_uri_components('ccnx:/singlecomponent') == ['singlecomponent']\", \"assert extract_uri_components('ccnx:/') == []\", \"assert extract_uri_components('invalid_uri_format') == []\", \"assert extract_uri_components('ccnx:/') == []\", \"assert extract_ur...
{ "split": "train", "index": 67439, "acecode_id": "oss_106", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of buildings in a row. Your task is to write a function that returns the number of buildings that can see the sunset when viewed from the right side. A building can see the sunset if it is taller than all the buildings t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert countBuildingsWithSunset([3, 7, 8, 3, 6, 1]) == 3\", \"assert countBuildingsWithSunset([1, 5, 3, 2, 4]) == 2\", \"assert countBuildingsWithSunset([2, 2, 2, 2]) == 1\", \"assert countBuildingsWithSunset([1]) == 1\", \"assert countBuildingsWithSunset([]) == 0\...
{ "split": "train", "index": 67440, "acecode_id": "bigcode_python_fns_17721", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given a regular expression pattern and a string, implement a function that checks if the string matches the pattern. The pattern may include the following special characters: \n\n- `?` means zero or one of the preceding element.\n- `*` means zero or more of the preceding elemen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert word_match('abc', 'abc') == True\", \"assert word_match('a?c', 'ac') == True\", \"assert word_match('a*c', 'ac') == True\", \"assert word_match('a*c', 'aaac') == True\", \"assert word_match('a*c', 'b') == False\", \"assert word_match('a?b', '') == False\", \...
{ "split": "train", "index": 67441, "acecode_id": "bigcode_python_fns_41815", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Write a function that takes two integers, 'start' and 'end', and returns a list of all prime numbers in the inclusive range between 'start' and 'end'. A prime number is a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers.\nPlease rea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_primes(10, 40) == [11, 13, 17, 19, 23, 29, 31, 37]\", \"assert get_primes(1, 10) == [2, 3, 5, 7]\", \"assert get_primes(0, 20) == [2, 3, 5, 7, 11, 13, 17, 19]\", \"assert get_primes(20, 30) == [23, 29]\", \"assert get_primes(15, 15) == []\", \"assert get...
{ "split": "train", "index": 67442, "acecode_id": "evol_3781", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of song track numbers and a list of music file names. Your task is to write a function that checks if the number of music files (with a '.mp3' extension) in the provided list of file names matches the number of tracks in the list of song track numbers. If t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert number_of_songs_match([1, 2, 3], ['song1.mp3', 'song2.mp3', 'song3.mp3']) == True\", \"assert number_of_songs_match([1, 2], ['song1.mp3', 'song2.mp3', 'song3.mp3']) == False\", \"assert number_of_songs_match([], ['song1.mp3', 'song2.mp3']) == False\", \"asse...
{ "split": "train", "index": 67443, "acecode_id": "bigcode_python_fns_1061", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a target type and a set of properties, and returns a list of generators that can create instances of the specified target type while satisfying the given properties. The function should consider all base types of the target...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_viable_generators('TypeA', {'prop1', 'prop2'}) == ['Generator1', 'Generator2']\", \"assert find_viable_generators('TypeB', {'prop3'}) == []\", \"assert find_viable_generators('TypeE', {'prop1'}) == []\", \"assert find_viable_generators('TypeI', {'prop5'...
{ "split": "train", "index": 67444, "acecode_id": "bigcode_python_fns_17027", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of package names and returns a dictionary containing the count of each unique package name along with the total count of packages. The function should take a list of package names as input and return a diction...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_packages(['numpy', 'pandas', 'numpy', 'matplotlib', 'pandas', 'scipy', 'numpy']) == {'total_count': 7, 'numpy': 3, 'pandas': 2, 'matplotlib': 1, 'scipy': 1}\", \"assert count_packages(['tensorflow', 'keras', 'tensorflow', 'numpy']) == {'total_count': 4...
{ "split": "train", "index": 67445, "acecode_id": "oss_418", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that calculates the sum of the squares of all the even numbers in the list. The function should take a list of integers as input and return the sum of the squares of all the even numbers. If there are no even numbers, the function shou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_squares_of_even_numbers([1, 2, 3, 4, 5, 6]) == 56\", \"assert sum_of_squares_of_even_numbers([7, 8, 9, 10, 11]) == 164\", \"assert sum_of_squares_of_even_numbers([0, 1, 2, 3]) == 4\", \"assert sum_of_squares_of_even_numbers([2, 2, 2, 2]) == 16\", \"as...
{ "split": "train", "index": 67446, "acecode_id": "oss_22280", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that returns the first n prime numbers that are also Fibonacci numbers. If there are fewer than n such numbers, return an empty list. Implement this function efficiently using a dynamic programming approach. The function should be defined as follows: def get_fi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_fibo_primes(0) == []\", \"assert get_fibo_primes(1) == [2]\", \"assert get_fibo_primes(2) == [2, 3]\", \"assert get_fibo_primes(3) == [2, 3, 5]\", \"assert get_fibo_primes(4) == [2, 3, 5, 13]\", \"assert get_fibo_primes(5) == [2, 3, 5, 13, 89]\", \"asser...
{ "split": "train", "index": 67447, "acecode_id": "evol_10053", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates browsing through a collection of items in an online store. The function should take a list of items (strings) as input and return a formatted string that lists each item on a new line, prefixed with its index in the list. T...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert browse_items(['Book', 'Laptop', 'Pen']) == '0: Book\\\\n1: Laptop\\\\n2: Pen'\", \"assert browse_items(['Apple', 'Banana']) == '0: Apple\\\\n1: Banana'\", \"assert browse_items(['Chair']) == '0: Chair'\", \"assert browse_items([]) == 'No items available.'\",...
{ "split": "train", "index": 67448, "acecode_id": "bigcode_python_fns_32046", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `is_valid_isbn(isbn: str) -> bool` that validates an ISBN number. The function should accept a string representing an ISBN, which can be in either ISBN-10 or ISBN-13 format. The function should return True if the ISBN is valid and False otherwise. An ISBN i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_isbn('978-3-16-148410-0') == True\", \"assert is_valid_isbn('0-306-40615-2') == True\", \"assert is_valid_isbn('123456789X') == True\", \"assert is_valid_isbn('9783161484100') == True\", \"assert is_valid_isbn('978-0-306-40615-X') == False\", \"asse...
{ "split": "train", "index": 67449, "acecode_id": "evol_19922", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a list of integers and an integer target as input. The function should return the indices of the two numbers such that they add up to the target. You may assume that each input would have exactly one solution, and you may n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert two_sum([2, 7, 11, 15], 9) == [0, 1]\", \"assert two_sum([3, 2, 4], 6) == [1, 2]\", \"assert two_sum([3, 3], 6) == [0, 1]\", \"assert two_sum([0, 4, 3, 0], 0) == [0, 3]\", \"assert two_sum([-1, -2, -3, -4, -5], -8) == [2, 4]\", \"assert two_sum([10, 15, 3, 7...
{ "split": "train", "index": 67450, "acecode_id": "bigcode_python_fns_9894", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simple reaction lookup system for articles. The lookup function should accept up to three optional parameters: `article_id`, `user_id`, and `_id`. The function should return a dictionary representing the reaction base...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert lookup_reaction() == {}\", \"assert lookup_reaction(article_id='123') == {'article_id': '123'}\", \"assert lookup_reaction(user_id='456') == {'user_id': '456'}\", \"assert lookup_reaction(_id='789') == {'_id': '789'}\", \"assert lookup_reaction(article_id='1...
{ "split": "train", "index": 67451, "acecode_id": "bigcode_python_fns_21144", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that evaluates a mathematical expression represented as a string. The expression can contain non-negative integers, the four basic arithmetic operators (addition (+), subtraction (-), multiplication (*), and division (/)), and parenth...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert evaluate_expression('3 + 4 * (2 - 1)') == 7.0\", \"assert evaluate_expression('10 + 2 * 6') == 22.0\", \"assert evaluate_expression('100 * 2 + 12') == 212.0\", \"assert evaluate_expression('100 * (2 + 12)') == 1400.0\", \"assert evaluate_expression('100 * (2...
{ "split": "train", "index": 67452, "acecode_id": "oss_25180", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that generates a two-dimensional matrix of dimensions n by m, where every element in the matrix is initialized to the value zero. The function should accept two parameters, n (the number of rows) and m (the number of columns), and return the created matrix....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_matrix(1, 1) == [[0]]\", \"assert create_matrix(2, 2) == [[0, 0], [0, 0]]\", \"assert create_matrix(3, 3) == [[0, 0, 0], [0, 0, 0], [0, 0, 0]]\", \"assert create_matrix(2, 3) == [[0, 0, 0], [0, 0, 0]]\", \"assert create_matrix(4, 2) == [[0, 0], [0, 0]...
{ "split": "train", "index": 67453, "acecode_id": "evol_33008", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of integers and returns a dictionary where the keys are the unique integers from the list and the values are their respective counts in the list. Implement the function `count_integers(nums: List[int]) -> Dict[int, int]`...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_integers([1, 2, 2, 3, 1]) == {1: 2, 2: 2, 3: 1}\", \"assert count_integers([1, 1, 1, 1]) == {1: 4}\", \"assert count_integers([5, 5, 5, 5, 5]) == {5: 5}\", \"assert count_integers([]) == {}\", \"assert count_integers([0, 0, 1, 1, 1, 2, 2]) == {0: 2, 1:...
{ "split": "train", "index": 67454, "acecode_id": "bigcode_python_fns_35210", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings, where each string contains six space-separated fields: query ID, an unused field, document ID, rank, score, and an unused field. Your task is to create a dictionary where the keys are the unique query IDs and the values are dictionaries that map...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_run_data(['1 a doc1 1 0.5 b', '1 a doc2 2 0.7 b', '2 a doc3 1 0.3 b']) == {'1': {'doc1': 0.5, 'doc2': 0.7}, '2': {'doc3': 0.3}}\", \"assert process_run_data(['3 a doc4 1 0.8 b', '3 a doc5 2 0.9 b']) == {'3': {'doc4': 0.8, 'doc5': 0.9}}\", \"assert pr...
{ "split": "train", "index": 67455, "acecode_id": "bigcode_python_fns_48553", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a Python function that performs a linear search on a list of integers. The function should take in a list of integers and an integer to search for, and return the index of the integer in the list if it exists. If the integer is not found, return -1.\nPlease reason ste...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert linear_search([1, 2, 3, 4, 5], 3) == 2\", \"assert linear_search([5, 4, 3, 2, 1], 1) == 4\", \"assert linear_search([10, 20, 30, 40, 50], 10) == 0\", \"assert linear_search([1, 3, 5, 7, 9], 8) == -1\", \"assert linear_search([1, 2, 3, 4, 5], 1) == 0\", \"ass...
{ "split": "train", "index": 67456, "acecode_id": "evol_12242", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a square matrix represented as a list of lists, write a function that converts the matrix into a pretty string format. The pretty string should display each row of the matrix on a new line, with elements of the row separated by commas. The input matrix will always be squa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert pretty_print([[1, 2], [3, 4]]) == '1, 2\\\\n3, 4'\", \"assert pretty_print([[5]]) == '5'\", \"assert pretty_print([[1, 0, 1], [0, 1, 0], [1, 0, 1]]) == '1, 0, 1\\\\n0, 1, 0\\\\n1, 0, 1'\", \"assert pretty_print([[9, 8, 7], [6, 5, 4], [3, 2, 1]]) == '9, 8, 7\...
{ "split": "train", "index": 67457, "acecode_id": "bigcode_python_fns_32684", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes an array of integers and returns an array of the same size where each element is the sum of all the elements in the original array except for the element at that index. Ensure your solution does not use any additional data structures that grow with t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_sum_array([1, 2, 3]) == [5, 4, 3]\", \"assert get_sum_array([4, 5, 6]) == [11, 10, 9]\", \"assert get_sum_array([-1, -2, -3]) == [-5, -4, -3]\", \"assert get_sum_array([10, 20, 30, 40]) == [90, 80, 70, 60]\", \"assert get_sum_array([0, 0, 0]) == [0, 0, 0...
{ "split": "train", "index": 67458, "acecode_id": "evol_28433", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `shuffle_iterator(items: List[str]) -> List[str]` that takes a list of strings as input and returns a new list containing the elements of the input list in a randomly shuffled order. The function should ensure that the same element is not included more than...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert shuffle_iterator(['Hello', 'World', 'AI', 'Machine Learning']) != ['Hello', 'World', 'AI', 'Machine Learning']\", \"assert len(shuffle_iterator(['Hello', 'World', 'AI', 'Machine Learning'])) == 4\", \"assert set(shuffle_iterator(['Hello', 'World', 'AI', 'Mac...
{ "split": "train", "index": 67459, "acecode_id": "evol_19840", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function called `sum_three_numbers` that takes three integers as arguments and returns their sum.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block." } ]
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_three_numbers(1, 2, 3) == 6\", \"assert sum_three_numbers(-1, -2, -3) == -6\", \"assert sum_three_numbers(0, 0, 0) == 0\", \"assert sum_three_numbers(5, 10, 15) == 30\", \"assert sum_three_numbers(-5, 5, 0) == 0\", \"assert sum_three_numbers(100, 200, 30...
{ "split": "train", "index": 67460, "acecode_id": "evol_6274", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `shift_list` that takes a list of floating-point numbers and an integer `k`, and performs a leftward or rightward shift operation on the list based on a specified direction. The function should return the modified list after the shift. The function signatur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert shift_list([1.1, 2.2, 3.3, 4.4, 5.5], 3, 'left') == [4.4, 5.5, 1.1, 2.2, 3.3]\", \"assert shift_list([1.1, 2.2, 3.3, 4.4, 5.5], 1, 'right') == [5.5, 1.1, 2.2, 3.3, 4.4]\", \"assert shift_list([1.1, 2.2, 3.3, 4.4, 5.5], 5, 'left') == [1.1, 2.2, 3.3, 4.4, 5.5]...
{ "split": "train", "index": 67461, "acecode_id": "evol_10123", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with validating a sequence editing request based on certain conditions related to segments and targets. Write a function `validate_sequence_edit(data_type: str, defined: bool, missing: bool, used: bool, sequence_id: Optional[str]) -> Optional[str]` that returns a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_sequence_edit('barcode', False, True, False, None) == 'The target field is required for barcode references'\", \"assert validate_sequence_edit('barcode', False, False, False, 'boo') == 'Target ITS2 is not defined for the parent reference'\", \"asser...
{ "split": "train", "index": 67462, "acecode_id": "bigcode_python_fns_4067", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes in a list of integers and returns a new list containing only the even integers from the original list. The output list should maintain the order of the even integers as they appeared in the input list. Implement a function `fil...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 15, 20, 25]) == [10, 20]\", \"assert filter_even_numbers([-2, -1, 0, 1, 2]) == [-2, 0, 2]\", \"assert filter_even_numbers([]) == []\", \"assert filter_even_numbers([1, 3, 5])...
{ "split": "train", "index": 67463, "acecode_id": "oss_10444", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that manages a list of nodes in a network based on their positions. The function will be given a list of positions, and it needs to return a dictionary where each position is a key and its corresponding value is the index of that posi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_node_positions([(1.0, 2.0), (3.0, 4.0), (1.0, 2.0)]) == {(1.0, 2.0): 0, (3.0, 4.0): 1}\", \"assert get_node_positions([(1.0, 2.0, 3.0), (3.0, 4.0, 5.0), (1.0, 2.0, 3.0)]) == {(1.0, 2.0, 3.0): 0, (3.0, 4.0, 5.0): 1}\", \"assert get_node_positions([(0.0, 0...
{ "split": "train", "index": 67464, "acecode_id": "oss_10014", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple batch processing function. The function should take in a list of integers representing tasks to be processed and an optional string representing the name of the batch. The function should return a dictionary where the keys are the task iden...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_batch([1, 2, 3], 'Batch1') == {1: 1, 2: 4, 3: 9, 'batch_name': 'Batch1'}\", \"assert process_batch([4, 5], 'TestBatch') == {4: 16, 5: 25, 'batch_name': 'TestBatch'}\", \"assert process_batch([0, -1, -2]) == {0: 0, -1: 1, -2: 4}\", \"assert process_ba...
{ "split": "train", "index": 67465, "acecode_id": "bigcode_python_fns_17221", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings where each string represents an address separated by tab characters. Each address string contains the following fields in order: country_code, postal_code, place_name, admin_name1, admin_code1, admin_name2, admin_code2, admin_name3, admin_code3, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert import_addresses(['US\\\\t90210\\\\tBeverly Hills\\\\tCalifornia\\\\tCA\\\\tLos Angeles\\\\tLos Angeles County\\\\t\\\\t\\\\t34.0901\\\\t-118.4065\\\\t1']) == [{'country_code': 'US', 'postal_code': '90210', 'place_name': 'Beverly Hills', 'admin_name1': 'Cali...
{ "split": "train", "index": 67466, "acecode_id": "bigcode_python_fns_15429", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given a string `m` representing a mathematical operation in the format `a+b-c`, where `a`, `b`, and `c` are integers and `+` and `-` are arithmetic operators. Your task is to implement a function that evaluates the given expression and returns the result as an integer. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert evaluate_expression('1+1-1') == 1\", \"assert evaluate_expression('0+10-5') == 5\", \"assert evaluate_expression('100+200-150') == 150\", \"assert evaluate_expression('-5+5-10') == -10\", \"assert evaluate_expression('20+30-50') == 0\", \"assert evaluate_exp...
{ "split": "train", "index": 67467, "acecode_id": "oss_7186", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `create_http_server(hostname: str, port: int) -> str` that sets up a simple HTTP server using the SocketServer and SimpleHTTPServer modules in Python. Your function should take in a hostname and a port number as arguments. The function sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_http_server('localhost', 8080) == 'Server started at 127.0.0.1:8080'\", \"assert create_http_server('invalid.hostname', 8080) == 'Invalid hostname'\", \"assert create_http_server('localhost', 70000) == 'Invalid port number'\", \"assert create_http_ser...
{ "split": "train", "index": 67468, "acecode_id": "oss_30149", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the parsing of command-line arguments using the `argparse` module in Python. Your function should take in several parameters that simulate command-line arguments and return a dictionary with the parsed values. The function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_args(False, './config/ernie_config.json', './config/30k-clean.vocab.albert', '', 512, False, 'train.txt', 'eval.txt', 32, 0.001) == {'debug': False, 'ernie_config_file': './config/ernie_config.json', 'vocab_file': './config/30k-clean.vocab.albert', 'in...
{ "split": "train", "index": 67469, "acecode_id": "oss_12876", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that calculates the time difference between two timestamps represented as strings in the format 'YYYY-MM-DD HH:MM:SS'. The function should return a human-readable string representing the time difference in a user-friendly format. If the t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_time_difference('2023-10-01 12:00:00', '2023-10-01 12:00:00') == 'just now'\", \"assert format_time_difference('2023-10-01 12:00:00', '2023-10-01 12:00:05') == 'just now'\", \"assert format_time_difference('2023-10-01 12:00:00', '2023-10-01 12:00:10')...
{ "split": "train", "index": 67470, "acecode_id": "oss_15978", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that manages a list of tasks. Your function should allow for adding tasks, removing tasks, displaying the list of tasks, and marking a task as completed. Implement a function `manage_tasks(operations: List[Tuple[str, str]]) -> List[List[s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_tasks([('add', 'Task 1'), ('add', 'Task 2'), ('display', '')]) == [['Task 1', 'Task 2']]\", \"assert manage_tasks([('add', 'Task 1'), ('complete', 'Task 1'), ('display', '')]) == [['Task 1']]\", \"assert manage_tasks([('add', 'Task 1'), ('remove', 'Ta...
{ "split": "train", "index": 67471, "acecode_id": "oss_35216", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `decimal_to_binary(n: int) -> str` that takes a non-negative integer `n` and returns its binary representation as a string. The binary string should not include the '0b' prefix.\nPlease reason step by step, then write a self-contained Python solution. Give ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert decimal_to_binary(0) == '0'\", \"assert decimal_to_binary(1) == '1'\", \"assert decimal_to_binary(2) == '10'\", \"assert decimal_to_binary(3) == '11'\", \"assert decimal_to_binary(4) == '100'\", \"assert decimal_to_binary(5) == '101'\", \"assert decimal_to_b...
{ "split": "train", "index": 67472, "acecode_id": "evol_15526", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `create_foo` that takes two parameters: an integer `id` and a string `bar`. The function should return a dictionary representing an instance of a hypothetical class `Foo`, where the dictionary contains the keys 'id' and 'bar' with their corresponding values...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_foo(1, 'example') == {'id': 1, 'bar': 'example'}\", \"assert create_foo(42, 'test string') == {'id': 42, 'bar': 'test string'}\", \"assert create_foo(0, 'foo') == {'id': 0, 'bar': 'foo'}\", \"assert create_foo(-1, 'negative id') == {'id': -1, 'bar': '...
{ "split": "train", "index": 67473, "acecode_id": "evol_24107", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `factorial(n)` that calculates the factorial of a non-negative integer n. The function should raise a ValueError if n is negative or not an integer. The factorial of a non-negative integer n is the product of all positive integers less than or equal to n. F...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert factorial(0) == 1\", \"assert factorial(1) == 1\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", \"assert factorial(5) == 120\", \"assert factorial(6) == 720\", \"assert factorial(7) == 5040\", \"assert factorial(...
{ "split": "train", "index": 67474, "acecode_id": "evol_26230", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function that takes two strings as arguments. The function should return which of the two strings is a palindrome. If both are palindromes, the function should return both. If none is palindrome, the function should return a suitable error message. The function should ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert identify_palindromes('Able, was I saw Elba', 'Madam, in Eden I\\u2019m Adam') == ('Able, was I saw Elba', 'Madam, in Eden I\\u2019m Adam')\", \"assert identify_palindromes('A man, a plan, a canal, Panama', 'No lemon, no melon') == ('A man, a plan, a canal, P...
{ "split": "train", "index": 67475, "acecode_id": "evol_33072", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that creates a dispatch class for event handling in an application. The function should take a class, a class name, a tuple of base classes, and a dictionary of event names as parameters. The dispatch class should inherit from the spe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_dispatcher_class(SomeClass, 'MyDispatch', (BaseClass,), {'event1': 'handler1', 'event2': 'handler2'}) is not None\", \"assert create_dispatcher_class(SomeClass, 'MyDispatch', (BaseClass,), {'event1': 'handler1'}).__name__ == 'MyDispatch'\", \"assert i...
{ "split": "train", "index": 67476, "acecode_id": "bigcode_python_fns_11682", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of pairs where each pair consists of a unique identifier and a list of integers representing ratings. You also have a dictionary that maps unique identifiers to their corresponding previous ratings (in seconds). Your task is to write a function `calculate_r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_rating([(1, [10, 20]), (2, [30, 40])], {3: 43200}) == 0.0\", \"assert calculate_rating([(1, [1]), (2, [2])], {3: 86400}) == 0.0\", \"assert calculate_rating([], {1: 86400}) == 0.0\", \"assert calculate_rating([(1, [1])], {}) == 0.0\", \"assert calc...
{ "split": "train", "index": 67477, "acecode_id": "bigcode_python_fns_12681", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given four distinct points represented as tuples of (x, y) coordinates in a 2D plane, determine if the direction from the first point to the second point is the same as the direction from the third point to the fourth point. The points are collinear if they lie on the same stra...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rel_ordered((0, 0), (1, 1), (2, 2), (3, 3)) == True\", \"assert rel_ordered((1, 2), (2, 3), (3, 4), (4, 5)) == True\", \"assert rel_ordered((0, 0), (1, 1), (1, 0), (2, -1)) == False\", \"assert rel_ordered((1, 1), (2, 2), (3, 3), (4, 4)) == True\", \"assert ...
{ "split": "train", "index": 67478, "acecode_id": "bigcode_python_fns_42984", "num_tests": 16 }
acecode
[ { "role": "user", "content": "In a town, there are `N` people labelled from `1` to `N`. There is a rumor that one of these people is secretly the town judge. If the town judge exists, then: The town judge trusts nobody, and everybody (except for the town judge) trusts the town judge. You are given `trust`, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert findJudge(3, [[1,3],[2,3],[3,1]]) == -1\", \"assert findJudge(3, [[1,2],[2,3]]) == -1\", \"assert findJudge(2, [[1,2],[2,1]]) == -1\", \"assert findJudge(4, [[1,2],[1,3],[2,3],[3,4]]) == -1\", \"assert findJudge(3, [[1,2],[2,1],[1,3]]) == -1\", \"assert find...
{ "split": "train", "index": 67479, "acecode_id": "evol_16123", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Implement a function that performs Caesar Cipher encryption on a given string with a specified shift. The function should only encrypt alphabetic characters, while non-alphabetic characters remain unchanged. The function signature should be: `def caesar_cipher(text: str, shift:...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert caesar_cipher('Hello, World!', 3) == 'Khoor, Zruog!'\", \"assert caesar_cipher('abc', 1) == 'bcd'\", \"assert caesar_cipher('xyz', 2) == 'zab'\", \"assert caesar_cipher('A B C', 1) == 'B C D'\", \"assert caesar_cipher('Hello, World!', 0) == 'Hello, World!'\"...
{ "split": "train", "index": 67480, "acecode_id": "evol_22699", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `svn_auth_open` that simulates the behavior of opening an authentication session for a version control system. The function takes three parameters: `auth_baton` (a string representing the authentication credentials), `providers` (a list o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert svn_auth_open('my_credentials', ['provider1', 'provider2'], 42) == {'auth_baton': 'my_credentials', 'providers': ['provider1', 'provider2'], 'pool': 42}\", \"assert svn_auth_open('admin', [], 1) == {'auth_baton': 'admin', 'providers': [], 'pool': 1}\", \"ass...
{ "split": "train", "index": 67481, "acecode_id": "bigcode_python_fns_7049", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a data stream represented as a list of integers. Your task is to create a function that generates a dictionary where the keys are the unique integers from the data stream, and the values are the counts of how many times each integer appears in the stream. Implemen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_count_dict([1, 2, 2, 3, 1]) == {1: 2, 2: 2, 3: 1}\", \"assert generate_count_dict([5, 5, 5, 5, 5]) == {5: 5}\", \"assert generate_count_dict([]) == {}\", \"assert generate_count_dict([10, 20, 10]) == {10: 2, 20: 1}\", \"assert generate_count_dict([1...
{ "split": "train", "index": 67482, "acecode_id": "bigcode_python_fns_29203", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function `run_buildnis(arguments: List[str]) -> int` that simulates running a build command with given arguments. The function should return an integer representing the exit status of the command. If the argument list contains the string '--clean', the function should ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert run_buildnis(['--clean']) == 0\", \"assert run_buildnis(['build']) == -1\", \"assert run_buildnis(['--clean', 'extra']) == 0\", \"assert run_buildnis(['install']) == -1\", \"assert run_buildnis(['--help']) == -1\", \"assert run_buildnis(['--clean', '--verbos...
{ "split": "train", "index": 67483, "acecode_id": "bigcode_python_fns_12483", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that registers a plugin to a specific type. The function should take two arguments: `plugin_identity` (a string representing the identity of the plugin) and `type_identity` (a string representing the type of the plugin). The function will...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert register_plugin('pluginA', 'type1') == 'Plugin pluginA registered successfully.'\", \"assert register_plugin('pluginB', 'type2') == 'Plugin pluginB registered successfully.'\", \"assert register_plugin('pluginC', 'type1') == 'Plugin pluginC registered succes...
{ "split": "train", "index": 67484, "acecode_id": "bigcode_python_fns_3563", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a primary node in a network system, which can manage connections to secondary nodes. The function, `manage_connections`, will take a list of operations as input and return the final state of connected secondary nodes. T...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_connections(['connect S1', 'connect S2', 'handle S1 Data from S1', 'handle S2 Data from S2']) == ['S1', 'S2']\", \"assert manage_connections(['connect S1', 'disconnect S1', 'handle S1 Data from S1']) == []\", \"assert manage_connections(['connect S1',...
{ "split": "train", "index": 67485, "acecode_id": "oss_11351", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of dictionaries representing companies, each containing the keys 'name', 'symbol', 'exchange', and optionally 'root', write a function `filter_companies_by_exchange(companies: List[Dict[str, Optional[str]]], exchange: str) -> List[Dict[str, Optional[str]]]` that re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_companies_by_exchange([{'name': 'Company A', 'symbol': 'A', 'exchange': 'NYSE'}, {'name': 'Company B', 'symbol': 'B', 'exchange': 'NASDAQ'}, {'name': 'Company C', 'symbol': 'C', 'exchange': None}], 'NYSE') == [{'name': 'Company A', 'symbol': 'A', 'exc...
{ "split": "train", "index": 67486, "acecode_id": "bigcode_python_fns_24595", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a class called Level that generates a list of invaders for a space invader game based on the current level of difficulty. The invaders should be represented by the Invader class, which has x and y coordinates. The number of invaders generated should be equal to the le...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert len(Level().generate_invaders(1)) == 10\", \"assert len(Level().generate_invaders(2)) == 20\", \"assert len(Level().generate_invaders(3)) == 30\", \"assert len(Level().generate_invaders(4)) == 40\", \"assert len(Level().generate_invaders(5)) == 50\", \"asser...
{ "split": "train", "index": 67487, "acecode_id": "evol_14809", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to validate a set of p-values used in statistical hypothesis testing. A p-value is a measure of the evidence against a null hypothesis and is expected to fall within the range of 0 to 1. Your function should perform the following chec...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_pvalues([0.2, 0.8, 0.5, 0.3]) == True\", \"assert validate_pvalues([0.1, 0.6, 1.2, 0.4]) == False\", \"assert validate_pvalues([0.0, 0.7, 0.5, 0.3]) == False\", \"assert validate_pvalues([0.2, 0.8, 1.0]) == False\", \"assert validate_pvalues([0.5, 0...
{ "split": "train", "index": 67488, "acecode_id": "oss_10245", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `find_max(words: List[str], case_sensitive: bool = False) -> str` that accepts a list of unique strings as its primary input. It should return the word with the greatest count of distinguished characters. In case of a tie, return the word that appears first...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_max(['name', 'of', 'String'], True) == 'String'\", \"assert find_max(['A', 'a', 'B', 'b'], False) == 'A'\", \"assert find_max(['abc', 'a', 'b', 'c']) == 'abc'\", \"assert find_max(['xyz', 'xy', 'xz', 'yz']) == 'xyz'\", \"assert find_max(['hello', 'world...
{ "split": "train", "index": 67489, "acecode_id": "evol_26523", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with determining the type of software version based on its version number provided as a string. Write a function `handleBotVersion` that takes a version number as input and returns a message based on the version. The function should return \"Legacy version\" for ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert handleBotVersion(\\\"v1.5\\\") == \\\"Legacy version\\\"\", \"assert handleBotVersion(\\\"v1.9\\\") == \\\"Legacy version\\\"\", \"assert handleBotVersion(\\\"v2.0\\\") == \\\"Stable version\\\"\", \"assert handleBotVersion(\\\"v2.1\\\") == \\\"Cutting-edge ...
{ "split": "train", "index": 67490, "acecode_id": "oss_22165", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing a time series data. Your task is to process this data by downsampling it to a specified sampling rate. The downsampling should be done by taking every nth element from the list, where n is the sampling rate. Write a function `downsa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert downsample_data([1, 2, 3, 4, 5, 6], 2) == [1, 3, 5]\", \"assert downsample_data([10, 20, 30, 40, 50], 3) == [10, 40]\", \"assert downsample_data([5, 10, 15, 20], 1) == [5, 10, 15, 20]\", \"assert downsample_data([100, 200, 300], 4) == []\", \"assert downsamp...
{ "split": "train", "index": 67491, "acecode_id": "bigcode_python_fns_37036", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that determines the best adapter to use based on a set of constraints provided as boolean parameters. The function should follow these rules: \n\n1. If `use_myriad` is True, then `openvino` must be set to True. If `cpu_only` is also True,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_adapter(True, False, True, False) == 'Error: Cannot run with both Torch and OpenVINO'\", \"assert create_adapter(False, False, True, True) == 'Using Torch with GPU'\", \"assert create_adapter(False, True, True, False) == 'Using Torch with CPU'\", \"as...
{ "split": "train", "index": 67492, "acecode_id": "bigcode_python_fns_4575", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that transforms a given record into a customized format. The customization should convert the record into a Unicode string representation. You need to implement a function named `customize_record` that takes a single input parameter, `rec...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert customize_record(123) == '123'\", \"assert customize_record(45.67) == '45.67'\", \"assert customize_record(['a', 'b', 'c']) == \\\"['a', 'b', 'c']\\\"\", \"assert customize_record({'key': 'value'}) == \\\"{'key': 'value'}\\\"\", \"assert customize_record(Non...
{ "split": "train", "index": 67493, "acecode_id": "bigcode_python_fns_35669", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a floating-point number x which is guaranteed to be in the range [0, 1]. Your task is to implement a function that converts this floating-point number to an integer in the range [0, 255]. The conversion should be done as follows: multiply x by 256 and round down t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert float_to_byte(0.0) == 0\", \"assert float_to_byte(0.1) == 25\", \"assert float_to_byte(0.25) == 64\", \"assert float_to_byte(0.5) == 128\", \"assert float_to_byte(1.0) == 255\", \"assert float_to_byte(0.255) == 65\", \"assert float_to_byte(0.999) == 255\", \...
{ "split": "train", "index": 67494, "acecode_id": "bigcode_python_fns_14642", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a two-dimensional list that may contain nested lists and various data types, write a function that sums up all integers greater than 5. The function should handle inputs of variable lengths and filter out non-integer types before performing the addition. Your function sho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_integers_greater_than_five([[3, 7], [5, 6, 1], [7, [8, 3], 12]]) == 40\", \"assert sum_integers_greater_than_five([[1, 2], [3, 4], [5]]) == 0\", \"assert sum_integers_greater_than_five([1, 2, 3]) == 0\", \"assert sum_integers_greater_than_five([]) == 0\"...
{ "split": "train", "index": 67495, "acecode_id": "evol_13368", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a decorator in Python that can modify the behavior of a given method in a class. Write a function `decorator(func)` that takes a function as an argument and returns a new function. The new function should execute some code before and after calli...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert decorator(lambda: 'test')() == 'test'\", \"assert decorator(lambda: 2 + 2)() == 4\", \"assert decorator(lambda: 'Hello, World!')() == 'Hello, World!'\", \"assert decorator(lambda: 10 * 5)() == 50\", \"assert decorator(lambda: sum([1, 2, 3]))() == 6\", \"asse...
{ "split": "train", "index": 67496, "acecode_id": "evol_12419", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that compresses an image by resizing it to a fixed size of 200x200 pixels. The function will take a list of tuples, where each tuple contains the width and height of an image. Your function should return a list of new dimensions after...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compress_images([(300, 400), (500, 600), (150, 250)]) == [(200, 200), (200, 200), (200, 200)]\", \"assert compress_images([(800, 600), (1024, 768)]) == [(200, 200), (200, 200)]\", \"assert compress_images([(200, 200), (200, 200)]) == [(200, 200), (200, 200)]...
{ "split": "train", "index": 67497, "acecode_id": "bigcode_python_fns_5632", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer n, write a function that returns a list of all the factors of n in ascending order. A factor is a number that divides n without leaving a remainder. The function should handle the case where n is less than or equal to 0 by returning an empty list. Implement the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_factors(12) == [1, 2, 3, 4, 6, 12]\", \"assert get_factors(1) == [1]\", \"assert get_factors(0) == []\", \"assert get_factors(-5) == []\", \"assert get_factors(100) == [1, 2, 4, 5, 10, 20, 25, 50, 100]\", \"assert get_factors(28) == [1, 2, 4, 7, 14, 28]\...
{ "split": "train", "index": 67498, "acecode_id": "bigcode_python_fns_6052", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a function that computes the number of capital vowel letters (A, E, I, O, U) located at even indices in a given string. The function should handle non-alphabetic characters and should return 'Invalid input' for null or non-string inputs. Implement the function as follows...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_upper('aBCdEf') == 1\", \"assert count_upper('abcdefg') == 0\", \"assert count_upper('dBBE') == 0\", \"assert count_upper('AEIOU') == 3\", \"assert count_upper('') == 0\", \"assert count_upper('A') == 1\", \"assert count_upper('B') == 0\", \"assert cou...
{ "split": "train", "index": 67499, "acecode_id": "evol_23911", "num_tests": 13 }