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 integers. Your task is to implement a function that takes in the list and returns a new list that contains only the even numbers from the original list, maintaining their order. If there are no even numbers, return an empty list. Write a function named `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([0, 1, 2, 3, 4, 5]) == [0, 2, 4]\", \"assert filter_even_numbers([-2, -1, 0, 1, 2]) == [-2, 0, 2]\", \"assert filter_even_numbers([-1, -3, -5]) == []\", \"assert filter_even_numbe...
{ "split": "train", "index": 68900, "acecode_id": "bigcode_python_fns_38420", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a program to parse and process a set of rules for a game. Each rule is represented as a string and needs to be parsed into a structured format for further processing. The rules are provided as input in the form of a list of strings. Write a Python f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_rules(['move up 10', 'attack enemy', 'defend 5']) == [Rule(type='move', direction='up', distance=10), Rule(type='attack', target='enemy'), Rule(type='defend', duration=5)]\", \"assert parse_rules(['move down 20']) == [Rule(type='move', direction='down'...
{ "split": "train", "index": 68901, "acecode_id": "oss_14365", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes three string inputs: `name`, `label`, and `verbose_name`, each representing attributes of a payment processing service configuration. The function should return a dictionary containing these three attributes as key-value pairs ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_payment_config('django-robokassa', 'Robokassa', '\\u0420\\u043e\\u0431\\u043e\\u043a\\u0430\\u0441\\u0441\\u0430') == {'name': 'django-robokassa', 'label': 'Robokassa', 'verbose_name': '\\u0420\\u043e\\u0431\\u043e\\u043a\\u0430\\u0441\\u0441\\u0430'}...
{ "split": "train", "index": 68902, "acecode_id": "oss_696", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of cookie data and extracts specific information from it. Each entry in the list represents a cookie and contains tab-separated information such as the domain, path, secure flag, expiration date, and name of t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_cookies(['# domain\\\\tpath\\\\tsecure\\\\texpiration\\\\tname', 'example.com\\\\t/\\\\tTRUE\\\\t1555555555\\\\tsession_id'], 'example.com') == ['session_id']\", \"assert extract_cookies(['# domain\\\\tpath\\\\tsecure\\\\texpiration\\\\tname', 'examp...
{ "split": "train", "index": 68903, "acecode_id": "oss_36927", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing a list of individuals represented by their names and ages using a Data Transfer Object (DTO). Create a function `calculate_average_age(dto_list: List[MyDto]) -> float` that takes a list of DTOs as input and returns the average age of all individuals...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average_age([]) == 0\", \"assert calculate_average_age([MyDto('Alice', 25)]) == 25.0\", \"assert calculate_average_age([MyDto('Bob', 30), MyDto('Charlie', 20)]) == 25.0\", \"assert calculate_average_age([MyDto('David', 40), MyDto('Eve', 35), MyDto(...
{ "split": "train", "index": 68904, "acecode_id": "oss_16525", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of a group of people in a line. Your task is to determine the number of pairs of people (i, j) such that the height of person i is greater than the height of person j and i < j. Write a function `count_taller_pairs(heigh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_taller_pairs([1, 2, 3]) == 0\", \"assert count_taller_pairs([3, 2, 1]) == 3\", \"assert count_taller_pairs([1, 3, 2]) == 1\", \"assert count_taller_pairs([5, 5, 5]) == 0\", \"assert count_taller_pairs([1]) == 0\", \"assert count_taller_pairs([100, 90, ...
{ "split": "train", "index": 68905, "acecode_id": "bigcode_python_fns_31328", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing the names of fields in a data model. Your task is to implement a function that checks whether every field name in a given list exists in a predefined list of valid fields. If any field from the list is not found in the valid fields, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_fields(['name', 'age', 'email'], ['name', 'age']) == 'All fields are valid.'\", \"assert check_fields(['name', 'age', 'email'], ['name', 'age', 'address']) == 'Field \\\"address\\\" is missing in valid fields.'\", \"assert check_fields(['id', 'title', ...
{ "split": "train", "index": 68906, "acecode_id": "bigcode_python_fns_28058", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string `dayinput` consisting of directional characters: 'N', 'S', 'E', and 'W', which represent movements in the north, south, east, and west directions respectively. Starting from the coordinate (0, 0), your task is to determine how many unique coordinates you ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_coordinates('N') == 2\", \"assert unique_coordinates('NS') == 2\", \"assert unique_coordinates('E') == 2\", \"assert unique_coordinates('W') == 2\", \"assert unique_coordinates('NSNS') == 2\", \"assert unique_coordinates('NSSS') == 4\", \"assert uniqu...
{ "split": "train", "index": 68907, "acecode_id": "bigcode_python_fns_43067", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function `reverse_deque(d: Deque[int]) -> Deque[int]` that takes a deque of integers as input and returns a new deque containing the elements in reverse order. You should not use any built-in functions for reversing the deque.\nPlease reason step by step, then write...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_deque(deque([1, 2, 3, 4, 5])) == deque([5, 4, 3, 2, 1])\", \"assert reverse_deque(deque([])) == deque([])\", \"assert reverse_deque(deque([10])) == deque([10])\", \"assert reverse_deque(deque([1, 2, 3])) == deque([3, 2, 1])\", \"assert reverse_deque(...
{ "split": "train", "index": 68908, "acecode_id": "evol_29127", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing a file path. The path may or may not contain a checkpoint file name at the end. Your task is to implement a function that will return the formatted path of the checkpoint file by appending 'last_checkpoint.txt' to the end of the provided path...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_best_checkpoint_path('/home/user/checkpoints') == '/home/user/checkpoints/last_checkpoint.txt'\", \"assert get_best_checkpoint_path('/home/user/checkpoints/last_checkpoint.txt') == '/home/user/checkpoints/last_checkpoint.txt'\", \"assert get_best_checkpo...
{ "split": "train", "index": 68909, "acecode_id": "bigcode_python_fns_44229", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `remove_duplicates(input_list)` that takes a list of elements and returns a set of unique integers derived from the list. The function should handle erroneous inputs by only including valid integers in the final set. If an element cannot be converted to an inte...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_duplicates(['1', '2', '3', '3', '4']) == {1, 2, 3, 4}\", \"assert remove_duplicates([1.1, 2.2, 3.3]) == {1, 2, 3}\", \"assert remove_duplicates(['10', '20', '30', '40']) == {10, 20, 30, 40}\", \"assert remove_duplicates(['a', 'b', 'c']) == set()\", \"...
{ "split": "train", "index": 68910, "acecode_id": "evol_5768", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Write a Python function that takes a list of integers and returns a new list containing the string 'Good Day' for each integer that is divisible by 5. If the input list is empty, it should return an empty list. The function should be optimized to handle lists with up to 10,000 ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_divisibility([]) == []\", \"assert check_divisibility([1, 2, 3, 4]) == []\", \"assert check_divisibility([5]) == ['Good Day']\", \"assert check_divisibility([10, 20, 30]) == ['Good Day', 'Good Day', 'Good Day']\", \"assert check_divisibility([7, 11, 13...
{ "split": "train", "index": 68911, "acecode_id": "evol_12831", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of expressions, each represented as a tuple with the first element being the type of the expression and the subsequent elements being sub-expressions, implement a function that checks if all expressions in the list have the same type or are subtype-compatible. The ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_compatibility([('A', [('A',)]), ('A', [('A',)])]) == True\", \"assert check_compatibility([('A', [('A',)]), ('B', [('B',)])]) == False\", \"assert check_compatibility([('A', [('A',)]), ('A', [('B',)])]) == True\", \"assert check_compatibility([('A', [(...
{ "split": "train", "index": 68912, "acecode_id": "bigcode_python_fns_20674", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a 2D array of integers representing pixel values of an image. Your task is to implement a function that returns the minimum and maximum pixel values from the given array. The function should be named `min_max_pixel_values` and should take a single parameter, a 2D ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert min_max_pixel_values([[1, 2, 3], [4, 5, 6]]) == (1, 6)\", \"assert min_max_pixel_values([[10, 20, 30], [5, 15, 25]]) == (5, 30)\", \"assert min_max_pixel_values([[0, -1, -2], [-3, -4, -5]]) == (-5, 0)\", \"assert min_max_pixel_values([[1]]) == (1, 1)\", \"as...
{ "split": "train", "index": 68913, "acecode_id": "bigcode_python_fns_28036", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string input that contains a substring formatted as 'action_num=node_id', where 'action_num' is a 1-indexed integer and 'node_id' is a string identifier. Your task is to write a function that extracts the 'action_num' and 'node_id' from this substring. The funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_action_num_and_node_id('action_num=5,node_id=XYZ') == {'action_num': 4, 'node_id': 'XYZ'}\", \"assert extract_action_num_and_node_id('action_num=1,node_id=ABC') == {'action_num': 0, 'node_id': 'ABC'}\", \"assert extract_action_num_and_node_id('This i...
{ "split": "train", "index": 68914, "acecode_id": "bigcode_python_fns_29182", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `max_subarray_sum(arr)` that takes a list of integers and floats, and returns the sum of the subarray with the maximum sum. The function should effectively handle both positive and negative numbers, as well as floating-point values. Your implementation shou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_subarray_sum([-2,1,-3,4,-1,2,1,-5,4]) == 6\", \"assert max_subarray_sum([1]) == 1\", \"assert max_subarray_sum([5,4,-1,7,8]) == 23\", \"assert max_subarray_sum([-1,-2,-3,-4]) == -1\", \"assert max_subarray_sum([1,2,3,4,5]) == 15\", \"assert max_subarray_...
{ "split": "train", "index": 68915, "acecode_id": "evol_16393", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that checks whether a given string is a valid identifier according to Python's naming conventions. A valid identifier must start with a letter or underscore, followed by letters, digits, or underscores. The function should take a s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_identifier('validIdentifier') == True\", \"assert is_valid_identifier('_validIdentifier') == True\", \"assert is_valid_identifier('valid_identifier_123') == True\", \"assert is_valid_identifier('123invalid') == False\", \"assert is_valid_identifier(...
{ "split": "train", "index": 68916, "acecode_id": "oss_37514", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of 2D keypoints and generates a vector representation for each keypoint based on a specified center point and inter-distance. The function should take the following parameters: a list of keypoints represented as tuples o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_vectors([(1, 2)], (0, 0), 1.0) == [(1, 1.0, 2.0)]\", \"assert create_vectors([(2, 3), (4, 5)], (0, 0), 2.0) == [(1, 1.0, 1.5), (1, 2.0, 2.5)]\", \"assert create_vectors([], (0, 0), 1.0) == [(0, 0, 0)]\", \"assert create_vectors([(0, 0)], (0, 0), 1.0) ...
{ "split": "train", "index": 68917, "acecode_id": "oss_14945", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of tuples where each tuple contains an integer and a string (representing a variable name), implement a function that extracts all tuples from the list that match a specified variable name. The function should take two parameters: a list of tuples and a string repr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_tuples_by_var_name([(0, 'a'), (1, 'a'), (2, 'b'), (3, 'c')], 'a') == [(0, 'a'), (1, 'a')]\", \"assert extract_tuples_by_var_name([(0, 'x'), (1, 'y'), (2, 'x'), (3, 'z')], 'x') == [(0, 'x'), (2, 'x')]\", \"assert extract_tuples_by_var_name([(0, 'a'), ...
{ "split": "train", "index": 68918, "acecode_id": "bigcode_python_fns_41744", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that checks if a given list of solver names is valid according to a predefined set of available solvers. The function should take a list of solver names as input and return a list of any invalid solver names that are not recognized...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_solvers(['couenne', 'bonmin', 'ipopt']) == []\", \"assert validate_solvers(['couenne', 'invalid_solver']) == ['invalid_solver']\", \"assert validate_solvers(['gurobi', 'cplex']) == []\", \"assert validate_solvers(['couenne', 'bonmin', 'invalid_solve...
{ "split": "train", "index": 68919, "acecode_id": "oss_33443", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given two integers num_rows and num_cols, return a matrix of size num_rows x num_cols where the value at the (i, j) position is calculated as i + j. Implement a function that generates this matrix based on the specified dimensions.\nPlease reason step by step, then write a self...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert make_matrix(2, 3, lambda i, j: i + j) == [[0, 1, 2], [1, 2, 3]]\", \"assert make_matrix(1, 1, lambda i, j: i + j) == [[0]]\", \"assert make_matrix(3, 2, lambda i, j: i + j) == [[0, 1], [1, 2], [2, 3]]\", \"assert make_matrix(2, 2, lambda i, j: i + j) == [[0,...
{ "split": "train", "index": 68920, "acecode_id": "bigcode_python_fns_37176", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple office equipment management system. Create a function called `equipment_status` that takes in three dictionaries representing a printer, a scanner, and a copier. Each dictionary will contain the following keys: 'brand' (string), 'price'...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert equipment_status([{'brand': 'hp', 'price': 2000, 'capacity': 5, 'type': 'printer'}, {'brand': 'Canon', 'price': 1200, 'capacity': 5, 'type': 'scanner'}, {'brand': 'Xerox', 'price': 1500, 'capacity': 1, 'type': 'copier'}]) == ['hp printer is ready to print.',...
{ "split": "train", "index": 68921, "acecode_id": "oss_912", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a 2D list of points in a 3D space represented as tuples (x, y, z), write a function that determines which axes (0 for x, 1 for y, and 2 for z) contain variability among the points. The function should return a tuple of the axes that have more than one unique value. If all...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_plot_axes([(1, 2, 3), (1, 2, 4), (1, 3, 3)]) == (1, 2)\", \"assert get_plot_axes([(1, 2, 3), (1, 2, 3), (1, 2, 3)]) == ()\", \"assert get_plot_axes([(0, 0, 0), (0, 0, 0), (0, 0, 0)]) == ()\", \"assert get_plot_axes([(1, 2, 3), (1, 2, 3), (1, 2, 3)]) == (...
{ "split": "train", "index": 68922, "acecode_id": "bigcode_python_fns_9976", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a symbolic permission notation string that represents file permissions in the UNIX system. The string is expected to be exactly 9 characters long, consisting of three groups of three characters each: 'r' for read, 'w' for write, and 'x' for execute, or '-' for no ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert symb_to_num('rwxrwxrwx') == '777'\", \"assert symb_to_num('rwxr-xr-x') == '755'\", \"assert symb_to_num('rw-r--r--') == '644'\", \"assert symb_to_num('r--r--r--') == '444'\", \"assert symb_to_num('rwxr--r--') == '744'\", \"assert symb_to_num('rwxrwx---') == ...
{ "split": "train", "index": 68923, "acecode_id": "bigcode_python_fns_21289", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with finding the highest catalog identifier from a list of sales catalog names. Each catalog name is expected to be in the format 'Sale Catalog Br-XXXX', where XXXX is a 4-digit number representing the catalog's identifier. Write a function `highest_catalog_ident...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert highest_catalog_identifier(['Sale Catalog Br-1544', 'Sale Catalog Br-1555', 'Invalid Catalog', 'Sale Catalog Br-1533']) == 1555\", \"assert highest_catalog_identifier(['Sale Catalog Br-0001', 'Sale Catalog Br-0002']) == 2\", \"assert highest_catalog_identifi...
{ "split": "train", "index": 68924, "acecode_id": "oss_32608", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that filters a list of strings based on specific keywords. Write a function `filter_keywords(data: List[str], keywords: List[str]) -> List[str]` that takes in two parameters: `data`, a list of strings, and `keywords`, a list of strings. T...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_keywords(['Hello World', 'This is a test', 'Python programming'], ['test']) == ['Hello World', 'Python programming']\", \"assert filter_keywords(['apple', 'banana', 'cherry'], ['banana']) == ['apple', 'cherry']\", \"assert filter_keywords(['Data Scien...
{ "split": "train", "index": 68925, "acecode_id": "bigcode_python_fns_21569", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes two input strings and determines if they are anagrams of each other, ignoring case differences. An anagram is a word or phrase formed by rearranging the letters of a different word or phrase using all the original letters exactly once.\nPlease reason...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert are_anagrams('listen', 'silent') == True\", \"assert are_anagrams('Triangle', 'Integral') == True\", \"assert are_anagrams('Apple', 'Pabble') == False\", \"assert are_anagrams('The Morse Code', 'Here Come Dots') == True\", \"assert are_anagrams('School Maste...
{ "split": "train", "index": 68926, "acecode_id": "evol_22214", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of tuples, where each tuple represents a pair of samples with their corresponding distance. Your task is to create a function that updates a dictionary with these distances. The keys of the dictionary are tuples of sample indices, and the values are the dis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_distances(0, [('sample1', 1.5), ('sample2', 2.0)], {}, {'sample1': 1, 'sample2': 2}) == None\", \"assert update_distances(0, [('sample1', 1.5)], {}, {'sample1': 1}) == None\", \"assert update_distances(1, [('sample0', 1.5)], {}, {'sample0': 0}) == Non...
{ "split": "train", "index": 68927, "acecode_id": "bigcode_python_fns_30141", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with analyzing podcast visit data. Given a list of podcast visit records, each represented as a list containing the podcast name, number of visits, number of campaign visits, and number of exits, your goal is to aggregate this data. Implement a function `aggregat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert aggregate_podcast_data([]) == {}\", \"assert aggregate_podcast_data([['Podcast A', 10, 5, 2]]) == {'podcast a': {'visits': 10, 'visits_campaign': 5, 'exits': 2}}\", \"assert aggregate_podcast_data([['Podcast A', 10, 5, 2], ['Podcast B', 20, 10, 4]]) == {'pod...
{ "split": "train", "index": 68928, "acecode_id": "bigcode_python_fns_22786", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the measurement process of a gauge for measuring a physical quantity. The function `measure_gauge(name: str, family_type: str) -> str` takes two parameters: `name` (a string representing the name of the gauge) and `fami...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert measure_gauge('Temperature', 'analog') == 'Normal measurement'\", \"assert measure_gauge('Pressure', 'GAUGE') == 'Special measurement for GAUGE type'\", \"assert measure_gauge('Humidity', 'digital') == 'Normal measurement'\", \"assert measure_gauge('Flow', '...
{ "split": "train", "index": 68929, "acecode_id": "oss_12394", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a string containing HTML content and converts it to plain text, while ensuring that the resulting text does not exceed a certain length. Write a function `truncate_html_content(html: str) -> str` that processes the input HT...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert truncate_html_content('<p>This is a sample paragraph with some <b>bold</b> text.</p>') == 'This is a sample paragraph with some bold text.'\", \"assert truncate_html_content('<h1>Header</h1><p>Content</p>') == 'HeaderContent'\", \"assert truncate_html_conten...
{ "split": "train", "index": 68930, "acecode_id": "oss_13336", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a date input, convert it to a datetime object. The input can be of various types: a datetime object, a timestamp (integer), or None. If the input is already a datetime object, return it as is. If the input is a timestamp, convert it to a datetime object. If the input is N...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_datetime(datetime.datetime(2023, 10, 1, 12, 0, 0)) == datetime.datetime(2023, 10, 1, 12, 0, 0)\", \"assert convert_to_datetime(None) == None\", \"assert convert_to_datetime(datetime.datetime(2000, 1, 1, 0, 0, 0)) == datetime.datetime(2000, 1, 1, 0...
{ "split": "train", "index": 68931, "acecode_id": "bigcode_python_fns_45607", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of points on a 2D plane represented as an array of `points`, and an integer `s` representing the side length of a square. Your task is to implement a function that finds the maximum number of points that are within or lie on any square grid of side length `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert maxPointsInsideSquare([[-2,0],[2,0],[0,2],[0,-2]], 1) == [1, [-2.0, 0.0]]\", \"assert maxPointsInsideSquare([[0,0],[1,1],[-1,-1],[2,2]], 2) == [3, [0.0, 0.0]]\", \"assert maxPointsInsideSquare([[1,1],[2,2],[3,3]], 1) == [1, [1.0, 1.0]]\", \"assert maxPointsI...
{ "split": "train", "index": 68932, "acecode_id": "evol_9737", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function to calculate the average of a list of stress values. The function should take a single input parameter: a list of floating-point numbers representing nodal stress values. Your function should compute the average stress by summing a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average_stress([5.5, 10.0, 15.5]) == 10.33\", \"assert calculate_average_stress([1.0, 2.0, 3.0, 4.0]) == 2.50\", \"assert calculate_average_stress([0.0, 0.0, 0.0]) == 0.00\", \"assert calculate_average_stress([10.0, 20.0]) == 15.00\", \"assert calc...
{ "split": "train", "index": 68933, "acecode_id": "oss_26157", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list and a pattern number, implement a function `shuffle_and_sort(lst, pattern)` that first shuffles the list based on the pattern. The shuffle operation moves the last 'pattern' elements to the front of the list. After shuffling, the function should sort the list based...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert shuffle_and_sort([1, 3, 2, 4], 2) == [1, 2, 3, 4]\", \"assert shuffle_and_sort([], 2) == []\", \"assert shuffle_and_sort(['apple', 'banana', 42], 2) == [42, 'apple', 'banana']\", \"assert shuffle_and_sort([1, 2, 3, 4], 4) == [1, 2, 3, 4]\", \"assert shuffle_...
{ "split": "train", "index": 68934, "acecode_id": "evol_30720", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Implement a function that converts an alphanumeric string into an integer. The string may contain non-numeric characters which should be ignored. If the string contains negative (-) or positive (+) symbols, they should be considered as well. The string may begin or end with non...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_string_to_int('123abc') == 123\", \"assert convert_string_to_int('abc-456def') == -456\", \"assert convert_string_to_int('++-7') == -7\", \"assert convert_string_to_int('++--9') == 9\", \"assert convert_string_to_int('--5') == 5\", \"assert convert_s...
{ "split": "train", "index": 68935, "acecode_id": "evol_4027", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a dictionary `the_dict` and two strings `key` and `substring`, write a function `dict_key_contains_substring(the_dict, key, substring)` that checks if the dictionary contains the specified `key` and if the corresponding value includes the specified `substring`. The functi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert dict_key_contains_substring({'a': 'apple', 'b': 'banana'}, 'a', 'app') == True\", \"assert dict_key_contains_substring({'x': 'hello', 'y': 'world'}, 'y', 'orl') == True\", \"assert dict_key_contains_substring({'1': 'test', '2': 'example'}, '2', 'ample') == T...
{ "split": "train", "index": 68936, "acecode_id": "bigcode_python_fns_1344", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that returns the key name for a specific field used to store CVE (Common Vulnerabilities and Exposures) identifiers in a database. Implement a function named `get_cve_id_field_name` that takes no parameters and returns the string 'cve_id'...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_cve_id_field_name() == 'cve_id'\", \"assert get_cve_id_field_name() != 'CVE_ID'\", \"assert len(get_cve_id_field_name()) == 6\", \"assert 'cve' in get_cve_id_field_name()\", \"assert get_cve_id_field_name().startswith('c') == True\", \"assert get_cve_id_...
{ "split": "train", "index": 68937, "acecode_id": "bigcode_python_fns_19456", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that manages the state of a connection based on whether all required information has been sent and the current state of the connection. The function should have the following signature: `def manage_connection_state(relation_name: str,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_connection_state('test_relation', True, False) == {'test_relation.available'}\", \"assert manage_connection_state('test_relation', False, False) == set()\", \"assert manage_connection_state('test_relation', True, True) == set()\", \"assert manage_conn...
{ "split": "train", "index": 68938, "acecode_id": "oss_6922", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two floating-point numbers, `num1` and `num2`, and a floating-point error margin, `error`. Write a function `check_within_margin(num1: float, num2: float, error: float) -> bool` that returns `True` if `num1` is within the range of `num2` ± `error`, and `False` oth...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_within_margin(5.0, 5.0, 0.5) == True\", \"assert check_within_margin(5.0, 5.0, 0.0) == True\", \"assert check_within_margin(4.5, 5.0, 0.5) == True\", \"assert check_within_margin(5.5, 5.0, 0.5) == True\", \"assert check_within_margin(4.4, 5.0, 0.5) == ...
{ "split": "train", "index": 68939, "acecode_id": "bigcode_python_fns_22223", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `find_substring_indices(s: str, sub: str) -> List[int]` that locates all occurrences of a given substring within a designated string, including overlapping occurrences. The function should return a list of indices where the substring starts in the string. I...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_substring_indices('Hello World!', 'Hello') == [0]\", \"assert find_substring_indices('Hello World!', 'World') == [6]\", \"assert find_substring_indices('abababab', 'aba') == [0, 2, 4]\", \"assert find_substring_indices('abcabcabc', 'abc') == [0, 3, 6]\"...
{ "split": "train", "index": 68940, "acecode_id": "evol_26678", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `generate_prime_matrix(n: int) -> List[List[int]]` that constructs an n by n matrix filled exclusively with prime integers. The function should return a 2D list where each element is a prime number. The matrix should be filled row-wise with prime numbers starti...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_prime_matrix(1) == [[2]]\", \"assert generate_prime_matrix(2) == [[2, 3], [5, 7]]\", \"assert generate_prime_matrix(3) == [[2, 3, 5], [7, 11, 13], [17, 19, 23]]\", \"assert generate_prime_matrix(4) == [[2, 3, 5, 7], [11, 13, 17, 19], [23, 29, 31, 37...
{ "split": "train", "index": 68941, "acecode_id": "evol_4512", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with simulating the process of a blockchain node receiving and processing blocks during the initial block download (IBD) phase. The node receives blocks that may arrive out of order, each containing a block height and a chainwork value. Your task is to implement ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_blocks([{'height': 1, 'chainwork': 150}, {'height': 2, 'chainwork': 100}, {'height': 3, 'chainwork': 50}], 200) == 2\", \"assert process_blocks([{'height': 1, 'chainwork': 100}, {'height': 2, 'chainwork': 100}, {'height': 3, 'chainwork': 100}], 350) ...
{ "split": "train", "index": 68942, "acecode_id": "oss_4405", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Write a function that takes a list of integers as input and returns a list of tuples, where each tuple contains a unique integer from the input list and its corresponding frequency count. The order of the unique integers in the output list should match their first appearance in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list_element_frequency([1, 2, 3, 1, 2, 4]) == [(1, 2), (2, 2), (3, 1), (4, 1)]\", \"assert list_element_frequency([10, 20, 10, 30, 20, 20]) == [(10, 2), (20, 3), (30, 1)]\", \"assert list_element_frequency([7, 8, 9, 7, 8, 9, 7]) == [(7, 3), (8, 2), (9, 2)]\"...
{ "split": "train", "index": 68943, "acecode_id": "evol_13944", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the behavior of managing a book in a library. Each book is identified by a unique ISBN (International Standard Book Number). The function should take the book's title, author, ISBN, and availability status as input para...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_book('The Catcher in the Rye', 'J.D. Salinger', '9780316769488') == {'title': 'The Catcher in the Rye', 'author': 'J.D. Salinger', 'isbn': '9780316769488', 'available': True}\", \"assert manage_book('1984', 'George Orwell', '9780451524935') == {'title...
{ "split": "train", "index": 68944, "acecode_id": "oss_19164", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an unsorted array of integers and a target integer, implement a function that searches for the target in the array and returns the index of its first occurrence. If the target integer is not found, return -1. The function should handle duplicate values in the array correc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert binary_search([3, 1, 4, 2, 5], 3) == 0\", \"assert binary_search([3, 1, 4, 2, 5], 6) == -1\", \"assert binary_search([1, 2, 2, 3, 2], 2) == 1\", \"assert binary_search([], 1) == -1\", \"assert binary_search([5, 5, 5, 5, 5], 5) == 0\", \"assert binary_search(...
{ "split": "train", "index": 68945, "acecode_id": "evol_3967", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with developing a function that processes a collection of nodes represented as a dictionary, where each node contains various attributes. Write a Python function `find_nodes_with_attribute_value(nodes: dict, attribute: str, value: str) -> list` that takes in a di...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_nodes_with_attribute_value({}, 'type', 'compute') == []\", \"assert find_nodes_with_attribute_value({'1': {'name': 'node1', 'type': 'compute'}}, 'type', 'compute') == ['node1']\", \"assert find_nodes_with_attribute_value({'1': {'name': 'node1', 'type': ...
{ "split": "train", "index": 68946, "acecode_id": "oss_1296", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function to simulate the retrieval of connected peers from a cryptocurrency network. Implement a function `nspv_getpeerinfo(node_ip: str, user_pass: str) -> str` that takes two parameters: `node_ip`, which is the IP address of the libnspv d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert nspv_getpeerinfo('http://192.168.1.1:54321', 'mypassword') == '{\\\"node_ip\\\": \\\"http://192.168.1.1:54321\\\", \\\"user_pass\\\": \\\"mypassword\\\", \\\"peers\\\": [{\\\"peer_id\\\": \\\"peer1\\\", \\\"status\\\": \\\"active\\\"}, {\\\"peer_id\\\": \\\"...
{ "split": "train", "index": 68947, "acecode_id": "oss_29017", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to calculate the information gain in a decision tree. Information gain is used in the construction of decision trees to determine the attribute that provides the greatest amount of information about the classification of a set of item...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert info_gain({'A': 30, 'B': 30}, [{'A': 15, 'B': 15}, {'A': 15, 'B': 15}]) == 0.0\", \"assert info_gain({'X': 5, 'Y': 5}, [{'X': 5, 'Y': 0}, {'X': 0, 'Y': 5}]) == 1.0\", \"assert info_gain({'C': 1, 'D': 1}, [{'C': 1, 'D': 0}, {'C': 0, 'D': 1}]) == 1.0\", \"asse...
{ "split": "train", "index": 68948, "acecode_id": "oss_20479", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a list of actions represented as strings. Each action can either be 'ALLOW' or 'DENY'. Your task is to create a function that takes this list of actions and returns a dictionary with two keys: 'allowed' and 'denied'. The value of 'allowed' should be the count of '...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_actions(['ALLOW', 'DENY', 'ALLOW']) == {'allowed': 2, 'denied': 1}\", \"assert count_actions(['DENY', 'DENY', 'DENY']) == {'allowed': 0, 'denied': 3}\", \"assert count_actions(['ALLOW', 'ALLOW', 'ALLOW']) == {'allowed': 3, 'denied': 0}\", \"assert coun...
{ "split": "train", "index": 68949, "acecode_id": "bigcode_python_fns_810", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes a list of sales data over a year, where each element is a list containing a month (as a string) and its corresponding sales (as an integer). The function should return the month with the highest sales and the month with the lowest sales from the prov...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calc_max_min([['January', 10], ['February', 15], ['March', 20], ['April', 17], ['May', 25], ['June', 18], ['July', 22], ['August', 19], ['September', 24], ['October', 28], ['November', 16], ['December', 23]]) == (['October', 28], ['January', 10])\", \"assert...
{ "split": "train", "index": 68950, "acecode_id": "evol_8074", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a given dictionary and performs specific operations on its key-value pairs. The function should take in a dictionary as input and return the total count of key-value pairs in the dictionary. Additionally, for each ke...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_dictionary({'a': 1, 'b': 2, 'c': 3}) == (['a: 1', 'b: 2', 'c: 3'], 3)\", \"assert process_dictionary({'x': 10, 'y': 20}) == (['x: 10', 'y: 20'], 2)\", \"assert process_dictionary({'name': 'Alice', 'age': 30}) == (['name: Alice', 'age: 30'], 2)\", \"a...
{ "split": "train", "index": 68951, "acecode_id": "oss_34028", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers ranging from 0 to 19. Your task is to implement a function that processes each number in the list by calculating its square and cube. The function should return a list of tuples where each tuple contains the original number, its square, and its ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_numbers([0, 1, 2, 3, 4]) == [(0, 0, 0), (1, 1, 1), (2, 4, 8), (3, 9, 27), (4, 16, 64)]\", \"assert process_numbers([5, 6, 7, 8, 9]) == [(5, 25, 125), (6, 36, 216), (7, 49, 343), (8, 64, 512), (9, 81, 729)]\", \"assert process_numbers([10, 11, 12]) ==...
{ "split": "train", "index": 68952, "acecode_id": "oss_10771", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the creation of a digital wallet. The function `create_wallet()` should accept a string parameter `client_name` which represents the name of the client for whom the wallet is being created. The function should return a dict...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_wallet('Alice') == {'client_name': 'Alice', 'wallet_id': 'Alice_wallet', 'balance': 0}\", \"assert create_wallet('Bob') == {'client_name': 'Bob', 'wallet_id': 'Bob_wallet', 'balance': 0}\", \"assert create_wallet('Charlie') == {'client_name': 'Charlie...
{ "split": "train", "index": 68953, "acecode_id": "bigcode_python_fns_24092", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that manages font loading and retrieval. Your function should take in two parameters: `font_name` (a string representing the name of the font file) and `font_size` (an integer representing the size of the font). The function should lo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_font('arial.ttf', 24) == None\", \"assert manage_font('times.ttf', 12) == None\", \"assert manage_font('arial.ttf', 12) == None\", \"assert manage_font('verdana.ttf', 14) == None\", \"assert manage_font('arial.ttf', 14) == None\", \"assert manage_font...
{ "split": "train", "index": 68954, "acecode_id": "oss_24301", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Given an array 'arr' of N integers, check if it is possible to achieve an array sorted in non-decreasing order by performing the following operations: 1. Perform right shift operation any number of times. 2. Swap exactly two elements in the array up to three times. Additionally...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rearrange_three_elements([]) == True\", \"assert rearrange_three_elements([1]) == False\", \"assert rearrange_three_elements([10, 9, 8, 7]) == False\", \"assert rearrange_three_elements([9, 8, 7, 6, 5]) == False\", \"assert rearrange_three_elements([8, 7, 6,...
{ "split": "train", "index": 68955, "acecode_id": "evol_30085", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Implement a recursive function that calculates the product of the sums of tuples in a list until the product exceeds a specified target value. Each tuple contains exactly two numeric elements. If the list is empty or if any element in the list is not a tuple of two integers or ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert product_of_sums([(2, 3), (4, 5), (6, 7)], 50) == 45\", \"assert product_of_sums([], 50) == 'Error: List is empty'\", \"assert product_of_sums([(1, 2)], 10) == 3\", \"assert product_of_sums([(0, 0), (0, 0)], 10) == 0\", \"assert product_of_sums([(3, 3)], 10) ...
{ "split": "train", "index": 68956, "acecode_id": "evol_4954", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of file paths. The function should iterate through all the files in the list and return a new list containing only the file names that have the extensions '.md.raw' or '.nbdata.raw'. Write a Python function `f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_raw_files(['file1.md.raw', 'file2.txt', 'file3.nbdata.raw', 'file4.jpg']) == ['file1.md.raw', 'file3.nbdata.raw']\", \"assert filter_raw_files(['doc1.md.raw', 'doc2.md', 'doc3.nbdata.raw', 'doc4.nbdata']) == ['doc1.md.raw', 'doc3.nbdata.raw']\", \"ass...
{ "split": "train", "index": 68957, "acecode_id": "oss_15198", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a numerical array and a specified target integer, write a function that returns all unique combinations of elements from the array that sum up to the target. Each combination should be returned as a list of integers, and the order of the integers in the combination should...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_combinations([1, 2, 2, 3], 4) == [[1, 3], [2, 2]]\", \"assert find_combinations([], 0) == [[]]\", \"assert find_combinations([5], 5) == [[5]]\", \"assert find_combinations([3, 5, 7], 12) == [[5, 7]]\", \"assert find_combinations([1, 2, 3], 6) == [[1, 2,...
{ "split": "train", "index": 68958, "acecode_id": "evol_16073", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Implement a Python function `perform_operation(x: float, y: float, operation: str) -> Union[float, str]` that takes two numbers and a string representing an arithmetic operation ('add', 'subtract', 'multiply', 'divide') and returns the result of the specified operation. The fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert perform_operation(10, 5, 'add') == 15\", \"assert perform_operation(10, 5, 'subtract') == 5\", \"assert perform_operation(10, 5, 'multiply') == 50\", \"assert perform_operation(10, 5, 'divide') == 2.0\", \"assert perform_operation(10.5, 2.5, 'add') == 13.0\"...
{ "split": "train", "index": 68959, "acecode_id": "evol_1736", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the sequence of messages exchanged between a device and an access point during a WPS (Wi-Fi Protected Setup) session. Each message is denoted by a string: 'M1', 'M2', 'M3', 'M4', 'M5', or 'msg=9'. Your task is to determine if there ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert detect_mismatch(['M1', 'M2', 'M3', 'M4', 'M5', 'msg=9']) == True\", \"assert detect_mismatch(['M1', 'M2', 'M3', 'M5', 'msg=9']) == True\", \"assert detect_mismatch(['M1', 'M2', 'M3', 'M4', 'msg=9', 'M5']) == False\", \"assert detect_mismatch(['M5', 'msg=9'])...
{ "split": "train", "index": 68960, "acecode_id": "bigcode_python_fns_25959", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Implement a Fibonacci search algorithm that takes a list of sorted strings and a target string as inputs and returns the index of the target string in the list. If the target string is not found, return -1. The input list will be sorted in ascending order and contain unique str...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fib_search(['a', 'c', 'g', 'm', 'o', 't'], 'm') == 3\", \"assert fib_search(['a', 'c', 'g', 'm', 'o', 't'], 'a') == 0\", \"assert fib_search(['a', 'c', 'g', 'm', 'o', 't'], 't') == 5\", \"assert fib_search(['a', 'c', 'g', 'm', 'o', 't'], 'c') == 1\", \"asser...
{ "split": "train", "index": 68961, "acecode_id": "evol_1148", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function `negate_values(nums: List[int]) -> List[int]` that negates each value in the list and returns a new list with the negated values. The negation of a number x is defined as -x. The input list can contain both positive and negative in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert negate_values([1, 2, 3]) == [-1, -2, -3]\", \"assert negate_values([-1, -2, -3]) == [1, 2, 3]\", \"assert negate_values([0]) == [0]\", \"assert negate_values([5, -5, 0]) == [-5, 5, 0]\", \"assert negate_values([10, 20, -30, -40]) == [-10, -20, 30, 40]\", \"a...
{ "split": "train", "index": 68962, "acecode_id": "bigcode_python_fns_24858", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 2D array `image` representing a grayscale image, implement a function `filter_image(image: List[List[int]], scalings: List[int]) -> List[List[List[float]]]` that returns a list of filtered images based on the given downsampling factors in `scalings`. For each downsampli...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_image([[0, 0], [0, 0]], [1]) == [[[0.0, 0.0], [0.0, 0.0]]]\", \"assert filter_image([[255, 255], [255, 255]], [1]) == [[[127.5, 127.5], [127.5, 127.5]]]\", \"assert filter_image([[10, 20, 30], [40, 50, 60]], [1]) == [[[5.0, 10.0, 15.0], [20.0, 25.0, 3...
{ "split": "train", "index": 68963, "acecode_id": "bigcode_python_fns_37681", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a password generation algorithm. The algorithm takes a string `md` of length at least 6 as input and generates a password of length 8. The algorithm constructs the password by iterating through the characters of the input string and filling the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_password('abcdefgh') == 'abcdefgh'\", \"assert generate_password('abc') == 'abc' + ''*5\", \"assert generate_password('a b c d e f g h') == 'abcdefgh'\", \"assert generate_password('1234567890') == '12345678'\", \"assert generate_password('hello wor...
{ "split": "train", "index": 68964, "acecode_id": "oss_31269", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes an array of integers and returns the maximum and minimum values from the array. The input array will have a length between 10 and 100. You need to handle the input array efficiently, ensuring that you iterate through it only once.\nPlease reason ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_max_min([8, 22, 61, 17, 46, 10, 5, 90]) == (90, 5)\", \"assert find_max_min([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == (10, 1)\", \"assert find_max_min([100, 99, 98, 97, 96, 95, 94, 93, 92, 91]) == (100, 91)\", \"assert find_max_min([23, 45, 67, 12, 34, 89, 2,...
{ "split": "train", "index": 68965, "acecode_id": "evol_626", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Create a function `build_https_link(sub_domain: str, domain: str, path: str, query_params: dict, hash_val: str = '') -> str` that constructs a secure HTTPS hyperlink from the provided components: sub-domain, main domain, specified path, query parameters, and an optional hash va...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert build_https_link('mypage', 'google', 'search', {'q': 'python programming'}) == 'https://mypage.google/search?q=python+programming'\", \"assert build_https_link('yourpage', 'duckduckgo', 'query', {'p': 'java software'}, 'section1') == 'https://yourpage.duckdu...
{ "split": "train", "index": 68966, "acecode_id": "evol_30868", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to retrieve vehicle statistics for a specified player in a game statistics application. The function should take four parameters: `region` (a string representing the player's region), `playerName` (a string representing the player's n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert getStatistics('NA', 'Player1', 1, {}) == {1: {'region': 'NA', 'playerName': 'Player1', 'vehicleStats': {}}}\", \"assert getStatistics('EU', 'Player2', 2, {}) == {2: {'region': 'EU', 'playerName': 'Player2', 'vehicleStats': {}}}\", \"assert getStatistics('AS'...
{ "split": "train", "index": 68967, "acecode_id": "oss_7162", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a binary tree with n nodes as input, write a Python function that calculates the maximum depth of the tree and returns the maximum depth along with the depth level that contains the maximum number of nodes. If the tree is empty, return (0, -1), and if the tree contains on...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_depth_and_max_nodes_level(None) == (0, -1)\", \"assert max_depth_and_max_nodes_level(TreeNode(1)) == (1, 0)\", \"assert max_depth_and_max_nodes_level(TreeNode(1, TreeNode(2, TreeNode(4)), TreeNode(3))) == (3, 1)\", \"assert max_depth_and_max_nodes_level(...
{ "split": "train", "index": 68968, "acecode_id": "evol_3634", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a binary tree, implement a function that returns the sum of values of nodes that have an even-valued grandparent and an odd-valued parent. A grandparent is defined as the parent of a node's parent. If there are no nodes that meet this condition, return `0`.\nPlease reason...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sumEvenGrandparent(TreeNode(2, TreeNode(3), TreeNode(4))) == 0\", \"assert sumEvenGrandparent(TreeNode(1, TreeNode(2, TreeNode(3), TreeNode(4, TreeNode(5), None)), TreeNode(6))) == 0\", \"assert sumEvenGrandparent(TreeNode(2)) == 0\", \"assert sumEvenGrandpa...
{ "split": "train", "index": 68969, "acecode_id": "evol_9878", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Write a function `find_char_positions(s1: str, s2: str) -> Union[str, List[int]]` that takes in two strings `s1` and `s2`. The function should randomly select a character from `s1`, check if that character exists in `s2`, and return a list of indices where that character occurs...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_char_positions('xyz', 'abcde') == 'Character does not occur in the second string'\", \"assert find_char_positions('', 'abc') == 'Character does not occur in the second string'\", \"assert find_char_positions('abc', 'xyz') == 'Character does not occur in...
{ "split": "train", "index": 68970, "acecode_id": "evol_26747", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a list of integers, compute the sum of the second smallest and second largest prime (non-composite) numbers present in the list. If the list does not contain at least two prime numbers, return None.\nPlease reason step by step, then write a self-contained Python solution....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_sum([12, 8, -22, 17, 5, -3, 11, 7]) == 18\", \"assert compute_sum([10, 15, 3, 5, 7]) == 10\", \"assert compute_sum([-1, -2, -3, -4]) == None\", \"assert compute_sum([4, 6, 8, 9]) == None\", \"assert compute_sum([2, 4, 6, 8, 10]) == None\", \"assert c...
{ "split": "train", "index": 68971, "acecode_id": "evol_21887", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given a list of words, generate a dictionary that contains links for each word based on the specified contexts. Each link is constructed using a base command string where the word and context are inserted into specific placeholders. The function should return a dictionary where...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_links(['apple', 'banana'], 'http://example.com/?word={0}&context={1}') == {'right': {'apple': 'http://example.com/?word=apple&context=right', 'banana': 'http://example.com/?word=banana&context=right'}, 'left': {'apple': 'http://example.com/?word=app...
{ "split": "train", "index": 68972, "acecode_id": "bigcode_python_fns_22002", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a binary string consisting of only '0's and '1's, write a function that takes the string as input and returns a new string where all the '0's are replaced with '1's and all the '1's are replaced with '0's. The output should maintain the order of the characters in the inpu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert flip_binary_string('1100') == '0011'\", \"assert flip_binary_string('0000') == '1111'\", \"assert flip_binary_string('1111') == '0000'\", \"assert flip_binary_string('101010') == '010101'\", \"assert flip_binary_string('') == ''\", \"assert flip_binary_strin...
{ "split": "train", "index": 68973, "acecode_id": "bigcode_python_fns_25748", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `count_words_performance(text: str) -> float` that takes a string `text` as input and returns the time taken to count the number of words in the text. The number of words is determined by splitting the text on spaces. The function should return the execution ti...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert abs(count_words_performance('Hello world') - 0.0) < 0.1\", \"assert abs(count_words_performance('This is a test string') - 0.0) < 0.1\", \"assert abs(count_words_performance('One two three four five') - 0.0) < 0.1\", \"assert abs(count_words_performance('Pyt...
{ "split": "train", "index": 68974, "acecode_id": "evol_12358", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a 2D array `mask` of boolean values, where `True` represents a masked pixel and `False` represents an unmasked pixel. Each unmasked pixel can be divided into smaller sub-pixels based on a provided `sub_size`. Your task is to write a function that calculates the to...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert total_sub_pixels_from_mask([[False, False], [False, False]], 3) == 36\", \"assert total_sub_pixels_from_mask([[True, True], [True, True]], 1) == 0\", \"assert total_sub_pixels_from_mask([[False]], 1) == 1\", \"assert total_sub_pixels_from_mask([[True]], 2) =...
{ "split": "train", "index": 68975, "acecode_id": "bigcode_python_fns_40618", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function that takes two lists: a list of keys and a corresponding list of values, and generates a hierarchical dictionary. The first key should map to a dictionary containing the next key, and so forth, until the last key maps to its corresponding value. If the list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert hierarchical_dict(['a', 'b', 'c'], [1, 2, 3]) == {'a': {'b': {'c': 3}}}\", \"assert hierarchical_dict(['x', 'y'], [10, 20]) == {'x': {'y': 20}}\", \"assert hierarchical_dict(['first', 'second', 'third'], ['one', 'two', 'three']) == {'first': {'second': {'thi...
{ "split": "train", "index": 68976, "acecode_id": "evol_3266", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a 2D list of integers representing a grid where each integer corresponds to a color value. Your task is to convert this grid into a flat list of color values. If the grid is 2-dimensional (rows x columns), you need to return the color values in a flattened list wh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert flatten_color_grid([[255, 0, 0], [0, 255, 0], [0, 0, 255]]) == [255, 0, 0, 0, 255, 0, 0, 0, 255]\", \"assert flatten_color_grid([[[255, 0, 0], [0, 255, 0]], [[0, 0, 255], [255, 255, 0]]]) == [16711680, 65280, 255, 16776960]\", \"assert flatten_color_grid([[0...
{ "split": "train", "index": 68977, "acecode_id": "bigcode_python_fns_31914", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple text-based adventure game in Python. The game will involve navigating through different rooms represented by the `Room` class. Each room has a name, description, and possible exits to other rooms. Your task is to implement a function ca...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_rooms_and_connections()[0].get_exit('east') == None\", \"assert create_rooms_and_connections()[2].get_exit('north') == None\", \"assert create_rooms_and_connections()[0].name == 'Kitchen'\", \"assert create_rooms_and_connections()[1].name == 'Bedroom'...
{ "split": "train", "index": 68978, "acecode_id": "oss_4153", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are working on a software development project that involves building a kernel module for a custom operating system. Your task is to write a Python function that generates the content of a Kbuild file for a kernel module based on the provided module name. The function should...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_kbuild_content('jerry_module') == 'obj-m += jerry_module.o\\\\n\\\\nall:\\\\n\\\\tmake -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules\\\\n\\\\nclean:\\\\n\\\\tmake -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean'\", \"assert generat...
{ "split": "train", "index": 68979, "acecode_id": "oss_33407", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of edges representing an undirected graph and a source node, implement a function to find an Eulerian path from the source node that visits every edge exactly once. If the graph does not have an Eulerian path, return an empty list. An Eulerian path exists if at mos...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_eulerian_path([(0, 1), (1, 2), (1, 3), (2, 3), (3, 0)], 0) == []\", \"assert find_eulerian_path([(0, 1), (1, 2), (2, 0), (3, 4)], 0) == []\", \"assert find_eulerian_path([(0, 1), (1, 2), (2, 3), (3, 0), (3, 4)], 0) == []\", \"assert find_eulerian_path([...
{ "split": "train", "index": 68980, "acecode_id": "bigcode_python_fns_18923", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Implement a function that converts a given string into its Morse code representation. The input string will consist of uppercase letters, digits, and spaces. Each character should be separated by a space in the Morse code output. For instance, the input 'HELLO' should return '....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert string_to_morse('HELLO') == '.... . .-.. .-.. --- '\", \"assert string_to_morse('SOS') == '... --- ... '\", \"assert string_to_morse('123') == '.---- ..--- ...-- '\", \"assert string_to_morse('GOODBYE') == '--. --- --- -.. -... -.-- . '\", \"assert string_to...
{ "split": "train", "index": 68981, "acecode_id": "evol_18348", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given a function that decorates another function to parse options and run a recipe. Your task is to implement a function named `run_recipe` that takes a function as input, along with an options dictionary and a verbosity flag. The `run_recipe` function should set the ve...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert run_recipe(lambda option1, option2: f'Executed with {option1} and {option2}', {'option1': 'a', 'option2': 'b'}, True) == 'Executed with a and b'\", \"assert run_recipe(lambda option1, option2: f'Executed with {option1} and {option2}', {'option1': '1', 'optio...
{ "split": "train", "index": 68982, "acecode_id": "bigcode_python_fns_20446", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two arrays of positive integers, `boxes` and `warehouse`, representing the heights of boxes and the heights of rooms in a warehouse respectively. The warehouse has rooms indexed from `0` to `n - 1` from left to right, with `warehouse[i]` (0-indexed) indicating the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert maxBoxesInWarehouse([4,3,4,1], [5,3,3,4,1]) == 3\", \"assert maxBoxesInWarehouse([1,2,2,3,4], [3,4,1,2]) == 3\", \"assert maxBoxesInWarehouse([4,5,6], [3,3,3,3,3]) == 0\", \"assert maxBoxesInWarehouse([1,1,1], [1,1,1,1]) == 3\", \"assert maxBoxesInWarehouse(...
{ "split": "train", "index": 68983, "acecode_id": "evol_34676", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Write a function `extract_data` that takes a list of dictionaries, where each dictionary represents an item with keys 'name', 'description', and 'price', and returns a list of items sorted by price in ascending order. Each item in the output list should be a dictionary containi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_data([{'name': 'Item A', 'description': 'Description A', 'price': 10.00}, {'name': 'Item B', 'description': 'Description B', 'price': 5.00}, {'name': 'Item C', 'description': 'Description C', 'price': 20.00}]) == [{'name': 'Item B', 'description': 'D...
{ "split": "train", "index": 68984, "acecode_id": "evol_20613", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given two lists of integers, `y_true` and `y_pred`, representing the true labels and predicted labels respectively, write a function `mean_iou(y_true: List[int], y_pred: List[int]) -> float` that computes the mean Intersection over Union (IoU) for these two lists. The IoU for e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert mean_iou([1, 1, 1], [1, 1, 1]) == 1.0\", \"assert mean_iou([1, 2, 3], [4, 5, 6]) == 0.0\", \"assert mean_iou([], []) == 0.0\", \"assert mean_iou([1, 2, 3], [1, 2, 3]) == 1.0\", \"assert mean_iou([0, 0, 2], [0, 0, 2]) == 1.0\", \"assert mean_iou([1, 2, 3, 4],...
{ "split": "train", "index": 68985, "acecode_id": "bigcode_python_fns_4124", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Implement a function that detects all occurrences of a particular substring within a given string, including overlapping sequences. The function should return a list of tuples, where each tuple contains the starting and ending positions of the found substring. The starting posi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_all_substrings('Hello, Hello, Hello!', 'llo') == [(2, 5), (9, 12), (16, 19)]\", \"assert find_all_substrings('abcabcabc', 'abc') == [(0, 3), (3, 6), (6, 9)]\", \"assert find_all_substrings('aaaaaa', 'aa') == [(0, 2), (1, 3), (2, 4), (3, 5), (4, 6)]\", \...
{ "split": "train", "index": 68986, "acecode_id": "evol_16445", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that returns a list of all possible pairs of adjacent elements from the input list. Each pair should be represented as a tuple, and the order of pairs in the output list should reflect the order of elements in the input list.\nPlea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sequencial_pairs([1, 2, 3, 4]) == [(1, 2), (2, 3), (3, 4)]\", \"assert sequencial_pairs([5, 10, 15]) == [(5, 10), (10, 15)]\", \"assert sequencial_pairs([7]) == []\", \"assert sequencial_pairs([]) == []\", \"assert sequencial_pairs([1, 1, 1]) == [(1, 1), (1,...
{ "split": "train", "index": 68987, "acecode_id": "evol_29237", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a table represented as a list of lists, where each inner list represents a row of the table. You need to implement a function that aligns the elements of a specified column in the table based on a given alignment option: 'left', 'right', or 'center'. The alignment...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert align_column([['Name', 'Age'], ['Alice', '30'], ['Bob', '25']], 1, 'left') == [('Name', 'Age'), ('Alice', '30 '), ('Bob', '25 ')]\", \"assert align_column([['Name', 'Age'], ['Alice', '30'], ['Bob', '25']], 1, 'right') == [('Name', 'Age'), ('Alice', ' 30'), (...
{ "split": "train", "index": 68988, "acecode_id": "bigcode_python_fns_189", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to simulate the connection attempts to a database management system (DBMS). The function should take four parameters: host (string), port (integer), username (string), and password (string). It will attempt to connect to the DBMS with...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert connect_to_db('localhost', 3306, 'user', 'password') == 'Connected DBMS Object'\", \"assert connect_to_db('db.example.com', 27017, 'mongo', 'mongo') == 'Connected DBMS Object'\", \"assert connect_to_db('test.server', 8080, 'test', 'test123') == 'Connected DB...
{ "split": "train", "index": 68989, "acecode_id": "oss_23116", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple text-based adventure game that allows a player to navigate through a series of rooms. Each room has a name, a description, and a set of possible actions the player can take. Your task is to write a function that, given a list of rooms and t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_room_info([{'name': 'Room1', 'description': 'A dark cave.', 'actions': ['Look around', 'Leave']}, {'name': 'Room2', 'description': 'A sunny field.', 'actions': ['Sit down', 'Run'] }], 'Room1') == {'description': 'A dark cave.', 'actions': ['Look around',...
{ "split": "train", "index": 68990, "acecode_id": "oss_9244", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that generates a random sequence composed of five unique characters from the alphanumeric set (both uppercase, lowercase letters, and digits). The function should ensure that the resulting combination does not repeat any character and that it returns the sequen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert len(generate_random_sequence()) == 5\", \"assert len(set(generate_random_sequence())) == 5\", \"assert all(c.isalnum() for c in generate_random_sequence())\", \"assert all(c in 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' for c in generat...
{ "split": "train", "index": 68991, "acecode_id": "evol_35593", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, compute the least number of alterations needed to convert the array into a strictly increasing palindrome. The number of distinct modifications allowed is specified by a limit. If it is impossible to achieve the transformation within the given limit,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert smallest_change([10,20,30,40,50,30,20,10], 2) == 2\", \"assert smallest_change([5, 4, 3, 2, 1], 1) == 'Impossible'\", \"assert smallest_change([1, 2, 3, 4, 3, 2, 1], 2) == 0\", \"assert smallest_change([10, 10, 10, 10], 1) == 0\", \"assert smallest_change([5...
{ "split": "train", "index": 68992, "acecode_id": "evol_20316", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of filters and a specific filter to remove from the list. The function should return a new list with the specified filter removed. If the filter does not exist in the list, return the original list unchanged. Implement t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_filter_from_list(['filter1', 'filter2', 'filter3'], 'filter2') == ['filter1', 'filter3']\", \"assert remove_filter_from_list(['filter1', 'filter2', 'filter3'], 'filter4') == ['filter1', 'filter2', 'filter3']\", \"assert remove_filter_from_list([], 'fi...
{ "split": "train", "index": 68993, "acecode_id": "bigcode_python_fns_37306", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that performs a linear search on a one-dimensional list to locate a specific element. The function should return a list of indices where the element occurs in the list. If the element does not exist in the list, return an empty list.\nPlease reason step by ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert linear_search([1, 2, 3, 4, 5], 3) == [2]\", \"assert linear_search([1, 2, 3, 4, 5], 6) == []\", \"assert linear_search([1, 2, 2, 3, 2], 2) == [1, 2, 4]\", \"assert linear_search([], 1) == []\", \"assert linear_search([5, 5, 5, 5, 5], 5) == [0, 1, 2, 3, 4]\",...
{ "split": "train", "index": 68994, "acecode_id": "evol_12266", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that creates a list of user objects based on provided user data. Each user has a username, password, email, age, and gender. The function should take a list of dictionaries, where each dictionary contains the user's information, and r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_users([{'username': 'user1', 'password': 'pass1', 'email': 'user1@example.com', 'age': 25, 'gender': 'male'}]) == [{'username': 'user1', 'password': 'pass1', 'email': 'user1@example.com', 'age': 25, 'gender': 'male'}]\", \"assert create_users([{'usern...
{ "split": "train", "index": 68995, "acecode_id": "bigcode_python_fns_11723", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that translates a given text message from English to emoji language. The emoji language is represented by a dictionary where English words or phrases are mapped to their corresponding emoji symbols. Implement a function `translate_...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert translate_to_emoji('Hello, world!', {'hello': '\\ud83d\\udc4b', 'world': '\\ud83c\\udf0d'}) == '\\ud83d\\udc4b, \\ud83c\\udf0d!'\", \"assert translate_to_emoji('xd is funny!', {'xd': '\\ud83d\\ude02'}) == '\\ud83d\\ude02 is funny!'\", \"assert translate_to_e...
{ "split": "train", "index": 68996, "acecode_id": "oss_30497", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function to manage the activation of a VPN service. The function should accept an activation key and simulate the activation process. The function should check if the activation key is valid. If the activation key is 'VALID_KEY', the fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert conn_start('VALID_KEY') == 'Activation successful'\", \"assert conn_start('VALID_KEY') == 'Activation successful'\", \"assert conn_start('VALID_KEY') == 'Activation successful'\", \"assert conn_start('VALID_KEY') == 'Activation successful'\", \"assert conn_s...
{ "split": "train", "index": 68997, "acecode_id": "oss_31188", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function `median(numbers: List[int]) -> List[int]` that returns a list of medians for the input numbers as they are added one by one. The median is defined as the middle value in a sorted list of numbers. If the list has an even number of e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert median([1]) == [1]\", \"assert median([1, 2]) == [1, 1]\", \"assert median([1, 2, 3]) == [1, 1, 2]\", \"assert median([1, 2, 3, 4]) == [1, 1, 2, 2]\", \"assert median([8, 6, 7, 5]) == [8, 7, 7, 6]\", \"assert median([0, 0, 0, 0, 0]) == [0, 0, 0, 0, 0]\", \"a...
{ "split": "train", "index": 68998, "acecode_id": "bigcode_python_fns_37945", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You need to create a function that compares two lists of numerical values and returns a list of similarity scores based on a specified comparison method. The function will take two lists and a string indicating the comparison method. The supported comparison methods are 'absdev...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compare_lists([1.0, 2.0, 3.0], [1.0, 2.0, 3.0], 'absdev') == [0.0, 0.0, 0.0]\", \"assert compare_lists([1.0, 2.0, 3.0], [3.0, 2.0, 1.0], 'absdev') == [2.0, 0.0, 2.0]\", \"assert compare_lists([1.0, 2.0], [2.0, 4.0], 'squared') == [1.0, 4.0]\", \"assert compa...
{ "split": "train", "index": 68999, "acecode_id": "bigcode_python_fns_30158", "num_tests": 16 }