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 an array of two strings. Write a function called `mutations` that takes this array as input and returns true if the first string contains all the letters of the second string (case-insensitive), and false otherwise. The comparison should ignore the case of the let...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert mutations(['hello', 'Hello']) == True\", \"assert mutations(['hello', 'hey']) == False\", \"assert mutations(['Alien', 'line']) == True\", \"assert mutations(['abc', 'a']) == True\", \"assert mutations(['abc', 'd']) == False\", \"assert mutations(['A', 'a'])...
{ "split": "train", "index": 83800, "acecode_id": "oss_21133", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `generate_url` that constructs a URL given the following parameters: a base URL, a prefix, a context, a name, and a postfix. The function should return the formatted URL string. The URL format should be as follows: `https://<base-url>/<pr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_url('em.myproject.svc:8443', 'transit', 'sample', 'view', 'tuples') == 'https://em.myproject.svc:8443/transit/sample/view/tuples'\", \"assert generate_url('example.com', 'jobs', 'context1', 'name1', 'info') == 'https://example.com/jobs/context1/name...
{ "split": "train", "index": 83801, "acecode_id": "bigcode_python_fns_12472", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a configuration dictionary that contains user credentials in JSON format. The credentials are nested within the dictionary under the keys 'credentials', 'gspread', and 'credential'. Your task is to implement a function `extract_credentials(config: dict) -> str` th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_credentials({'credentials': {'gspread': {'credential': '{\\\"client_email\\\":\\\"example@example.com\\\",\\\"private_key\\\":\\\"-----BEGIN PRIVATE KEY-----\\\\n...\\\\n-----END PRIVATE KEY-----\\\\n\\\"}'}}}) == '{\\\"client_email\\\":\\\"example@e...
{ "split": "train", "index": 83802, "acecode_id": "bigcode_python_fns_8002", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `word`, write a function `find_closest_vowel_subsequence` that identifies the first single vowel or a pair of vowels nestled between two consonants when searching from the end of the string. If such a vowel or pair is found, return it. If none are found, return a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_closest_vowel_subsequence('bat') == 'a'\", \"assert find_closest_vowel_subsequence('piano') == 'o'\", \"assert find_closest_vowel_subsequence('symphony') == 'o'\", \"assert find_closest_vowel_subsequence('fly') == ''\", \"assert find_closest_vowel_subse...
{ "split": "train", "index": 83803, "acecode_id": "evol_34309", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a list of integers `data`, your task is to normalize the values in the list such that the sum of all elements equals 1. The normalized value for each element is calculated by dividing the element by the sum of all elements in the list. If the sum of the list is zero, retu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert normalize_data([1, 2, 3]) == [0.16666666666666666, 0.3333333333333333, 0.5]\", \"assert normalize_data([0, 0, 0]) == [0.0, 0.0, 0.0]\", \"assert normalize_data([-1, -1, -1]) == [0.3333333333333333, 0.3333333333333333, 0.3333333333333333]\", \"assert normaliz...
{ "split": "train", "index": 83804, "acecode_id": "bigcode_python_fns_23495", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that returns the number of unique elements in the list. The function should take a single parameter, `lst`, which is a list of integers. You may assume that the list will always contain at least one element.\nPlease reason step by step...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_unique_elements([1, 2, 2, 3, 4, 4, 4, 5, 6, 7, 7]) == 7\", \"assert count_unique_elements([1, 1, 1, 1]) == 1\", \"assert count_unique_elements([1, 2, 3, 4, 5]) == 5\", \"assert count_unique_elements([10, 20, 10, 30, 20]) == 3\", \"assert count_unique_e...
{ "split": "train", "index": 83805, "acecode_id": "evol_33936", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a positive integer n, implement a function that returns a list of all even numbers up to n if n is even, and a list of all odd numbers up to n if n is odd. The function should be named `generate_numbers`. For example, if the input is 5, the output should be [1, 3, 5] (for...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_numbers(5) == [1, 3, 5]\", \"assert generate_numbers(4) == [2, 4]\", \"assert generate_numbers(1) == [1]\", \"assert generate_numbers(2) == [2]\", \"assert generate_numbers(0) == []\", \"assert generate_numbers(10) == [2, 4, 6, 8, 10]\", \"assert ge...
{ "split": "train", "index": 83806, "acecode_id": "evol_8290", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `fibonacci(n: int) -> List[int]` that computes the Fibonacci sequence up to the nth term, where n is a positive integer. The Fibonacci sequence is defined as follows: the first two terms are 0 and 1, and each subsequent term is the sum of the two preceding term...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci(1) == [0]\", \"assert fibonacci(2) == [0, 1]\", \"assert fibonacci(3) == [0, 1, 1]\", \"assert fibonacci(4) == [0, 1, 1, 2]\", \"assert fibonacci(5) == [0, 1, 1, 2, 3]\", \"assert fibonacci(6) == [0, 1, 1, 2, 3, 5]\", \"assert fibonacci(7) == [0, 1...
{ "split": "train", "index": 83807, "acecode_id": "evol_6275", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function `create_app(config: str) -> str` that generates a string representing the configuration of a Flask application based on the provided configuration name. The function should accept a string parameter `config`, which can be one of the follow...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_app('DevelopConfig') == 'App created with DevelopConfig and static folder at /path/to/DevelopConfig/src/static'\", \"assert create_app('ProductionConfig') == 'App created with ProductionConfig and static folder at /path/to/ProductionConfig/src/static'...
{ "split": "train", "index": 83808, "acecode_id": "bigcode_python_fns_12643", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Define a function named 'diffList' that accepts a list of integers 'numList' and a boolean 'absolute_difference' (default to False). The function should return a new list that contains the difference of each pair of consecutive numbers from 'numList'. If 'absolute_difference' i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert diffList([1, 2, 3]) == [1, 1]\", \"assert diffList([2, 5, 9, 16]) == [3, 4, 7]\", \"assert diffList([2, 5, 9, 16], absolute_difference=True) == [3, 4, 7]\", \"assert diffList([10, 20, 30]) == [10, 10]\", \"assert diffList([5, 3, 1]) == [-2, -2]\", \"assert d...
{ "split": "train", "index": 83809, "acecode_id": "evol_15252", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a non-negative integer, implement a function `check_number(input_number)` that checks whether the input is a valid non-negative integer and returns a dictionary with the following details: \n1. If the input is invalid (not a non-negative integer), return a message indicat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_number('abc') == {'abc': ('The input should be a non-negative integer', [], None, None, None)}\", \"assert check_number(1) == {1: (False, [1], 1, None, None)}\", \"assert check_number(2) == {2: (True, [1, 2], 3, 2, (2, 1))}\", \"assert check_number(3) ...
{ "split": "train", "index": 83810, "acecode_id": "evol_32066", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Write a Python function that converts an IP address from dot-decimal notation to binary notation. The function should take a single string parameter representing the IP address. If the input is not a valid IP address (i.e., if any segment is not a number between 0 and 255), the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_ip('192.168.1.1') == '11000000.10101000.00000001.00000001'\", \"assert convert_ip('0.0.0.0') == '00000000.00000000.00000000.00000000'\", \"assert convert_ip('255.255.255.255') == '11111111.11111111.11111111.11111111'\", \"assert convert_ip('256.100.5...
{ "split": "train", "index": 83811, "acecode_id": "evol_32371", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given four integer lists A, B, C, and D, write a function `four_sum_count(A: List[int], B: List[int], C: List[int], D: List[int]) -> int` that returns the number of tuples (i, j, k, l) such that A[i] + B[j] + C[k] + D[l] equals zero. Each list has the same length N, where 0 <= ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert four_sum_count([1, 2], [-2, -1], [-1, 2], [0, 2]) == 2\", \"assert four_sum_count([], [], [], []) == 0\", \"assert four_sum_count([0], [0], [0], [0]) == 1\", \"assert four_sum_count([-1], [1], [-1], [1]) == 1\", \"assert four_sum_count([0, 0, 0], [0, 0, 0], ...
{ "split": "train", "index": 83812, "acecode_id": "evol_19539", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a two-dimensional list of integers, implement a function that flattens the list, removes any duplicate elements, and returns the resulting list in sorted order. The function should be defined as follows: def flatten_sort_unique(two_d_list):\nPlease reason step by step, th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert flatten_sort_unique([[1, 2, 3], [3, 4, 5, 5, 6, 6], [1, 4, 7], [8, 9]]) == [1, 2, 3, 4, 5, 6, 7, 8, 9]\", \"assert flatten_sort_unique([[5, 1, 3], [3, 5, 1], [5, 5, 1]]) == [1, 3, 5]\", \"assert flatten_sort_unique([[0, 0, 0], [0], []]) == [0]\", \"assert fl...
{ "split": "train", "index": 83813, "acecode_id": "evol_11101", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an XML document containing employee details structured as follows: each employee is represented by an 'employee' element, which contains a 'name' element. The 'name' element has attributes 'salary' and 'designation', and the text content of the 'name' element represents t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_employee_details('<doc><employee><name salary=\\\"50000\\\" designation=\\\"Developer\\\">John Doe</name></employee></doc>') == [{'name': 'John Doe', 'salary': '50000', 'designation': 'Developer'}]\", \"assert get_employee_details('<doc><employee><name s...
{ "split": "train", "index": 83814, "acecode_id": "evol_13909", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `value`, implement a function that removes all special characters from the string except for periods (.) and negative signs (-). The function should return a new string that contains only alphanumeric characters along with the allowed special characters. For exam...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_special_characters('ICE') == 'ICE'\", \"assert remove_special_characters('-4.2') == '-4.2'\", \"assert remove_special_characters('%&!@#8.32&#*;') == '8.32'\", \"assert remove_special_characters('123abc!@#') == '123abc'\", \"assert remove_special_chara...
{ "split": "train", "index": 83815, "acecode_id": "bigcode_python_fns_12434", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of numerical data points. Write a function `cumulative_ratio(data: List[float], reverse: bool = False) -> Tuple[List[float], List[float]]` that calculates the cumulative ratio of the sorted data points. The function should return two lists: the first list c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cumulative_ratio([3, 1, 2], False) == ([1, 2, 3], [0.3333333333333333, 0.6666666666666666, 1.0])\", \"assert cumulative_ratio([3, 1, 2], True) == ([3, 2, 1], [0.3333333333333333, 0.6666666666666666, 1.0])\", \"assert cumulative_ratio([5, 3, 8, 4], False) == ...
{ "split": "train", "index": 83816, "acecode_id": "bigcode_python_fns_10953", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a luminosity value in ergs per second, convert it to solar luminosity (Lsun). The conversion factor is that 1 Lsun is equal to approximately 3.828e+33 ergs/s. Implement a function `ergs_to_lsun(luminosity: float) -> float` that takes a single parameter, `luminosity`, whic...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert abs(ergs_to_lsun(3.828e+33) - 1.0) < 1e-6\", \"assert abs(ergs_to_lsun(7.656e+33) - 2.0) < 1e-6\", \"assert abs(ergs_to_lsun(0) - 0.0) < 1e-6\", \"assert abs(ergs_to_lsun(1.914e+34) - 5.0) < 1e-6\", \"assert abs(ergs_to_lsun(3.828e+34) - 10.0) < 1e-6\"]}" }
{ "split": "train", "index": 83817, "acecode_id": "bigcode_python_fns_37405", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a list of file names and need to construct a dictionary that maps the original file paths to their corresponding preprocessed file paths. The original file paths are constructed by prepending a fixed string '/path/to/root/data/training/' to each file name, while t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert preprocess_file_paths(['file1.csv', 'file2.csv']) == {'/path/to/root/data/training/file1.csv': '/path/to/root/data/preprocess/file1.csv', '/path/to/root/data/training/file2.csv': '/path/to/root/data/preprocess/file2.csv'}\", \"assert preprocess_file_paths(['...
{ "split": "train", "index": 83818, "acecode_id": "oss_8649", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Develop a function that takes an array of integers and identifies all pairs of elements that have the smallest difference between them. The function should return these pairs in ascending order, ensuring that the lower value in the pair appears first. The function must also han...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_closest_pairs([3, 1, 4, 1, 5, 9, 2, 6, 5]) == [(1, 1), (5, 5)]\", \"assert find_closest_pairs([1]) == []\", \"assert find_closest_pairs([]) == []\", \"assert find_closest_pairs([1, 2, 2, 3]) == [(2, 2)]\", \"assert find_closest_pairs([5, 5, 5, 5]) == [(...
{ "split": "train", "index": 83819, "acecode_id": "evol_1738", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that decorates a given function as a command. The decorator should add an attribute `__command__` with the value `True` to the function. Your function should take a single function as input and return the same function with the added ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert hasattr(cmd(lambda: None), '__command__') == True\", \"assert cmd(lambda: 1).__command__ == True\", \"assert cmd(lambda: 2 + 2).__command__ == True\", \"assert cmd(lambda: None).__command__ == True\", \"assert cmd(lambda: True).__command__ == True\", \"asser...
{ "split": "train", "index": 83820, "acecode_id": "bigcode_python_fns_24509", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a string representing a sequence of characters. Your task is to create a function that counts the number of times each character appears in the string and returns a dictionary with characters as keys and their counts as values. The function should be case-sensitiv...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_character_occurrences('Hello World') == {'H': 1, 'e': 1, 'l': 3, 'o': 2, 'W': 1, 'r': 1, 'd': 1}\", \"assert count_character_occurrences('') == {}\", \"assert count_character_occurrences('aaaAAA') == {'a': 3, 'A': 3}\", \"assert count_character_occurre...
{ "split": "train", "index": 83821, "acecode_id": "bigcode_python_fns_31147", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Implement a function that accepts a list of strings and concatenates them into a single string without using the built-in concatenation or join function. Additionally, the function should accept an optional second parameter, which is a list of indices. The function should only ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fuse_text(['Hello', 'World', 'Good', 'Day']) == 'HelloWorldGoodDay'\", \"assert fuse_text(['Hello', 'World', 'Good', 'Day'], [0, 2]) == 'HelloGood'\", \"assert fuse_text(['Hello', 'World', 'Good', 'Day'], [1, 3]) == 'WorldDay'\", \"assert fuse_text(['Hello',...
{ "split": "train", "index": 83822, "acecode_id": "evol_21396", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with sorting a list of integers, where some integers may be None, representing missing values. Implement a function called `sort_with_none` that sorts the list such that all None values are considered to have the maximum possible value and are placed at the end o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_with_none([3, None, 1, 5, None, 2]) == [1, 2, 3, 5, None, None]\", \"assert sort_with_none([None, None, 1, 2, 3]) == [1, 2, 3, None, None]\", \"assert sort_with_none([4, 5, 6, None]) == [4, 5, 6, None]\", \"assert sort_with_none([]) == []\", \"assert so...
{ "split": "train", "index": 83823, "acecode_id": "oss_34417", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks whether an emergency condition is met based on a method name and a list of numerical values. The emergency condition is defined as all three of the following statistical values being equal to zero: 1) `hits_std_plus`: Mean...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_emergency_condition('Stads', [0, 0, 0, 0, 0]) == True\", \"assert check_emergency_condition('Stads', [1, 1, 1]) == False\", \"assert check_emergency_condition('Stads', [0]) == True\", \"assert check_emergency_condition('Stads', [2, 2, 2, 2, 2]) == Fals...
{ "split": "train", "index": 83824, "acecode_id": "oss_17654", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing the name of a pcap file (e.g., 'example.pcap'). Your task is to write a function that generates the full path of the pcap file by appending it to a predefined directory path '/pcaps/'. Implement a function called 'get_full_pcap_path' that tak...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_full_pcap_path('example.pcap') == '/pcaps/example.pcap'\", \"assert get_full_pcap_path('test.pcap') == '/pcaps/test.pcap'\", \"assert get_full_pcap_path('capture.pcap') == '/pcaps/capture.pcap'\", \"assert get_full_pcap_path('data.pcap') == '/pcaps/data....
{ "split": "train", "index": 83825, "acecode_id": "bigcode_python_fns_19040", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `greeting(name: str) -> str` that takes a string `name` as input and returns a greeting message in the format 'Hello, {name}'.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert greeting('Alice') == 'Hello, Alice'\", \"assert greeting('Bob') == 'Hello, Bob'\", \"assert greeting('Charlie') == 'Hello, Charlie'\", \"assert greeting('David') == 'Hello, David'\", \"assert greeting('Eve') == 'Hello, Eve'\", \"assert greeting('Frank') == '...
{ "split": "train", "index": 83826, "acecode_id": "evol_30549", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the link probability between multiple points on a map based on a given upper triangular matrix A and a distance matrix D. The link probability is defined as the product of the exponential of the negative distances and the corresponding entries in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert LinkProbability([[0, 1], [0, 0]], [[1, 2], [0, 3]]) == [[0.0, 0.1353352832366127], [0, 0.0]]\", \"assert LinkProbability([[0, 1], [0, 0]], [[0, 0], [0, 0]]) == [[0.0, 1.0], [0, 0.0]]\", \"assert LinkProbability([[0, 1], [0, 0]], [[2, 1], [0, 0]]) == [[0.0, 0...
{ "split": "train", "index": 83827, "acecode_id": "oss_18247", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a data probe for scientific instruments. Implement a function `create_probe` that takes in a string parameter `filename` representing the name of a file, and an optional parameter `instrument` which is a string indicating the type of instrument (def...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_probe('data.txt') == {'geometry': 'Polychromatic', 'header': 'Header of data.txt', 'data': [1, 2, 3, 4, 5]}\", \"assert create_probe('experiment.csv', 'Spectrometer') == {'geometry': 'Polychromatic', 'header': 'Header of experiment.csv', 'data': [1, 2...
{ "split": "train", "index": 83828, "acecode_id": "bigcode_python_fns_26882", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a list of user identifiers and generates a unique set of user identifiers. The function should take a list of user identifiers as input and return a set containing all unique user identifiers from the input list, regardless...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_user_identifiers(['user1', 'user2', 'user1', 'user3']) == {'user1', 'user2', 'user3'}\", \"assert unique_user_identifiers(['userA', 'userB', 'userC', 'userA']) == {'userA', 'userB', 'userC'}\", \"assert unique_user_identifiers(['user1', 'user1', 'user...
{ "split": "train", "index": 83829, "acecode_id": "oss_31595", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a temperature in Fahrenheit, write a function that converts it to Celsius. The function should take a single float parameter representing the temperature in Fahrenheit and return the equivalent temperature in Celsius. Use the conversion formula: Celsius = 5 * (Fahrenheit ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fahrenheit_to_celsius(32) == 0.0\", \"assert fahrenheit_to_celsius(212) == 100.0\", \"assert fahrenheit_to_celsius(0) == -17.77777777777778\", \"assert fahrenheit_to_celsius(-40) == -40.0\", \"assert fahrenheit_to_celsius(100) == 37.77777777777778\", \"asser...
{ "split": "train", "index": 83830, "acecode_id": "oss_35002", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that transforms a list of tuples into a list of dictionaries. Each tuple contains two elements: a title (string) and content (string). Your function should take a list of these tuples and return a list of dictionaries, where each dictiona...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert collect_snippets([('Snippet 1', 'This is the first snippet.'), ('Snippet 2', 'This is the second snippet.')]) == [{'title': 'Snippet 1', 'content': 'This is the first snippet.'}, {'title': 'Snippet 2', 'content': 'This is the second snippet.'}]\", \"assert c...
{ "split": "train", "index": 83831, "acecode_id": "oss_21076", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a Tic-Tac-Toe board represented as a list of strings `board`, implement a function `is_valid_tic_tac_toe(board)` that returns True if the board state is a valid position during the course of a Tic-Tac-Toe game, adhering to the following rules: Players alternately fill the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_tic_tac_toe(['O ', ' ', ' ']) == False\", \"assert is_valid_tic_tac_toe(['XOX', ' X ', ' ']) == False\", \"assert is_valid_tic_tac_toe(['XXX', ' ', 'OOO']) == False\", \"assert is_valid_tic_tac_toe(['XOX', 'O O', 'XOX']) == True\", \"assert...
{ "split": "train", "index": 83832, "acecode_id": "evol_30518", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `create_hls_client(streams: List[int]) -> List[str]` that processes each integer in the list, setting a property called `ll_hls` to True for each stream. The function should return a list of strings where each string is formatted as 'S...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_hls_client([1, 2, 3]) == ['Stream 0: HLS client created.', 'Stream 1: HLS client created.', 'Stream 2: HLS client created.']\", \"assert create_hls_client([5]) == ['Stream 0: HLS client created.']\", \"assert create_hls_client([10, 20, 30, 40]) == ['S...
{ "split": "train", "index": 83833, "acecode_id": "bigcode_python_fns_34801", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of strings, implement a function that calculates the cumulative length of the strings after filtering out those that start with a lowercase letter and those that contain non-alphabetical symbols. The function should return the total length of the remaining string...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_name_length(['1abc', 'Hello', 'World']) == 10\", \"assert sum_name_length(['John', 'doe', 'Jane']) == 8\", \"assert sum_name_length(['apple', 'banana', 'Cherry']) == 6\", \"assert sum_name_length(['A', 'B', 'C']) == 3\", \"assert sum_name_length(['a', 'b...
{ "split": "train", "index": 83834, "acecode_id": "evol_5657", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Write a function `is_prime_power(n: int) -> bool` that determines whether a given integer n is a prime power. A prime power is defined as `p^k` where `p` is a prime number and `k` is a positive integer. Your function should return True if the number is a prime power and False o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_prime_power(1) == False\", \"assert is_prime_power(2) == True\", \"assert is_prime_power(3) == True\", \"assert is_prime_power(4) == True\", \"assert is_prime_power(5) == True\", \"assert is_prime_power(6) == False\", \"assert is_prime_power(7) == True\",...
{ "split": "train", "index": 83835, "acecode_id": "bigcode_python_fns_11684", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a multi-line string called 'docstring'. Your task is to extract a specific path specification from this string based on a provided 'spec' string, which defaults to 'operation'. The 'docstring' contains lines of text, and you need to identify and return the relevan...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_spec_from_docstring('operation: add\\\\nreturn: sum', 'operation') == 'operation: add\\\\n'\", \"assert extract_spec_from_docstring('operation: subtract\\\\nreturn: difference', 'operation') == 'operation: subtract\\\\n'\", \"assert extract_spec_from...
{ "split": "train", "index": 83836, "acecode_id": "bigcode_python_fns_2628", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes an integer 'value' and returns an object that simulates a constant source. The object should have a method called 'evaluate' that, when called, returns the 'value' passed to the function. Design this function to ensure that mul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert Constant(1).evaluate() == 1\", \"assert Constant(2).evaluate() == 2\", \"assert Constant(3).evaluate() == 3\", \"assert Constant(4).evaluate() == 4\", \"assert Constant(5).evaluate() == 5\", \"assert Constant(-1).evaluate() == -1\", \"assert Constant(0).eval...
{ "split": "train", "index": 83837, "acecode_id": "bigcode_python_fns_20514", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that can serialize and deserialize a Binary Search Tree (BST). The function should take a BST represented by its root node and return a string representation of the serialized tree. The deserialization function should take this string and reconstruct the or...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bst.find(bst.root, 3) == True\", \"assert bst.getMax(bst.root) == 5\", \"assert bst.find(bst.root, 6) == False\", \"assert bst.getMax(bst.root) == 5\", \"assert bst.find(bst.root, 1) == True\", \"assert bst.getMax(bst.root) == 5\", \"assert bst.find(bst.root...
{ "split": "train", "index": 83838, "acecode_id": "evol_28266", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two lists of integers, `list_a` and `list_b`, write a function `vec_add` that performs element-wise addition of the two lists. The function should return a new list containing the results of the addition. If the two lists are of different lengths, the function should rais...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert vec_add([1, 2, 3], [4, 5, 6]) == [5, 7, 9]\", \"assert vec_add([-1, -2, -3], [-4, -5, -6]) == [-5, -7, -9]\", \"assert vec_add([0, 0, 0], [0, 0, 0]) == [0, 0, 0]\", \"assert vec_add([1], [2]) == [3]\", \"assert vec_add([100, 200], [300, 400]) == [400, 600]\"...
{ "split": "train", "index": 83839, "acecode_id": "bigcode_python_fns_23475", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with cleaning up a list of pipeline configurations. Write a function `cleanup_pipelines(pipelines: List[str]) -> List[str]` that takes in a list of pipeline configuration paths represented as strings. The function should return a new list containing the cleaned p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cleanup_pipelines(['built/pipeline1', 'built/pipeline2', 'pipeline3']) == ['pipeline1', 'pipeline2', 'pipeline3']\", \"assert cleanup_pipelines(['built/pipelineA', 'built/pipelineB', 'built/pipelineC']) == ['pipelineA', 'pipelineB', 'pipelineC']\", \"assert ...
{ "split": "train", "index": 83840, "acecode_id": "bigcode_python_fns_25011", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of buildings in a row. Your task is to write a function `max_visible_buildings(heights: List[int]) -> int` that returns the maximum number of buildings that can be seen from the left side. A building can be seen if it is...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_visible_buildings([4, 2, 3, 1, 5]) == 2\", \"assert max_visible_buildings([1, 3, 2, 5, 4]) == 3\", \"assert max_visible_buildings([5, 4, 3, 2, 1]) == 1\", \"assert max_visible_buildings([1, 2, 3, 4, 5]) == 5\", \"assert max_visible_buildings([3, 1, 4, 1,...
{ "split": "train", "index": 83841, "acecode_id": "bigcode_python_fns_9611", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates receiving data packets in a UDP-like manner. The function should take a list of strings representing data packets and return a list of strings that were successfully received. Each string in the input list represents a data...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert receive_packets(['packet1', 'packet2', '']) == ['packet1', 'packet2']\", \"assert receive_packets(['', '', '']) == []\", \"assert receive_packets(['data1', 'data2', 'data3']) == ['data1', 'data2', 'data3']\", \"assert receive_packets(['packet', '', 'packet2'...
{ "split": "train", "index": 83842, "acecode_id": "oss_27487", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a set of coordinates in a three-dimensional plane (x1, y1, z1), (x2, y2, z2), and (x3, y3, z3) that represent vertices of a triangle, write a function that checks whether they form a valid triangle. If they do, calculate the area of the triangle using Heron's formula and ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_triangle_area([0, 0, 0], [1, 1, 1], [2, 2, 2]) == 'Error: Points do not form a valid triangle'\", \"assert calculate_triangle_area([1, 2, 3], [4, 5, 6], [7, 8, 9]) == 'Error: Points do not form a valid triangle'\", \"assert calculate_triangle_area(...
{ "split": "train", "index": 83843, "acecode_id": "evol_33600", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a list of strings, where each string represents a title for a scan. Your task is to implement a function `update_scan_title(scans: List[str], old_title: str, new_title: str) -> List[str]` that updates the title of an existing scan in the list to a new title if the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_scan_title(['test'], 'test', 'test2') == ['test2']\", \"assert update_scan_title(['scan1', 'scan2'], 'scan1', 'new_scan1') == ['new_scan1', 'scan2']\", \"assert update_scan_title(['scan1', 'scan2'], 'scan3', 'new_scan3') == ['scan1', 'scan2']\", \"ass...
{ "split": "train", "index": 83844, "acecode_id": "bigcode_python_fns_9129", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that performs a specific mathematical operation on an integer input. Write a Python function `calculate_a(a)` that takes an integer `a` as input and returns the value of `a` after applying the operation `a = int((a * 3) + 1)`. For exa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_a(0) == 1\", \"assert calculate_a(1) == 4\", \"assert calculate_a(2) == 7\", \"assert calculate_a(3) == 10\", \"assert calculate_a(4) == 13\", \"assert calculate_a(5) == 16\", \"assert calculate_a(-2) == -5\", \"assert calculate_a(-3) == -8\", \"as...
{ "split": "train", "index": 83845, "acecode_id": "oss_24132", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries representing different carousels, where each dictionary contains a key 'class' associated with a list of strings. Your task is to write a function `get_carousel_classes(carousels: List[Dict[str, List[str]]]) -> List[List[str]]` that returns ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_carousel_classes([{'class': ['scbs-carousel', 'scbs-slide', 'scbs-carousel-fade']}, {'class': ['scbs-carousel', 'scbs-slide']}, {'class': ['scbs-carousel', 'scbs-slide']}]) == [['scbs-carousel', 'scbs-slide', 'scbs-carousel-fade'], ['scbs-carousel', 'scb...
{ "split": "train", "index": 83846, "acecode_id": "bigcode_python_fns_26331", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Extract the alt attribute values from all the <a> tags in the given HTML text. Return a list of unique alt attribute values found in the <a> tags, in the order they first appear in the HTML. Do this without using any in-built HTML parsers or libraries.\nPlease reason step by st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_alt('<html><body><p>This is a hyperlink example</p><a href=\\\"http://example.com\\\" alt=\\\"Example Link\\\">Example</a><a href=\\\"http://example2.com\\\" alt=\\\"Example Link 2\\\">Example 2</a><a href=\\\"http://example3.com\\\" alt=\\\"Example ...
{ "split": "train", "index": 83847, "acecode_id": "evol_8198", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a non-negative integer `bi_tot`, return a tuple containing two values. The first value should be the last two digits of `bi_tot`, and the second value should be the integer formed by all but the last two digits of `bi_tot` (if `bi_tot` has less than two digits, consider t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert ret_comb_index(12345) == (45, 123)\", \"assert ret_comb_index(100) == (00, 1)\", \"assert ret_comb_index(0) == (00, 0)\", \"assert ret_comb_index(99) == (99, 0)\", \"assert ret_comb_index(987654321) == (21, 9876543)\", \"assert ret_comb_index(2000) == (00, 2...
{ "split": "train", "index": 83848, "acecode_id": "bigcode_python_fns_49299", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with designing a function that takes a list of dictionaries representing medical orders and comments. Each dictionary contains the keys 'lekarstvo_name' (a string representing the medication name), 'post_id' (an integer representing the associated post), and 'com...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_orders_comments([{'lekarstvo_name': 'Aspirin', 'post_id': 1, 'comment_text': 'Effective pain relief'}, {'lekarstvo_name': 'Aspirin', 'post_id': 1, 'comment_text': 'Good for headaches'}, {'lekarstvo_name': 'Ibuprofen', 'post_id': 2, 'comment_text': 'H...
{ "split": "train", "index": 83849, "acecode_id": "oss_21000", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that compares the `dn` attributes of two strings representing node names and returns `True` if they are equal, and `False` otherwise. The function should take two strings as parameters. Implement the function `are_nodes_equal(node1: s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert are_nodes_equal('A', 'A') == True\", \"assert are_nodes_equal('A', 'B') == False\", \"assert are_nodes_equal('Node1', 'Node1') == True\", \"assert are_nodes_equal('Node1', 'node1') == False\", \"assert are_nodes_equal('test', 'test') == True\", \"assert are_...
{ "split": "train", "index": 83850, "acecode_id": "oss_29522", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that performs a linear search on a given list of integers to determine if a specified target integer is present in the list. The function should return True if the target is found, and False otherwise. For example, given the list [5, 10, 15, 20, 25, 30, 35]...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert linear_search([5, 10, 15, 20, 25, 30, 35], 20) == True\", \"assert linear_search([1, 2, 3, 4, 5], 3) == True\", \"assert linear_search([10, 20, 30, 40], 25) == False\", \"assert linear_search([100, 200, 300, 400], 100) == True\", \"assert linear_search([-5, ...
{ "split": "train", "index": 83851, "acecode_id": "evol_33891", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a class or function object in Python, implement a function `fqname_for` that returns the fully qualified name of that object as a string. The fully qualified name should be in the format `module_name.object_name`. If the object is defined locally (i.e., in a function), ra...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fqname_for(int) == 'builtins.int'\", \"assert fqname_for(str) == 'builtins.str'\", \"assert fqname_for(list) == 'builtins.list'\", \"assert fqname_for(dict) == 'builtins.dict'\", \"assert fqname_for(set) == 'builtins.set'\", \"assert fqname_for(tuple) == 'bu...
{ "split": "train", "index": 83852, "acecode_id": "bigcode_python_fns_31073", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that retrieves a list of AWS credential file names from a given dictionary of environment variables. The function should take a single argument, a dictionary where keys are environment variable names and values are their corresponding...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_aws_credential_files_from_env({'AWS_CREDENTIALS_FILE1': 'file1.txt', 'AWS_CREDENTIALS_FILE2': 'file2.txt'}) == ['AWS_CREDENTIALS_FILE1', 'AWS_CREDENTIALS_FILE2']\", \"assert get_aws_credential_files_from_env({'AWS_CREDENTIALS_FILE3': 'file3.txt', 'OTHER_...
{ "split": "train", "index": 83853, "acecode_id": "bigcode_python_fns_41311", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of strings as input and returns a dictionary that counts the occurrences of each unique string in the list. The function should be named `count_string_occurrences`. The input will be a list of strings, and the output sho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_string_occurrences(['apple', 'banana', 'apple']) == {'apple': 2, 'banana': 1}\", \"assert count_string_occurrences(['cat', 'dog', 'cat', 'mouse', 'dog']) == {'cat': 2, 'dog': 2, 'mouse': 1}\", \"assert count_string_occurrences(['a', 'b', 'a', 'c', 'a',...
{ "split": "train", "index": 83854, "acecode_id": "bigcode_python_fns_21798", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers representing scores of students in a class, write a function that determines the average score and returns it rounded to two decimal places. The function should handle an edge case where the list is empty by returning 0.00. Your function should be defin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_score([80, 90, 100]) == 90.00\", \"assert average_score([70, 85, 95, 100]) == 87.50\", \"assert average_score([0, 0, 0]) == 0.00\", \"assert average_score([100, 90, 80, 70, 60]) == 80.00\", \"assert average_score([10]) == 10.00\", \"assert average_sc...
{ "split": "train", "index": 83855, "acecode_id": "bigcode_python_fns_1752", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves a function object from a dictionary based on its name. The function should take two parameters: a string `func_name` representing the name of the function to retrieve, and an `attrdict` which is a dictionary where each key ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_func_from_attrdict('add', {'add': {'name': 'add'}, 'subtract': {'name': 'subtract'}}) == {'name': 'add'}\", \"assert get_func_from_attrdict('multiply', {'add': {'name': 'add'}, 'subtract': {'name': 'subtract'}}) == None\", \"assert get_func_from_attrdict...
{ "split": "train", "index": 83856, "acecode_id": "bigcode_python_fns_24909", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a positive integer n, write a function that determines if for every factor d of n, the expression d + n / d yields a prime number. Return True if this condition holds for all factors, otherwise return False.\nPlease reason step by step, then write a self-contained Python ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_prime_factors_condition(1) == True\", \"assert is_prime_factors_condition(2) == True\", \"assert is_prime_factors_condition(4) == False\", \"assert is_prime_factors_condition(8) == False\", \"assert is_prime_factors_condition(9) == False\", \"assert is_pr...
{ "split": "train", "index": 83857, "acecode_id": "evol_30237", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given two matrices A and B represented as 2D lists, implement a function `matrix_multiply(A, B)` that returns the product of the two matrices. The function should handle the case where matrices cannot be multiplied due to incompatible dimensions by returning an empty list. The ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\", \"assert matrix_multiply([[1]], [[2]]) == [[2]]\", \"assert matrix_multiply([[1, 2]], [[3], [4]]) == [[11]]\", \"assert matrix_multiply([[1, 2], [3, 4]], [[1], [1]]) == [[3], [7]]...
{ "split": "train", "index": 83858, "acecode_id": "evol_9036", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `intersperse` that accepts a list of integers `numbers` and a single integer `delimiter`. The function should return a new list with the integer `delimiter` inserted between each pair of consecutive elements in `numbers`. If `delimiter` is negative, you sho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert intersperse([1, 2, 3], 0) == [1, 0, 2, 0, 3]\", \"assert intersperse([1, 2], 5) == [1, 5, 2]\", \"assert intersperse([], 3) == []\", \"assert intersperse([4, 5, 6], -1) == [5, -1, 6]\", \"assert intersperse([7, 8, 9], -2) == [9]\", \"assert intersperse([10],...
{ "split": "train", "index": 83859, "acecode_id": "evol_35608", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, write a function that finds the maximum sum of any four distinct numbers in the array. If the array has fewer than four elements, return 0.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_sum_of_four([2, -7, -4, 15, 25, 18, -12]) == 60\", \"assert max_sum_of_four([1, 2, 3]) == 0\", \"assert max_sum_of_four([10, 20, 30, 40]) == 100\", \"assert max_sum_of_four([5, 5, 5, 5, 5]) == 20\", \"assert max_sum_of_four([1, 2, 3, 4, 5, 6]) == 18\", \...
{ "split": "train", "index": 83860, "acecode_id": "evol_31073", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a variable number of lists, each containing integers. Your task is to implement a function `list_sum(*argv)` that takes these lists as input and returns the sum of all integers across all provided lists. If a non-list or non-integer value is encountered, it should...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list_sum([1, 2, 3], [4, 5]) == 15\", \"assert list_sum([1, 2, 3], [4, 'a', 5]) == 15\", \"assert list_sum([]) == 0\", \"assert list_sum([1, 2, 3], [None], [4, 5]) == 15\", \"assert list_sum([1, 2], [3, 4], [5]) == 15\", \"assert list_sum([100, 200], [300], [...
{ "split": "train", "index": 83861, "acecode_id": "bigcode_python_fns_30008", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two arrays of integers, write a function in Python that checks if the two arrays are inverse of each other. An array is considered the inverse of another if one array is the reverse of the other, including handling duplicate values and empty arrays. Your function should r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert areInverse([1, 2, 3], [3, 2, 1]) == True\", \"assert areInverse([], []) == True\", \"assert areInverse([4, 5, 6], [6, 5, 4]) == True\", \"assert areInverse([1, 1, 2], [2, 1, 1]) == True\", \"assert areInverse([0], [0]) == True\", \"assert areInverse([1, 2], ...
{ "split": "train", "index": 83862, "acecode_id": "evol_25901", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `hamiltonian_cycle_exists(graph: List[List[int]]) -> bool` that determines whether a Hamiltonian cycle exists in a given undirected graph. The graph is represented as an adjacency matrix where `graph[i][j]` is 1 if there is an edge between vertex `i` and ve...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert hamiltonian_cycle_exists([[0, 1, 1, 1], [1, 0, 0, 1], [1, 0, 0, 1], [1, 1, 1, 0]]) == True\", \"assert hamiltonian_cycle_exists([[0, 1, 0], [1, 0, 1], [0, 1, 0]]) == False\", \"assert hamiltonian_cycle_exists([[0, 1], [1, 0]]) == True\", \"assert hamiltonian...
{ "split": "train", "index": 83863, "acecode_id": "evol_7969", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates dealing cards from a standard 52-card deck. The function should take an integer parameter representing the number of cards to deal and return a list of tuples, where each tuple contains the rank and suit of the dealt cards....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert len(deal_cards(5)) == 5\", \"assert len(deal_cards(52)) == 52\", \"assert deal_cards(52) != deal_cards(52)\", \"assert deal_cards(0) == []\", \"assert len(deal_cards(10)) == 10\", \"assert deal_cards(1)[0][0] in range(1, 14)\", \"assert deal_cards(1)[0][1] i...
{ "split": "train", "index": 83864, "acecode_id": "oss_3881", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given an XML document that contains a list of people, with each person having a name, age, and role. Your task is to implement a function that parses this XML string and returns a list of tuples containing each person's name, age, and role, along with a dictionary that ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert xml_parser('<people><person><name>John Doe</name><age>45</age><role>Engineer</role></person><person><name>Jane Doe</name><age>32</age><role>Doctor</role></person></people>') == ([('John Doe', 45, 'Engineer'), ('Jane Doe', 32, 'Doctor')], {'Engineer': 45.0, '...
{ "split": "train", "index": 83865, "acecode_id": "evol_34671", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates a batch process for data manipulation. You need to implement a function named `clear_memory_data` that initializes a `BatchProcessor` object with a specified integer parameter `n` and an optional string parameter `in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert clear_memory_data(5, 'config_tests.ini') == 'All memory data cleared.'\", \"assert clear_memory_data(10, None) == 'All memory data cleared.'\", \"assert clear_memory_data(0, 'test.ini') == 'All memory data cleared.'\", \"assert clear_memory_data(3, 'settings...
{ "split": "train", "index": 83866, "acecode_id": "oss_14297", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two arrays of integers representing two images, your task is to find and return an array containing the count of matching objects between the two images. Each object in the images is represented by a unique integer. If an image contains no objects, return an array of zero...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_matching_objects([], [1, 2, 3]) == []\", \"assert count_matching_objects([10, 10, 10], [10, 10]) == [2]\", \"assert count_matching_objects([3, 3, 3], [3, 3, 3]) == [3]\", \"assert count_matching_objects([0, 0, 0], [0, 0]) == [2]\", \"assert count_match...
{ "split": "train", "index": 83867, "acecode_id": "bigcode_python_fns_33076", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that swaps the values at two specified indices in the list. The function should take three parameters: the list of integers, and two indices (h and k) that indicate the positions to swap. The function should modify the list in place by...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert swap([1, 2, 3, 4, 5], 1, 3) == None and [1, 4, 3, 2, 5] == [1, 4, 3, 2, 5]\", \"assert swap([10, 20, 30, 40], 0, 2) == None and [30, 20, 10, 40] == [30, 20, 10, 40]\", \"assert swap([5, 6, 7, 8, 9], 2, 4) == None and [5, 6, 9, 8, 7] == [5, 6, 9, 8, 7]\", \"a...
{ "split": "train", "index": 83868, "acecode_id": "bigcode_python_fns_17987", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string that represents a block of code. Your task is to write a function that preprocesses the code by removing any newlines that appear between opening and closing parentheses for tuples and lists. The function should take a single string input representing the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert preprocess_code('my_list = [1,\\\\n2,\\\\n3]') == 'my_list = [1, 2, 3]'\", \"assert preprocess_code('my_tuple = (4,\\\\n5,\\\\n6)') == 'my_tuple = (4, 5, 6)'\", \"assert preprocess_code('empty_list = []') == 'empty_list = []'\", \"assert preprocess_code('sin...
{ "split": "train", "index": 83869, "acecode_id": "bigcode_python_fns_40267", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of news articles and returns a list of news objects. Each news object should contain specific attributes extracted from the news articles. Write a Python function `process_news_articles(newsarticle_list)` that...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_news_articles([{'id': '1', 'name': 'CNN', 'author': 'John Doe', 'title': 'Breaking News', 'urlToImage': 'image_url', 'description': 'This is a breaking news article', 'url': 'https://www.cnn.com/article1'}]) == [{'id': '1', 'name': 'CNN', 'author': '...
{ "split": "train", "index": 83870, "acecode_id": "oss_18001", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates sending fun messages to a user in a chat. The function `send_fun_messages(username: str, repetitions: int) -> List[str]` takes a username and a number of repetitions as input. The function should generate a list of messages...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert send_fun_messages('Alice', 3) == ['Hi Alice! This is 1x fun!', 'Hi Alice! This is 2x fun!', 'Hi Alice! This is 3x fun!']\", \"assert send_fun_messages('Bob', 1) == ['Hi Bob! This is 1x fun!']\", \"assert send_fun_messages('Charlie', 0) == []\", \"assert send...
{ "split": "train", "index": 83871, "acecode_id": "bigcode_python_fns_48203", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function called `map_transform(process)` that takes a single argument `process`, which is another function returning a boolean value. Your function should return a modified version of the `process` function that applies a transformation...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert map_transform(lambda: True)() == 'Success'\", \"assert map_transform(lambda: False)() == 'Failure'\", \"assert map_transform(lambda: 1 == 1)() == 'Success'\", \"assert map_transform(lambda: 1 == 2)() == 'Failure'\", \"assert map_transform(lambda: len('Hello'...
{ "split": "train", "index": 83872, "acecode_id": "oss_12441", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with generating a parameter string that describes various input parameters for a computational task. Write a function `generate_param_string` that takes the following parameters: `fasta_file_path` (str), `output_dir` (str), `bis` (bool), `strand` (str), `max_pcr_...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_param_string('file.fasta', '/output', True, 'forward', 100, 5, 10, False, 42) == 'input=file.fasta\\\\noutput_dir=/output\\\\nbis=True\\\\nstrand=forward\\\\nmax_PCR_len=100\\\\nn_subseq=5\\\\nn_tries=10\\\\nverbose=False\\\\nseed=42'\", \"assert ge...
{ "split": "train", "index": 83873, "acecode_id": "bigcode_python_fns_20076", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `func_nums(*args)` that takes a variable number of positive integers and returns a dictionary. For each positive integer, the dictionary should contain the following information: a boolean indicating if the number of its divisors is even or odd, a list of i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert func_nums(12) == {12: (True, [1, 2, 3, 4, 6, 12], 28, 3)}\", \"assert func_nums(30) == {30: (True, [1, 2, 3, 5, 6, 10, 15, 30], 72, 5)}\", \"assert func_nums(28) == {28: (True, [1, 2, 4, 7, 14, 28], 56, 7)}\", \"assert func_nums(24) == {24: (True, [1, 2, 3, ...
{ "split": "train", "index": 83874, "acecode_id": "evol_8796", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given a dictionary of coordinates representing positions of vertices in a 2D space, implement a function that scales the positions by a given coefficient. The function should take in a dictionary where each key is an integer representing the vertex ID and the value is a list or...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert scale_positions({1: (1.0, 2.0), 2: (3.0, 4.0)}, 2) == {1: (2.0, 4.0), 2: (6.0, 8.0)}\", \"assert scale_positions({1: (0.0, 0.0)}, 5) == {1: (0.0, 0.0)}\", \"assert scale_positions({1: (1.1, 2.2)}, 10) == {1: (11.0, 22.0)}\", \"assert scale_positions({1: (-1....
{ "split": "train", "index": 83875, "acecode_id": "bigcode_python_fns_30363", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a two-dimensional list of integers. Implement a function that calculates the sum of each row and returns a list containing these sums. The function should be able to handle any number of rows and columns. For example, given the input [[1, 2, 3], [4, 5], [6]], the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert row_sums([[1, 2, 3], [4, 5], [6]]) == [6, 9, 6]\", \"assert row_sums([[10, 20], [30, 40, 50]]) == [30, 120]\", \"assert row_sums([[0], [0], [0]]) == [0, 0, 0]\", \"assert row_sums([[1, 1, 1], [2, 2, 2], [3, 3, 3]]) == [3, 6, 9]\", \"assert row_sums([[5, 5], ...
{ "split": "train", "index": 83876, "acecode_id": "evol_8332", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a simple API endpoint. This function should take three parameters: `mapper_id`, `start_date`, and `end_date`. The function will return a status code based on the validity of the input data. If the `mapper_id` is less than 1...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_api_status(1, '2021-10-10', '2021-10-31') == 200\", \"assert check_api_status(2, '2021-10-01', '2021-10-31') == 200\", \"assert check_api_status(0, '2021-10-10', '2021-10-31') == 401\", \"assert check_api_status(1, '2021-10-31', '2021-10-30') == 401\",...
{ "split": "train", "index": 83877, "acecode_id": "bigcode_python_fns_23779", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of countries from South America and Central America, including French Guiana, in random order. Your task is to implement a function that sorts these countries in alphabetical order, groups them by the first letter of each country, and counts the number of c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert country_grouping(['Argentina', 'Brazil', 'Chile']) == 'A: 1 - Argentina; B: 1 - Brazil; C: 1 - Chile'\", \"assert country_grouping(['Costa Rica', 'Cuba', 'Honduras']) == 'C: 2 - Costa Rica, Cuba; H: 1 - Honduras'\", \"assert country_grouping(['Venezuela', 'E...
{ "split": "train", "index": 83878, "acecode_id": "oss_11481", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to implement a function `parsing(lst: List[str]) -> Tuple[int, float, float, str]` that takes a list of strings as input. The list contains four elements: the year of film production (as a string), the latitude (as a string), the longitude (as a string), and a path (as...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parsing(['2020', '80', '90', 'dataset']) == (2020, 80.0, 90.0, 'dataset')\", \"assert parsing(['1999', '0', '0', 'path/to/dataset']) == (1999, 0.0, 0.0, 'path/to/dataset')\", \"assert parsing(['2022', '-45.5', '30.0', 'movie/path']) == (2022, -45.5, 30.0, 'm...
{ "split": "train", "index": 83879, "acecode_id": "bigcode_python_fns_27835", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a Python function that takes a string as input and returns a new string where each word is reversed while preserving the original order of the words. The function should correctly handle punctuation and capitalization. For example, if the input is 'Hello, World!', the ou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_each_word('Python is fun!') == 'nohtyP si !nuf'\", \"assert reverse_each_word('Good morning.') == 'dooG .gninrom'\", \"assert reverse_each_word('This is a test') == 'sihT si a tset'\", \"assert reverse_each_word('OpenAI is amazing.') == 'IAnepO si .g...
{ "split": "train", "index": 83880, "acecode_id": "evol_22762", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that computes average values from given amplitude, phase, and frequency data. Write a function `compute_averages(spectrum_amp, spectrum_phase, frequency, n_av, n_av2)` that takes in the following parameters: \n- `spectrum_amp`: a list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_averages([1.0, 2.0, 3.0], [10.0, 20.0, 30.0], [100.0, 200.0, 300.0], 1, 0) == ([1.0, 2.0, 3.0], [10.0, 20.0, 30.0], [100.0, 200.0, 300.0])\", \"assert compute_averages([5.0, 5.0, 5.0, 5.0], [10.0, 10.0, 10.0, 10.0], [100.0, 100.0, 100.0, 100.0], 1, 0...
{ "split": "train", "index": 83881, "acecode_id": "oss_35533", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function `can_drop_database(restapi_version: str) -> bool` that determines whether a database can be dropped based on the current environment. The function should take a single parameter, `restapi_version`, which is a string representing the curren...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_drop_database('dev') == True\", \"assert can_drop_database('prod') == False\", \"assert can_drop_database('test') == False\", \"assert can_drop_database('development') == False\", \"assert can_drop_database('DEV') == False\", \"assert can_drop_database('...
{ "split": "train", "index": 83882, "acecode_id": "oss_3835", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of file paths as strings. Implement a function `filter_cpp_files(file_paths: List[str]) -> List[str]` that returns a new list containing only the paths that end with the '.cpp' file extension. The input list may contain paths from different directories and ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_cpp_files(['src/main.cpp', 'src/utils.h', 'bin/test.cpp', 'obj/debug/main.cpp']) == ['src/main.cpp', 'bin/test.cpp', 'obj/debug/main.cpp']\", \"assert filter_cpp_files(['include/file.hpp', 'src/file.txt', 'main.cpp', 'temp.cpp', 'src/.gitignore']) == ...
{ "split": "train", "index": 83883, "acecode_id": "bigcode_python_fns_22902", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the cycling through a list of statuses and returns the sequence of statuses at specified intervals. The function should take two parameters: a list of statuses and an integer representing the number of seconds to simulate t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cycle_statuses(['status1', 'status2', 'status3'], 5) == ['status1', 'status2', 'status3', 'status1', 'status2']\", \"assert cycle_statuses(['online', 'idle', 'do not disturb'], 10) == ['online', 'idle', 'do not disturb', 'online', 'idle', 'do not disturb', '...
{ "split": "train", "index": 83884, "acecode_id": "oss_14017", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a custom filter function in Python. The function should take a predicate function and a list of integers as input, and return a new list containing only the integers from the input list for which the predicate function returns True. Your functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert custom_filter(lambda x: x > 0, [-1, 0, 1, 2, -2]) == [1, 2]\", \"assert custom_filter(lambda x: x < 0, [1, 2, 3, -1, -2]) == [-1, -2]\", \"assert custom_filter(lambda x: x % 2 == 0, [1, 2, 3, 4, 5, 6]) == [2, 4, 6]\", \"assert custom_filter(lambda x: x % 2 !...
{ "split": "train", "index": 83885, "acecode_id": "oss_4798", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `count_twin_primes(n: int) -> int` that takes an integer n as input and returns the count of twin prime pairs in the range from 1 to n. A twin prime pair consists of two prime numbers that differ by two, such as (3, 5) and (11, 13).\nPlease reason step by step,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_twin_primes(1) == 0\", \"assert count_twin_primes(2) == 0\", \"assert count_twin_primes(3) == 0\", \"assert count_twin_primes(4) == 0\", \"assert count_twin_primes(5) == 1\", \"assert count_twin_primes(10) == 2\", \"assert count_twin_primes(11) == 2\",...
{ "split": "train", "index": 83886, "acecode_id": "evol_28498", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that updates a molecular structure based on certain conditions. The function should take in the following parameters: a list representing the current molecular structure `mol`, a boolean `stop` flag, a boolean `new` flag, and a dictio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_molecular_structure([1, 2, 3], True, False, {}) is None\", \"assert update_molecular_structure([1, 2, 3], False, False, {}) == [1, 2, 3]\", \"assert update_molecular_structure([1, 2, 3], False, True, {'update': 10}) == [11, 12, 13]\", \"assert update_...
{ "split": "train", "index": 83887, "acecode_id": "oss_12848", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 2D array of integers, implement a function `custom_array_operations` that takes the array as input and returns a dictionary with the following keys: 'shape', 'mean', and 'custom_sum'. The 'shape' should contain the dimensions of the input array, the 'mean' should be the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert custom_array_operations([[1, 2], [3, 4]]) == {'shape': (2, 2), 'mean': 2.5, 'custom_sum': 30}\", \"assert custom_array_operations([[5, 6], [7, 8]]) == {'shape': (2, 2), 'mean': 6.5, 'custom_sum': 174}\", \"assert custom_array_operations([[0, 0], [0, 0]]) == ...
{ "split": "train", "index": 83888, "acecode_id": "oss_16384", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Create a Python function that determines the total number of weekdays in a specific month and year. Additionally, the function should provide the option to calculate the total count of a specific weekday (e.g., Monday, Tuesday) in that month. The function should be able to hand...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_weekdays(2023, 5, day=6) == {'Sunday': 4}\", \"assert count_weekdays(2024, 2, day=1) == {'Tuesday': 4}\", \"assert count_weekdays(2020, 1, day=5) == {'Saturday': 4}\", \"assert count_weekdays(1900, 2) == {'Monday': 4, 'Tuesday': 4, 'Wednesday': 4, 'Thu...
{ "split": "train", "index": 83889, "acecode_id": "evol_27452", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a JSON response and extracts specific error messages from it. The function should take a JSON string as input that represents the response from a web service. The JSON structure contains a key 'messages' which holds ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_error_messages('{\\\"messages\\\": [\\\"Error 1: Invalid input\\\", \\\"Error 2: Missing required field\\\"]}') == ['Error 1: Invalid input', 'Error 2: Missing required field']\", \"assert extract_error_messages('{\\\"messages\\\": [\\\"Error 3: Conn...
{ "split": "train", "index": 83890, "acecode_id": "oss_13865", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that initializes a sign based on an integer input. The function should follow these rules: if the input integer is greater than 0, it should return the string 'Positive Sign'; if the input integer is less than or equal to 0, it should ret...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert initialize_sign(5) == 'Positive Sign'\", \"assert initialize_sign(1) == 'Positive Sign'\", \"assert initialize_sign(10) == 'Positive Sign'\", \"assert initialize_sign(0) == 'Negative Sign'\", \"assert initialize_sign(-1) == 'Negative Sign'\", \"assert initia...
{ "split": "train", "index": 83891, "acecode_id": "bigcode_python_fns_780", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that manages the activation of certain environment settings based on the input parameters. The function, `activate_settings`, takes two optional parameters: `args` and `extra_args`. If `args` is not provided (i.e., it is None), the fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert activate_settings(None, None) == None\", \"assert activate_settings(None, 'extra') == None\", \"assert activate_settings([], None) == 'Settings Activated'\", \"assert activate_settings(['setting1'], 'extra') == 'Settings Activated'\", \"assert activate_setti...
{ "split": "train", "index": 83892, "acecode_id": "oss_6519", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `rounded_avg_custom_base(n: int, m: int, base: int) -> str` that calculates the rounded weighted average of the number of divisors for all integers in the range from `n` to `m`, inclusive. The weighted average should be represented in a custom base (between...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rounded_avg_custom_base(2, 2, 2) == '0b10'\", \"assert rounded_avg_custom_base(1, 20, 10) == '12'\", \"assert rounded_avg_custom_base(10, 5, 10) == -1\", \"assert rounded_avg_custom_base(1, 10, 1) == -1\", \"assert rounded_avg_custom_base(1, 10, 11) == -1\"]...
{ "split": "train", "index": 83893, "acecode_id": "evol_20256", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with determining whether a quarantine period has ended based on the length of the quarantine in days and the date when the quarantine started. Write a function `is_quarantine_over(quarantine_days: int, start_date: str) -> bool` that takes in two parameters: an in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_quarantine_over(30, '2023-09-01') == False\", \"assert is_quarantine_over(15, '2023-09-15') == False\", \"assert is_quarantine_over(0, '2023-10-01') == False\", \"assert is_quarantine_over(14, '2023-09-17') == False\", \"assert is_quarantine_over(3, '2023...
{ "split": "train", "index": 83894, "acecode_id": "bigcode_python_fns_35243", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a list of integers `num`. Write a function `find_index` that finds the index of the first element in the list such that the element is less than the element immediately to its right. If no such element exists, the function should return -1. The input list contains...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_index([10, 9, 8, 7, 6, 5]) == -1\", \"assert find_index([1, 2, 3, 4, 5]) == 0\", \"assert find_index([5, 5, 5, 5, 5]) == -1\", \"assert find_index([7, 8, 7, 8, 7]) == 0\", \"assert find_index([5, 4, 3, 2, 1]) == -1\", \"assert find_index([3, 2, 1, 0]) =...
{ "split": "train", "index": 83895, "acecode_id": "oss_14132", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that sorts an array of integers in non-decreasing order using the Merge Sort algorithm. Do not use any built-in sorting functions. Handle duplicate elements in the array.\nPlease reason step by step, then write a self-contained Python solution. Give your final ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_sort([12, 9, 7, 8, 6, 9, 12]) == [6, 7, 8, 9, 9, 12, 12]\", \"assert merge_sort([5, 3, 8, 5, 2]) == [2, 3, 5, 5, 8]\", \"assert merge_sort([1]) == [1]\", \"assert merge_sort([]) == []\", \"assert merge_sort([4, 4, 4, 4]) == [4, 4, 4, 4]\", \"assert mer...
{ "split": "train", "index": 83896, "acecode_id": "evol_23353", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes a list of integers and returns a new list that contains only the even numbers from the original list, maintaining the original order. The function should not use any built-in filter functions or list comprehensions.\nPlease reason step by step, then ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 15, 20, 25, 30]) == [10, 20, 30]\", \"assert filter_even_numbers([0, -2, -4, 3, 7]) == [0, -2, -4]\", \"assert filter_even_numbers([1, 3, 5, 7]) == []\", \"assert filter_even...
{ "split": "train", "index": 83897, "acecode_id": "evol_31640", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of cables represented as dictionaries, where each dictionary contains details about a cable including its 'length' (in meters), 'material', and 'manufacturer'. Your task is to write a function that takes this list of cable dictionaries and returns a new lis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_cables_by_material([{'length': 10.5, 'material': 'Copper', 'manufacturer': 'XYZ Corp'}, {'length': 12.0, 'material': 'Fiber', 'manufacturer': 'ABC Inc'}, {'length': 8.0, 'material': 'Copper', 'manufacturer': 'LMN Ltd'}], 'Copper') == [{'length': 10.5,...
{ "split": "train", "index": 83898, "acecode_id": "oss_6688", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string representing a price, your task is to implement a function that converts this string into an integer value. The price string may contain commas as thousands separators and may include currency symbols or other non-numeric characters. Your function should ignore a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_price('\\u20ac2,500') == 2500\", \"assert parse_price('1000') == 1000\", \"assert parse_price('9,999') == 9999\", \"assert parse_price('No price available') == 0\", \"assert parse_price('') == 0\", \"assert parse_price('Just a string') == 0\", \"assert...
{ "split": "train", "index": 83899, "acecode_id": "bigcode_python_fns_21993", "num_tests": 8 }