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 2D points on a Cartesian plane, where each point is represented as a tuple (x, y). Your task is to implement a function that takes a list of points and a scaling factor as input, and returns a new list of points, where each point is scaled by the given f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert scale_points([(1, 2), (3, 4)], 2) == [(2.0, 4.0), (6.0, 8.0)]\", \"assert scale_points([(0, 0), (1, 1)], 1) == [(0.0, 0.0), (1.0, 1.0)]\", \"assert scale_points([(1, 1), (2, 2)], 0) == [(0.0, 0.0), (0.0, 0.0)]\", \"assert scale_points([(5, 6)], 3) == [(15.0,...
{ "split": "train", "index": 600, "acecode_id": "bigcode_python_fns_27694", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of items, where each item is a dictionary containing information about an audio file. The function should take the list of items as input and perform the following tasks for each item: 1. Extract the value of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_items([{'autio_title': 'song1', 'fileName': 'file1', 'downUrl': 'http://example.com/file1.mp3'}]) == None\", \"assert process_items([{'autio_title': 'song2', 'fileName': 'file2', 'downUrl': 'http://example.com/file2.wav'}]) == None\", \"assert proces...
{ "split": "train", "index": 601, "acecode_id": "oss_30271", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that filters a given string by converting all characters to uppercase. Write a function named `convert_to_uppercase` that takes a single string as input and returns the uppercase version of that string. The function should handle an e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_uppercase('hello') == 'HELLO'\", \"assert convert_to_uppercase('world') == 'WORLD'\", \"assert convert_to_uppercase('Python') == 'PYTHON'\", \"assert convert_to_uppercase('123abc!@#') == '123ABC!@#'\", \"assert convert_to_uppercase('') == ''\", \"...
{ "split": "train", "index": 602, "acecode_id": "oss_35905", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of network interfaces, write a function that returns the first valid peer address from the list. Each network interface is represented as a dictionary containing an 'attrs' key, which is a list of tuples. Each tuple contains a key-value pair. A valid peer address i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_peer_address([{ 'attrs': [('IFA_ADDRESS', '192.168.1.1')]}, {'attrs': []}, {'attrs': [('IFA_ADDRESS', '10.0.0.1')]}]) == '192.168.1.1'\", \"assert get_peer_address([{ 'attrs': []}, {'attrs': []}]) == None\", \"assert get_peer_address([{ 'attrs': [('IFA_A...
{ "split": "train", "index": 603, "acecode_id": "bigcode_python_fns_11633", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the remaining time until a specified end time. Write a Python function called `calculate_remaining_time` that takes two parameters: `current_time` (string): A string representing the current time in the format 'HH:MM:S...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_remaining_time('12:30:15', '15:45:20') == '3 hours, 15 minutes, 5 seconds'\", \"assert calculate_remaining_time('00:00:00', '01:00:00') == '1 hours, 0 minutes, 0 seconds'\", \"assert calculate_remaining_time('23:59:59', '00:00:01') == '0 hours, 0 m...
{ "split": "train", "index": 604, "acecode_id": "oss_29503", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `binary_search(arr: List[int], x: int) -> Tuple[int, int]` that performs a binary search on a sorted array `arr` to find the index of the element `x`. The function should return a tuple containing the index of `x` if found, or -1 if not found, along with th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert binary_search([10, 20, 30, 40, 50], 30) == (2, 1)\", \"assert binary_search([1, 2, 3, 4, 5], 6) == (-1, 3)\", \"assert binary_search([1, 2, 3, 4, 5], 5) == (4, 3)\", \"assert binary_search([], 1) == (-1, 0)\", \"assert binary_search([1], 1) == (0, 1)\", \"as...
{ "split": "train", "index": 605, "acecode_id": "evol_32954", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Implement a function that performs a zigzag level order traversal of a tree. The tree can either be a binary tree or an n-ary tree. The traversal should alternate the order of nodes on each level: nodes at the highest depth should be printed from left to right, the immediate lo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert zigzag_traversal(Node(1, [Node(2), Node(3), Node(4)])) == [1, 4, 3, 2]\", \"assert zigzag_traversal(Node(1, [Node(2, [Node(5), Node(6)]), Node(3), Node(4)])) == [1, 4, 3, 2, 5, 6]\", \"assert zigzag_traversal(Node(1, [])) == [1]\", \"assert zigzag_traversal(...
{ "split": "train", "index": 606, "acecode_id": "evol_34129", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a grid layout representing a window manager with multiple frames. Each frame can contain multiple clients (windows). You need to implement a function `shift_window(direction: str, current_index: str) -> str` that takes two parameters: `direction` which can be 'up'...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert shift_window('left', '11') == '01'\", \"assert shift_window('right', '11') == '21'\", \"assert shift_window('left', '21') == '11'\", \"assert shift_window('up', '00') == '00'\", \"assert shift_window('left', '00') == '00'\"]}" }
{ "split": "train", "index": 607, "acecode_id": "bigcode_python_fns_26981", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the outputs of a neural network module. Your task is to implement a function `recompute_outputs(outputs: List[int]) -> Tuple[int]` that takes in this list and applies a specific transformation to each element. The transformation is ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert recompute_outputs([3, 5, 10]) == (2, 4, 9)\", \"assert recompute_outputs([0, 1, 2]) == (-1, 0, 1)\", \"assert recompute_outputs([-1, -5, -10]) == (-2, -6, -11)\", \"assert recompute_outputs([100, 200, 300]) == (99, 199, 299)\", \"assert recompute_outputs([7]...
{ "split": "train", "index": 608, "acecode_id": "bigcode_python_fns_15041", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that returns an array filled with specific useful angle measures for trigonometric calculations. The function should return an array with the following values: [-1, -π/4, -π/6, 0, π/6, π/4, 1]. Implement a function called `fill_trigonomet...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fill_trigonometry_array() == [-1, -math.pi / 4, -math.pi / 6, 0, math.pi / 6, math.pi / 4, 1]\", \"assert fill_trigonometry_array() == [-1, -0.7853981633974483, -0.5235987755982988, 0, 0.5235987755982988, 0.7853981633974483, 1]\", \"assert fill_trigonometry_...
{ "split": "train", "index": 609, "acecode_id": "bigcode_python_fns_42698", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function named `pass_through` that takes a list of integers as input and returns the same list without any modifications. Your function should operate as follows: \n\n- Input: A list of integers, which can contain both positive and negative va...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert pass_through([1, 2, 3]) == [1, 2, 3]\", \"assert pass_through([-1, 0, 1]) == [-1, 0, 1]\", \"assert pass_through([]) == []\", \"assert pass_through([10, 20, 30, 40]) == [10, 20, 30, 40]\", \"assert pass_through([0, 0, 0]) == [0, 0, 0]\", \"assert pass_throug...
{ "split": "train", "index": 610, "acecode_id": "oss_11757", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of sentences, implement a function that dissects each sentence into separate lexical entities (words) and checks for potential errors. The function should raise an exception if any sentence is void (empty or only contains whitespace), or if it contains numbers or s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert dissect_sentences(['Hello World', 'This is a test']) == [['Hello', 'World'], ['This', 'is', 'a', 'test']]\", \"assert dissect_sentences([' Hello World ']) == [['Hello', 'World']]\", \"assert dissect_sentences(['Multiple words here']) == [['Multiple', 'w...
{ "split": "train", "index": 611, "acecode_id": "evol_1559", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are given a dictionary that contains information about a day's activities. This dictionary has the following keys: 'Prayer', 'Morning', and other time-related keys. The 'Prayer' key contains a list where the first element indicates whether a prayer was made (NaN if not). Th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert populate_day_overview({'Prayer': [float('nan')], 'Morning': [1]}, True) == (True, 1, '2023-10-01', '09:00', '17:00')\", \"assert populate_day_overview({'Prayer': [float('nan')], 'Morning': [float('nan')]}, False) == (False, None, '2023-10-01', '09:00', '17:0...
{ "split": "train", "index": 612, "acecode_id": "bigcode_python_fns_46160", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes in two strings, `old_file` and `new_file`. The function should check if the two file paths refer to the same file. If they do, return `True`. If they do not, return `False`. Additionally, if the `new_file` string is empty, the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_file_paths('path/to/old_file.txt', 'path/to/old_file.txt') == True\", \"assert check_file_paths('path/to/old_file.txt', 'path/to/new_file.txt') == False\", \"assert check_file_paths('path/to/old_file.txt', '') == False\", \"assert check_file_paths('', ...
{ "split": "train", "index": 613, "acecode_id": "bigcode_python_fns_12203", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a generator function that produces a sequence of integers starting from 0, incrementing by 1 each time it is called. Your task is to implement a function `generate_numbers(n: int, infinite: bool = False) -> Generator[int, None, None]` that takes an integer `n` and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list(generate_numbers(5, False)) == [0, 1, 2, 3, 4]\", \"assert list(generate_numbers(1, False)) == [0]\", \"assert list(generate_numbers(0, False)) == []\", \"assert list(generate_numbers(3, False)) == [0, 1, 2]\", \"assert list(generate_numbers(10, False))...
{ "split": "train", "index": 614, "acecode_id": "bigcode_python_fns_26894", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Develop a Python function that can handle operations on a simulated file storage system. The function should be able to perform the following actions: upload a file, download a file, delete a file, and list all files in the storage. The function should take in a bucket name, an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert handle_storage('my_bucket', 'file1.txt', '/path/to/file1.txt', 'upload') == 'File uploaded successfully.'\", \"assert handle_storage('my_bucket', 'file4.txt', '/path/to/file4.txt', 'upload') == 'File uploaded successfully.'\", \"assert handle_storage('my_buc...
{ "split": "train", "index": 615, "acecode_id": "evol_715", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given a list of keys and a dictionary, create a function that extracts the values corresponding to the keys from the dictionary. The function should return a new dictionary containing only the extracted key-value pairs. If a key from the list is not present in the dictionary, i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_keys(['a', 'b', 'c'], {'a': 1, 'b': 2, 'd': 4}) == {'a': 1, 'b': 2}\", \"assert extract_keys(['x', 'y', 'z'], {'a': 1, 'b': 2, 'c': 3}) == {}\", \"assert extract_keys(['a', 'b'], {'a': 10, 'c': 20}) == {'a': 10}\", \"assert extract_keys([], {'a': 1, ...
{ "split": "train", "index": 616, "acecode_id": "bigcode_python_fns_30961", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `first_distinct_char(string: str) -> int` that takes a string as input and returns the index of the first character that appears exactly once in the string. If there are no distinct characters, return -1.\nPlease reason step by step, then write a self-conta...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert first_distinct_char('googlesearch') == 4\", \"assert first_distinct_char('aabbcc') == -1\", \"assert first_distinct_char('abcdefg') == 0\", \"assert first_distinct_char('aabbc') == 4\", \"assert first_distinct_char('racecar') == 3\", \"assert first_distinct_...
{ "split": "train", "index": 617, "acecode_id": "evol_3966", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a string representing a matrix of floating-point numbers and returns the sum of each column as a list. The input string will consist of rows separated by newline characters and columns separated by commas. The functi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_columns('1.0,2.0,3.0\\\\n4.0,5.0,6.0\\\\n7.0,8.0,9.0') == [12.0, 15.0, 18.0]\", \"assert sum_columns('1.5,2.5\\\\n3.5,4.5') == [5.0, 7.0]\", \"assert sum_columns('1.0,,3.0\\\\n,5.0,6.0\\\\n7.0,,9.0') == [8.0, 5.0, 18.0]\", \"assert sum_columns('1.0,2.0\\...
{ "split": "train", "index": 618, "acecode_id": "oss_3653", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Create the shortest palindrome starting with a given string, while ignoring case and non-alphanumeric characters. The algorithm should identify the longest palindromic suffix of the given string and append the reversed prefix (that comes before the palindromic suffix) to the en...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert make_palindrome('racecar') == 'racecar'\", \"assert make_palindrome('A man, a plan, a canal: Panama') == 'A man, a plan, a canal: Panama'\", \"assert make_palindrome('') == ''\", \"assert make_palindrome('a') == 'a'\", \"assert make_palindrome('12321') == '1...
{ "split": "train", "index": 619, "acecode_id": "evol_416", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function called `moor_sailboat` that takes a sailboat's name and its current mooring state (True for moored, False for unmoored) as input. The function should toggle the state of the sailboat and return a message indicating whether the sailboat is now moored or unmo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert moor_sailboat('Wind Dancer', True) == 'The Wind Dancer sailboat is now unmoored'\", \"assert moor_sailboat('Ocean Breeze', False) == 'The Ocean Breeze sailboat is now moored'\", \"assert moor_sailboat('Sea Spirit', True) == 'The Sea Spirit sailboat is now un...
{ "split": "train", "index": 620, "acecode_id": "evol_24353", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of command-line arguments for a machine learning training job. The function should parse the input arguments and return a dictionary containing the parsed values. Each command-line argument is provided in the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_arguments(['--experiments=shuffle_mode=auto', '--machine_type=n1-standard-8']) == {'experiments': 'shuffle_mode=auto', 'machine_type': 'n1-standard-8', 'train_steps': 10000, 'eval_steps': 5000}\", \"assert parse_arguments(['--model_type=resnet', '--bat...
{ "split": "train", "index": 621, "acecode_id": "oss_13398", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function called `sort_numbers` that takes a list of integers as input and returns a new list with the integers sorted in ascending order. The input list can contain both positive and negative numbers.\nPlease reason step by step, then write a self-contained Python s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_numbers([37, -44, 24, 13, -90, 22, -85, 1]) == [-90, -85, -44, 1, 13, 22, 24, 37]\", \"assert sort_numbers([3, 1, 2]) == [1, 2, 3]\", \"assert sort_numbers([-1, -3, -2]) == [-3, -2, -1]\", \"assert sort_numbers([]) == []\", \"assert sort_numbers([5]) ==...
{ "split": "train", "index": 622, "acecode_id": "evol_34922", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `are_anagrams(string1: str, string2: str) -> bool` that determines if two given strings are anagrams of each other. An anagram is defined as a rearrangement of the characters in one string to form the other string, taking into account upper and lower case d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert are_anagrams('listen', 'silent') == True\", \"assert are_anagrams('abc', 'cba') == True\", \"assert are_anagrams('12345', '54321') == True\", \"assert are_anagrams('aabbcc', 'abcabc') == True\", \"assert are_anagrams('A', 'a') == False\", \"assert are_anagra...
{ "split": "train", "index": 623, "acecode_id": "evol_31958", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with helping a coffee shop owner manage customer satisfaction during business hours. The coffee shop is open for `n` minutes, and during each minute `i`, a certain number of customers (`customers[i]`) enter the shop. However, the owner can be moody, which affects...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_satisfied_customers([2,0,1,3,1,1,8,6], [0,1,0,1,0,1,0,1], 4, 2) == 19\", \"assert max_satisfied_customers([0,0,0,0,0], [0,0,0,0,0], 1, 1) == 0\", \"assert max_satisfied_customers([10,20,30], [0,0,0], 2, 1) == 60\", \"assert max_satisfied_customers([5,10,...
{ "split": "train", "index": 624, "acecode_id": "evol_29164", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that creates a user profile based on given attributes. The function should accept a user's password, a list of permissions, and a list of group names. The user profile should be created with the following default attributes: active st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_user_profile('mypassword', ['app.view', 'app.edit'], ['admins', 'editors']) == {'password': 'mypassword', 'permissions': ['app.view', 'app.edit'], 'groups': ['admins', 'editors'], 'is_active': True, 'is_superuser': False, 'is_staff': False}\", \"asser...
{ "split": "train", "index": 625, "acecode_id": "bigcode_python_fns_25032", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `is_valid_mac(mac: str) -> bool` that determines whether a given string is a valid MAC (Media Access Control) address. The function should validate the MAC address according to the IEEE 802 standard formats: EUI-48 (6 octets) and EUI-64 (8 octets). A valid ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_mac('00:1A:2B:3C:4D:5E') == True\", \"assert is_valid_mac('00-1A-2B-3C-4D-5E') == True\", \"assert is_valid_mac('00:1A:2B:3C:4D:5E:6F:70') == True\", \"assert is_valid_mac('00-1A-2B-3C-4D-5E-6F-70') == True\", \"assert is_valid_mac('00:1A:2B:3C:4D:5...
{ "split": "train", "index": 626, "acecode_id": "evol_33661", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a filter selection for a combo box based on a given parameter and its default value. The function should take three inputs: a string `param`, a string `default_value`, and a string `base_key`. It should return a list co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert combo_filter('color', 'red', 'primary') == ['|filters|', 'color', 'red', 'primary']\", \"assert combo_filter('size', 'medium', 'large') == ['|filters|', 'size', 'medium', 'large']\", \"assert combo_filter('shape', 'circle', 'square') == ['|filters|', 'shape'...
{ "split": "train", "index": 627, "acecode_id": "bigcode_python_fns_11915", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks if a given list of file paths adheres to the PEP8 style guide. The function should take a list of strings representing file paths and a whitelist of file paths that should be ignored. It should return True if all the files tha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_pep8(['file1.py', 'file3.py'], ['file2.py']) == False\", \"assert check_pep8(['file4.py'], []) == True\", \"assert check_pep8(['file5.py', 'file6.py', 'file7.py'], ['file6.py']) == True\", \"assert check_pep8(['file11.py'], ['file11.py']) == True\", \"...
{ "split": "train", "index": 628, "acecode_id": "bigcode_python_fns_37243", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement the quick sort algorithm in Python without using the built-in sort() function or any other sorting libraries. The function should take an unsorted array of floating point numbers and integers as input and return the sorted array. The input array can contain both posit...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert quicksort([3.2, 1.5, 4, -2, 0, 5.1, -1.5, 6, 2.3, -4]) == [-4, -2, -1.5, 0, 1.5, 2.3, 3.2, 4, 5.1, 6]\", \"assert quicksort([-5, -2, 0, 3, 1, -3, -1, 2, -4, 4.5]) == [-5, -4, -3, -2, -1, 0, 1, 2, 3, 4.5]\", \"assert quicksort([1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) ...
{ "split": "train", "index": 629, "acecode_id": "evol_20108", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a dictionary of data and inserts a predefined method into it. The method will be represented by a constant string '_INSERT'. Your function should raise an exception called 'InvalidDataError' if the input dictionary contains...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert insert_data({'key1': 'value1', 'key2': 'value2'}) == {'key1': 'value1', 'key2': 'value2', 'method': '_INSERT'}\", \"assert insert_data({'name': 'John', 'age': '30'}) == {'name': 'John', 'age': '30', 'method': '_INSERT'}\", \"assert insert_data({'a': 'apple',...
{ "split": "train", "index": 630, "acecode_id": "bigcode_python_fns_18118", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a decimal latitude and longitude, convert them into a tuple representing the degrees, minutes, and seconds format. The output should be a tuple of tuples, where the first tuple represents the latitude in the format (degrees, minutes, seconds) and the second tuple represen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_coordinates(34.0522, -118.2437) == ((34, 3, 7), (118, 14, 37))\", \"assert convert_coordinates(-34.0522, 118.2437) == ((34, 3, 7), (118, 14, 37))\", \"assert convert_coordinates(0, 0) == ((0, 0, 0), (0, 0, 0))\", \"assert convert_coordinates(-22.9068...
{ "split": "train", "index": 631, "acecode_id": "bigcode_python_fns_9920", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a Python function called `divisor_and_even_check(n)` that takes a single integer `n` as input and returns a tuple containing a list of all positive divisors of `n` and a boolean indicating whether the number of divisors is even. If `n` is less than 1, the function sho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert divisor_and_even_check(1) == ([1], False)\", \"assert divisor_and_even_check(2) == ([1, 2], True)\", \"assert divisor_and_even_check(6) == ([1, 2, 3, 6], True)\", \"assert divisor_and_even_check(8) == ([1, 2, 4, 8], True)\", \"assert divisor_and_even_check(9...
{ "split": "train", "index": 632, "acecode_id": "evol_31401", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of integers and your task is to find the maximum sum of a non-empty subarray. A subarray is a contiguous part of the array. Implement a function that takes a list of integers as input and returns the maximum sum of any contiguous subarray within the list. T...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_subarray_sum([-1, -2, -3, -4]) == -1\", \"assert max_subarray_sum([5, 4, -1, 7, 8]) == 23\", \"assert max_subarray_sum([0, 0, 0, 0]) == 0\", \"assert max_subarray_sum([-2, 1, -3, 4, -1, 2, 1, -5, 4]) == 6\", \"assert max_subarray_sum([-1]) == -1\", \"ass...
{ "split": "train", "index": 633, "acecode_id": "oss_1789", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Your task is to implement a function that takes this list and returns the sum of all even numbers in the list. If there are no even numbers, return 0. Write a function `sum_of_evens(nums: List[int]) -> int` that performs this task.\nPlease reas...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([2, 4, 6, 8, 10]) == 30\", \"assert sum_of_evens([1, 3, 5, 7]) == 0\", \"assert sum_of_evens([]) == 0\", \"assert sum_of_evens([10, 21, 32, 43, 54]) == 96\", \"assert sum_of_evens([-2, -4, -6, -8]) ...
{ "split": "train", "index": 634, "acecode_id": "bigcode_python_fns_47165", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a dictionary `gene_data` where each key is a tuple representing (gene_name, transcript_id) and the value is a list of dictionaries representing variants, your task is to filter the variants based on specific mutation types. The function should return a new dictionary cont...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_variants({('GeneB', 'T2'): [{'Var3': ['FrameShift-Delete', 'seq1', 'seq2']}, {'Var4': ['NonFrameShift', 'Insert', 'seq1', 'seq2', 'seq3']}]}) == {('GeneB', 'T2', '+'): [{'Var3': ['FrameShift-Delete', 'seq1', 'seq2'], 'Var4': ['NonFrameShift', 'Insert'...
{ "split": "train", "index": 635, "acecode_id": "bigcode_python_fns_6341", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with developing a function that simulates the fetching of energy consumption data from a specified source. Your function should take a string parameter representing the source of data and return a string indicating the energy consumption in kilowatt-hours (kWh). ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fetch_energy_consumption('Utility Meter') == '100 kWh'\", \"assert fetch_energy_consumption('Solar Panel') == '50 kWh'\", \"assert fetch_energy_consumption('Wind Turbine') == '75 kWh'\", \"assert fetch_energy_consumption('Battery Storage') == 'Data unavailab...
{ "split": "train", "index": 636, "acecode_id": "oss_6799", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simplified version of a Least Recently Used (LRU) cache using Python. An LRU cache is a data structure that stores a fixed number of items and evicts the least recently used item when the cache reaches its limit. Your task is to implement a fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert lru_cache_operations(['put', 'get', 'put', 'get'], [1, 1, 2, 2], [10, None, 20, None], 1) == [10, 20]\", \"assert lru_cache_operations(['get', 'put', 'get'], [1, 1, 1], [None, 10, None], 1) == [-1, 10]\", \"assert lru_cache_operations(['put', 'get'], [1, 1],...
{ "split": "train", "index": 637, "acecode_id": "oss_30997", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the read counts of samples. Your task is to implement a function `process_reads(reads: List[int], threshold: int, normalize: bool) -> List[float]` that processes the input reads according to the following rules: 1. If the read count...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_reads([10, 20, 30], 50, False) == [10.0, 20.0, 30.0]\", \"assert process_reads([-5, 0, 5], 10, False) == [0.0, 0.0, 5.0]\", \"assert process_reads([-10, -20, -30], 50, True) == [0.0, 0.0, 0.0]\", \"assert process_reads([0, 0, 0], 100, False) == [0.0,...
{ "split": "train", "index": 638, "acecode_id": "bigcode_python_fns_45416", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a command dictionary for a benchmarking tool. The function will take three parameters: a string `cmd` representing the command to be executed, a string `label` providing a human-readable name for the command, and an optiona...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_command('echo hello', 'Print Hello', {}) == {'cmd': 'echo hello', 'label': 'Print Hello', 'env': {}}\", \"assert create_command('ls -l', 'List Files') == {'cmd': 'ls -l', 'label': 'List Files', 'env': {}}\", \"assert create_command('pwd', 'Print Worki...
{ "split": "train", "index": 639, "acecode_id": "bigcode_python_fns_39790", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the starting of a communication channel on a specific board. The function `start_communication(board_number: int, channel_number: int) -> int` should accept two parameters: `board_number`, which represents the number of...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert start_communication(1, 1) == 1\", \"assert start_communication(1, 10) == 1\", \"assert start_communication(2, 5) == 1\", \"assert start_communication(3, 3) == 1\", \"assert start_communication(1, 0) == -1\", \"assert start_communication(1, 11) == -1\", \"ass...
{ "split": "train", "index": 640, "acecode_id": "bigcode_python_fns_14979", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a class `Chain` that allows for constructing URL paths dynamically using method chaining. The `Chain` class should have an `__init__` method that initializes an instance with an optional `path` argument, which defaults to an empty string. Additional...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert Chain().users('123').repos._path == '/users/123/repos'\", \"assert Chain().products('456').details._path == '/products/456/details'\", \"assert Chain().orders('789').status._path == '/orders/789/status'\", \"assert Chain().users('123').repos('abc').issues._p...
{ "split": "train", "index": 641, "acecode_id": "oss_25477", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `classify_numbers(nums)` that classifies each number in the list as 'even' or 'odd'. The function should return a dictionary where the keys are 'even' and 'odd', and the values are lists of numbers that fall into each category. The inp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert classify_numbers([1, 2, 3, 4]) == {'even': [2, 4], 'odd': [1, 3]}\", \"assert classify_numbers([10, 15, 20, 25]) == {'even': [10, 20], 'odd': [15, 25]}\", \"assert classify_numbers([0, 1, 2, 3]) == {'even': [0, 2], 'odd': [1, 3]}\", \"assert classify_numbers...
{ "split": "train", "index": 642, "acecode_id": "bigcode_python_fns_15887", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of news articles, each represented as a dictionary with at least 'id' and 'content' keys, and paginates the list of articles based on a given page number and a maximum count of articles per page. The function should retu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert paginate_news([{'id': 1, 'content': 'Article 1'}, {'id': 2, 'content': 'Article 2'}, {'id': 3, 'content': 'Article 3'}], 1, 2) == {'articles': [{'id': 1, 'content': 'Article 1'}, {'id': 2, 'content': 'Article 2'}], 'current_page': 1, 'total_pages': 2}\", \"a...
{ "split": "train", "index": 643, "acecode_id": "bigcode_python_fns_30923", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the frequency spectrum of a signal. Your task is to write a function that rearranges the list such that the first half of the list is moved to the back and the second half is moved to the front. The function should handle both even ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert shift_spectrum([1, 2, 3, 4, 5, 6]) == [4, 5, 6, 1, 2, 3]\", \"assert shift_spectrum([1, 2, 3, 4, 5]) == [4, 5, 1, 2, 3]\", \"assert shift_spectrum([1]) == [1]\", \"assert shift_spectrum([]) == []\", \"assert shift_spectrum([1, 2, 3, 4]) == [3, 4, 1, 2]\", \"...
{ "split": "train", "index": 644, "acecode_id": "bigcode_python_fns_6456", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a string, implement a function `remove_duplicate_characters` that removes all duplicate characters from the string while maintaining the order of their first appearance. The function should return a new string with unique characters only.\nPlease reason step by step, then...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_duplicate_characters('hello') == 'helo'\", \"assert remove_duplicate_characters('aabbcc') == 'abc'\", \"assert remove_duplicate_characters('abcd') == 'abcd'\", \"assert remove_duplicate_characters('aabbccddeeff') == 'abcdef'\", \"assert remove_duplica...
{ "split": "train", "index": 645, "acecode_id": "evol_45", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `register_user` that takes a username and an email as input parameters and returns a message indicating the success of the user registration. The function should ensure that the username and email are unique. If the username or email already exists, return ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert register_user('charlie', 'charlie@example.com') == 'User charlie created successfully.'\", \"assert register_user('alice', 'alice@example.com') == 'Error: Username or email already exists.'\", \"assert register_user('dave', 'alice@example.com') == 'Error: Us...
{ "split": "train", "index": 646, "acecode_id": "evol_9745", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that takes a string as input and returns the first non-repeating character in that string. If there is no non-repeating character, return an empty string. The function should be named `first_non_repeating_char` and should take one ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert first_non_repeating_char('leetcode') == 'l'\", \"assert first_non_repeating_char('loveleetcode') == 'v'\", \"assert first_non_repeating_char('aabb') == ''\", \"assert first_non_repeating_char('') == ''\", \"assert first_non_repeating_char('swiss') == 'w'\", ...
{ "split": "train", "index": 647, "acecode_id": "oss_33316", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function called `compare_entities` that takes in two dictionaries representing entities and a dictionary of weights for their properties. The function should return 0 if the entities possess exactly equal status across all properties, a positive value if Entity 1 is...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compare_entities({'age': 30, 'income': 80000, 'credit score': 700}, {'age': 28, 'income': 120000, 'credit score': 650}, {'income': 2, 'age': 1, 'credit score': 1/3}) < 0\", \"assert compare_entities({'age': 28, 'income': 120000, 'credit score': 650}, {'age':...
{ "split": "train", "index": 648, "acecode_id": "evol_34850", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to implement a function `send_request(method: str, url: str, data: bytes) -> bytes` that simulates sending a request to a given URL with a specified HTTP method and payload. The function should return a byte string that represents a mocked response based on the provide...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert send_request('PUT', 'https://fakereg.com/api/stuff', data=b'test-payload') == b'200 OK'\", \"assert send_request('GET', 'https://fakereg.com/api/stuff', data=b'test-payload') == b'404 Not Found'\", \"assert send_request('POST', 'https://fakereg.com/api/stuff...
{ "split": "train", "index": 649, "acecode_id": "bigcode_python_fns_48443", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a JSON string representing service availability data and extracts a list of available services. The JSON string will have the following structure: {\"avail\": {\"service_availability\": {\"services\": [\"service1\", \"s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_available_services('{\\\"avail\\\": {\\\"service_availability\\\": {\\\"services\\\": [\\\"service1\\\", \\\"service2\\\"]}}}') == ['service1', 'service2']\", \"assert extract_available_services('{\\\"avail\\\": {\\\"service_availability\\\": {\\\"se...
{ "split": "train", "index": 650, "acecode_id": "oss_11141", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two integers: `nprocs`, the number of processors, and `number_of_tasks`, the number of tasks to perform. Your task is to implement a function that determines how many groups the `nprocs` processors should be divided into in order to efficiently handle the `number_...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert processor_group_size(8, 10) == 16\", \"assert processor_group_size(10, 5) == 5\", \"assert processor_group_size(12, 15) == 24\", \"assert processor_group_size(15, 10) == 15\", \"assert processor_group_size(20, 25) == 40\", \"assert processor_group_size(30, 2...
{ "split": "train", "index": 651, "acecode_id": "bigcode_python_fns_45651", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks the availability of a specific item in a laboratory inventory system. You will be given a list of container IDs and a list of tip rack IDs. Your goal is to implement the function `check_availability(item_id, containers, tip_ra...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_availability('C1', ['C1', 'C2', 'C3'], ['TR1', 'TR2']) == True\", \"assert check_availability('TR3', ['C1', 'C2', 'C3'], ['TR1', 'TR2']) == False\", \"assert check_availability('C2', ['C1', 'C2', 'C3'], ['TR1', 'TR2']) == True\", \"assert check_availab...
{ "split": "train", "index": 652, "acecode_id": "oss_6984", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given three arrays of integers, implement a function that returns a list of common elements among all three arrays. The function should perform efficiently, with a time complexity better than O(n^3).\nPlease reason step by step, then write a self-contained Python solution. Give...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_common_elements([1, 2, 3, 4, 5], [4, 5, 6, 7, 8], [3, 4, 5, 9, 10]) == [4, 5]\", \"assert find_common_elements([1, 1, 1], [1, 1, 1], [1, 1, 1]) == [1]\", \"assert find_common_elements([1, 2, 3], [4, 5, 6], [7, 8, 9]) == []\", \"assert find_common_elemen...
{ "split": "train", "index": 653, "acecode_id": "evol_24200", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing network traffic shaping for various nodes in a network. Each node has a unique ID, and you need to implement a function that takes a list of node configurations and returns a list of configurations for specific node IDs. Each configuration includes ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_node_configurations([(1, 100, 200, 1), (2, 150, 250, 2)], [1, 2]) == [(100, 200, 1), (150, 250, 2)]\", \"assert get_node_configurations([(1, 100, 200, 1), (2, 150, 250, 2)], [3]) == [None]\", \"assert get_node_configurations([(1, 100, 200, 1)], [1, 2]) =...
{ "split": "train", "index": 654, "acecode_id": "oss_19925", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function that takes another function and two sets of arguments. The function should call the provided function twice, once with each set of arguments. The function signature should be: def call_twice(func: Callable, arg1: Any, arg2: Any):\nPlease reason step by step, t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert call_twice(print_word, 'hello', 'world') == None\", \"assert call_twice(print_word, 1, 2) == None\", \"assert call_twice(print_word, [1, 2, 3], [4, 5]) == None\", \"assert call_twice(print_word, (1, 2), (3, 4)) == None\", \"assert call_twice(print_word, {'ke...
{ "split": "train", "index": 655, "acecode_id": "evol_17977", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of strings, write a function `count_ngrams(segment: List[str], n: int) -> Dict[Tuple[str], int]` that extracts all n-grams of a specified order from the input list and counts their occurrences. An n-gram is a contiguous sequence of n items from the list. The functi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_ngrams(['a', 'b', 'c', 'a', 'b'], 2) == {('a', 'b'): 2, ('b', 'c'): 1, ('c', 'a'): 1}\", \"assert count_ngrams(['a', 'b', 'c', 'a', 'b'], 1) == {('a',): 2, ('b',): 2, ('c',): 1}\", \"assert count_ngrams(['a', 'b', 'c', 'd', 'e'], 3) == {('a', 'b', 'c')...
{ "split": "train", "index": 656, "acecode_id": "bigcode_python_fns_3556", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of dictionaries representing machines, each with a status and a power value, write a function `sum_active_machines_power(machines)` that returns the total power of all active machines. A machine is considered active if its status is 1. Each machine dictionary has t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_active_machines_power([{'St': 1, 'Pm': 10.5}, {'St': 0, 'Pm': 5.0}, {'St': 1, 'Pm': 3.5}]) == 14.0\", \"assert sum_active_machines_power([{'St': 0, 'Pm': 0.0}, {'St': 0, 'Pm': 0.0}]) == 0.0\", \"assert sum_active_machines_power([{'St': 1, 'Pm': 1.0}, {'S...
{ "split": "train", "index": 657, "acecode_id": "bigcode_python_fns_3324", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a dictionary of categories where each category has a name, a parent category, and a category type, write a function `create_category_hierarchy(cats: Dict[str, Dict[str, Union[str, Dict[str, str]]]], categoryType: str) -> Dict[str, List[str]]` that returns a dictionary rep...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_category_hierarchy({'1': {'name': 'A', 'parent': {'name': 'Root'}, 'categoryType': 'Type1'}, '2': {'name': 'B', 'parent': {'name': 'A'}, 'categoryType': 'Type1'}, '3': {'name': 'C', 'parent': {'name': 'B'}, 'categoryType': 'Type2'}, '4': {'name': 'D',...
{ "split": "train", "index": 658, "acecode_id": "bigcode_python_fns_44533", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a configuration represented as a YAML formatted string. Your task is to implement a function `reveal_extra_to_args(config: str) -> List[str]` that takes this string as input and converts it into a list of command line arguments. The function should parse the YAML ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reveal_extra_to_args('''reveal_extra:\\n key0: value0\\n key1: value1\\n''') == ['-V', '-V', 'key0=value0', 'key1=value1']\", \"assert reveal_extra_to_args('''reveal_extra:\\n keyA: valueA\\n keyB: valueB\\n keyC: valueC\\n''') == ['-V', '-V', 'keyA=val...
{ "split": "train", "index": 659, "acecode_id": "bigcode_python_fns_15697", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `get_specification_config()` that simulates loading a configuration for a system. The function should return a dictionary containing configuration settings for a hypothetical application. The configuration dictionary should have the following keys: 'version...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_specification_config() == {'version': '1.0.0', 'debug_mode': True, 'features': ['feature_a', 'feature_b', 'feature_c']}\", \"assert isinstance(get_specification_config(), dict)\", \"assert 'version' in get_specification_config()\", \"assert 'debug_mode' ...
{ "split": "train", "index": 660, "acecode_id": "bigcode_python_fns_7982", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked to create a function `generate_simple_header` that constructs a simplified header based on the input header data. The input will be provided as a dictionary instead of a FITS header object. The function should take the following parameters: \n\n- `header_data`: A...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_simple_header({'CRPIX1': 100.0, 'CRVAL1': 200.0, 'CTYPE1': 'RA', 'NAXIS1': 512, 'NAXIS2': 512}) == {'NAXIS': 2, 'NAXIS1': 512, 'NAXIS2': 512, 'CRPIX1': 100.0, 'CRVAL1': 200.0, 'CTYPE1': 'RA'}\", \"assert generate_simple_header({'CRPIX1': 50.0, 'CRVA...
{ "split": "train", "index": 661, "acecode_id": "bigcode_python_fns_32930", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Write a function `analyze_text(text: str) -> Dict[str, int]` that takes a string input and returns a dictionary containing the counts of uppercase letters, lowercase letters, digits, and symbols in the text. The dictionary should have the keys 'Uppercase letters', 'Lowercase le...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert analyze_text('12345') == {'Uppercase letters': 0, 'Lowercase letters': 0, 'Digits': 5, 'Symbols': 0}\", \"assert analyze_text('abcXYZ!@#') == {'Uppercase letters': 3, 'Lowercase letters': 3, 'Digits': 0, 'Symbols': 3}\", \"assert analyze_text('Python3.9') ==...
{ "split": "train", "index": 662, "acecode_id": "evol_812", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function that calculates the On Balance Volume (OBV) given a list of asset prices and corresponding volumes. The OBV is a cumulative total of the up and down volume. When the current price is higher than the previous price, the current volume is added to the OBV. Wh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_obv([100, 105, 102, 107], [10, 20, 30, 40]) == [0, 20, -10, 30]\", \"assert calculate_obv([100, 100, 100, 100], [10, 20, 30, 40]) == [0, 0, 0, 0]\", \"assert calculate_obv([200, 210, 205, 220, 215], [5, 15, 10, 25, 20]) == [0, 15, 5, 30, 10]\", \"a...
{ "split": "train", "index": 663, "acecode_id": "bigcode_python_fns_49664", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given an array of distinct integers, implement a function that returns a new array containing the integers from the input array, each multiplied by a factor of three. Additionally, remove any resulting value that is not a prime number. The function should only return the new ar...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert solve([4, 16, 25]) == []\", \"assert solve([6, 10]) == []\", \"assert solve([12, 14]) == []\", \"assert solve([18]) == []\", \"assert solve([27]) == []\", \"assert solve([50, 60]) == []\", \"assert solve([70, 80]) == []\"]}" }
{ "split": "train", "index": 664, "acecode_id": "evol_25571", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a dictionary representing an address and returns a formatted address string. The dictionary will have the following keys: 'street', 'city', 'state', and 'zip'. Your function should concatenate these components into a single...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_address({'street': '123 Main St', 'city': 'Anytown', 'state': 'CA', 'zip': '12345'}) == '123 Main St, Anytown, CA 12345'\", \"assert format_address({'street': '456 Elm St', 'city': 'Othertown', 'state': 'NY', 'zip': '54321'}) == '456 Elm St, Othertown...
{ "split": "train", "index": 665, "acecode_id": "oss_33469", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `find_maximum` that returns the maximum value in the list. If the list is empty, the function should return `None`. \n\nFunction Signature: `def find_maximum(nums: List[int]) -> Union[int, None]:` \n\nInput: A list of integers `nums` w...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_maximum([1, 2, 3, 4, 5]) == 5\", \"assert find_maximum([-1, -2, -3, -4, -5]) == -1\", \"assert find_maximum([100, 200, 300]) == 300\", \"assert find_maximum([]) == None\", \"assert find_maximum([0, 0, 0]) == 0\", \"assert find_maximum([1]) == 1\", \"ass...
{ "split": "train", "index": 666, "acecode_id": "bigcode_python_fns_25009", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes a sentence as input and returns a new sentence that contains only the alphabetical characters and spaces, removing all other non-alphabetical characters. For example, given the input '20 this# is an, te2st. se*nt?enc#e', the output should be 'this is...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_non_alphabetical_chars('Hello, World!') == 'Hello World'\", \"assert remove_non_alphabetical_chars('Python3.8 is great!') == 'Python is great'\", \"assert remove_non_alphabetical_chars('No special @characters!') == 'No special characters'\", \"assert ...
{ "split": "train", "index": 667, "acecode_id": "evol_333", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of positive whole numbers and a specific target whole number, determine if there exists any pair of **consecutive** whole numbers in the array such that their product equals the specified target number. Implement a function that returns true if such a pair exists...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert product_exists([2, 3, 5, 7], 15) == True\", \"assert product_exists([1, 2, 3, 4], 6) == True\", \"assert product_exists([4, 5, 6], 30) == True\", \"assert product_exists([2, 4, 6], 24) == True\", \"assert product_exists([7, 8, 9], 56) == True\", \"assert pro...
{ "split": "train", "index": 668, "acecode_id": "evol_4519", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of students in a classroom. Your task is to implement a function that calculates the average height of the students, rounded to two decimal places. Write a function `average_height(heights: List[int]) -> float` where `he...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_height([150, 160, 170, 180]) == 165.0\", \"assert average_height([145, 155, 165]) == 155.0\", \"assert average_height([160]) == 160.0\", \"assert average_height([]) == 0.0\", \"assert average_height([100, 200, 300]) == 200.0\", \"assert average_heigh...
{ "split": "train", "index": 669, "acecode_id": "bigcode_python_fns_1677", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary and a key. Write a function `get_value_from_dict` that retrieves the value associated with the key from the dictionary. If the key does not exist in the dictionary, the function should return None. Your function should handle cases where the input dic...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_value_from_dict({'a': 1, 'b': 2}, 'a') == 1\", \"assert get_value_from_dict({'a': 1, 'b': 2}, 'b') == 2\", \"assert get_value_from_dict({'a': 1, 'b': 2}, 'c') == None\", \"assert get_value_from_dict({}, 'a') == None\", \"assert get_value_from_dict({'key'...
{ "split": "train", "index": 670, "acecode_id": "bigcode_python_fns_23659", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that returns a list of all prime numbers within a specified range. The function should take two parameters: 'start' and 'end', where 'start' is the initial value and 'end' is the final value of the range (inclusive). The function should return a list of pri...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_primes(2, 50) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47]\", \"assert generate_primes(1, 10) == [2, 3, 5, 7]\", \"assert generate_primes(10, 20) == [11, 13, 17, 19]\", \"assert generate_primes(20, 30) == [23, 29]\", \"assert generate...
{ "split": "train", "index": 671, "acecode_id": "evol_24360", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `compare_consonants(str1: str, str2: str) -> str` that compares two strings and finds which one is lexicographically greater, considering only English consonants (B, C, D, F, G, H, J, K, L, M, N, P, Q, R, S, T, V, W, X, Y, Z, b, c, d, f, g, h, j, k, l, m, n, p,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compare_consonants('xyz', 'abc') == 'String 1 is lexicographically greater'\", \"assert compare_consonants('cat', 'bat') == 'String 1 is lexicographically greater'\", \"assert compare_consonants('abc', 'xyz') == 'String 2 is lexicographically greater'\", \"a...
{ "split": "train", "index": 672, "acecode_id": "evol_906", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of satellite collection identifiers and returns a list of unique band identifiers found within these collections. Each satellite collection identifier is a string that represents a specific data set. Your function should...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_unique_bands(['LANDSAT/LC08/C01/T1_TOA', 'LANDSAT/LE07/C01/T1_TOA']) == ['B1', 'B2', 'B3', 'B4']\", \"assert extract_unique_bands(['LANDSAT/LC08/C01/T1_TOA']) == ['B1', 'B2', 'B3']\", \"assert extract_unique_bands(['LANDSAT/LE07/C01/T1_TOA']) == ['B1...
{ "split": "train", "index": 673, "acecode_id": "bigcode_python_fns_9522", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a list of floating-point numbers, write a function that calculates and returns the median value of the list. The median is the value separating the higher half from the lower half of the data set. If the list has an odd number of elements, the median is the middle element...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert median([1.0, 2.0, 3.0]) == 2.0\", \"assert median([3.0, 1.0, 2.0]) == 2.0\", \"assert median([1.0, 2.0, 3.0, 4.0]) == 2.5\", \"assert median([4.0, 3.0, 1.0, 2.0]) == 2.5\", \"assert median([5.0]) == 5.0\", \"assert median([1.0, 2.0]) == 1.5\", \"assert media...
{ "split": "train", "index": 674, "acecode_id": "bigcode_python_fns_20086", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a configuration setting for a web application. Implement a function `get_link_smear_name()` that returns the name of the configuration setting for the 'Link Smear' feature. The function should not take any parameters and should return the string 'li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_link_smear_name() == 'linksmear'\", \"assert get_link_smear_name() == 'linksmear'\", \"assert get_link_smear_name() == 'linksmear'\", \"assert get_link_smear_name() == 'linksmear'\", \"assert get_link_smear_name() == 'linksmear'\", \"assert get_link_smea...
{ "split": "train", "index": 675, "acecode_id": "oss_504", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given the root of a binary tree, implement a function that calculates the sum of all the values of the left leaves. A left leaf is defined as a leaf node that is the left child of its parent. If there are no left leaves, the function should return 0.\nPlease reason step by step...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sumOfLeftLeaves(None) == 0\", \"assert sumOfLeftLeaves(TreeNode(1)) == 0\", \"assert sumOfLeftLeaves(TreeNode(1, TreeNode(2), None)) == 2\", \"assert sumOfLeftLeaves(TreeNode(1, None, TreeNode(3))) == 0\", \"assert sumOfLeftLeaves(TreeNode(1, TreeNode(2, Tre...
{ "split": "train", "index": 676, "acecode_id": "evol_17616", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simple user authentication process. The function will take a dictionary representing a user database and a dictionary representing a login request. The user database is a mapping of usernames to their corresponding pa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert authenticate_user({'user1': 'pass1', 'user2': 'pass2'}, {'username': 'user1', 'password': 'pass1'}) == 'Login successful'\", \"assert authenticate_user({'user1': 'pass1', 'user2': 'pass2'}, {'username': 'user3', 'password': 'pass3'}) == 'User not found'\", \...
{ "split": "train", "index": 677, "acecode_id": "bigcode_python_fns_37674", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a program to assess the severity of network health issues based on predefined criteria. The severity is represented by emojis, with '🤒' indicating a moderate issue and '💀' indicating a critical issue. The severity is determined based on the networ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert assess_network_severity('INSECURE') == '\\ud83d\\udc80'\", \"assert assess_network_severity('INEFFICIENT') == '\\ud83e\\udd12'\", \"assert assess_network_severity('NORMAL') == '\\ud83d\\ude0a'\", \"assert assess_network_severity('INSECURE') == '\\ud83d\\udc8...
{ "split": "train", "index": 678, "acecode_id": "oss_10544", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of historical stock data represented as dictionaries and returns a DataFrame-like structure. Each dictionary contains the keys 'datetime', 'open', 'high', 'low', and 'close'. The function should convert this list into a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert load_historical_data([{'datetime': '2023-01-01', 'open': 100.0, 'high': 105.0, 'low': 95.0, 'close': 102.0}, {'datetime': '2023-01-02', 'open': 101.0, 'high': 106.0, 'low': 96.0, 'close': 103.0}]) == {'datetime': ['2023-01-01', '2023-01-02'], 'open': [100.0,...
{ "split": "train", "index": 679, "acecode_id": "bigcode_python_fns_25700", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to manage a simple library system. The function should take a list of operations and a list of patrons and books, and return the final list of books and patrons in the library. The operations can be of two types: 'add_book' and 'add_p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_library([('add_book', '1984', 'George Orwell'), ('add_patron', 'John Doe')]) == {'books': [{'title': '1984', 'author': 'George Orwell'}], 'patrons': ['John Doe']}\", \"assert manage_library([('add_book', 'The Catcher in the Rye', 'J.D. Salinger'), ('a...
{ "split": "train", "index": 680, "acecode_id": "oss_9696", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a dictionary representing a user's details, implement a function `get_user_info(user_details: Dict[str, Any]) -> Tuple[str, int, int, int]` that returns a tuple containing the user's biography, media count, follower count, and following count. The input dictionary will co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_user_info({'biography': 'Hello World', 'media_count': 10, 'follower_count': 100, 'following_count': 50}) == ('Hello World', 10, 100, 50)\", \"assert get_user_info({'biography': 'Python Developer', 'media_count': 25, 'follower_count': 200, 'following_coun...
{ "split": "train", "index": 681, "acecode_id": "bigcode_python_fns_959", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of precincts, where each precinct is represented by its name and a list of coordinates (tuples of latitude and longitude) that form a polygon. Your task is to implement a function that calculates the area of each precinct and identifies the precinct with th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert largest_precinct_area({'A': [(0, 0), (0, 2), (2, 2), (2, 0)]}) == ('A', 4.0)\", \"assert largest_precinct_area({'B': [(0, 0), (1, 1), (1, 0)]}) == ('B', 0.5)\", \"assert largest_precinct_area({'C': [(0, 0), (0, 5), (5, 5), (5, 0)], 'D': [(1, 1), (1, 2), (2, ...
{ "split": "train", "index": 682, "acecode_id": "oss_26206", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string value that is supposed to represent a date. Your task is to implement a function that checks if this string can be converted into a valid date-time object based on the provided date format or formats. If no format is given, the function should assume the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_date('2023-10-04', None) == True\", \"assert is_valid_date('04/10/2023', '%d/%m/%Y') == True\", \"assert is_valid_date('10-04-2023', '%m-%d-%Y') == True\", \"assert is_valid_date('10-04-23', '%m-%d-%y') == True\", \"assert is_valid_date('2023-02-29'...
{ "split": "train", "index": 683, "acecode_id": "bigcode_python_fns_20040", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that calculates the square of a given numeric value. The function should take a single parameter, which is a float representing the numeric value, and return its square as a float. Implement the function `calculate_square(value: float) ->...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_square(0) == 0.0\", \"assert calculate_square(1) == 1.0\", \"assert calculate_square(2) == 4.0\", \"assert calculate_square(-1) == 1.0\", \"assert calculate_square(-2) == 4.0\", \"assert calculate_square(3.5) == 12.25\", \"assert calculate_square(-...
{ "split": "train", "index": 684, "acecode_id": "oss_4982", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that identifies the second and third least values present in a given numerical matrix. The matrix may contain both positive and negative floating-point numbers. The function should return these elements in ascending order without using any built-in sort fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_second_third_smallest([[0.1, 0.2, 0.3], [-1.1, -0.5]]) == (-0.5, 0.1)\", \"assert get_second_third_smallest([[10.5, 20.2], [30.3, 5.0], [-10.1, 0.0]]) == (0.0, 5.0)\", \"assert get_second_third_smallest([[3.3, 1.1], [4.4, 2.2], [5.5]]) == (2.2, 3.3)\", \...
{ "split": "train", "index": 685, "acecode_id": "evol_25352", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes an address and optional parameters for country and administrative area, and returns a list of dictionaries containing the latitude and longitude of the address. Each dictionary in the list should include the keys 'latitude' and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert geolocate('1600 Amphitheatre Parkway, Mountain View, CA') == [{'latitude': 37.422, 'longitude': -122.084}]\", \"assert geolocate('1 Infinite Loop, Cupertino, CA') == [{'latitude': 37.331, 'longitude': -122.031}]\", \"assert geolocate('Invalid Address') == []...
{ "split": "train", "index": 686, "acecode_id": "bigcode_python_fns_36421", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a raw data dictionary containing network information. The function should extract the values associated with the keys 'dns' and 'connect'. If the 'dns' key is present, the function should return its value; otherwise, it...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_network_info({'dns': '8.8.8.8', 'connect': 'connected'}) == ('8.8.8.8', 'connected')\", \"assert extract_network_info({'dns': '8.8.8.8'}) == ('8.8.8.8', -1)\", \"assert extract_network_info({'connect': 'connected'}) == (-1, 'connected')\", \"assert e...
{ "split": "train", "index": 687, "acecode_id": "oss_27686", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a custom dataset for a machine learning project that consists of images and corresponding labels. Implement a function named `load_custom_dataset` that takes two parameters: a list of image paths and a list of corresponding labels. The function shou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert load_custom_dataset(['img1.jpg', 'img2.jpg'], ['label1', 'label2']) == {'img1.jpg': 'label1', 'img2.jpg': 'label2'}\", \"assert load_custom_dataset(['img1.jpg'], ['label1']) == {'img1.jpg': 'label1'}\", \"assert load_custom_dataset([], []) == {}\", \"assert ...
{ "split": "train", "index": 688, "acecode_id": "oss_9389", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers and a specific target sum, write a function `pair_sum_count(arr: List[int], target: int) -> int` that returns the number of unique pairs of elements in the array that sum up to the target value. A pair is defined as two elements in the array that can ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert pair_sum_count([1, 3, 2, 2], 4) == 2\", \"assert pair_sum_count([1, 1, 1, 1], 2) == 1\", \"assert pair_sum_count([0, 0, 0, 0], 0) == 1\", \"assert pair_sum_count([], 5) == 0\", \"assert pair_sum_count([1, 2, 3, 4, 5], 10) == 0\", \"assert pair_sum_count([1, ...
{ "split": "train", "index": 689, "acecode_id": "oss_3436", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks if a specific value exists in a list of strings. The function should return `True` if the value is found in the list and `False` otherwise. The function should ignore leading and trailing whitespace in the list entries. Im...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert search_in_list([' apple ', 'banana', ' orange '], 'banana') == True\", \"assert search_in_list([' apple ', 'banana', ' orange '], 'grape') == False\", \"assert search_in_list([' ', ' apple ', 'banana'], 'apple') == True\", \"assert search_in_list([...
{ "split": "train", "index": 690, "acecode_id": "oss_1330", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the scores of students in a class. Your task is to implement a function that calculates the average score of the students. The average should be computed by summing all the scores and dividing by the number of students. If there are...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average([100, 90, 80, 70]) == 85.0\", \"assert calculate_average([60, 70, 80, 90, 100]) == 80.0\", \"assert calculate_average([50]) == 50.0\", \"assert calculate_average([]) == 0.0\", \"assert calculate_average([0, 0, 0]) == 0.0\", \"assert calcula...
{ "split": "train", "index": 691, "acecode_id": "bigcode_python_fns_35410", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to extract the definition of a class named 'UserCheck' from a provided string representation of a Python file. Your function should take a string input that contains multiple lines of code and return the class definition including any lines of code that belong to the c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_user_check_class('class UserCheck(object):\\\\n def __init__(self):\\\\n pass\\\\n') == 'class UserCheck(object):\\\\n def __init__(self):\\\\n pass\\\\n'\", \"assert extract_user_check_class('def random_function():\\\\n pass\\...
{ "split": "train", "index": 692, "acecode_id": "bigcode_python_fns_41953", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that logs parameters and metrics for a machine learning model. The function should accept a dictionary of parameters and two metrics: train_loss and test_loss. The function should return a formatted string that summarizes the logged param...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert log_model_data({'alpha': 0.01, 'batch_size': 32}, 0.5, 0.4) == 'alpha: 0.01, batch_size: 32, train_loss: 0.5, test_loss: 0.4'\", \"assert log_model_data({'learning_rate': 0.001, 'epochs': 100}, 0.25, 0.2) == 'learning_rate: 0.001, epochs: 100, train_loss: 0....
{ "split": "train", "index": 693, "acecode_id": "bigcode_python_fns_36372", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python decorator named `ignore_copy` that prevents the copying of a specific method in a class. This decorator should be used to ensure that the `__getattr__` method is ignored during copying of the class instance. The `__getattr__` method is ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert MyClass().__getattr__('field1').name == 'field1'\", \"assert MyClass().__getattr__('field2').name == 'field2'\", \"assert isinstance(MyClass().__getattr__('field1'), Field)\", \"assert isinstance(MyClass().__getattr__('field2'), Field)\", \"assert MyClass()....
{ "split": "train", "index": 694, "acecode_id": "oss_27110", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a simple error reporting system. The function `report_error` should take one parameter, an error message as a string. If the error message is 'I'm sorry Dave, I'm afraid I can't do that.', the function should raise an Excep...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert report_error('File not found') == 'File not found'\", \"assert report_error('Invalid input') == 'Invalid input'\", \"assert report_error('Connection timed out') == 'Connection timed out'\", \"assert report_error('Access denied') == 'Access denied'\", \"asser...
{ "split": "train", "index": 695, "acecode_id": "bigcode_python_fns_37417", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings. Your task is to implement a function that calculates the total number of characters present in all the strings combined. The function should take a list of strings as input and return an integer representing the total character count. Note that ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert total_characters(['hello', 'world']) == 10\", \"assert total_characters(['', '']) == 0\", \"assert total_characters(['a', 'b', 'c']) == 3\", \"assert total_characters(['']) == 0\", \"assert total_characters(['singleWord']) == 10\", \"assert total_characters(...
{ "split": "train", "index": 696, "acecode_id": "oss_4771", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are building a device management system that allows you to retrieve the status of a specific device based on its unique identifier. Implement a function `get_device_status(device_id: str) -> str` that takes a device ID as input and returns the status of the device as a stri...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_device_status('device_1') == 'active'\", \"assert get_device_status('device_2') == 'inactive'\", \"assert get_device_status('device_3') == 'error'\", \"assert get_device_status('device_4') == 'offline'\", \"assert get_device_status('device_5') == 'unknow...
{ "split": "train", "index": 697, "acecode_id": "oss_28003", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a float value representing a fraction between 0.0 and 1.0, implement a function that formats this fraction as a percentage string. The function should take two parameters: a float `percentage` and an integer `pos`. The output should be a string that represents the percent...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_percent(0.0, 1) == '0%'\", \"assert format_percent(0.25, 1) == '25%'\", \"assert format_percent(0.5, 1) == '50%'\", \"assert format_percent(0.75, 1) == '75%'\", \"assert format_percent(1.0, 1) == '100%'\", \"assert format_percent(0.333, 1) == '33%'\",...
{ "split": "train", "index": 698, "acecode_id": "bigcode_python_fns_36009", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a dictionary containing specifications for a plot based on the provided energy value, number of bins, and range of values. The function should be named `get_plot_spec_binstat_abs` and it should accept three parameters: `ene...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_plot_spec_binstat_abs('Photon') == {'title': None, 'label_x': 'True Photon Energy [GeV]', 'label_y': '(Reco - True) Photon Energy [GeV]', 'bins_x': 50, 'range_x': (0, 5), 'bins_y': None, 'range_y': None, 'minor': True, 'grid': True}\", \"assert get_plot_...
{ "split": "train", "index": 699, "acecode_id": "bigcode_python_fns_41347", "num_tests": 16 }