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 ranges, where each range is represented as a tuple of two integers (min, max). Your task is to simplify the list of ranges such that overlapping ranges are merged into a single range. If two ranges overlap or touch, they should be combined into one. Retu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reduce_range_overlaps([(1, 3), (2, 6), (8, 10), (15, 18)]) == [(1, 6), (8, 10), (15, 18)]\", \"assert reduce_range_overlaps([(1, 4), (4, 5)]) == [(1, 5)]\", \"assert reduce_range_overlaps([(1, 5), (2, 3), (4, 6)]) == [(1, 6)]\", \"assert reduce_range_overlap... | {
"split": "train",
"index": 72200,
"acecode_id": "bigcode_python_fns_43805",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a given request data and an offset value to generate query parameters for a POST request. Your function should take in two parameters: `request` (a dictionary containing the request data) and `offset` (an integer repres... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_post_query_params({}, 5) == 'Request data is missing'\", \"assert set_post_query_params({'key1': 'value1'}, 10) == {'key1': 'value1', 'offset': 10}\", \"assert set_post_query_params({'param1': 'data1', 'param2': 'data2'}, 0) == {'param1': 'data1', 'param... | {
"split": "train",
"index": 72201,
"acecode_id": "oss_19663",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 9x9 Sudoku board represented as a 2D list `board`. The board is partially filled with digits from 1 to 9, and the empty cells are represented by 0. Your task is to implement a function `change(position)` that takes a tuple `position` representing the row and col... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert change((0, 2)) == True\", \"assert change((1, 1)) == True\", \"assert change((4, 1)) == True\", \"assert change((5, 1)) == True\", \"assert change((8, 0)) == True\", \"assert change((8, 8)) == True\", \"assert change((3, 3)) == True\", \"assert change((6, 3)... | {
"split": "train",
"index": 72202,
"acecode_id": "oss_2080",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a caching mechanism for a function that computes the sum of two integers. Your goal is to create a decorator function called `cache` that caches the result of the sum for a specified period of time in seconds. The decorator should have the follo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cache(3)(lambda x, y: x + y)(1, 2) == 3\", \"assert cache(3)(lambda x, y: x + y)(1, 3) == 4\", \"assert cache(3)(lambda x, y: x + y)(2, 2) == 4\", \"assert cache(3)(lambda x, y: x + y)(1, 2) == 3\", \"assert cache(3)(lambda x, y: x + y)(1, 2) == 3\", \"asser... | {
"split": "train",
"index": 72203,
"acecode_id": "oss_31427",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `as_bytes` that takes a single parameter `x` and converts it to bytes. If `x` is already of type `bytes`, return it as it is. If `x` is of any other type, convert it to a string and then encode that string using UTF-8 encoding before returning the result as byt... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert as_bytes(b'hello') == b'hello'\", \"assert as_bytes('hello') == b'hello'\", \"assert as_bytes(123) == b'123'\", \"assert as_bytes(3.14) == b'3.14'\", \"assert as_bytes([1, 2, 3]) == b'[1, 2, 3]'\"]}"
} | {
"split": "train",
"index": 72204,
"acecode_id": "bigcode_python_fns_47669",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates and returns the accuracy for a given metric. The function takes in three parameters: `metric`, `hits`, and `misses`. If the `metric` is 'pointing', the function should calculate the accuracy as hits divided by the tota... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_metric('pointing', 10, 5) == 0.6666666666666666\", \"assert calculate_metric('pointing', 0, 0) == 0.0\", \"assert calculate_metric('pointing', 5, 5) == 0.5\", \"assert calculate_metric('pointing', 20, 10) == 0.6666666666666666\", \"assert calculate... | {
"split": "train",
"index": 72205,
"acecode_id": "oss_3067",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a numeric sequence (list of integers) and a specific integer limit, write a function `extract_elements(sequence, limit)` that returns a new list containing all elements from the sequence starting from the index that matches the limit (1-based index). If the limit is great... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_elements([1, 2, 3, 4, 5, 6], 3) == [3, 4, 5, 6]\", \"assert extract_elements([1, 2, 3, 4, 5, 6], 1) == [1, 2, 3, 4, 5, 6]\", \"assert extract_elements([1, 2, 3, 4, 5, 6], 6) == [6]\", \"assert extract_elements([1, 2, 3, 4, 5, 6], 7) == []\", \"assert... | {
"split": "train",
"index": 72206,
"acecode_id": "evol_34890",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that constructs a WebSocket URL based on a given path and query parameters. The WebSocket URL should be formatted as follows: 'ws://{host}:{port}/{path}?{query}'. The parameters are: \n - host: a string representing the host (e.g., 'local... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert construct_websocket_url('localhost', 8080, 'ws-endpoint', 'param1=value1') == 'ws://localhost:8080/ws-endpoint?param1=value1'\", \"assert construct_websocket_url('127.0.0.1', 3000, 'chat', '') == 'ws://127.0.0.1:3000/chat?'\", \"assert construct_websocket_ur... | {
"split": "train",
"index": 72207,
"acecode_id": "bigcode_python_fns_3244",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a positive integer n, write a function `find_prime_divisor(n)` that returns the smallest prime divisor of n. If n does not have any prime divisors less than or equal to 1,000,000, the function should return -1. A prime divisor is defined as a prime number that divides n w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_prime_divisor(15) == 3\", \"assert find_prime_divisor(28) == 2\", \"assert find_prime_divisor(100) == 2\", \"assert find_prime_divisor(37) == 37\", \"assert find_prime_divisor(1) == -1\", \"assert find_prime_divisor(2) == 2\", \"assert find_prime_diviso... | {
"split": "train",
"index": 72208,
"acecode_id": "bigcode_python_fns_39906",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the number of items in different categories. Your task is to implement a function that calculates the total number of items across all categories. Write a function `total_items(categories: List[int]) -> int` that takes a list of int... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert total_items([1, 2, 3]) == 6\", \"assert total_items([0, 0, 0]) == 0\", \"assert total_items([5, 5, 5]) == 15\", \"assert total_items([10]) == 10\", \"assert total_items([1, 100, 1000]) == 1101\", \"assert total_items([7, 14, 21]) == 42\", \"assert total_item... | {
"split": "train",
"index": 72209,
"acecode_id": "bigcode_python_fns_9523",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that counts the occurrences of specific license information found within a string. The license information is defined as any text enclosed within a pair of triple double quotes (`\"\"\" ... \"\"\"`) or triple single quotes (`''... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_license_occurrences('\\\"\\\"\\\"License A\\\"\\\"\\\"') == {'License A': 1}\", \"assert count_license_occurrences('\\\"\\\"\\\"License A\\\"\\\"\\\" \\\"\\\"\\\"License B\\\"\\\"\\\"') == {'License A': 1, 'License B': 1}\", \"assert count_license_occu... | {
"split": "train",
"index": 72210,
"acecode_id": "oss_15136",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_queue(operations: List[Tuple[str, Any]]) -> List[Optional[Any]]` that takes a list of operations to perform on a queue. The operations include 'enqueue' to add an element to the queue and 'dequeue' to remove the front element from the queue. The fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_queue([('enqueue', 1), ('enqueue', 2), ('dequeue', None)]) == [1]\", \"assert create_queue([('enqueue', 3), ('dequeue', None), ('dequeue', None)]) == [3, None]\", \"assert create_queue([('dequeue', None)]) == [None]\", \"assert create_queue([('enqueue... | {
"split": "train",
"index": 72211,
"acecode_id": "evol_9947",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function `is_valid_video_source(video_source: str) -> bool` that checks if a given video source string is a valid video filename based on simple criteria: the string should end with '.mp4', '.avi', or '.mov'. Your function should return True if the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_video_source('example_video.mp4') == True\", \"assert is_valid_video_source('movie.avi') == True\", \"assert is_valid_video_source('clip.mov') == True\", \"assert is_valid_video_source('document.pdf') == False\", \"assert is_valid_video_source('imag... | {
"split": "train",
"index": 72212,
"acecode_id": "oss_37665",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an array of integers. Your task is to sort the elements of the array based on the following criteria: \n1. Divide the elements into three groups: \n - Even-indexed and even numbers (even_group) \n - Odd-indexed and odd numbers (odd_group) \n - All remaining ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert custom_sort([1, 3, 5, 7, 9]) == [1, 3, 5, 7, 9]\", \"assert custom_sort([2, 4, 6, 8, 10]) == [2, 4, 6, 8, 10]\", \"assert custom_sort([2, 1]) == [2, 1]\", \"assert custom_sort([1, 2]) == [1, 2]\", \"assert custom_sort([2]) == [2]\", \"assert custom_sort([1])... | {
"split": "train",
"index": 72213,
"acecode_id": "evol_13594",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a list of 2D points representing strokes in a drawing, where each stroke is represented as a list of tuples (x, y). Your task is to apply a random rotation to each stroke in the drawing about the origin (0, 0) by a random angle sampled from a Gaussian distribution... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert jitter_rotate([[(1, 0), (0, 1)]], 0.2) != [[(1, 0), (0, 1)]]\", \"assert jitter_rotate([[(3, 4), (5, 6)]], 0.5) != [[(3, 4), (5, 6)]]\", \"assert jitter_rotate([[(0, 0), (1, 1), (2, 2)]], 0.1) != [[(0, 0), (1, 1), (2, 2)]]\", \"assert jitter_rotate([[(1, 2),... | {
"split": "train",
"index": 72214,
"acecode_id": "bigcode_python_fns_2174",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string containing multiple area descriptions separated by ';' (semicolon) and further divided by '、' (comma), write a function that extracts and returns a list of human-readable addresses. Each area description may contain a main area name followed by sub-areas. If the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_areas('A\\u533a\\u3001B\\u3001C\\uff1bD\\u533a\\u3001E\\u3001F\\u3001G') == ['A\\u533a', 'B', 'C', 'D\\u533a', 'E', 'F', 'G']\", \"assert parse_areas('X\\u533a\\u3001Y\\u533a\\u3001Z') == ['X\\u533a', 'Y\\u533a', 'Z']\", \"assert parse_areas('M\\u533a\... | {
"split": "train",
"index": 72215,
"acecode_id": "bigcode_python_fns_25273",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple function that simulates the behavior of a web application with two routes: one for the root path and another for the login path. When the function `handle_request` is called with a request path, it should return a string indicating the outc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert handle_request('/') == 'Redirecting to /login'\", \"assert handle_request('/login') == '401 Unauthorized'\", \"assert handle_request('/other') == '404 Not Found'\", \"assert handle_request('/login') == '401 Unauthorized'\", \"assert handle_request('/home') =... | {
"split": "train",
"index": 72216,
"acecode_id": "oss_30748",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of configuration options, where each option is a key-value pair represented as a tuple. Your function should read these configuration options and return a dictionary that maps each key to its corresponding value. If a ke... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert load_options([('key1', 'value1'), ('key2', 'value2'), ('key1', 'value3')]) == {'key1': 'value3', 'key2': 'value2'}\", \"assert load_options([('key1', 'value1'), ('key1', 'value1')]) == {'key1': 'value1'}\", \"assert load_options([]) == {}\", \"assert load_op... | {
"split": "train",
"index": 72217,
"acecode_id": "bigcode_python_fns_9406",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two positive integers, A and B. Your task is to write a function that calculates the greatest common divisor (GCD) of A and B using the Euclidean algorithm. The GCD is the largest positive integer that divides both A and B without leaving a remainder. Implement a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert gcd(105, 90) == 15\", \"assert gcd(100, 25) == 25\", \"assert gcd(13, 17) == 1\", \"assert gcd(56, 98) == 14\", \"assert gcd(48, 18) == 6\", \"assert gcd(101, 10) == 1\", \"assert gcd(36, 60) == 12\", \"assert gcd(1, 1) == 1\", \"assert gcd(1000000, 500000) ... | {
"split": "train",
"index": 72218,
"acecode_id": "oss_871",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, implement a function that checks if each string starts with the term 'canine' followed by zero or more non-alphabetic characters excluding the letters 'x' and 'y'. The function should return a list of boolean values where each value indicates whether th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert matching_series(['canine..', 'canine:', 'xcanine', 'ycanine']) == [True, True, False, False]\", \"assert matching_series(['canine123.', 'canine?', 'canine:', 'canine@']) == [True, True, True, True]\", \"assert matching_series(['canine0', 'canine1', 'canine2'... | {
"split": "train",
"index": 72219,
"acecode_id": "evol_23617",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a positive integer, write a function that checks if it can be represented as a valid UUID (Universally Unique Identifier) when interpreted as an integer. A valid UUID is a 128-bit number, and thus the integer representation must be between 0 and 2^128 - 1. Your function s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_uuid_int(0) == True\", \"assert is_valid_uuid_int(1) == True\", \"assert is_valid_uuid_int(2**128 - 1) == True\", \"assert is_valid_uuid_int(2**128) == False\", \"assert is_valid_uuid_int(123456789) == True\", \"assert is_valid_uuid_int(2**127) == T... | {
"split": "train",
"index": 72220,
"acecode_id": "bigcode_python_fns_12778",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks if a given backend IP address is linked to any of the provided IP addresses of a load balancer. The function should accept a backend IP address as a string and a comma-separated string of load balancer IP addresses. It sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_backend_linked('10.0.0.5', 'ip-10.0.0.1,ip-10.0.0.2') == 'Backend 10.0.0.5 not linked to any of the specified IPs'\", \"assert check_backend_linked('10.0.0.4', 'ip-10.0.0.4,ip-10.0.0.5') == 'Backend 10.0.0.4 is linked to ip-10.0.0.4'\", \"assert check_... | {
"split": "train",
"index": 72221,
"acecode_id": "bigcode_python_fns_31210",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that finds the smallest missing positive number. The function should handle edge cases where the list may include duplicate entries, negative numbers, zeros, or be in a non-sequential order. The function should return the smallest ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_smallest_missing_positive([3, 4, -10, -2, 9, 8, 1, 1, 0, 3]) == 2\", \"assert find_smallest_missing_positive([1, 2, 0]) == 3\", \"assert find_smallest_missing_positive([-1, -2, -3]) == 1\", \"assert find_smallest_missing_positive([7, 8, 9, 11, 12]) == 1... | {
"split": "train",
"index": 72222,
"acecode_id": "evol_3303",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a configuration represented as a dictionary in Python. The configuration contains various settings and metadata for a software project. Your goal is to perform the following operations based on the provided configuration di... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_config({'project': 'Buggy', 'copyright': '2019 <NAME>. Maintained by the TouchBIT Team', 'author': '<NAME>', 'version': 'latest', 'release': 'latest', 'language': 'en', 'exclude_patterns': ['_build']}) == ('Buggy', '2019', 'Latest version and release... | {
"split": "train",
"index": 72223,
"acecode_id": "oss_25043",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates a list of random integer coordinates representing points in a 2D space. Each point should have x and y coordinates within a specified range. Write a function `generate_random_points(k, x_range, y_range)` that generates ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert all(0 <= point[0] <= 10 for point in generate_random_points(5, (0, 10), (0, 10)))\", \"assert all(0 <= point[1] <= 10 for point in generate_random_points(5, (0, 10), (0, 10)))\", \"assert len(generate_random_points(0, (0, 10), (0, 10))) == 0\", \"assert len(... | {
"split": "train",
"index": 72224,
"acecode_id": "oss_1138",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the total number of pixels in an image represented as a 2D array. Each element in the array corresponds to a pixel in the image. Write a function `calculate_total_pixels(image: List[List[int]], pixel_per_line: int) -> int` that takes in a 2D arra... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_pixels([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]], 4) == 12\", \"assert calculate_total_pixels([[0]], 1) == 1\", \"assert calculate_total_pixels([[1, 1], [1, 1]], 2) == 4\", \"assert calculate_total_pixels([[1], [2], [3]], 1) == 3\", \"ass... | {
"split": "train",
"index": 72225,
"acecode_id": "oss_15928",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_prime(n)` that checks if a given number `n` is a prime number. The function should return `True` for prime numbers and `False` for all other numbers, including negative numbers, zero, one, floating-point numbers, and complex numbers. A prime number is d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_prime(2) == True\", \"assert is_prime(3) == True\", \"assert is_prime(4) == False\", \"assert is_prime(5) == True\", \"assert is_prime(6) == False\", \"assert is_prime(11) == True\", \"assert is_prime(13) == True\", \"assert is_prime(17) == True\", \"asse... | {
"split": "train",
"index": 72226,
"acecode_id": "evol_18475",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with verifying the behavior of a message handling system that processes a specific message format. Implement a function `validate_message_response` which takes the following parameters: \n- `message`: The message string to be sent to the system for processing. \n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_message_response('test_message', 0, 0, 0, True) == True\", \"assert validate_message_response('test_message', 1, 0, 0, True) == False\", \"assert validate_message_response('test_message', 0, 1, 0, True) == False\", \"assert validate_message_response... | {
"split": "train",
"index": 72227,
"acecode_id": "oss_26834",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a weather data retrieval system based on a specific weather product type. Your function should take a list of weather product types as input and return a corresponding list of mock weather data responses based on the produc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_weather_data(['astronomy', 'hourly', 'daily']) == ['astronomy_response', 'hourly_response', 'daily_response']\", \"assert get_weather_data(['daily_simple', 'observation']) == ['daily_simple_forecasts_response', 'observation_response']\", \"assert get_wea... | {
"split": "train",
"index": 72228,
"acecode_id": "bigcode_python_fns_36099",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a perfect binary tree, where each node has an additional pointer called 'next' that should be set to point to its next right node. If there is no next right node, the next pointer should be set to NULL. Write a function to populate each next pointer in the tree. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert connect(Node(1, Node(2), Node(3))).next == None\", \"assert connect(Node(1, Node(2, Node(4), Node(5)), Node(3))).next == None\", \"assert connect(Node(1)).next == None\", \"assert connect(Node(1, Node(2, Node(4), Node(5)), Node(3, Node(6), Node(7)))).right.n... | {
"split": "train",
"index": 72229,
"acecode_id": "oss_4957",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a 2D matrix representing the output of a neural network after a classification task, write a function that computes the saliency map for the input matrix. The saliency map is defined as the gradient of the maximum value in each row of the output matrix with respect to the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_saliency_map([[1, 2, 3], [4, 5, 6]], [[0.1, 0.2, 0.3], [0.4, 0.5, 0.6]]) == [[0.0, 0.0, 1.0], [0.0, 0.0, 1.0]]\", \"assert compute_saliency_map([[2, 1], [3, 4]], [[0.5, 0.5], [0.2, 0.8]]) == [[1.0, 0.0], [0.0, 1.0]]\", \"assert compute_saliency_map([... | {
"split": "train",
"index": 72230,
"acecode_id": "bigcode_python_fns_4092",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function `add_numbers(num1: int, num2: int) -> int` that takes two integers as input and returns their sum.\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 add_numbers(1, 2) == 3\", \"assert add_numbers(-1, 1) == 0\", \"assert add_numbers(0, 0) == 0\", \"assert add_numbers(100, 200) == 300\", \"assert add_numbers(-100, -200) == -300\", \"assert add_numbers(50, 50) == 100\", \"assert add_numbers(-50, 50) == 0\",... | {
"split": "train",
"index": 72231,
"acecode_id": "evol_13898",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with analyzing a list of test results. Each test result can either be a success or a failure. Implement a function that takes a list of test results and returns a message indicating whether all tests were successful. If all tests are successful, return 'All targe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_tests([True, True, True]) == 'All targets succeeded analysis'\", \"assert analyze_tests([False, True, True]) == 'Some targets failed analysis'\", \"assert analyze_tests([True, False, True]) == 'Some targets failed analysis'\", \"assert analyze_tests(... | {
"split": "train",
"index": 72232,
"acecode_id": "bigcode_python_fns_16106",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a file path in a version control system, implement a function `get_revision_number(path: str) -> int` that extracts and returns the revision number from the path. The revision number is represented as the last integer in the path. If there is no revi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_revision_number('/repo/trunk/file@42') == 42\", \"assert get_revision_number('/repo/trunk/file@1000') == 1000\", \"assert get_revision_number('/repo/trunk/dir/file@7') == 7\", \"assert get_revision_number('/repo/trunk/file@1') == 1\", \"assert get_revisi... | {
"split": "train",
"index": 72233,
"acecode_id": "bigcode_python_fns_32892",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that performs a series of arithmetic and bitwise operations on two integers. The function should accept two integers, `a` and `b`, and return a dictionary containing the results of the following operations: addition, subtraction, mult... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_operations(10, 5) == {'addition': 15, 'subtraction': 5, 'multiplication': 50, 'division': 2.0, 'bitwise_and': 0, 'bitwise_or': 15, 'bitwise_xor': 15}\", \"assert calculate_operations(0, 0) == {'addition': 0, 'subtraction': 0, 'multiplication': 0, '... | {
"split": "train",
"index": 72234,
"acecode_id": "oss_32508",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a configuration dictionary for a weather application. The configuration dictionary contains a 'name' key for the weather station name, a 'phone_id' key representing a unique identifier for a mobile device, and a 'device_id'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_weather_config({'name': 'Station1', 'phone_id': '12345', 'device_id': ['abc', 'def', 'ghi']}) == ['12345', 'abc', 'def', 'ghi']\", \"assert process_weather_config({'name': 'Station2', 'phone_id': '67890', 'device_id': []}) == ['67890']\", \"assert pr... | {
"split": "train",
"index": 72235,
"acecode_id": "bigcode_python_fns_5097",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `get_sorted_nameservers(zone: str, additional: List[str]) -> List[str]` that takes a string `zone` representing a domain zone and a list of strings `additional` representing additional nameservers. The function should return a sorted ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_sorted_nameservers('example.com', []) == ['ns1.example.com', 'ns2.example.com']\", \"assert get_sorted_nameservers('example.com', ['ns3.example.com']) == ['ns1.example.com', 'ns2.example.com', 'ns3.example.com']\", \"assert get_sorted_nameservers('demo.c... | {
"split": "train",
"index": 72236,
"acecode_id": "bigcode_python_fns_38558",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of daily death rates for multiple locations, implement a function that processes this data by calculating the natural logarithm of the death rates and the adjusted death rates for each location. The function should take a list of dictionaries, where each dictionary... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_data([{'location': 'A', 'days': 1, 'death_rate': 0.0}, {'location': 'A', 'days': 2, 'death_rate': 0.0}]) == [{'location': 'A', 'days': 1, 'death_rate': 0.0, 'ln_death_rate': None, 'adjusted_death_rate': 0.0, 'ln_adjusted_death_rate': None}, {'locatio... | {
"split": "train",
"index": 72237,
"acecode_id": "bigcode_python_fns_29817",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Design a function in Python that finds the common elements in two different sorted arrays using recursion. The function should take two sorted lists as input and return a list of common elements. You are not allowed to use any built-in methods or explicit loops (for/while) for ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert common_elements([], []) == []\", \"assert common_elements([1, 2, 3], []) == []\", \"assert common_elements([], [1, 2, 3]) == []\", \"assert common_elements([1, 2, 3], [4, 5, 6]) == []\", \"assert common_elements([1, 2, 2, 3], [2, 2, 3, 4]) == [2, 2, 3]\", \"... | {
"split": "train",
"index": 72238,
"acecode_id": "evol_6128",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating command-line instructions for running multiple experiments with varying parameters. Given a dictionary of experiments, where each experiment has its own set of parameters, and a list of integer seeds for random number generation, your goal is to c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert make_commands({'experiment1': {'param1': 10, 'param2': 20}, 'experiment2': {'param1': 30, 'param2': 40}}, [0, 1, 2]) == ['run_experiment.py --param1 10 --param2 20 --seed 0', 'run_experiment.py --param1 10 --param2 20 --seed 1', 'run_experiment.py --param1 1... | {
"split": "train",
"index": 72239,
"acecode_id": "oss_15673",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers, implement a function `multiply(lst1, lst2)` that calculates and returns a tuple of four values: the product of odd numbers at even indices in `lst1`, the product of even numbers at odd indices in `lst2`, the sum of even numbers in `lst1`, and the su... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multiply([1, 2, 3, 4, 5], [6, 7, 8, 9, 10]) == (15, 0, 6, 16)\", \"assert multiply([2, 4, 6], [1, 3, 5]) == (1, 0, 12, 9)\", \"assert multiply([1, 2, 3, 4], [5, 6, 7, 8]) == (3, 48, 6, 12)\", \"assert multiply([1], [2]) == (1, 0, 0, 0)\", \"assert multiply([... | {
"split": "train",
"index": 72240,
"acecode_id": "evol_18671",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given a year and a month, implement a function `get_days_in_month(year: int, month: int) -> int` that returns the number of days in that month for the given year. The function should handle the leap year for February correctly. If the month is not between 1 and 12, return -1.\n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_days_in_month(2020, 2) == 29\", \"assert get_days_in_month(2021, 2) == 28\", \"assert get_days_in_month(1900, 2) == 28\", \"assert get_days_in_month(2000, 2) == 29\", \"assert get_days_in_month(2021, 4) == 30\", \"assert get_days_in_month(2021, 1) == 31\... | {
"split": "train",
"index": 72241,
"acecode_id": "evol_3645",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of product prices, write a function that identifies and fixes erroneous price entries (e.g., negative values and values that are unusually high compared to the rest of the list). The function should replace these erroneous prices with the mean of the valid prices a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fix_prices([-10, -20, -30]) == 0.0\", \"assert fix_prices([1, 2, 3, 4, 5]) == 3.0\", \"assert fix_prices([15, 25, 35, 45, 55]) == 35.0\", \"assert fix_prices([0, 10, 20, 30, 40, 50]) == 30.0\", \"assert fix_prices([1, 2, 3, 4, 5, 100]) == 3.0\", \"assert fix... | {
"split": "train",
"index": 72242,
"acecode_id": "evol_18954",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple inventory management system for a small store. The system will allow you to manage items in the inventory which includes creating, fetching, updating, and deleting items. Each item has a unique ID, a name, a description, a quantity, and a p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_inventory(['ADD Apple Fresh red apple 10 0.5', 'ADD Banana Yellow banana 5 0.3', 'UPDATE 1 Apple Crispy red apple 15 0.6', 'DELETE 2']) == [{'id': 1, 'name': 'Apple', 'description': 'Crispy red apple', 'quantity': 15, 'price': 0.6}]\", \"assert manage... | {
"split": "train",
"index": 72243,
"acecode_id": "bigcode_python_fns_3787",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings representing lines of text and an integer representing the number of spaces for indentation, return a list of lines where each line has been stripped of the specified number of leading spaces if it has that much indentation. If a line is blank, it should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert strip_indentation(2, [' line1', ' line2', 'line3', ' ', ' line4']) == ['line1', 'line2', '']\", \"assert strip_indentation(4, [' line1', ' line2', 'line3', ' ', ' line4']) == ['line1', 'line2', '']\", \"assert strip_indentation(5, [' line1', ... | {
"split": "train",
"index": 72244,
"acecode_id": "bigcode_python_fns_28582",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Create a function that takes two numbers and a string representing a mathematical operation. The function should perform the operation on the two numbers and return the result. If the inputs are not valid numbers or if the operation is not one of the allowed operators ('+', '-'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate(5, 9, '+') == 14\", \"assert calculate(10, 3, '-') == 7\", \"assert calculate(4, 5, '*') == 20\", \"assert calculate(16, 4, '/') == 4\", \"assert calculate(5.5, 2.2, '-') == 3.3\", \"assert calculate(10, 2, '/') == 5\", \"assert calculate(7, 3, '*'... | {
"split": "train",
"index": 72245,
"acecode_id": "evol_22971",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the cumulative product of all odd integers within a specified range of consecutive numbers, from n to m (inclusive). The function should take two integers n and m as inputs, where n is less than or equal to m. Return the cumulative product o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert odd_product(1, 5) == 15\", \"assert odd_product(3, 7) == 105\", \"assert odd_product(2, 2) == 1\", \"assert odd_product(1, 1) == 1\", \"assert odd_product(0, 10) == 945\", \"assert odd_product(10, 10) == 1\", \"assert odd_product(11, 13) == 143\", \"assert o... | {
"split": "train",
"index": 72246,
"acecode_id": "evol_28798",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing a flat graph, where each key is a node ID (a string), and each value is another dictionary containing information about the node. One of the attributes in the node dictionary can be `result`, which is a boolean indicating whether the node... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_result_node({'A': {'result': True}, 'B': {'result': False}}) == ('A', {'result': True})\", \"assert find_result_node({'A': {'result': False}, 'B': {'result': False}, 'C': {'result': True}}) == ('C', {'result': True})\", \"assert find_result_node({'1': {... | {
"split": "train",
"index": 72247,
"acecode_id": "bigcode_python_fns_26450",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the distance of a point from the origin in a 3D space. The point is represented by a tuple of three values (x, y, z), where x, y, and z are the respective coordinates along the x-axis, y-axis, and z-axis. Your objectiv... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_distance_from_origin((0, 0, 0)) == 0.0\", \"assert calculate_distance_from_origin((1, 1, 1)) == 1.7320508075688772\", \"assert calculate_distance_from_origin((3, 4, 0)) == 5.0\", \"assert calculate_distance_from_origin((5, 12, 0)) == 13.0\", \"asse... | {
"split": "train",
"index": 72248,
"acecode_id": "oss_17490",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an iterator that can potentially raise a StopIteration exception when there are no more items to return. Your task is to implement a function `next_item(iterator)` that safely retrieves the next item from the iterator. If the iterator is exhausted and raises a Sto... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert next_item(iter([1, 2, 3])) == 1\", \"assert next_item(iter([])) == 'Iterator has been exhausted.'\", \"assert next_item(iter(['a', 'b', 'c'])) == 'a'\", \"assert next_item(iter([])) == 'Iterator has been exhausted.'\", \"assert next_item(iter(range(5))) == 0... | {
"split": "train",
"index": 72249,
"acecode_id": "bigcode_python_fns_32368",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a binary expression tree representing an arithmetic expression, implement a function to evaluate the expression. The tree nodes contain either integer values or operators (+, -, *, /). The function should return the result of the arithmetic expression as an integer. The i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate(Node('+', Node('2'), Node('3'))) == 5\", \"assert evaluate(Node('*', Node('2'), Node('3'))) == 6\", \"assert evaluate(Node('-', Node('5'), Node('2'))) == 3\", \"assert evaluate(Node('/', Node('6'), Node('2'))) == 3\", \"assert evaluate(Node('+', Nod... | {
"split": "train",
"index": 72250,
"acecode_id": "evol_11559",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two integer values, a and b, implement a function that returns the product of these two numbers. The function should take two parameters, a and b, and return their multiplication. Assume that both a and b are within the range of -10^6 to 10^6.\nPlease reason step by step,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert example_function_with_shape(2, 3) == 6\", \"assert example_function_with_shape(-1, 1) == -1\", \"assert example_function_with_shape(0, 5) == 0\", \"assert example_function_with_shape(10, -10) == -100\", \"assert example_function_with_shape(-10, -10) == 100\"... | {
"split": "train",
"index": 72251,
"acecode_id": "bigcode_python_fns_35034",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that returns the first 5 even-indexed elements of the list. If the list has fewer than 5 elements, return all of them. Additionally, if the list contains fewer than 5 even-indexed elements, return all the available even-indexed ele... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert print_even_indexed_elements([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) == [0, 2, 4, 6, 8]\", \"assert print_even_indexed_elements([10]) == [10]\", \"assert print_even_indexed_elements([]) == []\", \"assert print_even_indexed_elements([2, 4, 6, 8, 10, 12]) == [2, 6, 10]... | {
"split": "train",
"index": 72252,
"acecode_id": "evol_5128",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a user's search query and generates a list of articles based on that query. Each article should have a unique identifier, a title, and a brief content description. Your function should take a string representing the use... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_search_query('Hello world') == [{'id': 'article_1', 'title': 'Article 1', 'content': 'Content for article 1'}, {'id': 'article_2', 'title': 'Article 2', 'content': 'Content for article 2'}]\", \"assert process_search_query('Python programming') == [{... | {
"split": "train",
"index": 72253,
"acecode_id": "oss_3362",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Develop a function that takes in three strings and returns a tuple containing the number of unique characters in each string. The function should ignore spaces and consider all other characters for uniqueness.\nPlease reason step by step, then write a self-contained Python solu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_characters('abcdefgh', 'ijklmnop', 'qrstuvwx') == (8, 8, 8)\", \"assert unique_characters('', '', '') == (0, 0, 0)\", \"assert unique_characters('1234567890', '0987654321', '1122334455') == (10, 10, 5)\", \"assert unique_characters('abcd1234', 'efgh56... | {
"split": "train",
"index": 72254,
"acecode_id": "evol_12936",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the scores of multiple students in a class. Your task is to write a function `calculate_average(scores: List[int]) -> float` that returns the average score of the students rounded to two decimal places. If the list is empty, the fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average([100, 90, 80, 70]) == 85.0\", \"assert calculate_average([60, 75, 90, 100, 50]) == 75.0\", \"assert calculate_average([]) == 0.0\", \"assert calculate_average([0, 0, 0]) == 0.0\", \"assert calculate_average([100]) == 100.0\", \"assert calcu... | {
"split": "train",
"index": 72255,
"acecode_id": "bigcode_python_fns_42104",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates responses based on specific input messages. Implement a function `generate_response(message: str) -> str` that takes a string message as input and returns a predefined response based on the content of the message. If the me... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_response('Bye') == 'Goodbye!'\", \"assert generate_response('Help') == 'How can I help you?'\", \"assert generate_response('Thanks') == 'You are welcome!'\", \"assert generate_response('Hello') == 'Sorry, I didn\\u2019t understand that.'\", \"assert... | {
"split": "train",
"index": 72256,
"acecode_id": "evol_6151",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of organizations, each represented by a dictionary containing an 'id' and 'name'. Write a function `get_organization_by_id(orgs: List[Dict[str, Union[int, str]]], org_id: int) -> Dict[str, Union[int, str]]` that retrieves the organization with the given 'or... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_organization_by_id([{'id': 1, 'name': 'Org A'}, {'id': 2, 'name': 'Org B'}], 1) == {'id': 1, 'name': 'Org A'}\", \"assert get_organization_by_id([{'id': 1, 'name': 'Org A'}, {'id': 2, 'name': 'Org B'}], 2) == {'id': 2, 'name': 'Org B'}\", \"assert get_or... | {
"split": "train",
"index": 72257,
"acecode_id": "bigcode_python_fns_33372",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that selects a subset of non-dominated solutions based on a specified algorithm for multi-objective optimization. Write a function `multi_objective_optimization` that takes in the following parameters: \n- `Y_nondominated`: a list of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multi_objective_optimization([[1, 2], [3, 4], [5, 0]], 2, 'NSGA-II') == [[1, 2], [3, 4]]\", \"assert multi_objective_optimization([[10, 2], [30, 4], [50, 0]], 2, 'NSGA-II') == [[10, 2], [30, 4]]\", \"assert multi_objective_optimization([[5, 5], [6, 6], [7, 7... | {
"split": "train",
"index": 72258,
"acecode_id": "oss_1897",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a list of positive integers and classifies them into three categories: perfect squares, perfect cubes, and prime numbers. The function should return three separate lists: one for perfect squares, one for perfect cubes, and one for prime numbers. For ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert classify_numbers([2, 3, 4, 5, 6]) == ([4], [], [2, 3, 5])\", \"assert classify_numbers([10, 15, 20, 25, 30]) == ([25], [], [])\", \"assert classify_numbers([49, 50, 51, 52]) == ([49], [], [])\", \"assert classify_numbers([16, 18, 20, 21]) == ([16], [], [])\"... | {
"split": "train",
"index": 72259,
"acecode_id": "evol_11946",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `sum_of_evens(nums: List[int]) -> int` that returns the sum of all even numbers in the list. If there are no even numbers, return 0. The function should handle both positive and negative integers.\nPlease reason step by step, then writ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([10, 21, 32, 43, 54]) == 96\", \"assert sum_of_evens([-2, -4, 1, 3]) == -6\", \"assert sum_of_evens([]) == 0\", \"assert sum_of_evens([1, 3, 5]) == 0\", \"assert sum_of_evens([0, 0, 0]) == 0\", \"as... | {
"split": "train",
"index": 72260,
"acecode_id": "bigcode_python_fns_2654",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of integers and a target integer. The function should return a new list where each integer is replaced by their difference from the target integer. For example, if the target is 5 and the input list is [3, 7, 1], the out... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert difference_from_target([3, 7, 1], 5) == [2, -2, 4]\", \"assert difference_from_target([0, 0, 0], 0) == [0, 0, 0]\", \"assert difference_from_target([5, 5, 5], 5) == [0, 0, 0]\", \"assert difference_from_target([1, 2, 3, 4, 5], 3) == [2, 1, 0, -1, -2]\", \"as... | {
"split": "train",
"index": 72261,
"acecode_id": "bigcode_python_fns_1557",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of weather records, where each record is a dictionary containing information about a weather station. Each dictionary has the following keys: 'station', 'latitude', 'longitude', 'visibility', 'windspeed', and 'precipitation'. Your task is to implement a fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_weather_records([{'station': 'A', 'latitude': '34.05', 'longitude': '-118.25', 'visibility': '10', 'windspeed': '5', 'precipitation': '0'}, {'station': 'B', 'latitude': '40.71', 'longitude': '-74.01', 'visibility': '8', 'windspeed': '', 'precipitation... | {
"split": "train",
"index": 72262,
"acecode_id": "bigcode_python_fns_39217",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings representing the output from samtools mpileup, count the number of reads at each position supporting the reference allele and the number supporting a non-reference allele. Each string in the list is formatted as 'chromosome position coverage'. Write a fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_reads(['chr1 100 5', 'chr1 101 3', 'chr2 150 10']) == [('chr1', 100, 5), ('chr1', 101, 3), ('chr2', 150, 10)]\", \"assert count_reads(['chr2 200 8', 'chr2 200 12', 'chr1 300 4']) == [('chr2', 200, 8), ('chr2', 200, 12), ('chr1', 300, 4)]\", \"assert co... | {
"split": "train",
"index": 72263,
"acecode_id": "bigcode_python_fns_8435",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing different memory devices and their specifications. Each device is identified by a unique string key, and the corresponding value is another dictionary containing the following attributes: `page_size`, `max_clock`, `write_cycle`, `capacity... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_memory_devices({'A': {'page_size': 64, 'write_cycle': 0.005, 'capacity': 1024, 'bitmask': '01'}, 'B': {'page_size': 128, 'write_cycle': 0.002, 'capacity': 2048, 'bitmask': '01'}}, 64, 0.005, 1024, '01') == ['A', 'B']\", \"assert find_memory_devices({'A'... | {
"split": "train",
"index": 72264,
"acecode_id": "oss_24179",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function `make_palindrome(string: str) -> str` that takes a string input and generates the shortest palindrome by using the provided string as a prefix. The function should ignore case and non-alphanumeric characters when determining the palindrome. The output shoul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert make_palindrome('') == ''\", \"assert make_palindrome('cat') == 'catac'\", \"assert make_palindrome('cata') == 'catac'\", \"assert make_palindrome('race') == 'racecar'\", \"assert make_palindrome('hello') == 'hellolleh'\", \"assert make_palindrome('123') == ... | {
"split": "train",
"index": 72265,
"acecode_id": "evol_7008",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes in four integer parameters: red (r), green (g), blue (b), and an optional alpha (a) value which defaults to 1.0. The function should return a tuple representing the normalized RGB color values, where each value is in the range ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_rgb_color(0, 0, 0) == (0.0, 0.0, 0.0, 1.0)\", \"assert set_rgb_color(255, 255, 255) == (1.0, 1.0, 1.0, 1.0)\", \"assert set_rgb_color(-1, 100, 200) == (0.0, 0.39215686274509803, 0.7843137254901961, 1.0)\", \"assert set_rgb_color(100, 256, 200) == (0.3921... | {
"split": "train",
"index": 72266,
"acecode_id": "bigcode_python_fns_42621",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that retrieves a stored message from a message container. The function should accept a string input as the message and return that same message when called. Implement the function `get_message(message: str) -> str`, where `message` is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_message('Hello, World!') == 'Hello, World!'\", \"assert get_message('LeetCode is fun!') == 'LeetCode is fun!'\", \"assert get_message('Python programming') == 'Python programming'\", \"assert get_message('') == ''\", \"assert get_message('12345') == '123... | {
"split": "train",
"index": 72267,
"acecode_id": "oss_13197",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `fuzzy_equal` that determines if two floating-point numbers are considered 'fuzzy equal' within a specified threshold. The function should take three parameters: a floating-point number `a`, a floating-point number `b`, and a positive floating-point ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fuzzy_equal(1.0, 1.0, 0.1) == True\", \"assert fuzzy_equal(1.0, 1.1, 0.2) == True\", \"assert fuzzy_equal(-1.0, -1.0, 0.5) == True\", \"assert fuzzy_equal(-1.0, -1.3, 0.3) == False\", \"assert fuzzy_equal(0.0, 0.0, 0.1) == True\", \"assert fuzzy_equal(1.5, 1... | {
"split": "train",
"index": 72268,
"acecode_id": "oss_25532",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating a sequence of text based on given input sequences. Implement a function `generate_text(inputs: List[str], sequence_length: int, batch_size: int) -> List[str]` that takes a list of input sequences and generates a specified number of text sequences ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_text(['hello', 'world'], 5, 2) == ['hello', 'world']\", \"assert generate_text(['short'], 3, 1) == ['sho']\", \"assert generate_text(['text', 'input'], 8, 2) == ['texttext', 'inputinp']\", \"assert generate_text([], 5, 1) == []\", \"assert generate_... | {
"split": "train",
"index": 72269,
"acecode_id": "oss_24429",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `remove_even_numbers()` that takes no parameters and performs the following operations: 1. Create a list of integers from 1 to 10 (inclusive). 2. Remove all even numbers from the list. 3. Return the modified list containing only the o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_even_numbers() == [1, 3, 5, 7, 9]\", \"assert remove_even_numbers() == [1, 3, 5, 7, 9]\", \"assert remove_even_numbers() == [1, 3, 5, 7, 9]\", \"assert remove_even_numbers() == [1, 3, 5, 7, 9]\", \"assert remove_even_numbers() == [1, 3, 5, 7, 9]\", \"... | {
"split": "train",
"index": 72270,
"acecode_id": "oss_4971",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `create_graph` that takes in a variable number of keyword arguments representing the attributes of a graph plot. The function should return a dictionary that represents a graph plot with the given attributes. Each attribute should be a ke... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_graph() == {}\", \"assert create_graph(title='My Graph') == {'title': 'My Graph'}\", \"assert create_graph(x_label='X-axis', y_label='Y-axis') == {'x_label': 'X-axis', 'y_label': 'Y-axis'}\", \"assert create_graph(color='blue', width=2) == {'color': '... | {
"split": "train",
"index": 72271,
"acecode_id": "bigcode_python_fns_46451",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to validate and process dataset information in a data management system. The system has a predefined dictionary `DATAWORLD_DATASETS` that contains information about different datasets. Each dataset is represented by a key-value pair, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_dataset_info('scrub', 'DATASET_OWNER') == 'THE_PUBLIC_DATASET_YOU_WANT_TO_PUSH_TO'\", \"assert validate_dataset_info('raw', 'DATASET_OWNER') == 'THE_PRIVATE_DATASET_YOU_WANT_TO_PUSH_TO'\", \"assert validate_dataset_info('scrub', 'DATASET_OWNER') == ... | {
"split": "train",
"index": 72272,
"acecode_id": "oss_26816",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing a list of file formats to determine how many unknown formats are present. Implement a function `update_unknown_format_count(formats: List[str]) -> int` that takes a list of file formats as input and returns the count of unknown formats. An unknown... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_unknown_format_count(['csv', 'json', 'xml']) == 0\", \"assert update_unknown_format_count(['txt', 'xls']) == 2\", \"assert update_unknown_format_count(['csv', 'json', 'xml', 'csv']) == 0\", \"assert update_unknown_format_count(['pdf', 'docx', 'csv']) ... | {
"split": "train",
"index": 72273,
"acecode_id": "oss_29864",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that receives a list of medication names, each associated with a dosage amount. Your function should return a dictionary where the keys are the medication names and the values are the dosages. If a medication appears multiple times in the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_medication_dosage([('Aspirin', 100.0), ('Ibuprofen', 200.0), ('Aspirin', 150.0)]) == {'Aspirin': 250.0, 'Ibuprofen': 200.0}\", \"assert get_medication_dosage([('Paracetamol', 500.0), ('Paracetamol', 200.0), ('Ibuprofen', 300.0), ('Aspirin', 100.0)]) == {... | {
"split": "train",
"index": 72274,
"acecode_id": "bigcode_python_fns_21802",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks if a given string is a valid abbreviation of another string. An abbreviation is valid if it can be transformed into the original string by replacing the numeric values in the abbreviation with the corresponding number of c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_abbreviation('hello', 'h3o') == True\", \"assert is_valid_abbreviation('internationalization', 'i18n') == True\", \"assert is_valid_abbreviation('abbreviation', 'a10n') == True\", \"assert is_valid_abbreviation('a', 'a') == True\", \"assert is_valid... | {
"split": "train",
"index": 72275,
"acecode_id": "bigcode_python_fns_17671",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing HTML content. Your task is to write a function that extracts all valid links from this HTML content that end with a specified file type (e.g., '.pdf', '.html', '.txt'). The function should return a list of these links. You may assume that the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_links('<a href=\\\"file.pdf\\\">PDF</a>', '.pdf') == ['file.pdf']\", \"assert extract_links('<a href=\\\"image.jpg\\\">Image</a><a href=\\\"document.txt\\\">Text</a>', '.txt') == ['document.txt']\", \"assert extract_links('<a href=\\\"page.html\\\">P... | {
"split": "train",
"index": 72276,
"acecode_id": "oss_1591",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that logs progress messages based on specific conditions. Implement the function `log_progress(is_first_update: bool, total: int, current: int, message: str) -> str` that returns a log message if certain criteria are met. The function will... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_progress(True, 1700, 399, 'issues') == 'processed 400 of 1700 issues'\", \"assert log_progress(True, 1700, 799, 'PRs') == 'processed 800 of 1700 PRs'\", \"assert log_progress(True, 2000, 1599, 'PRs') == 'processed 1600 of 2000 PRs'\", \"assert log_progre... | {
"split": "train",
"index": 72277,
"acecode_id": "bigcode_python_fns_28643",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `lcm_of_primes(limit: int) -> int` that calculates the least common multiple (LCM) of all prime numbers up to a specified limit. The function should return the LCM of all prime numbers less than or equal to the given limit.\nPlease reason step by step, then... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lcm_of_primes(1) == 1\", \"assert lcm_of_primes(2) == 2\", \"assert lcm_of_primes(3) == 6\", \"assert lcm_of_primes(4) == 6\", \"assert lcm_of_primes(5) == 30\", \"assert lcm_of_primes(15) == 30030\", \"assert lcm_of_primes(5) == 30\", \"assert lcm_of_primes... | {
"split": "train",
"index": 72278,
"acecode_id": "evol_2685",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers and a target integer as input and returns a list of pairs of indices (i, j) such that the numbers at those indices add up to the target integer. Each pair should be unique, and the order of indices in the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_pairs([1, 2, 3, 4], 7) == [(2, 3)]\", \"assert find_pairs([], 0) == []\", \"assert find_pairs([1, 2, 3], 6) == []\", \"assert find_pairs([1, 2, 3, 4, 5], 10) == []\", \"assert find_pairs([1, 2, 3, 4, 5, 6, 7, 8, 9], 20) == []\"]}"
} | {
"split": "train",
"index": 72279,
"acecode_id": "bigcode_python_fns_49532",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a URL routing system for a web application. Given a list of URL patterns, each represented as a tuple containing a regular expression pattern and a name for the URL pattern, create a function that takes a URL and matches it to the corresponding ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert match_url([(r'^show/$', 'carton-tests-show'), (r'^add/$', 'carton-tests-add')], '/remove/') == 'Not Found'\", \"assert match_url([(r'^remove/$', 'carton-tests-remove'), (r'^clear/$', 'carton-tests-clear')], '/notfound/') == 'Not Found'\", \"assert match_url(... | {
"split": "train",
"index": 72280,
"acecode_id": "oss_1128",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a database query and a list of parameters to be used in that query. Your task is to implement a function that simulates executing the query with the provided parameters. The function should return True if the simulation is successful (i.e., t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_query_execution('SELECT * FROM users WHERE id = %s', ['1']) == True\", \"assert simulate_query_execution('INSERT INTO users (name, age) VALUES (%s, %s)', ['Alice', '30']) == True\", \"assert simulate_query_execution('DELETE FROM users WHERE id = %s'... | {
"split": "train",
"index": 72281,
"acecode_id": "bigcode_python_fns_3765",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `char_count(string: str) -> dict` that takes an ASCII string as input and returns a dictionary where each distinct character in the string is a key, and the corresponding value is the number of times that character appears in the string. The function should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert char_count('Hello') == {'H': 1, 'e': 1, 'l': 2, 'o': 1}\", \"assert char_count('aaaa') == {'a': 4}\", \"assert char_count('') == {}\", \"assert char_count('abcABC') == {'a': 1, 'b': 1, 'c': 1, 'A': 1, 'B': 1, 'C': 1}\", \"assert char_count('123abcABC') == {'... | {
"split": "train",
"index": 72282,
"acecode_id": "evol_34803",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a configuration dictionary `site_config` which contains two keys: 'series_posts' and 'categories'. The 'series_posts' key maps to a list of tuples, where each tuple contains a category (string), a post name (string), and a page URL (string). The 'categories' key m... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert render_series_fragment({'series_posts': [('Tech', '2023-10-01-post1.md', 'url1'), ('Tech', '2023-10-02-post2.md', 'url2')], 'categories': {'Tech': ['post1', 'post2', 'post3', 'post4', 'post5', 'post6', 'post7', 'post8', 'post9', 'post10', 'post11']}}) == '<d... | {
"split": "train",
"index": 72283,
"acecode_id": "bigcode_python_fns_29729",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a series of transactions for multiple bank accounts. Each transaction is represented as a tuple containing an account number, an operation type (either 'Deposit' or 'Withdrawal'), and an operation value. Your function s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert account_transactions([(1, 'Deposit', -10), (2, 'Deposit', -5)]) == 'Invalid operation encountered.'\", \"assert account_transactions([(1, 'Withdrawal', 1)]) == 'Invalid operation encountered.'\", \"assert account_transactions([(1, 'Deposit', 5), (2, 'Withdra... | {
"split": "train",
"index": 72284,
"acecode_id": "evol_7910",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers, `firsts` and `others`, representing the pregnancy lengths in weeks of two groups of women, write a function `calculate_mean_difference(firsts: List[int], others: List[int]) -> float` that returns the difference between the mean pregnancy length of t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_mean_difference([], [38, 37, 36]) == 0.0\", \"assert calculate_mean_difference([40], [38]) == 2.0\", \"assert calculate_mean_difference([35, 36, 37], [40, 41, 42]) == -5.0\", \"assert calculate_mean_difference([40, 41, 39, 38], [36, 37]) == 3.0\", ... | {
"split": "train",
"index": 72285,
"acecode_id": "bigcode_python_fns_31923",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the total cost of a service after applying tax. The function should take the initial cost of the service and a tax rate as inputs, and return the total cost after tax. The tax is calculated as a percentage of the initi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_cost(100, 0.1) == 110.0\", \"assert calculate_total_cost(200, 0.15) == 230.0\", \"assert calculate_total_cost(0, 0.2) == 0.0\", \"assert calculate_total_cost(50, 0.05) == 52.5\", \"assert calculate_total_cost(75, 0.2) == 90.0\", \"assert calc... | {
"split": "train",
"index": 72286,
"acecode_id": "oss_12969",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing a queue of tasks. Your task is to 'flush' this queue, which means you need to return an empty list after removing all the elements from it. Implement a function that takes a list of integers as input and returns an empty list. The i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert flush_queue([1, 2, 3]) == []\", \"assert flush_queue([-1, -2, -3]) == []\", \"assert flush_queue([0]) == []\", \"assert flush_queue([]) == []\", \"assert flush_queue([10, 20, 30, 40, 50]) == []\", \"assert flush_queue([-10, 0, 10]) == []\", \"assert flush_qu... | {
"split": "train",
"index": 72287,
"acecode_id": "bigcode_python_fns_19780",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that determines whether a given list of integers is strictly ascending. If the list is strictly ascending, return 'Sequence strictly ascends'. If it is not, identify and return any local minima or maxima in the sequence as tuples in the form (index, value),... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_sequence([]) == 'Sequence not long enough'\", \"assert check_sequence([5]) == 'Sequence not long enough'\", \"assert check_sequence([1, 2, 3, 4, 5]) == 'Sequence strictly ascends'\", \"assert check_sequence([10, 20, 30, 40]) == 'Sequence strictly ascen... | {
"split": "train",
"index": 72288,
"acecode_id": "evol_6866",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a list of measurements represented as tuples, where each tuple consists of three elements: 'smiles' (a string), 'solvent' (a string), and 'peakwavs' (a float representing the peak wavelength). Your task is to aggregate duplicate measurements for each unique combin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert aggregate_measurements([('C1=CC=CC=C1', 'water', 450.0)], 5) == [('C1=CC=CC=C1', 'water', 450.0)]\", \"assert aggregate_measurements([('C1=CC=CC=C1', 'water', 450.0), ('C1=CC=CC=C1', 'water', 450.0)], 5) == [('C1=CC=CC=C1', 'water', 450.0)]\", \"assert aggre... | {
"split": "train",
"index": 72289,
"acecode_id": "bigcode_python_fns_33193",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a list of gene information and a list of atypical gene indicators, your task is to extract the names of atypical genes based on specific criteria. Each gene entry in the input list is a string formatted as follows: '<strand> <start_position> <end_position> <protein_id> <t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_atypical_genes(['+ 1 100 prot1 CDS 2', '+ 101 200 prot2 CDS 1', '- 201 300 prot3 CDS 2'], ['+ 1 100', '- 201 300']) == ['prot1', 'prot3']\", \"assert extract_atypical_genes(['+ 1 100 prot1 CDS 1', '+ 101 200 prot2 CDS 2', '+ 201 300 prot3 CDS 2'], ['... | {
"split": "train",
"index": 72290,
"acecode_id": "bigcode_python_fns_9245",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of celestial objects, each defined by their right ascension (ra), declination (dec), distance (d in Mpc), and distance error (e_d), write a function that filters out objects based on a specified maximum distance. The function should return a list of tuples containi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_celestial_objects([(10.0, 20.0, 1.0, 0.1), (15.0, 25.0, 2.0, 0.2), (20.0, 30.0, 3.0, 0.3)], 2.0) == [(10.0, 20.0, 1.0), (15.0, 25.0, 2.0)]\", \"assert filter_celestial_objects([(30.0, 40.0, 5.0, 0.5), (35.0, 45.0, 4.0, 0.4), (40.0, 50.0, 6.0, 0.6)], 5... | {
"split": "train",
"index": 72291,
"acecode_id": "bigcode_python_fns_36825",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that retrieves a specific class alias from a predefined set of aliases. The function will take a string input, 'alias', which can be one of the following values: 'DSC', 'DSK', or 'DSA'. If the input does not match any of these values,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_class_name('DSC') == 'DataSourceClient'\", \"assert get_class_name('DSK') == 'DataSourceKey'\", \"assert get_class_name('DSA') == 'DataSourceAlias'\", \"assert get_class_name('INVALID_ALIAS') == None\", \"assert get_class_name('') == None\", \"assert get... | {
"split": "train",
"index": 72292,
"acecode_id": "bigcode_python_fns_29054",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of sentences, and you need to implement a function `word_frequency` that processes this list and returns a dictionary containing the frequency of each unique alphanumeric word, ignoring case sensitivity and excluding certain common English stop words. The f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert word_frequency(['The sun is shining.', 'Shining bright like a diamond.']) == {'sun': 1, 'shining': 2, 'bright': 1, 'like': 1, 'diamond': 1}\", \"assert word_frequency(['Hello world!', 'Hello again, world.']) == {'hello': 2, 'world': 2, 'again': 1}\", \"asser... | {
"split": "train",
"index": 72293,
"acecode_id": "oss_24783",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given two floating-point numbers representing intervals in degrees between parallels (dpar) and meridians (dmer), and a string representing the coordinate system (coord), write a function that returns a string describing the graticule configuration. The function should follow t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert graticule(10.0, 15.0, 'E') == 'Graticule: Parallels every 10.0 degrees, Meridians every 15.0 degrees, using E coordinate system.'\", \"assert graticule(5.0, 20.0, 'G') == 'Graticule: Parallels every 5.0 degrees, Meridians every 20.0 degrees, using G coordina... | {
"split": "train",
"index": 72294,
"acecode_id": "bigcode_python_fns_27262",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that divides each element in the list by a given scalar value. The function should take two parameters: a list of integers and a scalar (which can be an integer or a float). The function should return a new list containing the results ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert divide_elements([10, 20, 30], 2) == [5.0, 10.0, 15.0]\", \"assert divide_elements([100, 200, 300], 10) == [10.0, 20.0, 30.0]\", \"assert divide_elements([5, 10, 15], 0) == []\", \"assert divide_elements([-10, -20, -30], 2) == [-5.0, -10.0, -15.0]\", \"assert... | {
"split": "train",
"index": 72295,
"acecode_id": "bigcode_python_fns_21537",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with designing a simple social media post system. Each post can have a unique identifier, content, and a timestamp for when it was created. You need to implement a function that takes a list of posts represented as dictionaries, each containing 'id', 'content', a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_posts([{'id': 1, 'content': 'Hello World', 'created_at': '2023-10-01T12:00:00Z'}, {'id': 2, 'content': 'Goodbye World', 'created_at': '2023-10-02T12:00:00Z'}]) == [{'id': 1, 'content': 'Hello World', 'created_at': '2023-10-01T12:00:00Z'}, {'id': 2, 'con... | {
"split": "train",
"index": 72296,
"acecode_id": "oss_14662",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of integers and reverses the order of the elements in the list without using any built-in reverse methods or functions. The function should modify the list in place and return the reversed list.\nPlease reason step by step, then write a se... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_array([1, 2, 3, 4, 5]) == [5, 4, 3, 2, 1]\", \"assert reverse_array([10, 20, 30]) == [30, 20, 10]\", \"assert reverse_array([7]) == [7]\", \"assert reverse_array([]) == []\", \"assert reverse_array([-1, -2, -3, -4]) == [-4, -3, -2, -1]\", \"assert re... | {
"split": "train",
"index": 72297,
"acecode_id": "evol_29493",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of command line arguments as strings. Your task is to parse these arguments and return a dictionary that maps each argument to its value. The arguments can be of the following types: \n\n1. A flag argument that starts with '--' and does not have a value (e.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_arguments(['--config', '--pretrain_url', 'http://example.com/model']) == {'config': True, 'pretrain_url': 'http://example.com/model'}\", \"assert parse_arguments(['--config', '--pretrain_fpath', '/path/to/model', '--device']) == {'config': True, 'pretr... | {
"split": "train",
"index": 72298,
"acecode_id": "bigcode_python_fns_31590",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that extracts the class name from a given string representing a module and class in the format 'module_name.class_name'. Write a function `extract_class_name(module_and_class_name: str) -> str` that takes a string as input and returns the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_class_name('text_recognizer.models.MLP') == 'MLP'\", \"assert extract_class_name('numpy.linalg.inv') == 'inv'\", \"assert extract_class_name('collections.Counter') == 'Counter'\", \"assert extract_class_name('os.path.join') == 'join'\", \"assert extr... | {
"split": "train",
"index": 72299,
"acecode_id": "bigcode_python_fns_6368",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.