data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that reconstructs a full timestamp from a partial timestamp, which only contains the least significant bytes. The partial timestamp is a floating-point number representing the time in seconds since the epoch. Your goal is to create a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reconstruct_full_timestamp(0.123456, 1631530000.0) == 1631530000.123456\", \"assert reconstruct_full_timestamp(0.987654, 1631530000.0) == 1631530000.987654\", \"assert reconstruct_full_timestamp(0.0, 1631530000.0) == 1631530000.0\", \"assert reconstruct_full... | {
"split": "train",
"index": 100,
"acecode_id": "oss_4529",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates a simplified version of a command-line execution. Your function should take a command as input and return a string indicating whether the command executed successfully or failed, based on a set of predefined commands... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert execute_command('echo Hello') == 'Success'\", \"assert execute_command('date') == 'Success'\", \"assert execute_command('ls') == 'Success'\", \"assert execute_command('mkdir test') == 'Failure'\", \"assert execute_command('rm -rf test') == 'Failure'\", \"ass... | {
"split": "train",
"index": 101,
"acecode_id": "oss_23714",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists, convert them into a dictionary where elements of the first list are the keys and elements of the second list are the corresponding values. Implement a function that takes a dictionary, a key, and a new value as parameters. The function should update the value o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_value({'a': 'd', 'b': 'e', 'c': 'f'}, 'a', 'z') == {'a': 'z', 'b': 'e', 'c': 'f'}\", \"assert update_value({'a': 'd', 'b': 'e', 'c': 'f'}, 'b', 'x') == {'a': 'd', 'b': 'x', 'c': 'f'}\", \"assert update_value({'a': 'd', 'b': 'e', 'c': 'f'}, 'c', 'y') =... | {
"split": "train",
"index": 102,
"acecode_id": "evol_26786",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that returns the dataset type based on the number of classes specified. The function should handle two scenarios: when the number of classes is 10, it should return 'CIFAR-10', and when the number of classes is 100, it should retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_dataset_name(10) == 'CIFAR-10'\", \"assert get_dataset_name(100) == 'CIFAR-100'\", \"assert get_dataset_name(10) == 'CIFAR-10'\", \"assert get_dataset_name(100) == 'CIFAR-100'\", \"assert get_dataset_name(10) == 'CIFAR-10'\", \"assert get_dataset_name(10... | {
"split": "train",
"index": 103,
"acecode_id": "oss_17304",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function `verify_date(input_date: str) -> str` that takes a date as a string in the format 'DD Month' (for example, '31 October'). The function should verify if the given date is valid, considering leap years and the number of days in each month. If the date is vali... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert verify_date('31 January') == 'Valid date'\", \"assert verify_date('29 February') == 'Valid date'\", \"assert verify_date('28 February') == 'Valid date'\", \"assert verify_date('31 March') == 'Valid date'\", \"assert verify_date('30 April') == 'Valid date'\",... | {
"split": "train",
"index": 104,
"acecode_id": "evol_5990",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates a formatted error message when a user sends an incomplete command to a server. The function should take in two parameters: a user's nickname (a string) and the command they attempted to execute (also a string). If the c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_error_message('user1', 'JOIN') == '461 user1 JOIN :Not enough parameters'\", \"assert generate_error_message('guest', 'PART') == '461 guest PART :Not enough parameters'\", \"assert generate_error_message('admin', 'NICK') == '461 admin NICK :Not enou... | {
"split": "train",
"index": 105,
"acecode_id": "bigcode_python_fns_35585",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of products, where each product is represented as a dictionary with keys 'name', 'price', and 'category'. Your task is to implement a function `filter_products_by_price_range(products: List[Dict[str, Union[str, float]]], min_price: float, max_price: float) ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_products_by_price_range([{'name': 'Product A', 'price': 10.0, 'category': 'Category 1'}, {'name': 'Product B', 'price': 20.0, 'category': 'Category 2'}, {'name': 'Product C', 'price': 30.0, 'category': 'Category 3'}], 15.0, 25.0) == [{'name': 'Product... | {
"split": "train",
"index": 106,
"acecode_id": "oss_20644",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that takes a dictionary representing user details and returns the user's first name. The input dictionary will always contain a key 'first_name' with a string value. If the 'first_name' key does not exist, return None. Implemen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_user_first_name({'first_name': 'Alice'}) == 'Alice'\", \"assert get_user_first_name({'first_name': 'Bob'}) == 'Bob'\", \"assert get_user_first_name({'first_name': 'Charlie'}) == 'Charlie'\", \"assert get_user_first_name({'first_name': 'David'}) == 'David... | {
"split": "train",
"index": 107,
"acecode_id": "oss_33927",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a user leaving a chat group and updates a message confirming the user's departure. The function should take two parameters: `chat_id` (an integer representing the unique ID of the chat) and `participants_count` (an integer ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert user_left_chat(12345, 10) == 'User has left the chat 12345. Current participants count: 9'\", \"assert user_left_chat(67890, 5) == 'User has left the chat 67890. Current participants count: 4'\", \"assert user_left_chat(11111, None) == 'User has left the cha... | {
"split": "train",
"index": 108,
"acecode_id": "bigcode_python_fns_4602",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates retrieving information about available speech-to-text (S2T) and text-to-speech (T2S) pipelines, as well as a list of NLP agents. The function should utilize provided configurations to generate a mock response contain... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert retrieve_nlp_info({}, {}) == {'s2t_pipelines': ['s2t_pipeline_1', 's2t_pipeline_2'], 't2s_pipelines': ['t2s_pipeline_A', 't2s_pipeline_B', 't2s_pipeline_C'], 'nlu_agents': ['nlu_agent_1', 'nlu_agent_2', 'nlu_agent_3']}\", \"assert retrieve_nlp_info({}, {}) =... | {
"split": "train",
"index": 109,
"acecode_id": "oss_1638",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program that manages train stations. Each train station is represented by its name, latitude, and longitude. You need to implement a function that takes a list of train station names and returns the names sorted in alphabetical order. Your functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_station_names(['Station A', 'Station C', 'Station B']) == ['Station A', 'Station B', 'Station C']\", \"assert sort_station_names(['Zebra Station', 'Alpha Station', 'Echo Station']) == ['Alpha Station', 'Echo Station', 'Zebra Station']\", \"assert sort_s... | {
"split": "train",
"index": 110,
"acecode_id": "oss_24848",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function `generate_secret_id(vault: str, name: str, version: Optional[str] = None) -> str` that generates a unique identifier for a secret stored in a vault. The identifier should follow the format: 'secrets/{vault}/{name}/{version}', with the version be... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_secret_id('myVault', 'mySecret', 'v1') == 'secrets/myVault/mySecret/v1'\", \"assert generate_secret_id('myVault', 'mySecret') == 'secrets/myVault/mySecret'\", \"assert generate_secret_id('testVault', 'testSecret', 'v2') == 'secrets/testVault/testSec... | {
"split": "train",
"index": 111,
"acecode_id": "bigcode_python_fns_34109",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of guitar specifications, and you need to determine how many guitars match a specific specification. Each guitar specification is represented by a dictionary containing the following keys: 'builder', 'model', 'type', 'back_wood', 'top_wood', and 'num_string... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_matching_guitars([{'builder': 'FENDER', 'model': 'Stratocaster', 'type': 'ELECTRIC', 'back_wood': 'MAHOGANY', 'top_wood': 'MAPLE', 'num_strings': 6}, {'builder': 'GIBSON', 'model': 'Les Paul', 'type': 'ELECTRIC', 'back_wood': 'ROSEWOOD', 'top_wood': 'C... | {
"split": "train",
"index": 112,
"acecode_id": "oss_33092",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a string called `paragraph` and an array of strings named `banned`. Your task is to implement a function `mostCommonWord(paragraph: str, banned: List[str]) -> str` that returns the most frequently occurring word in the `paragraph`, excluding any words present in t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert mostCommonWord('Bob hit a ball, the hit BALL flew far after it was hit.', ['hit']) == 'ball'\", \"assert mostCommonWord('a.', []) == 'a'\", \"assert mostCommonWord('Hello world! Hello!', ['hello']) == 'world'\", \"assert mostCommonWord('The quick brown fox j... | {
"split": "train",
"index": 113,
"acecode_id": "evol_23156",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that returns the sum of all the even numbers in the list. If there are no even numbers, the function should return 0. The input list can contain both positive and negative integers, and it may also include zero. Please implement th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([10, 15, 20, 25]) == 30\", \"assert sum_of_evens([-2, -4, -6, 1, 3]) == -12\", \"assert sum_of_evens([0, 1, 2, 3, 4]) == 6\", \"assert sum_of_evens([-1, -3, -5]) == 0\", \"assert sum_of_evens([]) ==... | {
"split": "train",
"index": 114,
"acecode_id": "bigcode_python_fns_30860",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that validates the name of a device model. The function should accept a string input representing the model name and return an error message if the model name is empty or does not meet specific criteria. The model name must be between... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_model_name('') == 'model name value should be between 1 and 1000'\", \"assert validate_model_name('A') == 'Valid model name'\", \"assert validate_model_name('B') == 'Valid model name'\", \"assert validate_model_name('C') == 'Valid model name'\", \"a... | {
"split": "train",
"index": 115,
"acecode_id": "bigcode_python_fns_1237",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that returns the total number of participants in a competition. The function should check if the competition is currently active, and if so, return the total number of participants. If the competition is not active, the function should re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_total_participants(True, 10) == 10\", \"assert get_total_participants(False, 10) == 1\", \"assert get_total_participants(True, 0) == 0\", \"assert get_total_participants(False, 0) == 1\", \"assert get_total_participants(True, 100) == 100\", \"assert get_... | {
"split": "train",
"index": 116,
"acecode_id": "bigcode_python_fns_47283",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that replaces all occurrences of a list of words (t) in a paragraph (s) with a corresponding list of words (r). The function should ignore the case of the words while replacing and maintain the original casing in the output. Ensure that you only replace who... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_words('Hello world! This is a test.', ['hello', 'test'], ['hi', 'exam']) == 'Hi world! This is a exam.'\", \"assert replace_words('Python is great. Python is fun.', ['python'], ['Java']) == 'Java is great. Java is fun.'\", \"assert replace_words('The... | {
"split": "train",
"index": 117,
"acecode_id": "evol_32832",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of names patterns and a list of names to transform. Implement a function `check_names_pattern(names_pattern: List[str], names_to: List[str]) -> None:` that raises a `ValueError` if `names_pattern` is a list or tuple and the length of `names_to` does not mat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_names_pattern(['1', 'rar'], ['variable', 'value']) is None\", \"assert check_names_pattern(['name'], ['first_name']) is None\", \"assert check_names_pattern(['a', 'b', 'c'], ['x', 'y', 'z']) is None\", \"assert check_names_pattern(['1', '2', '3'], ['on... | {
"split": "train",
"index": 118,
"acecode_id": "bigcode_python_fns_38772",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with developing a configuration validation function for a database connection setup. The function should check for missing configuration values and construct a message listing the missing values. The database configuration parameters are as follows: `db_engine` (... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_db_config(None, '/path/to/drivers', 'localhost', 3306) == ' -DBEngine- '\", \"assert validate_db_config('MySQL', None, 'localhost', 3306) == ' -SQL_DRIVERS_LOCATION_<OS_Type>- '\", \"assert validate_db_config('MySQL', '/path/to/drivers', None, 3306)... | {
"split": "train",
"index": 119,
"acecode_id": "oss_3278",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that manages a simple agenda. The agenda should be able to store appointments and retrieve the last appointment added. You need to implement a function `manage_agenda(appointments: List[str]) -> str` that takes a list of appointment s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_agenda([]) == 'No appointments in the agenda'\", \"assert manage_agenda(['Doctor Appointment']) == 'Doctor Appointment'\", \"assert manage_agenda(['Meeting with Bob', 'Lunch with Alice']) == 'Lunch with Alice'\", \"assert manage_agenda(['Gym', 'Grocer... | {
"split": "train",
"index": 120,
"acecode_id": "oss_35582",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "In a given string of digits, identify the sequence of four consecutive digits that yields the highest product. What is the numerical value of this maximum product?\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_product_of_consecutive_digits('123456789') == 3024\", \"assert max_product_of_consecutive_digits('000012345') == 120\", \"assert max_product_of_consecutive_digits('999999999') == 6561\", \"assert max_product_of_consecutive_digits('1111111111') == 1\", \"... | {
"split": "train",
"index": 121,
"acecode_id": "evol_19176",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Create a function in Python that checks whether the integer n belongs to the Fibonacci sequence. If it does, the function should return the string 'Fibonacci', otherwise it should return 'Not Fibonacci'. The function should work for the range of n from 1 to 10^5.\nPlease reason... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_fibonacci(1) == 'Fibonacci'\", \"assert check_fibonacci(2) == 'Fibonacci'\", \"assert check_fibonacci(3) == 'Fibonacci'\", \"assert check_fibonacci(4) == 'Not Fibonacci'\", \"assert check_fibonacci(5) == 'Fibonacci'\", \"assert check_fibonacci(8) == 'F... | {
"split": "train",
"index": 122,
"acecode_id": "evol_21273",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string `suite` that can take one of four possible values: 'renaissance', 'dacapo', 'specjvm', or 'unknown'. Additionally, you are given a variable `temp_file` that is either a string representing a file path (for 'renaissance') or None (for the others). Your tas... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_suite('renaissance', 'path/to/temp.csv') == 'Processing for renaissance with temp file'\", \"assert process_suite('dacapo', None) == 'Processing for dacapo without temp file'\", \"assert process_suite('specjvm', None) == 'Processing for specjvm witho... | {
"split": "train",
"index": 123,
"acecode_id": "bigcode_python_fns_27848",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that searches for a student by their name in a given list of students. The function should take a list of student names and a search term (name of the student to search for) as input. If the student with the given name exists in the list,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert search_student(['Alice', 'Bob', 'Charlie'], 'Bob') == 'Bob'\", \"assert search_student(['Alice', 'Bob', 'Charlie'], 'Alice') == 'Alice'\", \"assert search_student(['Alice', 'Bob', 'Charlie'], 'Charlie') == 'Charlie'\", \"assert search_student(['Alice', 'Bob'... | {
"split": "train",
"index": 124,
"acecode_id": "bigcode_python_fns_33456",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a permission check system for a role-based access control (RBAC) model in a cloud-based image repository. The system should allow users to perform various actions based on their roles. You need to implement a function `check_permission(user_role... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_permission('admin', 'delete_robot_account') == True\", \"assert check_permission('admin', 'pull_image') == False\", \"assert check_permission('admin', 'push_image') == False\", \"assert check_permission('robot_account', 'pull_image') == True\", \"asser... | {
"split": "train",
"index": 125,
"acecode_id": "oss_274",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of words in the form of strings and a list of corresponding vectors representing their embeddings. Implement a function `create_word_index_dict(words: List[str], embeddings: List[List[float]]) -> Dict[str, int]` that creates a dictionary mapping each word t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_word_index_dict(['apple', 'banana', 'cherry'], [[0.1, 0.2], [0.3, 0.4], [0.5, 0.6]]) == {'apple': 0, 'banana': 1, 'cherry': 2}\", \"assert create_word_index_dict(['dog', 'cat'], [[1.0, 1.1], [2.0, 2.1]]) == {'dog': 0, 'cat': 1}\", \"assert create_word... | {
"split": "train",
"index": 126,
"acecode_id": "bigcode_python_fns_33570",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string, write a function that finds the length of the shortest substring that contains all the unique characters of the string. The function should also return the substring(s) that have that length. Duplicates are allowed if they exist. The input string will only conta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shortest_substring('a') == (1, ['a'])\", \"assert shortest_substring('ab') == (2, ['ab'])\", \"assert shortest_substring('abcde') == (5, ['abcde'])\", \"assert shortest_substring('abcdefghij') == (10, ['abcdefghij'])\", \"assert shortest_substring('abcdefghi... | {
"split": "train",
"index": 127,
"acecode_id": "evol_31054",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing time measurements in seconds. Write a function `time_measurements_length(measurements: List[int]) -> Tuple[int, int]` that returns a tuple containing two values: the length of the list and the total number of elements in the list. I... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert time_measurements_length([]) == (0, 0)\", \"assert time_measurements_length([1, 2, 3]) == (3, 3)\", \"assert time_measurements_length([10, 20, 30, 40, 50]) == (5, 5)\", \"assert time_measurements_length([[1, 2], [3, 4]]) == (2, 4)\", \"assert time_measuremen... | {
"split": "train",
"index": 128,
"acecode_id": "bigcode_python_fns_32647",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that formats a list of names into a human-readable string indicating who likes something. The function should take a list of strings as input and return a string. The formatting rules are as follows: 1. If the list is empty, return 'no on... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert likes([]) == 'no one likes this'\", \"assert likes(['Alice']) == 'Alice likes this'\", \"assert likes(['Bob', 'Charlie']) == 'Bob and Charlie like this'\", \"assert likes(['Dave', 'Eve', 'Frank']) == 'Dave, Eve and Frank like this'\", \"assert likes(['George... | {
"split": "train",
"index": 129,
"acecode_id": "bigcode_python_fns_46048",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a directed graph represented using an adjacency list and a dictionary that maps edges to their respective weights. Your task is to implement a function to find the shortest path from a given source node to all other nodes in the graph using Dijkstra's algorithm. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dijkstra_shortest_path({1: [(2, 5), (3, 2)], 2: [(3, 1)], 3: [(4, 4)], 4: []}, {(1, 2): 5, (1, 3): 2, (2, 3): 1, (3, 4): 4}, 1) == {2: 5, 3: 2, 4: 6}\", \"assert dijkstra_shortest_path({1: [(2, 4)], 2: [(3, 1)], 3: []}, {(1, 2): 4, (2, 3): 1}, 1) == {2: 4, 3... | {
"split": "train",
"index": 130,
"acecode_id": "oss_6904",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of integers and sorts it in non-decreasing order using the heap sort algorithm. The function should modify the list in place and return None. The input list can contain both positive and negative integers, as well as duplicates.\nPlease re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert heapSort([3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5]) == None and [1, 1, 2, 3, 3, 4, 5, 5, 5, 6, 9] == [1, 1, 2, 3, 3, 4, 5, 5, 5, 6, 9]\", \"assert heapSort([10, -1, 2, 0, -5]) == None and [-5, -1, 0, 2, 10] == [-5, -1, 0, 2, 10]\", \"assert heapSort([-3, -1, -2, -5]... | {
"split": "train",
"index": 131,
"acecode_id": "evol_15801",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a data object and returns a specific format based on certain conditions. The function takes in a parameter `data`, which is an object with properties `ok` and `message`. If `data.ok` is `True`, the function should itera... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_data({'ok': True, 'message': {'results': [{'uuid': '123', 'name': 'Group A'}, {'uuid': '456', 'name': 'Group B'}]}}) == (['UUID', 'Name'], [('123', 'Group A'), ('456', 'Group B')])\", \"assert process_data({'ok': True, 'message': {'results': []}}) ==... | {
"split": "train",
"index": 132,
"acecode_id": "oss_4322",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a memory system for an autonomous agent that stores information about detected objects. Each detected object has a name, a list of categories it belongs to, and its position in 3D space represented as a tuple of (x, y, z) coordinates. Implement a fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_detected_object_node('Ball', ['Sports', 'Outdoor'], (1, 2, 3)) == {'name': 'Ball', 'categories': ['Sports', 'Outdoor'], 'position': (1, 2, 3)}\", \"assert create_detected_object_node('Car', ['Vehicle', 'Transport'], (4, 5, 6)) == {'name': 'Car', 'cate... | {
"split": "train",
"index": 133,
"acecode_id": "oss_16351",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `factorial(n: int) -> int` that computes the factorial of a non-negative integer n. The factorial of a number n is the product of all positive integers less than or equal to n. You must implement this function recursively. The function should return 1 if n is 0... | 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": 134,
"acecode_id": "evol_27659",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `input_string`, write a function `convert_to_lower_case(input_string)` that converts the string to lowercase based on its current case style. The possible case styles include lowercase, uppercase, sentence case, title case, camel case, snake case, kebab case, and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_lower_case('HelloWorld') == 'helloworld'\", \"assert convert_to_lower_case('TITLE CASE EXAMPLE') == 'title case example'\", \"assert convert_to_lower_case('this is a sentence case') == 'this is a sentence case'\", \"assert convert_to_lower_case('t... | {
"split": "train",
"index": 135,
"acecode_id": "oss_32231",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `calculate_operations(a: int, b: int) -> Tuple[int, int, int, float]` that takes two integers, `a` and `b`, and returns a tuple containing their sum, difference, product, and quotient. The quotient should be a float and should handle division by zero by ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_operations(5, 3) == (8, 2, 15, 1.6666666666666667)\", \"assert calculate_operations(10, 2) == (12, 8, 20, 5.0)\", \"assert calculate_operations(-1, 1) == (0, -2, -1, -1.0)\", \"assert calculate_operations(0, 5) == (5, -5, 0, 0.0)\", \"assert calcul... | {
"split": "train",
"index": 136,
"acecode_id": "evol_2166",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_even(n: int) -> bool` that determines if a given non-negative integer `n` is even using mutual recursion. The function should raise a ValueError if `n` is negative. You must also implement a helper function `is_odd(n: int) -> bool` that determines if a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_even(0) == True\", \"assert is_even(1) == False\", \"assert is_even(2) == True\", \"assert is_even(3) == False\", \"assert is_even(4) == True\", \"assert is_even(10) == True\", \"assert is_even(11) == False\", \"assert is_even(100) == True\", \"assert is_... | {
"split": "train",
"index": 137,
"acecode_id": "evol_28254",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that sanitizes a mobile phone number by adding a country code and removing any leading zeros. The function should take a string representing a mobile number (which may start with one or more leading zeros) and return a new string that sta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sanitize_mobile_number('0723456789') == '254723456789'\", \"assert sanitize_mobile_number('00123456789') == '254123456789'\", \"assert sanitize_mobile_number('0000123456789') == '254123456789'\", \"assert sanitize_mobile_number('123456789') == '254123456789'... | {
"split": "train",
"index": 138,
"acecode_id": "bigcode_python_fns_44410",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes two integers N and M as input and returns the sum of all prime numbers between N and M (inclusive). You may assume that 1 ≤ N < M ≤ 10^5. Optimize the function for time complexity.\nPlease reason step by step, then write a self-contained Python solut... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_primes(10, 20) == 60\", \"assert sum_of_primes(1, 10) == 17\", \"assert sum_of_primes(1, 1) == 0\", \"assert sum_of_primes(2, 2) == 2\", \"assert sum_of_primes(3, 5) == 8\", \"assert sum_of_primes(15, 15) == 0\", \"assert sum_of_primes(17, 19) == 36\"... | {
"split": "train",
"index": 139,
"acecode_id": "evol_8322",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a string as input and returns the reversed version of that string. The function should handle empty strings and special characters correctly. If the input is not a valid string, return an error message indicating that a valid string is required.\... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_string('hello') == 'olleh'\", \"assert reverse_string('') == ''\", \"assert reverse_string('12345') == '54321'\", \"assert reverse_string('!@#$$%^&*()') == ')(*&^%$$#@!'\", \"assert reverse_string('Python') == 'nohtyP'\", \"assert reverse_string('rac... | {
"split": "train",
"index": 140,
"acecode_id": "evol_9203",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `extensive_sequence(str_lst: List[str], char_limit: int) -> List[str]` that takes a list of strings `str_lst` and an integer `char_limit` as input. The function should return the longest sequence of strings from `str_lst` such that the total length of the strin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extensive_sequence(['Hello', 'World', 'Python', 'Programming', 'Example'], 15) == ['Hello', 'World']\", \"assert extensive_sequence(['A', 'B', 'C', 'D'], 2) == ['A', 'B']\", \"assert extensive_sequence(['One', 'Two', 'Three'], 10) == ['One', 'Two']\", \"asse... | {
"split": "train",
"index": 141,
"acecode_id": "evol_7285",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `extract_unique_elements` that returns a list of integers containing only the unique elements from the original list, preserving the order of their first appearance. Duplicate elements should be excluded from the result entirely. For e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_unique_elements([1, 2, 2, 3, 4, 4, 5]) == [1, 3, 5]\", \"assert extract_unique_elements([1, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert extract_unique_elements([1, 1, 1, 1]) == []\", \"assert extract_unique_elements([]) == []\", \"assert extract_unique_ele... | {
"split": "train",
"index": 142,
"acecode_id": "evol_21031",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the creation of space exploration scenarios. The function, `create_hyper_galaxies`, should return a list containing exactly two instances of a hypothetical class `HyperGalaxy`. Assume that the `HyperGalaxy` class is alr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert len(create_hyper_galaxies()) == 2\", \"assert isinstance(create_hyper_galaxies()[0], HyperGalaxy)\", \"assert isinstance(create_hyper_galaxies()[1], HyperGalaxy)\", \"assert create_hyper_galaxies()[0] is not create_hyper_galaxies()[1]\", \"assert type(create... | {
"split": "train",
"index": 143,
"acecode_id": "oss_21592",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the initialization and operation of a raster data warping process. Implement a function `warp_raster(requires_task: bool, layer_id: int, input_ext_override: str) -> str` that takes three parameters: a boolean `requires_task... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert warp_raster(True, 123, '.byte') == 'Performing warp operation with layer_id: 123, requires_task: True, input_ext_override: .byte'\", \"assert warp_raster(False, 456, '.tiff') == 'Performing warp operation with layer_id: 456, requires_task: False, input_ext_o... | {
"split": "train",
"index": 144,
"acecode_id": "oss_33884",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the loading and preprocessing of an image. Your function should take a single image file path as input and return the dimensions of the image after simulating a preprocessing step. The preprocessing step should involve resi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_image('path/to/image1.jpg') == (100, 100)\", \"assert process_image('path/to/image2.png') == (100, 100)\", \"assert process_image('path/to/image3.bmp') == (100, 100)\", \"assert process_image('path/to/image4.jpeg') == (100, 100)\", \"assert process_i... | {
"split": "train",
"index": 145,
"acecode_id": "oss_27446",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You need to create a function that generates an HTML table header row. The function should return a string that contains the HTML markup for a table header with the following columns: 'Column name', 'DataType', 'PK' (Primary Key), 'FK' (Foreign Key), 'NN' (Not Null), 'UQ' (Uniq... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert html_table_header() == '<tr><th>Column name</th><th>DataType</th><th><abbr title=\\\"Primary Key\\\">PK</abbr></th><th><abbr title=\\\"Foreign Key\\\">FK</abbr></th><th><abbr title=\\\"Not Null\\\">NN</abbr></th><th><abbr title=\\\"Unique\\\">UQ</abbr></th><... | {
"split": "train",
"index": 146,
"acecode_id": "bigcode_python_fns_44862",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of integers, `X` and `Y`, and a tuple `shape` that represents the dimensions of a 2D image. Your task is to create a function `unflatten_image(X: List[int], Y: List[int], shape: Tuple[int, int]) -> List[List[int]]` that transforms the input 1D list `Y` i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unflatten_image([5, 6], [-1, -1, -1, -1], (2, 2)) == [[-1, -1], [-1, -1]]\", \"assert unflatten_image([7], [0, -1], (1, 2)) == [[7, -1]]\", \"assert unflatten_image([8, 9], [0, 1, 2], (2, 2)) == []\", \"assert unflatten_image([5, 6, 7], [5, 6, 7, -1, -1, -1]... | {
"split": "train",
"index": 147,
"acecode_id": "bigcode_python_fns_12033",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a dictionary of HTML attributes and returns a string representation of those attributes formatted for an HTML element. The function should map certain keys to their kebab-case equivalents, reduce class values to a single string... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert render_html_attributes({'id': 'my-element', 'class': 'btn', 'style': {'color': 'red'}}) == ' id=\\\"my-element\\\" class=\\\"btn\\\" style=\\\"color:red\\\"'\", \"assert render_html_attributes({'class': ['btn', 'active'], 'style': {'background-color': 'blue'... | {
"split": "train",
"index": 148,
"acecode_id": "bigcode_python_fns_46084",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary containing words as keys and their corresponding lengths as values. Your task is to implement a function `find_longest_word(word_lengths)` that takes in the dictionary `word_lengths` and returns the word with the longest length. If there are multiple ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_longest_word({'a': {'length': 1}, 'abc': {'length': 3}, 'abcd': {'length': 4}}) == 'abcd'\", \"assert find_longest_word({'word1': {'length': 5}, 'word2': {'length': 5}, 'longest': {'length': 7}}) == 'longest'\", \"assert find_longest_word({'first': {'le... | {
"split": "train",
"index": 149,
"acecode_id": "oss_23797",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `message`, implement a function `to_bytes(message: str) -> bytes` that converts the input string into a byte representation. The function should replace occurrences of '\\r' with a carriage return character (\\r) and '\\n' with a newline character (\\n) in the in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert to_bytes('Hello\\\\nWorld') == b'Hello\\\\nWorld'\", \"assert to_bytes('Line1\\\\rLine2\\\\nLine3') == b'Line1\\\\rLine2\\\\nLine3'\", \"assert to_bytes('Text with no special characters') == b'Text with no special characters'\", \"assert to_bytes('') == b''\... | {
"split": "train",
"index": 150,
"acecode_id": "bigcode_python_fns_31450",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Implement a function `sieve_of_eratosthenes(n: int) -> List[int]` that takes a positive integer n as input and returns a list of all prime numbers from 0 to n using the Sieve of Eratosthenes algorithm.\nPlease reason step by step, then write a self-contained Python solution. Gi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sieve_of_eratosthenes(10) == [2, 3, 5, 7]\", \"assert sieve_of_eratosthenes(20) == [2, 3, 5, 7, 11, 13, 17, 19]\", \"assert sieve_of_eratosthenes(30) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29]\", \"assert sieve_of_eratosthenes(1) == []\", \"assert sieve_of_erat... | {
"split": "train",
"index": 151,
"acecode_id": "evol_14697",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a user object with two attributes: first_name (a string) and email (a string). Your task is to implement a function `get_display_name(user)` that returns the best display name for the user. The function should return the user's first_name if it is not an empty str... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_display_name({'first_name': 'Alice', 'email': 'alice@example.com'}) == 'Alice'\", \"assert get_display_name({'first_name': '', 'email': 'alice@example.com'}) == 'alice@example.com'\", \"assert get_display_name({'first_name': 'Bob', 'email': ''}) == 'Bob'... | {
"split": "train",
"index": 152,
"acecode_id": "bigcode_python_fns_47261",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a custom function to find the symmetric difference (elements present in one set but not in the other) of two given sets represented as linked lists without using built-in Python set functions. The function should return the elements in sorted order and without duplicates... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_symmetric_difference(LinkedList([1, 2, 3]), LinkedList([2, 3, 4]), None) == [1, 4]\", \"assert set_symmetric_difference(LinkedList([5, 6, 7]), LinkedList([6, 7, 8]), None) == [5, 8]\", \"assert set_symmetric_difference(LinkedList([1, 1, 2]), LinkedList([... | {
"split": "train",
"index": 153,
"acecode_id": "evol_14580",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with developing a function that generates a command for compiling CUDA source files. The function should accept two arguments: a list of source file names (strings) and a boolean flag indicating whether to create a shared object. Based on the flag, the function s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_cuda_command(['file1.cu', 'file2.cu'], False) == 'clang -o file1.o -c file1.cu file2.cu'\", \"assert generate_cuda_command(['file1.cu'], True) == 'clang -o file1.so -c -shared file1.cu'\", \"assert generate_cuda_command(['file1.cu', 'file2.cu', 'fi... | {
"split": "train",
"index": 154,
"acecode_id": "bigcode_python_fns_34602",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a script and a corresponding voice recording. The script is represented as a list of strings `script_table`, where each element represents a segment of the script. Similarly, the voice recording is represented as a list of strings `voice_table`, where each element... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reconstruct_voice(['Hello world', 'This is', 'LeetCode'], ['Hello', 'world This', 'is LeetCode']) == ['Hello world This', 'is LeetCode']\", \"assert reconstruct_voice(['A', 'B', 'C'], ['A', 'B', 'C']) == ['A', 'B', 'C']\", \"assert reconstruct_voice(['Segmen... | {
"split": "train",
"index": 155,
"acecode_id": "oss_18408",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of integers and returns a dictionary containing the count of even and odd numbers in the list. Write a function `count_even_odd` that takes a list of integers as input. The function should return a dictionary ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_even_odd([1, 2, 3, 4, 5]) == {'even': 2, 'odd': 3}\", \"assert count_even_odd([10, 15, 20, 25]) == {'even': 2, 'odd': 2}\", \"assert count_even_odd([-2, -1, 0, 1, 2]) == {'even': 3, 'odd': 2}\", \"assert count_even_odd([]) == {'even': 0, 'odd': 0}\", \... | {
"split": "train",
"index": 156,
"acecode_id": "oss_29564",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with identifying missing dependencies from a list of available packages and a list of required packages. Given a list of available packages and a list of required packages, your goal is to determine which required packages are not present in the available package... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_missing_dependencies(['kyper', 'kyper.nbformat', 'kyper.nbformat.v2', 'kyper.utils'], ['numpy', 'kyper.nbformat.v2', 'pandas']) == ['numpy', 'pandas']\", \"assert find_missing_dependencies(['package1', 'package2', 'package3'], ['package4', 'package5']) ... | {
"split": "train",
"index": 157,
"acecode_id": "oss_13846",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a simple game where you control the movement of a cursor based on user input. Your program should display a happy face on the screen and continuously check for a button press. When the button is pressed, the program should read a simulated y-axis ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_cursor_movement(250) == 2\", \"assert simulate_cursor_movement(150) == 1\", \"assert simulate_cursor_movement(0) == 0\", \"assert simulate_cursor_movement(-100) == -1\", \"assert simulate_cursor_movement(999) == 9\", \"assert simulate_cursor_movemen... | {
"split": "train",
"index": 158,
"acecode_id": "oss_19122",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that returns the first n prime numbers using the Sieve of Eratosthenes method. The function should handle values of n up to 1 million efficiently. Your function should take a single integer n as input and return a list of the first n prime numbers.\nPlease ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert first_n_primes(1) == [2]\", \"assert first_n_primes(2) == [2, 3]\", \"assert first_n_primes(3) == [2, 3, 5]\", \"assert first_n_primes(4) == [2, 3, 5, 7]\", \"assert first_n_primes(5) == [2, 3, 5, 7, 11]\"]}"
} | {
"split": "train",
"index": 159,
"acecode_id": "evol_15553",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given a list of tuples where each tuple contains a date in the format 'YYYY-MM-DD' and a corresponding integer value, implement a function that returns the minimum and maximum values from the list of integers, as well as the earliest and latest dates in the list. The function s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_date_value_info([('2022-01-01', 5), ('2022-01-02', 10), ('2022-01-03', 7)]) == ('2022-01-01', '2022-01-03', 5, 10)\", \"assert extract_date_value_info([('2023-05-05', 2), ('2023-05-01', 8), ('2023-05-03', 1)]) == ('2023-05-01', '2023-05-05', 1, 8)\",... | {
"split": "train",
"index": 160,
"acecode_id": "bigcode_python_fns_10013",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a configuration for a device. The function should take the following parameters: 'host' (a string representing the device's host IP), 'name' (a string representing the device's name), 'activity' (a string representing a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_device_config('1.2.3.4', 'friend', 'Watch TV', 0.9, True, '555234534543') == {'unique_id': '555234534543', 'title': 'friend', 'data': {'host': '1.2.3.4', 'name': 'friend', 'activity': 'Watch TV', 'delay_secs': 0.9, 'activity_notify': True}}\", \"asse... | {
"split": "train",
"index": 161,
"acecode_id": "bigcode_python_fns_25179",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked to create a function that simulates the response of a server when an internal error occurs. The function should take in a request (represented as a string) and return a dictionary containing an error message and the status code. The error message should always be... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert server_error_response('GET /home') == {'error': 'Internal Server Error', 'status_code': 500}\", \"assert server_error_response('POST /api/data') == {'error': 'Internal Server Error', 'status_code': 500}\", \"assert server_error_response('PUT /user/1') == {'e... | {
"split": "train",
"index": 162,
"acecode_id": "bigcode_python_fns_12439",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of articles and a publication year as input. Each article is represented as a dictionary with keys 'title', 'author', and 'publication_date', which is a string in the format 'YYYY-MM-DD'. Your function should return a li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_article_titles_by_year([{'title': 'Python Basics', 'author': 'John Doe', 'publication_date': '2022-01-15'}, {'title': 'Data Structures in Python', 'author': 'Jane Smith', 'publication_date': '2022-03-20'}, {'title': 'Machine Learning Fundamentals', 'auth... | {
"split": "train",
"index": 163,
"acecode_id": "oss_2992",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two integers, `rows` and `cols`, implement a function `create_infinite_matrix(rows: int, cols: int) -> List[List[float]]` that returns a matrix (a list of lists) of size `rows x cols`, where each element is set to positive infinity (represented by `float('inf')`). You can... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_infinite_matrix(2, 3) == [[float('inf'), float('inf'), float('inf')], [float('inf'), float('inf'), float('inf')]]\", \"assert create_infinite_matrix(0, 5) == []\", \"assert create_infinite_matrix(5, 0) == []\", \"assert create_infinite_matrix(1, 1) ==... | {
"split": "train",
"index": 164,
"acecode_id": "bigcode_python_fns_16401",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of floating-point numbers representing log10 values of chlorophyll concentration. Your task is to compute the mean of these values while also counting how many values were used in the calculation. The function should return a tuple containing the mean value... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_mean_and_count([1.0, 2.0, 3.0]) == (2.0, 3)\", \"assert calculate_mean_and_count([-1.0, -2.0, -3.0]) == (-2.0, 3)\", \"assert calculate_mean_and_count([float('nan'), 2.0, 3.0]) == (2.5, 2)\", \"assert calculate_mean_and_count([float('nan'), float('... | {
"split": "train",
"index": 165,
"acecode_id": "bigcode_python_fns_18660",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that calculates the geometric mean of the elements in the given list. Your function should return an error message if the list contains any negative numbers, as the geometric mean can only be calculated for positive numbers. If the list is empty, return ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert geometric_mean([1, 2, 3, 4, 5]) == 2.605171084697352\", \"assert geometric_mean([0, 1, 2]) == 0.0\", \"assert geometric_mean([1]) == 1.0\", \"assert geometric_mean([0, 0, 0]) == 0.0\", \"assert geometric_mean([1, 1, 1, 1]) == 1.0\", \"assert geometric_mean([... | {
"split": "train",
"index": 166,
"acecode_id": "evol_25585",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function `count_steps_to_palindrome(num: int) -> Tuple[bool, int]` that determines whether a given integer exhibits the characteristics of a palindromic number and counts the number of steps required to convert the number into a palindromic number by repeatedly reve... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_steps_to_palindrome(195) == (True, 4)\", \"assert count_steps_to_palindrome(7337) == (True, 0)\", \"assert count_steps_to_palindrome(0) == (True, 0)\", \"assert count_steps_to_palindrome(7) == (True, 0)\", \"assert count_steps_to_palindrome(-1) == (Fal... | {
"split": "train",
"index": 167,
"acecode_id": "evol_18407",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves the maximum lengths and sizes of various messages and tokens used in a gaming platform. The function should return these values as a dictionary. The platform has the following constants: CLANINVITEMSG_MAXLEN (200), CLANINVI... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_message_constraints() == {'CLANINVITEMSG_MAXLEN': 200, 'CLANINVITERESPONSEMSG_MAXLEN': 200, 'CLANCHALLENGEMSG_MAXLEN': 200, 'CLANMSG_MAXLEN': 200, 'MEDIUS_TOKEN_MAXSIZE': 8, 'MEDIUS_BITFIELD_ELEMENT_SIZE': 8, 'MEDIUS_GENERIC_CHAT_FILTER_BITFIELD_LEN': 12... | {
"split": "train",
"index": 168,
"acecode_id": "oss_27764",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `flip_every_k_elements` that modifies a list of integers by flipping (i.e., changing the sign of) every k-th element starting from the first element. The function should take two parameters: a list of integers `arr` and an integer `k`... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert flip_every_k_elements([10, 20, 30, 40], 1) == [-10, -20, -30, -40]\", \"assert flip_every_k_elements([0, 1, 2], 3) == [0, 1, 2]\", \"assert flip_every_k_elements([], 1) == []\", \"assert flip_every_k_elements([100, -200, 300], 1) == [-100, 200, -300]\", \"as... | {
"split": "train",
"index": 169,
"acecode_id": "bigcode_python_fns_15395",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function `generate_fibonacci(n)` that generates an array containing the first n Fibonacci numbers. The function should not use recursion and must handle edge cases where n <= 0 by returning an empty array. If n is 1, the function should return an array containing on... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_fibonacci(0) == []\", \"assert generate_fibonacci(1) == [0]\", \"assert generate_fibonacci(2) == [0, 1]\", \"assert generate_fibonacci(3) == [0, 1, 1]\", \"assert generate_fibonacci(4) == [0, 1, 1, 2]\", \"assert generate_fibonacci(5) == [0, 1, 1, 2... | {
"split": "train",
"index": 170,
"acecode_id": "evol_4298",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function called `filter_numbers` that filters a list of integers based on a given threshold. The function should return a new list containing only the integers from the input list that are greater than the specified threshold. The function sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_numbers([1, 2, 3, 4, 5], 3) == [4, 5]\", \"assert filter_numbers([10, 20, 30, 40], 25) == [30, 40]\", \"assert filter_numbers([5, 3, 8, 1, 2], 10) == []\", \"assert filter_numbers([-1, -2, -3, -4], -3) == [-1, -2]\", \"assert filter_numbers([0, 0, 0, ... | {
"split": "train",
"index": 171,
"acecode_id": "oss_20800",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given three lists of integers. Write a function `get_even_and_merge(l1: list, l2: list, l3: list) -> list` that takes these three lists as input, extracts the even numbers from them, merges these even numbers into a single list, sorts the merged list in increasing order... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_even_and_merge([1, 2, 3], [4, 5, 6], [7, 8, 9]) == [2, 4, 6, 8]\", \"assert get_even_and_merge([10, 12, 14], [1, 3, 5], [20, 22, 24]) == [10, 12, 14, 20, 22, 24]\", \"assert get_even_and_merge([-2, -1, 0], [1, 3, 5], [-4, -6, 8]) == [-6, -4, -2, 0, 8]\",... | {
"split": "train",
"index": 172,
"acecode_id": "evol_34071",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function to manage the execution of a job named 'cleanup' on a simulated agent system. The job is responsible for cleaning up specified temporary files from a given directory path. Your function should take the following parameters: - `job_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert execute_cleanup_job('cleanup', 'agent_1', '/tmp/files') == 'Cleanup initiated for /tmp/files on agent agent_1.'\", \"assert execute_cleanup_job('cleanup', 'agent_2', '/var/tmp') == 'Cleanup initiated for /var/tmp on agent agent_2.'\", \"assert execute_cleanu... | {
"split": "train",
"index": 173,
"acecode_id": "oss_15784",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function `safe_division(a: float, b: float) -> float` that takes two floating-point numbers `a` and `b` as input and returns the result of the division `a / b`. If `b` is zero, the function should return `None` instead of raising an exception. This function is benef... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert safe_division(10.0, 2.0) == 5.0\", \"assert safe_division(5.0, 0.0) == None\", \"assert safe_division(15.0, 3.0) == 5.0\", \"assert safe_division(8.0, 4.0) == 2.0\", \"assert safe_division(1.0, 1.0) == 1.0\", \"assert safe_division(10.0, 0.0) == None\", \"as... | {
"split": "train",
"index": 174,
"acecode_id": "evol_3647",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `validate_email(email: str) -> bool` that checks if a given email address follows the standard SMTP (Simple Mail Transfer Protocol) syntax. The email address must consist of a local-part and a domain, separated by an '@' symbol. The local-part can include l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_email('user@example.com') == True\", \"assert validate_email('user.name@domain.co') == True\", \"assert validate_email('user_name+tag@sub.domain.com') == True\", \"assert validate_email('user@domain.com') == True\", \"assert validate_email('user@dom... | {
"split": "train",
"index": 175,
"acecode_id": "evol_20795",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that returns a new list containing only the unique integers from the input list, preserving the order of their first occurrence. The input list may contain positive and negative integers as well as duplicates. Your task is to implement... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_integers([1, 2, 2, 3]) == [1, 2, 3]\", \"assert unique_integers([4, 5, 6, 4, 7, 5]) == [4, 5, 6, 7]\", \"assert unique_integers([1, 1, 1, 1]) == [1]\", \"assert unique_integers([-1, -2, -2, -3]) == [-1, -2, -3]\", \"assert unique_integers([]) == []\",... | {
"split": "train",
"index": 176,
"acecode_id": "bigcode_python_fns_9042",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of integers and returns a new list containing only the even numbers from the original list. The function should maintain the order of the even numbers as they appeared in the input list. Implement the function `f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 15, 20, 25]) == [10, 20]\", \"assert filter_even_numbers([1, 3, 5]) == []\", \"assert filter_even_numbers([0, -2, -4, 1]) == [0, -2, -4]\", \"assert filter_even_numbers([]) =... | {
"split": "train",
"index": 177,
"acecode_id": "oss_32425",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `get_fifth_character(s: str) -> str` that returns the character located at the fifth position (index 4) of the given string `s`, provided that the length of `s` is greater than 4. If the length of `s` is less than or equal to 4, return a message indicating that... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_fifth_character('Python') == 'o'\", \"assert get_fifth_character('HelloWorld') == 'o'\", \"assert get_fifth_character('OpenAI') == 'A'\", \"assert get_fifth_character('abcdefg') == 'e'\", \"assert get_fifth_character('1234567890') == '5'\", \"assert get_... | {
"split": "train",
"index": 178,
"acecode_id": "evol_17393",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Design a class named 'Boat' that holds details related to a single boat. The class should include a method 'boat_info' that receives and stores multiple details about the boat, such as name, weight, color, and capacity. Additionally, the class should have a method 'anchor' that... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert Boat('Titan', 5000, 'Red', 10).name == 'Titan'\", \"assert Boat('Titan', 5000, 'Red', 10).weight == 5000\", \"assert Boat('Titan', 5000, 'Red', 10).color == 'Red'\", \"assert Boat('Titan', 5000, 'Red', 10).capacity == 10\"]}"
} | {
"split": "train",
"index": 179,
"acecode_id": "evol_18339",
"num_tests": 4
} |
acecode | [
{
"role": "user",
"content": "Given a non-negative integer n (0 <= n <= 12), write a Python function called `calculate_factorial` that returns the factorial of n. The factorial of a non-negative integer n is denoted by n! and is the product of all positive integers less than or equal to n. For example, the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_factorial(0) == 1\", \"assert calculate_factorial(1) == 1\", \"assert calculate_factorial(2) == 2\", \"assert calculate_factorial(3) == 6\", \"assert calculate_factorial(4) == 24\", \"assert calculate_factorial(5) == 120\", \"assert calculate_facto... | {
"split": "train",
"index": 180,
"acecode_id": "oss_33825",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the behavior of a cancellable request handler. The function should accept a boolean parameter `client_disconnected` that indicates whether the client has disconnected during the request processing. If `client_disconnected` ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cancellable_request_response(True) == 'Oh No!'\", \"assert cancellable_request_response(False) == 'Request processed successfully!'\", \"assert cancellable_request_response(True) == 'Oh No!'\", \"assert cancellable_request_response(False) == 'Request process... | {
"split": "train",
"index": 181,
"acecode_id": "bigcode_python_fns_40124",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes three integers representing the RGB (Red, Green, Blue) color components and returns them as a tuple. The function should also ensure that each color component is clamped within the range of 0 to 255. If a component is below... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_clamped_color(255, 128, 64) == (255, 128, 64)\", \"assert get_clamped_color(-10, 0, 300) == (0, 0, 255)\", \"assert get_clamped_color(256, -5, 100) == (255, 0, 100)\", \"assert get_clamped_color(255, 255, 255) == (255, 255, 255)\", \"assert get_clamped_c... | {
"split": "train",
"index": 182,
"acecode_id": "oss_4476",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing a sequence of numbers, write a function that returns a new list containing only the prime numbers from the original list. A prime number is defined as a number greater than 1 that has no positive divisors other than 1 and itself. The output... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_primes([2, 3, 4, 5, 6]) == [2, 3, 5]\", \"assert filter_primes([1, 4, 6, 8]) == []\", \"assert filter_primes([17, 18, 19, 20]) == [17, 19]\", \"assert filter_primes([10, 11, 12, 13, 14]) == [11, 13]\", \"assert filter_primes([0, 1, 2, 3, 4]) == [2, 3]... | {
"split": "train",
"index": 183,
"acecode_id": "bigcode_python_fns_27890",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of report objects, each containing details about a fishing report that includes the angler's name, a report ID, and the species caught. Your task is to implement a function called `verify_links(reports: List[Dict[str, Union[str, int]]]) -> List[bool]` that ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert verify_links([{'angler_name': 'Homer Simpson', 'report_id': 42, 'species': 'Trout'}]) == [True]\", \"assert verify_links([{'angler_name': 'Marge Simpson', 'report_id': 43, 'species': 'Salmon'}]) == [True]\", \"assert verify_links([{'angler_name': 'Bart Simps... | {
"split": "train",
"index": 184,
"acecode_id": "bigcode_python_fns_44653",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given the length of an edge of a dodecahedron, write a function `calculate_dodecahedron_properties(edge_length: float) -> Tuple[float, float]` that calculates and returns the surface area and volume of the dodecahedron. The surface area and volume should be calculated using the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_dodecahedron_properties(1) == (3 * math.sqrt(25 + 10 * math.sqrt(5)), ((15 + 7 * math.sqrt(5)) / 4))\", \"assert calculate_dodecahedron_properties(2) == (3 * math.sqrt(25 + 10 * math.sqrt(5)) * 4, ((15 + 7 * math.sqrt(5)) / 4) * 8)\", \"assert calc... | {
"split": "train",
"index": 185,
"acecode_id": "evol_19175",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, instead of removing negative numbers, replace each negative number with the sum of the squares of the next two positive numbers found in the list after the negative number. If there are not enough positive numbers after a negative number, remove it. Im... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_negatives([-1, -2, -3]) == []\", \"assert replace_negatives([-2, -4, -6, -8]) == []\", \"assert replace_negatives([]) == []\", \"assert replace_negatives([-1, -2]) == []\", \"assert replace_negatives([5, -1, -1]) == [5]\"]}"
} | {
"split": "train",
"index": 186,
"acecode_id": "evol_1518",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Create a function that takes two parameters: a list of n unique integers and an integer m. The function should return a new list of m unique elements from the given list. Expect the given list to have at least m elements but not more than 10^6 elements. The integers within the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert select_random_elements([1, 5, 8, 10], 2) != select_random_elements([1, 5, 8, 10], 2)\", \"assert len(select_random_elements([1, 5, 8, 10], 2)) == 2\", \"assert set(select_random_elements([1, 5, 8, 10], 2)).issubset({1, 5, 8, 10})\", \"assert len(select_rando... | {
"split": "train",
"index": 187,
"acecode_id": "evol_15372",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function named 'create_pseudonym' that takes a single string argument 'name'. The function should return a dictionary with a key 'pseudonym' that maps to the provided name. The name should be processed to ensure it is in lowercase and has leading and trailing whitespac... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_pseudonym('Alice') == {'pseudonym': 'alice'}\", \"assert create_pseudonym(' Bob ') == {'pseudonym': 'bob'}\", \"assert create_pseudonym(' CHARLIE ') == {'pseudonym': 'charlie'}\", \"assert create_pseudonym('') == {'pseudonym': 'default_pseudonym'}... | {
"split": "train",
"index": 188,
"acecode_id": "evol_35492",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that filters a list of integers based on specified criteria. The function should take a list of integers and a filter condition as input, and return a new list containing only the integers that meet the filter condition. The filter co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_integers([1, 2, 3, 4, 5], 'even') == [2, 4]\", \"assert filter_integers([1, 2, 3, 4, 5], 'odd') == [1, 3, 5]\", \"assert filter_integers([1, 12, 3, 4, 15], 'greater_than_10') == [12, 15]\", \"assert filter_integers([1, 2, 3, 4, 5], 'less_than_5') == [... | {
"split": "train",
"index": 189,
"acecode_id": "oss_13816",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple grid navigation algorithm for an agent in a simulated environment. The environment is represented by a grid where the agent can move in four directions: up (0), down (1), left (2), and right (3). The agent starts at a given position and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert navigate_grid(5, 5, (0, 0), (4, 4), []) == 8\", \"assert navigate_grid(3, 3, (0, 0), (2, 2), [(1, 1)]) == 4\", \"assert navigate_grid(6, 6, (0, 0), (5, 5), [(1, 3), (3, 1)]) == 10\", \"assert navigate_grid(1, 1, (0, 0), (0, 0), []) == 0\", \"assert navigate_... | {
"split": "train",
"index": 190,
"acecode_id": "oss_19618",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves the current assignments for each class a student is enrolled in based on predefined data. You will receive a student ID and a list of courses with their assignments. Your function should return a dictionary where the keys a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_student_assignments(1, {101: ('Math', ['Algebra Homework', 'Calculus Project']), 102: ('Science', ['Physics Lab', 'Chemistry Assignment'])}) == {'Math': ['Algebra Homework', 'Calculus Project'], 'Science': ['Physics Lab', 'Chemistry Assignment']}\", \"as... | {
"split": "train",
"index": 191,
"acecode_id": "oss_32940",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that manages the addition of labels for a document typesetting system. The function should have the following functionality: \n- Accept a `label` parameter, which is the name of the label to be added. \n- Accept an optional `above` parame... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_label('header') == 'label:header added at the beginning.'\", \"assert add_label('introduction') == 'label:introduction added at the beginning.'\", \"assert add_label('table of contents', above=True) == 'label:table of contents added at the beginning.'\",... | {
"split": "train",
"index": 192,
"acecode_id": "oss_4356",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function `count_occurrences(text: str) -> Dict[str, int]` that takes a string `text` as input and returns a dictionary where the keys are the unique words in the text (case-insensitive), and the values are the number of times each word appears in the text. Words are... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_occurrences('Hello world hello') == {'hello': 2, 'world': 1}\", \"assert count_occurrences('') == {}\", \"assert count_occurrences('Python python PYTHON') == {'python': 3}\", \"assert count_occurrences('A man a plan a canal Panama') == {'a': 3, 'man': ... | {
"split": "train",
"index": 193,
"acecode_id": "evol_4737",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function `check_perfect_square(num: int) -> Tuple[bool, Union[int, Tuple[int, int]]]` that checks whether a given integer is a perfect square. If `num` is a perfect square, return `True` and the integer square root of `num`. If `num` is not a perfect square and is g... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_perfect_square(-1) == False\", \"assert check_perfect_square(0) == (True, 0)\", \"assert check_perfect_square(1) == (True, 1)\", \"assert check_perfect_square(4) == (True, 2)\", \"assert check_perfect_square(9) == (True, 3)\", \"assert check_perfect_sq... | {
"split": "train",
"index": 194,
"acecode_id": "evol_28738",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `generate_combinations(characters: str, combinationLength: int) -> List[str]` that takes a string of sorted, distinct lowercase English letters `characters` and an integer `combinationLength`, and returns a list of all combinations of `characters` of length... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_combinations('abc', 2) == ['ab', 'ac', 'bc']\", \"assert generate_combinations('abcd', 2) == ['ab', 'ac', 'ad', 'bc', 'bd', 'cd']\", \"assert generate_combinations('abcde', 3) == ['abc', 'abd', 'abe', 'acd', 'ace', 'ade', 'bcd', 'bce', 'bde', 'cde']... | {
"split": "train",
"index": 195,
"acecode_id": "evol_33756",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a query string, implement a function `safe_query_string(query_string: str) -> str` that converts the query string into a unicode-safe and ASCII-safe string. The function should ensure that all characters in the query string are ASCII-compatible, whil... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert safe_query_string('name=John&Doe=Smith') == 'name=John&Doe=Smith'\", \"assert safe_query_string('name=J\\u00f6hn&Doe=Sm\\u00edth') == 'name=J%C3%B6hn&Doe=Sm%C3%ADth'\", \"assert safe_query_string('search=hello world') == 'search=hello%20world'\", \"assert sa... | {
"split": "train",
"index": 196,
"acecode_id": "bigcode_python_fns_44879",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing the HTML content of a detail page of an ebook. Your task is to implement a function `scrape_ebook_details(html_content: str) -> dict` that extracts the following information: the URL of the page (assumed to be the first occurrence of 'href' i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert scrape_ebook_details('<html><head><title>Ebook</title></head><body><a href=\\\"http://example.com\\\">Link</a><span class=\\\"bookTitle\\\">Python Programming</span><div class=\\\"buy\\\">$29.99</div><div id=\\\"content\\\"><h3>Chapter 1</h3><h3>Chapter 2</h... | {
"split": "train",
"index": 197,
"acecode_id": "bigcode_python_fns_19815",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_type(x)` that takes a single character `x` as input and prints 'alpha' if `x` is 'a', 'beta' if `x` is 'b', and 'gamma' if `x` is 'c'. Your solution must not use an `elif`, dictionary, or switch-case statement. Additionally, your function should be ca... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_type('a') == 'alpha'\", \"assert find_type('A') == 'alpha'\", \"assert find_type('b') == 'beta'\", \"assert find_type('B') == 'beta'\", \"assert find_type('c') == 'gamma'\", \"assert find_type('C') == 'gamma'\", \"assert find_type('d') == 'unknown'\", \... | {
"split": "train",
"index": 198,
"acecode_id": "evol_7855",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes two positive integers as input and returns their least common multiple (LCM). If either of the input numbers is zero or negative, the function should return \"Invalid input\". Implement the solution using a custom function to calculate the greatest c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lcm(18, 9) == 18\", \"assert lcm(4, 6) == 12\", \"assert lcm(5, 0) == 'Invalid input'\", \"assert lcm(-3, 7) == 'Invalid input'\", \"assert lcm(12, 15) == 60\", \"assert lcm(1, 1) == 1\", \"assert lcm(21, 14) == 42\", \"assert lcm(8, 12) == 24\", \"assert lc... | {
"split": "train",
"index": 199,
"acecode_id": "evol_33950",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.