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 `fibonacci_rng(n)` that takes an integer `n` as input and returns a list containing the first `n` terms of the Fibonacci sequence in a randomized order without repetition. The function should handle edge cases where `n` is negative (return an empty list), z... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci_rng(-5) == []\", \"assert fibonacci_rng(0) == []\", \"assert fibonacci_rng(1) == [0]\", \"assert len(fibonacci_rng(2)) == 2\", \"assert len(fibonacci_rng(3)) == 3\", \"assert len(fibonacci_rng(4)) == 4\", \"assert len(fibonacci_rng(5)) == 5\", \"as... | {
"split": "train",
"index": 63000,
"acecode_id": "evol_30754",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `generate_passcode(length)` that generates a random alphanumeric passcode of a specified length. The passcode must be at least 8 characters long and must contain at least one numerical digit and one alphabetic character. If the provided length is less than 8, t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_passcode(8) is not None\", \"assert len(generate_passcode(10)) == 10\", \"assert len(generate_passcode(12)) == 12\", \"assert len(generate_passcode(15)) == 15\", \"assert generate_passcode(8).isalnum()\", \"assert any(c.isdigit() for c in generate_p... | {
"split": "train",
"index": 63001,
"acecode_id": "evol_4821",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function in Python that matches all phone number formats within a given text. These formats include (999) 999-9999, 999-999-9999, 999.999.9999, and 999 999 9999. The function should return a list of tuples where each tuple contains a matched phone number and its corresp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_phone_numbers_and_area_codes('Call me at (123) 555-1212 or 456-555-1212.') == [('(123) 555-1212', '123'), ('456-555-1212', '456')]\", \"assert extract_phone_numbers_and_area_codes('My old numbers were 789.555.1212 and 321 555 1212.') == [('789.555.12... | {
"split": "train",
"index": 63002,
"acecode_id": "evol_7470",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of event logs, where each log is represented by a dictionary containing an `event_log_id` and a `severity`. Your task is to determine if two specific logs have been created for a given instance. The two logs you need to check for are: one with `event_log_id... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert are_resize_confirm_logs_created([{'event_log_id': 1001, 'severity': 'critical', 'instance_id': 'inst1'}, {'event_log_id': 1002, 'severity': 'critical', 'instance_id': 'inst1'}], 'inst1') == True\", \"assert are_resize_confirm_logs_created([{'event_log_id': 1... | {
"split": "train",
"index": 63003,
"acecode_id": "bigcode_python_fns_48686",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that determines the environment mode based on a given input string. The environment mode can be one of the following: 'development', 'testing', 'staging', or 'production'. The input string may contain variations of these mode names... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert determine_environment_mode('This is a development environment') == 'development'\", \"assert determine_environment_mode('Testing the new feature') == 'testing'\", \"assert determine_environment_mode('Staging server ready for deployment') == 'staging'\", \"as... | {
"split": "train",
"index": 63004,
"acecode_id": "oss_13764",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of buildings in a city. Your task is to write a function that determines how many buildings can be seen from the left side of the street. A building can be seen if it is taller than all the buildings to its left. Impleme... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_visible_buildings([3, 7, 8, 3, 6, 1]) == 3\", \"assert count_visible_buildings([1, 2, 3, 4, 5]) == 5\", \"assert count_visible_buildings([5, 4, 3, 2, 1]) == 1\", \"assert count_visible_buildings([1]) == 1\", \"assert count_visible_buildings([2, 2, 2, 2... | {
"split": "train",
"index": 63005,
"acecode_id": "bigcode_python_fns_8913",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if two numerical values represented as strings are equal. Write a function `check_equality` that takes two parameters: 1. `value1` (string) - representing the first numerical value. 2. `value2` (string) - representing the seco... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_equality('5', '5') == True\", \"assert check_equality('10', '5') == False\", \"assert check_equality('3.14', '3.14') == True\", \"assert check_equality('2', '2.0') == False\", \"assert check_equality('0', '0') == True\", \"assert check_equality('abc', ... | {
"split": "train",
"index": 63006,
"acecode_id": "oss_10015",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You have been tasked with implementing a function that checks if all gift cards assigned to a checkout are valid and active. A gift card is considered valid if it is not expired. You are given a list of gift cards, each represented by a dictionary containing 'id', 'expiration_d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert are_gift_cards_valid([{'id': 1, 'expiration_date': '2025-12-31', 'is_active': True}, {'id': 2, 'expiration_date': '2025-11-30', 'is_active': True}]) == True\", \"assert are_gift_cards_valid([{'id': 1, 'expiration_date': '2022-05-01', 'is_active': True}, {'id... | {
"split": "train",
"index": 63007,
"acecode_id": "bigcode_python_fns_38873",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `import_sensitivities(input)` that takes a tuple `input` where the first element is a string `tol` and the second element is a float `ratio`. The function should return a list of integers representing the sensitivities based on the pro... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert import_sensitivities(('low', 1.0)) == [1.0, 2.0, 3.0, 4.0, 5.0]\", \"assert import_sensitivities(('medium', 1.5)) == [9.0, 10.5, 12.0, 13.5, 15.0]\", \"assert import_sensitivities(('high', 2.0)) == [22.0, 24.0, 26.0, 28.0, 30.0]\", \"assert import_sensitivit... | {
"split": "train",
"index": 63008,
"acecode_id": "bigcode_python_fns_10959",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `add_drain_reactions(metab_list: List[str], prefix_id: str = 'MDS') -> Tuple[List[str], List[str]]` that takes in a list of metabolite identifiers and a prefix string. The function should generate a list of drain reaction identifiers base... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_drain_reactions(['atp_c', 'glc_c'], 'MDS') == (['MDS__atp_c', 'MDS__glc_c'], ['atp_c', 'glc_c'])\", \"assert add_drain_reactions(['nadh_c'], 'MDS') == (['MDS__nadh_c'], ['nadh_c'])\", \"assert add_drain_reactions(['co2', 'h2o', 'glucose'], 'MDS') == (['M... | {
"split": "train",
"index": 63009,
"acecode_id": "bigcode_python_fns_39805",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `modify_list(result: List[str], guess: str, answer: str) -> List[str]` that modifies a list of characters based on a user's guess of a letter in a target word. The function should take in three parameters: a list of characters `result` re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert modify_list(['_', '_', '_', '_'], 'b', 'banana') == ['B', '_', '_', '_']\", \"assert modify_list(['_', '_', '_', '_'], 'c', 'banana') == ['_', '_', '_', '_']\", \"assert modify_list(['_', '_', '_', '_'], 'B', 'banana') == ['B', '_', '_', '_']\", \"assert mod... | {
"split": "train",
"index": 63010,
"acecode_id": "bigcode_python_fns_30954",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that returns the integer that appears most frequently in the list. If there is a tie for the most frequent integer, return the smallest integer among those with the highest frequency. The input list will always contain at least two uni... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert most_common([2, 2, 2, 2, 3, 4, 5, 6, 6, 7]) == 2\", \"assert most_common([1, 2, 3, 3, 2, 1]) == 1\", \"assert most_common([5, 5, 4, 4, 3, 3, 2, 2]) == 2\", \"assert most_common([10, 20, 10, 20, 30]) == 10\", \"assert most_common([7, 7, 8, 8, 8, 9, 9]) == 8\"... | {
"split": "train",
"index": 63011,
"acecode_id": "evol_16519",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing a database of unique IDs. Your task is to implement a function that generates a view name for a specific operation based on these IDs. The view name should be created by concatenating the string 'view_' with the sum of the IDs, foll... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_view_name([1, 2, 3]) == 'view_6_count'\", \"assert generate_view_name([10, 20, 30]) == 'view_60_count'\", \"assert generate_view_name([0, 0, 0]) == 'view_0_count'\", \"assert generate_view_name([-1, -2, -3]) == 'view_-6_count'\", \"assert generate_v... | {
"split": "train",
"index": 63012,
"acecode_id": "bigcode_python_fns_39472",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `swap_dict_key_value(d)` that takes a dictionary `d` as input and swaps its keys and values. If there are duplicate values in the input dictionary, the function should handle these by storing the original keys as a list under the corresponding value in the new ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert swap_dict_key_value({'a': 1, 'b': 2}) == {1: 'a', 2: 'b'}\", \"assert swap_dict_key_value({'a': 1, 'b': 1}) == {1: ['a', 'b']}\", \"assert swap_dict_key_value({'x': 3, 'y': 3, 'z': 4}) == {3: ['x', 'y'], 4: 'z'}\", \"assert swap_dict_key_value({'name': 'Alic... | {
"split": "train",
"index": 63013,
"acecode_id": "evol_13986",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that checks if a given version string of a library starts with a specific prefix. Your task is to complete the function `check_version_prefix(version: str, prefix: str) -> bool` by implementing the necessary logic to achieve this. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_version_prefix('1.9.1', '1.9') == True\", \"assert check_version_prefix('1.9.0', '1.9') == True\", \"assert check_version_prefix('2.0.0', '1.9') == False\", \"assert check_version_prefix('1.8.5', '1.9') == False\", \"assert check_version_prefix('1.9bet... | {
"split": "train",
"index": 63014,
"acecode_id": "oss_36750",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a state change in a DataGridView cell. Given a string representation of a cell (e.g., 'Cell(1, 2)') and a boolean value indicating whether the state has changed (True for changed, False for unchanged), return a string m... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cell_state_change('Cell(1, 2)', True) == 'Cell at (1, 2) has changed state.'\", \"assert cell_state_change('Cell(1, 2)', False) == 'Cell at (1, 2) remains unchanged.'\", \"assert cell_state_change('Cell(0, 0)', True) == 'Cell at (0, 0) has changed state.'\",... | {
"split": "train",
"index": 63015,
"acecode_id": "oss_33707",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function that, given two strings of unequal length, returns a new string with characters of both strings alternating. Beyond the length of the shorter string, append the remaining characters of the longer string. If both strings are numeric, return an error message. Fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_strings('abc', '12345') == 'a1b2c345'\", \"assert merge_strings('hello', 'world') == 'hweolrllod'\", \"assert merge_strings('', 'xyz') == 'xyz'\", \"assert merge_strings('123', '456') == 'Error: Both strings are numeric.'\", \"assert merge_strings('abc... | {
"split": "train",
"index": 63016,
"acecode_id": "evol_29662",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of molecules represented as strings. Your task is to create a function that enumerates the tautomers of these molecules. A tautomer is a specific type of structural isomer that can be interconverted. Your function should return a list that includes the orig... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert enumerate_tautomers(['H2O']) == ['H2O', 'H2O_tautomer1']\", \"assert enumerate_tautomers(['C6H6']) == ['C6H6', 'C6H6_tautomer1']\", \"assert enumerate_tautomers(['C2H5OH', 'C2H4O']) == ['C2H5OH', 'C2H5OH_tautomer1', 'C2H4O', 'C2H4O_tautomer1']\", \"assert en... | {
"split": "train",
"index": 63017,
"acecode_id": "bigcode_python_fns_9393",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer x, implement a function that returns x if x is greater than 0. If x is less than or equal to 0, return the value of x plus 10. Do not use any ternary expressions in your implementation.\nPlease reason step by step, then write a self-contained Python solution. G... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert func(5) == 5\", \"assert func(0) == 10\", \"assert func(-3) == 7\", \"assert func(-10) == 0\", \"assert func(10) == 10\", \"assert func(-1) == 9\", \"assert func(100) == 100\", \"assert func(-5) == 5\", \"assert func(1) == 1\", \"assert func(-20) == -10\", \... | {
"split": "train",
"index": 63018,
"acecode_id": "evol_26059",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that determines the median value(s) of the provided 2D matrix consisting of integers. If the total number of elements in the matrix is even, return a list with two central elements; otherwise, return a list containing just the one median value. The matrix w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert median_2d_matrix([[1, 3], [2]]) == [2]\", \"assert median_2d_matrix([[1, 2], [3, 4]]) == [2, 3]\", \"assert median_2d_matrix([[5], [1], [2], [4], [3]]) == [3]\", \"assert median_2d_matrix([[10, 20], [30, 40], [50, 60]]) == [30, 40]\", \"assert median_2d_matr... | {
"split": "train",
"index": 63019,
"acecode_id": "evol_20059",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given two strings s and t, write a function that replaces all occurrences of the characters in string t in string s with '*'. After performing the replacements, check if the resultant string has any repeated characters. Additionally, output a string that shows the frequency cou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_strings('hello', 'he') == ['**llo', '*:2,l:2,o:1', 'Non-unique']\", \"assert process_strings('world', 'o') == ['w*rld', 'w:1,*:1,r:1,l:1,d:1', 'Unique']\", \"assert process_strings('aaa', 'a') == ['***', '*:3', 'Non-unique']\", \"assert process_strin... | {
"split": "train",
"index": 63020,
"acecode_id": "evol_2000",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple banking system. The function should take a list of transactions as input, where each transaction is represented as a tuple. Each tuple consists of a string indicating the transaction type ('deposit' or 'withdra... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_bank([('deposit', 100), ('withdrawal', 50)]) == (50, [('deposit', 100), ('withdrawal', 50)])\", \"assert simulate_bank([('deposit', 200), ('withdrawal', 300)]) == (200, [('deposit', 200)])\", \"assert simulate_bank([('withdrawal', 100)]) == (0, [])\... | {
"split": "train",
"index": 63021,
"acecode_id": "oss_29333",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of floats, `x`, representing a series of values, and a float `discount` which represents a discount rate (0 <= discount < 1). Your task is to implement a function that computes the discounted cumulative sums of the input list. The discounted cumulative sum ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert discount_cumsum([0.0, 0.0, 0.0], 0.5) == [0.0, 0.0, 0.0]\", \"assert discount_cumsum([5.0], 0.9) == [5.0]\", \"assert discount_cumsum([1.0, 1.0, 1.0, 1.0], 0.0) == [1.0, 1.0, 1.0, 1.0]\", \"assert discount_cumsum([1.0, 2.0], 1.0) == [3.0, 2.0]\", \"assert di... | {
"split": "train",
"index": 63022,
"acecode_id": "bigcode_python_fns_42331",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Create a function in Python that takes a single string input `s`. The function should validate the string based on specific requirements: \n\n- The string must have a minimum length of 8 and a maximum length of 12 characters. \n- The string must contain at least 2 digits. \n- T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert string_validator('Code_42') == False\", \"assert string_validator('Valid_123') == False\", \"assert string_validator('Short1!') == False\", \"assert string_validator('TooLongString123!') == False\", \"assert string_validator('NoSpecialChars123') == False\", ... | {
"split": "train",
"index": 63023,
"acecode_id": "evol_7917",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function 'hasDuplicate' that checks if a given tuple contains any duplicate entries. The function should return True if there are duplicates, and False otherwise. For example, given the tuple (2, 6, 8, 4, 6), the function should return True.\nPlease reason step by s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hasDuplicate((1, 2, 3, 4, 5)) == False\", \"assert hasDuplicate((1, 1, 2, 3, 4)) == True\", \"assert hasDuplicate((5, 5, 5, 5, 5)) == True\", \"assert hasDuplicate((1, 2, 3, 4, 4)) == True\", \"assert hasDuplicate((10, 20, 30, 40, 50)) == False\", \"assert h... | {
"split": "train",
"index": 63024,
"acecode_id": "evol_24798",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers, where each integer represents a student's score in a mathematics exam. Your task is to implement a function `predict_scores(scores: List[int], threshold: int) -> List[str]` that returns a list of strings indicating whether each student has pass... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert predict_scores([75, 85, 55, 90, 45], 60) == ['Passed', 'Passed', 'Failed', 'Passed', 'Failed']\", \"assert predict_scores([30, 45, 50, 80, 95], 50) == ['Failed', 'Failed', 'Passed', 'Passed', 'Passed']\", \"assert predict_scores([100, 100, 100, 100], 100) ==... | {
"split": "train",
"index": 63025,
"acecode_id": "bigcode_python_fns_20823",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that returns the range of years associated with a given domain number. The domain number corresponds to a specific time period, and the function should return the range of years in the format \"start year-end year\". Write a function ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_year_range(1) == '1948-56'\", \"assert get_year_range(2) == '1960-68'\", \"assert get_year_range(3) == '1972-80'\", \"assert get_year_range(4) == '1984-92'\", \"assert get_year_range(5) == 'Invalid domain'\", \"assert get_year_range(0) == 'Invalid domain... | {
"split": "train",
"index": 63026,
"acecode_id": "oss_22128",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a dictionary representing the configuration of a reinforcement learning algorithm and outputs a formatted string summarizing the configuration. The input dictionary will contain the following keys: 'algo_class' (a string re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_rl_config({'algo_class': 'SAC', 'training_params': {'gamma': 0.99, 'lr': 0.001}, 'resource_allocation': {'num_gpus': 2, 'num_rollout_workers': 4}}) == 'Algorithm: SAC, Gamma: 0.99, Learning Rate: 0.001, GPUs: 2, Rollout Workers: 4'\", \"assert format_... | {
"split": "train",
"index": 63027,
"acecode_id": "oss_24996",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a boolean variable `enableManagedAttachments` which indicates whether managed attachments are enabled in a system. Write a function `checkManagedAttachments(enableManagedAttachments: bool) -> str` that returns a message based on the value of `enableManagedAttachme... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert checkManagedAttachments(True) == 'Managed attachments enabled'\", \"assert checkManagedAttachments(False) == 'No dropbox migration - managed attachments not enabled'\", \"assert checkManagedAttachments(True) == 'Managed attachments enabled'\", \"assert check... | {
"split": "train",
"index": 63028,
"acecode_id": "bigcode_python_fns_41167",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers and returns a list of their squares. The function should handle an empty list and should return an empty list in that case. The input list can contain both positive and negative integers. Your task is to ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert square_integers([]) == []\", \"assert square_integers([1]) == [1]\", \"assert square_integers([-1]) == [1]\", \"assert square_integers([2, 3]) == [4, 9]\", \"assert square_integers([-2, -3]) == [4, 9]\", \"assert square_integers([0]) == [0]\", \"assert squar... | {
"split": "train",
"index": 63029,
"acecode_id": "oss_20936",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a function that validates if the provided input is a string. Your task is to implement a function named `validate_string` that takes a single parameter `input_value`. The function should check if `input_value` is a string. If it is not, the function should raise a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_string('valid string') == 'valid string'\", \"assert validate_string('another valid string') == 'another valid string'\", \"assert validate_string('Hello World') == 'Hello World'\", \"assert validate_string('') == ''\", \"assert validate_string('123... | {
"split": "train",
"index": 63030,
"acecode_id": "oss_22939",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a custom exception hierarchy for a Python application that processes weather data from various sensors. Your goal is to define a base exception class named `IkazuchiError`, which serves as the root exception for this application. Additionally, y... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_exceptions()['IkazuchiError'].__doc__ == 'ikazuchi root exception'\", \"assert create_exceptions()['SensorError'].__doc__ == 'Exception raised for errors related to a sensor.'\", \"assert create_exceptions()['DataProcessingError'].__doc__ == 'Exceptio... | {
"split": "train",
"index": 63031,
"acecode_id": "oss_18220",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Hercy wants to accumulate funds for his inaugural automobile. He deposits money into the Leetcode financial institution daily. His initial deposit is $1 on Monday, and from Tuesday to Sunday, he increases his deposit by $1 each day compared to the previous day. Every following ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert totalMoney(1) == 1\", \"assert totalMoney(2) == 3\", \"assert totalMoney(3) == 6\", \"assert totalMoney(4) == 10\", \"assert totalMoney(5) == 15\", \"assert totalMoney(6) == 21\", \"assert totalMoney(7) == 28\"]}"
} | {
"split": "train",
"index": 63032,
"acecode_id": "evol_34253",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a list of triplets, where each triplet consists of three integers (a, b, c) representing connections between nodes in a graph. Your task is to create a graph representation from these triplets and return the number of unique edges in the graph. An edge is consider... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_edges([(1, 2, 3), (1, 2, 3), (1, 2, 3)]) == 3\", \"assert count_unique_edges([(1, 2, 3), (3, 2, 1)]) == 3\", \"assert count_unique_edges([(1, 2, 3), (2, 3, 1), (3, 1, 2)]) == 3\", \"assert count_unique_edges([(1, 2, 3), (4, 5, 6)]) == 6\", \"ass... | {
"split": "train",
"index": 63033,
"acecode_id": "bigcode_python_fns_1287",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function `convert_pressure(value: float, from_unit: str, to_unit: str) -> float` that converts pressure readings from one unit to another. The supported input units are 'pascal', 'atm', 'mmhg', 'bar', and 'psi'. The function should raise a ValueError if the input un... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_pressure(101325, 'pascal', 'atm') == 1.0\", \"assert convert_pressure(1, 'atm', 'pascal') == 101325.0\", \"assert convert_pressure(760, 'mmhg', 'atm') == 1.0\", \"assert convert_pressure(1, 'bar', 'pascal') == 100000.0\", \"assert convert_pressure(10... | {
"split": "train",
"index": 63034,
"acecode_id": "evol_27353",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function that verifies the validity of a table name and the data type of a specified field in a DataFrame. The function should take the following parameters: a list of field names (strings) representing the DataFrame schema, the name of the table (string... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_table_and_field(['date', 'name', 'amount'], 'users', 'date', 'DateType') == True\", \"assert validate_table_and_field(['date', 'name', 'amount'], 'users', 'amount', 'IntegerType') == True\", \"assert validate_table_and_field(['date', 'name', 'amount... | {
"split": "train",
"index": 63035,
"acecode_id": "bigcode_python_fns_31477",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that manages the configuration of a machine learning model. The function should take in the following parameters: batch size, logging level (as a string), and mode of operation (either 'train' or 'eval'). The function should return a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert configure_model(32, 'DEBUG', 'train') == {'Batch Size': 32, 'Logging Level': 'DEBUG', 'Mode': 'train'}\", \"assert configure_model(16, 'INFO', 'eval') == {'Batch Size': 16, 'Logging Level': 'INFO', 'Mode': 'eval'}\", \"assert configure_model(64, 'WARNING', '... | {
"split": "train",
"index": 63036,
"acecode_id": "oss_14681",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of numerical values and a corresponding list of boolean values of the same length, implement a function that checks if each number is even when the corresponding boolean value is True. If the boolean value is False, the function should check if the number is a prim... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert verify_sequence([2, 3, 4, 5], [True, False, True, False]) == True\", \"assert verify_sequence([2, 3, 4, 6], [True, False, True, False]) == False\", \"assert verify_sequence([1, 2, 3, 4], [False, True, False, True]) == False\", \"assert verify_sequence([5, 7,... | {
"split": "train",
"index": 63037,
"acecode_id": "evol_31363",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given coins of different denominations and a total amount of money. Write a function to compute the number of combinations that make up that amount. You may assume that you have an infinite number of each kind of coin. However, the catch is that you cannot use the same ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert combinations(3, [2]) == 0\", \"assert combinations(10, [10]) == 1\", \"assert combinations(0, [1, 2, 3]) == 1\", \"assert combinations(1, [1]) == 1\", \"assert combinations(5000, [1]) == 1\"]}"
} | {
"split": "train",
"index": 63038,
"acecode_id": "evol_19135",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the factorial of a given non-negative integer n using tail recursion. The function should be defined as `tail_recursive_factorial(n: int) -> int`. Tail recursion is a special case of recursion where the recursive call is the last operation i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert tail_recursive_factorial(0) == 1\", \"assert tail_recursive_factorial(1) == 1\", \"assert tail_recursive_factorial(2) == 2\", \"assert tail_recursive_factorial(3) == 6\", \"assert tail_recursive_factorial(4) == 24\", \"assert tail_recursive_factorial(5) == 1... | {
"split": "train",
"index": 63039,
"acecode_id": "evol_9211",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a temperature control system for a heating element. The system has a method `adjust_power_level` which is called whenever the desired temperature is changed. The method takes three parameters: the current temperature `curTemp`, the new desired tem... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert adjust_power_level(30, 20, 100) == 0\", \"assert adjust_power_level(20, 20, 100) == 100\", \"assert adjust_power_level(15, 20, 100) == 100\", \"assert adjust_power_level(25, 20, 50) == 0\", \"assert adjust_power_level(10, 10, 0) == 0\", \"assert adjust_power... | {
"split": "train",
"index": 63040,
"acecode_id": "oss_12740",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists: `values` and `labels`, where the `i-th` item has a value `values[i]` and a label `labels[i]`. Your task is to implement a function that returns the largest possible sum of a subset of items, subject to the following constraints: You can select at most `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert largestValsFromLabels([5,4,3,2,1], [1,1,2,2,3], 3, 1) == 9\", \"assert largestValsFromLabels([5,4,3,2,1], [1,3,3,3,2], 3, 2) == 12\", \"assert largestValsFromLabels([9,8,8,7,6], [0,0,0,1,1], 3, 2) == 24\", \"assert largestValsFromLabels([5,4,3,2,1], [1,1,2,2... | {
"split": "train",
"index": 63041,
"acecode_id": "evol_22628",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that determines the input channel size, pooling size, and layer size for a neural network based on a given dataset and model type. The function should take in two parameters: a string `dataset` which can either be 'mnist', 'mini_imagenet'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fetch_net('mnist', 'wrn16_4') == (1, 2, 80)\", \"assert fetch_net('mini_imagenet', 'conv') == (3, 3, 320)\", \"assert fetch_net('cifar10', 'conv') == (3, 2, 320)\", \"assert fetch_net('mnist', 'conv') == (1, 2, 80)\", \"assert fetch_net('cifar10', 'wrn16_4')... | {
"split": "train",
"index": 63042,
"acecode_id": "bigcode_python_fns_26568",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a non-negative integer n, write a function `int2binlist(n)` that converts the integer n to a list of its binary digits. The function should return the binary representation as a list, starting from the most significant bit (leftmost) to the least significant bit (rightmos... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert int2binlist(0) == [0]\", \"assert int2binlist(1) == [1]\", \"assert int2binlist(2) == [1, 0]\", \"assert int2binlist(3) == [1, 1]\", \"assert int2binlist(4) == [1, 0, 0]\", \"assert int2binlist(5) == [1, 0, 1]\", \"assert int2binlist(6) == [1, 1, 0]\", \"ass... | {
"split": "train",
"index": 63043,
"acecode_id": "evol_7431",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer timestamp `ts`, write a function `convert_ts_to_date(ts: int) -> str` that converts the given timestamp into a human-readable date string in the format 'YYYY-MM-DD'. The timestamp represents the number of seconds that have elapsed since the Unix epoch (January ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_ts_to_date(0) == '1970-01-01'\", \"assert convert_ts_to_date(1609459200) == '2021-01-01'\", \"assert convert_ts_to_date(1612137600) == '2021-02-01'\", \"assert convert_ts_to_date(1614556800) == '2021-03-01'\", \"assert convert_ts_to_date(1617244800) ... | {
"split": "train",
"index": 63044,
"acecode_id": "bigcode_python_fns_14075",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a log file name. Your task is to implement a function `save_log_file(log_file: str) -> str` that takes this log file name as input and returns a message indicating whether the log file name is valid or not. A log file name is considered valid... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert save_log_file('log1.txt') == 'Invalid log file name.'\", \"assert save_log_file('') == 'Invalid log file name.'\", \"assert save_log_file('my_logfile') == 'Log file saved successfully.'\", \"assert save_log_file('log_file_2023') == 'Log file saved successful... | {
"split": "train",
"index": 63045,
"acecode_id": "bigcode_python_fns_5259",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a learning rate scheduler for a neural network training process. The learning rate scheduler is a function that adjusts the learning rate during training to improve the convergence and performance of the model. Your goal is to create a Python fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_learning_rate(1, 0.1, 0.9, 10) == 0.1\", \"assert get_learning_rate(5, 0.1, 0.9, 10) == 0.1\", \"assert get_learning_rate(11, 0.1, 0.9, 10) == 0.09\", \"assert get_learning_rate(20, 0.2, 0.5, 4) == 0.0125\", \"assert get_learning_rate(2, 0.1, 0.9, 10) ==... | {
"split": "train",
"index": 63046,
"acecode_id": "oss_17483",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a string, write a function that retrieves the last character that repeats in the string. If no repeating character is found, return 'None'.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block."... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert last_repeating_char('abcde') == 'None'\", \"assert last_repeating_char('hello') == 'l'\", \"assert last_repeating_char('aabbcc') == 'c'\", \"assert last_repeating_char('racecar') == 'r'\", \"assert last_repeating_char('openai') == 'None'\", \"assert last_rep... | {
"split": "train",
"index": 63047,
"acecode_id": "evol_25911",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates the uploading of a file to a storage system. Your function should take the following parameters: \n- `file_path` (string): The local path of the file to be uploaded. \n- `bucket_name` (string): The name of the storag... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert upload_file('local_file.txt', 'my-bucket', 'uploaded_file.txt') == \\\"File 'local_file.txt' uploaded to bucket 'my-bucket' with key 'uploaded_file.txt' successfully.\\\"\", \"assert upload_file('local_file.txt', '', 'uploaded_file.txt') == \\\"Error: Bucket... | {
"split": "train",
"index": 63048,
"acecode_id": "oss_31639",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that initializes a server interface. The function should take any number of positional and keyword arguments and return a string message confirming that the server has been initialized with the given parameters. The message should include... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_server() == 'Server initialized with positional args: () and keyword args: {}'\", \"assert initialize_server(1, 2, 3) == 'Server initialized with positional args: (1, 2, 3) and keyword args: {}'\", \"assert initialize_server(None) == 'Server initi... | {
"split": "train",
"index": 63049,
"acecode_id": "bigcode_python_fns_20459",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function `advanced_custom_base_arithmetic(m: int, n: int, base: int, operation: str, sequential: bool) -> str` that performs a specified arithmetic operation on a range of integers or prime numbers between `m` and `n`, and then converts the result to a specified bas... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert advanced_custom_base_arithmetic(5, 5, 10, 'product', True) == '5'\", \"assert advanced_custom_base_arithmetic(1, 5, 10, 'max', False) == '5'\", \"assert advanced_custom_base_arithmetic(30, 40, 10, 'min', True) == '30'\", \"assert advanced_custom_base_arithme... | {
"split": "train",
"index": 63050,
"acecode_id": "evol_33587",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that manages a list of tasks. The function should accept a list of task descriptions and return a new list with only the unique tasks, removing any duplicates. Each task description is a string. Implement the function `unique_tasks(ta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_tasks(['Task 1', 'Task 2', 'Task 1', 'Task 3']) == ['Task 1', 'Task 2', 'Task 3']\", \"assert unique_tasks(['Buy groceries', 'Clean the house', 'Buy groceries', 'Walk the dog']) == ['Buy groceries', 'Clean the house', 'Walk the dog']\", \"assert uniqu... | {
"split": "train",
"index": 63051,
"acecode_id": "oss_543",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `format_notes` that takes a list of notes, where each note is represented as a dictionary with keys `id`, `body`, and `date`. The function should return a formatted string for each note, where each line contains the note's `id`, followed ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_notes([]) == ''\", \"assert format_notes([{'id': 1, 'body': 'First note', 'date': '2023-10-01 12:00:00'}]) == '1: First note, 2023-10-01 12:00:00'\", \"assert format_notes([{'id': 1, 'body': 'First note', 'date': '2023-10-01 12:00:00'}, {'id': 2, 'bod... | {
"split": "train",
"index": 63052,
"acecode_id": "oss_7024",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given two strings 'a' and 'b', write a function to compute the length of the longest common subsequence (LCS) between the two strings. The LCS is defined as the longest sequence that appears in both strings in the same order, but not necessarily consecutively. For example, the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lcs('abcde', 'ace') == 3\", \"assert lcs('abc', 'abc') == 3\", \"assert lcs('abc', 'def') == 0\", \"assert lcs('abcdef', 'fbdcam') == 2\", \"assert lcs('', 'nonempty') == 0\", \"assert lcs('nonempty', '') == 0\", \"assert lcs('', '') == 0\", \"assert lcs('a'... | {
"split": "train",
"index": 63053,
"acecode_id": "bigcode_python_fns_37495",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function to check if two given strings are case-sensitive anagrams of each other. The function should ignore punctuation and whitespace, and consider only alphabetic characters. You are not allowed to use any built-in library functions or data structures, including ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_anagram('The eyes', 'They see') == True\", \"assert check_anagram('A Santa at NASA', 'A tan, a cat, a fat, a man') == False\", \"assert check_anagram('Hello, World!', 'dlroW ,olleH') == True\", \"assert check_anagram('Python', 'Java') == False\", \"ass... | {
"split": "train",
"index": 63054,
"acecode_id": "evol_9506",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing file paths. Each string in the list is a simulated path to a file that may have a symbolic link. Your task is to implement a function `resolve_links(paths: List[str]) -> List[Dict[str, str]]` that returns a list of dictionaries where... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert resolve_links(['file1', 'file2', 'file3']) == [{'source': 'file1', 'target': 'file1_resolved'}, {'source': 'file2', 'target': 'file2_resolved'}, {'source': 'file3', 'target': 'file3_resolved'}]\", \"assert resolve_links(['link1', 'link2']) == [{'source': 'li... | {
"split": "train",
"index": 63055,
"acecode_id": "bigcode_python_fns_39686",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a single input, a callable function `fn`, and returns a new function that, when called, will execute `fn` and catch any exceptions that occur during its execution. If an exception occurs, the new function should return a string... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert handle_function(lambda: 1 / 0)() == 'Function call failed: division by zero'\", \"assert handle_function(lambda: 'Hello' + ' World')() == 'Function call succeeded'\", \"assert handle_function(lambda: [1, 2, 3][3])() == 'Function call failed: list index out o... | {
"split": "train",
"index": 63056,
"acecode_id": "bigcode_python_fns_47882",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of bookmark nodes represented as dictionaries and organizes them into a structured format. Each bookmark node can either be a folder or a link. A folder can contain other folders or links. Your function should take t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert organize_bookmarks([{'type': 'folder', 'title': 'Favorites', 'children': [{'type': 'link', 'title': 'Google'}, {'type': 'link', 'title': 'Facebook'}]}], '1') == {'id': '1', 'title': 'Favorites', 'contents': [{'id': '1_1', 'title': 'Google'}, {'id': '1_2', 't... | {
"split": "train",
"index": 63057,
"acecode_id": "bigcode_python_fns_16089",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, determine if it satisfies the properties of a max heap. A max heap is a complete binary tree where each parent node is greater than or equal to its child nodes. Implement a function `isMaxHeap(lst: List[int]) -> bool` that takes the list as input and r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isMaxHeap([10, 9, 8, 7, 6]) == True\", \"assert isMaxHeap([10, 9, 8, 7, 6, 5, 4]) == True\", \"assert isMaxHeap([10, 9, None, 7, 6]) == True\", \"assert isMaxHeap([10, 5, 6, 7, 8]) == False\", \"assert isMaxHeap([5, 5, 5, 5]) == True\", \"assert isMaxHeap([N... | {
"split": "train",
"index": 63058,
"acecode_id": "evol_24239",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a list of all the unique child and grandchild nodes based on a given configuration. Each node in the configuration can have child nodes, and the function should recursively process these child nodes. The input to the functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_nodes([{'plugin_type': 'text', 'values': {'content': 'Hello'}}, {'plugin_type': 'image', 'values': {'src': 'image.png'}, 'children': [{'plugin_type': 'caption', 'values': {'text': 'An image caption'}}]}]) == [{'type': 'text', 'values': {'content': 'He... | {
"split": "train",
"index": 63059,
"acecode_id": "bigcode_python_fns_29144",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_crud_controller` that takes a database session and a model class as arguments and returns a simple CRUD controller class that can be used for a web application. The returned class should have basic methods for create, read, update, and delete operat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_crud_controller(DBSession, Book).__name__ == 'CrudController'\", \"assert 'create' in dir(create_crud_controller(DBSession, Book))\", \"assert 'read' in dir(create_crud_controller(DBSession, Book))\", \"assert 'update' in dir(create_crud_controller(DB... | {
"split": "train",
"index": 63060,
"acecode_id": "evol_8610",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function that generates a two-dimensional sparse matrix from a provided list of numerical values and a separate list indicating the indices at which these values need to be placed. The remaining elements in the matrix should be zero. The matrix should be of size n x n,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_matrix(3, [1, 2], [(0, 0), (1, 1)]) == [[1, 0, 0], [0, 2, 0], [0, 0, 0]]\", \"assert generate_matrix(4, [5, 10], [(0, 0), (2, 2)]) == [[5, 0, 0, 0], [0, 0, 0, 0], [0, 0, 10, 0], [0, 0, 0, 0]]\", \"assert generate_matrix(2, [3], [(0, 1)]) == [[0, 3],... | {
"split": "train",
"index": 63061,
"acecode_id": "evol_15476",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of tuples where each tuple contains two elements, a string representing the name of a torsional coordinate and a corresponding integer value. Your task is to write a function `extract_torsion_names` that takes this list of tuples as input and returns a tupl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_torsion_names([('dihedral1', 1), ('dihedral2', 2), ('dihedral1', 3)]) == ('dihedral1', 'dihedral2')\", \"assert extract_torsion_names([('angle1', 5), ('angle2', 8), ('angle1', 6), ('angle3', 2)]) == ('angle1', 'angle2', 'angle3')\", \"assert extract_... | {
"split": "train",
"index": 63062,
"acecode_id": "bigcode_python_fns_17065",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that returns the pth element of an altered factorial sequence, computed modulo q. The function should be able to handle large values of p efficiently. The conditions are: 1 <= p <= 10^12, 2 <= q <= 10^6. The altered factorial sequence is defined such that t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert factorialModulo(5, 2) == 0\", \"assert factorialModulo(10, 8) == 0\", \"assert factorialModulo(12, 12) == 0\", \"assert factorialModulo(0, 10) == 1\", \"assert factorialModulo(1, 5) == 1\", \"assert factorialModulo(4, 3) == 0\", \"assert factorialModulo(6, 5... | {
"split": "train",
"index": 63063,
"acecode_id": "evol_35815",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that formats an IP address and a corresponding host name into a specific string format. Implement a function `format_ip_address(ip: str, host: str) -> str` that takes two arguments: a string `ip` representing the IP address and a string `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_ip_address('192.168.1.1', 'example.com') == '192.168.1.1:example.com'\", \"assert format_ip_address('10.0.0.1', 'myserver.local') == '10.0.0.1:myserver.local'\", \"assert format_ip_address('255.255.255.255', 'localhost') == '255.255.255.255:localhost'... | {
"split": "train",
"index": 63064,
"acecode_id": "oss_36533",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes two strings and returns a tuple containing the number of unique words in each string and the number of common words appearing in both strings. The word comparison should be case-insensitive, and punctuation should not be accounted for in words.\nPlea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert word_count('Hello world!', 'Hello there world!') == (2, 3, 2)\", \"assert word_count('Python is great.', 'python is fun!') == (3, 3, 2)\", \"assert word_count('Good morning!', 'Good night!') == (2, 2, 1)\", \"assert word_count('Data science, AI.', 'Data scie... | {
"split": "train",
"index": 63065,
"acecode_id": "evol_233",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function `student_statistics(grades: List[int]) -> Tuple[float, int, int]` that takes a list of integers representing student grades as input. Your function should return a tuple containing the average grade, the highest grade, and the lowest grade... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert student_statistics([]) == (0.0, None, None)\", \"assert student_statistics([85]) == (85.0, 85, 85)\", \"assert student_statistics([85, 90, 78]) == (84.33333333333333, 90, 78)\", \"assert student_statistics([100, 95, 90, 85, 80]) == (90.0, 100, 80)\", \"asser... | {
"split": "train",
"index": 63066,
"acecode_id": "oss_35947",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `reverse_each_word(sentence: str) -> str` that takes a string `sentence` as input and returns a new string where each word in the original sentence is reversed, but the order of the words remains the same. A word is defined as a sequence of characters separated... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_each_word('hello world') == 'olleh dlrow'\", \"assert reverse_each_word('python programming') == 'nohtyp gnimmargorp'\", \"assert reverse_each_word('data structures') == 'atad serutcurts'\", \"assert reverse_each_word('reverse each word') == 'esrever... | {
"split": "train",
"index": 63067,
"acecode_id": "evol_10773",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a mathematical expression represented as a string, determine if the expression is a literal. A literal is defined as a single variable (e.g., 'a', 'b') or a negation of a single variable (e.g., '~a'). An expression that involves operations such as addition, multiplication... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_literal('a') == True\", \"assert is_literal('b') == True\", \"assert is_literal('c') == True\", \"assert is_literal('~a') == True\", \"assert is_literal('~b') == True\", \"assert is_literal('~c') == True\", \"assert is_literal('a + b') == False\", \"asser... | {
"split": "train",
"index": 63068,
"acecode_id": "bigcode_python_fns_26852",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a tweet, implement a function that truncates the tweet to a specified length and generates overlapping substrings (windows) of a specified size with a specified step. The function should return a list of these substrings. Each substring should be at ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_substrings('Short tweet', 20, 5, 1) == ['Short', 'hort ', 'ort t', 'rt tw', 't twe', ' twee', 'tweet']\", \"assert generate_substrings('', 10, 5, 1) == []\", \"assert generate_substrings('abcdefg', 7, 3, 2) == ['abc', 'cde', 'efg']\", \"assert gener... | {
"split": "train",
"index": 63069,
"acecode_id": "bigcode_python_fns_37046",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that counts the occurrences of a specified point type in a given list of points representing a lattice structure. Each point in the lattice has a type that can be determined through a helper function. Write a function called `countPoi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert countPointsInType([1, 2, 3, 2, 1, 2], 2) == 3\", \"assert countPointsInType([1, 1, 1, 1], 1) == 4\", \"assert countPointsInType([3, 3, 5, 7, 9], 4) == 0\", \"assert countPointsInType([2, 4, 6, 8, 10], 2) == 1\", \"assert countPointsInType([], 1) == 0\", \"as... | {
"split": "train",
"index": 63070,
"acecode_id": "oss_22266",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with counting the occurrences of specified names within a list of tags. Write a function `count_name_occurrences(names, book_tags)` where: \n- `names` (list of strings) represents the list of names you want to count. \n- `book_tags` (list of strings) represents t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_name_occurrences(['Alice', 'Bob', 'Charlie'], ['Alice', 'Bob', 'Alice', 'Charlie', 'Alice']) == {'Alice': 3, 'Bob': 1, 'Charlie': 1}\", \"assert count_name_occurrences(['X', 'Y', 'Z'], ['X', 'X', 'Y', 'X', 'Z', 'Y', 'Z']) == {'X': 3, 'Y': 2, 'Z': 2}\",... | {
"split": "train",
"index": 63071,
"acecode_id": "oss_27192",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that indents a given string by a specified number of spaces and tabs. The function should take four parameters: the input string, the number of spaces to indent (default is 4), the number of tabs to indent (default is 0), and a boolean fl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert indent_string('Hello\\\\nWorld', 2, 1, False) == '\\\\t Hello\\\\n\\\\t World'\", \"assert indent_string('Single line', 4, 0, False) == ' Single line'\", \"assert indent_string('Single line', 0, 1, False) == '\\\\tSingle line'\", \"assert indent_string(... | {
"split": "train",
"index": 63072,
"acecode_id": "bigcode_python_fns_39876",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing tasks, where each integer corresponds to the duration of a task in seconds. Your goal is to determine the total time required to complete all tasks. Implement a function `total_task_time(tasks: List[int]) -> int` that takes a list o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert total_task_time([5, 10, 15]) == 30\", \"assert total_task_time([1, 2, 3, 4]) == 10\", \"assert total_task_time([]) == 0\", \"assert total_task_time([0, 0, 0]) == 0\", \"assert total_task_time([10]) == 10\", \"assert total_task_time([7, 14, 21]) == 42\", \"as... | {
"split": "train",
"index": 63073,
"acecode_id": "bigcode_python_fns_44900",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `generate_matrix(m: int, n: int) -> List[List[int]]` that generates a matrix of size m x n filled with zeros. The matrix should be represented as a list of lists, where each inner list represents a row of the matrix. The function should take two parameters: m (... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_matrix(2, 3) == [[0, 0, 0], [0, 0, 0]]\", \"assert generate_matrix(1, 1) == [[0]]\", \"assert generate_matrix(0, 5) == []\", \"assert generate_matrix(4, 2) == [[0, 0], [0, 0], [0, 0], [0, 0]]\", \"assert generate_matrix(3, 3) == [[0, 0, 0], [0, 0, 0... | {
"split": "train",
"index": 63074,
"acecode_id": "evol_12554",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the weights of different layers in a neural network. Your task is to write a function `set_all_param_values(weights: List[int], layer: List[int]) -> List[int]` that takes in the weights and a layer, and returns a new list of weights... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_all_param_values([1, 2, 3], [1, 1, 1]) == [0, 2, 6]\", \"assert set_all_param_values([1, 2], [0, 1]) == [0, 2]\", \"assert set_all_param_values([0, 0, 0], [1, 2, 3]) == [0, 0, 0]\", \"assert set_all_param_values([100, 200, 300], [1, 1, 1]) == [0, 200, 60... | {
"split": "train",
"index": 63075,
"acecode_id": "bigcode_python_fns_44784",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given a 2D list 'dataset' where each inner list represents a record of user ratings, and an integer 'user_id', write a function that returns a list of all records where the first element matches the 'user_id'. If no records are found, return an empty list. The 'dataset' will ha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_user_ratings(1, [[1, 5], [2, 3], [1, 4]]) == [[1, 5], [1, 4]]\", \"assert filter_user_ratings(2, [[1, 5], [2, 3], [1, 4]]) == [[2, 3]]\", \"assert filter_user_ratings(3, [[1, 5], [2, 3], [1, 4]]) == []\", \"assert filter_user_ratings(4, [[4, 5], [4, 3... | {
"split": "train",
"index": 63076,
"acecode_id": "bigcode_python_fns_13266",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a weighted undirected graph represented as an adjacency list, implement a function `find_shortest_paths(graph: Dict[str, Dict[str, int]], starting_vertex: str) -> Dict[str, int]` that returns the shortest path distances from the starting vertex to all other vertices in th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_shortest_paths({'A': {'B': 2}, 'B': {'A': 2, 'C': 2}, 'C': {'B': 2}}, 'A') == {'A': 0, 'B': 2, 'C': 4}\", \"assert find_shortest_paths({'A': {'B': 1}, 'B': {'A': 1, 'C': 1}, 'C': {'B': 1}}, 'A') == {'A': 0, 'B': 1, 'C': 2}\", \"assert find_shortest_path... | {
"split": "train",
"index": 63077,
"acecode_id": "evol_32847",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with assembling H2O molecules using a string representation of threads, where 'H' represents a hydrogen thread and 'O' represents an oxygen thread. Your goal is to rearrange the input string such that all 'H' and 'O' characters are grouped into valid water molecu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert assemble_h2o('HOH') in ['HHO', 'OHH']\", \"assert assemble_h2o('OOHHHH') in ['HHOHHO', 'HOHHOH', 'OHHHHO']\", \"assert assemble_h2o('HHOOO') in ['HHO', 'OHO']\", \"assert assemble_h2o('HHOHHO') in ['HHOHHO', 'HOHHHO']\", \"assert assemble_h2o('OOHH') in ['HH... | {
"split": "train",
"index": 63078,
"acecode_id": "evol_34450",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function to determine whether a given set of three cards forms a valid 'Set' according to the rules of the Set card game. Each card has four features: color, shape, number, and shading. A set of three cards is considered valid if, for e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_set(Card('red', 'circle', 1, 'solid'), Card('red', 'circle', 1, 'solid'), Card('red', 'circle', 1, 'solid')) == True\", \"assert is_valid_set(Card('red', 'circle', 1, 'solid'), Card('green', 'square', 2, 'striped'), Card('blue', 'triangle', 3, 'empt... | {
"split": "train",
"index": 63079,
"acecode_id": "oss_10425",
"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 in the range from `start` to `end`. If there are not enough distinct prime numbers in the specified range, return as many as possib... | 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(10, 30, 5) == [11, 13, 17, 19, 23]\", \"assert generate_distinct_primes(50, 70, 4) == [53, 59, 61, 67]\", \"assert gene... | {
"split": "train",
"index": 63080,
"acecode_id": "evol_20689",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of floating-point numbers representing weights, and you need to clip these weights to be within a specified range defined by a lower and upper bound. Implement a function `clip_weights(weights: List[float], weight_constraint: Tuple[float, float]) -> List[fl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert clip_weights([1.5, 2.3, 3.8], (2.0, 3.0)) == [2.0, 2.3, 3.0]\", \"assert clip_weights([-1.0, 0.5, 5.0], (0.0, 4.0)) == [0.0, 0.5, 4.0]\", \"assert clip_weights([0.0, 1.0, 2.0], (1.5, 2.5)) == [1.5, 1.5, 2.0]\", \"assert clip_weights([10.5, 9.1, 8.2], (8.0, 1... | {
"split": "train",
"index": 63081,
"acecode_id": "bigcode_python_fns_48651",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of integers and returns a new list containing the squares of each integer. The output should be in the format specified by a second parameter, `output_format`, which can either be 'integer' or 'string'. If `output_format... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert square_numbers([1, 2, 3, 4, 5], 'integer') == [1, 4, 9, 16, 25]\", \"assert square_numbers([1, 2, 3, 4, 5], 'string') == ['1', '4', '9', '16', '25']\", \"assert square_numbers([-1, -2, -3], 'integer') == [1, 4, 9]\", \"assert square_numbers([-1, -2, -3], 'st... | {
"split": "train",
"index": 63082,
"acecode_id": "oss_28476",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `binary_nor(x: int, y: int) -> int` that calculates the NOR of two binary digits. The inputs x and y will be either 0 or 1. The function should return 1 if both x and y are 0, otherwise return 0.\nPlease reason step by step, then write a self-contained Pyth... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binary_nor(0, 0) == 1\", \"assert binary_nor(0, 1) == 0\", \"assert binary_nor(1, 0) == 0\", \"assert binary_nor(1, 1) == 0\", \"assert binary_nor(0, 0) == 1\", \"assert binary_nor(1, 1) == 0\", \"assert binary_nor(1, 0) == 0\", \"assert binary_nor(0, 1) == ... | {
"split": "train",
"index": 63083,
"acecode_id": "evol_32638",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that calculates the skewness of a given list of numerical elements. The skewness is a measure of the asymmetry of the probability distribution of a real-valued random variable. You can use the formula for skewness defined as: \\( \\text{skewness} = \\fra... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_skewness([5, 10, 15, 20, 25]) == 0.0\", \"assert calculate_skewness([1, 2, 3]) == 0.0\", \"assert calculate_skewness([1, 2, 2, 3, 4, 5]) > 0\", \"assert calculate_skewness([5, 6, 7, 8, 9, 10]) == 0.0\", \"assert calculate_skewness([-5, -10, -15, -2... | {
"split": "train",
"index": 63084,
"acecode_id": "evol_6103",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries where each dictionary represents a book with keys for 'title', 'author', and 'price'. Your task is to create a function that takes this list as input and returns a list of strings formatted as 'Title: <title>, Author: <author>, Price: <price... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_books([{'title': 'Book A', 'author': 'Author A', 'price': 10.99}, {'title': 'Book B', 'author': 'Author B', 'price': 15.50}]) == ['Title: Book A, Author: Author A, Price: 10.99', 'Title: Book B, Author: Author B, Price: 15.50']\", \"assert format_book... | {
"split": "train",
"index": 63085,
"acecode_id": "oss_32027",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D pose represented by its x and y coordinates and an angle theta (in radians). Write a function `convert_pose` that converts this 2D pose into a 3D pose. The 3D pose should maintain the same x and y coordinates from the 2D pose, but the z coordinate should alwa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_pose(1, 2, 0) == ('Rotation(0)', (1, 2, 0))\", \"assert convert_pose(0, 0, 1.5708) == ('Rotation(1.5708)', (0, 0, 0))\", \"assert convert_pose(-1, -1, 3.14159) == ('Rotation(3.14159)', (-1, -1, 0))\", \"assert convert_pose(5, 5, 0) == ('Rotation(0)',... | {
"split": "train",
"index": 63086,
"acecode_id": "bigcode_python_fns_19901",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of words as input and returns a dictionary where each unique word is a key and its corresponding value is the number of times that word appears in the list. For example, given the input list ['apple', 'banana', 'apple', 'orange', 'banana',... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_words(['cat', 'dog', 'dog', 'cat', 'mouse', 'cat', 'cat']) == {'cat': 4, 'dog': 2, 'mouse': 1}\", \"assert count_words(['apple', 'banana', 'apple', 'orange', 'banana', 'banana']) == {'apple': 2, 'banana': 3, 'orange': 1}\", \"assert count_words(['hello... | {
"split": "train",
"index": 63087,
"acecode_id": "evol_22024",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two arrays of integers, merge them into a single array and implement the bubble sort algorithm to sort this new array. The algorithm must also detect duplicate values from the merge and must remove them during sorting. Write a function `merge_and_sort(arr1: List[int], arr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_and_sort([34, 16, 12, 9, 5], [15, 16, 10, 8, 5, 3]) == [3, 5, 8, 9, 10, 12, 15, 16, 34]\", \"assert merge_and_sort([1, 2, 3], [4, 5, 6]) == [1, 2, 3, 4, 5, 6]\", \"assert merge_and_sort([1, 1, 1], [1, 1, 1]) == [1]\", \"assert merge_and_sort([], [1, 2,... | {
"split": "train",
"index": 63088,
"acecode_id": "evol_20861",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with extracting product data from a simulated set of HTML pages. Write a Python function called `extract_product_data` that takes in a list of strings `html_pages`, where each string represents the HTML source code of a product page. The function should perform t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_product_data(['<div class=\\\"product-name\\\">Product A</div><div class=\\\"product-price\\\">$10.00</div>']) == [('Product A', '$10.00')]\", \"assert extract_product_data(['<div class=\\\"product-name\\\">Product B</div><div class=\\\"product-price... | {
"split": "train",
"index": 63089,
"acecode_id": "oss_18725",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_max(nested_list)` that takes a list which may contain numbers or nested lists of numbers. The function should return the maximum numeric value found within the list or nested lists. If the input is not a list, if it is an empty list, or if it contains... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max([1, 2, 3]) == 3\", \"assert find_max([[1, 2], [3, 4]]) == 4\", \"assert find_max([1, [2, [3, 4]], 5]) == 5\", \"assert find_max([[1, 2, 3], [4, [5, 6]]]) == 6\", \"assert find_max([[[1], 2], [3], 4]) == 4\", \"assert find_max([1, 2, [3, 4], [5, [6, ... | {
"split": "train",
"index": 63090,
"acecode_id": "evol_29795",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a list of datasets, each containing a list of files with their respective sizes, implement a function that calculates the total size of all files across all datasets. Your function should return the total size as an integer. Each dataset is represented as a dictionary wit... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert total_file_size([{'files': [{'bytes': 100}, {'bytes': 200}]}]) == 300\", \"assert total_file_size([{'files': [{'bytes': 50}, {'bytes': 150}]}]) == 200\", \"assert total_file_size([{'files': [{'bytes': 0}]}]) == 0\", \"assert total_file_size([{'files': [{'byt... | {
"split": "train",
"index": 63091,
"acecode_id": "bigcode_python_fns_27904",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of particle crossing events represented as a list of dictionaries. Each dictionary contains the following keys: 'particle_id' (an integer), 'x_position' (a float), 'y_position' (a float), 'z_position' (a float), and 'time' (a float). Your task is to write a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert identify_crossing_events([{'particle_id': 1, 'x_position': 0.0, 'y_position': 0.0, 'z_position': -1.0, 'time': 0.1}, {'particle_id': 1, 'x_position': 0.0, 'y_position': 0.0, 'z_position': 1.0, 'time': 0.2}, {'particle_id': 2, 'x_position': 1.0, 'y_position':... | {
"split": "train",
"index": 63092,
"acecode_id": "bigcode_python_fns_42183",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of URL patterns and extracts specific information from each pattern. Each URL pattern is represented as a tuple containing the URL regex, the corresponding view function, and the URL name. The URL regex is a s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_url_info([(r'^path1/$', 'view1', 'name1'), (r'^path2/$', 'view2', 'name2')]) == {'name1': ('view1', r'^path1/$'), 'name2': ('view2', r'^path2/$')}\", \"assert extract_url_info([(r'^path1/$', 'view1', None), (r'^path2/$', 'view2', 'name2')]) == {'name... | {
"split": "train",
"index": 63093,
"acecode_id": "oss_408",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of user answers, implement a function `get_answer(answerid: int, user_answers: List[str]) -> str` that returns a string formatted as 'Your updated answer: {answer}' where {answer} is the answer corresponding to the provided `answerid`. If the `answerid` is out of t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_answer(0, ['Answer 1', 'Answer 2', 'Answer 3']) == 'Your updated answer: Answer 1'\", \"assert get_answer(1, ['Answer 1', 'Answer 2', 'Answer 3']) == 'Your updated answer: Answer 2'\", \"assert get_answer(2, ['Answer 1', 'Answer 2', 'Answer 3']) == 'Your... | {
"split": "train",
"index": 63094,
"acecode_id": "bigcode_python_fns_36312",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string s, implement a function that determines whether the characters of the string can be rearranged to form a palindrome. A palindrome is a string that reads the same forwards and backwards. Return True if a valid palindrome can be formed, and False otherwise.\nPlease... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_form_palindrome('radar') == True\", \"assert can_form_palindrome('civic') == True\", \"assert can_form_palindrome('ivicc') == True\", \"assert can_form_palindrome('hello') == False\", \"assert can_form_palindrome('aabb') == True\", \"assert can_form_pali... | {
"split": "train",
"index": 63095,
"acecode_id": "evol_7301",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of intervals represented as pairs of floating-point numbers, write a function `min_intervals(intervals)` that determines the minimum number of non-overlapping intervals needed to cover the entire range of the provided intervals. An interval is represented as a list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert min_intervals([[1, 4], [2, 6], [8, 9], [3.2, 3.8], [2, 2]]) == 3\", \"assert min_intervals([[1, 2], [1, 2], [1, 2]]) == 1\", \"assert min_intervals([[1, 1], [1, 1], [1, 1]]) == 1\", \"assert min_intervals([[1, 3], [4, 5], [2, 4]]) == 2\", \"assert min_interv... | {
"split": "train",
"index": 63096,
"acecode_id": "evol_23619",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_empty_list` that generates an empty list in Python. The function should include error handling to catch any exceptions that may occur during the creation of the list and return a specific error message in such cases. If the list is created successfu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_empty_list() == []\", \"assert create_empty_list() == []\", \"assert create_empty_list() == []\", \"assert create_empty_list() == []\", \"assert create_empty_list() == []\", \"assert create_empty_list() == []\", \"assert create_empty_list() == []\", \... | {
"split": "train",
"index": 63097,
"acecode_id": "evol_33356",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates an HTTP status message. The function should be initialized with a default status code of 200 and a default message of 'OK'. You need to implement a function `generate_http_status_message(status_code: int, message: str) -> s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_http_status_message(200, 'OK') == 'Status Code: 200, Message: OK'\", \"assert generate_http_status_message(404, 'Not Found') == 'Status Code: 404, Message: Not Found'\", \"assert generate_http_status_message(500, 'Internal Server Error') == 'Status ... | {
"split": "train",
"index": 63098,
"acecode_id": "oss_26691",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that returns a new list containing only the even numbers from the original list, maintaining the order of their appearance. If there are no even numbers, return an empty list. The function signature should be: `def filter_even_numb... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([6, 7, 8, 9]) == [6, 8]\", \"assert filter_even_numbers([1, 3, 5, 7]) == []\", \"assert filter_even_numbers([-2, -1, 0, 1, 2]) == [-2, 0, 2]\", \"assert filter_even_numbers([]) ==... | {
"split": "train",
"index": 63099,
"acecode_id": "bigcode_python_fns_34384",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.