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 `greet_person(name: str) -> str` that takes a string `name` as input and returns a greeting message in the format 'Hello, {name}'.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert greet_person('Jane') == 'Hello, Jane'\", \"assert greet_person('Alice') == 'Hello, Alice'\", \"assert greet_person('Bob') == 'Hello, Bob'\", \"assert greet_person('Charlie') == 'Hello, Charlie'\", \"assert greet_person('David') == 'Hello, David'\", \"assert ...
{ "split": "train", "index": 83400, "acecode_id": "evol_20651", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the CRUD operations for medical specialties in a simplified manner. The function should accept a list of operations, each of which is a tuple containing an operation type and the corresponding data. The operation types ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_specialties([('create', 'Cardiology'), ('create', 'Neurology'), ('read', 0)]) == ['Cardiology']\", \"assert manage_specialties([('create', 'Orthopedics'), ('update', (0, 'Sports Medicine')), ('read', 0)]) == ['Sports Medicine']\", \"assert manage_spec...
{ "split": "train", "index": 83401, "acecode_id": "oss_33399", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `get_existing_rule` that checks if a given text exactly matches a predefined set of rules. Each rule is represented as a string. The function should return the matched rule if there is exactly one match, and return False otherwise. Th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_existing_rule('rule1') == 'rule1'\", \"assert get_existing_rule('rule2') == 'rule2'\", \"assert get_existing_rule('rule3') == 'rule3'\", \"assert get_existing_rule('rule4') == 'rule4'\", \"assert get_existing_rule('rule5') == False\", \"assert get_existi...
{ "split": "train", "index": 83402, "acecode_id": "bigcode_python_fns_6797", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with determining the most effective treatment for a specific subclone of cancer cells based on a matrix that represents the effects of various treatments. You will implement a function called `most_effective_treatment(matrix, subclone_index)` that takes in a 2D a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert most_effective_treatment([[0, 0, 0], [0, 0, 0], [0, 0, 0]], 0) == 0\", \"assert most_effective_treatment([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]], 0) == 2\", \"assert most_effective_treatment([[1, 2], [3, 2]], 1) == 0\", \"assert most_effective_treatment([[2.5, 2....
{ "split": "train", "index": 83403, "acecode_id": "oss_62", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that saves a given model object into a file using the pickle module. The function should take two parameters: the model object and a string representing the file path where the model should be saved. Implement the function `save_model...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert save_model({'key': 'value'}, 'model.pkl') is None\", \"assert save_model([1, 2, 3], 'list_model.pkl') is None\", \"assert save_model('simple string model', 'string_model.pkl') is None\", \"assert save_model((1, 2, 3), 'tuple_model.pkl') is None\", \"assert s...
{ "split": "train", "index": 83404, "acecode_id": "bigcode_python_fns_15549", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a string as input, converts every letter in the string to lower case, and then reverses the order of the words in the string. Non-alphanumeric characters should remain in their original position. For example, given the input 'Goodbye Universe!', ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_and_lower('Goodbye Universe!') == 'universe! goodbye'\", \"assert reverse_and_lower('Hello World') == 'world hello'\", \"assert reverse_and_lower('Python is Awesome!') == 'awesome! is python'\", \"assert reverse_and_lower('A B C D E') == 'e d c b a'\...
{ "split": "train", "index": 83405, "acecode_id": "evol_33728", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates a simple training loop for a machine learning model. The function should take the following parameters: `name` (string), `initial_weights` (list of floats), `max_epochs` (integer), `precision` (integer, either 32 or ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert training_loop('model1', None, 5, 32, 42) == [{'epoch': 0, 'loss': 0.5, 'accuracy': 0.8}, {'epoch': 1, 'loss': 0.5, 'accuracy': 0.8}, {'epoch': 2, 'loss': 0.5, 'accuracy': 0.8}, {'epoch': 3, 'loss': 0.5, 'accuracy': 0.8}, {'epoch': 4, 'loss': 0.5, 'accuracy':...
{ "split": "train", "index": 83406, "acecode_id": "oss_27262", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `get_key_details(yaml_string: str, keys: List[str]) -> Dict[str, Dict[str, Union[str, int]]]` that takes a YAML formatted string and a list of keys, and returns a dictionary where each key maps to another dictionary containing its associated value and the line ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_key_details('Key1: value1\\\\nKey2: value2\\\\nKey3: value3', ['Key1', 'Key2', 'Key3']) == {'Key1': {'value': 'value1', 'line': 1}, 'Key2': {'value': 'value2', 'line': 2}, 'Key3': {'value': 'value3', 'line': 3}}\", \"assert get_key_details('Key1: value1\...
{ "split": "train", "index": 83407, "acecode_id": "evol_19011", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function `convert_currency_pairs(currency_pairs: List[Tuple[str, str]], exchange_rates: Dict[str, Dict[str, float]]) -> List[Tuple[str, str, float]]` that takes a list of currency pairs and a dictionary of exchange rates, and returns a list of tuples containing each...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_currency_pairs([('USD', 'EUR'), ('GBP', 'JPY')], {'USD': {'EUR': 0.85}, 'GBP': {'JPY': 150.0}}) == [('USD', 'EUR', 0.85), ('GBP', 'JPY', 150.0)]\", \"assert convert_currency_pairs([('USD', 'CAD'), ('AUD', 'JPY')], {'USD': {'CAD': 1.25}, 'AUD': {'JPY'...
{ "split": "train", "index": 83408, "acecode_id": "evol_34710", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that returns a new list containing only the unique elements from the original list while maintaining the original order. The input list may contain duplicate values, and the output list should not have any duplicates. You should implem...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_duplicates([1, 2, 3, 1, 2, 4]) == [1, 2, 3, 4]\", \"assert remove_duplicates([1, 1, 1, 1]) == [1]\", \"assert remove_duplicates([]) == []\", \"assert remove_duplicates([5, 5, 6, 7, 8, 6, 5]) == [5, 6, 7, 8]\", \"assert remove_duplicates([2, 3, 5, 3, 2...
{ "split": "train", "index": 83409, "acecode_id": "bigcode_python_fns_2906", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that concatenates two strings using the logic of a singly linked list. Each character of the strings should be stored in a node of the linked list. The function should create a linked list from both input strings and return the concatenated string formed by tra...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert concatenate_strings('hello', 'world') == 'helloworld'\", \"assert concatenate_strings('abc', 'def') == 'abcdef'\", \"assert concatenate_strings('', 'test') == 'test'\", \"assert concatenate_strings('test', '') == 'test'\", \"assert concatenate_strings('', ''...
{ "split": "train", "index": 83410, "acecode_id": "evol_23775", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that extracts all distinct words from a given text string, ignoring case and punctuation. The function should return a set of these distinct words. For example, given the input string 'Hello, world! Hello, universe.', the function should return a set contai...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert distinct_lexemes('Hello, world! Hello, universe.') == {'hello', 'world', 'universe'}\", \"assert distinct_lexemes('Once upon a time, in a time long past, there was a tale of great adventure and challenge.') == {'once', 'upon', 'a', 'time', 'in', 'long', 'pas...
{ "split": "train", "index": 83411, "acecode_id": "evol_21800", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `generate_distinct_primes(start: int, end: int, count: int) -> List[int]` that generates a list of `count` distinct prime numbers within the range of `start` and `end` (both inclusive). If there are not enough distinct prime numbers in the specified range, the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_distinct_primes(10, 100, 15) == [11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67]\", \"assert generate_distinct_primes(1, 10, 4) == [2, 3, 5, 7]\", \"assert generate_distinct_primes(10, 20, 5) == [11, 13, 17, 19]\", \"assert generate_dist...
{ "split": "train", "index": 83412, "acecode_id": "evol_21504", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Implement a function `bubble_sort_descending(arr)` that takes a list of integers `arr` and sorts it in decreasing order using the bubble sort algorithm. The function should modify the input list in place and return None. For example, given the input list `arr = [10, 5, 2, 7, 6]...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bubble_sort_descending([10, 5, 2, 7, 6]) == None and [10, 7, 6, 5, 2] == [10, 7, 6, 5, 2]\", \"assert bubble_sort_descending([1, 2, 3]) == None and [3, 2, 1] == [3, 2, 1]\", \"assert bubble_sort_descending([5, 4, 3, 2, 1]) == None and [5, 4, 3, 2, 1] == [5, ...
{ "split": "train", "index": 83413, "acecode_id": "evol_12097", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of employee records, where each record is represented as a dictionary containing the following keys: 'id', 'name', 'email', 'age', and 'salary'. Write a function `update_employee(records: List[Dict[str, Union[str, int]]], id: int, new_data: Dict[str, Union[...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_employee([{'id': 1, 'name': 'Alex', 'email': 'alex@gmail.com', 'age': 30, 'salary': 5000}], 1, {'name': 'Alex', 'email': 'alex@gmail.com', 'age': 30, 'salary': 5000}) == {'id': 1, 'name': 'Alex', 'email': 'alex@gmail.com', 'age': 30, 'salary': 5000}\"...
{ "split": "train", "index": 83414, "acecode_id": "bigcode_python_fns_49942", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string `template` which contains a series of text segments and tags. Each tag starts with a specified `left_delimiter`. Your task is to implement a function that returns the text segment between a specified `pointer` (index) and the next occurrence of the `left_...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_next_segment('Hello {{name}}, welcome!', 0, '{{') == ('Hello ', 6)\", \"assert find_next_segment('Hello {{name}}, welcome!', 6, '{{') == ('', 6)\", \"assert find_next_segment('abc{def}ghi', 0, '{') == ('abc', 3)\", \"assert find_next_segment('abc{def}gh...
{ "split": "train", "index": 83415, "acecode_id": "bigcode_python_fns_22058", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple function that simulates a messaging bot's middleware. The middleware will set a default parse mode for messages. Implement the function `set_default_parse_mode(parse_mode: str, middleware_list: list) -> list` that takes a string `parse_mode...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_default_parse_mode('HTML', []) == [{'parse_mode': 'HTML'}]\", \"assert set_default_parse_mode('Markdown', [{'parse_mode': 'HTML'}]) == [{'parse_mode': 'HTML'}, {'parse_mode': 'Markdown'}]\", \"assert set_default_parse_mode('Markdown', [{'parse_mode': 'HT...
{ "split": "train", "index": 83416, "acecode_id": "oss_3548", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a log string that contains memory usage statistics in a specific format. Your task is to extract the memory statistics section from the log and return it as a dictionary. The memory usage section starts with the line 'Memory usage is given in bytes:' and ends befo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_memory_stats('Memory usage is given in bytes:\\\\n---\\\\nArray 100 200 300 1.5\\\\nMatrix 400 500 600 2.5\\\\n===========') == {'Array': [100, 200, 300, 1.5], 'Matrix': [400, 500, 600, 2.5]}\", \"assert extract_memory_stats('Memory usage is given in...
{ "split": "train", "index": 83417, "acecode_id": "bigcode_python_fns_15815", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with analyzing EEG data represented as a dictionary containing channel names and their corresponding signal values. Your goal is to implement a function `get_bads(rawf)` that identifies and returns a list of bad channels based on the following criteria: 1) Channe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_bads({'ch_names': ['Fp1', 'Fp2', 'Cz'], 'data': {'Fp1': [110, 120], 'Fp2': [10, 20], 'Cz': [30, 40]}}) == ['Fp1', 'Fp2']\", \"assert get_bads({'ch_names': ['Fz', 'Pz', 'Oz'], 'data': {'Fz': [20, 30], 'Pz': [60, 70], 'Oz': [40, 50]}}) == []\", \"assert ge...
{ "split": "train", "index": 83418, "acecode_id": "oss_23277", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a 2D list representing a grayscale image, where each element in the list corresponds to a pixel value (an integer between 0 and 255). You also have a list of pixel values that you want to omit from your calculations. Your task is to implement a function that calcu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_variance([[0, 0], [0, 0]], []) == 0.0\", \"assert calculate_variance([[255]], []) == 0.0\", \"assert calculate_variance([[0]], []) == 0.0\", \"assert calculate_variance([[1, 1], [1, 1]], []) == 0.0\", \"assert calculate_variance([[1, 2], [3, 4]], [...
{ "split": "train", "index": 83419, "acecode_id": "bigcode_python_fns_47537", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing file paths and a target output file path. Your task is to concatenate the contents of all the files in the list into the target output file. The function should return the path of the output file after concatenation. Assume that the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_files(['file1.txt', 'file2.txt'], 'output.txt') == 'output.txt'\", \"assert merge_files(['fileA.txt', 'fileB.txt', 'fileC.txt'], 'final_output.txt') == 'final_output.txt'\", \"assert merge_files(['data1.txt'], 'single_output.txt') == 'single_output.txt...
{ "split": "train", "index": 83420, "acecode_id": "bigcode_python_fns_6134", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function called `calculate_square_root` that takes an integer input and calculates its square root. If the input is negative, the function should raise a custom exception called `InvalidInputError` with the message 'Input must be a non-negative int...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_square_root(0) == 0.0\", \"assert calculate_square_root(1) == 1.0\", \"assert calculate_square_root(4) == 2.0\", \"assert calculate_square_root(9) == 3.0\", \"assert calculate_square_root(16) == 4.0\", \"assert calculate_square_root(25) == 5.0\", \...
{ "split": "train", "index": 83421, "acecode_id": "oss_31680", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates acquiring a lock on a resource. The function, `acquire_lock`, should take the following parameters: `expires` (an integer representing expiry time in seconds), `should_fail` (a boolean indicating whether to raise an err...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert acquire_lock(60, True, False) == 'Lock acquired'\", \"assert acquire_lock(0, True, True) == 'Lock acquired'\", \"assert acquire_lock(30, True, False) == 'Lock acquired'\", \"assert acquire_lock(120, True, False) == 'Lock acquired'\", \"assert acquire_lock(18...
{ "split": "train", "index": 83422, "acecode_id": "bigcode_python_fns_33809", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Implement a function that generates a random integer between two given numbers, x and y (inclusive). The function should take two parameters, x and y, and return a random integer in the range [x, y].\nPlease reason step by step, then write a self-contained Python solution. Give...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_random_between(1, 10) in range(1, 11)\", \"assert generate_random_between(-5, 5) in range(-5, 6)\", \"assert generate_random_between(0, 0) == 0\", \"assert generate_random_between(100, 200) in range(100, 201)\", \"assert generate_random_between(-10,...
{ "split": "train", "index": 83423, "acecode_id": "evol_14543", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks a list of URLs to ensure all expected URLs have been visited during a web scraping operation. The function should take two parameters: a list of visited URLs and a list of expected URLs. If any expected URL is not present in t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_visited_urls(['http://example.com', 'http://example.org'], ['http://example.com']) == ['http://example.com', 'http://example.org']\", \"assert check_visited_urls(['http://example.com', 'http://example.org'], ['http://example.com', 'http://example.org']...
{ "split": "train", "index": 83424, "acecode_id": "bigcode_python_fns_21929", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Implement a function `create_bucket(bucket_name: str) -> str` that takes a bucket name as input and simulates the creation of an Amazon S3 bucket. The function should return a string indicating the URL of the newly created bucket in the 'us-west-1' region. Ensure that the bucke...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_bucket('my-test-bucket') == 'https://my-test-bucket.s3.us-west-1.amazonaws.com'\", \"assert create_bucket('example-bucket-123') == 'https://example-bucket-123.s3.us-west-1.amazonaws.com'\", \"assert create_bucket('bucket-name') == 'https://bucket-name...
{ "split": "train", "index": 83425, "acecode_id": "evol_22613", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a banking operation to manage the balance of a single bank account. Implement a function called `bank_operations` that takes the following parameters: an initial balance (integer), a list of operations (list of tuples), where each operation is a t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bank_operations(1000, [('deposit', 500), ('withdraw', 200)]) == 1300\", \"assert bank_operations(500, [('withdraw', 600)]) == 500\", \"assert bank_operations(300, [('deposit', 200), ('withdraw', 100), ('withdraw', 500)]) == 400\", \"assert bank_operations(10...
{ "split": "train", "index": 83426, "acecode_id": "oss_17657", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a string `line` which represents a line in a configuration output and a list `configs` that represents a stack of configuration node objects, determine if the line indicates that an 'edit' section ends without a 'next' end marker. The conditions for this special case are:...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_edit_end_without_next('end', [{'name': 'vdom', 'type': 'NT_CONFIG', 'end_re': re.compile('end')}, {'name': 'edit', 'type': 'NT_EDIT'}]) == True\", \"assert is_edit_end_without_next('end', [{'name': 'vdom', 'type': 'NT_CONFIG', 'end_re': re.compile('end')}...
{ "split": "train", "index": 83427, "acecode_id": "bigcode_python_fns_94", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a table name and a list of condition fields, write a function that generates a SQL DELETE query string. The function should take two parameters: a string 'table' representing the name of the table, and an iterable 'where' containing the names of the fields that will be us...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert build_delete('users', ['id', 'name']) == 'DELETE FROM \\\"users\\\" WHERE id = :id AND name = :name'\", \"assert build_delete('products', ['product_id']) == 'DELETE FROM \\\"products\\\" WHERE product_id = :product_id'\", \"assert build_delete('orders', ['or...
{ "split": "train", "index": 83428, "acecode_id": "bigcode_python_fns_46839", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes in a list of strings representing movie reviews and a corresponding list of integers representing sentiments (1 for positive, 0 for negative). The function should return a list of tuples where each tuple contains a review and its corresponding se...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_reviews(['Great movie!', 'Not good', 'Loved it', 'Terrible'], [1, 0, 1, 0]) == [('Great movie!', 1), ('Loved it', 1), ('Not good', 0), ('Terrible', 0)]\", \"assert sort_reviews(['Okay', 'Fantastic', 'Boring', 'Amazing'], [0, 1, 0, 1]) == [('Fantastic', ...
{ "split": "train", "index": 83429, "acecode_id": "evol_16144", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a string as input and alternately changes the casing of each alphabetical character, while leaving non-alphabetical characters unchanged. The function should maintain the original order of characters in the string. For example, given the input 'H...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert alternate_case('aBcD') == 'AbCd'\", \"assert alternate_case('1234') == '1234'\", \"assert alternate_case('!@#$%') == '!@#$%'\", \"assert alternate_case('Python 3.9') == 'PyThOn 3.9'\", \"assert alternate_case('') == ''\", \"assert alternate_case('abcdef') ==...
{ "split": "train", "index": 83430, "acecode_id": "evol_5135", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that converts a given numerical value from base 10 to any specified base between 2 and 16. The function should support both integer and floating-point numbers with up to three decimal places. For example, for the input number 50.5 and the base 2, the output...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert float_dec2base(50.5, 2) == '110010.1'\", \"assert float_dec2base(50.5, 8) == '62.4'\", \"assert float_dec2base(50.5, 16) == '32.8'\", \"assert float_dec2base(-50.5, 2) == '-110010.1'\", \"assert float_dec2base(-50.5, 8) == '-62.4'\", \"assert float_dec2base(...
{ "split": "train", "index": 83431, "acecode_id": "evol_19714", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with resizing a graphical figure based on given dimensions. Implement a function `resize_figure(width: int, height: int) -> str` that takes in the width and height of a figure in inches and returns a string indicating the new size in the format 'width,height'. Th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert resize_figure(5, 10) == '5,10'\", \"assert resize_figure(0, 0) == '0,0'\", \"assert resize_figure(12, 8) == '12,8'\", \"assert resize_figure(15, 20) == '15,20'\", \"assert resize_figure(3, 7) == '3,7'\", \"assert resize_figure(10, 5) == '10,5'\", \"assert re...
{ "split": "train", "index": 83432, "acecode_id": "bigcode_python_fns_16848", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a user profile represented as a dictionary where the keys are 'username' and 'follows', and a target username to check. The 'follows' key contains a list of usernames that the user is following. Your task is to implement a function that takes in three parameters: ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_profile_info({'username': 'alice', 'follows': ['bob', 'charlie']}, 'alice', False) == ('alice', False, 'self_profile_stream')\", \"assert check_profile_info({'username': 'alice', 'follows': ['bob', 'charlie']}, 'bob', True) == ('bob', True, 'following'...
{ "split": "train", "index": 83433, "acecode_id": "bigcode_python_fns_37946", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a list of strings, each representing a label of a node in a tree structure, implement a function `merged_nodes(labels: List[str]) -> List[str]` that merges nodes with the same base label but different suffixes into a single node. The base label is defined as the part of t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merged_nodes(['VP_2*0', 'VP_2*1', 'VP_2']) == ['VP_2']\", \"assert merged_nodes(['VP_1', 'VP_1*0', 'VP_1*1']) == ['VP_1']\", \"assert merged_nodes(['VP_2*0', 'VP_3']) == ['VP_2', 'VP_3']\", \"assert merged_nodes(['VP*0', 'VP*1', 'VP*2']) == ['VP']\", \"asser...
{ "split": "train", "index": 83434, "acecode_id": "bigcode_python_fns_32480", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function to generate a 3D array of size l x m x n, filling it with numbers from 1 to l*m*n in a zig-zag pattern. The function should take three parameters, l, m, and n, where each of them is an integer between 1 and 5 (inclusive). The output should be a list of l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_3d_array(1, 1, 1) == [[[1]]]\", \"assert generate_3d_array(1, 2, 2) == [[[1, 2], [4, 3]]]\", \"assert generate_3d_array(2, 2, 2) == [[[1, 2], [4, 3]], [[5, 6], [8, 7]]]\", \"assert generate_3d_array(3, 2, 2) == [[[1, 2], [4, 3]], [[5, 6], [8, 7]], [...
{ "split": "train", "index": 83435, "acecode_id": "evol_793", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Write a Python function to sort a given list of dictionaries by the keys 'name' and 'age'. The dictionaries should be sorted first by the 'name' key in ascending order. If there are dictionaries with the same 'name', sort them by the 'age' key in ascending order. The function s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_dicts([{'name': 'Jose', 'age': 32}, {'name': 'Ravi', 'age': 23}, {'name': 'Paul', 'age': 32}, {'name': 'Jose', 'age': 28}]) == [{'name': 'Jose', 'age': 28}, {'name': 'Jose', 'age': 32}, {'name': 'Paul', 'age': 32}, {'name': 'Ravi', 'age': 23}]\", \"asse...
{ "split": "train", "index": 83436, "acecode_id": "evol_8113", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing lines of text. Your task is to implement a function that converts lines starting with the marker '//' into lines where '//' is replaced with two spaces ' '. The function should return a new list with the modified lines. Lines that d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert whitespaceify_hidden_markers(['Hello', '//This is a comment', 'World', '//Another comment']) == ['Hello', ' This is a comment', 'World', ' Another comment']\", \"assert whitespaceify_hidden_markers(['No marker here', 'Just another line']) == ['No marker he...
{ "split": "train", "index": 83437, "acecode_id": "bigcode_python_fns_46199", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a game environment where a player can shoot at an enemy. The game has a player position represented by an integer variable `position`, a shooting direction represented by an integer variable `direction`, and a constant integer `HEIGHT` representin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_shooting(5, 1, 10) == 'Player is shooting towards the enemy.'\", \"assert simulate_shooting(7, -1, 10) == 'This scenario should never happen.'\", \"assert simulate_shooting(0, 0, 10) == 'Shooting action cannot happen.'\", \"assert simulate_shooting(...
{ "split": "train", "index": 83438, "acecode_id": "oss_12796", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Write a function `generate_code_string()` that generates a random encoded text string that meets the following criteria: The resultant message must consist of exactly 15 characters, include at least one unique symbol (e.g., !, @, #), contain at least one Roman numeral (I, V, X,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert len(generate_code_string()) == 15\", \"assert any(c in string.punctuation for c in generate_code_string())\", \"assert any(c in 'IVXLCDM' for c in generate_code_string())\", \"assert any(c.isupper() for c in generate_code_string())\", \"assert any(c.islower(...
{ "split": "train", "index": 83439, "acecode_id": "evol_34870", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that computes the greatest common divisor (GCD) of all Fibonacci numbers that are less than or equal to a given threshold 'n'. The Fibonacci sequence starts with 0 and 1, and each subsequent number is the sum of the two preceding ones. Your function should ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_gcd_for_fibonacci(0) == 0\", \"assert compute_gcd_for_fibonacci(1) == 1\", \"assert compute_gcd_for_fibonacci(2) == 1\", \"assert compute_gcd_for_fibonacci(3) == 1\", \"assert compute_gcd_for_fibonacci(4) == 1\", \"assert compute_gcd_for_fibonacci(5)...
{ "split": "train", "index": 83440, "acecode_id": "evol_19492", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of alphanumeric strings, write a function that arranges these strings in descending order based on their alphabetical value. The alphabetical value is determined by the lexicographical order of the characters in the strings, ignoring any numeric values. The functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert arrange_descending(['b21', 'd10', 'c3', 'a100', 'e2']) == ['e2', 'd10', 'c3', 'b21', 'a100']\", \"assert arrange_descending(['z1', 'y2', 'x3', 'a4']) == ['z1', 'y2', 'x3', 'a4']\", \"assert arrange_descending(['apple', 'banana', 'cherry']) == ['cherry', 'ban...
{ "split": "train", "index": 83441, "acecode_id": "evol_9449", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given an array of integers and an integer k, implement a function that returns the kth smallest unique element in the array along with its frequency. If k is larger than the number of unique elements in the array, return an error message. The function should have the signature ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_kth_smallest([8, 4, 3, 3, 2, 1, 1, 29, 37, 1], 3) == (3, 2)\", \"assert find_kth_smallest([5, 5, 5, 5, 5], 1) == (5, 5)\", \"assert find_kth_smallest([1, 2, 3, 4, 5], 2) == (2, 1)\", \"assert find_kth_smallest([7, 7, 8, 8, 9], 1) == (7, 2)\", \"assert f...
{ "split": "train", "index": 83442, "acecode_id": "evol_11304", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a list of integers, construct a hash table (dictionary) where each integer serves as the key and its occurrence in the list serves as the value. Additionally, return a list of all keys that have the maximum occurrence count. If there is more than one key with the maximum ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_occurrence_keys([1, 2, 3, 2, 1, 3, 1]) == [1]\", \"assert max_occurrence_keys([4, 5, 6, 4, 5, 5]) == [5]\", \"assert max_occurrence_keys([7, 8, 9, 9, 8, 7, 8]) == [8]\", \"assert max_occurrence_keys([10, 20, 10, 30, 20, 10]) == [10]\", \"assert max_occur...
{ "split": "train", "index": 83443, "acecode_id": "evol_19137", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a URL slug that represents a title in a simplified format. Your task is to implement a function `convert_slug(slug: str, pages: List[str]) -> str` that decodes the URL slug into its original string format. The slug may contain hyphens ('-') or underscores ('_') wh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_slug('my-page-title', ['My Page Title', 'Another Page', 'Example Page']) == 'My Page Title'\", \"assert convert_slug('my_page_title', ['My Page Title', 'Another Page', 'Example Page']) == 'My Page Title'\", \"assert convert_slug('my-page-title', ['my...
{ "split": "train", "index": 83444, "acecode_id": "evol_31524", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of tuples where each tuple contains an item ID, a purchase cost, and a purchase quantity, implement a function that calculates the weighted median of the purchase costs for each unique item ID, using the purchase quantities as weights. If the total weight for an it...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_weighted_median([(1, 10, 1), (1, 20, 2), (1, 30, 0)]) == {1: 20.0}\", \"assert calculate_weighted_median([(1, 5, 0), (1, 15, 0), (1, 25, 5)]) == {1: 25.0}\", \"assert calculate_weighted_median([(1, 100, 1), (1, 200, 1), (1, 300, 1)]) == {1: 200.0}\...
{ "split": "train", "index": 83445, "acecode_id": "evol_33253", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with manipulating LED colors in a simple display. Given three pairs of RGB values for Red, Magenta, and Lime LEDs, each represented as tuples of integers (R, G, B) where 0 <= R, G, B <= 255, your goal is to swap the Green and Blue values for each LED. Implement a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert swap_green_blue((0, 0, 0), (0, 0, 0), (0, 0, 0)) == ((0, 0, 0), (0, 0, 0), (0, 0, 0))\", \"assert swap_green_blue((255, 255, 255), (123, 234, 345), (12, 34, 56)) == ((255, 255, 255), (123, 345, 234), (12, 56, 34))\", \"assert swap_green_blue((10, 20, 30), (4...
{ "split": "train", "index": 83446, "acecode_id": "bigcode_python_fns_17006", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a vector represented as a list of numbers, write a function named `normalize_vector` that normalizes the vector to unit length. The function should take in a list of floats and return a new list of the same length, where each element is the corresponding element of the in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert normalize_vector([3.0, 4.0]) == [0.6, 0.8]\", \"assert normalize_vector([1.0, 2.0, 2.0]) == [0.3333333333333333, 0.6666666666666666, 0.6666666666666666]\", \"assert normalize_vector([0.0, 0.0]) == [0.0, 0.0]\", \"assert normalize_vector([1.0]) == [1.0]\", \"...
{ "split": "train", "index": 83447, "acecode_id": "bigcode_python_fns_40240", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `choose_best_action(state: List[float], model: Any) -> int` that determines the best action for a player to take in a game given the current state of the game and a pre-trained model. The `state` is represented as a list of floats indicating various paramet...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert choose_best_action([0.1, 0.2, 0.3], mock_model) == 1\", \"assert choose_best_action([0.5, 0.2, 0.1], mock_model) == 0\", \"assert choose_best_action([0.4, 0.4, 0.2], mock_model) == 0\", \"assert choose_best_action([0.9, 0.0, 0.1], mock_model) == 0\", \"asser...
{ "split": "train", "index": 83448, "acecode_id": "evol_29680", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that returns the middle element of the list. If the list has an even number of elements, return the average of the two middle elements. The function should be called `find_middle` and should take a single parameter, `arr`, which is...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_middle([1, 3, 5, 7]) == 4.0\", \"assert find_middle([10]) == 10\", \"assert find_middle([1, 2, 3]) == 2\", \"assert find_middle([1, 2, 3, 4]) == 2.5\", \"assert find_middle([8, 6, 7, 5, 3]) == 7\", \"assert find_middle([-1, -2, -3, -4]) == -2.5\", \"ass...
{ "split": "train", "index": 83449, "acecode_id": "evol_22324", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a similarity checker for a set of documents. The similarity between two documents is determined by comparing their content and calculating a similarity score using the Jaccard similarity coefficient. The Jaccard similarity score is calculated as...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_similar_documents(['Same words same words', 'Same words same words'], 2, 1.0) == [(0, 1)]\", \"assert find_similar_documents(['The quick brown fox jumps', 'The quick brown fox leaps'], 3, 0.5) == [(0, 1)]\", \"assert find_similar_documents(['Lorem ipsum...
{ "split": "train", "index": 83450, "acecode_id": "oss_16914", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a voting system for a competition. The voting system follows a simple elimination process where candidates compete in rounds, and the winner of each round advances until a majority winner is determined. You are given a function `determine_winner...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert determine_winner([(300, 'Eve'), (250, 'Frank'), (100, 'Grace'), (50, 'Hannah')], 300) == 'Eve'\", \"assert determine_winner([(500, 'Liam'), (400, 'Mia'), (300, 'Noah')], 450) == 'Liam'\", \"assert determine_winner([(800, 'Rita'), (300, 'Sam'), (200, 'Tina')]...
{ "split": "train", "index": 83451, "acecode_id": "oss_18017", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Design a data structure that supports the following operations: Add(key) - Inserts a new key with value 1. If the key already exists, it doubles its current value. Key is guaranteed to be a non-empty string. Subtract(key) - If key's value is 1, remove it from the data structure...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert my_data_structure.add('a') == None\", \"assert my_data_structure.add('b') == None\", \"assert my_data_structure.add('a') == None\", \"assert my_data_structure.subtract('a') == None\", \"assert my_data_structure.subtract('b') == None\", \"assert my_data_struc...
{ "split": "train", "index": 83452, "acecode_id": "evol_2639", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Create a function `adventure_game_status(location, inventory)` that simulates the current status of a player in a text-based adventure game. The function takes in two parameters: a string `location` representing the player's current location, and a list `inventory` containing i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert adventure_game_status('forest', []) == 'You are in a forest. You can see a castle to the north. Inventory: empty'\", \"assert adventure_game_status('forest', ['sword']) == 'You are in a forest. You can see a castle to the north. Inventory: sword'\", \"assert...
{ "split": "train", "index": 83453, "acecode_id": "evol_13049", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a nested list as input and returns a new list containing all the elements of the input list in reverse order. The input list may contain other lists at any depth. For example, given the input ['a', 'b', ['c', 'd']], the output should be ['d', 'c'...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert print_reverse(['a', 'b', ['c', 'd']]) == ['d', 'c', 'b', 'a']\", \"assert print_reverse([1, 2, [3, 4, [5]]]) == [5, 4, 3, 2, 1]\", \"assert print_reverse([[1, 2], [3, 4], [5, 6]]) == [6, 5, 4, 3, 2, 1]\", \"assert print_reverse(['x', ['y', 'z']]) == ['z', 'y...
{ "split": "train", "index": 83454, "acecode_id": "evol_22107", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of recent commands and a user input string, and predicts the most likely command the user intends to enter based on the most frequently used command that starts with the given input string. If there are no matches, return an empty string.\...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert predict_command(['open', 'save', 'open', 'exit', 'open'], 'op') == 'open'\", \"assert predict_command(['start', 'stop', 'start', 'restart'], 'st') == 'start'\", \"assert predict_command(['run', 'test', 'run', 'build'], 'r') == 'run'\", \"assert predict_comma...
{ "split": "train", "index": 83455, "acecode_id": "evol_10346", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a base image represented as a 3D list or array, a box defined by its top-left corner coordinates (x1, y1) and its dimensions (width, height), and a change array indicating how much to adjust each parameter of the box, implement a function that calculates the new position ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert change_box((100, 200, 3), [10, 20, 30, 40], [5, -10, 0, 0]) == [15, 10, 30, 40]\", \"assert change_box((100, 200, 3), [10, 20, 30, 40], [0, 0, 0, 0]) == [10, 20, 30, 40]\", \"assert change_box((100, 200, 3), [0, 0, 30, 40], [-5, 0, 0, 0]) == [0, 0, 30, 40]\"...
{ "split": "train", "index": 83456, "acecode_id": "bigcode_python_fns_19046", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a positive integer n, write a function `cumulative_total(n)` that computes the cumulative total of the cubed values of all whole numbers from 1 to n, inclusive. The function should return the computed total as an integer.\nPlease reason step by step, then write a self-con...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cumulative_total(1) == 1\", \"assert cumulative_total(2) == 9\", \"assert cumulative_total(3) == 36\", \"assert cumulative_total(4) == 100\", \"assert cumulative_total(5) == 225\", \"assert cumulative_total(6) == 441\", \"assert cumulative_total(7) == 784\",...
{ "split": "train", "index": 83457, "acecode_id": "evol_15152", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with generating a random string based on specified length constraints. Write a function `generate_random_string` that takes in a dictionary `prop` with the following optional keys: `minLength` (an integer representing the minimum length of the generated string, d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_random_string({'minLength': 0, 'maxLength': 0}) == ''\", \"assert len(generate_random_string({'minLength': 1, 'maxLength': 10})) >= 1\", \"assert len(generate_random_string({'minLength': 1, 'maxLength': 10})) <= 10\", \"assert generate_random_string...
{ "split": "train", "index": 83458, "acecode_id": "bigcode_python_fns_13401", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a finite state machine (FSM) in Python. The FSM should support the following operations: initializing the FSM with a set of states, a current state, a set of non-accepting states, and a list of transition functions. Your task is to implement a f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transition_fsm(0, 'a', [(0, 'a', 1), (1, 'b', 2)]) == 1\", \"assert transition_fsm(1, 'b', [(0, 'a', 1), (1, 'b', 2)]) == 2\", \"assert transition_fsm(0, 'b', [(0, 'a', 1), (1, 'b', 2)]) == 0\", \"assert transition_fsm(2, 'a', [(0, 'a', 1), (1, 'b', 2)]) == ...
{ "split": "train", "index": 83459, "acecode_id": "oss_32832", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a distinct hexadecimal string as an input and returns the corresponding ASCII character for that hexadecimal value. The input string will be a valid hexadecimal representation consisting of characters from 0-9 and A-F (case insensitive).\nPlease ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert hex_to_ascii('41') == 'A'\", \"assert hex_to_ascii('61') == 'a'\", \"assert hex_to_ascii('7A') == 'z'\", \"assert hex_to_ascii('23') == '#'\", \"assert hex_to_ascii('2A') == '*'\", \"assert hex_to_ascii('30') == '0'\", \"assert hex_to_ascii('39') == '9'\", \...
{ "split": "train", "index": 83460, "acecode_id": "evol_8314", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of parameters representing the coefficients of various terms in a molecular dynamics simulation, an array representing the quantum mechanics (QM) hessian matrix, and an integer representing the number of atoms in the molecule. Your task is to compute the re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_residuals([10.0], [10.0], 1) == [0.0]\", \"assert calculate_residuals([1.0]*100, [0.0]*100, 10) == [1.0]*100\", \"assert calculate_residuals([0.0], [0.0], 1) == [0.0]\", \"assert calculate_residuals([1.0, 2.0, -2.0], [-1.0, 0.0, 1.0], 2) == [2.0, 2...
{ "split": "train", "index": 83461, "acecode_id": "bigcode_python_fns_45810", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that compresses a given list of integers using a simple run-length encoding (RLE) algorithm. The function should take a list of integers as input and return a list of tuples, where each tuple contains a unique integer and the number o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compress_rle([]) == []\", \"assert compress_rle([1]) == [(1, 1)]\", \"assert compress_rle([1, 1]) == [(1, 2)]\", \"assert compress_rle([1, 2]) == [(1, 1), (2, 1)]\", \"assert compress_rle([1, 1, 1, 2, 2, 3]) == [(1, 3), (2, 2), (3, 1)]\", \"assert compress_r...
{ "split": "train", "index": 83462, "acecode_id": "bigcode_python_fns_39312", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `create_property_map(cls: type, property_map: Optional[Union[Callable, Dict[str, Any]]] = None) -> Dict[str, Any]`. This function should generate a property map for a given class `cls`. If `property_map` is provided and is callable, it sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_property_map(str) == {}\", \"assert create_property_map(str, None) == {}\", \"assert create_property_map(str, {}) == {}\", \"assert create_property_map(str, {'name': 'example'}) == {'name': 'example'}\", \"assert create_property_map(str, lambda cls: {...
{ "split": "train", "index": 83463, "acecode_id": "bigcode_python_fns_33313", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that simulates the checking of internet connectivity status for a device. The function should handle various scenarios and return a dictionary containing the cause of the connectivity issue. Your implementation should consider ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_internet_connectivity() == {'cause': 'Internet connection is active.'}\", \"assert check_internet_connectivity() == {'cause': 'DNS resolution failure. Check DNS settings.'}\", \"assert check_internet_connectivity() == {'cause': 'DNS resolution failure....
{ "split": "train", "index": 83464, "acecode_id": "oss_14400", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that registers a new directive in a documentation system. The function, `register_directive`, accepts two parameters: a string `name` representing the name of the directive and a callable `directive` that defines the behavior of the d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert register_directive('test_directive', lambda: 'Test') is None\", \"assert register_directive('example_directive', lambda: 'Example') is None\", \"assert register_directive('test_directive', lambda: 'New Test') is None\", \"assert register_directive('another_d...
{ "split": "train", "index": 83465, "acecode_id": "bigcode_python_fns_43388", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes an integer as input and transforms it into its corresponding binary representation as a string. The function should raise a custom exception if the input is not an integer. Additionally, you must implement the conversion using recursion, avoiding...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert int_to_bin(0) == '0'\", \"assert int_to_bin(1) == '1'\", \"assert int_to_bin(2) == '10'\", \"assert int_to_bin(3) == '11'\", \"assert int_to_bin(4) == '100'\", \"assert int_to_bin(5) == '101'\", \"assert int_to_bin(10) == '1010'\", \"assert int_to_bin(15) ==...
{ "split": "train", "index": 83466, "acecode_id": "evol_18609", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates retrieving the last commit message from a version control system. The function should accept a list of commit messages and return the most recent commit message. If the list is empty, it should return an empty string. I...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_last_commit_message(['Initial commit', 'Added README', 'Fixed bug']) == 'Fixed bug'\", \"assert get_last_commit_message(['Initial commit']) == 'Initial commit'\", \"assert get_last_commit_message([]) == ''\", \"assert get_last_commit_message(['Update dep...
{ "split": "train", "index": 83467, "acecode_id": "bigcode_python_fns_36412", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a program that analyzes the frequency of words in a given text. Your program should take a string of text as input and output a dictionary containing the frequency of each word in the text. A word is defined as a sequence of alphanumeric characters ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert word_frequency_counter('Hello, world! This is a hello world program. Hello, everyone.') == {'hello': 3, 'world': 2, 'this': 1, 'is': 1, 'a': 1, 'program': 1, 'everyone': 1}\", \"assert word_frequency_counter('Python is great. Python is easy!') == {'python': ...
{ "split": "train", "index": 83468, "acecode_id": "oss_15735", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an XML string representing a test element with various attributes, write a function that checks if all required attributes are present in the XML element. The function should take the XML string and a list of required attributes as input. If all required attributes are pr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_required_attributes('<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?><test required1=\\\"foo\\\" optional1=\\\"foo\\\" />', ['required1']) == True\", \"assert check_required_attributes('<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?><test required...
{ "split": "train", "index": 83469, "acecode_id": "bigcode_python_fns_25840", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings `data`, where each string represents a single character. Your task is to implement a function `count_occurrences(data)` that returns a dictionary. The keys of the dictionary should be the unique characters from the list, and the values should be ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_occurrences([\\\"a\\\", \\\"b\\\", \\\"a\\\", \\\"c\\\", \\\"b\\\", \\\"a\\\"]) == {\\\"a\\\": 3, \\\"b\\\": 2, \\\"c\\\": 1}\", \"assert count_occurrences([\\\"x\\\", \\\"y\\\", \\\"x\\\", \\\"z\\\", \\\"y\\\"]) == {\\\"x\\\": 2, \\\"y\\\": 2, \\\"z\\...
{ "split": "train", "index": 83470, "acecode_id": "oss_26462", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of words and returns a dictionary containing the frequency count of each unique word. The function should ignore case sensitivity and consider words with a minimum count specified by the user. If a word's frequency is be...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_word_frequencies(['apple', 'banana', 'Apple', 'orange', 'banana', 'banana'], 1) == {'apple': 2, 'banana': 3, 'orange': 1}\", \"assert count_word_frequencies(['hello', 'world', 'hello', 'HELLO', 'world'], 2) == {'hello': 3, 'world': 2}\", \"assert count...
{ "split": "train", "index": 83471, "acecode_id": "oss_35099", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers representing costs for different values in the domain of a variable, and a mode that can either be 'min' or 'max', implement a function `calculate_optimal_costs(domain: List[int], recv_costs: Dict[int, int], mode: str) -> Dict[int, int]` that calculates...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_optimal_costs([1], {1: 10}, 'min') == {1: 10}\", \"assert calculate_optimal_costs([2], {2: 20}, 'max') == {2: 20}\", \"assert calculate_optimal_costs([0, 5, 10], {0: 0, 5: 0, 10: 0}, 'min') == {0: 0, 5: 0, 10: 0}\", \"assert calculate_optimal_costs...
{ "split": "train", "index": 83472, "acecode_id": "bigcode_python_fns_48582", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `get_setting` that retrieves a configuration setting based on a provided setting name. The function should prioritize the following order when looking up the setting: it first checks if the setting exists in a predefined dictionary `setti...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_setting('theme', 'dark') == 'light'\", \"assert get_setting('language', 'English') == 'Spanish'\", \"assert get_setting('unknown_setting', 'fallback') == 'fallback'\", \"assert get_setting('another_setting') == None\", \"assert get_setting('theme') == 'l...
{ "split": "train", "index": 83473, "acecode_id": "bigcode_python_fns_38761", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Write a function `is_valid_palindrome_anagram(s: str) -> bool` that determines if the input string `s` can be rearranged to form a palindrome. A string can form a palindrome if at most one character has an odd count of occurrences. Your function should return `True` if the stri...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_palindrome_anagram('civic') == True\", \"assert is_valid_palindrome_anagram('ivicc') == True\", \"assert is_valid_palindrome_anagram('hello') == False\", \"assert is_valid_palindrome_anagram('A man a plan a canal Panama') == True\", \"assert is_vali...
{ "split": "train", "index": 83474, "acecode_id": "evol_15129", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Your task is to implement a function that calculates the sum of all even integers in the list and returns the result. The function should ignore any odd integers in the list. Write a Python function named `sum_of_evens` that takes a single para...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([0, 1, 2, 3, 4]) == 6\", \"assert sum_of_evens([10, 20, 30]) == 60\", \"assert sum_of_evens([-1, -2, -3, -4]) == -6\", \"assert sum_of_evens([5, 7, 9]) == 0\", \"assert sum_of_evens([]) == 0\", \"as...
{ "split": "train", "index": 83475, "acecode_id": "oss_1124", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the number of points scored by a team in each game of a season. Your task is to implement a function `calculate_average_score(points: List[int]) -> float` that computes the average score per game. The average score is defined as the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average_score([10, 20, 30]) == 20.0\", \"assert calculate_average_score([0, 0, 0]) == 0.0\", \"assert calculate_average_score([5]) == 5.0\", \"assert calculate_average_score([]) == 0.0\", \"assert calculate_average_score([100, 200, 300, 400]) == 25...
{ "split": "train", "index": 83476, "acecode_id": "bigcode_python_fns_790", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `diff_max_min_nested(d: dict) -> int` that calculates the difference between the maximum and minimum values in a given dictionary. The dictionary may contain nested dictionaries, and you should consider all values at all levels. The function should return the d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert diff_max_min_nested({'one': 1, 'two': 2, 'three': 3, 'four': {'a': 4, 'b': 5}, 'five': 5}) == 4\", \"assert diff_max_min_nested({'a': 10, 'b': {'c': 20, 'd': 5}, 'e': 15}) == 15\", \"assert diff_max_min_nested({'x': 1, 'y': {'z': 3, 'w': 4}, 'v': 10}) == 9\"...
{ "split": "train", "index": 83477, "acecode_id": "evol_7815", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Implement a function `even_odd_count(num)` that takes an integer input (which can be negative, have leading zeros, or be in binary format) and returns a tuple consisting of two integers: the first integer representing the count of even digits and the second integer representing...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert even_odd_count(123) == (1, 2)\", \"assert even_odd_count(-9876543210) == (5, 5)\", \"assert even_odd_count(11111111) == (0, 8)\", \"assert even_odd_count(999) == (0, 3)\", \"assert even_odd_count(-100101) == (3, 3)\"]}" }
{ "split": "train", "index": 83478, "acecode_id": "evol_13585", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a program to calculate the average score for a list of subjects based on their respective scores. Each subject has multiple scores associated with it. Your goal is to write a function `calculate_average_score` that takes two input parameters: a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average_score(['Math', 'Science', 'History'], [[85, 90, 95], [70, 80, 90], [100, 90, 80]]) == {'Math': 90.0, 'Science': 80.0, 'History': 90.0}\", \"assert calculate_average_score(['English', 'Art'], [[70, 85], [60, 70, 80]]) == {'English': 77.5, 'A...
{ "split": "train", "index": 83479, "acecode_id": "oss_14467", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with generating a Google Cloud Storage link based on three input parameters: channel, platform, and build. Implement a function `generate_gstorage_link(channel: str, platform: str, build: str) -> str` that takes these three parameters and returns a formatted Goog...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_gstorage_link('stable', 'linux', '1234') == 'gs://chromeos-releases/stable-channel/linux/1234/'\", \"assert generate_gstorage_link('beta', 'windows', '5678') == 'gs://chromeos-releases/beta-channel/windows/5678/'\", \"assert generate_gstorage_link('...
{ "split": "train", "index": 83480, "acecode_id": "bigcode_python_fns_31574", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a dictionary representation of a software package configuration file based on given details. The function should take the following parameters: version (string), description (string), author (string), author_email (string),...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_config_dict('1.0.0', 'My Package', 'Alice', 'alice@example.com', 'Bob', 'bob@example.com', 'http://example.com', 'MIT', ['dep1', 'dep2']) == {'version': '1.0.0', 'description': 'My Package', 'author': 'Alice', 'author_email': 'alice@example.com', 'm...
{ "split": "train", "index": 83481, "acecode_id": "oss_10558", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that specifies an optimizer and its parameters for a machine learning model. The function should take a single argument `lr` (a float representing the learning rate) and return a tuple containing the optimizer type and a dictionary of key...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_optimizer(0.01) == ('SGD', {'lr': 0.01, 'weight_decay': 1e-6, 'momentum': 0.9})\", \"assert get_optimizer(0.1) == ('SGD', {'lr': 0.1, 'weight_decay': 1e-6, 'momentum': 0.9})\", \"assert get_optimizer(0.001) == ('SGD', {'lr': 0.001, 'weight_decay': 1e-6, ...
{ "split": "train", "index": 83482, "acecode_id": "bigcode_python_fns_76", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary where the keys are strings and the values are lists of integers. Your task is to implement a function that converts this dictionary into a flat list containing all the integers from the lists corresponding to the keys. If a key has an empty list, it s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert flatten_dict({'a': [1, 2, 3], 'b': [4, 5]}) == [1, 2, 3, 4, 5]\", \"assert flatten_dict({'x': [], 'y': [10, 20, 30]}) == [10, 20, 30]\", \"assert flatten_dict({'key1': [1], 'key2': [], 'key3': [2, 3]}) == [1, 2, 3]\", \"assert flatten_dict({}) == []\", \"ass...
{ "split": "train", "index": 83483, "acecode_id": "bigcode_python_fns_49080", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string, your task is to count how many palindromic substrings in this string exist that have a length greater than 1 and are not made up of the same character repeated. Each distinct occurrence of the same substring (based on different start or end indexes) should be co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert countSubstrings('abc') == 0\", \"assert countSubstrings('aaa') == 0\", \"assert countSubstrings('a') == 0\", \"assert countSubstrings('') == 0\", \"assert countSubstrings('noon') == 1\", \"assert countSubstrings('abcba') == 2\", \"assert countSubstrings('dei...
{ "split": "train", "index": 83484, "acecode_id": "evol_28016", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are provided with a list of deposit and withdrawal operations on multiple bank accounts that all start with zero balance. Each operation is represented as a list where the first element is the account ID and the second element is the amount of money to deposit (positive) or...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert BelowZero([[1, 2], [2, -1], [2, -3]]) == (True, [2], -1.0)\", \"assert BelowZero([[1, 1], [1, 1], [1, -3]]) == (True, [1], -1.0)\", \"assert BelowZero([[1, 2], [1, 2], [1, 2], [1, 2]]) == (False, [], 8.0)\", \"assert BelowZero([[1, -1], [1, -1], [1, -1]]) ==...
{ "split": "train", "index": 83485, "acecode_id": "evol_14171", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Create a Python function that takes a list containing strings and nested lists of strings, and removes consecutive repeating characters in each string. The function should return a list with the modified strings, retaining the same structure as the original input. Inputs will c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_consecutive_repeats(['aaaaa', ['bbbb', 'cccc'], 'ddddd']) == ['a', ['b', 'c'], 'd']\", \"assert remove_consecutive_repeats(['abc', ['def', 'ghi'], 'jkl']) == ['abc', ['def', 'ghi'], 'jkl']\", \"assert remove_consecutive_repeats(['', [''], '']) == ['',...
{ "split": "train", "index": 83486, "acecode_id": "evol_4453", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Write a Python function that takes an integer n as input and returns True if n is a prime number and False otherwise. You should implement the prime checking functionality from scratch without using any prebuilt functions in Python. The function should handle edge cases such as...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_prime(0) == False\", \"assert check_prime(1) == False\", \"assert check_prime(2) == True\", \"assert check_prime(3) == True\", \"assert check_prime(4) == False\", \"assert check_prime(5) == True\", \"assert check_prime(6) == False\", \"assert check_pri...
{ "split": "train", "index": 83487, "acecode_id": "evol_21634", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a positive floating-point number, implement a function that returns the integer part of the number, which is defined as the largest integer that is less than or equal to the input number. The function should have the following signature: `def extract_integer(number: float...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_integer(4.7) == 4\", \"assert extract_integer(3.0) == 3\", \"assert extract_integer(9.99) == 9\", \"assert extract_integer(0.1) == 0\", \"assert extract_integer(2.5) == 2\", \"assert extract_integer(10.0) == 10\", \"assert extract_integer(5.999) == 5...
{ "split": "train", "index": 83488, "acecode_id": "evol_12175", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of availability details for various vessels, where each detail is represented as a dictionary containing the keys 'vessel_name', 'availability_status', and 'other_details'. Your task is to implement a function, `process_vessel_availability`, that takes this...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_vessel_availability([]) == []\", \"assert process_vessel_availability([{'vessel_name': 'Vessel A', 'availability_status': 'Available', 'other_details': 'Details A'}]) == [('Vessel A', 'Available', 'Details A')]\", \"assert process_vessel_availability...
{ "split": "train", "index": 83489, "acecode_id": "oss_30501", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of integer problem IDs and returns a dictionary where the keys are the problem IDs and the values are the corresponding simulated submissions. The submission for each problem ID is generated as a string in the format 'Su...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert retrieve_submissions([1, 2, 3]) == {1: 'Submission for problem 1', 2: 'Submission for problem 2', 3: 'Submission for problem 3'}\", \"assert retrieve_submissions([100, 101]) == {100: 'Submission for problem 100', 101: 'Submission for problem 101'}\", \"asser...
{ "split": "train", "index": 83490, "acecode_id": "oss_11342", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with categorizing tweets based on the proximity of a user to known shelters. You have a list of shelter codes and their corresponding geographical coordinates. Write a Python function `categorize_tweet(tweet, user_location)` that takes in a string `tweet` represe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert categorize_tweet('Emergency shelter set up at MNTG1 for those affected by the storm.', '40.7128,-74.0060') == True\", \"assert categorize_tweet('Looking for places to stay.', '40.7130,-74.0050') == True\", \"assert categorize_tweet('Help needed at MNTG.', '4...
{ "split": "train", "index": 83491, "acecode_id": "oss_21725", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the process of restarting a network service. The function should take a boolean input indicating whether the network service can be restarted successfully or not. If the service restarts successfully, the function should re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert restart_network(True) == 'Network is back'\", \"assert restart_network(False) == 'Network restart failed'\", \"assert restart_network(False) == 'Network restart failed'\", \"assert restart_network(True) == 'Network is back'\", \"assert restart_network(False)...
{ "split": "train", "index": 83492, "acecode_id": "bigcode_python_fns_17843", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists of integers, `received_packets` and `lost_packets`, representing the packets received and the packets lost in a particular tensor plane. Each packet is represented by its unique identifier (an integer). You need to create a function that finds the neares...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_neighbors([1, 2, 4, 5], [3]) == {((2, 4)): [3]}\", \"assert find_neighbors([1, 2, 3], [0]) == {((-1, 1)): [0]}\", \"assert find_neighbors([1, 2, 3], [4]) == {((3, -1)): [4]}\", \"assert find_neighbors([1, 3], [2]) == {((1, 3)): [2]}\", \"assert find_nei...
{ "split": "train", "index": 83493, "acecode_id": "bigcode_python_fns_46928", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing the HTML content of a web page. Your task is to extract all the static asset links from this HTML content. A static asset link can be found in 'script' tags (with a 'src' attribute), 'img' tags (with a 'src' attribute), and 'link' tags (with ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_static_links('<html><head><link href=\\\"/static/style.css\\\"></head><body><script src=\\\"/static/app.js\\\"></script><img src=\\\"/static/image.png\\\"></body></html>') == ['/static/style.css', '/static/app.js', '/static/image.png']\", \"assert ex...
{ "split": "train", "index": 83494, "acecode_id": "bigcode_python_fns_22510", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with processing a block of text data formatted as follows: the first line contains a comma-separated list of integers, where the last integer represents the mode group. The second line contains a comma-separated list of integers, where the last integer indicates ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_data('1,2,3,4\\\\n5,6,7,8\\\\n3\\\\na,b,c\\\\nd,e,f\\\\ng,h,i') == (4, 8, [['a', 'b', 'c'], ['d', 'e', 'f'], ['g', 'h', 'i']])\", \"assert process_data('10,20,30,40\\\\n50,60,70,80\\\\n2\\\\nx,y,z\\\\na,b,c') == (40, 80, [['x', 'y', 'z'], ['a', 'b', ...
{ "split": "train", "index": 83495, "acecode_id": "oss_32130", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Define a function `second_smallest(lst)` that accepts a list `lst` containing a mix of integers, floating point numbers, and strings. The function should identify and return the second smallest numerical value from the list. If the list does not contain at least two numerical v...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert second_smallest([3, 1, 2]) == 2\", \"assert second_smallest([10, 20, 5, 15]) == 10\", \"assert second_smallest([-1, -2, -3]) == -2\", \"assert second_smallest([7, 8, 'a', 6]) == 7\", \"assert second_smallest(['x', 'y', 5.5, 3.2, 3.1]) == 3.2\", \"assert seco...
{ "split": "train", "index": 83496, "acecode_id": "evol_28061", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a multi-dimensional shape for a blob based on specific dimensions. The function should take the following parameters: `batch_len`, `batch_width`, `list_size`, `channels`, and `dtype`. The `dtype` can only be 'float32' or 'i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_blob_shape(1, 1, 1, 1, 'float32') == (1, 1, 1, 1, 1, 1, 1)\", \"assert generate_blob_shape(2, 3, 4, 5, 'int32') == (2, 3, 4, 1, 1, 1, 5)\", \"assert generate_blob_shape(10, 10, 10, 10, 'float32') == (10, 10, 10, 1, 1, 1, 10)\", \"assert generate_blo...
{ "split": "train", "index": 83497, "acecode_id": "bigcode_python_fns_21813", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of n integers, where each integer is in the range 1 to n inclusive. However, one integer is missing from the list. Your task is to find and return the missing integer. Write a function `find_missing_integer` that takes in a list of n-1 integers and returns ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_missing_integer([3, 7, 1, 2, 8, 4, 5]) == 6\", \"assert find_missing_integer([1, 2, 3, 5]) == 4\", \"assert find_missing_integer([1]) == 2\", \"assert find_missing_integer([2, 3, 4, 5, 6]) == 1\", \"assert find_missing_integer([4, 1, 3]) == 2\", \"asser...
{ "split": "train", "index": 83498, "acecode_id": "oss_15363", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Write a Python function to return a list of all Mondays between two provided dates. The function should take two string parameters, `start_date` and `end_date`, in the format 'MM/DD/YYYY'.\nPlease reason step by step, then write a self-contained Python solution. Give your final...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert all_mondays('01/01/2020', '12/31/2020') == ['01/06/2020', '01/13/2020', '01/20/2020', '01/27/2020', '02/03/2020', '02/10/2020', '02/17/2020', '02/24/2020', '03/02/2020', '03/09/2020', '03/16/2020', '03/23/2020', '03/30/2020', '04/06/2020', '04/13/2020', '04/...
{ "split": "train", "index": 83499, "acecode_id": "evol_31662", "num_tests": 16 }