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": "Implement a function `prime_factors(n: int) -> Dict[int, int]` that accepts an integer input `n` and returns a dictionary containing every prime divisor of `n` as the keys and their respective multiplicities as the values. For example, if `n = 18`, the output should be `{2: 1, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert prime_factors(1) == {}\", \"assert prime_factors(2) == {2: 1}\", \"assert prime_factors(3) == {3: 1}\", \"assert prime_factors(4) == {2: 2}\", \"assert prime_factors(5) == {5: 1}\", \"assert prime_factors(6) == {2: 1, 3: 1}\", \"assert prime_factors(7) == {7...
{ "split": "train", "index": 80100, "acecode_id": "evol_17002", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that computes the cumulative total of the individual digits in a given positive integer. The function should also accommodate for negative integers by considering their absolute values. Additionally, the function should have an option to return the computed...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cumulative_digit_sum(123) == [1, 3, 6]\", \"assert cumulative_digit_sum(0) == [0]\", \"assert cumulative_digit_sum(-100) == [1, 1, 1]\", \"assert cumulative_digit_sum(999) == [9, 18, 27]\", \"assert cumulative_digit_sum(123456789) == [1, 3, 6, 10, 15, 21, 28...
{ "split": "train", "index": 80101, "acecode_id": "evol_16454", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a float `rough_value`, an integer `increment`, and optional integers `minimum` and `maximum`, write a function `round_down` that rounds `rough_value` down to the nearest multiple of `increment`. The rounded value must be greater than or equal to `minimum` and less than or...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert round_down(10.7, 2) == 10\", \"assert round_down(10.3, 2) == 10\", \"assert round_down(10.7, 3) == 9\", \"assert round_down(10.1, 5) == 10\", \"assert round_down(10.9, 5) == 10\", \"assert round_down(15.2, 4, 8) == 12\", \"assert round_down(15.2, 4, 10) == 1...
{ "split": "train", "index": 80102, "acecode_id": "bigcode_python_fns_36677", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of service names and their corresponding function names that need to be registered in a service container. Your task is to implement a function `configure_services(services: List[Tuple[str, str]]) -> Dict[str, Callable]` that takes a list of tuples, where e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert configure_services([('command_processor', 'make_command_processor'), ('logger', 'make_logger')]) == {'command_processor': 'command_processor service created', 'logger': 'logger service created'}\", \"assert configure_services([('streamalert_forwarder', 'make...
{ "split": "train", "index": 80103, "acecode_id": "bigcode_python_fns_5173", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that constructs a URL given a base API URL and an ID. The function should take two parameters: a string representing the base API URL and a string representing the ID. The function should return a string that combines the base API URL wit...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert construct_url('https://api.example.com', '123') == 'https://api.example.com/v1/global/outcome_groups/123'\", \"assert construct_url('http://localhost:8000', '456') == 'http://localhost:8000/v1/global/outcome_groups/456'\", \"assert construct_url('https://api...
{ "split": "train", "index": 80104, "acecode_id": "bigcode_python_fns_35120", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries where each dictionary represents a person's information, including their name and age. Write a function `get_names_above_age(people: List[Dict[str, Union[str, int]]], age: int) -> List[str]` that returns a list of names of people whose age i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_names_above_age([{'name': 'Alice', 'age': 30}, {'name': 'Bob', 'age': 25}, {'name': 'Charlie', 'age': 35}], 28) == ['Alice', 'Charlie']\", \"assert get_names_above_age([{'name': 'David', 'age': 20}, {'name': 'Eve', 'age': 22}], 21) == ['Eve']\", \"assert...
{ "split": "train", "index": 80105, "acecode_id": "bigcode_python_fns_311", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a list of elements based on a sorting requirement. Your function should have the following signature: `def process_data(imported_data: list, sort_flag: bool) -> list:`. The `imported_data` parameter is a list of element...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_data([3, 1, 2], True) == [1, 2, 3]\", \"assert process_data([3, 1, 2], False) == [3, 1, 2]\", \"assert process_data(['banana', 'apple', 'cherry'], True) == ['apple', 'banana', 'cherry']\", \"assert process_data(['banana', 'apple', 'cherry'], False) =...
{ "split": "train", "index": 80106, "acecode_id": "oss_16103", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `validate_kwargs(kwargs: dict, file_type: Optional[str]) -> bool` that checks if the provided keyword arguments (`kwargs`) are valid for a given file type. The supported file types and their corresponding valid keyword arguments are a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_kwargs({'encoding': 'utf8'}, 'csv') == True\", \"assert validate_kwargs({'delimiter': ';'}, 'csv') == True\", \"assert validate_kwargs({'sheet_name': 0}, 'excel') == True\", \"assert validate_kwargs({'header': 1}, 'excel') == True\", \"assert valida...
{ "split": "train", "index": 80107, "acecode_id": "bigcode_python_fns_38331", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are given a dictionary `data` with the following keys: 'HNAC', 'ICC_abs', 'DCC_abs', and 'VOL'. Each key maps to a numeric value (float or int). Your task is to write a function that calculates and returns a new dictionary containing the following keys and their correspondi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert feature_norm_ldc({'HNAC': 100, 'ICC_abs': 50, 'DCC_abs': 50, 'VOL': 100}) == {'HNAP': 200.0, 'TCC': 1.0, 'ICC': 0.5, 'DCC': 0.5}\", \"assert feature_norm_ldc({'HNAC': 100, 'ICC_abs': 0, 'DCC_abs': 50, 'VOL': 100}) == None\", \"assert feature_norm_ldc({'HNAC'...
{ "split": "train", "index": 80108, "acecode_id": "bigcode_python_fns_26362", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Create a function named 'create_person' that takes two arguments, 'name' (a string) and 'age' (an integer), and returns a dictionary representing a person with those characteristics. The dictionary should have keys 'name' and 'age' with the corresponding values from the argumen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_person('Alice', 30) == {'name': 'Alice', 'age': 30}\", \"assert create_person('Bob', 25) == {'name': 'Bob', 'age': 25}\", \"assert create_person('Charlie', 40) == {'name': 'Charlie', 'age': 40}\", \"assert create_person('Diana', 22) == {'name': 'Diana...
{ "split": "train", "index": 80109, "acecode_id": "evol_29684", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a robotic system. Implement a function `describe_robotic_component` that takes a component type (either 'instrument', 'detector', or 'jaw') and an identifier (ID) as inputs. The function should return a description of the specified component. Use ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert describe_robotic_component('instrument', 1) == 'Instrument ID: 1, Type: Arm'\", \"assert describe_robotic_component('instrument', 2) == 'Instrument ID: 2, Type: Gripper'\", \"assert describe_robotic_component('instrument', 3) == 'Component not found'\", \"as...
{ "split": "train", "index": 80110, "acecode_id": "oss_6121", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `count_nums(array)` that accepts a list of integers and returns the count of elements where the sum of absolute values of their digits (preserving the number's sign) is not only positive, but also divisible by 4. For example, if the input is [8, -4, -6, 5, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_nums([4, 8, 12, 20]) == 2\", \"assert count_nums([7]) == 0\", \"assert count_nums([0, 1, 2, 3]) == 0\", \"assert count_nums([3, 9]) == 0\", \"assert count_nums([22, 44, 66]) == 3\", \"assert count_nums([]) == 0\"]}" }
{ "split": "train", "index": 80111, "acecode_id": "evol_33433", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a test result validation system for a software testing framework. The `validate_test_results` function is responsible for checking the results of a series of test cases and ensuring that they meet certain criteria. Each test case is represented ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_test_results([('Addition', 5, 2 + 3), ('Subtraction', 7, 10 - 3), ('Multiplication', 20, 4 * 5), ('Division', 4, 12 / 3)]) == ['Test Addition passed', 'Test Subtraction passed', 'Test Multiplication passed', 'Test Division passed']\", \"assert valid...
{ "split": "train", "index": 80112, "acecode_id": "oss_3214", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two tuples of numbers, which may also contain non-numeric values. Your task is to implement a function `diff_tuples(t1, t2)` that calculates the difference between the corresponding elements of the two tuples. If either tuple is empty, treat it as a tuple containi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert diff_tuples((5, 3, 7), (2, 1, 4)) == (3, 2, 3)\", \"assert diff_tuples((1, 2, 3), (4, 5, 6)) == (0, 0, 0)\", \"assert diff_tuples((), (1, 2, 3)) == (0, 0, 0)\", \"assert diff_tuples((1, 2, 3), ()) == (1, 2, 3)\", \"assert diff_tuples((5, 'a', 7), (2, 1, 'b')...
{ "split": "train", "index": 80113, "acecode_id": "evol_19887", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with validating a publication form based on specific criteria. Implement a function `is_valid_publication(document_type: str, status: int, is_LILACS: bool, descriptor_count: int, attachment_present: bool) -> bool`. The function should return True if the publicati...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_publication('S', 1, True, 0, True) == True\", \"assert is_valid_publication('S', 1, True, 0, False) == True\", \"assert is_valid_publication('X', 1, True, 1, True) == True\", \"assert is_valid_publication('X', 1, True, 1, False) == False\", \"assert...
{ "split": "train", "index": 80114, "acecode_id": "bigcode_python_fns_13349", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that updates an existing object in a system. The function will take a dictionary of parameters that represent the fields of the object to be updated. Your function should return a dictionary that confirms the update and includes the u...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_object({'name': 'Test Object', 'type': 'Type A'}) == {'name': 'Test Object', 'type': 'Type A', 'status': 'Inactive'}\", \"assert update_object({'name': 'Test Object', 'status': 'Active'}) == {'name': 'Test Object', 'type': 'Generic', 'status': 'Active...
{ "split": "train", "index": 80115, "acecode_id": "bigcode_python_fns_14239", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two lists of integers, `a` and `b`, both of length `n`, and a list of integers `diag_mat` of length `n`, write a function `compute_diagonal_entries(a: List[int], diag_mat: List[int], b: List[int]) -> List[int]` that computes the diagonal entries of the product of the matr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_diagonal_entries([1, 2, 3], [4, 5, 6], [7, 8, 9]) == [28, 80, 162]\", \"assert compute_diagonal_entries([10, 20, 30], [2, 3, 4], [1, 2, 3]) == [20, 120, 360]\", \"assert compute_diagonal_entries([-1, -2, -3], [4, 5, 6], [7, 8, 9]) == [-28, -80, -162]...
{ "split": "train", "index": 80116, "acecode_id": "bigcode_python_fns_1126", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of unique integers, your task is to determine if it is possible to sort the array such that all even numbers come before all odd numbers by performing unlimited left shift operations. A left shift operation moves all elements to the left by one index, with the fi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert shiftOneNumber([]) == True\", \"assert shiftOneNumber([2, 4, 1, 3, 5]) == True\", \"assert shiftOneNumber([3, 5, 4, 1, 2]) == False\", \"assert shiftOneNumber([1, 2, 3, 4]) == False\", \"assert shiftOneNumber([4, 2, 6, 3, 1]) == True\", \"assert shiftOneNumb...
{ "split": "train", "index": 80117, "acecode_id": "evol_22881", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a version number string. The function should take a version number as input and append a commit count to it if the version ends with 'a', 'b', or 'rc'. The commit count will be provided as a separate input parameter....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_version('1.2.3a', 1) == '1.2.3a1'\", \"assert process_version('1.2.3b', 3) == '1.2.3b3'\", \"assert process_version('1.2.3rc', 10) == '1.2.3rc10'\", \"assert process_version('1.0.0', 5) == '1.0.0'\", \"assert process_version('2.1.0a', 0) == '2.1.0a0'...
{ "split": "train", "index": 80118, "acecode_id": "oss_19255", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that finds the index of the first occurrence of a given target number in a sorted list of integers. If the target number is not present in the list, return the index where it can be inserted to maintain the sorted order. The function should be able to handle an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert search_insert([], 5) == 0\", \"assert search_insert([1], 0) == 0\", \"assert search_insert([1], 1) == 0\", \"assert search_insert([1], 2) == 1\", \"assert search_insert([1, 3, 5, 6], 5) == 2\", \"assert search_insert([1, 3, 5, 6], 2) == 1\", \"assert search_...
{ "split": "train", "index": 80119, "acecode_id": "evol_20275", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of box sizes represented as a list of floats. You need to implement a function that applies the minimum image convention to a list of distance vectors. The minimum image convention wraps the distances so that they stay within the bounds defined by the box s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert minimum_image_box([5.0, 5.0, 5.0], [[6.0, 6.0, 6.0], [11.0, 11.0, 11.0]]) == [[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]]\", \"assert minimum_image_box([4.0, 4.0, 4.0], [[2.0, 2.0, 2.0], [8.0, 8.0, 8.0]]) == [[2.0, 2.0, 2.0], [0.0, 0.0, 0.0]]\", \"assert minimum_image...
{ "split": "train", "index": 80120, "acecode_id": "bigcode_python_fns_12877", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple linear model using a configuration dictionary that specifies the dimensions of the model. Implement a function `model_creator(config: dict) -> str` that takes a configuration dictionary with two keys: 'input_dim' and 'output_dim', both of w...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert model_creator({'input_dim': 1, 'output_dim': 1}) == 'Linear(1, 1)'\", \"assert model_creator({'input_dim': 2, 'output_dim': 3}) == 'Linear(2, 3)'\", \"assert model_creator({'input_dim': 10, 'output_dim': 5}) == 'Linear(10, 5)'\", \"assert model_creator({'inp...
{ "split": "train", "index": 80121, "acecode_id": "bigcode_python_fns_4751", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function that simulates connecting to multiple AWS Redshift clusters. The function should take a list of clusters (each represented as a tuple containing hostname, port, dbname, user, and password) and a SQL query string as inputs. The function should randomly se...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert connect_to_redshift([], 'SELECT * FROM users') == 'No clusters available.'\", \"assert connect_to_redshift([('host1', 5439, 'db1', 'user1', 'pass1')], 'SELECT * FROM users') == 'Executed query \\\"SELECT * FROM users\\\" on cluster host1:5439'\", \"assert co...
{ "split": "train", "index": 80122, "acecode_id": "evol_19047", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to parse a time offset represented as a string and return the corresponding timedelta object. The time offset string can be in the format 'HH:MM:SS' or '-HH:MM:SS' to represent positive or negative offsets respectively. If the input i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_time_offset(None) == timedelta(0)\", \"assert parse_time_offset('00:00:00') == timedelta(0)\", \"assert parse_time_offset('01:00:00') == timedelta(hours=1)\", \"assert parse_time_offset('-01:00:00') == timedelta(hours=-1)\", \"assert parse_time_offset(...
{ "split": "train", "index": 80123, "acecode_id": "oss_1008", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a bundle UUID as input and generates the filenames for storing the manifest and metadata of that bundle. The manifest filename should be formatted as `$UUID.manifest.json` and the metadata filename should be formatted as `$UUID...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_filenames('123e4567-e89b-12d3-a456-426614174000') == ('123e4567-e89b-12d3-a456-426614174000.manifest.json', '123e4567-e89b-12d3-a456-426614174000.metadata.json')\", \"assert generate_filenames('abcd-efgh-ijkl-mnop') == ('abcd-efgh-ijkl-mnop.manifest...
{ "split": "train", "index": 80124, "acecode_id": "oss_34018", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the holdings of registers from a Modbus TCP server. Your task is to write a function that takes this list as input and returns the sum of all the integers in the list. The function should handle an empty list by returning 0. Please ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_registers([1, 2, 3, 4, 5]) == 15\", \"assert sum_registers([-1, -2, -3, -4, -5]) == -15\", \"assert sum_registers([10, 20, 30]) == 60\", \"assert sum_registers([]) == 0\", \"assert sum_registers([0, 0, 0]) == 0\", \"assert sum_registers([100, 200, 300, 4...
{ "split": "train", "index": 80125, "acecode_id": "oss_6654", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of sentences, a corresponding list of intents, and a corresponding list of slots, group the sentences based on their intents. Implement a function `group_intents(sentences: List[str], intents: List[str], slots: List[str]) -> Dict[str, List[Tuple[str, str]]]` that t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert group_intents([\\\"Hello, how can I help you?\\\", \\\"Book a flight.\\\", \\\"Cancel my reservation.\\\"], [\\\"greeting\\\", \\\"booking\\\", \\\"cancellation\\\"], [\\\"none\\\", \\\"flight\\\", \\\"reservation\\\"]) == {\\\"greeting\\\": [(\\\"Hello, how...
{ "split": "train", "index": 80126, "acecode_id": "bigcode_python_fns_4357", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of products, and your task is to return the first four items from the list as a tuple. If the list contains fewer than four items, you should return `None` for the missing items in the tuple. Write a function `unpack_products` that takes a list of products ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unpack_products(['arroz', 'feijao', 'laranja', 'banana']) == ('arroz', 'feijao', 'laranja', 'banana')\", \"assert unpack_products(['pen', 'pencil', 'eraser']) == ('pen', 'pencil', 'eraser', None)\", \"assert unpack_products(['apple']) == ('apple', None, None...
{ "split": "train", "index": 80127, "acecode_id": "oss_16773", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of fictional GitHub repository names and returns a dictionary containing the repository names as keys and their respective star counts as values. For this task, you will simulate the star counts for a set of p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_repositories(['repo1', 'repo2']) == {'repo1': 5, 'repo2': 10}\", \"assert process_repositories(['repo3']) == {'repo3': 20}\", \"assert process_repositories([]) == {}\", \"assert process_repositories(['repo2', 'repo2', 'repo2']) == {'repo2': 10}\", \"...
{ "split": "train", "index": 80128, "acecode_id": "oss_35182", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `is_value_required(value: Any) -> bool`. This function should determine if a given value is required based on the following criteria: If the value is `None`, the function should raise a `ValueNotRequired` exception. If the value is an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_value_required(5) == True\", \"assert is_value_required('Hello') == True\", \"assert is_value_required(0) == True\", \"assert is_value_required([]) == True\", \"assert is_value_required({}) == True\", \"assert is_value_required(True) == True\", \"assert i...
{ "split": "train", "index": 80129, "acecode_id": "bigcode_python_fns_28487", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing SAS code and a boolean indicating whether to use a remote server (True) or a local server (False). Your task is to implement a function that simulates executing the SAS code on the specified server and returns a list of strings representing t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert execute_sas(\\\"data example; set mydata; run;\\\", True) == [\\\"column1\\\", \\\"column2\\\"]\", \"assert execute_sas(\\\"data example; set mydata; run;\\\", False) == [\\\"column1\\\", \\\"column2\\\"]\", \"assert execute_sas(\\\"data test; set sample; ru...
{ "split": "train", "index": 80130, "acecode_id": "bigcode_python_fns_8232", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that removes any entries from a given list of dictionaries where a specified key contains a null or missing value. Each dictionary in the list contains the keys 'Name' and 'Age'. Your function should return a new list of dictionaries that only includes thos...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_entries([{'Name': 'John', 'Age': 25}, {'Name': 'Jane', 'Age': None}, {'Name': 'Maria', 'Age': 30}], 'Age') == [{'Name': 'John', 'Age': 25}, {'Name': 'Maria', 'Age': 30}]\", \"assert filter_entries([], 'Age') == []\", \"assert filter_entries([{'Name': ...
{ "split": "train", "index": 80131, "acecode_id": "evol_11903", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of nodes represented as dictionaries. Each node has the following attributes: 'id' (an integer), 'year' (an integer), and 'articles' (a list of strings). Your task is to enrich these nodes by adding a 'version' attribute based on the input list of locations...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert enrich_nodes([{'id': 3, 'year': 2020, 'articles': []}], [], ['article3']) == [{'id': 3, 'year': 2020, 'articles': [], 'version': 'No Version'}]\", \"assert enrich_nodes([{'id': 5, 'year': 2018, 'articles': ['f']}], [], ['article5']) == [{'id': 5, 'year': 201...
{ "split": "train", "index": 80132, "acecode_id": "bigcode_python_fns_26736", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that retrieves the version number of a specified package from a predefined list of packages and their versions. Your function should take the package name as input and return its version number. If the package is not found in the p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_package_version('requests') == '2.25.1'\", \"assert get_package_version('numpy') == '1.19.5'\", \"assert get_package_version('pandas') == '1.1.5'\", \"assert get_package_version('scikit-learn') == '0.24.2'\", \"assert get_package_version('matplotlib') ==...
{ "split": "train", "index": 80133, "acecode_id": "oss_12545", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries representing participants in a clinical study. Each dictionary contains the following keys: 'participant_id', 'Age', and 'Image_ID'. Your task is to implement a function `clean_participants(participants: List[Dict[str, Union[int, str]]]) -> ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert clean_participants([{'participant_id': 1, 'Age': 50, 'Image_ID': 'img1'}, {'participant_id': 2, 'Age': 45, 'Image_ID': 'img2'}, {'participant_id': 1, 'Age': 50, 'Image_ID': 'img1'}, {'participant_id': 3, 'Age': 73, 'Image_ID': 'img3'}]) == ['img1', 'img3']\"...
{ "split": "train", "index": 80134, "acecode_id": "bigcode_python_fns_10201", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with constructing a simple neural network model. Write a function `construct_model(num_classes: int, pretrained: bool = False) -> dict` that takes the number of output classes and a boolean flag indicating whether to return a pre-trained model. The function shoul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert construct_model(10, True) == {'num_classes': 10, 'pretrained': True}\", \"assert construct_model(5, False) == {'num_classes': 5, 'pretrained': False}\", \"assert construct_model(0, True) == {'num_classes': 0, 'pretrained': True}\", \"assert construct_model(2...
{ "split": "train", "index": 80135, "acecode_id": "bigcode_python_fns_40333", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that generates a dictionary containing URLs for various user API endpoints based on a user's primary key. The function should take an integer `pk` representing the user's primary key and return a dictionary with the following keys and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_user_api_urls(123) == {'data_downloads': '/api/user-data-downloads/123/', 'details': '/api/user-details/123/', 'change_email': '/api/user-change-email/123/', 'change_password': '/api/user-change-password/123/', 'edit_details': '/api/user-edit-detail...
{ "split": "train", "index": 80136, "acecode_id": "oss_10942", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with developing a utility function that adjusts a pair of date strings based on specific conditions. The function should accept two date strings in the format 'YYYY-MM-DD' as inputs, denoting the start date and the end date. Your goal is to modify the end date ac...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert adjust_dates('2022-05-15', '2022-06-20') == ('2022-05-15', '2022-07-01')\", \"assert adjust_dates('2022-05-15', '2022-05-25') == ('2022-05-15', '2022-06-01')\", \"assert adjust_dates('2023-03-10', '2023-03-20') == ('2023-03-10', '2023-04-01')\", \"assert adj...
{ "split": "train", "index": 80137, "acecode_id": "oss_28755", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a three-dimensional matrix consisting of integers, implement a function that finds and returns the maximum cumulative sum of any submatrix across all layers. A layer refers to each two-dimensional matrix embedded within the three-dimensional matrix. The function should be...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_submatrix_sum([[[1]]]) == 1\", \"assert max_submatrix_sum([[[1, -1], [2, 3]], [[4, -5], [6, -7]]]) == 10\", \"assert max_submatrix_sum([[[-1, -2], [-3, -4]], [[-5, -6], [-7, -8]]]) == -1\", \"assert max_submatrix_sum([[[0, 0], [0, 0]], [[0, 0], [0, 0]]])...
{ "split": "train", "index": 80138, "acecode_id": "evol_20477", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a list of file names, write a function that returns a list of boolean values indicating whether each file name has an image file extension. The allowed image file extensions are: '.jpg', '.jpeg', '.png', '.gif', and '.bmp'. The input is a list of strings representing the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert image_has_suffix(['image.jpg', 'document.pdf', 'photo.png']) == [True, False, True]\", \"assert image_has_suffix(['file.bmp', 'file.txt', 'file.gif']) == [True, False, True]\", \"assert image_has_suffix(['test.jpeg', 'example.doc', 'archive.zip']) == [True, ...
{ "split": "train", "index": 80139, "acecode_id": "bigcode_python_fns_47680", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that takes an enterprise number as input and returns the corresponding organization name and description from a predefined registry of private enterprise numbers. If the enterprise number is not found in the registry, the function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_enterprise_info('1') == {'organization_name': 'Example Organization', 'description': 'Example Description'}\", \"assert get_enterprise_info('2') == {'organization_name': 'Sample Corp', 'description': 'Sample Services'}\", \"assert get_enterprise_info('3'...
{ "split": "train", "index": 80140, "acecode_id": "oss_20431", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers that contains both ascending and descending sequences, and a single integer value. Write a function insert_sorted(List, value) that inserts the given value into the list while maintaining the existing ascending and descending orders. The functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert insert_sorted([1, 3, 5, 8, 10, 15, 7, 2], 6) == [1, 3, 5, 6, 8, 10, 15, 7, 2]\", \"assert insert_sorted([1, 2, 3, 4, 5], 6) == [1, 2, 3, 4, 5, 6]\", \"assert insert_sorted([5, 4, 3, 2, 1], 0) == [5, 4, 3, 2, 1, 0]\", \"assert insert_sorted([], 5) == [5]\", \...
{ "split": "train", "index": 80141, "acecode_id": "evol_11284", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Develop a function to calculate the product of all numeric values in a given list that may contain mixed data types, including nested lists and dictionaries. The function should ignore non-numeric values and handle both nested structures and complex numbers. Return the product ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert product_of_values([1, 2, 3]) == 6\", \"assert product_of_values([1, 'a', 2.5]) == 2.5\", \"assert product_of_values([[1, 2], [3, 4]]) == 24\", \"assert product_of_values({'a': 1, 'b': {'c': 2}}) == 2\", \"assert product_of_values([1, 2, [3, 4], {'a': 5}]) ==...
{ "split": "train", "index": 80142, "acecode_id": "evol_12760", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of integers, representing the values of variables in a mathematical model. Your task is to implement a function that takes in this list and returns a new list where all even integers are doubled and all odd integers are halved (using integer division). The ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transform_integers([1, 2, 3, 4]) == [0, 4, 1, 8]\", \"assert transform_integers([10, 15, 20]) == [20, 7, 40]\", \"assert transform_integers([0, -2, -3, -4]) == [0, -4, -2, -8]\", \"assert transform_integers([]) == []\", \"assert transform_integers([5]) == [2...
{ "split": "train", "index": 80143, "acecode_id": "bigcode_python_fns_14290", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of dates in the format 'YYYY-MM-DD', write a function `categorize_dates(dates: List[str]) -> List[str]` that assigns each date to a category based on the following rules: Dates that fall within the last 10 days from today should be categorized as 'Category 1', date...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert categorize_dates(['2023-10-15', '2023-10-25']) == ['Category 2', 'Category 1']\", \"assert categorize_dates(['2023-10-25']) == ['Category 1']\", \"assert categorize_dates(['2023-10-12', '2023-10-01', '2023-09-25']) == ['Category 2', 'Category 3', 'Category 3...
{ "split": "train", "index": 80144, "acecode_id": "bigcode_python_fns_49932", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given a minimum value `minval`, a maximum value `maxval`, a minimum change `delta_min`, a maximum change `delta_max`, and a length of sequence `T`, simulate a random walk that stays within the boundaries defined by `minval` and `maxval`. The random walk is generated by taking r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bounded_random_walk(10, 10, 1, 5, 5) == [10, 10, 10, 10, 10]\", \"assert bounded_random_walk(1, 2, 0, 0, 1) == [1]\", \"assert bounded_random_walk(0, 1, 0, 0, 3) == [0, 0, 0]\", \"assert bounded_random_walk(0, 0, 0, 0, 1) == [0]\", \"assert bounded_random_wa...
{ "split": "train", "index": 80145, "acecode_id": "bigcode_python_fns_27599", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given a string `s`, implement a function `count_prime_vowels` that calculates the number of lowercase vowels ('a', 'e', 'i', 'o', 'u') found at prime indices of the string. The function should ignore uppercase vowels and only count lowercase vowels located at indices that are p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_prime_vowels('ABCDEFG') == 0\", \"assert count_prime_vowels('aeiou') == 2\", \"assert count_prime_vowels('xyz') == 0\", \"assert count_prime_vowels('abcdeiou') == 2\", \"assert count_prime_vowels('') == 0\", \"assert count_prime_vowels('aeiouAEIOU') ==...
{ "split": "train", "index": 80146, "acecode_id": "evol_22528", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of a series of buildings. Your task is to determine how many buildings can see the sunset. A building can see the sunset if it is taller than all the buildings to its right. Write a function `count_sunset_buildings(heigh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_sunset_buildings([1, 2, 3, 4, 5]) == 1\", \"assert count_sunset_buildings([5, 4, 3, 2, 1]) == 5\", \"assert count_sunset_buildings([3, 3, 3, 3, 3]) == 1\", \"assert count_sunset_buildings([10]) == 1\", \"assert count_sunset_buildings([1, 2]) == 1\", \"...
{ "split": "train", "index": 80147, "acecode_id": "bigcode_python_fns_8856", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `longest_increasing_subseq(seq)` that returns a valid longest increasing subsequence from the list. The subsequence does not need to be contiguous, and if there are multiple longest increasing subsequences, return any one of them. The ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longest_increasing_subseq([0, 1, 0, 3, 2, 3]) == [0, 1, 2, 3] or longest_increasing_subseq([0, 1, 0, 3, 2, 3]) == [0, 1, 3]\", \"assert longest_increasing_subseq([7, 7, 7, 7, 7]) == [7]\", \"assert longest_increasing_subseq([3, 2]) == [3] or longest_increasi...
{ "split": "train", "index": 80148, "acecode_id": "evol_17059", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that simulates the steps of creating a distribution package for a software module using the Autotools build system. The function should take a `module` object as its parameter, which represents the software module for which the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert _autotools_dist_builder(MockModule('/path/to/source')) == ['cd /path/to/source', 'autoreconf -i', './configure', 'make dist']\", \"assert _autotools_dist_builder(MockModule('/another/source/dir')) == ['cd /another/source/dir', 'autoreconf -i', './configure',...
{ "split": "train", "index": 80149, "acecode_id": "oss_32497", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that simplifies the multiplication of two fractions represented as strings. The function should take two string inputs, each representing a fraction in the form 'numerator/denominator'. It should return a simplified string representation of the resulting fr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert improved_simplify('1/2', '1/3') == '1/6'\", \"assert improved_simplify('2/4', '3/6') == '1/4'\", \"assert improved_simplify('3/5', '2/5') == '6/25'\", \"assert improved_simplify('5/10', '10/5') == '1/1'\", \"assert improved_simplify('0/1', '3/4') == '0/1'\",...
{ "split": "train", "index": 80150, "acecode_id": "evol_12530", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Define a function `functional_median(l: list, cmp_func: callable)` that returns the median of the list 'l' without manipulating it into an array or using built-in tools. The function should handle tuples represented by both even and odd numbers, repetitive elements, and use the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert functional_median([3, 1, 2, 4, 5], lambda a, b: a - b) == 3\", \"assert functional_median([1, 2, 2, 4, 5], lambda a, b: a - b) == 2\", \"assert functional_median([7, 3, 5, 1], lambda a, b: a - b) == 4.0\", \"assert functional_median([1], lambda a, b: a - b) ...
{ "split": "train", "index": 80151, "acecode_id": "evol_19261", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of tuples representing orders, where each tuple contains a view name, a column name, and the order direction (either 'asc' for ascending or 'desc' for descending), implement a function `get_order_dict(orders: List[Tuple[str, str, str]]) -> Dict[str, Tuple[str, str]...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_order_dict([('view1', 'column1', 'asc'), ('view2', 'column2', 'desc'), ('view1', 'column3', 'asc')]) == {'view1': ('column3', 'asc'), 'view2': ('column2', 'desc')}\", \"assert get_order_dict([('view1', 'column1', 'asc'), ('view1', 'column2', 'desc'), ('v...
{ "split": "train", "index": 80152, "acecode_id": "bigcode_python_fns_12473", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing connection IDs. Your task is to define a function `process_connection` that simulates processing each connection ID by returning a string that indicates the connection has been processed. You need to implement a function that takes ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_connections([1, 2, 3]) == ['Processed connection 1', 'Processed connection 2', 'Processed connection 3']\", \"assert process_connections([0, 4, 5]) == ['Processed connection 0', 'Processed connection 4', 'Processed connection 5']\", \"assert process_...
{ "split": "train", "index": 80153, "acecode_id": "oss_2149", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a string input representing a programming language and returns a string indicating whether the language can be used for debugging purposes. The function should return 'Supported' if the language is either 'Python' or 'JavaScrip...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_debugger_support('Python') == 'Supported'\", \"assert check_debugger_support('JavaScript') == 'Supported'\", \"assert check_debugger_support('Java') == 'Not Supported'\", \"assert check_debugger_support('C++') == 'Not Supported'\", \"assert check_debug...
{ "split": "train", "index": 80154, "acecode_id": "bigcode_python_fns_2686", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given the angle of incidence in radians and the indices of refraction for two mediums, implement a function that calculates the angle of refraction using Snell's law. The function should take three parameters: 'angle_1' (a float representing the angle of incidence in radians), ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert abs(snell_angle_2(0.0, 1.0, 1.0) - 0.0) < 1e-9\", \"assert abs(snell_angle_2(0.5, 1.0, 1.0) - 0.5) < 1e-9\", \"assert abs(snell_angle_2(1.0, 1.0, 1.0) - 1.0) < 1e-9\", \"assert abs(snell_angle_2(0.0, 1.0, 1.5) - 0.0) < 1e-9\", \"assert abs(snell_angle_2(0.0,...
{ "split": "train", "index": 80155, "acecode_id": "bigcode_python_fns_40249", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that calculates the final value after applying a series of percentage increases and decreases to an initial value. The function `calculate_final_value` takes three parameters: `initial_value` (a float representing the initial v...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_final_value(100, [10, 20, 5], [15, 10]) == 106.029\", \"assert calculate_final_value(50, [0], [0]) == 50.0\", \"assert calculate_final_value(1000, [50, 50], [0]) == 2250.0\", \"assert calculate_final_value(300, [-50], [0]) == 150.0\", \"assert calc...
{ "split": "train", "index": 80156, "acecode_id": "oss_4695", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are given a list of resources, where each resource can be of three types: 'Layer', 'Service', or 'HarvestJob'. Your task is to implement a function that takes in this list and returns a dictionary containing the counts of each type of resource. The function should take a si...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_resources(['Layer', 'Service', 'HarvestJob', 'Layer']) == {'Layer': 2, 'Service': 1, 'HarvestJob': 1}\", \"assert count_resources(['Service', 'Service', 'HarvestJob']) == {'Layer': 0, 'Service': 2, 'HarvestJob': 1}\", \"assert count_resources([]) == {'...
{ "split": "train", "index": 80157, "acecode_id": "bigcode_python_fns_37607", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of user profiles, each represented as a dictionary containing the keys 'user_id', 'bio', 'fav_music_genre', 'fav_book_genre', and 'fav_movie_genre'. Write a function `get_user_profile(user_id: int, profiles: List[Dict[str, Any]]) -> Optional[Dict[str, Any]]...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_user_profile(1, [{'user_id': 1, 'bio': 'Loves music', 'fav_music_genre': 'Rock', 'fav_book_genre': 'Sci-Fi', 'fav_movie_genre': 'Action'}]) == {'user_id': 1, 'bio': 'Loves music', 'fav_music_genre': 'Rock', 'fav_book_genre': 'Sci-Fi', 'fav_movie_genre': ...
{ "split": "train", "index": 80158, "acecode_id": "evol_24943", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a program to validate the equality of two strings based on a case-sensitive comparison. Write a function that takes two strings as input and returns a boolean value indicating whether the two strings are equal. The comparison should be case-sens...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validateEquality('hello', 'hello') == True\", \"assert validateEquality('Hello', 'hello') == False\", \"assert validateEquality('Python', 'python') == False\", \"assert validateEquality('Test', 'Test') == True\", \"assert validateEquality('123', '123') == Tr...
{ "split": "train", "index": 80159, "acecode_id": "oss_23177", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that processes a list of database migration operations and returns a dictionary containing the count of each type of operation. The migration operations are represented as tuples, where the first element is the type of operatio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_migration_operations([('create', '0012_add_column'), ('alter', '0020_modify_table'), ('create', '0024_staffmember_categories'), ('delete', '0035_remove_data'), ('rename', '0042_rename_column')]) == {'create': 2, 'alter': 1, 'delete': 1, 'rename': 1}\",...
{ "split": "train", "index": 80160, "acecode_id": "oss_4836", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of floating-point numbers, write a function `kmax` that returns the `k` largest unique values from the list in descending order. If there are fewer than `k` unique values, return all unique values sorted in descending order. The input list may contain duplicates. T...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert kmax([1.0, 3.0, 5.0, 7.0, 3.0, 5.0], 3) == [7.0, 5.0, 3.0]\", \"assert kmax([2.5, 2.5, 2.5, 2.5], 1) == [2.5]\", \"assert kmax([5.5, 3.2, 8.9, -1.0], 2) == [8.9, 5.5]\", \"assert kmax([1.1, 2.2, 3.3, 4.4, 4.4, 5.5], 4) == [5.5, 4.4, 3.3, 2.2]\", \"assert kma...
{ "split": "train", "index": 80161, "acecode_id": "bigcode_python_fns_39277", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks whether a given IP address belongs to a specified CIDR block. The CIDR block is represented as a string in the format 'x.x.x.x/n', where 'x.x.x.x' is the starting IP address and 'n' is the prefix length. An IP address is also ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_ip_in_cidr('192.168.1.1', '192.168.1.0/24') == True\", \"assert is_ip_in_cidr('192.168.2.1', '192.168.1.0/24') == False\", \"assert is_ip_in_cidr('10.0.0.1', '10.0.0.0/8') == True\", \"assert is_ip_in_cidr('10.1.1.1', '10.0.0.0/8') == True\", \"assert is_...
{ "split": "train", "index": 80162, "acecode_id": "bigcode_python_fns_18944", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that manages a simplified database for marine life. The function should be able to add and remove aquatic species and their environments efficiently. Each aquatic species has a unique identifier (UUID), a conservation rank, and a habi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_marine_life('add_species', {'species_identity': 'uuid1', 'conservation_rank': 'Endangered', 'habitat': 'Coral Reef'}) == None\", \"assert manage_marine_life('add_environment', {'habitat_title': 'Coral Reef', 'aquatic_temperature': 26.5, 'geographic_co...
{ "split": "train", "index": 80163, "acecode_id": "evol_22707", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given two integers, `row` and `col`, representing one-based indices of a matrix, implement a function that returns the entry in the transformation matrix corresponding to those indices. The entry is determined using the following logic: Convert `col` to its Gray code, then perf...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert matrix_entry(1, 2) == -1.0\", \"assert matrix_entry(3, 4) == -1.0\", \"assert matrix_entry(4, 5) == -1.0\", \"assert matrix_entry(5, 6) == 1.0\", \"assert matrix_entry(6, 7) == -1.0\", \"assert matrix_entry(8, 9) == -1.0\", \"assert matrix_entry(5, 7) == -1....
{ "split": "train", "index": 80164, "acecode_id": "bigcode_python_fns_34714", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that manages a simple to-do list. The function should allow users to add tasks and view the current tasks, and confirm whether they want to exit the program. The input to the function will be a list of commands. Each command will be a tup...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_todo_list([('add', 'Buy milk'), ('view', ''), ('add', 'Read book'), ('view', ''), ('exit', 'yes')]) == ['Task added: Buy milk', 'Current tasks: Buy milk', 'Task added: Read book', 'Current tasks: Buy milk, Read book', 'Goodbye!']\", \"assert manage_to...
{ "split": "train", "index": 80165, "acecode_id": "oss_1974", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that counts the number of occurrences of a specific substring within a given string. The function should be case-insensitive and should consider overlapping occurrences of the substring. For example, in the string 'in_residence', the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_true('Hello, hello, HeLLo!', 'hello') == 3\", \"assert count_true('aaaaaa', 'aa') == 5\", \"assert count_true('abcabcabc', 'abc') == 3\", \"assert count_true('The quick brown fox jumps over the lazy dog', 'the') == 2\", \"assert count_true('OpenAI Open...
{ "split": "train", "index": 80166, "acecode_id": "oss_12593", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Define and implement a function `search_nested_data_structure(nested_data, target)` that performs a linear search on a complex data structure, such as a nested list (a list containing lists). This function should work with multiple data types (both integers and strings). Given ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert search_nested_data_structure([[1, 'cat'], [2, 'dog'], [3, 'bird'], [4, 'fish']], 2) == (2, 1, 0)\", \"assert search_nested_data_structure([[1, 'cat'], [2, 'dog'], [3, 'bird'], [4, 'fish']], 'dog') == ('dog', 1, 1)\", \"assert search_nested_data_structure([[1...
{ "split": "train", "index": 80167, "acecode_id": "evol_32023", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of temperature measurements from a device in degrees Celsius. Your task is to implement a function that calibrates these temperatures by applying a linear transformation defined by a calibration constant. The function should take the following inputs: a lis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calibrate_temperatures([20.0, 21.5, 19.8], 2.0) == [22.0, 23.5, 21.8]\", \"assert calibrate_temperatures([-10.0, 0.0, 10.0], 5.0) == [-5.0, 5.0, 15.0]\", \"assert calibrate_temperatures([15.5, 25.0, 30.2, 0.0], 1.5) == [17.0, 26.5, 31.7, 1.5]\", \"assert cal...
{ "split": "train", "index": 80168, "acecode_id": "bigcode_python_fns_45591", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given three lists: topographies, surfaces, and tags, return a new list containing all unique topographies that are either explicitly present in the topographies list, or are associated with a surface in the surfaces list, or are tagged with a tag in the tags list. Each topograp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert instances_to_topographies([1, 2, 3], [1, 2], [2]) == [1, 2, 3]\", \"assert instances_to_topographies([10, 20], [10, 30], [30]) == [10, 20, 30]\", \"assert instances_to_topographies([5, 15, 25], [5, 15], [25]) == [5, 15, 25]\", \"assert instances_to_topograph...
{ "split": "train", "index": 80169, "acecode_id": "bigcode_python_fns_34378", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function `count_distinct_palindromes(text: str) -> int` that takes a string as input and returns the number of distinct palindromic words in the string. A word is considered palindromic if it reads the same backward as forward, ignoring case. The input string may co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_distinct_palindromes('noon') == 1\", \"assert count_distinct_palindromes('') == 0\", \"assert count_distinct_palindromes('Hello world') == 0\", \"assert count_distinct_palindromes('A man a plan a canal Panama') == 1\", \"assert count_distinct_palindrom...
{ "split": "train", "index": 80170, "acecode_id": "evol_156", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function `get_authorization_url(api_address: str) -> str` that generates an authorization URL for a user to grant access to their Twitter account. The function takes a single parameter `api_address`, which is a string representing the base URL of t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_authorization_url('https://api.example.com') == 'https://api.example.com/authorize'\", \"assert get_authorization_url('https://api.example.com/') == 'https://api.example.com/authorize'\", \"assert get_authorization_url('http://localhost') == 'http://loca...
{ "split": "train", "index": 80171, "acecode_id": "bigcode_python_fns_20444", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that returns a list of tuples, where each tuple contains two successive elements from the provided list. If the list has fewer than two elements, return an empty list.\nPlease reason step by step, then write a self-contained Python...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert successive_pairs([1, 2, 3]) == [(1, 2), (2, 3)]\", \"assert successive_pairs([1]) == []\", \"assert successive_pairs([]) == []\", \"assert successive_pairs([5, 6, 7, 8]) == [(5, 6), (6, 7), (7, 8)]\", \"assert successive_pairs([0, 1]) == [(0, 1)]\", \"assert...
{ "split": "train", "index": 80172, "acecode_id": "evol_25058", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, implement a function that finds the pair of integers with the maximum sum. If the array has fewer than two elements, return 'Not enough elements to form a pair'.\nPlease reason step by step, then write a self-contained Python solution. Give your fina...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_max_pair([1, 2, 3, 4, 5]) == (4, 5)\", \"assert find_max_pair([0, 0, 0]) == (0, 0)\", \"assert find_max_pair([10, 20, 30]) == (20, 30)\", \"assert find_max_pair([-1, 1, 2, 3]) == (2, 3)\", \"assert find_max_pair([5]) == 'Not enough elements to form a pa...
{ "split": "train", "index": 80173, "acecode_id": "evol_281", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function that takes a string containing text and uses regex to find and replace all email addresses in the text with the string literal 'EMAIL'. The function should return the modified string with the email addresses anonymized.\nPlease reason step by step, then wri...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert anonymize_emails('Hello, my email is john.doe@email.com.') == 'Hello, my email is EMAIL.'\", \"assert anonymize_emails('Contact us at support@example.com or sales@example.org.') == 'Contact us at EMAIL or EMAIL.'\", \"assert anonymize_emails('No email here!'...
{ "split": "train", "index": 80174, "acecode_id": "evol_9827", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representation of a molecule in SMILES format. Your task is to write a function `protonate_molecule(smiles: str) -> str` that simulates the protonation of the molecule at pH 7.4. The function should take the SMILES string as input and return a new SMILES ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert protonate_molecule('C1=CC=CC=C1') == 'C1=CC=CC=C1'\", \"assert protonate_molecule('N') == 'N[H]'\", \"assert protonate_molecule('NCC') == 'N[H]CC'\", \"assert protonate_molecule('CC(N)C') == 'CC(N[H])C'\", \"assert protonate_molecule('O=C(C)N') == 'O=C(C)N[H...
{ "split": "train", "index": 80175, "acecode_id": "bigcode_python_fns_43781", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `intersperse(numbers: List[int], delimeter: int) -> List[int]` that accepts a list of integers, `numbers`, and another integer `delimeter`. The function should generate a list where the `delimeter` is interspersed between every pair of successive elements f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert intersperse([], 4) == []\", \"assert intersperse([1, 2, 3], 4) == [1, 4, 2, 4, 3]\", \"assert intersperse([1, 2, 3, 4], 1) == [1, 2, 3, 4]\", \"assert intersperse([0, 1], -1) == [0, 1]\", \"assert intersperse([1], 2) == [1]\", \"assert intersperse([1, 2, 3, ...
{ "split": "train", "index": 80176, "acecode_id": "evol_33079", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a logging function that logs messages to the console. Your function should accept a log level (as a string), a message (as a string), and an arbitrary number of additional arguments. The log levels can be 'debug', 'info', 'warning', 'error', and 'cr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert log_message('error', 'An error occurred', 'ErrorCode: 404') == 'error An error occurred ErrorCode: 404'\", \"assert log_message('warning', 'This is a warning', 'in module', 'test') == 'warning This is a warning in module test'\", \"assert log_message('critic...
{ "split": "train", "index": 80177, "acecode_id": "bigcode_python_fns_12287", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a list of strings representing lines in a YAML log file and a list of keys to remove, implement a function `clean_logfile(logfile_lines: List[str], to_remove: List[str]) -> List[str]` that replaces the values of the specified keys with the string '<folded>'. The function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert clean_logfile(['key1: value1', 'key2: value2'], ['key1']) == ['key1: <folded>', 'key2: value2']\", \"assert clean_logfile(['key1: value1', 'key2: value2'], ['key2']) == ['key1: value1', 'key2: <folded>']\", \"assert clean_logfile(['key1: value1', 'key2: valu...
{ "split": "train", "index": 80178, "acecode_id": "bigcode_python_fns_1569", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that extracts copyright information from a given string representing the content of a file. The copyright information is typically found within comments at the beginning of the string and follows a specific format. The function sho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_copyright_info('# Copyright 2022 John Doe\\\\n# Licensed under the Apache License, Version 2.0;') == ('John Doe', 'Apache License, Version 2.0')\", \"assert extract_copyright_info('# Copyright 2021 Jane Smith\\\\n# Licensed under the MIT License;') =...
{ "split": "train", "index": 80179, "acecode_id": "oss_17370", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a list of integers and returns a new list containing the elements of the original list in reverse order. You should not modify the original list. Write a function called 'reverse_list' that accepts a list of integers as inp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_list([1, 2, 3, 4, 5]) == [5, 4, 3, 2, 1]\", \"assert reverse_list([10, 20, 30]) == [30, 20, 10]\", \"assert reverse_list([0, -1, -2]) == [-2, -1, 0]\", \"assert reverse_list([]) == []\", \"assert reverse_list([100]) == [100]\", \"assert reverse_list(...
{ "split": "train", "index": 80180, "acecode_id": "evol_31135", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the orientation score of an object based on its 2D location and an orientation angle. The object is defined by its location as a 2D vector and an angle in radians. Your function should perform the following steps: 1. C...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_score([3, 4], 0) == -1.0\", \"assert calculate_score([0, 0], 0) == -1.0\", \"assert calculate_score([1, 1], 1) == -1.0\", \"assert calculate_score([-1, -1], -1) == -1.0\", \"assert calculate_score([5, 0], 0) == -1.0\", \"assert calculate_score([0, ...
{ "split": "train", "index": 80181, "acecode_id": "oss_15809", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two sorted arrays, write a function `find_common_elements(list1, list2)` that returns a list of all common elements between the two arrays. The function should not use any built-in functions or libraries to find the common elements. Assume both input arrays are sorted in ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_common_elements([1, 4, 6, 10, 20, 25, 30, 35, 40], [2, 5, 8, 10, 15, 20, 25, 30, 35]) == [10, 20, 25, 30, 35]\", \"assert find_common_elements([1, 2, 3], [4, 5, 6]) == []\", \"assert find_common_elements([1, 2, 3, 4, 5], [1, 2, 2, 3, 3]) == [1, 2, 3]\",...
{ "split": "train", "index": 80182, "acecode_id": "evol_28403", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `detect_file_type(file_ext: str, file_size: int, magic_bytes: str) -> str` that determines the type of a file based on its extension, size in bytes, and the presence of specific magic bytes. The function should support the following c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert detect_file_type('avi', 160, 'AVI LIST') == 'container'\", \"assert detect_file_type('wav', 200, 'WAVEfmt ') == 'container'\", \"assert detect_file_type('cda', 128, 'CDDAfmt ') == 'container'\", \"assert detect_file_type('mp3', 150, 'ID3') == 'Unknown'\", \"...
{ "split": "train", "index": 80183, "acecode_id": "oss_7359", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the centroid of a 3D object represented by its bounding box coordinates. The bounding box is defined by a list of six floating-point numbers: [xmin, ymin, zmin, xmax, ymax, zmax]. Your function should take a single par...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_centroid([0.0, 0.0, 0.0, 4.0, 4.0, 4.0]) == [2.0, 2.0, 2.0]\", \"assert calculate_centroid([-1.0, -1.0, -1.0, 1.0, 1.0, 1.0]) == [0.0, 0.0, 0.0]\", \"assert calculate_centroid([2.5, 2.5, 2.5, 5.5, 5.5, 5.5]) == [4.0, 4.0, 4.0]\", \"assert calculate...
{ "split": "train", "index": 80184, "acecode_id": "oss_28232", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists of messages and an address book. Each message is represented by a tuple containing a message ID and a sender's phone number. The address book is represented as a list of tuples, where each tuple contains a sender's phone number, name, company, and birthd...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_messages_with_address_book([(1, '12345'), (2, '67890')], [('12345', 'Alice', 'CompanyA', '01-01-1990'), ('54321', 'Bob', 'CompanyB', '02-02-1985')]) == [(1, 'Alice', 'CompanyA', '01-01-1990'), (2, 'Unknown', 'Unknown', 'Unknown')]\", \"assert merge_mes...
{ "split": "train", "index": 80185, "acecode_id": "bigcode_python_fns_1480", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that summarizes the performance metrics of a machine learning model. The function takes in several input parameters and returns a tuple containing various metrics. Your function should have the following signature: `def summarize_m...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert summarize_model_performance(0.95, 10.0, 100, 50, 0.9, 0.05, 0.1, 0.01) == (0.95, 10.0, 100, 50, 0.9, 0.05, 0.1, 0.01)\", \"assert summarize_model_performance(0.8, 5.0, 50, 30, 0.85, 0.1, 0.2, 0.04) == (0.8, 5.0, 50, 30, 0.85, 0.1, 0.2, 0.04)\", \"assert summ...
{ "split": "train", "index": 80186, "acecode_id": "oss_31047", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a user registration system for a web application. Implement a function named `register_user` that simulates the registration process. The function should accept a dictionary representing user details, which includes the keys 'username', 'email', and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert register_user({'username': 'user1', 'email': 'user1@example.com', 'password': 'password123'}) == 'User registered successfully'\", \"assert register_user({'username': 'user2', 'email': 'invalid_email', 'password': 'password123'}) == 'Invalid email format'\",...
{ "split": "train", "index": 80187, "acecode_id": "oss_12949", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function in Python that takes an arbitrary array as input and returns its length and the middle element(s). If the array is empty, the function should return None. If the array has an even number of elements, the function should return the two middle elements. Otherwise...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert array_properties([]) is None\", \"assert array_properties([1]) == (1, 1)\", \"assert array_properties([1, 2]) == (2, (1, 2))\", \"assert array_properties([1, 2, 3]) == (3, 2)\", \"assert array_properties([1, 2, 3, 4]) == (4, (2, 3))\", \"assert array_propert...
{ "split": "train", "index": 80188, "acecode_id": "evol_15089", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a DNA record represented as a dictionary containing genetic features. Your task is to write a Python function `process_genetic_features(record)` that processes the genetic features and extracts relevant information about specific types of genetic elements. The inp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_genetic_features({'gene': {'gene': ['ABC']}}) == {'gene_name': 'ABC'}\", \"assert process_genetic_features({'tRNA': {'feature_sequence': 'ATCG', 'gene': ['XYZ'], 'product': ['tRNA-OTHER']}}) == {'tRNA': {'feature_sequence': 'ATCG', 'gene_name': 'XYZ'...
{ "split": "train", "index": 80189, "acecode_id": "oss_5121", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given a list of commodity names as strings. Your task is to categorize these commodities into a special collection based on predefined keys. The predefined keys are: ['9900_80_0', '9905_10_0', '9905_80_0', '9910_10_0', '9910_80_0']. Implement a function `collection_head...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert collection_headings(['cotton', 'wheat', '9900_80_0_cotton']) == {'9900_80_0': ['9900_80_0_cotton'], '9905_10_0': [], '9905_80_0': [], '9910_10_0': [], '9910_80_0': []}\", \"assert collection_headings(['9905_10_0_rice', '9905_80_0_corn', '9910_10_0_sugar']) =...
{ "split": "train", "index": 80190, "acecode_id": "bigcode_python_fns_2629", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that logs examples used to train a machine learning model. The function `log_learn_entry` takes a list of examples to learn from, where each example is represented as a dictionary with keys as feature names and values as feature value...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert log_learn_entry([{'feature1': 10, 'feature2': 20}, {'feature1': 15, 'feature2': 25}]) == [{'feature1': 10, 'feature2': 20}, {'feature1': 15, 'feature2': 25}]\", \"assert log_learn_entry([{'feature1': 1, 'feature2': 2}]) == [{'feature1': 1, 'feature2': 2}]\",...
{ "split": "train", "index": 80191, "acecode_id": "oss_15279", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer n, write a function check_parity(n) that returns 'Even' if the integer is even, and 'Odd' if the integer is odd.\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 check_parity(0) == 'Even'\", \"assert check_parity(1) == 'Odd'\", \"assert check_parity(2) == 'Even'\", \"assert check_parity(-1) == 'Odd'\", \"assert check_parity(-2) == 'Even'\", \"assert check_parity(3) == 'Odd'\", \"assert check_parity(4) == 'Even'\", \"...
{ "split": "train", "index": 80192, "acecode_id": "evol_7587", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries where each dictionary represents a quote with a specific structure. Each quote must contain the fields 'author', 'text', and 'year'. Write a function `validate_quotes(quotes: List[Dict[str, str]]) -> bool` that checks if all quotes in the li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_quotes([{ 'author': 'Author One', 'text': 'Quote text one', 'year': '2021' }, { 'author': 'Author Two', 'text': 'Quote text two', 'year': '2020' }]) == True\", \"assert validate_quotes([{ 'author': 'Author One', 'text': 'Quote text one' }, { 'author...
{ "split": "train", "index": 80193, "acecode_id": "bigcode_python_fns_11688", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function `get_language_specifics()` that returns a string representing the default language used in a programming environment. The function should not take any parameters and should return one of the following strings: 'Python', 'Java', 'JavaScript', 'C++', 'Ruby'. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_language_specifics() == 'Python'\", \"assert get_language_specifics() == 'Python'\", \"assert get_language_specifics() == 'Python'\", \"assert get_language_specifics() == 'Python'\", \"assert get_language_specifics() == 'Python'\", \"assert get_language_...
{ "split": "train", "index": 80194, "acecode_id": "bigcode_python_fns_42375", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `print_diamond_pattern(diamond_size: int) -> str` that accepts an integer parameter `diamond_size` and returns a string representation of a solid diamond pattern made of stars ('*'). The function should handle error cases where the parameter is not a positive i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert print_diamond_pattern(1) == '*\\\\n'\", \"assert print_diamond_pattern(0) == 'Invalid input'\", \"assert print_diamond_pattern(-1) == 'Invalid input'\", \"assert print_diamond_pattern('3') == 'Invalid input'\", \"assert print_diamond_pattern('a') == 'Invalid...
{ "split": "train", "index": 80195, "acecode_id": "evol_28091", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are given a 2D array representing a grid filled with non-negative integers. Each cell in the grid represents the height of a tower at that position. Your task is to implement a function that calculates the volume of water that can be trapped after raining. Water can only be...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert trap_water([[0, 2, 0], [0, 1, 0], [0, 2, 0]]) == 0\", \"assert trap_water([[1, 1, 1], [1, 1, 1], [1, 1, 1]]) == 0\", \"assert trap_water([[1, 2, 1, 2, 1], [2, 3, 2, 3, 2], [1, 2, 1, 2, 1]]) == 0\", \"assert trap_water([[0, 0, 0], [0, 0, 0], [0, 0, 0]]) == 0\...
{ "split": "train", "index": 80196, "acecode_id": "bigcode_python_fns_538", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a string representation of a sequence of integers separated by commas, implement a function that segments the sequence into two non-empty intervals such that the sum of the numbers in both intervals is even. If it is not possible to split the sequence in such a way, retur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert split_sequence('1,3,5') == [[1, 3], [5]]\", \"assert split_sequence('10,20,30') == [[10], [20, 30]]\", \"assert split_sequence('1,1,1,1') == [[1, 1], [1, 1]]\", \"assert split_sequence('0,0,0') == [[0], [0, 0]]\", \"assert split_sequence('1,-1,2') == [[1, -1...
{ "split": "train", "index": 80197, "acecode_id": "evol_31607", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with parsing a string that represents time window settings for a video analysis project. Each time window is defined by a start time and an end time, separated by a colon (':'). The string may contain multiple time windows separated by commas. Your goal is to wri...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_time_windows('0:end, 100:200, 300:400') == [(0, 'end'), (100, 200), (300, 400)]\", \"assert parse_time_windows('50:100, 150:end') == [(50, 100), (150, 'end')]\", \"assert parse_time_windows('10:20') == [(10, 20)]\", \"assert parse_time_windows('0:end')...
{ "split": "train", "index": 80198, "acecode_id": "oss_17884", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that checks if two given strings are anagrams of each other. The function should consider case-sensitivity, special characters, and numbers in its validation. The input strings may include any characters, and you should return True if they are anagrams, and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_anagram('Bombe@123', 'bemob#@321') == False\", \"assert check_anagram('12345', '54321') == True\", \"assert check_anagram('anagram', 'nagaram') == True\", \"assert check_anagram('Test123', '123Test') == True\", \"assert check_anagram('Python3$', '3$Pyt...
{ "split": "train", "index": 80199, "acecode_id": "evol_11308", "num_tests": 15 }