data_source
large_stringclasses
1 value
prompt
listlengths
1
1
ability
large_stringclasses
1 value
reward_model
dict
extra_info
dict
acecode
[ { "role": "user", "content": "You are given a list of regions, each represented as a tuple containing the region name and its corresponding distance to a theoretical value. Your task is to write a function `calculate_average_distance(regions: List[Tuple[str, float]]) -> float` that calculates the average di...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average_distance([('Region A', 10.0), ('Region B', 20.0)]) == 15.0\", \"assert calculate_average_distance([('Region C', 5.5), ('Region D', 4.5), ('Region E', 6.0)]) == 5.33\", \"assert calculate_average_distance([('Region F', 0.0), ('Region G', 10....
{ "split": "train", "index": 1900, "acecode_id": "bigcode_python_fns_20537", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two integers k and n, return all unique combinations of k numbers that sum up to n using numbers from 1 to 9. Each number can be used at most once. Additionally, the sum of the digits in each combination must be a prime number. The result should be a list of all valid com...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert combinationSum3(4, 1) == []\", \"assert combinationSum3(3, 2) == []\", \"assert combinationSum3(9, 45) == []\", \"assert combinationSum3(2, 3) == [[1,2]]\", \"assert combinationSum3(2, 11) == [[2,9],[3,8],[4,7],[5,6]]\", \"assert combinationSum3(2, 12) == []...
{ "split": "train", "index": 1901, "acecode_id": "evol_27148", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are given a properly formatted JSON string that represents a collection of information about a person. Your task is to implement a function that takes this JSON string as input and prints all keys and their corresponding values, including those in nested objects and lists. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert print_json_info('{\\\"name\\\": \\\"Alice\\\", \\\"age\\\": 30, \\\"nested_obj\\\": {\\\"key1\\\":\\\"value1\\\"}, \\\"json_list\\\":[\\\"item1\\\", {\\\"list_key\\\":\\\"list_value\\\"}]}') is None\", \"assert print_json_info('{\\\"name\\\": \\\"Bob\\\", \\...
{ "split": "train", "index": 1902, "acecode_id": "evol_32814", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that constructs a `Corpus` object from a given dictionary. The `Corpus` class has the following attributes: `name`, a string representing the name of the corpus, and `description`, a string representing the description of the corpus. Impl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert Corpus.from_dict({'name': 'Corpus A', 'description': 'Description A'}).name == 'Corpus A'\", \"assert Corpus.from_dict({'name': 'Corpus B', 'description': 'Description B'}).description == 'Description B'\", \"assert Corpus.from_dict({'name': 'Test Corpus', '...
{ "split": "train", "index": 1903, "acecode_id": "oss_4281", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that can encode a given string using a specified character encoding. Your function should take two inputs: a string `data` containing the data to be encoded and a string `encoding` specifying the character encoding to be used. The ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert encode_data('Hello, World!', 'utf-8') == b'Hello, World!'\", \"assert encode_data('Python Programming', 'utf-8') == b'Python Programming'\", \"assert encode_data('LeetCode Challenges', 'ascii') == b'LeetCode Challenges'\", \"assert encode_data('\\u4f60\\u597...
{ "split": "train", "index": 1904, "acecode_id": "oss_5803", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that formats a message for display in a user interface. The function should take a string input and return a formatted string that includes the message surrounded by square brackets. Additionally, if the message contains the word 'err...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_message('Hello, World!') == '[Hello, World!]'\", \"assert format_message('This is an error message') == '[Alert: THIS IS AN ERROR MESSAGE]'\", \"assert format_message('All systems operational') == '[All systems operational]'\", \"assert format_message...
{ "split": "train", "index": 1905, "acecode_id": "bigcode_python_fns_1374", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that generates the Fibonacci sequence up to the nth position using an iterative approach. The function should return a list containing the Fibonacci numbers from the 0th to the (n-1)th position. If n is less than or equal to 0, the function should return an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci(0) == []\", \"assert fibonacci(1) == [0]\", \"assert fibonacci(2) == [0, 1]\", \"assert fibonacci(3) == [0, 1, 1]\", \"assert fibonacci(4) == [0, 1, 1, 2]\", \"assert fibonacci(5) == [0, 1, 1, 2, 3]\", \"assert fibonacci(6) == [0, 1, 1, 2, 3, 5]\",...
{ "split": "train", "index": 1906, "acecode_id": "evol_22149", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `configure_camera(up: Tuple[int, int, int], fovy: int, projection: str) -> Dict[str, Union[Tuple[int, int, int], int, str]]`. This function will take in three parameters: an up vector represented as a tuple of three integers, a field ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert configure_camera((0, 1, 0), 60, 'PERSPECTIVE') == {'up': (0, 1, 0), 'fovy': 60, 'projection': 'PERSPECTIVE'}\", \"assert configure_camera((0, 0, 1), 45, 'ORTHOGRAPHIC') == {'up': (0, 0, 1), 'fovy': 45, 'projection': 'ORTHOGRAPHIC'}\", \"assert configure_came...
{ "split": "train", "index": 1907, "acecode_id": "oss_33370", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simulation system that allows you to place visualization-only spheres in a 3D space. Write a function `add_viz_sphere(radius: float, pos: Tuple[float, float, float]) -> Dict[str, Any]` that takes in a radius and a position as a tuple of three floa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_viz_sphere(1.0, (0.0, 0.0, 0.0)) == {'radius': 1.0, 'position': (0.0, 0.0, 0.0), 'motion_type': 'KINEMATIC', 'collidable': False}\", \"assert add_viz_sphere(2.5, (1.0, 1.0, 1.0)) == {'radius': 2.5, 'position': (1.0, 1.0, 1.0), 'motion_type': 'KINEMATIC',...
{ "split": "train", "index": 1908, "acecode_id": "bigcode_python_fns_37381", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a decorator function `with_error_context(func)` that wraps a given function and handles context errors. The decorator should catch any exceptions raised by the wrapped function and return a string 'Error occurred' instead of propagating the exceptio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert with_error_context(lambda: 1 / 0)() == 'Error occurred'\", \"assert with_error_context(lambda: 'Hello' + ' World!')() == 'Hello World!'\", \"assert with_error_context(lambda: int('abc'))() == 'Error occurred'\", \"assert with_error_context(lambda: len([1, 2,...
{ "split": "train", "index": 1909, "acecode_id": "bigcode_python_fns_45854", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary that represents the privileges of users in a chat application. Each user has a specific privilege level associated with their username and channel. Your task is to implement a function `show_user_privilege(privileges: Dict[str, Dict[str, int]], channe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert show_user_privilege({'general': {'alice': 5, 'bob': 3}, 'random': {'charlie': 2}}, 'general', 'alice') == '5'\", \"assert show_user_privilege({'general': {'alice': 5, 'bob': 3}}, 'general', 'bob') == '3'\", \"assert show_user_privilege({'general': {'alice': ...
{ "split": "train", "index": 1910, "acecode_id": "bigcode_python_fns_33754", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a simple help command system. The function `help_command(command: str) -> str` should take in a command as a string and return a help message based on the command provided. The help messages for specific commands are predef...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert help_command('start') == 'Starts the application.'\", \"assert help_command('stop') == 'Stops the application.'\", \"assert help_command('pause') == 'Pauses the application.'\", \"assert help_command('resume') == 'Resumes the application.'\", \"assert help_c...
{ "split": "train", "index": 1911, "acecode_id": "bigcode_python_fns_34978", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that filters job dictionaries based on specific criteria defined by regular expressions. The job is represented as a dictionary containing attributes such as 'title' and 'location'. Your task is to implement a function named `match_jo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert match_jobs([{'title': 'software developer', 'location': 'New York'}, {'title': 'data analyst', 'location': 'Los Angeles'}], {'title': 'developer|engineer', 'location': 'New York'}) == [{'title': 'software developer', 'location': 'New York'}]\", \"assert matc...
{ "split": "train", "index": 1912, "acecode_id": "oss_27554", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function that checks if a given variable 'k' is present in any of the provided list of tuples. The function should return True if 'k' is found in at least one tuple; otherwise, it should return False.\nPlease reason step by step, then write a self-contained Python s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert scrutinize_tuples([(1, 2, 3), (4, 5, 6)], 7) == False\", \"assert scrutinize_tuples([(1, 2, 3), (4, 5, 6)], 2) == True\", \"assert scrutinize_tuples([], 1) == False\", \"assert scrutinize_tuples([(1, 2), (3, 4)], 1) == True\", \"assert scrutinize_tuples([(7,...
{ "split": "train", "index": 1913, "acecode_id": "evol_15113", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a python function that calculates the area of the largest triangle that can be inscribed in a semicircle with a given radius and center coordinates (h, k). The function should take three parameters: h (x-coordinate of the center), k (y-coordinate of the center), and r (ra...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_triangle_semicircle(1, 1, 3) == (9, [(1-3, 1), (1+3, 1), (1, 1+3)])\", \"assert max_triangle_semicircle(-1, -1, 4) == (16, [(-5, -1), (3, -1), (-1, 3)])\", \"assert max_triangle_semicircle(2, 3, 0) == (None, None)\", \"assert max_triangle_semicircle(2, 3...
{ "split": "train", "index": 1914, "acecode_id": "evol_1373", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of float data type numeric values, implement a function `sort_array_desc` that returns a new array with the values sorted from highest to lowest value. For example, given the input array [7.1, 3.2, 5.5, 9.8, 11.0, 10.7], the output should be [11.0, 10.7, 9.8, 7.1...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_array_desc([7.1, 3.2, 5.5, 9.8, 11.0, 10.7]) == [11.0, 10.7, 9.8, 7.1, 5.5, 3.2]\", \"assert sort_array_desc([1.1, 2.2, 3.3, 4.4]) == [4.4, 3.3, 2.2, 1.1]\", \"assert sort_array_desc([-1.1, -2.2, -3.3, -4.4]) == [-1.1, -2.2, -3.3, -4.4]\", \"assert sort...
{ "split": "train", "index": 1915, "acecode_id": "evol_6304", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of floating-point numbers representing different contour levels in a 2D array. Your task is to write a function that takes this list of contour levels and returns a sorted list of unique contour levels rounded to a specified number of decimal places. The fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_sorted_contour_levels([1.2345, 2.3456, 1.2345], 2) == [1.23, 2.35]\", \"assert unique_sorted_contour_levels([3.0, 3.1, 3.2, 3.0], 1) == [3.0, 3.1, 3.2]\", \"assert unique_sorted_contour_levels([2.0, 2.0, 2.0], 0) == [2]\", \"assert unique_sorted_conto...
{ "split": "train", "index": 1916, "acecode_id": "bigcode_python_fns_26416", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that returns a dictionary containing the counts of odd and even numbers in the list, as well as a list of all prime numbers found in the list. The output dictionary should have the keys 'odd_count', 'even_count', and 'primes'. The func...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_odds_evens_primes([1, 2, 3, 4, 5]) == {'odd_count': 3, 'even_count': 2, 'primes': [2, 3, 5]}\", \"assert count_odds_evens_primes([10, 12, 14, 16, 18]) == {'odd_count': 0, 'even_count': 5, 'primes': []}\", \"assert count_odds_evens_primes([-1, -2, -3, -...
{ "split": "train", "index": 1917, "acecode_id": "evol_19287", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a dictionary representing the inventory of resources in a system, where the keys are resource types and the values are dictionaries containing 'total' and 'reserved' counts. Your task is to implement a function that locks the inventory by reserving all available r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert lock_inventory({'VCPU': {'total': 10, 'reserved': 0}}) == True\", \"assert lock_inventory({'VCPU': {'total': 0, 'reserved': 0}}) == True\", \"assert lock_inventory({'VCPU': {'total': 5, 'reserved': 2}}) == True\", \"assert lock_inventory({'VCPU': {'total': 2...
{ "split": "train", "index": 1918, "acecode_id": "bigcode_python_fns_48058", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of images represented as 2D arrays (lists of lists) containing pixel intensity values. Implement a function `get_image_mask(images: List[List[List[int]]], b_threshold: int = 0) -> List[List[int]]` that returns a mask for the images. The mask should be a bin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_image_mask([], 0) == []\", \"assert get_image_mask([[[0]]], 0) == [[0]]\", \"assert get_image_mask([[[0, 0], [0, 0]]], 0) == [[0, 0], [0, 0]]\", \"assert get_image_mask([[[0, 1], [2, 3]], [[1, 2], [3, 4]]], 0) == [[0, 0], [1, 1]]\", \"assert get_image_ma...
{ "split": "train", "index": 1919, "acecode_id": "bigcode_python_fns_13205", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Given an integer n, generate n random points on the surface of a 2-dimensional sphere (a circle) of radius r. Each point should be represented as a tuple of (x, y) coordinates. The x and y coordinates must be calculated based on the equation of a circle and should be uniformly ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert len(generate_circle_points(100, 1)) == 100\", \"assert len(generate_circle_points(0, 1)) == 0\", \"assert all(-1 <= x <= 1 and -1 <= y <= 1 for x, y in generate_circle_points(10, 1))\", \"assert all(-2 <= x <= 2 and -2 <= y <= 2 for x, y in generate_circle_p...
{ "split": "train", "index": 1920, "acecode_id": "bigcode_python_fns_28966", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Develop a Python function to remove specified padding characters from a given text segment while preserving the structure of words and sentences. The function should take in a string and a list of user-defined padding characters to be stripped off. For instance, given the sourc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_padding_characters(' The quick \\\\n brown\\\\t fox jumps \\\\t over \\\\n the lazy dog ', [' ', '\\\\t', '\\\\n']) == 'The quick brown fox jumps over the lazy dog'\", \"assert remove_padding_characters('\\\\t\\\\tLeading and trailing t...
{ "split": "train", "index": 1921, "acecode_id": "evol_18131", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Implement a function `square_root(s: float) -> float` that computes the square root of a non-negative number `s` using the Babylonian method (also known as Heron's method). The function should return the square root of `s` accurate to a precision where further iterations do not...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert square_root(0) == 0.0\", \"assert abs(square_root(1) - 1.0) < 1e-10\", \"assert abs(square_root(4) - 2.0) < 1e-10\", \"assert abs(square_root(9) - 3.0) < 1e-10\", \"assert abs(square_root(16) - 4.0) < 1e-10\", \"assert abs(square_root(25) - 5.0) < 1e-10\", \...
{ "split": "train", "index": 1922, "acecode_id": "bigcode_python_fns_32304", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of lists, where each inner list represents detection results for a sequence of images. Additionally, you are provided with a list of class labels corresponding to the detection results. Your task is to implement a function that combines these two inputs int...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert make_sequence_output([[1, 2], [3, 4]], ['cat', 'dog']) == {'detections': [[1, 2], [3, 4]], 'classes': ['cat', 'dog']}\", \"assert make_sequence_output([[], [5, 6, 7]], ['car']) == {'detections': [[], [5, 6, 7]], 'classes': ['car']}\", \"assert make_sequence_...
{ "split": "train", "index": 1923, "acecode_id": "bigcode_python_fns_27724", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple logging system in Python. The system should have a function that accepts a list of messages and a corresponding list of severity levels (e.g., 'DEBUG', 'INFO', 'WARNING', 'ERROR'). Your goal is to create a function `log_messages` that p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert log_messages([], []) == []\", \"assert log_messages(['Message A', 'Message B'], ['DEBUG']) == []\", \"assert log_messages(['Test 1', 'Test 2', 'Test 3'], ['DEBUG', 'INFO']) == []\", \"assert log_messages(['Message 1'], []) == []\", \"assert log_messages(['Ms...
{ "split": "train", "index": 1924, "acecode_id": "oss_28970", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Implement a function `get_byte_size(obj, seen=None, size_of_other_types=None)` that calculates the total byte size of a Python object, including its contents. The function should handle various types including lists, tuples, sets, dictionaries, strings, integers, floats, and cu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_byte_size(3.14) == 24\", \"assert get_byte_size('Hello') == 54\", \"assert get_byte_size([]) == 56\", \"assert get_byte_size(None) == 16\", \"assert get_byte_size(complex(1, 2)) == 32\", \"assert get_byte_size(object()) == 16\"]}" }
{ "split": "train", "index": 1925, "acecode_id": "evol_20990", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Write a function `convert_to_pig_latin(word: str) -> str` that takes a single word as input and converts it to Pig Latin. If the word starts with a vowel (a, e, i, o, u), append 'way' to the end of the word. If the word starts with a consonant, move the first letter to the end ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_pig_latin('Elephant') == 'Elephantway'\", \"assert convert_to_pig_latin('apple') == 'appleway'\", \"assert convert_to_pig_latin('Orange') == 'Orangeway'\", \"assert convert_to_pig_latin('umbrella') == 'umbrellaway'\", \"assert convert_to_pig_latin...
{ "split": "train", "index": 1926, "acecode_id": "evol_34984", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are developing a feature for a social networking platform that manages user invitations. Each user has a maximum number of invitations they can send. You need to implement a function that calculates the number of remaining invitations a user can send based on the number of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_invite_message(5, 10, '') == 'You have 5 invites remaining.'\", \"assert update_invite_message(10, 10, '') == 'You have used all invites.'\", \"assert update_invite_message(0, 5, '') == 'You have 5 invites remaining.'\", \"assert update_invite_message...
{ "split": "train", "index": 1927, "acecode_id": "oss_35767", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes a list of integers and returns a new list containing only the even integers from the original list. The order of the even integers in the new list should be the same as their order in the original list. If there are no even integers, return an empty ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5, 6]) == [2, 4, 6]\", \"assert filter_even_numbers([7, 9, 11]) == []\", \"assert filter_even_numbers([0, 1, 2, 3, 4]) == [0, 2, 4]\", \"assert filter_even_numbers([-2, -1, 0, 1, 2]) == [-2, 0, 2]\", \"assert filter_even_numb...
{ "split": "train", "index": 1928, "acecode_id": "evol_29283", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string, write a function that counts the number of lowercase letters in the string. The function should return the total count of lowercase letters found in the input string.\nPlease reason step by step, then write a self-contained Python solution. Give your final progr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_lowercase_letters('Python Programming') == 15\", \"assert count_lowercase_letters('HELLO WORLD') == 0\", \"assert count_lowercase_letters('abcdefg') == 7\", \"assert count_lowercase_letters('12345!@#') == 0\", \"assert count_lowercase_letters('') == 0\...
{ "split": "train", "index": 1929, "acecode_id": "evol_18725", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with processing a list of cliff heights and determining if each height is above or below a specified threshold. Write a function `classify_cliffs(heights: List[int], threshold: int) -> List[str]` that takes a list of integers representing the heights of cliffs an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert classify_cliffs([100, 50, 75], 60) == ['Above', 'Below', 'Above']\", \"assert classify_cliffs([30, 20, 50, 40], 25) == ['Above', 'Below', 'Above', 'Above']\", \"assert classify_cliffs([10, 15, 20, 25], 25) == ['Below', 'Below', 'Below', 'Below']\", \"assert ...
{ "split": "train", "index": 1930, "acecode_id": "bigcode_python_fns_25201", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Design a Python function that computes the total volume of a list of cylinders. Each cylinder is represented by a dictionary containing 'radius' and 'height' as keys. The function should return the total volume of all cylinders in the list. The volume of a cylinder can be calcu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_volume([{'radius': 1, 'height': 1}, {'radius': 1, 'height': 1}]) == 6.283185307179586\", \"assert compute_volume([{'radius': 0, 'height': 5}]) == 0.0\", \"assert compute_volume([]) == 0.0\", \"assert compute_volume([{'radius': 5, 'height': 1}]) == 78...
{ "split": "train", "index": 1931, "acecode_id": "evol_36071", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `connect_to_server(host: str, port: int) -> str` that simulates a connection to a server. The function should take in a host (a string representing the server address) and a port number (an integer representing the port to connect to). Th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert connect_to_server('localhost', 27450) == 'Connected to localhost on port 27450'\", \"assert connect_to_server('192.168.1.1', 8080) == 'Connected to 192.168.1.1 on port 8080'\", \"assert connect_to_server('example.com', 80) == 'Connected to example.com on por...
{ "split": "train", "index": 1932, "acecode_id": "bigcode_python_fns_4432", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of classifiers and returns a dictionary containing the count of each unique audience category. The audience categories are represented as strings in the classifiers list. Each string may contain multiple audie...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_audience_categories(['Intended Audience :: Developers', 'Intended Audience :: Science/Research']) == {'Intended Audience': 2, 'Developers': 1, 'Science/Research': 1}\", \"assert count_audience_categories(['Intended Audience :: Developers', 'Intended Au...
{ "split": "train", "index": 1933, "acecode_id": "oss_31778", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given two dictionaries where each key is a tuple representing a unique data bin identifier and each value is a list of rows associated with that bin. Your task is to merge the rows from the second dictionary into the first one in-place. Each key in the first dictionary ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_binified_rows({(1, 2): [[1, 2], [3]], (2, 3): [[4]]}, {(1, 2): [[5]], (3, 4): [[6]]}) == {(1, 2): [[1, 2], [3], [5]], (2, 3): [[4]], (3, 4): [[6]]}\", \"assert merge_binified_rows({(1, 1): [[10]], (2, 2): [[20]]}, {(1, 1): [[30]], (2, 3): [[40]]}) == {...
{ "split": "train", "index": 1934, "acecode_id": "bigcode_python_fns_23727", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `create_figure()` that simulates the process of creating a new figure for plotting. The function should take no input and return a string indicating that a new figure has been created with a specified size of 10 units width and 3 units he...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_figure() == 'New figure created with size (10, 3)'\", \"assert create_figure() == 'New figure created with size (10, 3)'\", \"assert create_figure() == 'New figure created with size (10, 3)'\", \"assert create_figure() == 'New figure created with size...
{ "split": "train", "index": 1935, "acecode_id": "bigcode_python_fns_12485", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are developing a chatbot application that processes messages in a group chat. Your task is to implement a function `detectAtMe` that checks if the chatbot is mentioned in a message content. If the chatbot is mentioned, the function should prepend `[@ME]` to the message cont...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert detectAtMe('ChatBot', 'No mention here.') == 'No mention here.'\", \"assert detectAtMe('Bot', 'Just a random message without a mention.') == 'Just a random message without a mention.'\", \"assert detectAtMe('Assistant', 'Good morning! @Assistant') == '[@ME] ...
{ "split": "train", "index": 1936, "acecode_id": "oss_1968", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks if a user is authenticated based on their authentication ID and credentials. The function should be named `is_user_authenticated(auth_id: int, credentials: str) -> bool`. If both `auth_id` and `credentials` are provided, t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_user_authenticated(1, 'password123') == True\", \"assert is_user_authenticated(2, 'password456') == True\", \"assert is_user_authenticated(3, 'wrongpassword') == False\", \"assert is_user_authenticated(5, 'password000') == False\", \"assert is_user_authen...
{ "split": "train", "index": 1937, "acecode_id": "oss_34774", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that extracts specific information from a given JSON object representing a digital claim. The JSON object may contain various fields such as 'claim', 'context', 'cptId', 'expirationDate', 'id', and 'issuanceDate'. Your task is to i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_claim_info({'claim': {}, 'context': '', 'cptId': 1, 'expirationDate': 1234567890, 'id': 'abc123', 'issuanceDate': 9876543210}) == ('abc123', 1234567890)\", \"assert extract_claim_info({'cptId': 2000003, 'context': 'https://example.com', 'claim': {}})...
{ "split": "train", "index": 1938, "acecode_id": "oss_10115", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of migration models and extracts relevant information about the models and their fields. Each model is represented as a dictionary containing the model name and a list of fields, where each field is represente...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_migration_models([]) == {'total_models': 0, 'total_fields': 0, 'average_fields_per_model': 0, 'field_names_by_model': {}}\", \"assert process_migration_models([{ 'name': 'User', 'fields': [] }]) == {'total_models': 1, 'total_fields': 0, 'average_fiel...
{ "split": "train", "index": 1939, "acecode_id": "oss_11186", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a list of columns in a building. Each column has a height and a width. The function should take a list of tuples where each tuple contains the height and width of a column (e.g., [(height1, width1), (height2, width2), ...])...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert getTotalColumnArea([(1, 1), (2, 2), (3, 3)]) == 14\", \"assert getTotalColumnArea([(5, 5), (5, 5)]) == 50\", \"assert getTotalColumnArea([(10, 10)]) == 100\", \"assert getTotalColumnArea([(0, 1)]) == 0\", \"assert getTotalColumnArea([(1, 0)]) == 0\", \"asser...
{ "split": "train", "index": 1940, "acecode_id": "bigcode_python_fns_7521", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that returns the sum of all the even numbers in the list. If there are no even numbers, return 0. The function should be defined as follows: `def sum_of_evens(numbers: List[int]) -> int:` where `numbers` is a list of integers. The func...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([0, -2, -4, 6]) == 0\", \"assert sum_of_evens([-1, -2, -3, -4]) == -6\", \"assert sum_of_evens([10, 15, 20]) == 30\", \"assert sum_of_evens([1, 3, 5]) == 0\", \"assert sum_of_evens([-2, 2, 4]) == 4\...
{ "split": "train", "index": 1941, "acecode_id": "oss_8710", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to implement a function that retrieves the text from a specified line in a list of strings. The function should take an integer 'line_number' as input, which is 1-indexed, meaning that 1 refers to the first line in the list. The function should return the text of that ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_line_text(['Hello, World!', 'This is a test.', 'Goodbye!'], 1) == 'Hello, World!'\", \"assert get_line_text(['Hello, World!', 'This is a test.', 'Goodbye!'], 2) == 'This is a test.'\", \"assert get_line_text(['Hello, World!', 'This is a test.', 'Goodbye!...
{ "split": "train", "index": 1942, "acecode_id": "bigcode_python_fns_23871", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates basic banking operations on a single bank account. The function should be able to handle the following operations: deposit, withdraw, and check balance. You are given an initial balance for a bank account and a list of oper...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_bank_operations(1000, [('deposit', 500), ('withdraw', 200), ('balance', 0)]) == 1300\", \"assert process_bank_operations(500, [('withdraw', 100), ('withdraw', 600), ('deposit', 200)]) == 600\", \"assert process_bank_operations(100, [('deposit', 50), ...
{ "split": "train", "index": 1943, "acecode_id": "oss_23836", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a text string, write a function that identifies and returns all numerals exceeding zero. The function should return the numbers in the form of a list, excluding any occurrences of zero. The numerals can be of multiple digits and may appear anywhere within the text. Please...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_numbers('There are 3 apples and 0 oranges') == ['3']\", \"assert find_numbers('My balance is 100 dollars and I owe 0 dollars') == ['100']\", \"assert find_numbers('The temperature dropped to -5 degrees and then rose to 25 degrees') == ['5', '25']\", \"a...
{ "split": "train", "index": 1944, "acecode_id": "evol_21166", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `trie_operations(operations: List[Tuple[str, str]]) -> List[bool]` that performs a series of operations on a Trie data structure. The input is a list of operations where each operation is a tuple containing a command and a word. The command can be either 'a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert trie_operations([('add', 'apple'), ('find', 'apple')]) == [True]\", \"assert trie_operations([('add', 'banana'), ('find', 'banana')]) == [True]\", \"assert trie_operations([('add', 'grape'), ('find', 'orange')]) == [False]\", \"assert trie_operations([('add'...
{ "split": "train", "index": 1945, "acecode_id": "oss_13343", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of dictionaries representing sensor data. Each dictionary contains keys 'type', 'port', 'A_id', and 'B_id'. Your function should extract sensor IDs and port numbers based on certain criteria and construct comm...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_commands_from_data([{'type': 'TC', 'port': 1, 'A_id': 'A1', 'B_id': 'B1'}, {'type': 'TC', 'port': 2, 'A_id': 'A2', 'B_id': 'B2'}]) == [(('A1', 'B1'), 1), (('A2', 'B2'), 2)]\", \"assert generate_commands_from_data([{'type': 'TC', 'port': 1, 'A_id': '...
{ "split": "train", "index": 1946, "acecode_id": "oss_9160", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates metadata for a radar file based on specific input parameters. The function should take in the following parameters: `location` (a string representing the location of the radar), `date` (a tuple of three integers representin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_metadata('New York', (2023, 10, 5), 'Weather Service') == {'title': 'Radar file from New York', 'year': 2023, 'month': 10, 'day': 5, 'location': 'New York', 'source': 'Weather Service'}\", \"assert generate_metadata('Los Angeles', (2022, 12, 25), 'N...
{ "split": "train", "index": 1947, "acecode_id": "bigcode_python_fns_30486", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of tuples where each tuple contains a left-hand side (LHS) variable and a right-hand side (RHS) expression, implement a function that simulates type-checking by assigning a type to each LHS based on the type of the corresponding RHS expression. The RHS expressions ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert type_check([('a', 1), ('b', 2.0), ('c', 'hello')]) == {'a': 'int', 'b': 'float', 'c': 'str'}\", \"assert type_check([('x', 5), ('y', 3.14), ('z', 'world'), ('w', None)]) == {'x': 'int', 'y': 'float', 'z': 'str', 'w': 'unknown'}\", \"assert type_check([('m', ...
{ "split": "train", "index": 1948, "acecode_id": "bigcode_python_fns_47893", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that computes the value of the probability density function (PDF) of a univariate standard Gaussian distribution. The PDF of a standard Gaussian distribution is defined by the formula: \\( f(x) = \\frac{1}{\\sqrt{2\\pi}} e^{-\\frac{x^...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert abs(normpdf(0) - 0.3989422804014337) < 1e-9\", \"assert abs(normpdf(1) - 0.24197072451914337) < 1e-9\", \"assert abs(normpdf(-1) - 0.24197072451914337) < 1e-9\", \"assert abs(normpdf(2) - 0.05399096651318806) < 1e-9\", \"assert abs(normpdf(-2) - 0.0539909665...
{ "split": "train", "index": 1949, "acecode_id": "bigcode_python_fns_8326", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Your task is to write a function that takes this list as input and returns a new list containing only the unique elements from the original list, while maintaining the order of their first occurrence. For example, given the input list [1, 2, 2,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_elements([1, 2, 2, 3, 4, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert unique_elements([1, 1, 1, 1]) == [1]\", \"assert unique_elements([]) == []\", \"assert unique_elements([5, 5, 5, 6, 7, 6]) == [5, 6, 7]\", \"assert unique_elements([1, 2, 3, 4, 5]) == [1, ...
{ "split": "train", "index": 1950, "acecode_id": "oss_22065", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of strings representing file names, write a function `zip_files` that takes in the list and returns a single string representing the name of a zip file that would contain all the provided files. The zip file name should be formatted as 'files.zip' regardless of the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert zip_files(['file1.txt', 'file2.txt']) == 'files.zip'\", \"assert zip_files(['document.pdf']) == 'files.zip'\", \"assert zip_files(['image.png', 'video.mp4', 'audio.mp3']) == 'files.zip'\", \"assert zip_files([]) == 'empty.zip'\", \"assert zip_files(['notes.t...
{ "split": "train", "index": 1951, "acecode_id": "bigcode_python_fns_6791", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `check_palindrome` that accepts a string as input and returns `True` if the string is a palindrome, and `False` otherwise. A palindrome is a word, phrase, number, or other sequences of characters that reads the same forward and backward, ignoring spaces, pu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_palindrome('Madam') == True\", \"assert check_palindrome('Nun') == True\", \"assert check_palindrome('A man, a plan, a canal, Panama!') == True\", \"assert check_palindrome('No lemon, no melon') == True\", \"assert check_palindrome('Was it a car or a c...
{ "split": "train", "index": 1952, "acecode_id": "evol_34617", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, return the list after removing all duplicate integers, preserving the original order of their first appearance. The function should take a single argument, which is a list of integers, and return a new list of integers without duplicates. If the input ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_duplicates([1, 2, 3, 1, 2, 4]) == [1, 2, 3, 4]\", \"assert remove_duplicates([5, 5, 5, 5]) == [5]\", \"assert remove_duplicates([]) == []\", \"assert remove_duplicates([10, 20, 10, 30, 40, 20]) == [10, 20, 30, 40]\", \"assert remove_duplicates([1, 2, ...
{ "split": "train", "index": 1953, "acecode_id": "bigcode_python_fns_17663", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves the value of a specific setting from a configuration object. The configuration object is represented as a dictionary where keys are section names, and values are dictionaries of key-value pairs. Your function should accept ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_setting_value({'Hotkey': {'hk_next': 'Ctrl+N', 'hk_prev': 'Ctrl+P'}}, 'Hotkey', 'hk_next') == 'Ctrl+N'\", \"assert get_setting_value({'Hotkey': {'hk_next': 'Ctrl+N', 'hk_prev': 'Ctrl+P'}}, 'Hotkey', 'hk_prev') == 'Ctrl+P'\", \"assert get_setting_value({'...
{ "split": "train", "index": 1954, "acecode_id": "bigcode_python_fns_39314", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a floating-point number 'm' representing the mass of a star, implement a function that calculates the number of stars with mass 'm' according to the following rules: If 'm' is between 0.1 and 0.3 (inclusive), return c * (m ** -1.2); if 'm' is greater than 0.3 but less tha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert IMF_N(0.1) == 0.497056 * (0.1 ** -1.2)\", \"assert IMF_N(0.2) == 0.497056 * (0.2 ** -1.2)\", \"assert IMF_N(0.3) == 0.497056 * (0.3 ** -1.2)\", \"assert IMF_N(0.4) == 0.241367 * (0.4 ** -1.8)\", \"assert IMF_N(0.5) == 0.241367 * (0.5 ** -1.8)\", \"assert IMF...
{ "split": "train", "index": 1955, "acecode_id": "bigcode_python_fns_23931", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the deletion of a group entry in a directory structure represented as a list of dictionaries. Each dictionary represents a group with a unique 'dn' (distinguished name) key. The function should take a list of groups and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert delete_group([{'dn': 'group1'}, {'dn': 'group2'}, {'dn': 'group3'}], {'dn': 'group2'}) == [{'dn': 'group1'}, {'dn': 'group3'}]\", \"assert delete_group([{'dn': 'group1'}, {'dn': 'group2'}, {'dn': 'group3'}], {'dn': 'group4'}) == [{'dn': 'group1'}, {'dn': 'gr...
{ "split": "train", "index": 1956, "acecode_id": "bigcode_python_fns_15055", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a generator yielding wallpaper items. Each wallpaper item is represented as a dictionary containing details such as the image URL, title, and tags. Your function should take the generator as input and return a list o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_wallpaper_items((item for item in [{'image_url': 'https://example.com/image1.jpg', 'title': 'Mountain View', 'tags': ['mountain', 'nature', 'landscape']}, {'image_url': 'https://example.com/image2.jpg', 'title': 'Sunset Beach', 'tags': ['beach', 'sun...
{ "split": "train", "index": 1957, "acecode_id": "oss_10092", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating an XML structure for a given parent node that wraps around multiple child nodes. Write a function `create_xml(comment: str, parent_node: str, nodes: List[str]) -> str` that takes a comment string, a parent node name, and a list of child node strings...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_xml('Test comment', 'histograms', ['<histogram />', '<histogram />']) == '<!-- Test comment -->\\\\n<histograms>\\\\n <histogram />\\\\n <histogram />\\\\n</histograms>'\", \"assert create_xml('Sample comment', 'data', ['<entry />', '<entry />',...
{ "split": "train", "index": 1958, "acecode_id": "bigcode_python_fns_40589", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function that extracts all the unique words from a given string and returns them as a set. You should ensure to handle punctuation and case sensitivity so that 'Word' and 'word' are considered the same word. For example, the input string 'Hello, world! Hello' should yi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_unique_words('Hello, world! Hello') == {'hello', 'world'}\", \"assert extract_unique_words('The quick brown fox jumps over the lazy dog.') == {'the', 'quick', 'brown', 'fox', 'jumps', 'over', 'lazy', 'dog'}\", \"assert extract_unique_words('Python is...
{ "split": "train", "index": 1959, "acecode_id": "evol_12689", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given an integer array `nums` and you have to return a new `counts` array. The `counts` array has the property where `counts[i]` is the number of larger elements to the left of `nums[i]`. Write a function `countLarger(nums: List[int]) -> List[int]` that returns this cou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert countLarger([1]) == [0]\", \"assert countLarger([1, 1]) == [0, 0]\", \"assert countLarger([5, 4, 3, 2, 1]) == [0, 1, 2, 3, 4]\", \"assert countLarger([1, 2, 3, 4, 5]) == [0, 0, 0, 0, 0]\", \"assert countLarger([0, 0, 0, 0]) == [0, 0, 0, 0]\", \"assert countL...
{ "split": "train", "index": 1960, "acecode_id": "evol_7724", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Given a non-negative integer, implement a function that returns a list of booleans indicating whether each digit in the integer is even. The function should return a list where each element corresponds to a digit in the integer and is True if the digit is even and False if it i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert even_digit_detector(123456) == [False, True, False, True, False, True]\", \"assert even_digit_detector(24680) == [True, True, True, True, True]\", \"assert even_digit_detector(0) == [True]\", \"assert even_digit_detector(9) == [False]\", \"assert even_digit_...
{ "split": "train", "index": 1961, "acecode_id": "evol_4203", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Implement a function that counts the number of times the word 'python' appears in a given string, considering case sensitivity. The function should also return a list of starting indices of each occurrence. The function signature is: `def count_python_occurrences(char_sequence:...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_python_occurrences('The quick brown fox jumps over the lazy dog.') == {'count': 0, 'indices': []}\", \"assert count_python_occurrences('A simple string with no occurrences.') == {'count': 0, 'indices': []}\", \"assert count_python_occurrences('Just a s...
{ "split": "train", "index": 1962, "acecode_id": "evol_18158", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of buildings in a city. Your task is to implement a function that returns the number of buildings that can be seen from the left side. A building can be seen if it is taller than all the buildings to its left. Write a fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_visible_buildings([1]) == 1\", \"assert count_visible_buildings([1, 2, 3, 4]) == 4\", \"assert count_visible_buildings([4, 3, 2, 1]) == 1\", \"assert count_visible_buildings([1, 3, 2, 5, 4]) == 3\", \"assert count_visible_buildings([10, 5, 11, 8, 12]) ...
{ "split": "train", "index": 1963, "acecode_id": "bigcode_python_fns_45283", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that manages a collection of books in a simple list. The function should support the following operations: adding a new book, retrieving all books, retrieving a specific book by its index, updating a specific book by its index, and de...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_books([('add', {'title': 'Book A', 'author': 'Author A'})]) == [None]\", \"assert manage_books([('add', {'title': 'Book B', 'author': 'Author B'})]) == [None]\", \"assert manage_books([('get', 2)]) == ['Book not found']\", \"assert manage_books([('del...
{ "split": "train", "index": 1964, "acecode_id": "oss_27243", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Implement a function that takes in three sets as parameters and returns their union and intersection. The function should handle sets of varying sizes, including empty sets. The output should be a tuple containing the union and intersection of the three sets.\nPlease reason ste...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_operations({1, 2}, {3, 4}, {5, 6}) == ({1, 2, 3, 4, 5, 6}, set())\", \"assert set_operations({1}, {1}, {1}) == ({1}, {1})\", \"assert set_operations({1, 2, 3}, {4, 5, 6}, {7, 8, 9}) == ({1, 2, 3, 4, 5, 6, 7, 8, 9}, set())\", \"assert set_operations({1, 2...
{ "split": "train", "index": 1965, "acecode_id": "evol_19695", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simplified version of a stack-based virtual machine for a simple programming language. Your task is to implement the `pop` command for the virtual machine, which removes the top element from the stack and stores it in a designated memory locat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert pop_command('local') == '@LCL\\\\nD=M\\\\n@R13\\\\nM=D\\\\n@SP\\\\nAM=M-1\\\\nD=M\\\\n@R13\\\\nA=M\\\\nM=D\\\\n'\", \"assert pop_command('argument') == '@ARG\\\\nD=M\\\\n@R13\\\\nM=D\\\\n@SP\\\\nAM=M-1\\\\nD=M\\\\n@R13\\\\nA=M\\\\nM=D\\\\n'\", \"assert pop_c...
{ "split": "train", "index": 1966, "acecode_id": "oss_5369", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `ascii_encode(string: str) -> str` that takes a string as input and returns its 8-bit ASCII representation as a binary string. Each character in the input string should be converted to its ASCII value, and then represented as an 8-bit binary number. The out...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert ascii_encode('A') == '01000001'\", \"assert ascii_encode('Hello') == '0100100001100101011011000110110001101111'\", \"assert ascii_encode(' ') == '00100000'\", \"assert ascii_encode('!') == '00100001'\", \"assert ascii_encode('abc') == '0110000101100010011000...
{ "split": "train", "index": 1967, "acecode_id": "bigcode_python_fns_46099", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given an array of integers that may contain duplicates, write a function called `get_unique_permutations` that generates up to 'n' unique permutations of the integers in the array. The function should return a list of these unique permutations. If the number of unique permutati...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_permutations([1, 2, 2], 3) == [(1, 2, 2), (2, 1, 2), (2, 2, 1)]\", \"assert get_unique_permutations([1, 1, 1], 1) == [(1, 1, 1)]\", \"assert get_unique_permutations([4], 1) == [(4,)]\", \"assert get_unique_permutations([5, 5, 5, 5], 3) == [(5, 5, ...
{ "split": "train", "index": 1968, "acecode_id": "evol_19300", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are given a positive integer `n`. Your task is to write a function `solution` that takes `n` as input and returns the length of the longest consecutive sequence of ones in the binary representation of `n`. For example, if `n` is 156, its binary representation is 10011100. T...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert solution(156) == 3\", \"assert solution(15) == 4\", \"assert solution(5) == 1\", \"assert solution(1) == 1\", \"assert solution(255) == 8\", \"assert solution(0) == 0\", \"assert solution(3) == 2\", \"assert solution(7) == 3\", \"assert solution(8) == 1\", \...
{ "split": "train", "index": 1969, "acecode_id": "oss_21180", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of open orders represented by a dictionary, where each order has a unique order ID and associated details including the symbol, price, and quantity. Write a function `get_open_orders(symbol: str, orders: List[Dict[str, Union[str, float, int]]]) -> List[Dict...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_open_orders('BTCUSDT', [{'order_id': 1, 'symbol': 'BTCUSDT', 'price': 45000.0, 'quantity': 1}, {'order_id': 2, 'symbol': 'ETHUSDT', 'price': 3000.0, 'quantity': 2}]) == [{'order_id': 1, 'symbol': 'BTCUSDT', 'price': 45000.0, 'quantity': 1}]\", \"assert g...
{ "split": "train", "index": 1970, "acecode_id": "bigcode_python_fns_25469", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a Python function that calculates the nth Fibonacci number efficiently using caching or memoization. The function should return the nth Fibonacci number and indicate whether the last digit of this number is even or odd. The input n is a non-negative integer.\nPlease r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fib(0) == (0, 'Even')\", \"assert fib(1) == (1, 'Odd')\", \"assert fib(2) == (1, 'Odd')\", \"assert fib(3) == (2, 'Even')\", \"assert fib(4) == (3, 'Odd')\", \"assert fib(5) == (5, 'Odd')\", \"assert fib(6) == (8, 'Even')\", \"assert fib(7) == (13, 'Odd')\",...
{ "split": "train", "index": 1971, "acecode_id": "evol_7444", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of book titles. Your task is to return a list of titles that are unique, meaning they appear only once in the input list. For example, if the input list is ['A', 'B', 'A', 'C', 'D', 'B'], the output should be ['C', 'D'] since 'A' and 'B' appear more than on...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_titles(['A', 'B', 'A', 'C', 'D', 'B']) == ['C', 'D']\", \"assert unique_titles(['Introduction', 'Introduction', 'Chapter 1', 'Conclusion']) == ['Chapter 1', 'Conclusion']\", \"assert unique_titles(['Python', 'Java', 'Python', 'C++', 'Java']) == ['C++'...
{ "split": "train", "index": 1972, "acecode_id": "bigcode_python_fns_36840", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two integers, num1 and num2. Your task is to create a function that takes these two integers as input and performs the following operations based on a user's choice: 1 for addition, 2 for multiplication, 3 for finding the greater number, and 4 for entering new num...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert perform_operations(2, 3, [{'choice': 1}]) == 5\", \"assert perform_operations(2, 3, [{'choice': 2}]) == 6\", \"assert perform_operations(2, 3, [{'choice': 3}]) == 3\", \"assert perform_operations(2, 3, [{'choice': 4, 'new_num1': 5, 'new_num2': 10}]) == (5, 1...
{ "split": "train", "index": 1973, "acecode_id": "oss_22650", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of currency exchange rates over a week, implement a function `average_exchange_rate(rates: List[float]) -> str` that calculates the average exchange rate rounded to four decimal places. The function should take in a list of floats, where each float represents the e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_exchange_rate([1.2, 1.5, 1.3, 1.4, 1.6, 1.1, 1.0]) == '1.3000'\", \"assert average_exchange_rate([0.0, 0.0, 0.0]) == '0.0000'\", \"assert average_exchange_rate([2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5]) == '2.5000'\", \"assert average_exchange_rate([3.0, 3...
{ "split": "train", "index": 1974, "acecode_id": "bigcode_python_fns_29556", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that generates a random color in the hexadecimal triplet format, ensuring that the color is not plain black (#000000), not plain white (#ffffff), and not a grayscale color where the red, green, and blue values are equal. The function should return the generated...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_random_color() != '#000000'\", \"assert generate_random_color() != '#ffffff'\", \"assert generate_random_color() != '#000001'\", \"assert generate_random_color() != '#111111'\", \"assert generate_random_color() != '#222222'\", \"assert generate_rand...
{ "split": "train", "index": 1975, "acecode_id": "evol_22432", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `interchange_elements(arr, pos1, pos2)` that swaps the elements at the specified positions `pos1` and `pos2` in the list. If either position is out of bounds, the list should remain unchanged. The function should return the modified li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert interchange_elements([10, 20, 30, 40], 0, 1) == [20, 10, 30, 40]\", \"assert interchange_elements([10, 20, 30, 40], 1, 3) == [10, 40, 30, 20]\", \"assert interchange_elements([10, 20, 30, 40], 2, 2) == [10, 20, 30, 40]\", \"assert interchange_elements([10, 2...
{ "split": "train", "index": 1976, "acecode_id": "evol_15888", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a list of strings and a list of arguments. The function should map the strings to the arguments, filling in any missing arguments with the strings themselves. If there are more arguments than strings, the extra argument...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_strings(['x', 'y'], ['m', 'n', 'o']) == ['m', 'n']\", \"assert process_strings(['hello'], ['world']) == ['world']\", \"assert process_strings(['apple', 'banana'], ['orange', 'kiwi', 'grape']) == ['orange', 'kiwi']\", \"assert process_strings(['red', ...
{ "split": "train", "index": 1977, "acecode_id": "oss_19805", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Write a function called `reverse_string` that takes a string as input and returns a new string that is the reverse of the input string. You must not use any predefined Python functions or methods such as [::-1] or reversed() to accomplish this task. Ensure that your function ha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_string('\\u3053\\u3093\\u306b\\u3061\\u306f\\u3001\\u4e16\\u754c') == '\\u754c\\u4e16\\u3001\\u306f\\u3061\\u306b\\u3093\\u3053'\", \"assert reverse_string('abcdef') == 'fedcba'\", \"assert reverse_string('12345') == '54321'\", \"assert reverse_strin...
{ "split": "train", "index": 1978, "acecode_id": "evol_27841", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `round_number(value: float, precision: int, method: str) -> float` that rounds a given floating-point number to a specified precision using a specified rounding method. The parameters are as follows: \n\n- `value`: A floating-point nu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert round_number(42.55, 0, 'common') == 43.0\", \"assert round_number(42.55, 1, 'common') == 42.6\", \"assert round_number(42.55, 0, 'ceil') == 43.0\", \"assert round_number(42.55, 1, 'ceil') == 42.6\", \"assert round_number(42.55, 0, 'floor') == 42.0\", \"asser...
{ "split": "train", "index": 1979, "acecode_id": "bigcode_python_fns_46825", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of database names, return a list of corresponding database entries from a predefined dictionary. The function should raise a ValueError if any of the requested database names are not found in the dictionary. Implement a function named `get_databases` that takes two...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_databases(['db1', 'db2'], {'db1': 'entry1', 'db2': 'entry2'}) == ['entry1', 'entry2']\", \"assert get_databases(['db3'], {'db1': 'entry1', 'db2': 'entry2', 'db3': 'entry3'}) == ['entry3']\", \"assert get_databases(['db1'], {'db1': 'entry1'}) == ['entry1'...
{ "split": "train", "index": 1980, "acecode_id": "bigcode_python_fns_32494", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that calculates the total cost of a shopping cart. The shopping cart contains various items, each with a specified price and quantity. Your function should take a list of tuples as input, where each tuple represents an item in ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_total_cost([(10, 2), (5, 3), (8, 1)]) == 43\", \"assert calculate_total_cost([(1, 1), (2, 2), (3, 3)]) == 14\", \"assert calculate_total_cost([(0, 10), (5, 1)]) == 5\", \"assert calculate_total_cost([(10, 0), (15, 0)]) == 0\", \"assert calculate_to...
{ "split": "train", "index": 1981, "acecode_id": "oss_3341", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that parses a string argument and constructs a dictionary representing a fixed image entry. The function should handle the input string in the format 'image<:namespace:deployment:container>=result', where 'image' is the image name, an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_fixed_image_entry('nginx:prod:web:app=success') == {'image': 'nginx', 'namespace': 'prod', 'deployment': 'web', 'container': 'app', 'result': 'success'}\", \"assert parse_fixed_image_entry('mysql:prod:db:main=failure') == {'image': 'mysql', 'namespace'...
{ "split": "train", "index": 1982, "acecode_id": "oss_26926", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers `A` and a list of characters `Z`, write a function `generate_pairs(A, Z)` that generates all possible combinations of pairs where the first element is from list `A` and the second element is from list `Z`. Each pair should be represented as a tuple. The...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_pairs([1, 2], ['a', 'b']) == [(1, 'a'), (1, 'b'), (2, 'a'), (2, 'b')]\", \"assert generate_pairs([], ['x', 'y']) == []\", \"assert generate_pairs([3, 4], []) == []\", \"assert generate_pairs([0], ['c']) == [(0, 'c')]\", \"assert generate_pairs([5, 6...
{ "split": "train", "index": 1983, "acecode_id": "oss_19600", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a data point, its mean, and standard deviation (sigma) from a dataset, implement a function that calculates the z-score of the data point. The z-score indicates how many standard deviations a data point is from the mean. The formula to calculate the z-score is: zscore = (...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert zscore(10, 5, 2) == 2.5\", \"assert zscore(0, 0, 1) == 0.0\", \"assert zscore(5, 5, 1) == 0.0\", \"assert zscore(5, 5, 0.1) == 0.0\", \"assert zscore(15, 10, 5) == 1.0\", \"assert zscore(20, 10, 10) == 1.0\", \"assert zscore(-5, -10, 5) == 1.0\", \"assert zs...
{ "split": "train", "index": 1984, "acecode_id": "bigcode_python_fns_22044", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers representing the heights of students in a classroom, write a function that calculates the average height of the students rounded to the nearest integer. The input list will contain at least one integer and can contain at most 100 integers. The function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_height([150, 160, 170]) == 160\", \"assert average_height([140]) == 140\", \"assert average_height([100, 200, 300]) == 200\", \"assert average_height([120, 130, 140, 150]) == 135\", \"assert average_height([180, 190]) == 185\", \"assert average_heigh...
{ "split": "train", "index": 1985, "acecode_id": "bigcode_python_fns_47885", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the sum of all even numbers in a given list of integers. The function should take a single parameter, which is a list of integers, and return the sum of all even integers in that list. If there are no even numbers, the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([0, 1, 2, 3, 4]) == 6\", \"assert sum_of_evens([-2, -1, 0, 1, 2]) == 0\", \"assert sum_of_evens([1, 3, 5, 7]) == 0\", \"assert sum_of_evens([10, 20, 30]) == 60\", \"assert sum_of_evens([-4, -2, 2, 4...
{ "split": "train", "index": 1986, "acecode_id": "oss_5416", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a file renaming algorithm that follows a specific set of rules. Given a list of file names, each consisting of a base name and an extension, you need to write a function that renames the files according to the following rules:\n\n1. If the base ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rename_files(['spam_file.txt', 'prefix_spam_file.txt', 'prefix_file.txt', 'otherfile.md']) == ['eggs_file.md', 'eggs_file.md', 'file.md', 'otherfile.md']\", \"assert rename_files(['spam.txt', 'prefix_spam.txt']) == ['eggs.md', 'eggs.md']\", \"assert rename_f...
{ "split": "train", "index": 1987, "acecode_id": "oss_23940", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the nth Fibonacci number using an iterative approach. The Fibonacci sequence is a series of numbers in which each number is the sum of the two preceding ones, usually starting with 0 and 1. The sequence goes: 0, 1, 1, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci_iterative(1) == 0\", \"assert fibonacci_iterative(2) == 1\", \"assert fibonacci_iterative(3) == 1\", \"assert fibonacci_iterative(4) == 2\", \"assert fibonacci_iterative(5) == 3\", \"assert fibonacci_iterative(6) == 5\", \"assert fibonacci_iterativ...
{ "split": "train", "index": 1988, "acecode_id": "oss_15034", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that determines if the input version string represents a Python version that is 3.7 or higher. The function should return `True` if the version is 3.7 or higher, and `False` if the version is lower than 3.7. The version string ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_python_version('3.7.0') == True\", \"assert check_python_version('3.8.1') == True\", \"assert check_python_version('3.9.0') == True\", \"assert check_python_version('4.0.0') == True\", \"assert check_python_version('3.6.9') == False\", \"assert check_p...
{ "split": "train", "index": 1989, "acecode_id": "oss_24907", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of meetings represented by their start and end times in the format (start, end). Your task is to implement a function that returns the most optimal schedule of meetings, such that no two meetings overlap. The function should take a list of tuples as input, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_optimal_schedule([(1, 2), (2, 3), (3, 4), (4, 5)]) == [(1, 2), (2, 3), (3, 4), (4, 5)]\", \"assert find_optimal_schedule([(1, 3), (2, 6), (8, 10), (5, 7)]) == [(1, 3), (5, 7), (8, 10)]\", \"assert find_optimal_schedule([(1, 4), (3, 5), (0, 6), (5, 7), (...
{ "split": "train", "index": 1990, "acecode_id": "evol_1045", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a string that contains line breaks represented by the newline character '\\n'. Your task is to create a function that replaces each newline character in the string with the HTML line break tag '<br>'. Write a function `replace_newlines_with_br(text: str) -> str` t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert replace_newlines_with_br('Hello\\\\nWorld') == 'Hello<br>World'\", \"assert replace_newlines_with_br('Line1\\\\nLine2\\\\nLine3') == 'Line1<br>Line2<br>Line3'\", \"assert replace_newlines_with_br('No line breaks here') == 'No line breaks here'\", \"assert re...
{ "split": "train", "index": 1991, "acecode_id": "bigcode_python_fns_1821", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing a simple database of persons in different groups. Implement a function `manage_persons` that takes a list of operations and simulates adding and removing persons from groups. Each operation is represented as a tuple with the following format: ('add'...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_persons([('add', 'group1', 'Hans'), ('add', 'group1', 'Anna')]) == {'group1': ['Hans', 'Anna']}\", \"assert manage_persons([('add', 'group1', 'Hans'), ('add', 'group1', 'Hans')]) == {'group1': ['Hans']}\", \"assert manage_persons([('add', 'group1', 'H...
{ "split": "train", "index": 1992, "acecode_id": "bigcode_python_fns_26195", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Write a function named `get_first_element` that takes a list as an argument and returns the first element of the list. If the list is empty, the function should return the string 'Given list is empty'.\nPlease reason step by step, then write a self-contained Python solution. Gi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_first_element([6, 7, 8]) == 6\", \"assert get_first_element([1]) == 1\", \"assert get_first_element(['a', 'b', 'c']) == 'a'\", \"assert get_first_element([]) == 'Given list is empty'\", \"assert get_first_element(['first', 'second']) == 'first'\", \"asse...
{ "split": "train", "index": 1993, "acecode_id": "evol_27075", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `common(l1: list, l2: list) -> list` that returns a sorted list of unique integer elements that are common between two provided lists. You must not use any built-in Python list functionalities for sorting or removing duplicates. The function should correctl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert common([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]) == [1, 5, 653]\", \"assert common([5, 3, 2, 8], [3, 2]) == [2, 3]\", \"assert common([-2, -3, 0, 2, 5], [-5, 2, 0, -3]) == [-3, 0, 2]\", \"assert common([10, 20, 30], [30, 20, 10]) == [10, 20, 30]\"...
{ "split": "train", "index": 1994, "acecode_id": "evol_32524", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a parser for a custom Extended Context-Free Grammar (ECFG) format. The ECFG format consists of a set of production rules, each defining how a non-terminal symbol can be expanded into a sequence of terminal and non-terminal symbols, with the incl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_ecfg(['S -> a | b']) == True\", \"assert validate_ecfg(['Z -> {a|b}']) == True\", \"assert validate_ecfg(['R -> a|b']) == True\", \"assert validate_ecfg(['P -> {a.b} | {b*a}']) == True\", \"assert validate_ecfg(['S -> 1A']) == False\", \"assert vali...
{ "split": "train", "index": 1995, "acecode_id": "oss_9810", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You need to implement a function `colorize(text, fg)` that takes in a string `text` and a foreground color `fg`, and returns the colorized text formatted for console output. The function should support the following colors: \"red\", \"green\", \"yellow\", \"blue\", \"magenta\",...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert colorize(\\\"Hello, World!\\\", \\\"red\\\") == '\\\\x1b[31mHello, World!\\\\x1b[0m'\", \"assert colorize(\\\"Hello, World!\\\", \\\"green\\\") == '\\\\x1b[32mHello, World!\\\\x1b[0m'\", \"assert colorize(\\\"Hello, World!\\\", \\\"yellow\\\") == '\\\\x1b[33...
{ "split": "train", "index": 1996, "acecode_id": "oss_33595", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing measurements of some faulty system. Your task is to implement a function that checks if all measurements are within a specified error rate. The function should take in the list of measurements, an integer representing the maximum al...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_measurements([10, 12, 9, 11], 2) == True\", \"assert check_measurements([1, 3, 2, 5], 1) == False\", \"assert check_measurements([5, 5, 5, 5], 0) == True\", \"assert check_measurements([100, 98, 102, 101], 3) == True\", \"assert check_measurements([0, ...
{ "split": "train", "index": 1997, "acecode_id": "bigcode_python_fns_11559", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a string `seq` consisting of the characters 'H' and 'T', where 'H' represents a horizontal step and 'T' represents a vertical step. Your task is to implement a function `lattice2d_fixed_env(seq: str) -> Tuple[int, int]` that returns the final coordinates after fol...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert lattice2d_fixed_env('HHHH') == (4, 0)\", \"assert lattice2d_fixed_env('TTTT') == (0, 4)\", \"assert lattice2d_fixed_env('HTHT') == (2, 2)\", \"assert lattice2d_fixed_env('HHTT') == (2, 2)\", \"assert lattice2d_fixed_env('HT') == (1, 1)\", \"assert lattice2d_...
{ "split": "train", "index": 1998, "acecode_id": "bigcode_python_fns_46785", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing docket numbers. Write a function `process_dockets(docket_numbers: List[int], action: str) -> List[str]` that performs the specified action on the docket numbers based on the value of `action`. The possible actions are: 'get_all' to ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_dockets([1001, 1002, 1003], 'get_all') == ['1001.json', '1001.pdf', '1002.json', '1002.pdf', '1003.json', '1003.pdf']\", \"assert process_dockets([2001, 2002], 'get_json') == ['2001.json', '2002.json']\", \"assert process_dockets([3001], 'get_pdf') =...
{ "split": "train", "index": 1999, "acecode_id": "bigcode_python_fns_10809", "num_tests": 16 }