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": "Write a function in Python that takes a string as input and returns the number of consonants in that string. Consonants are all the letters in the English alphabet that are not vowels (a, e, i, o, u) and can be either uppercase or lowercase. Non-alphabetic characters should be ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_consonants('Hello world!') == 7\", \"assert count_consonants('AEIOU') == 0\", \"assert count_consonants('1234567890') == 0\", \"assert count_consonants('') == 0\", \"assert count_consonants('The quick brown fox jumps over the lazy dog.') == 24\", \"ass...
{ "split": "train", "index": 68500, "acecode_id": "evol_13010", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a string 's', a natural number 'n' and another natural number 'm', create a function that returns a list of all phrases from the string 's'. A phrase is a collection of words separated by a space, where the total count of consonants is 'n' and vowels' count is 'm'. Merge ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert select_phrases('', 2, 3) == []\", \"assert select_phrases('hello world', 3, 2) == ['hello']\", \"assert select_phrases('quick brown fox', 5, 2) == []\", \"assert select_phrases('xyz abc def', 3, 1) == []\", \"assert select_phrases('zoo', 1, 2) == ['zoo']\"]}...
{ "split": "train", "index": 68501, "acecode_id": "evol_18688", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the smooth L1 loss based on the following rules. The smooth L1 loss is defined as follows: \n- If the absolute value of the input `diff` is less than or equal to a given threshold `delta`, return 0.5 times the square ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert smooth_l1_loss(0.5) == 0.125\", \"assert smooth_l1_loss(0.0) == 0.0\", \"assert smooth_l1_loss(2.0) == 1.5\", \"assert smooth_l1_loss(1.0) == 0.5\", \"assert smooth_l1_loss(-1.0) == 0.5\", \"assert smooth_l1_loss(1.1) == 0.5 + 1.0 * (1.1 - 1.0)\"]}" }
{ "split": "train", "index": 68502, "acecode_id": "bigcode_python_fns_27858", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a positive integer n and a list of strings representing metadata column headers, implement a function `generate_columns(n: int, metadata_column_headers: List[str]) -> Dict[str, List[str]]` that creates a dictionary where each key is a metadata column header and the corres...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_columns(3, ['header1', 'header2']) == {'header1': ['val0', 'val1', 'val2'], 'header2': ['val0', 'val1', 'val2']}\", \"assert generate_columns(1, ['colA', 'colB', 'colC']) == {'colA': ['val0'], 'colB': ['val0'], 'colC': ['val0']}\", \"assert generate...
{ "split": "train", "index": 68503, "acecode_id": "bigcode_python_fns_24215", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that simulates a treasure collection game on a 2D grid. The grid represents a game world where each cell can either be empty, contain a treasure, or be blocked by an obstacle. You need to implement the `play_game` function, whi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert play_game([[0, 0, 0], [1, -1, 1], [0, 1, 0]], (0, 0), 'DDRR') == 2\", \"assert play_game([[1, 0, 0], [0, -1, 0], [1, 0, 1]], (0, 0), 'DDLL') == 1\", \"assert play_game([[0, 1, 0], [0, 0, 0], [0, 1, -1]], (0, 0), 'DDR') == 1\", \"assert play_game([[0, 0, 0], ...
{ "split": "train", "index": 68504, "acecode_id": "oss_7534", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given an integer array of `digits`, return the largest multiple of three that can be formed by concatenating some of the given digits in any order. The resulting number must have an even number of digits. If there is no answer, return an empty string. The answer should be retur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert largestMultipleOfThree([8,6,7,1,0,2]) == '876210'\", \"assert largestMultipleOfThree([1,2]) == '21'\", \"assert largestMultipleOfThree([0,0,0,0,0,0]) == '0'\", \"assert largestMultipleOfThree([3,3,3,3]) == '3333'\", \"assert largestMultipleOfThree([1,2,3,4,5...
{ "split": "train", "index": 68505, "acecode_id": "evol_11877", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes two lists of integers and returns a new list containing only the elements that are present in both input lists. The order of the elements in the output list should be the same as they appear in the first list. If there are no c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert common_elements([1, 2, 3, 4, 5], [3, 4, 5, 6, 7]) == [3, 4, 5]\", \"assert common_elements([1, 2, 2, 3], [2, 2, 4]) == [2]\", \"assert common_elements([1, 2, 3], [4, 5, 6]) == []\", \"assert common_elements([], [1, 2, 3]) == []\", \"assert common_elements([5...
{ "split": "train", "index": 68506, "acecode_id": "bigcode_python_fns_20411", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `mayan_number(number: int) -> List[int]` that takes an integer value and returns its corresponding Mayan numeral representation as a list of integers. Each integer in the output list represents a Mayan digit, where the least significant digit is at index 0....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert mayan_number(0) == []\", \"assert mayan_number(1) == [1]\", \"assert mayan_number(5) == [5]\", \"assert mayan_number(19) == [19]\", \"assert mayan_number(21) == [1, 1]\", \"assert mayan_number(399) == [19, 19]\", \"assert mayan_number(39) == [19, 1]\", \"ass...
{ "split": "train", "index": 68507, "acecode_id": "evol_32812", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the prices of products. Your task is to implement a function that calculates the average price of these products. The function should take in a list of integers and return a float representing the average price. If the list is empty...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average_price([10, 20, 30]) == 20.0\", \"assert calculate_average_price([1, 2, 3, 4, 5]) == 3.0\", \"assert calculate_average_price([100, 200, 300]) == 200.0\", \"assert calculate_average_price([5]) == 5.0\", \"assert calculate_average_price([]) ==...
{ "split": "train", "index": 68508, "acecode_id": "bigcode_python_fns_41518", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes a string as input and returns a dictionary containing the frequency of each distinct word in the string. The function should be case-insensitive and consider word boundaries to accurately count words. For example, 'Hello world hello' should count 'he...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_word_frequency('The quick brown fox jumps over the lazy dog') == {'the': 2, 'quick': 1, 'brown': 1, 'fox': 1, 'jumps': 1, 'over': 1, 'lazy': 1, 'dog': 1}\", \"assert calculate_word_frequency('Hello world hello') == {'hello': 2, 'world': 1}\", \"ass...
{ "split": "train", "index": 68509, "acecode_id": "evol_25230", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a payload for querying tickets in a ticketing system API. The payload must contain the following components: the HTTP method to be used for the request, the endpoint for the ticket query API, any query parameters (which sho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_ticket_query_payload('PUT', '/v1/mmlogic/tickets:update', ['id', 'status'], 1) == {'method': 'PUT', 'endpoint': '/v1/mmlogic/tickets:update', 'params': None, 'body': pool_generator(random.choices(['id', 'status'], k=1))}\", \"assert generate_ticket_...
{ "split": "train", "index": 68510, "acecode_id": "oss_15832", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Given two integers `txt_len` (the length of a text) and `vocab_size` (the size of its vocabulary), implement a function `guiraud_r` that calculates the Root Type-Token Ratio (RTTR) using the formula: `RTTR = vocab_size / sqrt(txt_len)`. The function should return the RTTR as a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert abs(guiraud_r(100, 20) - 2.0) < 1e-9\", \"assert abs(guiraud_r(64, 16) - 2.0) < 1e-9\", \"assert abs(guiraud_r(1, 0) - 0.0) < 1e-9\", \"assert abs(guiraud_r(25, 5) - 1.0) < 1e-9\", \"assert abs(guiraud_r(36, 6) - 1.0) < 1e-9\", \"assert abs(guiraud_r(144, 12...
{ "split": "train", "index": 68511, "acecode_id": "bigcode_python_fns_35455", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the nodes of a tree. Each node is represented by an integer value, and nodes can be connected to form a tree structure. Your task is to implement a function that retrieves all the unique values from this list of nodes, which represe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_virtual_roots([3, 1, 2, 3, 2]) == [1, 2, 3]\", \"assert get_virtual_roots([5, 5, 5, 5]) == [5]\", \"assert get_virtual_roots([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert get_virtual_roots([10, 2, 4, 10, 6]) == [2, 4, 6, 10]\", \"assert get_virtual_roo...
{ "split": "train", "index": 68512, "acecode_id": "bigcode_python_fns_43507", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `create_element` that takes the following parameters: `symbol` (str), `name` (str), `atomic_number` (int), `atomic_mass` (float), and `properties` (dict). The function should return a dictionary representing a chemical element with the pr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_element('O', 'Oxygen', 8, 15.999, {'mw': '1.0 g/mol', '_emit': True}) == {'symbol': 'O', 'name': 'Oxygen', 'atomic_number': 8, 'atomic_mass': 15.999, 'properties': {'mw': '1.0 g/mol', '_emit': True}}\", \"assert create_element('H', 'Hydrogen', 1, 1.00...
{ "split": "train", "index": 68513, "acecode_id": "oss_20535", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries, each representing a device with a unique ID and its attributes including 'host' (a string) and 'type' (a string). Write a function `setup_devices(devices: List[Dict[str, str]]) -> Dict[str, str]` that processes this list and returns a dicti...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert setup_devices([{'id': 'device1', 'host': '192.168.1.1', 'type': 'sensor'}, {'id': 'device2', 'host': '192.168.1.2', 'type': 'actuator'}]) == {'device1': 'Setup successful', 'device2': 'Setup failed'}\", \"assert setup_devices([{'id': 'device3', 'host': '192....
{ "split": "train", "index": 68514, "acecode_id": "bigcode_python_fns_48898", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks for the presence of specific environment variables and assigns default values to them if they are not present. The function should take a dictionary containing environment variable names as keys and their default values as val...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert assign_env_variables({'DB_HOST': 'localhost', 'DB_PORT': '5432', 'DB_USER': 'admin', 'DB_PASSWORD': 'password123', 'SECRET_KEY': 'mysecretkey'}) == {'DB_HOST': 'localhost', 'DB_PORT': '5432', 'DB_USER': 'admin', 'DB_PASSWORD': 'password123', 'SECRET_KEY': 'm...
{ "split": "train", "index": 68515, "acecode_id": "oss_37477", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are working on a web API for a project management system. The API receives requests to create new projects, and it expects certain parameters to be provided. The parameters are as follows: `attach` (string), `description` (string), `detection_chance` (integer), `project_id`...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validateProjectParams('location/path', 'Project Description', 90, 1, 1, 123) == 'All parameters are valid. Project creation successful.'\", \"assert validateProjectParams(123, 'Project Description', 90, 1, 1, 123) == \\\"Error: 'attach' should be a string.\\...
{ "split": "train", "index": 68516, "acecode_id": "oss_31558", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with validating tickets for an event based on specified rules for ticket fields. Each field has a set of valid ranges defined in the format 'field: range1 or range2', where each range is specified as 'min-max'. Your task is to implement a function `validate_ticke...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_tickets({'class': [[1, 3], [5, 7]], 'row': [[6, 11], [33, 44]], 'seat': [[13, 40], [45, 50]]}, [7, 1, 14], [[7, 3, 47], [40, 4, 50], [55, 2, 20], [38, 6, 12]]) == 71\", \"assert validate_tickets({'age': [[1, 10]], 'id': [[100, 200]]}, [5, 150], [[10...
{ "split": "train", "index": 68517, "acecode_id": "oss_1615", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Write a function named `symmetric_difference` that takes two lists of integers as input and returns a list containing the elements that are present in one of the lists but not both. If either input is not a list, the function should raise a ValueError with the message 'Input sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert symmetric_difference([1, 2, 3], [2, 3, 4]) == [1, 4]\", \"assert symmetric_difference([], [1, 2, 3]) == [1, 2, 3]\", \"assert symmetric_difference([5, 6, 7], []) == [5, 6, 7]\", \"assert symmetric_difference([1, 2, 3], [1, 2, 3]) == []\", \"assert symmetric_...
{ "split": "train", "index": 68518, "acecode_id": "evol_9565", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `paginate_results(results: List[Dict[str, Any]], command: str) -> List[str]`. This function will take in a list of dictionaries `results`, where each dictionary represents a search result with string keys and values of any type. The f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert paginate_results([], 'N') == []\", \"assert paginate_results([{'item': 'A'}], 'N') == ['item: A']\", \"assert paginate_results([{'item': 'A'}, {'item': 'B'}], 'N') == ['item: A', 'item: B']\", \"assert paginate_results([{'item': 'A'}, {'item': 'B'}, {'item':...
{ "split": "train", "index": 68519, "acecode_id": "bigcode_python_fns_43003", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given two integers, x and y. Your task is to write a function that calculates the number of bits that differ between the binary representations of x and y. Implement a function `count_different_bits(x, y)` that takes in two integers x and y and returns the count of diff...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_different_bits(5, 3) == 2\", \"assert count_different_bits(0, 0) == 0\", \"assert count_different_bits(1, 0) == 1\", \"assert count_different_bits(1, 2) == 2\", \"assert count_different_bits(255, 0) == 8\", \"assert count_different_bits(15, 15) == 0\",...
{ "split": "train", "index": 68520, "acecode_id": "oss_23272", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a string representing the name of a branch in a version control system. Your task is to implement a function `respond_to_command(branch: str) -> str` that performs the following actions based on the input branch name: \n- If the branch name is 'develop', return th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert respond_to_command('develop') == 'Development deployment startedBranch develop deployed successfully.'\", \"assert respond_to_command('master') == 'Production deployment startedBranch master deployed successfully.'\", \"assert respond_to_command('feature') =...
{ "split": "train", "index": 68521, "acecode_id": "bigcode_python_fns_18885", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `get_public_urls(service_name, services)` that takes a service name and a list of services represented as dictionaries. Each service dictionary contains its name as a key and a list of endpoints as its value. Each endpoint is a dictionary...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_public_urls('compute', [{'compute': [{'id': '1e6cecbd15b3413d9411052c52b9d433', 'publicURL': 'https://mycloud.org:13074/v2.1/6d2847d6a6414308a67644eefc7b98c7'}]}]) == ['https://mycloud.org:13074/v2.1/6d2847d6a6414308a67644eefc7b98c7']\", \"assert get_pub...
{ "split": "train", "index": 68522, "acecode_id": "oss_21609", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to calculate the square root of a given positive number with a specified precision using the Newton-Raphson method. The function should iteratively approximate the square root until the absolute difference between consecutive approxim...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert abs(sqrt_with_precision(2, 0.001) - 1.414) < 0.001\", \"assert abs(sqrt_with_precision(4, 0.0001) - 2.0) < 0.0001\", \"assert abs(sqrt_with_precision(9, 0.01) - 3.0) < 0.01\", \"assert abs(sqrt_with_precision(16, 0.001) - 4.0) < 0.001\", \"assert abs(sqrt_wi...
{ "split": "train", "index": 68523, "acecode_id": "oss_14900", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the total number of valid parameter combinations for a grid search based on a given machine learning model and its parameters. The function should take two inputs: a string representing the model type (either 'FNN', 'LSTM', or 'NDL') and a dictio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert estimate_gridsearch_size('NDL', {'learning_rate': [0.01, 0.1], 'batch_size': [32, 64]}) == 4\", \"assert estimate_gridsearch_size('FNN', {'hidden_layers': [0], 'activation': [None], 'embedding_input': [None], 'embedding_dim': [None], 'max_len': [None]}) == 1...
{ "split": "train", "index": 68524, "acecode_id": "bigcode_python_fns_20966", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Write a function `interlace_strings(str1: str, str2: str) -> str` that takes two strings as input and returns a new string formed by interlacing the characters of the two strings. If one string is longer than the other, append the remaining characters of the longer string to th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert interlace_strings('abc', '123') == 'a1b2c3'\", \"assert interlace_strings('abc', '') == 'abc'\", \"assert interlace_strings('', '123') == '123'\", \"assert interlace_strings('abcd', '12') == 'a1b2cd'\", \"assert interlace_strings('12', 'abcd') == '1a2bcd'\",...
{ "split": "train", "index": 68525, "acecode_id": "evol_28228", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given two sequences of integers, `seq1` and `seq2`. Your task is to implement a function `min_cost_transform(seq1, seq2)` that calculates the minimum cost of transforming `seq1` into `seq2`. The cost of transformation is defined as follows: 1. Deleting an element from `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert min_cost_transform([1, 2, 3], [2, 3, 4]) == 2\", \"assert min_cost_transform([1, 2], [1, 2]) == 0\", \"assert min_cost_transform([], [1, 2]) == 2\", \"assert min_cost_transform([1, 2], []) == 2\", \"assert min_cost_transform([1, 3, 5], [1, 2, 3]) == 2\", \"a...
{ "split": "train", "index": 68526, "acecode_id": "oss_15702", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings that represent text elements extracted from an Optical Character Recognition (OCR) system. Your task is to write a function that identifies the indices of any empty text elements in the list and returns them as a list of integers. An empty text e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_empty_text_indices(['Hello', '', 'World', '']) == [1, 3]\", \"assert find_empty_text_indices(['', 'Test', '']) == [0, 2]\", \"assert find_empty_text_indices(['Non-empty string']) == []\", \"assert find_empty_text_indices(['', '', '', '']) == [0, 1, 2, 3...
{ "split": "train", "index": 68527, "acecode_id": "oss_9678", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of elements and returns the smallest numeric value from that list. If the list contains non-numeric values or is empty, the function should return an appropriate error message. The function should handle exceptions gracefully.\nPlease reas...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_min([11, 9, 10, 14]) == 9\", \"assert find_min([]) == 'List contains no numeric values.'\", \"assert find_min(['a', 'b', 'c']) == 'List contains no numeric values.'\", \"assert find_min([1, 2, 3, 'x']) == 1\", \"assert find_min([5.5, 6.1, 4.3]) == 4.3\"...
{ "split": "train", "index": 68528, "acecode_id": "evol_10605", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a function that computes and maintains an array where each element at the i'th position is the result of the multiplication of all numbers in the initial integer array excluding the one at the i'th position. The function should also allow for efficient updates to the ori...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_excluding_self([1, 2, 3, 4]) == [24, 12, 8, 6]\", \"assert compute_excluding_self([5, 2, 3, 4]) == [24, 60, 40, 30]\", \"assert compute_excluding_self([1]) == [1]\", \"assert compute_excluding_self([2, 3]) == [3, 2]\", \"assert compute_excluding_self...
{ "split": "train", "index": 68529, "acecode_id": "evol_21177", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to start a web server. The function should accept two parameters: a 'context' object that contains configuration settings and a 'port' number (an integer) on which the server will run. Your function should return a string indicating t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert start_web_server('Production', 8080) == 'Server is running on port 8080 with context Production'\", \"assert start_web_server('Development', 3000) == 'Server is running on port 3000 with context Development'\", \"assert start_web_server('Testing', 5000) == '...
{ "split": "train", "index": 68530, "acecode_id": "bigcode_python_fns_14867", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `get_vehicle_info(brand: str, model: str, year: int) -> str` that takes a vehicle's brand, model, and year as input and returns a formatted string containing the vehicle's information in the format 'brand model, year'.\nPlease reason step by step, then writ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_vehicle_info('Tesla', 'Model X', 2019) == 'Tesla Model X, 2019'\", \"assert get_vehicle_info('Toyota', 'Corolla', 2020) == 'Toyota Corolla, 2020'\", \"assert get_vehicle_info('Ford', 'Mustang', 2021) == 'Ford Mustang, 2021'\", \"assert get_vehicle_info('...
{ "split": "train", "index": 68531, "acecode_id": "evol_5277", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given four floating-point numbers representing the CMYK color model (C, M, Y, K), where each value ranges from 0 to 1, write a function that converts these values into the RGB color model. The function should return a tuple of three floating-point numbers representing the RGB v...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cmyk_to_rgb(0, 0, 0, 0) == (1.0, 1.0, 1.0)\", \"assert cmyk_to_rgb(0, 0, 0, 1) == (0.0, 0.0, 0.0)\", \"assert cmyk_to_rgb(0.5, 0, 0, 0) == (0.5, 1.0, 1.0)\", \"assert cmyk_to_rgb(0, 0.5, 0.5, 0) == (1.0, 0.5, 0.5)\", \"assert cmyk_to_rgb(0, 0, 0.5, 0) == (1....
{ "split": "train", "index": 68532, "acecode_id": "bigcode_python_fns_1353", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are working on a data processing workflow for a web application pipeline, which consists of several stages: QUERYLOG, SESSIONS_RAW, SESSIONS_HOURLY, SPANS, and TRANSACTIONS. Your task is to implement a function that takes the name of a stage as input and returns the name of...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_next_stage('querylog') == 'sessions_raw'\", \"assert get_next_stage('sessions_raw') == 'sessions_hourly'\", \"assert get_next_stage('sessions_hourly') == 'spans'\", \"assert get_next_stage('spans') == 'transactions'\", \"assert get_next_stage('transactio...
{ "split": "train", "index": 68533, "acecode_id": "oss_30191", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing a block of code. Your task is to implement a function that analyzes this code and counts the number of lines of code that are not comments or empty lines, as well as the number of distinct functions defined in the code. A function is defined ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert analyze_code(\\\"# This is a comment\\\\n\\\\ndef example_function(param):\\\\n pass\\\\n\\\\n\\\\n# Another comment\\\\ndef another_function(x, y):\\\\n return x - y\\\\n\\\") == (2, 2)\", \"assert analyze_code(\\\"# Empty function\\\\n\\\\ndef empty_...
{ "split": "train", "index": 68534, "acecode_id": "evol_25417", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a modal template for a workflow based on the provided user input and selected workflow details. The function should take the following parameters: `incident` (a dictionary with incident details), `workflows` (a list of dict...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_modal_template({'id': 1, 'description': 'Incident 1'}, [{'id': 1, 'name': 'Workflow 1'}], {'id': 1, 'description': 'Workflow Description 1', 'parameters': [{'key': 'param1'}, {'key': 'param2'}]}) == {'blocks': [{'type': 'section', 'text': {'type': '...
{ "split": "train", "index": 68535, "acecode_id": "bigcode_python_fns_23176", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a list of integers representing the intensity values of a mass spectrometry experiment, your task is to identify valid regions of interest (ROIs) based on specific criteria. A region is considered valid if the following conditions are met: it contains at least 'min_length...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_valid_rois([None, None, None, None], 2, 1, 0) == []\", \"assert find_valid_rois([None, None, 1, 2, 3], 2, 2, 1) == [(2, 4)]\", \"assert find_valid_rois([None, None, None], 3, 1, 0) == []\", \"assert find_valid_rois([None, 1, 2, None, None], 2, 3, 1) == ...
{ "split": "train", "index": 68536, "acecode_id": "bigcode_python_fns_4424", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are given a list of strings `l`. Your task is to write a function `manipulate_list(l)` that returns a sorted version of the list, the type of the list, the length of the list, and the string representation of the list in the following format: a tuple containing the sorted l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manipulate_list(['c', 'a', 'b']) == (['a', 'b', 'c'], \\\"<class 'list'>\\\", 3, \\\"['c', 'a', 'b']\\\")\", \"assert manipulate_list(['apple', 'orange', 'banana']) == (['apple', 'banana', 'orange'], \\\"<class 'list'>\\\", 3, \\\"['apple', 'orange', 'banana...
{ "split": "train", "index": 68537, "acecode_id": "oss_23303", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a date in the format 'YYYY-MM-DD', return the corresponding German weekday name for that date. The output should be one of the following strings: 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag', or 'Sonntag'. You can assume that the input date is vali...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert german_weekday_name('2023-10-01') == 'Sonntag'\", \"assert german_weekday_name('2023-10-02') == 'Montag'\", \"assert german_weekday_name('2023-10-03') == 'Dienstag'\", \"assert german_weekday_name('2023-10-04') == 'Mittwoch'\", \"assert german_weekday_name('...
{ "split": "train", "index": 68538, "acecode_id": "bigcode_python_fns_8117", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that validates a job configuration for a distributed computing system. The function should take two parameters: an integer representing the number of instances for the job, and a string representing the coordination command line. The ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_job_configuration(3, 'python coordinator.py') == True\", \"assert validate_job_configuration(1, '') == False\", \"assert validate_job_configuration(0, 'java -jar coordinator.jar') == True\", \"assert validate_job_configuration(10, 'bash run.sh') == ...
{ "split": "train", "index": 68539, "acecode_id": "oss_8480", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers representing stock prices over a period, implement a function `predict_trend(prices: List[int]) -> List[int]` that predicts the trend of these prices by categorizing each price into different trend clusters. The output should be a list of integers where...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert predict_trend([5, 5, 5, 5]) == [0, 0, 0, 0]\", \"assert predict_trend([3, 2, 1]) == [0, 1, 2]\", \"assert predict_trend([2, 3, 4, 5]) == [0, 0, 0, 0]\", \"assert predict_trend([10, 10, 10, 10, 10]) == [0, 0, 0, 0, 0]\", \"assert predict_trend([1]) == [0]\", ...
{ "split": "train", "index": 68540, "acecode_id": "bigcode_python_fns_49373", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Implement a function `get_movie_details(title: str) -> Optional[Dict[str, Union[str, int]]]` that retrieves the details of a movie given its title. The function should return a dictionary containing the following details: Movie name, Director, Actors, Year of Release, and Durat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_movie_details('Inception') == {'Movie Name': 'Inception', 'Director': 'Christopher Nolan', 'Actors': ['Leonardo DiCaprio', 'Joseph Gordon-Levitt', 'Elliot Page'], 'Year of Release': 2010, 'Duration': 148}\", \"assert get_movie_details('The Shawshank Rede...
{ "split": "train", "index": 68541, "acecode_id": "evol_7831", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Implement a function that inserts a specified value into a multidimensional list at a given set of indices. The function should take in a multidimensional list, a list of indices, and a value to insert. The insertion should replace the existing value at the specified indices. I...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert insert_in_multidim([[1, 2], [3, 4]], [0, 1], 5) == [[1, 5], [3, 4]]\", \"assert insert_in_multidim([[1, 2], [3, 4]], [1, 0], 6) == [[1, 2], [6, 4]]\", \"assert insert_in_multidim([[1, 2, 3], [4, 5, 6]], [0, 2], 7) == [[1, 2, 7], [4, 5, 6]]\", \"assert insert...
{ "split": "train", "index": 68542, "acecode_id": "evol_14080", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of posts represented by tuples, where each tuple contains two integers: `id_post` and `id_parent_post`. Your task is to implement a function `determine_node_types(posts: List[Tuple[int, int]]) -> List[Tuple[int, str]]` that categorizes each post as either a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert determine_node_types([(1, 0), (2, 1), (3, 1), (4, 2)]) == [(1, 'parent'), (2, 'parent'), (3, 'leaf'), (4, 'leaf')]\", \"assert determine_node_types([(5, 0), (6, 0), (7, 5)]) == [(5, 'parent'), (6, 'leaf'), (7, 'leaf')]\", \"assert determine_node_types([(8, 0...
{ "split": "train", "index": 68543, "acecode_id": "bigcode_python_fns_1898", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a list of complex refractive indices `n_list` and a list of corresponding thicknesses `d_list`, implement a function `calculate_alpha_d(n_index: complex, d_index: float, lam: float) -> float` that calculates the absorption coefficient `alpha_d`. The absorption coefficient...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_alpha_d(1.0, 1e5, 200) == 0.0\", \"assert calculate_alpha_d(4.0, 50, 200) == 0.0\", \"assert calculate_alpha_d(1 + 3j, 0, 200) == 0.0\", \"assert calculate_alpha_d(0 + 0j, 50, 200) == 0.0\", \"assert calculate_alpha_d(1 + 0j, 25, 250) == 0.0\", \"a...
{ "split": "train", "index": 68544, "acecode_id": "bigcode_python_fns_17859", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Write a function that identifies the most frequent words in a given sentence while also taking into consideration the following conditions: 1. The function should be case-insensitive, i.e., 'Summer' and 'summer' should be treated as the same word. 2. The function should ignore ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert most_frequent_word('Hello, hello? Hello!') == (['hello'], 3)\", \"assert most_frequent_word('To be, or not to be: that is the question.') == (['to', 'be'], 2)\", \"assert most_frequent_word('Wow! This is amazing, amazing indeed!') == (['amazing'], 2)\", \"as...
{ "split": "train", "index": 68545, "acecode_id": "evol_18628", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Implement a function that determines if two input strings contain identical unique words, ignoring case and non-alphanumeric characters, while also ensuring that those words appear in the same exact order and frequency. The function should return True if both strings meet these...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert evaluate_word_sets_order_and_frequency('Hello World!', 'hello world') == True\", \"assert evaluate_word_sets_order_and_frequency('This is a test', 'This is a test') == True\", \"assert evaluate_word_sets_order_and_frequency('Python is fun', 'python is fun') ...
{ "split": "train", "index": 68546, "acecode_id": "evol_10759", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `user_password_check(password)` that takes a string representing a user's password and returns 'Valid' if the password meets the criteria, and 'Invalid' otherwise. A password is considered valid if it satisfies the following conditions: - It is between 8 an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert user_password_check('1234A@b') == 'Invalid'\", \"assert user_password_check('Password123') == 'Invalid'\", \"assert user_password_check('Pa$$w0rd!') == 'Valid'\", \"assert user_password_check('P@ss12') == 'Invalid'\", \"assert user_password_check('123@@@') =...
{ "split": "train", "index": 68547, "acecode_id": "evol_14867", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given two lists of points representing two curves in a 2D plane. Each point is represented as a tuple of x and y coordinates. Your task is to implement a function that calculates the average distance between corresponding points on these two curves. The average distance...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_curve_distance([(0, 0), (1, 1)], [(0, 0), (1, 1)]) == 0.0\", \"assert average_curve_distance([(0, 0), (1, 1)], [(0, 1), (1, 0)]) == 1.0\", \"assert average_curve_distance([(0, 0), (2, 2)], [(0, 0), (2, 4)]) == 1.0\", \"assert average_curve_distance([...
{ "split": "train", "index": 68548, "acecode_id": "bigcode_python_fns_19149", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of numbers, write a function that computes the kurtosis of the distribution. The kurtosis is defined as the fourth central moment divided by the square of the second central moment. You need to implement a function `kurtosis(inlist: List[float]) -> float`, where `i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert kurtosis([1, 1, 1, 1, 1]) == None\", \"assert kurtosis([0, 0, 0, 0]) == None\", \"assert kurtosis([3, 3, 3, 3, 3]) == None\", \"assert kurtosis([1, 1, 2, 2]) == 1.0\", \"assert kurtosis([2, 2, 2]) == None\", \"assert kurtosis([0]) == None\"]}" }
{ "split": "train", "index": 68549, "acecode_id": "bigcode_python_fns_49439", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of comma-separated strings, where each string represents a row of data. Your function should print each row of data without any list brackets or quotes. Each row should be printed on a new line. Implement a function `pri...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert print_csv_rows(['name,age,city', 'Alice,30,New York', 'Bob,25,Los Angeles']) == None\", \"assert print_csv_rows(['item,quantity,price', 'apple,10,1.50', 'banana,5,0.75']) == None\", \"assert print_csv_rows(['header1,header2', 'data1,data2', 'data3,data4']) =...
{ "split": "train", "index": 68550, "acecode_id": "bigcode_python_fns_36136", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the weighted loss for a Gaussian regression model. The function should accept three parameters: 'pred' (a list of predicted values), 'target' (a list of target values), and 'weight' (a list of weights corresponding to ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert abs(weighted_loss([0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [1.0, 1.0, 1.0]) - 0.0) < 1e-9\", \"assert abs(weighted_loss([1.0, 1.0, 1.0], [2.0, 2.0, 2.0], [1.0, 1.0, 1.0]) - 1.0) < 1e-9\", \"assert abs(weighted_loss([0.0, 1.0, 2.0], [0.0, 1.0, 2.0], [1.0, 1.0, 1.0])...
{ "split": "train", "index": 68551, "acecode_id": "bigcode_python_fns_48592", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that takes a list of integers and returns the sum of all even numbers in that list. The function should handle empty lists and ensure that the input is always a list of integers. Write a function called `sum_of_evens` that implemen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_evens([]) == 0\", \"assert sum_of_evens([1, 3, 5]) == 0\", \"assert sum_of_evens([2, 4, 6]) == 12\", \"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([10, 20, 30, 25]) == 60\", \"assert sum_of_evens([-2, -4, -6]) == -12\", \"assert...
{ "split": "train", "index": 68552, "acecode_id": "oss_27096", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simple thread pool for managing concurrent tasks. Your function should take two parameters: an integer `max_threads` which defines the maximum number of concurrent threads, and a list of strings `links`, where each st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert thread_pool_simulation(3, ['http://example1.com', 'http://example2.com', 'http://example3.com']) == ['http://example1.com', 'http://example2.com', 'http://example3.com']\", \"assert thread_pool_simulation(2, ['http://example1.com', 'http://example2.com', 'ht...
{ "split": "train", "index": 68553, "acecode_id": "oss_37285", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of genome strings, calculate the pairwise Hamming distances between the genomes. The Hamming distance between two strings is defined as the number of positions at which the corresponding symbols are different. You should only consider the standard nucleotides (A, T...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_hamming_distances(['A', 'A']) == [0]\", \"assert get_hamming_distances(['A', 'T']) == [1]\", \"assert get_hamming_distances(['ATG', 'ATG', 'ATC']) == [0, 1]\", \"assert get_hamming_distances(['ATCG', 'ATCG', 'ATGG']) == [0, 1]\", \"assert get_hamming_dis...
{ "split": "train", "index": 68554, "acecode_id": "bigcode_python_fns_23569", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the number of active connections for various services in a system. Your task is to implement a function that takes this list as input and returns the total number of connections that are currently active across all services. The fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert total_active_connections([1, 2, 3]) == 6\", \"assert total_active_connections([0, 0, 0]) == 0\", \"assert total_active_connections([5, 10, 15]) == 30\", \"assert total_active_connections([1]) == 1\", \"assert total_active_connections([100, 200, 300]) == 600\...
{ "split": "train", "index": 68555, "acecode_id": "bigcode_python_fns_13315", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a DNA sequence in the form of a string containing characters 'A', 'C', 'G', and 'T'. Your task is to write a function that finds the reverse complement of the given DNA sequence. The reverse complement of a DNA sequence is formed by reversing the sequence and repl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverseComplement('AGTCCGTA') == 'TACGGACT'\", \"assert reverseComplement('A') == 'T'\", \"assert reverseComplement('T') == 'A'\", \"assert reverseComplement('C') == 'G'\", \"assert reverseComplement('G') == 'C'\", \"assert reverseComplement('ATCGTAGC') == '...
{ "split": "train", "index": 68556, "acecode_id": "oss_2722", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with expanding a configuration dictionary that may contain simple string values or lists of strings. Your goal is to implement a function `expand_config` that takes a configuration dictionary as input and generates all possible configurations by expanding the lis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert expand_config({'host': 'localhost'}) == [{'host': 'localhost'}]\", \"assert expand_config({'host': 'localhost', 'ports': ['8080']}) == [{'host': 'localhost', 'ports': '8080'}]\", \"assert expand_config({'host': 'localhost', 'protocols': ['http', 'https']}) =...
{ "split": "train", "index": 68557, "acecode_id": "oss_2735", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a URL for a server-side rendering service based on a list of image layer URLs and an optional size parameter. The function should take a list of strings, where each string represents an image URL, and an optional size param...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert build_layers_url(['url1', 'url2'], 'SIZE_300') == 'https://impress-2020.openneo.net/api/outfitImage?size=300&layerUrls=url1,url2'\", \"assert build_layers_url(['url1']) == 'https://impress-2020.openneo.net/api/outfitImage?size=600&layerUrls=url1'\", \"assert...
{ "split": "train", "index": 68558, "acecode_id": "bigcode_python_fns_12988", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string representing an email address, implement a function `validate_email` that returns `True` if the email address is valid according to the following criteria: 1. It contains a single '@' symbol. 2. The '@' symbol is not at the beginning or end of the email address. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_email('test@example.com') == True\", \"assert validate_email('user.name@domain.org') == True\", \"assert validate_email('user-name@domain.net') == True\", \"assert validate_email('user_name@domain.com') == True\", \"assert validate_email('@domain.co...
{ "split": "train", "index": 68559, "acecode_id": "oss_37085", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that simulates the behavior of a simple file writing system. The function `write_to_file(filename: str, content: str) -> bool` should take in two parameters: a filename (a string) and content (also a string). It should write the content to...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert write_to_file('myfile.txt', 'Hello World!') == True\", \"assert write_to_file('example.txt', 'Sample text') == True\", \"assert write_to_file('test.txt', 'Test content') == True\", \"assert write_to_file('data.txt', 'Data to write') == True\", \"assert write...
{ "split": "train", "index": 68560, "acecode_id": "bigcode_python_fns_11391", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a buy-to-open (BTO) order for a high-risk trading strategy. The order must be built based on the following parameters: a contract price, a high risk flag, and several user settings such as high risk order value, buy lim...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_bto_order(3.00, 1500, 0.05, 0.20) == {'price': 3.15, 'quantity': 476, 'orderStrategyType': 'TRIGGER', 'childOrderStrategies': [{'orderType': 'STOP', 'stopPrice': 2.52}]}\", \"assert process_bto_order(5.00, 3000, 0.02, 0.10) == {'price': 5.10, 'quanti...
{ "split": "train", "index": 68561, "acecode_id": "bigcode_python_fns_35338", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Implement a function `binary_search_range(arr: List[int], x: int) -> Union[Tuple[int, int], int]` that performs an iterative binary search on a sorted array `arr`. The function should return a tuple containing the starting and ending indices of the element `x` if it is present ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert binary_search_range([1, 1, 2, 2, 2, 2, 3, 4, 5, 5], 2) == (2, 5)\", \"assert binary_search_range([1, 1, 2, 2, 2, 2, 3, 4, 5, 5], 1) == (0, 1)\", \"assert binary_search_range([1, 1, 2, 2, 2, 2, 3, 4, 5, 5], 3) == (6, 6)\", \"assert binary_search_range([1, 1, ...
{ "split": "train", "index": 68562, "acecode_id": "evol_4216", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that determines the largest of three distinct numbers. The function takes three floating-point numbers as input and returns the largest number. If the numbers are not distinct, the function should return a message indicating that the input...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_largest(5.0, 8.0, 3.0) == 8.0\", \"assert find_largest(4.0, 4.0, 4.0) == 'Invalid input: Please enter three different numbers.'\", \"assert find_largest(-1.0, 0.0, 1.0) == 1.0\", \"assert find_largest(2.5, 3.5, 1.5) == 3.5\", \"assert find_largest(10.0,...
{ "split": "train", "index": 68563, "acecode_id": "oss_1121", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a scoring system for a game. The game consists of multiple levels, and the player's score is calculated based on their performance in each level. The scoring system follows these rules: The player starts with a score of 0. For each level, the pl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_final_score([10, -5, 8, -3, 15]) == 109\", \"assert calculate_final_score([-10, -20, -30, -40, -50]) == 0\", \"assert calculate_final_score([0, 0, 0, 0, 0]) == 0\", \"assert calculate_final_score([5, 4, 3, 2, 1]) == 35\", \"assert calculate_final_s...
{ "split": "train", "index": 68564, "acecode_id": "oss_24657", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Write a Python function that takes a long input line and replaces every third occurrence of the letter 'a' with a hash symbol. The function should ensure that the replacement only happens if the 'a' is surrounded by white spaces or punctuation marks. This means that 'a' letters...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert replace_third_a('a a a a') == 'a a # a'\", \"assert replace_third_a('a! a? a. a') == 'a! a? #. a'\", \"assert replace_third_a('Hello, a apple a orange a!') == 'Hello, a apple a orange #!'\", \"assert replace_third_a('a b a c a d a') == 'a b a c # d a'\", \"a...
{ "split": "train", "index": 68565, "acecode_id": "evol_10551", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that removes all duplicate elements from the list and returns a new list containing only the unique elements. The order of the unique elements in the output list should be the same as their first occurrence in the input list. For e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_duplicates([9, 1, 5, 5, 2, 3, 2, 1]) == [9, 1, 5, 2, 3]\", \"assert remove_duplicates([1, 2, 3, 1, 2, 3]) == [1, 2, 3]\", \"assert remove_duplicates([5, 5, 5, 5]) == [5]\", \"assert remove_duplicates([]) == []\", \"assert remove_duplicates([4, 4, 4, 4...
{ "split": "train", "index": 68566, "acecode_id": "evol_28680", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a URL routing system similar to Django's URL dispatcher. The function should take a URL path and match it to a corresponding view function based on the defined URL patterns. You are given a list of URL patterns, where each ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert resolve_view('/about/', [('/about/', 'about')]) == 'about'\", \"assert resolve_view('/', [('/', 'home')]) == 'home'\", \"assert resolve_view('/contact/', [('/contact/', 'contact')]) == 'contact'\", \"assert resolve_view('/products/', [('/products/', 'product...
{ "split": "train", "index": 68567, "acecode_id": "oss_33319", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of public keys represented as strings, implement a function `validate_keys(keys: List[str]) -> List[str]` that returns a list of valid public keys. A valid public key must adhere to the following criteria: it should start with 'ssh-rsa' or 'ssh-dss', followed by a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_keys(['ssh-rsa valid_key_1', 'ssh-dss valid_key_2']) == ['ssh-rsa valid_key_1', 'ssh-dss valid_key_2']\", \"assert validate_keys(['invalid_key_1', 'invalid_key_2']) == []\", \"assert validate_keys(['ssh-rsa valid_key_3', 'ssh-rsa valid_key_4', 'inva...
{ "split": "train", "index": 68568, "acecode_id": "bigcode_python_fns_2778", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Implement a function `find_index(array: List[int], target: int) -> int` that searches for a given target integer in a list of integers and returns the index of the first occurrence of the target in the list. If the target is not found, return -1. The function should handle case...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_index([1, 2, 3, 4, 5], 4) == 3\", \"assert find_index([1, 2, 3, 4, 5], 1) == 0\", \"assert find_index([1, 2, 3, 4, 5], 5) == 4\", \"assert find_index([1, 2, 3, 4, 5], 6) == -1\", \"assert find_index([], 1) == -1\", \"assert find_index([10, 20, 30], 20) ...
{ "split": "train", "index": 68569, "acecode_id": "evol_2445", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a positive integer n, implement a function `get_unique_prime_factors(n)` that returns a list of all unique prime factors of n. The list should be sorted in ascending order. For example, for n = 36, the output should be [2, 3].\nPlease reason step by step, then write a sel...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_prime_factors(36) == [2, 3]\", \"assert get_unique_prime_factors(1) == []\", \"assert get_unique_prime_factors(2) == [2]\", \"assert get_unique_prime_factors(10) == [2, 5]\", \"assert get_unique_prime_factors(28) == [2, 7]\", \"assert get_unique_p...
{ "split": "train", "index": 68570, "acecode_id": "evol_29746", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the extraction of trace data from multiple repositories. The function should take a list of repository names and a branch name as input. The output should be a dictionary where each repository name is a key, and the val...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_trace_data(['repo1', 'repo2'], 'main') == {'repo1': 'Extraction successful from repo1 on branch main', 'repo2': 'Extraction successful from repo2 on branch main'}\", \"assert extract_trace_data(['repoA', 'repoB', ''], 'develop') == {'repoA': 'Extract...
{ "split": "train", "index": 68571, "acecode_id": "bigcode_python_fns_34796", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with formatting a list of issues from a project management tool. Each issue has a title, state (either 'open' or 'closed'), and timestamps for when it was created and updated. You need to implement a function that takes a list of issues, a list of developer IDs, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_issues([('1', 'Issue 1 [main]', 'open', 'user1', '2023-01-01', '2023-01-02')], ['user1'], datetime.datetime(2023, 1, 1), datetime.datetime(2023, 1, 3)) == [('2023-01-02', 'Issue', 'opened', '[main]', '', 'Issue 1 [main]')]\", \"assert format_issues([(...
{ "split": "train", "index": 68572, "acecode_id": "bigcode_python_fns_9108", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with processing employee data represented as a list of dictionaries in Python. Each dictionary contains the following keys: 'ID', 'Name', 'Department', and 'Salary'. Your program needs to handle cases where the 'Department' key has an empty value and perform spec...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_employees([{'ID': 1, 'Name': 'John', 'Department': 'D1', 'Salary': 50000}, {'ID': 2, 'Name': 'Alice', 'Department': '', 'Salary': 60000}, {'ID': 3, 'Name': 'Bob', 'Department': 'D2', 'Salary': 55000}, {'ID': 4, 'Name': 'Eve', 'Department': '', 'Salar...
{ "split": "train", "index": 68573, "acecode_id": "oss_8212", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers where each integer represents a score of a student in a class. Your task is to write a function that takes this list of scores and returns a new list containing only the scores that are greater than or equal to the average score of the class. Th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_scores([50, 60, 70, 80, 90]) == [70, 80, 90]\", \"assert filter_scores([10, 10, 10, 10, 10]) == [10, 10, 10, 10, 10]\", \"assert filter_scores([1, 2, 3, 4, 5, 6]) == [4, 5, 6]\", \"assert filter_scores([10]) == [10]\", \"assert filter_scores([]) == []...
{ "split": "train", "index": 68574, "acecode_id": "bigcode_python_fns_17606", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Your task is to implement a function that takes this list as input and returns a new list containing the squares of each integer in the input list. The output list should maintain the same order as the input list. Write a function `square_numbe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert square_numbers([-2, 0, 3]) == [4, 0, 9]\", \"assert square_numbers([1, 2, 3]) == [1, 4, 9]\", \"assert square_numbers([-1, -2, -3]) == [1, 4, 9]\", \"assert square_numbers([0, 0, 0]) == [0, 0, 0]\", \"assert square_numbers([4, 5, 6]) == [16, 25, 36]\", \"ass...
{ "split": "train", "index": 68575, "acecode_id": "bigcode_python_fns_4699", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `factorial(n)` that calculates the factorial of a non-negative integer n without using recursion, built-in functions, or external libraries. The function should return an error message if the input is a non-integer or a negative integer. The factorial of a numb...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert factorial(0) == 1\", \"assert factorial(1) == 1\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", \"assert factorial(5) == 120\", \"assert factorial(6) == 720\", \"assert factorial(7) == 5040\", \"assert factorial(...
{ "split": "train", "index": 68576, "acecode_id": "evol_33531", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of frames represented by their IDs, your task is to implement a function that simulates switching to a specific frame by its ID. The function should take two arguments: a list of strings 'frames' representing the available frame IDs and a string 'target_frame' whic...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert switch_to_frame(['frame1', 'frame2', 'frame3'], 'frame2') == 'Switched to frame frame2'\", \"assert switch_to_frame(['frameA', 'frameB', 'frameC'], 'frameA') == 'Switched to frame frameA'\", \"assert switch_to_frame(['frame1', 'frame2', 'frame3'], 'frame4') ...
{ "split": "train", "index": 68577, "acecode_id": "bigcode_python_fns_26483", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `set_logging_level(level: Union[str, int]) -> int` that sets the logging level based on the given input. The logging levels are defined as follows: 'DEBUG' corresponds to level 10, 'INFO' corresponds to level 20, 'WARNING' corresponds to level 30, 'ERROR' c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_logging_level('DEBUG') == 10\", \"assert set_logging_level('INFO') == 20\", \"assert set_logging_level('WARNING') == 30\", \"assert set_logging_level('ERROR') == 40\", \"assert set_logging_level('CRITICAL') == 50\", \"assert set_logging_level(10) == 10\"...
{ "split": "train", "index": 68578, "acecode_id": "bigcode_python_fns_33228", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of strings, implement a function `filter_non_repeating_strings(mylist)` that returns a new list containing only the strings that appear more than once in the original list, preserving the order of their first occurrence. If no strings meet this criterion, return an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_non_repeating_strings(['fox', 'fox', 'cat', 'dog', 'dog']) == ['fox', 'fox', 'dog', 'dog']\", \"assert filter_non_repeating_strings(['apple', 'banana', 'apple', 'orange', 'banana']) == ['apple', 'apple', 'banana', 'banana']\", \"assert filter_non_repe...
{ "split": "train", "index": 68579, "acecode_id": "evol_15339", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simple in-memory cache. This cache should store key-value pairs, allowing for both insertion and retrieval of values based on keys. The function should take an action string that specifies whether to 'insert' a key-va...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simple_cache('insert', 'a', '1') is None\", \"assert simple_cache('retrieve', 'b') == 'Key not found'\", \"assert simple_cache('insert', 'b', '2') is None\", \"assert simple_cache('insert', 'c', '3') is None\", \"assert simple_cache('retrieve', 'd') == 'Key ...
{ "split": "train", "index": 68580, "acecode_id": "bigcode_python_fns_17594", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given an integer n, return the first n numbers of the Fibonacci sequence concatenated into a single string. The Fibonacci sequence is defined as follows: F(0) = 0, F(1) = 1, and F(n) = F(n-1) + F(n-2) for n > 1. For example, if n = 5, the result should be '011235' as it combine...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert pattern(1) == '0'\", \"assert pattern(2) == '01'\", \"assert pattern(3) == '011'\", \"assert pattern(4) == '0112'\", \"assert pattern(5) == '01123'\", \"assert pattern(6) == '011235'\", \"assert pattern(7) == '0112358'\", \"assert pattern(8) == '011235813'\"...
{ "split": "train", "index": 68581, "acecode_id": "evol_34609", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that appends a value to a list associated with a specific key in a dictionary. If the key does not exist in the dictionary, you should create a new entry with that key and initialize it with an empty list before appending the value. T...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert smartAppend({}, 'apple', 1) == {'apple': [1]}\", \"assert smartAppend({'banana': [2]}, 'banana', 3) == {'banana': [2, 3]}\", \"assert smartAppend({'carrot': []}, 'carrot', 5) == {'carrot': [5]}\", \"assert smartAppend({'grape': [4]}, 'kiwi', 6) == {'grape': ...
{ "split": "train", "index": 68582, "acecode_id": "bigcode_python_fns_31970", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that generates a table name based on the input parameters. The function `create_table_name` takes in three parameters: `abi` (a string representing the ABI of a smart contract), `contract_name` (a string representing the name of the s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_table_name('example_abi', 'MyContract', 'log') == 'MyContract_logs'\", \"assert create_table_name('example_abi', 'MyContract', 'state') == 'MyContract_state'\", \"assert create_table_name('example_abi', 'Token', 'log') == 'Token_logs'\", \"assert crea...
{ "split": "train", "index": 68583, "acecode_id": "oss_37382", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a 3D tensor represented as a list of lists of lists of integers. Your task is to implement a function that simulates periodic boundary conditions by randomly translating the tensor along each of its dimensions. The function should accept the tensor and an integer ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert translate_tensor([[[1]], [[2]], [[3]], [[4]]], 1) == [[[1]], [[2]], [[3]], [[4]]]\", \"assert translate_tensor([[[1, 1], [1, 1], [1, 1]]], 1) == [[[1, 1], [1, 1], [1, 1]]]\", \"assert translate_tensor([[[1]]], 0) == [[[1]]]\", \"assert translate_tensor([[[1,...
{ "split": "train", "index": 68584, "acecode_id": "bigcode_python_fns_35207", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Write a Python function that takes a given word and reverses it. Additionally, determine if the reversed word is an anagram of the original word. Return a tuple containing the reversed word and a boolean value indicating whether the reversed word is an anagram of the original w...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_and_anagram('evil') == ('live', True)\", \"assert reverse_and_anagram('racecar') == ('racecar', True)\", \"assert reverse_and_anagram('civic') == ('civic', True)\", \"assert reverse_and_anagram('deified') == ('deified', True)\", \"assert reverse_and_...
{ "split": "train", "index": 68585, "acecode_id": "evol_30455", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of student records and returns a dictionary containing the average age of students grouped by their grades. Each record in the input list is a tuple consisting of the student's name (string), age (integer), and grade (st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_age_by_grade([('Alice', 20, 'A'), ('Bob', 21, 'B'), ('Charlie', 22, 'A')]) == {'A': 21.0, 'B': 21.0}\", \"assert average_age_by_grade([]) == {}\", \"assert average_age_by_grade([('Dave', 19, 'C'), ('Eve', 22, 'C'), ('Frank', 24, 'B')]) == {'C': 20.5,...
{ "split": "train", "index": 68586, "acecode_id": "oss_13466", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, implement a function that returns a new array where each element is the square of the corresponding element in the given array. Your function should handle negative numbers and zero as well.\nPlease reason step by step, then write a self-contained Py...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert square_elements([2, -3, 4, 0, -5]) == [4, 9, 16, 0, 25]\", \"assert square_elements([-1, -2, -3]) == [1, 4, 9]\", \"assert square_elements([0, 0, 0]) == [0, 0, 0]\", \"assert square_elements([1, 2, 3]) == [1, 4, 9]\", \"assert square_elements([]) == []\", \"...
{ "split": "train", "index": 68587, "acecode_id": "evol_5264", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `convert_to_binary(n: int) -> str` that takes a non-negative integer n and returns its binary representation as a string. For example, for the input 18, the output should be '10010'.\nPlease reason step by step, then write a self-contained Python solution. Give...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_binary(0) == '0'\", \"assert convert_to_binary(1) == '1'\", \"assert convert_to_binary(2) == '10'\", \"assert convert_to_binary(3) == '11'\", \"assert convert_to_binary(4) == '100'\", \"assert convert_to_binary(5) == '101'\", \"assert convert_to_b...
{ "split": "train", "index": 68588, "acecode_id": "evol_34805", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function `lcm(sequence: List[int]) -> int` that calculates the Least Common Multiple (LCM) of the numbers in the list. The input list must contain only integers, and its length must be between 1 and 100,000. Each integer must be between 1 a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert lcm([2, 3, 4]) == 12\", \"assert lcm([5, 10, 15]) == 30\", \"assert lcm([1, 2, 3, 4, 5]) == 60\", \"assert lcm([7, 14, 21]) == 42\", \"assert lcm([12, 15]) == 60\", \"assert lcm([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == 2520\", \"assert lcm([1000000000, 999999999]...
{ "split": "train", "index": 68589, "acecode_id": "evol_7003", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `custom_sine_layer(input: List[float], constant: float) -> List[float]` that takes a list of float inputs and a constant `a`, and returns a new list where each element is transformed by the function `sin(a * input[i])`. The function should handle the input ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert custom_sine_layer([0.0], 1.0) == [0.0]\", \"assert custom_sine_layer([1.0], 1.0) == [0.8414709848078965]\", \"assert custom_sine_layer([0.0], 2.0) == [0.0]\", \"assert custom_sine_layer([1.0, 2.0], 1.0) == [0.8414709848078965, 0.9092974268256817]\", \"assert...
{ "split": "train", "index": 68590, "acecode_id": "evol_25196", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that creates a multi-layer perceptron (MLP) represented as a list of layers, where each layer is defined by its input size and output size. Your function should take three parameters: input_size (the size of the input layer), hidden_s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_mlp(3, 5, 2) == [(3, 5), (5, 5), (5, 2)]\", \"assert create_mlp(1, 10, 4) == [(1, 10), (10, 10), (10, 4)]\", \"assert create_mlp(10, 20, 5) == [(10, 20), (20, 20), (20, 5)]\", \"assert create_mlp(0, 0, 0) == [(0, 0), (0, 0), (0, 0)]\", \"assert create...
{ "split": "train", "index": 68591, "acecode_id": "oss_12367", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `expensive_function(arg1: int, arg2: int) -> int` that performs an expensive computation. Use memoization to enhance performance by caching the results of previous computations. The function should return a result of an arbitrary computation, such as calcul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert expensive_function(1, 2) == 30\", \"assert expensive_function(2, 3) == 50\", \"assert expensive_function(3, 4) == 70\", \"assert expensive_function(10, 20) == 300\", \"assert expensive_function(0, 0) == 0\", \"assert expensive_function(-1, -1) == -20\", \"as...
{ "split": "train", "index": 68592, "acecode_id": "evol_8135", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a system that can manage resources by allowing users to register finalization actions to be executed when a resource is released. Your task is to implement a function `resource_manager` that takes a list of tuples, where each tuple contains a re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert resource_manager([('file1', lambda: 'Finalizing file1'), ('file2', lambda: 'Finalizing file2')]) == ['Finalizing file1', 'Finalizing file2']\", \"assert resource_manager([('resourceA', lambda: 'Finalizing resource A'), ('resourceB', lambda: 'Finalizing resou...
{ "split": "train", "index": 68593, "acecode_id": "oss_3616", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that returns the maximum integer in the list. The function should handle possible exceptions, such as type inputs that are not integers, empty lists, or null inputs. If the input is invalid, raise a ValueError with an appropriate m...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_in_list([1, 2, 3, 4, 5]) == 5\", \"assert max_in_list([-1, -2, -3, -4, -5]) == -1\", \"assert max_in_list([0, 0, 0, 0]) == 0\", \"assert max_in_list([100]) == 100\", \"assert max_in_list([-1, 0, 1]) == 1\", \"assert max_in_list([1, 3, 2, 5, 4]) == 5\", \...
{ "split": "train", "index": 68594, "acecode_id": "evol_26750", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the plotting of scatter pie plots, where each marker is represented by a pie chart based on specified ratios. Your function should take in three parameters: a list of x coordinates, a list of y coordinates, and a list o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_scatter_pie([1, 2], [3, 4], [[0.5, 0.5], [0.2, 0.8]]) == [{'center': (1, 3), 'ratios': [0.5, 0.5]}, {'center': (2, 4), 'ratios': [0.2, 0.8]}]\", \"assert simulate_scatter_pie([1], [1], [[0.3, 0.7]]) == [{'center': (1, 1), 'ratios': [0.3, 0.7]}]\", \...
{ "split": "train", "index": 68595, "acecode_id": "oss_17443", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that counts how many files in a given list need to be renamed based on their extensions. The function should take in three parameters: a list of file names, the current file extension (as a string), and the new file extension (as a st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_files_to_rename(['image.png', 'photo.jpg', 'document.png'], 'png', 'jpg') == 2\", \"assert count_files_to_rename(['file1.jpeg', 'file2.jpeg', 'file3.png'], 'png', 'jpeg') == 1\", \"assert count_files_to_rename(['image.bmp', 'image.jpg', 'image.bmp'], '...
{ "split": "train", "index": 68596, "acecode_id": "oss_12046", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a unique feed name for a feed management system. The function should generate a unique feed name in the format 'Feed Name #<UUID>', where <UUID> is a randomly generated UUID. Your function should return this unique feed nam...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_unique_feed_name().startswith('Feed Name #')\", \"assert len(generate_unique_feed_name().split('#')) == 2\", \"assert len(generate_unique_feed_name().split('#')[1]) == 36\", \"assert generate_unique_feed_name() != generate_unique_feed_name()\", \"as...
{ "split": "train", "index": 68597, "acecode_id": "bigcode_python_fns_47441", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that validates and sets an environment name for a software application. Implement a function `set_env_name(new_env_name: str, current_env_name: str) -> str` that takes two parameters: `new_env_name`, which is the proposed new environment ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_env_name('Production', 'Development') == 'Production'\", \"assert set_env_name('Staging', 'Development') == 'Staging'\", \"assert set_env_name('Test123', 'Development') == 'Test123'\", \"assert set_env_name(' ', 'Development') == 'Development'\", \"asser...
{ "split": "train", "index": 68598, "acecode_id": "oss_14975", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `camouflage_text(text: str, lexicon: List[str]) -> str` that takes a string `text` and a list of strings `lexicon`. The function should replace each word in the `lexicon` found in the `text` with a string of asterisks of the same length as the word. Return the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert camouflage_text('The quick brown fox jumped over the lazy dog.', ['fox', 'dog']) == 'The quick brown *** jumped over the lazy ***.'\", \"assert camouflage_text('Hello world!', ['world']) == 'Hello *****!'\", \"assert camouflage_text('Testing one two three.',...
{ "split": "train", "index": 68599, "acecode_id": "evol_17877", "num_tests": 8 }