data_source
large_stringclasses
1 value
prompt
listlengths
1
1
ability
large_stringclasses
1 value
reward_model
dict
extra_info
dict
acecode
[ { "role": "user", "content": "You are given two lists, `m_t` and `Vdc_t`, representing time intervals and corresponding DC voltages respectively. Your task is to implement a function that generates a new list representing the terminal voltage of an inverter at each time interval. The terminal voltage is cal...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert inverter_terminal_voltage([1.0, 2.0, 3.0], [4.0, 5.0, 6.0]) == [2.0, 5.0, 9.0]\", \"assert inverter_terminal_voltage([0.0, 0.0], [10.0, 20.0]) == [0.0, 0.0]\", \"assert inverter_terminal_voltage([1.0], [10.0]) == [5.0]\", \"assert inverter_terminal_voltage([...
{ "split": "train", "index": 4700, "acecode_id": "bigcode_python_fns_40514", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of integers, and you need to implement a function that returns a new list containing only the unique elements from the original list, preserving the order of their first appearance. Write a function `get_unique_elements(arr: List[int]) -> List[int]:` where ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_elements([1, 2, 2, 3, 4, 1]) == [1, 2, 3, 4]\", \"assert get_unique_elements([5, 5, 5, 5]) == [5]\", \"assert get_unique_elements([10, 20, 10, 30, 20]) == [10, 20, 30]\", \"assert get_unique_elements([]) == []\", \"assert get_unique_elements([1, 2...
{ "split": "train", "index": 4701, "acecode_id": "bigcode_python_fns_5864", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string, write a function that counts the occurrence of a specific substring formed by consecutive characters. Implement the function `count_occurrences(text: str, pattern: str) -> int` that takes in a string `text` and a substring `pattern`, and returns the number of ti...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_occurrences('abcxyzxyzxyzxyzabcxyz', 'xyz') == 5\", \"assert count_occurrences('hello world', 'world') == 1\", \"assert count_occurrences('abcdefgh', 'xyz') == 0\", \"assert count_occurrences('xyzxyzzyivxyzfxyibxyzklmnoxyzpqrstu', 'xyz') == 5\", \"asse...
{ "split": "train", "index": 4702, "acecode_id": "evol_36067", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to implement a function that validates if a given parent object is an instance of a specified interface, `ChildInterface`. If the parent is None, the function should return without any error. If the parent is not None, it should raise a ValueError if the parent is not ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_parent_instance(None) is None\", \"assert validate_parent_instance(ChildInterface()) is None\", \"assert validate_parent_instance(ChildInterface()) is None\", \"assert validate_parent_instance(ChildInterface()) is None\", \"assert validate_parent_in...
{ "split": "train", "index": 4703, "acecode_id": "bigcode_python_fns_16063", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function that calculates the average value of a given list of numbers. If the list is empty, the function should return 'Error: The list is empty.' If the list contains any non-numeric values, the function should return 'Error: The list may contain a non-numeric val...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average([1, 2, 3, 4, 5]) == 3.0\", \"assert calculate_average([]) == 'Error: The list is empty.'\", \"assert calculate_average(['a', 1, 2]) == 'Error: The list may contain a non-numeric value.'\", \"assert calculate_average([10, 20, 30]) == 20.0\",...
{ "split": "train", "index": 4704, "acecode_id": "evol_23832", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that extracts plain text from a given HTML string by removing all HTML tags. The function should take a single parameter, `content`, which is a string representing the HTML content. Your task is to write a function that removes...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_plain_text('<h1>Welcome</h1>') == 'Welcome'\", \"assert extract_plain_text('<p>This is a <b>bold</b> statement.</p>') == 'This is a bold statement.'\", \"assert extract_plain_text('<ul><li>Item 1</li><li>Item 2</li></ul>') == 'Item 1Item 2'\", \"asse...
{ "split": "train", "index": 4705, "acecode_id": "oss_3710", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a string containing JSON data and performs specific operations based on the content. Your function should handle potential errors that may arise during the JSON data processing. You need to implement a function `proc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_json_string('{\\\"key\\\": \\\"value\\\"}') == {'key': 'value'}\", \"assert process_json_string('{\\\"name\\\": \\\"John\\\", \\\"age\\\": 30}') == {'name': 'John', 'age': 30}\", \"assert process_json_string('{\\\"array\\\": [1, 2, 3]}') == {'array':...
{ "split": "train", "index": 4706, "acecode_id": "oss_22430", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a dictionary that represents the variable types and their corresponding types from a database, as well as a list of entity variable types. Your task is to create a function that takes in a list of variable types and a dictionary of variable types mapping, and retu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_variable_types(['CATEGORICAL', 'SCALAR', 'DATETIME', 'TEXT'], {'CATEGORICAL': 'CATEGORICAL', 'SCALAR': 'SCALAR', 'DATETIME': 'DATETIME', 'TEXT': 'TEXT'}) == ['CATEGORICAL', 'SCALAR', 'DATETIME', 'TEXT']\", \"assert update_variable_types(['SCALAR', 'TE...
{ "split": "train", "index": 4707, "acecode_id": "bigcode_python_fns_14735", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a string `word` consisting of lowercase English letters and a character `ch`. Your task is to reverse the substring of `word` starting from the beginning of `word` up to and including the first occurrence of `ch`. After reversing this substring, concatenate it wit...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reversePrefix('abcdefd', 'd') == 'dcbaefd'\", \"assert reversePrefix('xyxzxe', 'z') == 'zxyxxe'\", \"assert reversePrefix('abcd', 'z') == 'abcd'\", \"assert reversePrefix('a', 'a') == 'a'\", \"assert reversePrefix('abc', 'c') == 'cba'\", \"assert reversePref...
{ "split": "train", "index": 4708, "acecode_id": "oss_20508", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Write a function `sum_of_squares` that takes five integers as input and returns the sum of the squares of these integers. The function should be defined as follows: `def sum_of_squares(a: int, b: int, c: int, d: int, e: int) -> int:`. For example, given the inputs 3, 0, 7, 2, a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_squares(3, 0, 7, 2, 8) == 126\", \"assert sum_of_squares(1, 1, 1, 1, 1) == 5\", \"assert sum_of_squares(-1, -1, -1, -1, -1) == 5\", \"assert sum_of_squares(0, 0, 0, 0, 0) == 0\", \"assert sum_of_squares(2, 2, 2, 2, 2) == 20\", \"assert sum_of_squares(...
{ "split": "train", "index": 4709, "acecode_id": "evol_1476", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a class `TransactionData` that contains a `payment_id` field, which can either be an 8-byte encrypted payment ID or a 32-byte plain text payment ID. Your task is to implement a function `process_payment_id(payment_id: bytes) -> bytearray` that takes this payment I...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_payment_id(b'') == bytearray()\", \"assert process_payment_id(b'12345678') == bytearray([2, 9, 1]) + b'12345678'\", \"assert process_payment_id(b'12345678123456781234567812345678') == bytearray([2, 33, 0]) + b'12345678123456781234567812345678'\", \"a...
{ "split": "train", "index": 4710, "acecode_id": "bigcode_python_fns_22218", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given two lists of integers, `train_data` and `extra_data`, representing two sets of training data. Your task is to merge these two lists into a single list called `data`. Additionally, you are provided with two lists of integers, `train_label` and `extra_label`, repres...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_data([1, 2, 3], [0, 1, 0], [4, 5], [1, 2]) == ([1, 2, 3, 4, 5], [0, 1, 0, 1, 2])\", \"assert merge_data([], [], [], []) == ([], [])\", \"assert merge_data([1], [0], [2], [1]) == ([1, 2], [0, 1])\", \"assert merge_data([1, 3], [0, 1], [2], [1]) == ([1, ...
{ "split": "train", "index": 4711, "acecode_id": "bigcode_python_fns_16161", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of tuples, where each tuple represents a Wyckoff site. Each tuple contains two elements: a list of positions and an integer indicating the multiplicity of that site. Your task is to implement a function `choose_wyckoff_sites(wyckoffs: List[Tuple[List[int], ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert choose_wyckoff_sites([([1, 2], 2), ([3], 1)], 2) == [1, 2]\", \"assert choose_wyckoff_sites([([1, 2], 1), ([3, 4, 5], 2)], 3) == [3, 4, 5]\", \"assert choose_wyckoff_sites([([1, 2], 2), ([3, 4], 2), ([5, 6, 7], 3)], 2) == [1, 2]\", \"assert choose_wyckoff_si...
{ "split": "train", "index": 4712, "acecode_id": "bigcode_python_fns_23956", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with developing a function that processes a list of timestamps representing the start and end of multiple time intervals. Your function should determine if any of the intervals overlap. An interval is represented as a tuple of two integers, where the first intege...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert has_overlap([(1, 3), (2, 4), (5, 7)]) == True\", \"assert has_overlap([(1, 2), (3, 4), (5, 6)]) == False\", \"assert has_overlap([(1, 5), (2, 3), (4, 6)]) == True\", \"assert has_overlap([(1, 2), (2, 3), (3, 4)]) == False\", \"assert has_overlap([(1, 4), (2,...
{ "split": "train", "index": 4713, "acecode_id": "bigcode_python_fns_11929", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a non-negative integer `num_warmup_steps`, implement a function `get_learning_rate_schedule(current_step: int, num_warmup_steps: int) -> float` that returns the learning rate factor for a training step. The learning rate should increase linearly from 0 to 1 during the war...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_learning_rate_schedule(0, 10) == 0.0\", \"assert get_learning_rate_schedule(1, 10) == 0.1\", \"assert get_learning_rate_schedule(5, 10) == 0.5\", \"assert get_learning_rate_schedule(10, 10) == 1.0\", \"assert get_learning_rate_schedule(11, 10) == 1.0\", ...
{ "split": "train", "index": 4714, "acecode_id": "bigcode_python_fns_29437", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks if the number of recipients matches the effective length of a PDF given its length and a starting page index. The effective length of the PDF is calculated by subtracting the starting page index from the total PDF length. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_pdf_length(10, 2, 8) == True\", \"assert check_pdf_length(5, 0, 5) == True\", \"assert check_pdf_length(20, 5, 15) == True\", \"assert check_pdf_length(15, 3, 12) == True\", \"assert check_pdf_length(8, 2, 6) == True\", \"assert check_pdf_length(12, 0,...
{ "split": "train", "index": 4715, "acecode_id": "oss_22731", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with monitoring the response times of a web service. Write a function `average_response_time(response_times: List[int]) -> float` that takes a list of integers representing the response times in milliseconds and returns the average response time as a float. If th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_response_time([100, 200, 300]) == 200.0\", \"assert average_response_time([0, 0, 0]) == 0.0\", \"assert average_response_time([123]) == 123.0\", \"assert average_response_time([]) == 0.0\", \"assert average_response_time([500, 1000]) == 750.0\", \"as...
{ "split": "train", "index": 4716, "acecode_id": "oss_10287", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing values in a dictionary, where the index of each integer represents its key. You need to implement a function that allows you to perform two types of operations: 1) Update a range of keys with a new value raised to a specified power,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert perform_operations([1, 1, 1, 1, 1], [('U', [0, 4, 2]), ('C', [0, 4])], 10) == [5]\", \"assert perform_operations([5, 6], [('C', [0, 1])], 50) == [11]\", \"assert perform_operations([0, 1, 2, 3], [('U', [0, 1, 1]), ('C', [0, 1])], 10) == [1]\", \"assert perfo...
{ "split": "train", "index": 4717, "acecode_id": "bigcode_python_fns_13088", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the process of transferring a message over a serial communication channel. The function `simulate_transfer` should take a string `message` and a maximum buffer size `buffer_size`. The function should return a list of st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_transfer('Hello, World!', 5) == ['Hello', ', Wor', 'ld!', '']\", \"assert simulate_transfer('Python', 3) == ['Pyt', 'hon']\", \"assert simulate_transfer('', 10) == []\", \"assert simulate_transfer('LeetCode', 8) == ['LeetCode']\", \"assert simulate_...
{ "split": "train", "index": 4718, "acecode_id": "oss_2732", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are given a list of tuples representing p-values associated with genetic variants across multiple batches. Each tuple contains a variant ID and its corresponding p-value. Implement a function `filter_variants` that takes the following parameters: `variants` (List[Tuple[str,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_variants([('var1', 0.05), ('var2', 0.01), ('var3', 0.03)], 0.03) == ['var2', 'var3']\", \"assert filter_variants([('var1', 0.1), ('var2', 0.2), ('var3', 0.5)], 0.01) == []\", \"assert filter_variants([('var1', 0.01), ('var2', 0.01), ('var3', 0.01)], 0...
{ "split": "train", "index": 4719, "acecode_id": "bigcode_python_fns_13794", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary representing a context, which contains various keys and values. One of the keys in the context is 'env', which itself is a dictionary containing nested keys. You need to implement a function that checks if a specific key exists in the 'env' dictionary...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert env_key_exists({'env': {'key1': 'value1', 'key2': 'value2'}}, 'key1') == True\", \"assert env_key_exists({'env': {'key1': 'value1', 'key2': 'value2'}}, 'key3') == False\", \"assert env_key_exists({'env': {}}, 'key1') == False\", \"assert env_key_exists({'env...
{ "split": "train", "index": 4720, "acecode_id": "bigcode_python_fns_33180", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary called 'potential' which contains parameters associated with different handlers. Each parameter is represented as a dictionary with the parameter name as the key and its value in a specific unit as the value. Your task is to implement a function that ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_parameter_value({'temperature': {'C': 25}}, 'temperature', 'C') == 25.0\", \"assert get_parameter_value({'pressure': {'Pa': 101325}}, 'pressure', 'Pa') == 101325.0\", \"assert get_parameter_value({}, 'temperature', 'C') == None\", \"assert get_parameter_...
{ "split": "train", "index": 4721, "acecode_id": "bigcode_python_fns_47749", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Implement a function that finds the optimal leftmost index to insert a given value into a sorted list while maintaining the sorted order. The function should be able to handle lists sorted in ascending or descending order, lists with repeated values, and mixed data types (inclu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_insertion_point([1, 3, 5, 7], 4) == 2\", \"assert find_insertion_point([1, 3, 5, 7], 8) == 4\", \"assert find_insertion_point([7, 5, 3, 1], 4) == 2\", \"assert find_insertion_point([7, 5, 3, 1], 0) == 4\", \"assert find_insertion_point(['apple', 'banana...
{ "split": "train", "index": 4722, "acecode_id": "evol_21412", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a list of house records, each represented as a dictionary containing the following keys: 'id', 'date', 'price', 'bedrooms', 'bathrooms', 'sqft_living', 'sqft_lot', 'floors', 'waterfront', 'view', 'condition', 'grade', 'sqft_above', 'sqft_basement', 'yr_built', 'yr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_houses([{'id': 1, 'date': 20210101, 'price': 500000, 'bedrooms': 3, 'bathrooms': 2, 'sqft_living': 2000, 'sqft_lot': 5000, 'floors': 2, 'waterfront': 0, 'view': 1, 'condition': 3, 'grade': 7, 'sqft_above': 1500, 'sqft_basement': 500, 'yr_built': 2000,...
{ "split": "train", "index": 4723, "acecode_id": "bigcode_python_fns_16660", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Your task is to write a function that takes this list as input and returns a new list that contains the squares of each integer from the input list. The output list should maintain the same order as the input list. Write a function named `squar...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert square_numbers([1, -2, 3]) == [1, 4, 9]\", \"assert square_numbers([0]) == [0]\", \"assert square_numbers([-1, -1, -1]) == [1, 1, 1]\", \"assert square_numbers([]) == []\", \"assert square_numbers([5, 10, 15]) == [25, 100, 225]\", \"assert square_numbers([-5...
{ "split": "train", "index": 4724, "acecode_id": "bigcode_python_fns_25144", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that calculates the minimum total cost of a list of products after applying a series of discounts in an optimal order. The function should take two parameters: `product_prices`, a list of integers representing the original prices of the p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_minimal_cost([100, 150, 200], [0, 0, 0]) == 450\", \"assert calculate_minimal_cost([100], [100]) == 0\", \"assert calculate_minimal_cost([500], [0]) == 500\", \"assert calculate_minimal_cost([100, 200, 300, 400, 500], [0, 0, 0, 0]) == 1500\", \"ass...
{ "split": "train", "index": 4725, "acecode_id": "evol_22463", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `can_build_model(master_config)` that determines whether a machine learning model can be built based on a given configuration. The function should take a dictionary `master_config` as input, which contains the following keys: 'Core_Co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_build_model({'Core_Config': {'Model_Config': {'model_type': 'linear_regression'}}}) == True\", \"assert can_build_model({'Core_Config': {'Model_Config': {'model_type': 'neural_network'}}}) == True\", \"assert can_build_model({'Core_Config': {'Model_Confi...
{ "split": "train", "index": 4726, "acecode_id": "bigcode_python_fns_5277", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes two lists of dependencies for a software package. The function should take in two lists of strings representing required dependencies and testing dependencies, and return a dictionary with the categorized dependencie...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_dependencies(['requests>=1.2.0', 'lxml', 'python-dateutil', 'pyOpenSSL'], ['nose', 'unittest2', 'mock']) == {'install_requires': ['requests>=1.2.0', 'lxml', 'python-dateutil', 'pyOpenSSL'], 'tests_require': ['nose', 'unittest2', 'mock']}\", \"assert ...
{ "split": "train", "index": 4727, "acecode_id": "oss_37217", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a distance in meters. Write a function that converts this distance into various units: kilometers, hectometers, decameters, decimeters, centimeters, and millimeters. The conversion factors are as follows: 1 kilometer (km) = 1000 meters, 1 hectometer (hect) = 100 m...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_distance(250) == {'km': 0.25, 'hect': 2.5, 'deca': 25.0, 'deci': 2500.0, 'cm': 25000.0, 'mm': 250000.0}\", \"assert convert_distance(1000) == {'km': 1.0, 'hect': 10.0, 'deca': 100.0, 'deci': 10000.0, 'cm': 100000.0, 'mm': 1000000.0}\", \"assert conve...
{ "split": "train", "index": 4728, "acecode_id": "oss_24735", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with reading a configuration file and returning its contents as a dictionary. The configuration file is in a specific format where each section is indicated by square brackets (e.g., [section1]), and each section contains key-value pairs separated by an equals si...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_config(['[section1]', 'key1=value1', 'key2=value2']) == {'section1': {'key1': 'value1', 'key2': 'value2'}}\", \"assert parse_config(['[section1]', 'key1=value1', '[section2]', 'key2=value2']) == {'section1': {'key1': 'value1'}, 'section2': {'key2': 'va...
{ "split": "train", "index": 4729, "acecode_id": "bigcode_python_fns_14776", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that handles exceptions when a certain condition is met. The function should take in a string message and a boolean flag indicating whether an error occurred. If the error flag is set to True, the function should return a JSON-like dictio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert handle_exception('Test error', True) == {'status_code': 400, 'content': {'message': \\\"Something bad happened Test error\\\"}}\", \"assert handle_exception('All good', False) == {'status_code': 200, 'content': {'message': \\\"Everything is okay All good\\\"...
{ "split": "train", "index": 4730, "acecode_id": "bigcode_python_fns_8720", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to synchronize data from a central storage to a local database model. The local database model is represented as a list of data entries, where each entry is a dictionary containing an 'id' and a 'value'. Your goal is to update the loc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert synchronize_data([], []) == []\", \"assert synchronize_data([], [{'id': 1, 'value': 'A'}]) == [{'id': 1, 'value': 'A'}]\", \"assert synchronize_data([{'id': 1, 'value': 'A'}], []) == [{'id': 1, 'value': 'A'}]\", \"assert synchronize_data([{'id': 1, 'value': ...
{ "split": "train", "index": 4731, "acecode_id": "oss_33429", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a list of coordinates and calculates the distance of each coordinate from the origin (0, 0). The coordinates are provided as a list of strings, where each string represents a pair of coordinates in the format 'x y'. You...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_distances(['1 1', '3 4', '0 0', '5 12']) == [1.41, 5.0, 0.0, 13.0]\", \"assert calculate_distances(['2 2', '6 8', '9 12']) == [2.83, 10.0, 15.0]\", \"assert calculate_distances(['-1 -1', '-3 -4', '-5 -12']) == [1.41, 5.0, 13.0]\", \"assert calculat...
{ "split": "train", "index": 4732, "acecode_id": "oss_34886", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given three points v1, v2, and v3 that define the vertices of a triangle in a 2D plane, and a point pt, write a function `is_point_in_triangle(pt: Tuple[float, float], v1: Tuple[float, float], v2: Tuple[float, float], v3: Tuple[float, float]) -> bool` that returns True if the p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_point_in_triangle((0.5, 0.5), (0, 0), (1, 0), (0, 1)) == True\", \"assert is_point_in_triangle((0, 0), (0, 0), (1, 0), (0, 1)) == True\", \"assert is_point_in_triangle((0.5, 0.5), (0, 0), (0, 1), (1, 1)) == True\", \"assert is_point_in_triangle((0.5, 0), ...
{ "split": "train", "index": 4733, "acecode_id": "bigcode_python_fns_20045", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function `decimal_bucket_sort(arr)` that sorts a list of floating-point numbers in the range [0, 1) using the Bucket Sort algorithm. The function should arrange the numbers in ascending order based on their decimal values. The input `arr` is a list of floats, and th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert decimal_bucket_sort([0.4, 0.8, 0.3, 0.5, 0.2]) == [0.2, 0.3, 0.4, 0.5, 0.8]\", \"assert decimal_bucket_sort([0.1, 0.9, 0.5, 0.6, 0.3]) == [0.1, 0.3, 0.5, 0.6, 0.9]\", \"assert decimal_bucket_sort([0.5, 0.5, 0.5]) == [0.5, 0.5, 0.5]\", \"assert decimal_bucket...
{ "split": "train", "index": 4734, "acecode_id": "evol_12517", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing a collection of web server requests. Each request has the following attributes: 'request_type', 'status', 'reception_datetime', 'commit_datetime', and 'request_body'. Your goal is to implement a function `manage_requests` that takes a list of reques...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_requests([{'request_type': 'GET', 'status': 'Pending', 'reception_datetime': '2022-01-01 12:00:00', 'commit_datetime': '2022-01-01 12:05:00', 'request_body': '...'}, {'request_type': 'POST', 'status': 'Completed', 'reception_datetime': '2022-01-02 08:...
{ "split": "train", "index": 4735, "acecode_id": "oss_4781", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given two numbers x and y, implement a function that returns the sum of these two numbers plus 7. The function should handle cases where the inputs are not numbers, returning None in such cases. Ensure to include a docstring that describes the function's purpose, parameters, an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_values_and_seven(1, 2) == 10\", \"assert add_values_and_seven(0, 0) == 7\", \"assert add_values_and_seven(-1, -1) == 5\", \"assert add_values_and_seven(3.5, 2.5) == 13\", \"assert add_values_and_seven(100, 200) == 307\", \"assert add_values_and_seven(-5,...
{ "split": "train", "index": 4736, "acecode_id": "evol_29610", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that removes all spaces from a given string. The function should take a single string input and return the modified string without any spaces, regardless of where the spaces are located (beginning, in-between, or at the end).\nPlease reason step by step, th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert strip_spaces(' Hello World ') == 'HelloWorld'\", \"assert strip_spaces(' OpenAI GPT-3 ') == 'OpenAIGPT-3'\", \"assert strip_spaces(' Spaces everywhere ') == 'Spaceseverywhere'\", \"assert strip_spaces('NoSpacesHere') == 'NoSpacesHere'\", \"assert strip_...
{ "split": "train", "index": 4737, "acecode_id": "evol_34025", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `content`, write a function `generate_short_sentence(content: str) -> str` that generates a random sentence based on the input string. The generated sentence must be no longer than 200 characters. The function should utilize a Markov Chain model with a state size...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_short_sentence('the quick brown fox jumps over the lazy dog') is not None\", \"assert len(generate_short_sentence('the quick brown fox jumps over the lazy dog')) <= 200\", \"assert generate_short_sentence('a man and a woman were walking down the str...
{ "split": "train", "index": 4738, "acecode_id": "bigcode_python_fns_46228", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a list of strings, implement a function that removes any non-alphanumeric characters from each string and then sorts the list in ascending order based on the number of unique words in each string. The words are separated by spaces. Return the sorted list.\nPlease reason s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert arrange_elements(['!@#$%', 'word1 word2', 'word1 word1 word2']) == ['!@#$%', 'word1 word2', 'word1 word1 word2']\", \"assert arrange_elements(['one two', 'three four five', 'six']) == ['six', 'one two', 'three four five']\", \"assert arrange_elements(['a', '...
{ "split": "train", "index": 4739, "acecode_id": "evol_3724", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that processes a list of tuples, where each tuple contains two elements. Your function should extract and return a new list containing the second elements from each tuple in the input list. If the input list is empty, the funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_second_elements([]) == []\", \"assert extract_second_elements([('a', 1)]) == [1]\", \"assert extract_second_elements([('b', 2), ('c', 3)]) == [2, 3]\", \"assert extract_second_elements([('d', 4), ('e', 5), ('f', 6)]) == [4, 5, 6]\", \"assert extract_...
{ "split": "train", "index": 4740, "acecode_id": "oss_1222", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `generate_primes(n: int) -> List[int]` that generates a list of all prime numbers in ascending order up to a specified number `n` (inclusive). A prime number is defined as a natural number greater than 1 that cannot be formed by multiplying two smaller natural ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_primes(1) == []\", \"assert generate_primes(2) == [2]\", \"assert generate_primes(3) == [2, 3]\", \"assert generate_primes(10) == [2, 3, 5, 7]\", \"assert generate_primes(20) == [2, 3, 5, 7, 11, 13, 17, 19]\", \"assert generate_primes(30) == [2, 3, ...
{ "split": "train", "index": 4741, "acecode_id": "evol_1229", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that calculates the least common multiple (LCM) of two distinct positive integers, x and y. The function should return an integer that represents the smallest common multiple of the two numbers. You can assume that the inputs will always be distinct positive in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert smallest_common_multiple(5, 3) == 15\", \"assert smallest_common_multiple(15, 25) == 75\", \"assert smallest_common_multiple(7, 9) == 63\", \"assert smallest_common_multiple(12, 15) == 60\", \"assert smallest_common_multiple(8, 12) == 24\", \"assert smallest...
{ "split": "train", "index": 4742, "acecode_id": "evol_35725", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Your task is to implement a function `process_numbers(nums: List[int]) -> Tuple[int, int, int]` that returns a tuple containing three values: the sum of the numbers, the maximum number, and the minimum number from the list. You can assume that ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_numbers([1, 2, 3]) == (6, 3, 1)\", \"assert process_numbers([-1, -2, -3]) == (-6, -1, -3)\", \"assert process_numbers([0, 0, 0]) == (0, 0, 0)\", \"assert process_numbers([5]) == (5, 5, 5)\", \"assert process_numbers([-5, 5]) == (0, 5, -5)\", \"assert...
{ "split": "train", "index": 4743, "acecode_id": "oss_34804", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string `center_e` which can either be 'trough' or 'peak'. Based on the value of `center_e`, you need to return a tuple containing two lists: the first list should contain labels based on the value of `center_e`, and the second list should contain corresponding k...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert _infer_labels('trough') == (['Trough', 'Peak', 'Inflection'], ['sample_trough', 'sample_next_peak', 'sample_end'])\", \"assert _infer_labels('peak') == (['Peak', 'Trough', 'Inflection'], ['sample_peak', 'sample_next_trough', 'sample_end'])\", \"assert _infer...
{ "split": "train", "index": 4744, "acecode_id": "bigcode_python_fns_38999", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that adds necessary Cross-Origin Resource Sharing (CORS) headers to an HTTP response for a web server application. Your function should accept no parameters and must add the following headers to the response: 1. 'Access-Control-Allow-...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert addCorsHeaders() == {'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS', 'Access-Control-Allow-Headers': 'Content-Type, Authorization'}\", \"assert addCorsHeaders() is not None\", \"assert 'Access-Control-Al...
{ "split": "train", "index": 4745, "acecode_id": "oss_28808", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing the results of a competition where each result entry is formatted as 'name:score', separated by commas. Your task is to implement a function that takes this string and returns a list of the top 'n' competitors sorted by their scores in descen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert top_competitors('Alice:100,Bob:200,Charlie:150', 2) == ['Bob', 'Charlie']\", \"assert top_competitors('Alice:100,Bob:200,Charlie:150', 3) == ['Bob', 'Charlie', 'Alice']\", \"assert top_competitors('Alice:100,Bob:100,Charlie:100', 2) == ['Alice', 'Bob']\", \"...
{ "split": "train", "index": 4746, "acecode_id": "bigcode_python_fns_36673", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a sorted list of integers. Your task is to implement a function that returns the median value of the list. The median is defined as the middle value in an ordered integer list. If the list has an odd number of elements, return the middle element. If the list has a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_median([1, 3, 5, 7, 9]) == 5\", \"assert find_median([1, 2, 3, 4, 5, 6]) == 3.5\", \"assert find_median([2, 4, 6]) == 4\", \"assert find_median([10, 20, 30, 40]) == 25.0\", \"assert find_median([1]) == 1\", \"assert find_median([1, 2]) == 1.5\", \"asser...
{ "split": "train", "index": 4747, "acecode_id": "oss_24398", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string, write a function `duplicate_characters(string)` that returns a list of characters that appear more than once in the string. The characters in the output list should be unique and should maintain the order of their first appearance in the input string. The functi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert duplicate_characters('hello') == ['l']\", \"assert duplicate_characters('abcdefg') == []\", \"assert duplicate_characters('aA') == []\", \"assert duplicate_characters('112233') == ['1', '2', '3']\", \"assert duplicate_characters('') == []\", \"assert duplica...
{ "split": "train", "index": 4748, "acecode_id": "evol_549", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Write a function that translates an input string containing a Hindi numeral in lowercase, ranging from 'एक' to 'नौ', back to its integer equivalent. The function should return the corresponding integer value of the given Hindi numeral string. The input will always be a valid nu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert hindi_to_int('\\u090f\\u0915') == 1\", \"assert hindi_to_int('\\u0926\\u094b') == 2\", \"assert hindi_to_int('\\u0924\\u0940\\u0928') == 3\", \"assert hindi_to_int('\\u091a\\u093e\\u0930') == 4\", \"assert hindi_to_int('\\u091b\\u0939') == 6\", \"assert hind...
{ "split": "train", "index": 4749, "acecode_id": "evol_10964", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing a list of devices in a network automation script. Each device is represented by a string name. Your task is to implement a function called `manageDevices` that takes two parameters: a list of device names and a command string. The command can either...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manageDevices(['Device1', 'Device2'], 'add', 'Device3') == ['Device1', 'Device2', 'Device3']\", \"assert manageDevices(['Device1', 'Device2'], 'remove', 'Device2') == ['Device1']\", \"assert manageDevices(['Device1', 'Device2'], 'remove', 'Device3') == ['Dev...
{ "split": "train", "index": 4750, "acecode_id": "oss_5599", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing page directories, where each entry in the list is a category or a page name. Your task is to convert this list into a single string that represents a file name. The format for the file name should be: 'category1_._category2_._page', ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert page_dirs_to_file_name(['Category1', 'Category2', 'Page']) == 'Category1_._Category2_._Page'\", \"assert page_dirs_to_file_name([' Category1 ', ' Category2 ', ' Page ']) == 'Category1_._Category2_._Page'\", \"assert page_dirs_to_file_name(['Category1',...
{ "split": "train", "index": 4751, "acecode_id": "bigcode_python_fns_27582", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Write a function that takes two lists of strings and returns a list of strings that are present in both lists. The output list should contain unique strings only and should be sorted in alphabetical order.\nPlease reason step by step, then write a self-contained Python solution...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert common_strings(['cat', 'dog', 'mouse', 'bird'], ['mouse', 'elephant', 'bee']) == ['mouse']\", \"assert common_strings(['apple', 'banana', 'cherry'], ['banana', 'cherry', 'date']) == ['banana', 'cherry']\", \"assert common_strings(['a', 'b', 'c'], ['d', 'e', ...
{ "split": "train", "index": 4752, "acecode_id": "evol_26744", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the average temperature from two temperature values given in a specific format. The temperature values are provided as 16-bit integers, where each unit represents 0.1 degrees Celsius. You need to implement a function that takes two integers as in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_temperature(200, 300) == 25.0\", \"assert average_temperature(100, 400) == 25.0\", \"assert average_temperature(0, 0) == 0.0\", \"assert average_temperature(150, 150) == 15.0\", \"assert average_temperature(255, 255) == 25.5\", \"assert average_tempe...
{ "split": "train", "index": 4753, "acecode_id": "oss_21037", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a string representing a URL-encoded query string. Your task is to decode this string and return the decoded version. The decoding process involves replacing '%2B' with '+', and decoding any other percent-encoded characters (e.g., '%20' to space). The input string ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert decode_query_string('Hello%20World%21') == 'Hello World!'\", \"assert decode_query_string('%2BHello%2B%20World%2B') == '+Hello+ World+'\", \"assert decode_query_string('Test%3A%20Value%20with%20spaces%20and%20%2Bplus%20signs') == 'Test: Value with spaces and...
{ "split": "train", "index": 4754, "acecode_id": "bigcode_python_fns_25616", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves the value of a specific key from a given dictionary. If the key does not exist in the dictionary, the function should raise an exception with a message indicating that the key was not found. Implement a function `get_dict_v...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_dict_value({'a': 'apple', 'b': 'banana'}, 'a') == 'apple'\", \"assert get_dict_value({'x': 'x-ray', 'y': 'yellow'}, 'y') == 'yellow'\", \"assert get_dict_value({'key1': 'value1', 'key2': 'value2'}, 'key1') == 'value1'\", \"assert get_dict_value({'foo': '...
{ "split": "train", "index": 4755, "acecode_id": "bigcode_python_fns_24149", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given an array 'arr' of N integers, determine if it is possible to sort the array in ascending order by performing exactly 4 swaps, each involving 2 different elements. Additionally, after the swaps, the resulting array must have an odd number of elements that are smaller than ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert arrange_elements([1, 3, 5, 7, 9, 11]) == False\", \"assert arrange_elements([10, 20, 30, 40, 50]) == False\", \"assert arrange_elements([1, 2, 3, 4, 5, 6, 7]) == False\", \"assert arrange_elements([10, 5, 2, 8, 1]) == False\", \"assert arrange_elements([3, 1...
{ "split": "train", "index": 4756, "acecode_id": "evol_17504", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function called `is_placeholder_function` that takes a single string input. The function should return `True` if the string is the exact phrase 'Place holder function for running this module as cmd line program.' and `False` otherwise. Your fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_placeholder_function('Place holder function for running this module as cmd line program.') == True\", \"assert is_placeholder_function('place holder function for running this module as cmd line program.') == False\", \"assert is_placeholder_function('Plac...
{ "split": "train", "index": 4757, "acecode_id": "bigcode_python_fns_24765", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `car_details(make: str, model: str, year: int, num_doors: int) -> dict` that takes the make, model, year, and number of doors of a car and returns a dictionary containing these details. The keys in the returned dictionary should be 'make', 'model', 'year', ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert car_details('Toyota', 'Corolla', 2019, 4) == {'make': 'Toyota', 'model': 'Corolla', 'year': 2019, 'num_doors': 4}\", \"assert car_details('Honda', 'Civic', 2020, 2) == {'make': 'Honda', 'model': 'Civic', 'year': 2020, 'num_doors': 2}\", \"assert car_details(...
{ "split": "train", "index": 4758, "acecode_id": "evol_30732", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `k_fold_cross_validation(X: List[int], k: int = 5, randomize: bool = False) -> List[Tuple[List[int], List[int]]]` that generates K (training, validation) pairs from the items in the list X. Each pair should consist of a training set (which contains the item...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert k_fold_cross_validation([1, 2, 3, 4, 5]) == [([2, 3, 4, 5], [1]), ([1, 3, 4, 5], [2]), ([1, 2, 4, 5], [3]), ([1, 2, 3, 5], [4]), ([1, 2, 3, 4], [5])]\", \"assert k_fold_cross_validation([1, 2, 3, 4, 5], k='loo') == [([2, 3, 4, 5], [1]), ([1, 3, 4, 5], [2]), ...
{ "split": "train", "index": 4759, "acecode_id": "bigcode_python_fns_41855", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a caching system that supports two modes of caching: 'LRU' (Least Recently Used) and 'LFU' (Least Frequently Used). Your implementation should allow storing key-value pairs and evict items based on the specified caching mode. Write a function `c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cache_system('LRU', [('put', 1, 10), ('put', 2, 20), ('get', 1, None)]) == [10]\", \"assert cache_system('LFU', [('put', 1, 10), ('put', 2, 20), ('put', 3, 30), ('get', 2, None)]) == [20]\", \"assert cache_system('LRU', [('put', 1, 10), ('put', 2, 20), ('put...
{ "split": "train", "index": 4760, "acecode_id": "oss_13900", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `check_nested_parentheses` that takes a string consisting of '(' and ')' characters as input and checks whether the parentheses in the string are correctly nested. Each '(' must be eventually followed by a ')', and at any point in the string, there cannot b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_nested_parentheses('()') == 'Yes'\", \"assert check_nested_parentheses('()()') == 'Yes'\", \"assert check_nested_parentheses('(())') == 'Yes'\", \"assert check_nested_parentheses('(()())') == 'Yes'\", \"assert check_nested_parentheses('(()))') == 'No'\...
{ "split": "train", "index": 4761, "acecode_id": "evol_339", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer `num` and an integer `max_bits`, write a function that reverses the bits of `num` up to `max_bits`. The function should ignore leading zeros in the original value of `num`. Return the resulting integer after the bit reversal. Assume `num` is a non-negative inte...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_bits(5, 0) == 0\", \"assert reverse_bits(5, 16) == 1\", \"assert reverse_bits(5, 31) == 31\", \"assert reverse_bits(8, 255) == 255\", \"assert reverse_bits(8, 128) == 1\", \"assert reverse_bits(8, 0) == 0\", \"assert reverse_bits(10, 1023) == 1023\",...
{ "split": "train", "index": 4762, "acecode_id": "bigcode_python_fns_1652", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a square matrix of integers, convert the matrix into a dictionary where each key is the row index and the value is another dictionary representing the column indices and their corresponding values from the matrix. The function should return this dictionary. For example, i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert (matrix2dict([[0, 1, 3], [1, 0, 2], [3, 2, 0]]) == {0: {0: 0, 1: 1, 2: 3}, 1: {0: 1, 1: 0, 2: 2}, 2: {0: 3, 1: 2, 2: 0}})\", \"assert (matrix2dict([[1, 2], [3, 4]]) == {0: {0: 1, 1: 2}, 1: {0: 3, 1: 4}})\", \"assert (matrix2dict([[5]]) == {0: {0: 5}})\", \"a...
{ "split": "train", "index": 4763, "acecode_id": "bigcode_python_fns_1077", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a job scheduling system that allows for the scheduling of recurring tasks at specific times on specific days of the week. Implement a function `calculateNextExecution(frequency: str, time: str, day: str, current_time: str) -> str` that calculate...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculateNextExecution('weekly', '15:30', 'Mon', '2023-10-01T15:30:00') == '2023-10-02T15:30:00'\", \"assert calculateNextExecution('weekly', '09:00', 'Wed', '2023-10-01T15:30:00') == '2023-10-04T09:00:00'\", \"assert calculateNextExecution('weekly', '12:15'...
{ "split": "train", "index": 4764, "acecode_id": "oss_5880", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a list of integers, rotate the elements of the list to the right by a given number of steps. The rotation means that the elements that are shifted off the end of the list reappear at the beginning. Implement a function `rotate_list(arr: List[int], steps: int) -> List[int]...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rotate_list([1, 2, 3, 4, 5], 2) == [4, 5, 1, 2, 3]\", \"assert rotate_list([1, 2, 3, 4, 5], 5) == [1, 2, 3, 4, 5]\", \"assert rotate_list([1], 3) == [1]\", \"assert rotate_list([], 3) == []\", \"assert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\", \"assert...
{ "split": "train", "index": 4765, "acecode_id": "bigcode_python_fns_40759", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `print_message(message: str) -> str` that takes a string `message` as input and returns the message prefixed with 'My message is: '. For example, if the input is 'Hello World', the output should be 'My message is: Hello World'.\nPlease reason step by step, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert print_message('Hello World') == 'My message is: Hello World'\", \"assert print_message('') == 'My message is: '\", \"assert print_message('Python is great!') == 'My message is: Python is great!'\", \"assert print_message('LeetCode') == 'My message is: LeetCo...
{ "split": "train", "index": 4766, "acecode_id": "evol_7584", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing a preamble of distinct numbers, followed by a sequence of additional numbers. Your task is to identify the first number in the sequence that cannot be expressed as the sum of two distinct numbers from the preamble. Write a function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_invalid_number([2, 4, 6, 8], [12, 14, 10, 11]) == 10\", \"assert find_invalid_number([5, 10, 15], [25, 20, 30, 35]) == 20\", \"assert find_invalid_number([2, 3, 5], [8, 9, 7]) == 9\", \"assert find_invalid_number([4, 8, 12, 16], [24, 32, 20]) == 20\", \...
{ "split": "train", "index": 4767, "acecode_id": "oss_19909", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a list of identifiers formatted as 'species|transcript|gene', write a function that builds a mapping of each identifier to its corresponding gene. If an identifier does not contain the full format, consider the identifier itself as the gene. The function should return a d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert buildGeneMap(['human|tx1|geneA', 'mouse|tx2|geneB', 'human|tx3|geneA', 'geneC']) == ({'human|tx1|geneA': 'human|geneA', 'mouse|tx2|geneB': 'mouse|geneB', 'human|tx3|geneA': 'human|geneA', 'geneC': 'geneC'}, {'human|geneA': ['human|tx1|geneA', 'human|tx3|gene...
{ "split": "train", "index": 4768, "acecode_id": "bigcode_python_fns_2379", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that enables specific CPU cores based on given indices. The function should take a parameter `rg` which can be either an integer, a list of integers, or None. If `rg` is None, it should return a message indicating that all CPU cores are e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_cpu_cores(None) == ['All CPU cores are enabled.']\", \"assert set_cpu_cores(0) == ['CPU core 0 is enabled.']\", \"assert set_cpu_cores(3) == ['CPU core 3 is enabled.']\", \"assert set_cpu_cores([1, 2, 3]) == ['CPU core 1 is enabled.', 'CPU core 2 is enab...
{ "split": "train", "index": 4769, "acecode_id": "bigcode_python_fns_35889", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that sanitizes a given list of dictionaries according to a specified schema. The function should take three parameters: the data (a list of dictionaries), a schema (a list of dictionaries describing the expected fields and their types), a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sanitize_data([{'name': 'Alice', 'age': 30}], [{'field_name': 'name', 'type': 'string'}, {'field_name': 'age', 'type': 'integer'}, {'field_name': 'salary', 'type': 'float'}], fill_missing=True) == [{'name': 'Alice', 'age': 30, 'salary': 0.0}]\", \"assert san...
{ "split": "train", "index": 4770, "acecode_id": "bigcode_python_fns_9566", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a summary table for a set of compounds in a pharmaceutical dataset. You are given a dictionary `pset_dict` that contains information about various compounds in a pharmaceutical set, identified by their unique IDs. You need to implement a function `b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert build_join_table({'A': 1, 'B': 2}, 'PSet1', [101, 102]) == [{'dataset_id': 'PSet1', 'compound_id': 101}, {'dataset_id': 'PSet1', 'compound_id': 102}]\", \"assert build_join_table({'A': 1, 'B': 2}, 'PSet1', []) == []\", \"assert build_join_table({}, 'PSet2', ...
{ "split": "train", "index": 4771, "acecode_id": "oss_31866", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that generates the Fibonacci sequence for the first n terms. Each number in the sequence should be the sum of the two preceding numbers. The function should raise a ValueError if n is not a positive integer. The function should return a list containing the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci(1) == [0]\", \"assert fibonacci(2) == [0, 1]\", \"assert fibonacci(3) == [0, 1, 1]\", \"assert fibonacci(4) == [0, 1, 1, 2]\", \"assert fibonacci(5) == [0, 1, 1, 2, 3]\", \"assert fibonacci(6) == [0, 1, 1, 2, 3, 5]\", \"assert fibonacci(7) == [0, 1...
{ "split": "train", "index": 4772, "acecode_id": "evol_30713", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of daemons, each represented by a list containing a string (name), an integer (ID), a boolean (is_hw_handler), and an additional string (uuid), implement a function `get_daemon_info(daemons: List[List[Union[str, int, bool, str]]]) -> Dict[str, Dict[str, bool]]` tha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_daemon_info([['daemon1', 0, True, 'uuid1'], ['daemon2', 1, False, 'uuid2']]) == {'daemon1': {'is_hw_handler': True}, 'daemon2': {'is_hw_handler': False}}\", \"assert get_daemon_info([['daemonA', 2, True, 'uuidA'], ['daemonB', 3, True, 'uuidB']]) == {'dae...
{ "split": "train", "index": 4773, "acecode_id": "bigcode_python_fns_8204", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given the lengths of the two bases of a trapezoid and its height, implement a function `calculate_area(base1: float, base2: float, height: float) -> float` that calculates the area of the trapezoid. The area can be calculated using the formula: (base1 + base2) * height / 2.\nPl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_area(10, 20, 5) == 75.0\", \"assert calculate_area(5, 15, 10) == 100.0\", \"assert calculate_area(3, 7, 4) == 20.0\", \"assert calculate_area(6.5, 13.5, 3) == 30.0\", \"assert calculate_area(0, 0, 5) == 0.0\", \"assert calculate_area(10, 10, 10) ==...
{ "split": "train", "index": 4774, "acecode_id": "evol_23121", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a recursive function that takes a sentence as input and returns the words of the sentence in reverse order as a single string. The sentence may include punctuation and should be split by spaces. Do not use any built-in reverse functions or looping constructs like for ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_order('The quick brown fox jumps over the lazy dog') == 'dog lazy the over jumps fox brown quick The'\", \"assert reverse_order('Hello, world!') == 'world! Hello,'\", \"assert reverse_order('Python is fun!') == 'fun! is Python'\", \"assert reverse_or...
{ "split": "train", "index": 4775, "acecode_id": "evol_13791", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Write a python function that takes a list and an integer n as input. The function should split the list at the nth element, move the first part to the end, and then sort the resulting list in ascending order. The function should handle exceptions for invalid input, specifically...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_and_rotate([3, 1, 4, 1, 5], 2) == [1, 1, 3, 4, 5]\", \"assert sort_and_rotate([[1, 2], [3, 4]], 0) == [[1, 2], [3, 4]]\", \"assert sort_and_rotate([{'a': 2, 'b': 3}, {'c': 1}], 1) == [{'c': 1}, {'a': 2, 'b': 3}]\", \"assert sort_and_rotate([{'x': 5, 'y'...
{ "split": "train", "index": 4776, "acecode_id": "evol_7493", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that translates a 2D image along the vertical axis based on a given translation factor. The image is represented as a 2D list (matrix) with dimensions (H x W), where each element is an integer representing pixel intensity. The transla...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert translate_image([[1, 2], [3, 4]], 1.5) == [[3, 4], [1, 2]]\", \"assert translate_image([[1]], 0.0) == [[1]]\", \"assert translate_image([[1, 2], [3, 4]], 0.0) == [[1, 2], [3, 4]]\", \"assert translate_image([[1, 2], [3, 4], [5, 6]], 2.0) == [[5, 6], [1, 2], ...
{ "split": "train", "index": 4777, "acecode_id": "bigcode_python_fns_49521", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a string representing the contents of a file, implement a function `ends_with_newline(content: str) -> bool` that checks if the string ends with a newline character ('\\n'). Return `True` if it does, and `False` otherwise.\nPlease reason step by step, then write a self-co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert ends_with_newline('Hello, World!\\\\n') == True\", \"assert ends_with_newline('Hello, World!') == False\", \"assert ends_with_newline('') == False\", \"assert ends_with_newline('\\\\n') == True\", \"assert ends_with_newline('Line 1\\\\nLine 2\\\\n') == True\...
{ "split": "train", "index": 4778, "acecode_id": "evol_30397", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of 3D coordinates representing points in space. Write a function `calculate_distance` that takes two points as input and returns the Euclidean distance between them. Each point is represented as a tuple of three floats (x, y, z) where x, y, and z are the co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_distance((0.0, 0.0, 0.0), (1.0, 1.0, 1.0)) == 1.7320508075688772\", \"assert calculate_distance((1.0, 2.0, 3.0), (4.0, 5.0, 6.0)) == 5.196152422706632\", \"assert calculate_distance((0.0, 0.0, 0.0), (0.0, 0.0, 0.0)) == 0.0\", \"assert calculate_dis...
{ "split": "train", "index": 4779, "acecode_id": "bigcode_python_fns_32162", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of photo metadata, where each photo is represented by a dictionary containing its 'name' and 'id'. Your task is to write a function that extracts the names of all the photos from the list and returns them in a new list. The input list will always contain at...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_photo_names([{'name': 'final_dsc1458_122.jpg', 'id': '335372090'}, {'name': '_dsc1614_121.jpg', 'id': '335372089'}, {'name': '_dsc1613_120.jpg', 'id': '335372088'}, {'name': '_dsc1610_119.jpg', 'id': '335372087'}]) == ['final_dsc1458_122.jpg', '_dsc1...
{ "split": "train", "index": 4780, "acecode_id": "bigcode_python_fns_47426", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks if a given string contains the names of two specific games and their corresponding categories based on a predefined list. The function should take a string as input and return a formatted message indicating whether the games a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert leaderboard_message('I am playing Super Mario Odyssey Any% today') == 'Super Mario Odyssey Any% Leaderboard: https://www.speedrun.com/SMO#Any%'\", \"assert leaderboard_message('Check out my run of The Legend of Zelda: Breath of the Wild 100%') == 'The Legend...
{ "split": "train", "index": 4781, "acecode_id": "bigcode_python_fns_31478", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given a string representing a series of commands for a robot to move on a grid. The robot starts at position (0, 0) and can move in four directions: up, down, left, and right. The commands are represented by the characters 'U' (up), 'D' (down), 'L' (left), and 'R' (righ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert finalPosition('UDLR') == (0, 0)\", \"assert finalPosition('ULDR') == (0, 0)\", \"assert finalPosition('UUU') == (0, 3)\", \"assert finalPosition('RRDDD') == (2, -3)\", \"assert finalPosition('LLL') == (-3, 0)\", \"assert finalPosition('RUDD') == (1, -1)\", \...
{ "split": "train", "index": 4782, "acecode_id": "oss_22535", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Create a function `calculate_net_earnings(gross_earnings: float, deductions: float) -> float` that computes the net earnings of an employee after accounting for deductions and applicable tax rates. The function should validate that both inputs are positive numbers. If any input...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_net_earnings(9000, 1000) == 8000.00\", \"assert calculate_net_earnings(10000, 1000) == 9000.00\", \"assert calculate_net_earnings(100000, 50000) == 37500.00\", \"assert calculate_net_earnings(15000, 0) == 13500.00\", \"assert calculate_net_earnings...
{ "split": "train", "index": 4783, "acecode_id": "evol_3413", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the ages of a group of people. Your task is to create a function that processes this list and returns a new list where each age is categorized into one of three groups: 'Child' for ages less than 13, 'Teenager' for ages between 13 a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert categorize_ages([5, 12, 13, 19, 20, 25]) == (['Child', 'Child', 'Teenager', 'Teenager', 'Adult', 'Adult'], {'Child': 2, 'Teenager': 2, 'Adult': 2})\", \"assert categorize_ages([10, 14, 18, 22, 30]) == (['Child', 'Teenager', 'Teenager', 'Adult', 'Adult'], {'C...
{ "split": "train", "index": 4784, "acecode_id": "bigcode_python_fns_15008", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `create_segments` that takes the list and returns a list of segments. A segment is defined as a contiguous subarray of the input list where the maximum element is greater than the minimum element. The function should return all such se...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_segments([1, 2, 3, 4]) == [[1, 2, 3, 4]]\", \"assert create_segments([4, 3, 2, 1]) == [[4, 3, 2, 1]]\", \"assert create_segments([1, 3, 2, 5, 4]) == [[1, 3, 2, 5, 4]]\", \"assert create_segments([1, 1, 1, 1]) == []\", \"assert create_segments([5, 4, 3...
{ "split": "train", "index": 4785, "acecode_id": "bigcode_python_fns_36538", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of fruit names as input and returns a new list containing the same fruit names, but sorted in ascending lexicographic order.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sortFruits(['apple', 'banana', 'cherry']) == ['apple', 'banana', 'cherry']\", \"assert sortFruits(['banana', 'apple', 'cherry']) == ['apple', 'banana', 'cherry']\", \"assert sortFruits(['cherry', 'banana', 'apple']) == ['apple', 'banana', 'cherry']\", \"asse...
{ "split": "train", "index": 4786, "acecode_id": "evol_26054", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a configuration dictionary for a backend system. The configuration dictionary should include the name of the backend and a list of configurations derived from several predefined lists. Implement a function `generate_backend...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_backend_config() == {'name': 'native', 'configs': DEFAULT_OP_INT8_CONFIGS + LINEAR_CONFIGS + CONV_CONFIGS + BINARY_OP_CONFIGS + FIXED_QPARAMS_OP_CONFIGS + [CAT_CONFIG] + BN_CONFIGS + SHARE_QPARAMS_OP_CONFIGS + RNN_OP_CONFIGS + EMBEDDING_OP_CONFIGS}\...
{ "split": "train", "index": 4787, "acecode_id": "bigcode_python_fns_42418", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that randomly selects a row from a list of datasets represented as lists of dictionaries. Each dataset has a weight associated with it, which determines the probability of selecting a row from that dataset. The function should take in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert select_random_row([], []) is None\", \"assert select_random_row([[{'id': 1}], [{'id': 2}]], [0.5, 0.5]) in [{'id': 1}, {'id': 2}]\", \"assert select_random_row([[{'id': 1}], [{'id': 2}, {'id': 3}]], [0.2, 0.8]) in [{'id': 1}, {'id': 2}, {'id': 3}]\", \"asser...
{ "split": "train", "index": 4788, "acecode_id": "bigcode_python_fns_7181", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of products represented as strings and an integer n. Your task is to implement a function `get_recommendations` that returns a dictionary containing the n most similar products for each product in the input list. You should assume that the similarity betwee...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_recommendations(['productC'], 1) == {'productC': ['productA']}\", \"assert get_recommendations(['productD'], 3) == {'productD': ['productB']}\", \"assert get_recommendations(['productA', 'productX'], 1) == {'productA': ['productB'], 'productX': []}\", \"...
{ "split": "train", "index": 4789, "acecode_id": "oss_2115", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Write a Python function that simulates the creation of a window with a specified width, height, and background color using a mock implementation of the Pygame library. The function should accept three parameters: `width` (an integer representing the window width), `height` (an ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_window(800, 600, (255, 255, 255)) == {'width': 800, 'height': 600, 'background_color': (255, 255, 255)}\", \"assert create_window(1024, 768, (0, 0, 0)) == {'width': 1024, 'height': 768, 'background_color': (0, 0, 0)}\", \"assert create_window(640, 480...
{ "split": "train", "index": 4790, "acecode_id": "oss_24233", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers, and your task is to implement a function that returns a new list containing only the unique integers from the original list, preserving the order of their first occurrence. Write a function `unique_integers(arr: List[int]) -> List[int]` where `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_integers([1, 2, 2, 3, 4, 3, 1]) == [1, 2, 3, 4]\", \"assert unique_integers([5, 5, 5, 5]) == [5]\", \"assert unique_integers([1, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert unique_integers([10, 9, 8, 10, 9]) == [10, 9, 8]\", \"assert unique_integers([]) == ...
{ "split": "train", "index": 4791, "acecode_id": "bigcode_python_fns_6255", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the attachment of files to a report. The function, `attach_file`, should take two parameters: `file_content` (a string representing the content of the file to be attached) and `description` (a string representing the de...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert attach_file('Sample file content', 'This is a sample file') == 'Attached file with description: This is a sample file'\", \"assert attach_file('Another file content', 'Another description') == 'Attached file with description: Another description'\", \"assert...
{ "split": "train", "index": 4792, "acecode_id": "oss_32146", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a main application script name and a list of data files that need to be included in a Mac application bundle. Your task is to write a function `generate_py2app_setup` that takes the main application script name and a list of data files as input and returns a dicti...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_py2app_setup('main.py', []) == {'app': 'main.py', 'data_files': [], 'options': {'py2app': {'argv_emulation': True}}}\", \"assert generate_py2app_setup('app.py', ['data.txt']) == {'app': 'app.py', 'data_files': ['data.txt'], 'options': {'py2app': {'a...
{ "split": "train", "index": 4793, "acecode_id": "oss_35214", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of match data and a specific team name, implement a function `get_heroes_played_players(matchs_data: List[Dict[str, Any]], team_longname: str) -> Dict[str, List[List[Union[str, int]]]]` that returns a dictionary mapping each player to the heroes they played and whe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_heroes_played_players([{'match_id': 1, 'picks': {'PlayerA': 'Hero1', 'PlayerB': 'Hero2'}, 'result': 1}, {'match_id': 2, 'picks': {'PlayerA': 'Hero3', 'PlayerC': 'Hero4'}, 'result': 0}], 'TeamName') == {'PlayerA': [['Hero1', 'Hero3'], [1, 0]], 'PlayerB': ...
{ "split": "train", "index": 4794, "acecode_id": "bigcode_python_fns_23664", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `draw_factorial(n: int) -> int` that computes the factorial of a given non-negative integer `n`. The function should return the factorial value without using any external libraries or resources. You must implement the function using recursion, where the bas...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert draw_factorial(0) == 1\", \"assert draw_factorial(1) == 1\", \"assert draw_factorial(2) == 2\", \"assert draw_factorial(3) == 6\", \"assert draw_factorial(4) == 24\", \"assert draw_factorial(5) == 120\", \"assert draw_factorial(6) == 720\", \"assert draw_fac...
{ "split": "train", "index": 4795, "acecode_id": "evol_33404", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing image file names. Each image file name is composed of a name followed by a file extension. Your task is to create a function `filter_jpg_images(image_files: List[str]) -> List[str]` that takes this list of image file names and return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_jpg_images(['image1.png', 'image2.jpg', 'image3.gif', 'image4.jpg']) == ['image2.jpg', 'image4.jpg']\", \"assert filter_jpg_images(['test.bmp', 'sample.jpg', 'example.PNG']) == ['sample.jpg']\", \"assert filter_jpg_images(['file.txt', 'document.docx']...
{ "split": "train", "index": 4796, "acecode_id": "bigcode_python_fns_37267", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a list of operation dates in the format 'YYYY-MM-DD'. Your task is to implement a function that returns a sorted list of unique operation dates. The input will be a list of strings representing the operation dates. Your function should ensure that the output list ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sorted_unique_dates(['2023-01-01', '2023-01-01', '2023-01-02']) == ['2023-01-01', '2023-01-02']\", \"assert sorted_unique_dates(['2023-02-01', '2023-01-01', '2023-01-01', '2023-02-02']) == ['2023-01-01', '2023-02-01', '2023-02-02']\", \"assert sorted_unique_...
{ "split": "train", "index": 4797, "acecode_id": "bigcode_python_fns_48815", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of symbols and a list of clauses, write a function `find_pure_symbol(symbols, clauses)` that returns the first symbol that appears exclusively as either a positive literal or a negative literal in the provided clauses. A positive literal is a symbol itself (e.g., A...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_pure_symbol(['A', 'B', 'C'], ['A|~B', '~B|~C', 'C|A']) == ('A', True)\", \"assert find_pure_symbol(['X', 'Y', 'Z'], ['X|Y', '~Y|Z']) == ('X', True)\", \"assert find_pure_symbol(['M', 'N'], ['~M|N', 'M|~N']) == (None, None)\", \"assert find_pure_symbol([...
{ "split": "train", "index": 4798, "acecode_id": "bigcode_python_fns_20052", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `execute_query` that simulates the execution of a parameterized SQL query. The function takes a SQL query string and a list of parameters as input. The parameters are provided in the format of a dictionary where the keys represent paramet...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert execute_query('SELECT * FROM products WHERE price < :max_price', {'max_price': 100}) == \\\"SELECT * FROM products WHERE price < 100\\\"\", \"assert execute_query('SELECT * FROM orders WHERE user_id = :user_id', {'user_id': 3}) == \\\"SELECT * FROM orders WH...
{ "split": "train", "index": 4799, "acecode_id": "oss_27702", "num_tests": 8 }