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 simple session management system. Write a function `manage_sessions(operations: List[Tuple[str]]) -> List[List[int]]` that simulates starting and ending sessions, as well as retrieving the list of active session IDs. The function takes a list ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_sessions([('start',), ('start',), ('active',)]) == [[1, 2]]\", \"assert manage_sessions([('start',), ('start',), ('start',), ('end', 2), ('active',)]) == [[1, 3]]\", \"assert manage_sessions([('start',), ('end', 1), ('end', 2), ('active',)]) == [[]]\"... | {
"split": "train",
"index": 5500,
"acecode_id": "oss_11622",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function to calculate the total salary of an employee after considering bonuses and deductions. Given the employee's base salary, a bonus amount, and a deduction amount, implement a function that returns the final salary. The function signature sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_final_salary(50000, 5000, 2000) == 53000\", \"assert calculate_final_salary(60000, 8000, 3000) == 65000\", \"assert calculate_final_salary(70000, 0, 5000) == 65000\", \"assert calculate_final_salary(30000, 2000, 10000) == 22000\", \"assert calculat... | {
"split": "train",
"index": 5501,
"acecode_id": "oss_12230",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that compresses the list by replacing consecutive duplicate numbers with a single instance of the number followed by its count. For example, the list [2, 2, 3, 3, 3, 4] should be compressed to '2 2 3 3 4'. Implement a function called `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compress_array([1, 1, 1, 2, 2, 3]) == '1 3 2 2 3 1'\", \"assert compress_array([5]) == '5 1'\", \"assert compress_array([]) == ''\", \"assert compress_array([1, 2, 3, 4]) == '1 1 2 1 3 1 4 1'\", \"assert compress_array([7, 7, 7, 7, 8, 8, 9]) == '7 4 8 2 9 1'... | {
"split": "train",
"index": 5502,
"acecode_id": "evol_5208",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a string and a list of words to hide, and returns the string with all occurrences of the specified words replaced by asterisks. Each occurrence of a word should be replaced with a number of asterisks equal to the length of the word. The function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hide_words('The quick brown fox jumped over the lazy dog.', ['fox', 'dog']) == 'The quick brown *** jumped over the lazy ***.'\", \"assert hide_words('The quick brown Dog jumped over the lazy dog.', ['dog']) == 'The quick brown Dog jumped over the lazy ***.'... | {
"split": "train",
"index": 5503,
"acecode_id": "evol_11175",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Write a function to find the maximum run of consecutive uppercase characters in the given string. The function should return a tuple containing the starting and ending index of this run in the string. If there are multiple runs of the same length, return the indices of the firs... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_run_uppercase('A') == (0, 0)\", \"assert max_run_uppercase('abcdefghijklmnopqrstuvwxyz') == (-1, -1)\", \"assert max_run_uppercase('ABCabcDEF') == (0, 2)\", \"assert max_run_uppercase('') == (-1, -1)\", \"assert max_run_uppercase('helloWORLD') == (5, 9)\... | {
"split": "train",
"index": 5504,
"acecode_id": "evol_27104",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function `insert_node(head: Node, new_value: int) -> Node` that inserts a new node with the given `new_value` into a doubly-linked list represented by `head`. The function should maintain the order of nodes and handle edge cases such as duplicate values and null poi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert insert_node(Node(10), 20).next.data == 20\", \"assert insert_node(Node(10), 10).data == 10\", \"assert insert_node(Node(10), 10).next == None\", \"assert insert_node(Node(10), 5).prev == None\", \"assert insert_node(Node(10), 5).data == 5\", \"assert insert_... | {
"split": "train",
"index": 5505,
"acecode_id": "evol_5881",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that extracts and validates URLs from a given string containing comma-separated URLs. The function should take a single string input where each URL is separated by a comma. After extracting the URLs, the function should validate ea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_valid_urls('http://example.com,http://test.com') == ['http://example.com', 'http://test.com']\", \"assert extract_valid_urls('ftp://fileserver.com,http://example.com') == ['ftp://fileserver.com', 'http://example.com']\", \"assert extract_valid_urls('... | {
"split": "train",
"index": 5506,
"acecode_id": "oss_29193",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates updating the status of a user in a hypothetical messaging application. The function should take two parameters: a filename (string) representing the file the user is currently editing, and an extension (string) representing... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_status('document', 'txt') == {'details': 'Editing document', 'assets': {'large_text': 'Editing a .txt file', 'large_image': 'txt'}}\", \"assert update_status('image', 'png') == {'details': 'Editing image', 'assets': {'large_text': 'Editing a .png file... | {
"split": "train",
"index": 5507,
"acecode_id": "bigcode_python_fns_17384",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `summation(n, term)` that takes an integer `n` and a function `term`. The function should return the sum of the first `n` natural numbers after applying the `term` function to each number. You must implement this using recursion only. The input `n` w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert summation(1, lambda x: x) == 1\", \"assert summation(2, lambda x: x) == 3\", \"assert summation(3, lambda x: x) == 6\", \"assert summation(4, lambda x: x) == 10\", \"assert summation(5, lambda x: x) == 15\", \"assert summation(5, lambda x: x * x) == 55\", \"... | {
"split": "train",
"index": 5508,
"acecode_id": "bigcode_python_fns_5550",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of buildings in a skyline. Write a function `merge_skylines` that takes in two lists of integers, `skyline1` and `skyline2`, and returns a new list that represents the merged skyline. The merged skyline should combine th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_skylines([1, 3, 2], [2, 1, 3]) == [2, 3, 3]\", \"assert merge_skylines([1, 4, 3], [2, 5, 1]) == [2, 5, 3]\", \"assert merge_skylines([5, 0, 0], [0, 5, 0]) == [5, 5, 0]\", \"assert merge_skylines([0, 2, 0], [0, 0, 3]) == [0, 2, 3]\", \"assert merge_skyl... | {
"split": "train",
"index": 5509,
"acecode_id": "bigcode_python_fns_44377",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a unique API key for users of a social media platform. The API key is composed of the user's ID and a secret key. The user's ID is a 20-character alphanumeric string, while the secret key is a 10-character alphanumeric stri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generateAPIKey('XXXXXXXXXXXXXXXXXXXX', 'ABCD1234EF') == 'XXXXXXXXXXXXXXXXXXXXABCD1234EF'\", \"assert generateAPIKey('12345678901234567890', 'ABCD1234EF') == '12345678901234567890ABCD1234EF'\", \"assert generateAPIKey('ABCDEFGHIJKLMN12345', '1234567890') == '... | {
"split": "train",
"index": 5510,
"acecode_id": "oss_31353",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Design a function `record_transaction(sku: str, transaction_type: str, quantity: int) -> None` that records a stock transaction for a product identified by its SKU in a warehousing inventory control system. If the transaction type is 'add', the quantity should be added to the p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert record_transaction('SKU123', 'add', 10) == None\", \"assert record_transaction('SKU123', 'remove', 5) == None\", \"assert record_transaction('SKU123', 'add', 20) == None\", \"assert record_transaction('SKU123', 'remove', 10) == None\", \"assert record_transa... | {
"split": "train",
"index": 5511,
"acecode_id": "evol_23319",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of words, implement a function that takes a string of text and returns a list of words from that text that are present in the given list of words. The comparison should be case-insensitive. The function signature is: def find_matching_words(word_list: List[str], te... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_matching_words(['dog', 'cat'], 'The dog chased the cat and the cat ran away.') == ['dog', 'cat']\", \"assert find_matching_words(['test'], 'No match here.') == []\", \"assert find_matching_words(['python', 'java'], 'Python and Java are popular programmi... | {
"split": "train",
"index": 5512,
"acecode_id": "bigcode_python_fns_19200",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given the lengths of the three sides of a triangle, write a function `triangle_properties(a: float, b: float, c: float) -> Union[Tuple[float, str], int]` that returns a tuple containing the area of the triangle (rounded to two decimal places) and the type of triangle ('Equilate... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert triangle_properties(3, 4, 5) == (6.0, 'Scalene')\", \"assert triangle_properties(1, 2, 10) == -1\", \"assert triangle_properties(5, 5, 8) == (12.0, 'Isosceles')\", \"assert triangle_properties(6, 6, 6) == (15.59, 'Equilateral')\", \"assert triangle_propertie... | {
"split": "train",
"index": 5513,
"acecode_id": "evol_10225",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary where the keys are names of car manufacturers and the values are lists of car models produced by each manufacturer. Write a function that returns a list of the first car model for each manufacturer in the order they appear in the dictionary. If a manu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_first_models({'Toyota': ['Camry', 'Corolla'], 'Ford': ['F-150', 'Focus'], 'Honda': []}) == ['Camry', 'F-150']\", \"assert get_first_models({'Tesla': ['Model S', 'Model 3'], 'BMW': ['X5', 'X3'], 'Audi': []}) == ['Model S', 'X5']\", \"assert get_first_mode... | {
"split": "train",
"index": 5514,
"acecode_id": "bigcode_python_fns_7305",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a list of integers and an optional argument specifying the minimum length of subarray. The function should return the shortest continuous increasing subarray in the list that has a length above or equal to the specified minimum length. If no such sub... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shortest_increasing_subarray([2,3,3,4,3,4,5,6,7], 3) == [3, 4, 5, 6, 7]\", \"assert shortest_increasing_subarray([1, 1, 1, 1], 2) == []\", \"assert shortest_increasing_subarray([], 2) == []\", \"assert shortest_increasing_subarray([3, 2, 1], 2) == []\", \"as... | {
"split": "train",
"index": 5515,
"acecode_id": "evol_6397",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function `extract_urls(text: str) -> List[str]` that takes a string as input and returns a list of all URLs present in the string. A URL is defined as a substring that starts with 'http://' or 'https://' followed by valid characters. If no URLs are found, return an ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_urls('Visit our site at http://example.com for more information.') == ['http://example.com']\", \"assert extract_urls('No URL here! Just some text.') == []\", \"assert extract_urls('Multiple URLs: http://foo.bar and https://baz.qux') == ['http://foo.... | {
"split": "train",
"index": 5516,
"acecode_id": "evol_14043",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of strings representing subject labels, write a function `scale_labels(subject_labels)` that scales the labels by converting each unique label into an integer. The labels should be assigned numbers starting from 0 for the first unique label, 1 for the second uniq... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert scale_labels(['math', 'science', 'math', 'history']) == [0, 1, 0, 2]\", \"assert scale_labels(['apple', 'banana', 'apple', 'orange']) == [0, 1, 0, 2]\", \"assert scale_labels(['cat', 'dog', 'cat', 'mouse', 'dog']) == [0, 1, 0, 2, 1]\", \"assert scale_labels(... | {
"split": "train",
"index": 5517,
"acecode_id": "bigcode_python_fns_13846",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `get_full_name(honorific: str, cognomen: str) -> str` that takes a person's honorific designation and their cognomen as input and returns their full name as a single string, formatted as 'Honorific Cognomen'.\nPlease reason step by step, then write a self-c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_full_name('Mr.', 'Smith') == 'Mr. Smith'\", \"assert get_full_name('Dr.', 'Johnson') == 'Dr. Johnson'\", \"assert get_full_name('Mrs.', 'Brown') == 'Mrs. Brown'\", \"assert get_full_name('Prof.', 'Williams') == 'Prof. Williams'\", \"assert get_full_name(... | {
"split": "train",
"index": 5518,
"acecode_id": "evol_7311",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `adjust_bicycle_speed` that takes in three parameters: an integer `gear`, an integer `speed`, and a string `terrain`. The function should simulate adjusting the speed of a bicycle based on the terrain provided. The terrain can be 'flat', 'steep', or ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert adjust_bicycle_speed(1, 0, 'flat') == 5\", \"assert adjust_bicycle_speed(2, 10, 'flat') == 15\", \"assert adjust_bicycle_speed(3, 5, 'steep') == 0\", \"assert adjust_bicycle_speed(4, 10, 'steep') == 5\", \"assert adjust_bicycle_speed(1, 0, 'downhill') == 10\... | {
"split": "train",
"index": 5519,
"acecode_id": "evol_35582",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a report text message for a notification system. The function should take in three parameters: a string `report_text`, a dictionary `svc_info` with a key 'ReportARN', and a string `now_str`. The report text has a maximum al... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_report('This is a test report that is within the limit.', {'ReportARN': 'arn:aws:sns:us-east-1:123456789012:MyTopic'}, '2023-10-01') == 'This is a test report that is within the limit.'\", \"assert process_report('Short report.', {'ReportARN': 'arn:a... | {
"split": "train",
"index": 5520,
"acecode_id": "bigcode_python_fns_40442",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that logs information about HTTP requests. The function should take the following parameters: \n- `method` (string): The HTTP method used in the request (e.g., 'GET', 'POST', 'PUT', 'DELETE'). \n- `full_url` (string): The full URL of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_request_fail('GET', 'https://example.com/api/resource', '/api/resource') is None\", \"assert log_request_fail('POST', 'http://test.com/path/to/resource', '/path/to/resource') is None\", \"assert log_request_fail('PUT', 'https://mywebsite.org/update/item'... | {
"split": "train",
"index": 5521,
"acecode_id": "oss_31449",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `s` that consists solely of the characters 'a', 'b', and 'c', implement a function that calculates and returns the total count of substrings that include at least one instance of each character 'a', 'b', and 'c'.\nPlease reason step by step, then write a self-con... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert substrings('abcabc') == 10\", \"assert substrings('aaacb') == 3\", \"assert substrings('abc') == 1\", \"assert substrings('abcabcabc') == 28\", \"assert substrings('ab') == 0\", \"assert substrings('aaaaaa') == 0\", \"assert substrings('bccba') == 3\", \"ass... | {
"split": "train",
"index": 5522,
"acecode_id": "evol_9331",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a contemporary poem and an integer representing a node identifier. Write a function `insert_poem(poem: str, node: int) -> str` that simulates the insertion of the poem into a graph database node. The function should return a success message i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert insert_poem('Do not go gentle into that good night', 1) == 'Poem inserted successfully'\", \"assert insert_poem('Old age should burn and rave at close of day', 2) == 'Poem inserted successfully'\", \"assert insert_poem('Rage, rage against the dying of the li... | {
"split": "train",
"index": 5523,
"acecode_id": "evol_22347",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates monitoring the active window on a Linux system. The function should take as input a list of tuples, where each tuple represents the name of a window and its corresponding bounding box coordinates in the format (name,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert monitor_active_windows([('Notepad', 10, 10, 300, 400)]) == ['Notepad: (10, 10, 300, 400)']\", \"assert monitor_active_windows([('Browser', 0, 0, 1280, 720)]) == ['Browser: (0, 0, 1280, 720)']\", \"assert monitor_active_windows([(None, 5, 5, 100, 100)]) == ['... | {
"split": "train",
"index": 5524,
"acecode_id": "oss_22992",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that returns the maximum product of any three distinct integers in the list. If the list has less than three integers, return 0. The function should handle both positive and negative numbers. Implement the function `max_product_of_thre... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_product_of_three([1, 2, 3, 4]) == 24\", \"assert max_product_of_three([-10, -10, 5, 2]) == 500\", \"assert max_product_of_three([1, 2, 3]) == 6\", \"assert max_product_of_three([-1, -2, -3]) == -6\", \"assert max_product_of_three([0, 0, 0]) == 0\", \"ass... | {
"split": "train",
"index": 5525,
"acecode_id": "bigcode_python_fns_48869",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `generate_unique_tuple()` that generates a 5-element tuple of unique random numbers between 5 and 15 (inclusive). Ensure that no number in the tuple is a multiple of another number in the tuple. The function should return the generated tuple.\nPlease reason ste... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_unique_tuple() != generate_unique_tuple()\", \"assert len(generate_unique_tuple()) == 5\", \"assert all(5 <= n <= 15 for n in generate_unique_tuple())\", \"assert all(not any(n % m == 0 or m % n == 0 for m in generate_unique_tuple() if n != m) for n... | {
"split": "train",
"index": 5526,
"acecode_id": "evol_6293",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of coefficients representing a polynomial in the form of a power series. Each coefficient corresponds to the coefficient of the term with the respective power of x. Your task is to write a function that evaluates the value of the polynomial for a given valu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate_polynomial([1.0, 0, 0], 5) == 1.0\", \"assert evaluate_polynomial([0, 0, 0], 3) == 0.0\", \"assert evaluate_polynomial([1, 2, 3], 1) == 6.0\", \"assert evaluate_polynomial([-1, -2, -3], 1) == -6.0\", \"assert evaluate_polynomial([2, 2, 2], 2) == 14.... | {
"split": "train",
"index": 5527,
"acecode_id": "oss_27688",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given two strings, `corpus` and `directory`. Your task is to create a function `copy_files(corpus: str, directory: str) -> List[str]` that simulates copying all characters from the `corpus` string into a new string `directory`. The `directory` string should contain all ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert copy_files('abc', 'xyz') == ['a', 'b', 'c']\", \"assert copy_files('hello', 'world') == ['h', 'e', 'l', 'l', 'o']\", \"assert copy_files('', 'anything') == []\", \"assert copy_files('test', '') == ['t', 'e', 's', 't']\", \"assert copy_files('12345', '67890')... | {
"split": "train",
"index": 5528,
"acecode_id": "bigcode_python_fns_1018",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two distinct binary search trees represented by their root nodes, implement a function `isIdentical(tree1, tree2)` that determines if the two trees are structurally identical and contain the same node values. The function should return `True` if both trees are identical, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isIdentical(None, None) == True\", \"assert isIdentical(None, TreeNode(1)) == False\", \"assert isIdentical(TreeNode(1), None) == False\", \"assert isIdentical(TreeNode(1), TreeNode(1)) == True\", \"assert isIdentical(TreeNode(2), TreeNode(2)) == True\", \"a... | {
"split": "train",
"index": 5529,
"acecode_id": "evol_14649",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `get_full_name(first_name: str, last_name: str) -> str` that takes a person's first name and last name as arguments and returns their full name in the format 'First Last'.\nPlease reason step by step, then write a self-contained Python solution. Give your f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_full_name('John', 'Doe') == 'John Doe'\", \"assert get_full_name('Jane', 'Smith') == 'Jane Smith'\", \"assert get_full_name('Alice', 'Johnson') == 'Alice Johnson'\", \"assert get_full_name('Bob', 'Brown') == 'Bob Brown'\", \"assert get_full_name('Charlie... | {
"split": "train",
"index": 5530,
"acecode_id": "evol_1502",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a scenario involving two sets of samples and a random seed. The function should take in two integers representing the number of samples in each set and a seed for the random number generator. The function should then pe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_sampling(5, 10, 42) == True\", \"assert simulate_sampling(10, 10, 42) == False\", \"assert simulate_sampling(0, 1, 100) == True\", \"assert simulate_sampling(1, 0, 100) == True\", \"assert simulate_sampling(3, 3, 123) == False\", \"assert simulate_s... | {
"split": "train",
"index": 5531,
"acecode_id": "oss_16107",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a Python function that converts raw temperature and humidity readings from a SHT2X sensor into human-readable values. The raw readings are provided as integers, where the temperature reading is in the range of 0 to 65535 and the humidity reading is a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_readings(0, 0) == (-46.85, -6)\", \"assert convert_readings(65536, 0) == (None, None)\", \"assert convert_readings(0, 65536) == (None, None)\", \"assert convert_readings(-1, 0) == (None, None)\", \"assert convert_readings(0, -1) == (None, None)\"]}"
... | {
"split": "train",
"index": 5532,
"acecode_id": "oss_34196",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a text augmentation algorithm that splits a given text into two parts at a specific character index. The algorithm should split the text at the index of the minimum character count specified and return the original text if the minimum character ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert split_text_at_min_char('quick brown', 6) == 'quick brown'\", \"assert split_text_at_min_char('quick brown fox', 10) == 'quick brown fox'\", \"assert split_text_at_min_char('hello world', 5) == 'hello world'\", \"assert split_text_at_min_char('this is a test'... | {
"split": "train",
"index": 5533,
"acecode_id": "oss_29978",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are building a function that simulates connecting to a server using given connection parameters. The function `connect_to_server(host: str, port: int, username: str, password: str) -> str` should accept a host address, port number, username, and password. It should return '... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert connect_to_server('localhost', 8080, 'user', 'pass') == 'Connection successful'\", \"assert connect_to_server('localhost', 3000, 'user', 'pass') == 'Invalid port for localhost'\", \"assert connect_to_server('0.0.0.0', 3000, 'user', 'pass') == 'Invalid host'\... | {
"split": "train",
"index": 5534,
"acecode_id": "bigcode_python_fns_22569",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `name` representing a mathematical expression, write a function `is_valid_expression(name: str) -> bool` that checks if the expression is made up of valid variable names. A valid variable name consists of alphabetical characters and underscores, and must not star... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_expression('var1 + var_2 - var3') == True\", \"assert is_valid_expression('var_a * var_b / var_c') == True\", \"assert is_valid_expression('1var + var_2') == False\", \"assert is_valid_expression('var_1 + _var') == True\", \"assert is_valid_expressi... | {
"split": "train",
"index": 5535,
"acecode_id": "bigcode_python_fns_23417",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that sorts the list in ascending order using the bubble sort algorithm. The function should take a list as input and return a new list that is sorted in ascending order.\nPlease reason step by step, then write a self-contained Pyth... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bubble_sort([5, 3, 8, 4, 2]) == [2, 3, 4, 5, 8]\", \"assert bubble_sort([1]) == [1]\", \"assert bubble_sort([]) == []\", \"assert bubble_sort([2, 1]) == [1, 2]\", \"assert bubble_sort([10, 9, 8, 7, 6]) == [6, 7, 8, 9, 10]\", \"assert bubble_sort([1, 2, 3, 4,... | {
"split": "train",
"index": 5536,
"acecode_id": "evol_30278",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of tuples, where each tuple contains the coordinates of two points in a 3D space. Each point is represented as a list of three integers, [x, y, z]. Your task is to compute the absolute distance between the z-coordinates of each pair of points. The distance ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_z_distances([([0, 1, 2], [0, 1, 3])]) == [1.0]\", \"assert compute_z_distances([([0, 0, 0], [0, 0, 0])]) == [0.0]\", \"assert compute_z_distances([([1, 2, 3], [4, 5, 6]), ([0, 1, 2], [3, 4, 5])]) == [3.0, 3.0]\", \"assert compute_z_distances([([-1, -... | {
"split": "train",
"index": 5537,
"acecode_id": "bigcode_python_fns_47344",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the status updates of a virtual pet named 'Pypet'. The pet has two attributes: energy and happiness, both initialized to 50. You need to implement a function `update_pet_status(commands: List[str]) -> Tuple[int, int]` that ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_pet_status(['feed', 'play', 'sleep']) == (80, 60)\", \"assert update_pet_status(['feed', 'feed', 'play', 'sleep']) == (90, 60)\", \"assert update_pet_status(['feed', 'feed', 'feed', 'play', 'play']) == (80, 70)\", \"assert update_pet_status(['play', '... | {
"split": "train",
"index": 5538,
"acecode_id": "oss_16866",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Write a function `create_pyramid(levels: int) -> List[List[int]]` that constructs a pyramidical structure with a specified number of levels. Each level `i` of the pyramid should contain `i` random integers selected from the range of 1 to 15. The total number of integers in the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert len(create_pyramid(6)) == 6\", \"assert sum(len(level) for level in create_pyramid(6)) <= 21\", \"assert all(1 <= num <= 15 for level in create_pyramid(5) for num in level)\", \"assert create_pyramid(0) == []\", \"assert len(create_pyramid(5)) == 5\", \"asse... | {
"split": "train",
"index": 5539,
"acecode_id": "evol_16768",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of geographical coordinates representing different monitoring stations and a central coordinate. Your task is to implement a function that returns the number of monitoring stations that are located within a specified radius from the central coordinate. The ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_stations_within_radius([(0, 0), (1, 1), (2, 2)], (0, 0), 1) == 1\", \"assert count_stations_within_radius([(10, 10), (20, 20)], (15, 15), 5) == 0\", \"assert count_stations_within_radius([(0, 0)], (0, 0), 1) == 1\", \"assert count_stations_within_radiu... | {
"split": "train",
"index": 5540,
"acecode_id": "bigcode_python_fns_17758",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with manipulating Python function definitions represented as strings. Write a function named `modify_function` that takes three parameters: `func_def` (a string representing a function definition), `keyword` (a string representing a keyword argument), and `defaul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert modify_function(\\\"def example_function(arg1, arg2):\\\", 'keyword_arg1', 'default_value') == \\\"def example_function(arg1, arg2):\\\"\", \"assert modify_function(\\\"def my_func(x, y):\\\", 'z', 'default') == \\\"def my_func(x, y):\\\"\", \"assert modify_... | {
"split": "train",
"index": 5541,
"acecode_id": "oss_26715",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates the movement of a robot in a 2D grid environment based on given movement instructions. The grid is defined as a 2D list where each cell is either empty (represented by 0) or occupied by an obstacle (represented by 1)... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_robot_movement([[0, 0], [0, 0]], 'RRDD') == (1, 1)\", \"assert simulate_robot_movement([[0, 1], [0, 0]], 'DR') == (1, 1)\", \"assert simulate_robot_movement([[0, 0, 1], [0, 0, 0]], 'RDR') == (1, 2)\", \"assert simulate_robot_movement([[0]], '') == (... | {
"split": "train",
"index": 5542,
"acecode_id": "oss_497",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of grayscale pixel values representing an image and generates corresponding binary masks based on a threshold. The function should take a list of pixel values (integers between 0 and 255) and a threshold value, a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_masks([0, 128, 255, 50], 100) == ([0, 1, 1, 0], [0, 0, 0, 0])\", \"assert generate_masks([0, 0, 0, 0], 0) == ([0, 0, 0, 0], [1, 1, 1, 1])\", \"assert generate_masks([255, 128, 64, 32], 128) == ([1, 0, 0, 0], [0, 1, 0, 0])\", \"assert generate_masks(... | {
"split": "train",
"index": 5543,
"acecode_id": "oss_9339",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function to process image recognition based on detection type and monitoring mode. Implement a function `process_image_and_recognize(detect_type: str, monitoring_mode: bool) -> str` that takes in two parameters: a string `detect_type` which specif... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_image_and_recognize('cat', False) == '\\u8fd9\\u4e2a\\u5e94\\u8be5\\u662fcat'\", \"assert process_image_and_recognize('dog', False) == '\\u8fd9\\u4e2a\\u5e94\\u8be5\\u662fdog'\", \"assert process_image_and_recognize('', False) == '\\u6ca1\\u6709\\u8b... | {
"split": "train",
"index": 5544,
"acecode_id": "oss_1420",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `reverse_values(string: str, integer: int, lst: List[int]) -> Tuple[str, str, List[int]]` that accepts a string, an integer, and a list of integers. The function should return a tuple containing three elements: the reversed string, the reversed integer as a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_values('hello', 123, [1, 2, 3, 4, 5]) == ('olleh', '321', [5, 4, 3, 2, 1])\", \"assert reverse_values('test', 4567, [7, 8, 9]) == ('tset', '7654', [9, 8, 7])\", \"assert reverse_values('radar', 101, [5, 4, 3]) == ('radar', '101', [3, 4, 5])\", \"asse... | {
"split": "train",
"index": 5545,
"acecode_id": "evol_30575",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of recipe names represented as strings. Your task is to implement a function that checks if a specified recipe exists in the list. If the recipe exists, return True; otherwise, return False. Write a function `recipe_exists(recipes: List[str], recipe_name: s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert recipe_exists(['pasta', 'salad', 'soup'], 'salad') == True\", \"assert recipe_exists(['pasta', 'salad', 'soup'], 'pizza') == False\", \"assert recipe_exists(['cake', 'cookie', 'brownie'], 'cake') == True\", \"assert recipe_exists(['cake', 'cookie', 'brownie'... | {
"split": "train",
"index": 5546,
"acecode_id": "bigcode_python_fns_35221",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of space names and you need to check if each space exists in a predefined list of valid spaces. If a space exists, return '204 No Content'. If it does not exist, return '404 Not Found'. Implement a function named `check_space_existence(spaces: List[str]) ->... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_space_existence(['space1', 'space2']) == ['204 No Content', '204 No Content']\", \"assert check_space_existence(['space3', 'space4']) == ['204 No Content', '204 No Content']\", \"assert check_space_existence(['space5', 'space1']) == ['204 No Content', ... | {
"split": "train",
"index": 5547,
"acecode_id": "bigcode_python_fns_31377",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "A bug is located on the x-axis at position 0 and needs to reach its home positioned at `x`. The bug can jump forward exactly `a` positions or backward `b` positions. However, it cannot jump backward consecutively and must avoid certain `forbidden` positions. The bug can jump fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert minimumJumps([14,4,18,1,15], 3, 15, 9) == 3\", \"assert minimumJumps([8,3,16,6,12,20], 15, 13, 11) == -1\", \"assert minimumJumps([1,6,2,14,5,17,4], 16, 9, 7) == 2\", \"assert minimumJumps([6, 7, 8], 5, 1, 10) == 2\", \"assert minimumJumps([9, 10, 11], 4, 2,... | {
"split": "train",
"index": 5548,
"acecode_id": "evol_22367",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given two 3-dimensional tensors `s` and `t`, where the first dimension represents the batch size, the second dimension represents the rows, and the third dimension represents the columns, implement a function `batched_matrix_multiplication(s: List[List[List[int]]], t: List[List... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert batched_matrix_multiplication([[[1, 0], [0, 1]]], [[[5, 2], [3, 4]]]) == [[[5, 2], [3, 4]]]\", \"assert batched_matrix_multiplication([[[1, 2]]], [[[3], [4]]]) == [[[11]]]\", \"assert batched_matrix_multiplication([[[1, 1], [1, 1]]], [[[1, 1], [1, 1]]]) == [... | {
"split": "train",
"index": 5549,
"acecode_id": "bigcode_python_fns_40592",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary where the keys are strings and the values can either be strings or nested dictionaries, implement a function `transform_dict_keys(dt: dict, callback_fn: Callable[[str], str]) -> dict` that applies a given callback function `callback_fn` to all keys of the dic... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_dict_keys({'a': 'apple', 'b': 'banana'}, lambda x: x.upper()) == {'A': 'apple', 'B': 'banana'}\", \"assert transform_dict_keys({'a': {'b': 'banana', 'c': 'cherry'}}, lambda x: x + '_key') == {'a_key': {'b_key': 'banana', 'c_key': 'cherry'}}\", \"as... | {
"split": "train",
"index": 5550,
"acecode_id": "bigcode_python_fns_30442",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes three integers as input and returns the product of their cubes. The function should compute the cube of each integer individually and then multiply these cubed values together.\nPlease reason step by step, then write a self-contained Python solut... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cubic_product(1, 2, 3) == 216\", \"assert cubic_product(0, 5, 10) == 0\", \"assert cubic_product(-1, -2, -3) == -216\", \"assert cubic_product(-1, 1, 1) == -1\", \"assert cubic_product(10, 0, 5) == 0\", \"assert cubic_product(1, -1, 1) == -1\", \"assert cubi... | {
"split": "train",
"index": 5551,
"acecode_id": "evol_25978",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating unique sums of a given number of terms, where each term is a constant value between 1 and a specified maximum value. Write a function `generate_unique_sums(n: int, min_terms: int, max_terms: int, max_constant: int) -> List[int]` that returns a lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_unique_sums(5, 1, 3, 2) == [1, 2, 3, 4, 5]\", \"assert generate_unique_sums(0, 1, 2, 10) == []\", \"assert generate_unique_sums(2, 1, 1, 5) == [1, 2]\", \"assert generate_unique_sums(6, 1, 2, 4) == [1, 2, 3, 4, 5, 6]\", \"assert generate_unique_sums... | {
"split": "train",
"index": 5552,
"acecode_id": "bigcode_python_fns_47630",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are working on a Python project that involves managing dependencies for a package. The `install_requires` list in the `setup.py` file contains the required dependencies for the package. Write a function `format_dependencies` that takes a list of dependencies as input and re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_dependencies(['numpy', 'pandas', 'matplotlib']) == '\\u2022 numpy\\\\n\\u2022 pandas\\\\n\\u2022 matplotlib'\", \"assert format_dependencies(['requests', 'flask']) == '\\u2022 requests\\\\n\\u2022 flask'\", \"assert format_dependencies(['scikit-learn'... | {
"split": "train",
"index": 5553,
"acecode_id": "oss_30650",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You have to implement a function `create_zero_matrix(shape: Tuple[int, int]) -> List[List[float]]` that creates and returns a new matrix (2D list) with the given shape, filled with zeros. The `shape` parameter is a tuple of two integers representing the number of rows and colum... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_zero_matrix((0, 0)) == []\", \"assert create_zero_matrix((1, 1)) == [[0.0]]\", \"assert create_zero_matrix((2, 2)) == [[0.0, 0.0], [0.0, 0.0]]\", \"assert create_zero_matrix((3, 3)) == [[0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]]\", \"assert cr... | {
"split": "train",
"index": 5554,
"acecode_id": "bigcode_python_fns_17412",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a positive integer n, implement a function `greatest_prime_factor_sum(n: int) -> int` that calculates the sum of the greatest prime factors of all integers from 2 to n, and returns the result modulo $10^9$. For example, `greatest_prime_factor_sum(10)` should return 32, as... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert greatest_prime_factor_sum(10) == 32\", \"assert greatest_prime_factor_sum(100) == 1915\", \"assert greatest_prime_factor_sum(10000) == 10118280\", \"assert greatest_prime_factor_sum(1) == 0\", \"assert greatest_prime_factor_sum(2) == 2\", \"assert greatest_p... | {
"split": "train",
"index": 5555,
"acecode_id": "evol_5791",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a list of raw input tensors, where each tensor is a list of 50 floating-point numbers. Your task is to write a function `preprocess_and_validate(input_tensors)` that takes this list and returns a validation dictionary. The dictionary should use the index of each i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert preprocess_and_validate([[1.0]*50, [2.0]*50]) == {0: {'label': 1, 'input': [0.5]*50}, 1: {'label': 1, 'input': [1.0]*50}}\", \"assert preprocess_and_validate([[0.0]*50, [0.5]*50]) == {0: {'label': 1, 'input': [0.0]*50}, 1: {'label': 1, 'input': [0.25]*50}}\"... | {
"split": "train",
"index": 5556,
"acecode_id": "oss_9631",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an iterable collection of integers and a predicate function, implement a function `any_true(iterable: List[int], pred: Callable[[int], bool]) -> bool` that returns `True` if any element in the collection satisfies the predicate function, and `False` otherwise. The predica... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert any_true([1, 2, 3, 4], lambda x: x > 3) == True\", \"assert any_true([1, 2, 3, 4], lambda x: x < 0) == False\", \"assert any_true([0, 0, 0], lambda x: x == 0) == True\", \"assert any_true([-1, -2, -3], lambda x: x > -2) == True\", \"assert any_true([5, 6, 7]... | {
"split": "train",
"index": 5557,
"acecode_id": "bigcode_python_fns_11905",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to implement a function called `calculate_average` that takes a list of integers as input and returns the average value of the integers in that list. If the list is empty, the function should return 0.0. The average is calculated a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average([1, 2, 3, 4, 5]) == 3.0\", \"assert calculate_average([-1, -2, -3]) == -2.0\", \"assert calculate_average([10, 20, 30]) == 20.0\", \"assert calculate_average([0]) == 0.0\", \"assert calculate_average([]) == 0.0\", \"assert calculate_average... | {
"split": "train",
"index": 5558,
"acecode_id": "oss_34011",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `make_tree_item` that constructs a tree item with specific attributes. The function should take the following parameters: \n1. `parent` (str): The parent node's identifier. \n2. `text` (str): The display text for the tree item. \n3. `icon... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert make_tree_item('parent1', 'Child 1', 'icon1') == {'parent': 'parent1', 'text': 'Child 1', 'icon': 'icon1', 'first_col_text': None, 'second_col_text': None}\", \"assert make_tree_item('parent2', 'Child 2', 'icon2', 'hidden1') == {'parent': 'parent2', 'text': ... | {
"split": "train",
"index": 5559,
"acecode_id": "bigcode_python_fns_13262",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of overpasses on a highway, represented as a list of tuples. Each tuple contains two integers, where the first integer is the start point and the second integer is the end point of an overpass. Your task is to determine the maximum number of non-overlapping... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_non_overlapping_overpasses([(1, 3), (2, 4), (5, 7), (6, 8)]) == 2\", \"assert max_non_overlapping_overpasses([(1, 2), (3, 4), (5, 6)]) == 3\", \"assert max_non_overlapping_overpasses([(1, 5), (2, 3), (4, 6)]) == 2\", \"assert max_non_overlapping_overpass... | {
"split": "train",
"index": 5560,
"acecode_id": "oss_32230",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of integers and returns a new list containing only the unique integers from the input list, in the order they first appeared. Implement the function `unique_numbers(nums: List[int]) -> List[int]:` where `nums` is a list ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_numbers([1, 2, 2, 3]) == [1, 2, 3]\", \"assert unique_numbers([4, 5, 4, 6, 5]) == [4, 5, 6]\", \"assert unique_numbers([1, 1, 1, 1]) == [1]\", \"assert unique_numbers([]) == []\", \"assert unique_numbers([7, 8, 9, 7, 8]) == [7, 8, 9]\", \"assert uniqu... | {
"split": "train",
"index": 5561,
"acecode_id": "bigcode_python_fns_988",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers, and you need to implement a function that removes all occurrences of a specified integer from the list. The function should return a new list containing the remaining integers in the same order they appeared in the original list. Write a functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_occurrences([1, 2, 3, 4, 5], 3) == [1, 2, 4, 5]\", \"assert remove_occurrences([1, 2, 2, 3, 4, 2], 2) == [1, 3, 4]\", \"assert remove_occurrences([5, 5, 5], 5) == []\", \"assert remove_occurrences([], 1) == []\", \"assert remove_occurrences([0, 1, 0, ... | {
"split": "train",
"index": 5562,
"acecode_id": "bigcode_python_fns_27363",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function to handle messages based on their topics and payloads. Implement the function `handleMessage(topic: str, payload: str) -> str` that takes in two parameters: a string `topic` and a string `payload`. The function should return a specific me... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert handleMessage('sensor/temperature', '35') == 'Warning: High temperature!'\", \"assert handleMessage('sensor/temperature', '30') == 'Message received: sensor/temperature with payload: 30'\", \"assert handleMessage('sensor/temperature', '29') == 'Message recei... | {
"split": "train",
"index": 5563,
"acecode_id": "oss_35114",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string `s` and three integers `x`, `y`, and `z`. You can perform three types of operations any number of times: Remove substring 'ab' and gain `x` points, remove substring 'ba' and gain `y` points, and remove substring 'abc' and gain `z` points. Return the maxim... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert maximumGain('abababab', 5, 2, 1) == 20\", \"assert maximumGain('cccccc', 1, 10, 5) == 0\", \"assert maximumGain('aabbaa', 2, 5, 3) == 10\", \"assert maximumGain('aaaaaa', 10, 20, 30) == 0\", \"assert maximumGain('cccaaa', 5, 5, 5) == 0\", \"assert maximumGai... | {
"split": "train",
"index": 5564,
"acecode_id": "evol_14999",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a variable `resp`, write a function `check_truthiness(resp)` that determines whether the variable is truthy or falsy without using the `if resp:` statement or any built-in truthiness checks directly. The function should return `True` if `resp` is truthy and `False` if `re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_truthiness(None) == False\", \"assert check_truthiness(False) == False\", \"assert check_truthiness(0) == False\", \"assert check_truthiness(0.0) == False\", \"assert check_truthiness(0j) == False\", \"assert check_truthiness('') == False\", \"assert c... | {
"split": "train",
"index": 5565,
"acecode_id": "oss_30829",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple user management system for a web application. Your goal is to create a function called `manage_users` that accepts a list of user operations and returns the results of those operations. The operations will be represented as tuples: eith... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_users([('get', 'user1@example.com')]) == [None]\", \"assert manage_users([('get', 'user1@example.com'), ('get', 'user2@example.com')]) == [None, None]\", \"assert manage_users([('get', 'user1@example.com'), ('get', 'user1@example.com')]) == [None, Non... | {
"split": "train",
"index": 5566,
"acecode_id": "oss_34549",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the process of managing DNS TXT records for a specified domain. The function should take two parameters: a string 'domain' representing the domain name (e.g., 'example.com') and a string 'token' representing a unique token ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_dns_management('example.com', 'unique-token') == ['create', 'verify', 'delete']\", \"assert simulate_dns_management('invalid-domain', 'unique-token') == ['No actions taken']\", \"assert simulate_dns_management('test.com', 'token-123') == ['create', ... | {
"split": "train",
"index": 5567,
"acecode_id": "bigcode_python_fns_44864",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, where each string represents the content of a file. Your task is to implement a function that returns a list of integers representing the sizes of each file in bytes. The size of a file is defined as the number of characters in its string repres... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_file_sizes(['Hello', 'World']) == [5, 5]\", \"assert get_file_sizes(['']) == [0]\", \"assert get_file_sizes(['Single line', 'Second line', 'Third']) == [11, 11, 5]\", \"assert get_file_sizes(['A' * 10000]) == [10000]\", \"assert get_file_sizes(['Python',... | {
"split": "train",
"index": 5568,
"acecode_id": "bigcode_python_fns_42014",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a list of resources, where each resource is represented by a dictionary with two keys: 'name' (a string) and 'is_awesome' (a boolean). Your task is to implement a function called `filter_awesome_resources(resources: List[Dict[str, Union[str, bool]]]) -> List[str]`... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_awesome_resources([{'name': 'Resource1', 'is_awesome': True}, {'name': 'Resource2', 'is_awesome': False}, {'name': 'Resource3', 'is_awesome': True}]) == ['Resource1', 'Resource3']\", \"assert filter_awesome_resources([{'name': 'ResourceA', 'is_awesome... | {
"split": "train",
"index": 5569,
"acecode_id": "bigcode_python_fns_14426",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `count_distinct_chars(s: str) -> int` that takes a string as input and returns the count of distinct characters present in the string. Characters are case-sensitive, and spaces should also be counted as distinct characters. For example, in the string 'hello... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_distinct_chars('hello world') == 8\", \"assert count_distinct_chars('') == 0\", \"assert count_distinct_chars('a') == 1\", \"assert count_distinct_chars('abc') == 3\", \"assert count_distinct_chars('aabbcc') == 3\", \"assert count_distinct_chars('abcAB... | {
"split": "train",
"index": 5570,
"acecode_id": "evol_23050",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple file system. The file system allows you to create files and directories, navigate through the file system, and find files by name. Implement a function `file_system_operations(operations: List[Tuple[str, str]]) -> List[str]` that accept... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert file_system_operations([('create_directory', 'dir1'), ('create_file', 'file1.txt', 'Hello World'), ('change_directory', 'dir1'), ('create_file', 'file2.txt', 'Test Content'), ('change_directory', '..'), ('find_file', 'file1.txt')]) == ['file1.txt']\", \"asse... | {
"split": "train",
"index": 5571,
"acecode_id": "oss_11808",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a function `fetch_one_row(query: str) -> dict` that simulates the fetching of a single row from a database based on the given SQL query. The function should take a string `query` as input, which represents the SQL query to be executed. The function should return a dic... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fetch_one_row('SELECT * FROM users WHERE id = 1') == {'id': 1, 'name': 'Alice', 'age': 30}\", \"assert fetch_one_row('SELECT * FROM users WHERE id = 2') == {'id': 2, 'name': 'Bob', 'age': 25}\", \"assert fetch_one_row('SELECT * FROM users WHERE id = 3') == {... | {
"split": "train",
"index": 5572,
"acecode_id": "bigcode_python_fns_30976",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with validating a search input for a custom search functionality. Implement a function `is_search_valid(query: str, index: str) -> bool` that checks whether both the search query and the search index are non-empty strings. The function should return `True` if bot... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_search_valid('example_query', 'example_index') == True\", \"assert is_search_valid('', 'example_index') == False\", \"assert is_search_valid('example_query', '') == False\", \"assert is_search_valid('', '') == False\", \"assert is_search_valid('search', '... | {
"split": "train",
"index": 5573,
"acecode_id": "oss_23217",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Write a function that determines whether a given matrix is symmetric or not. A symmetric matrix is defined as a square matrix that is equal to its transpose. The function should handle matrices of any size, including those with negative numbers and zero. If the matrix is not sq... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_symmetric([[1, 2, 3], [2, 4, 5], [3, 5, 6]]) == True\", \"assert is_symmetric([[1, 0, 0], [0, 1, 0], [0, 0, 1]]) == True\", \"assert is_symmetric([[1, 2], [2, 1]]) == True\", \"assert is_symmetric([[1, 2], [3, 4]]) == False\", \"assert is_symmetric([[5]])... | {
"split": "train",
"index": 5574,
"acecode_id": "evol_29408",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D grid representing a labyrinth, where 0s represent open paths and 1s represent walls. A robot starts at a given position in the labyrinth and needs to find the shortest path to a designated station. Implement the function `find_directions(labyrinth: List[List[... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_directions([[0, 0, 0], [0, 1, 0], [0, 0, 0]], (0, 0), (2, 2)) == 'rrdd'\", \"assert find_directions([[0, 0, 0], [1, 1, 0], [0, 0, 0]], (0, 0), (2, 2)) == 'rrdd'\", \"assert find_directions([[0, 1], [0, 0]], (0, 0), (1, 1)) == 'dr'\", \"assert find_direc... | {
"split": "train",
"index": 5575,
"acecode_id": "evol_8012",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function `pairwise_modulo(tuples1, tuples2)` that takes in two lists of tuples, `tuples1` and `tuples2`. Each tuple contains integers. The function should return a new list of tuples where each tuple contains the results of the modulo operation between the correspon... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pairwise_modulo([(1, 2), (3, 4)], [(1, 1), (2, 2)]) == [(0, 0), (1, 0)]\", \"assert pairwise_modulo([(5, 10)], [(2, 5)]) == [(1, 0)]\", \"assert pairwise_modulo([(10, 20)], [(3, 7)]) == [(1, 6)]\", \"assert pairwise_modulo([(1, 2), (3, 4)], [(4, 5), (6, 7)])... | {
"split": "train",
"index": 5576,
"acecode_id": "evol_4093",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that determines if a cave can be visited based on its type. Caves can be either 'big' or 'small'. A 'big' cave can be visited multiple times, while a 'small' cave can only be visited once. Your function should take two inputs: a string `c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_visit('big', set()) == True\", \"assert can_visit('big', {'big'}) == True\", \"assert can_visit('small', set()) == True\", \"assert can_visit('small', {'small'}) == False\", \"assert can_visit('small', {'big'}) == True\", \"assert can_visit('small', {'sm... | {
"split": "train",
"index": 5577,
"acecode_id": "bigcode_python_fns_16104",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that accepts a dictionary and returns a tuple containing all the keys stored within the given dictionary.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block."
}
] | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_keys({'Country': 'USA', 'Capital': 'Washington D.C.', 'Currency': 'USD'}) == ('Country', 'Capital', 'Currency')\", \"assert get_keys({'Name': 'Alice', 'Age': 30, 'City': 'New York'}) == ('Name', 'Age', 'City')\", \"assert get_keys({'A': 1, 'B': 2, 'C': 3... | {
"split": "train",
"index": 5578,
"acecode_id": "evol_11169",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the display of different user interface layouts based on the selected tab. The function should accept a string parameter `tab`, which can either be 'tab-1' or 'tab-2'. If the parameter is 'tab-2', the function should return... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert render_content('tab-1') == 'CHOICE_BASED_RECOMMENDATION_LAYOUT'\", \"assert render_content('tab-2') == 'TAB2_LAYOUT'\", \"assert render_content('tab-1') == 'CHOICE_BASED_RECOMMENDATION_LAYOUT'\", \"assert render_content('tab-2') == 'TAB2_LAYOUT'\", \"assert ... | {
"split": "train",
"index": 5579,
"acecode_id": "bigcode_python_fns_10376",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that counts the frequency of each word in a given string while excluding specific stop words. The function should take two parameters: a string 'text' which contains the content to analyze, and a list of strings 'stop_words' that contains... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert word_frequency('Hello world! Hello everyone.', ['the', 'and', 'of', 'to']) == {'hello': 2, 'world': 1, 'everyone': 1}\", \"assert word_frequency('Python is great. Python is fun!', ['is', 'the', 'and']) == {'python': 2, 'great': 1, 'fun': 1}\", \"assert word_... | {
"split": "train",
"index": 5580,
"acecode_id": "oss_12880",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates handling a basic HTTP GET request. The function should take a string input representing an HTTP GET request and return a string response based on the requested file. If the requested file exists, return the content of the f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert handle_request('GET /index.html HTTP/1.1') == 'HTTP/1.1 200 OK\\\\r\\\\n\\\\r\\\\n<!DOCTYPE html><html><body><h1>Hello, World!</h1></body></html>'\", \"assert handle_request('GET /about.html HTTP/1.1') == 'HTTP/1.1 200 OK\\\\r\\\\n\\\\r\\\\n<!DOCTYPE html><h... | {
"split": "train",
"index": 5581,
"acecode_id": "oss_15598",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given an integer x and a number of bits n, write a function that converts the integer x into its binary representation as a list of bits. The output list should be of length n, with the least significant bit (LSB) at the beginning of the list. If the binary representation of th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert int_to_bits(5, 4) == [1, 0, 1, 0]\", \"assert int_to_bits(2, 3) == [0, 1, 0]\", \"assert int_to_bits(15, 4) == [1, 1, 1, 1]\", \"assert int_to_bits(0, 5) == [0, 0, 0, 0, 0]\", \"assert int_to_bits(10, 5) == [0, 1, 0, 1, 0]\", \"assert int_to_bits(31, 5) == [... | {
"split": "train",
"index": 5582,
"acecode_id": "bigcode_python_fns_29581",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `max_bitwise` that takes two integers `x` and `y` as parameters and returns the larger of the two using only bitwise operators and no conditional statements. You must not use any arithmetic operations (like +, -, *, /) or conditional statements (like... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_bitwise(10, 10) == 10\", \"assert max_bitwise(-3, -5) == -3\", \"assert max_bitwise(7, 3) == 7\", \"assert max_bitwise(-1, 1) == 1\", \"assert max_bitwise(100, 50) == 100\", \"assert max_bitwise(15, 0) == 15\", \"assert max_bitwise(0, 0) == 0\", \"assert... | {
"split": "train",
"index": 5583,
"acecode_id": "evol_27005",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, create a binary tree where each integer in the array represents a node in the tree. The binary tree should be constructed such that the first element of the array is the root, and each subsequent element is added as a left or right child based on the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_binary_tree([7, 4, 5, 2, 9, 8, 6, 1]).value == 7\", \"assert create_binary_tree([7, 4, 5, 2, 9, 8, 6, 1]).left.value == 4\", \"assert create_binary_tree([7, 4, 5, 2, 9, 8, 6, 1]).left.left.value == 2\", \"assert create_binary_tree([7, 4, 5, 2, 9, 8, 6... | {
"split": "train",
"index": 5584,
"acecode_id": "evol_26394",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string, implement a function `word_frequency(s)` that returns a dictionary containing the frequency of each word in the string. The function should be case insensitive, meaning that 'Word' and 'word' should be treated as the same word. Words are defined as sequences of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert word_frequency('this string should contain 4 occurrences of the word should') == {'this': 1, 'string': 1, 'should': 2, 'contain': 1, '4': 1, 'occurrences': 1, 'of': 1, 'the': 1, 'word': 1}\", \"assert word_frequency('Hello world') == {'hello': 1, 'world': 1}... | {
"split": "train",
"index": 5585,
"acecode_id": "evol_35570",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a record representing electric vehicle (EV) charging information. Your task is to implement a function that processes this record and returns a list containing specific values from the record along with additional calculated data. The record is a dictionary that m... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_charging_record({'label': 'EV2', 'utility': 'UtilityB', 'name': 'Charger2', 'uri': 'http://example2.com'}, 300.0, 1500.0, False) == [b'EV2', b'UtilityB', None, b'Charger2', None, None, None, b'http://example2.com', None, 300.0, 1500.0, b'no']\", \"as... | {
"split": "train",
"index": 5586,
"acecode_id": "bigcode_python_fns_12644",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple game where a player moves around a grid and receives gifts at certain locations. The player's movement is controlled by a method that takes a single argument `direction`, indicating the direction of movement. The player's position is re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert give_gift(3, 4) == 'Health Pack'\", \"assert give_gift(1, 2) == 'Ammo'\", \"assert give_gift(0, 0) == 'Gold Coin'\", \"assert give_gift(2, 3) == None\", \"assert give_gift(4, 4) == None\", \"assert give_gift(1, 1) == None\", \"assert give_gift(3, 5) == None\... | {
"split": "train",
"index": 5587,
"acecode_id": "oss_22190",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Define a function G(n, d) that calculates the number of divisors of n whose first digits equal d. For a positive integer n and a digit sequence d, return the count of such divisors. The function should take two parameters: n (a positive integer) and d (a sequence of digits). Th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert G(30, 3) == 2\", \"assert G(36, 3) == 2\", \"assert G(200, 2) == 4\", \"assert G(10000, 100) == 3\", \"assert G(12, 2) == 1\"]}"
} | {
"split": "train",
"index": 5588,
"acecode_id": "evol_25020",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `create_label_id` that generates a unique label ID for a project based on the provided project ID, label name, and a list of associated template IDs. If no template IDs are provided, the function should assume that the first default templ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_label_id(1, 'Urgent', [2, 3]) == 'Label-1-Urgent-2'\", \"assert create_label_id(2, 'Important', []) == 'Label-2-Important-1'\", \"assert create_label_id(3, 'ToDo', [5]) == 'Label-3-ToDo-5'\", \"assert create_label_id(4, 'InProgress', [10, 11]) == 'Lab... | {
"split": "train",
"index": 5589,
"acecode_id": "bigcode_python_fns_23656",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the job IDs. Your task is to implement a function called `get_job_details` that takes this list as input and returns a list of dictionaries. Each dictionary should contain the job ID and its corresponding details, which include 'opt... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_job_details([1]) == [{'id': 1, 'options': 1, 'suggestions': 1}]\", \"assert get_job_details([2]) == [{'id': 2, 'options': 4, 'suggestions': 8}]\", \"assert get_job_details([3]) == [{'id': 3, 'options': 9, 'suggestions': 27}]\", \"assert get_job_details([... | {
"split": "train",
"index": 5590,
"acecode_id": "oss_34145",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two integers, `a` and `b`, implement a function `is_greater_or_equal(a: int, b: int) -> bool` that returns `True` if `a` is greater than or equal to `b`, and `False` otherwise. Your function should take two integers as input and provide a boolean output indicating the res... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_greater_or_equal(5, 3) == True\", \"assert is_greater_or_equal(2, 2) == True\", \"assert is_greater_or_equal(1, 4) == False\", \"assert is_greater_or_equal(-1, -5) == True\", \"assert is_greater_or_equal(0, 0) == True\", \"assert is_greater_or_equal(10, 1... | {
"split": "train",
"index": 5591,
"acecode_id": "bigcode_python_fns_15921",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simplified online shopping cart checkout process. Your function should take a list of items, where each item is represented as a dictionary containing the 'product' name, 'price', and 'quantity'. Your task is to calcu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert checkout_summary([{'product': 'apple', 'price': 1.0, 'quantity': 3}, {'product': 'banana', 'price': 0.5, 'quantity': 2}]) == {'items': [{'product': 'apple', 'price': 1.0, 'quantity': 3}, {'product': 'banana', 'price': 0.5, 'quantity': 2}], 'total_cost': 4.0}... | {
"split": "train",
"index": 5592,
"acecode_id": "oss_32110",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a basic dependency resolution process. Given a list of dependencies, where each dependency is represented as a tuple containing a task and its prerequisite, you need to determine a valid order of execution for the tasks. Each task can only be exec... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert resolve_dependencies([('A', 'B'), ('B', 'C'), ('C', 'A')]) == []\", \"assert resolve_dependencies([('A', 'B'), ('B', 'C')]) == ['C', 'B', 'A']\", \"assert resolve_dependencies([('A', 'B'), ('B', 'C'), ('C', 'D')]) == ['D', 'C', 'B', 'A']\", \"assert resolve_... | {
"split": "train",
"index": 5593,
"acecode_id": "oss_31755",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a positive integer n, write a function `create_locators(n)` that generates a list of locator names based on the number specified by the user. The locator names should follow the format 'ArmLocatorX' for the first n locators, where X is the index (starting from 1) of the l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_locators(1) == ['ArmLocator1', 'BucketLocator']\", \"assert create_locators(2) == ['ArmLocator1', 'ArmLocator2', 'BucketLocator']\", \"assert create_locators(3) == ['ArmLocator1', 'ArmLocator2', 'ArmLocator3', 'BucketLocator']\", \"assert create_locat... | {
"split": "train",
"index": 5594,
"acecode_id": "bigcode_python_fns_34684",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of integers and returns a new list containing only the even numbers from the original list. The output list should preserve the order of the even numbers as they appeared in the input list. Write a function called `filte... | 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, 30]) == [10, 20, 30]\", \"assert filter_even_numbers([1, 3, 5]) == []\", \"assert filter_even_numbers([2, 4, 6, 8]) == [2, 4, 6, 8]\", \"assert filter_even_number... | {
"split": "train",
"index": 5595,
"acecode_id": "oss_11931",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the values in a virtual table (vtable) for a class. Each integer represents the address of a method in the class. Your task is to implement a function that takes a method name as a string and a list of integers representing the addr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_method_address('method1', [1000, 2000, 3000]) == 1000\", \"assert get_method_address('method2', [1000, 2000, 3000]) == 2000\", \"assert get_method_address('method3', [1000, 2000, 3000]) == 3000\", \"assert get_method_address('method4', [1000, 2000, 3000]... | {
"split": "train",
"index": 5596,
"acecode_id": "bigcode_python_fns_47291",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a JSON object representing the output of a detection API, write a function that adds a field called 'classification_categories' to this JSON object. The 'classification_categories' field should be a dictionary that maps indices (starting from 0) to class names provided in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_classification_categories({}, ['cat', 'dog', 'fish']) == {'classification_categories': {'0': 'cat', '1': 'dog', '2': 'fish'}}\", \"assert add_classification_categories({'classification_categories': {}}, ['car', 'bike']) == {'classification_categories': {... | {
"split": "train",
"index": 5597,
"acecode_id": "bigcode_python_fns_23076",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_full_palindrome(s: str) -> bool` that checks whether a given input string is a full palindrome. A string is considered a full palindrome if the entire string (ignoring case, punctuation, and whitespace) is a palindrome, and each individual word in the s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_full_palindrome('Hello world') == False\", \"assert is_full_palindrome('Not a palindrome') == False\", \"assert is_full_palindrome('Racecar') == True\", \"assert is_full_palindrome('') == True\", \"assert is_full_palindrome('12321') == True\", \"assert is... | {
"split": "train",
"index": 5598,
"acecode_id": "evol_35211",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing operations for a virtual container system. You need to implement a function `manage_container(spawn_container: bool) -> Optional[str]` that behaves as follows: If `spawn_container` is `True`, the function should return the string 'Container spawned'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_container(True) == 'Container spawned'\", \"assert manage_container(False) == None\", \"assert manage_container(True) == 'Container spawned'\", \"assert manage_container(False) == None\", \"assert manage_container(True) == 'Container spawned'\", \"ass... | {
"split": "train",
"index": 5599,
"acecode_id": "oss_24724",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.