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": "Write a function that performs bubble sort on a list of integers. The function should take two parameters: a list of integers and a string indicating the order ('asc' for ascending or 'desc' for descending). The function should sort the list in the specified order and return th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bubble_sort([5, 3, 8, 4, 2], 'asc') == ([2, 3, 4, 5, 8], 7)\", \"assert bubble_sort([1], 'asc') == ([1], 0)\", \"assert bubble_sort([], 'asc') == ([], 0)\", \"assert bubble_sort([6, 5, 4, 3, 2, 1], 'asc') == ([1, 2, 3, 4, 5, 6], 15)\", \"assert bubble_sort([... | {
"split": "train",
"index": 66800,
"acecode_id": "evol_24139",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple web server response. Your goal is to create a function called `get_server_response` that takes no arguments and returns a string message. The function should always return the message 'Hello, World!' when calle... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_server_response() == 'Hello, World!'\", \"assert get_server_response() == 'Hello, World!'\", \"assert get_server_response() == 'Hello, World!'\", \"assert get_server_response() == 'Hello, World!'\", \"assert get_server_response() == 'Hello, World!'\", \"... | {
"split": "train",
"index": 66801,
"acecode_id": "oss_30240",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a camera selection logic for a QR code scanner application. Your function should take in a list of available camera devices and a desired camera device name. The function should perform the following steps: 1. Check if the specified device is pr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_camera(['Camera1', 'Camera2', 'Camera3'], 'Camera1') == 'Camera1'\", \"assert initialize_camera(['Camera1', 'Camera2', 'Camera3'], 'Camera2') == 'Camera2'\", \"assert initialize_camera(['Camera1', 'Camera2', 'Camera3'], 'Camera3') == 'Camera3'\", ... | {
"split": "train",
"index": 66802,
"acecode_id": "oss_24149",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a summary of a student's profile based on their skills and study information. The input to the function will be a dictionary containing the student's user information, study program, current study year, professional skills,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_student_profile({'name': 'Alice', 'study_program': 'Computer Science', 'current_study_year': 2, 'professional_skills': 'Project Management', 'technical_skills': 'Python, Django', 'soft_skills': 'Communication'}) == 'Student Name: Alice\\\\nStudy Pro... | {
"split": "train",
"index": 66803,
"acecode_id": "oss_37102",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes template strings and substitutes data into them. The function should take in a list of template strings and a corresponding list of dictionaries containing data for substitution. For each template string, you will su... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_templates(['Hello, ${name}!', 'Your balance is ${balance}.'], [{'name': 'Alice'}, {'balance': 100}]) == ['Hello, Alice!', 'Your balance is 100.']\", \"assert process_templates(['${greeting}, ${name}!'], [{'greeting': 'Hi', 'name': 'Bob'}]) == ['Hi, B... | {
"split": "train",
"index": 66804,
"acecode_id": "oss_10235",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that returns a dictionary containing the count of each unique integer in the list. The keys of the dictionary should be the unique integers, and the values should be the respective counts. Your function should handle both positive and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_integers([1, 2, 2, 3, 3, 3]) == {1: 1, 2: 2, 3: 3}\", \"assert count_unique_integers([-1, -1, 0, 1, 1, 1]) == {-1: 2, 0: 1, 1: 3}\", \"assert count_unique_integers([]) == {}\", \"assert count_unique_integers([5, 5, 5, 5, 5]) == {5: 5}\", \"asser... | {
"split": "train",
"index": 66805,
"acecode_id": "bigcode_python_fns_42608",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a dictionary containing sales information. The function should extract the value associated with the key 'sale' from the input dictionary and return a specific message based on the extracted value. If the 'sale' key is ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_sales_updates({'sale': 100}) == 'Total sales amount: 100'\", \"assert process_sales_updates({'sale': 50}) == 'Total sales amount: 50'\", \"assert process_sales_updates({'purchase': 200}) == 'No sales updates available'\", \"assert process_sales_updat... | {
"split": "train",
"index": 66806,
"acecode_id": "oss_16606",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates a user authentication system. Your function should take a username and a password as input and determine whether the authentication is successful based on predefined valid credentials. Implement the function `authent... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert authenticate_user('admin', 'secret123') == True\", \"assert authenticate_user('admin', 'wrongpassword') == False\", \"assert authenticate_user('user', 'secret123') == False\", \"assert authenticate_user('admin', '') == False\", \"assert authenticate_user('',... | {
"split": "train",
"index": 66807,
"acecode_id": "oss_23932",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a cryptocurrency wallet that can store balances for three types of cryptocurrencies: Bitcoin, Ethereum, and Litecoin. Your goal is to implement a function `manage_wallet` that simulates the operations of depositing and withdrawing amounts for each c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_wallet([('deposit', 'Bitcoin', 500), ('deposit', 'Ethereum', 300), ('withdraw', 'Bitcoin', 200)]) == {'Bitcoin': 300, 'Ethereum': 300, 'Litecoin': 0}\", \"assert manage_wallet([('deposit', 'Bitcoin', 1000), ('deposit', 'Litecoin', 700), ('withdraw', '... | {
"split": "train",
"index": 66808,
"acecode_id": "oss_35648",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the spawning of an actor in a virtual world. The function takes in parameters that specify the type of actor to spawn, the location and rotation where the actor should be spawned, and optional parameters for attachment to a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert spawn_actor('Pedestrian', (10, 5, 0), (0, 90, 0)) == 'Spawned Pedestrian at location (10, 5, 0) with rotation (0, 90, 0)'\", \"assert spawn_actor('Bicycle', (1, 0, 0), (0, 45, 0)) == 'Spawned Bicycle at location (1, 0, 0) with rotation (0, 45, 0)'\", \"asser... | {
"split": "train",
"index": 66809,
"acecode_id": "bigcode_python_fns_35480",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that manages a student's remark. The function should take a list of remarks and return the last remark added to the list. If the list is empty, it should return 'No remark available'. Implement a function `get_last_remark(remarks: List[st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_last_remark(['Good job!', 'Needs improvement', 'Excellent']) == 'Excellent'\", \"assert get_last_remark(['First remark']) == 'First remark'\", \"assert get_last_remark(['Remark 1', 'Remark 2']) == 'Remark 2'\", \"assert get_last_remark([]) == 'No remark ... | {
"split": "train",
"index": 66810,
"acecode_id": "oss_31267",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of SQL queries. Your function should take two parameters: a list of SQL queries and a boolean flag `print_names`. If `print_names` is `True`, the function should print the string 'Executing query' followed by ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert processQueries(['SELECT * FROM users;', 'DELETE FROM orders;'], True) == None\", \"assert processQueries(['INSERT INTO products VALUES (1, \\\"item1\\\");'], False) == None\", \"assert processQueries([], True) == None\", \"assert processQueries(['CREATE TABL... | {
"split": "train",
"index": 66811,
"acecode_id": "oss_13866",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that converts a given string of ASCII characters into its equivalent hexadecimal notation. The output should be a single string representing the hexadecimal values of the characters in the input string. If the input string contains any non-ASCII characters ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert ascii_to_hex('Hello') == '48656c6c6f'\", \"assert ascii_to_hex('World') == '576f726c64'\", \"assert ascii_to_hex('') == ''\", \"assert ascii_to_hex('Python') == '507974686f6e'\", \"assert ascii_to_hex('Test 123') == '5465737420313233'\", \"assert ascii_to_he... | {
"split": "train",
"index": 66812,
"acecode_id": "evol_10523",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `priority_mapper` that takes a string of numeric characters (s) and a mapping priority list (p) as input. The function should remove any duplicate mapping from the priority list while preserving order. It should return a list that contains all unique... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert priority_mapper('12530', []) == ['0', '3', '5', '2', '1']\", \"assert priority_mapper('13579', ['1', '3', '5', '7', '9']) == ['1', '3', '5', '7', '9']\", \"assert priority_mapper('24680', ['1', '3', '5', '7', '9']) == ['2', '4', '6', '8', '0']\", \"assert pr... | {
"split": "train",
"index": 66813,
"acecode_id": "evol_6798",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given two integers, num1 and num2, write a function called `compare_numbers` that compares these two numbers and returns a specific message based on their relationship. You should return the following messages: - If num1 is equal to num2, return 'The numbers are equal.' - If nu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compare_numbers(66, 66) == 'The numbers are equal.'\", \"assert compare_numbers(55, 66) == 'num1 is less than num2.'\", \"assert compare_numbers(100, 50) == 'num1 is greater than num2.'\", \"assert compare_numbers(-10, -10) == 'The numbers are equal.'\", \"a... | {
"split": "train",
"index": 66814,
"acecode_id": "oss_7574",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `remove_uneven_elements(nested_tuple)` that takes a nested mixed tuple as input and removes all uneven elements. The function should handle tuples within tuples and can include integers, floats, and strings. If a string represents a numeric value and is even, i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_uneven_elements((1, 2, 3, 4)) == (2, 4)\", \"assert remove_uneven_elements((1.5, 2.0, 3.0, 4.0)) == (2.0, 4.0)\", \"assert remove_uneven_elements(('1', '2', '3', '4')) == ('2', '4')\", \"assert remove_uneven_elements(((1, 2), (3, 4))) == (2, 4)\", \"a... | {
"split": "train",
"index": 66815,
"acecode_id": "evol_28078",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_occurrences(info, y)` that takes in a list of lists `info` and a string `y`. The function should return a sorted list of tuples where each tuple represents the index positions of occurrences of `y` within the `info` list or checks if `y` is a key in a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_occurrences([[1, 2], ['a', 3, {'key': 'y'}], ['y', 'a']], 'y') == [(2, 0)]\", \"assert find_occurrences([[{'y': 1}], [2, 3, 'y']], 'y') == [(0, 'y'), (1, 2)]\", \"assert find_occurrences([[1, 2, 3], [4, 5, 6]], 'a') == []\", \"assert find_occurrences([[... | {
"split": "train",
"index": 66816,
"acecode_id": "evol_16487",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `is_num_even` that takes a single integer argument `n`. The function should return `True` if the number is even and `False` if the number is odd. If the input is not an integer, the function should return 'Error: Input is not an integer'.\nPlease rea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_num_even(2) == True\", \"assert is_num_even(3) == False\", \"assert is_num_even(0) == True\", \"assert is_num_even(-2) == True\", \"assert is_num_even(-3) == False\", \"assert is_num_even(100) == True\", \"assert is_num_even(101) == False\", \"assert is_n... | {
"split": "train",
"index": 66817,
"acecode_id": "evol_26681",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, write a function `find_longest_word(words)` that returns the longest word in the list. If there are multiple words of the same maximum length, return the first one that appears in the list. The input list will contain only non-empty strings.\nPlease rea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_longest_word(['apple', 'banana', 'cherry']) == 'banana'\", \"assert find_longest_word(['a', 'ab', 'abc', 'abcd']) == 'abcd'\", \"assert find_longest_word(['hello', 'world', 'python', 'programming']) == 'programming'\", \"assert find_longest_word(['longe... | {
"split": "train",
"index": 66818,
"acecode_id": "evol_25886",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with analyzing the dependencies of a given Python package. Create a function `find_dependencies(dependencies, package)` that takes in a dictionary `dependencies` where keys are package names and values are lists of the package's direct dependencies. The function ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_dependencies({'a': ['b'], 'b': ['c'], 'c': []}, 'a') == ['b', 'c']\", \"assert find_dependencies({}, 'non_existing_pkg') == []\", \"assert find_dependencies({'a': []}, 'a') == []\", \"assert find_dependencies({'p1': ['p2'], 'p2': ['p3'], 'p3': []}, 'p1'... | {
"split": "train",
"index": 66819,
"acecode_id": "oss_22170",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a list of asset records, where each record includes the asset's code (a string), a suffix (a string), and a list of historical prices (a list of floats). Your task is to implement a function `generate_beancount_format(assets: List[Tuple[str, str, List[float]]]) ->... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_beancount_format([('AAPL', 'OF', [150.0, 152.0, 153.5]), ('GOOGL', 'STK', [2800.0, 2820.0])]) == {'OFAAPL': [150.0, 152.0, 153.5], 'STKGOOGL': [2800.0, 2820.0]}\", \"assert generate_beancount_format([('TSLA', 'STK', [700.0, 710.0]), ('BTC', 'CRYPTO'... | {
"split": "train",
"index": 66820,
"acecode_id": "bigcode_python_fns_31440",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of integers, `list1` and `list2`, each containing `n` elements. Your task is to implement a function that computes the element-wise product of the two lists and returns a new list containing the results. The element-wise product is defined as multiplying... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert elementwise_product([1, 2, 3], [4, 5, 6]) == [4, 10, 18]\", \"assert elementwise_product([0, 1, 2], [3, 4, 5]) == [0, 4, 10]\", \"assert elementwise_product([-1, -2, -3], [1, 2, 3]) == [-1, -4, -9]\", \"assert elementwise_product([1, 0, 2], [5, 5, 5]) == [5,... | {
"split": "train",
"index": 66821,
"acecode_id": "oss_5362",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of URLs, write a function `rank_urls` that takes a list of URLs and returns a dictionary where each URL is mapped to its corresponding total score. The total score for each URL is calculated based on a hypothetical scoring system where each URL receives points from... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rank_urls(['http://example.com', 'http://test.com'], {'http://example.com': 10, 'http://test.com': 5}) == {'http://example.com': 10, 'http://test.com': 5}\", \"assert rank_urls(['http://a.com', 'http://b.com', 'http://c.com'], {'http://a.com': 2, 'http://b.c... | {
"split": "train",
"index": 66822,
"acecode_id": "bigcode_python_fns_17558",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that determines whether a given function can be called with a specified set of arguments. The function should accept two parameters: a callable function and a list or tuple of arguments. The output should be True if the function can be ca... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_call_function(lambda x: x + 1, [1]) == True\", \"assert can_call_function(lambda x, y: x + y, [1, 2]) == True\", \"assert can_call_function(lambda x: x + 1, []) == False\", \"assert can_call_function(lambda x, y, z: x + y + z, [1, 2]) == False\", \"asser... | {
"split": "train",
"index": 66823,
"acecode_id": "bigcode_python_fns_40138",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a byte string that may either be a UTF-8 encoded string or a gzip compressed byte string containing a UTF-8 encoded string. Write a function `decode_response(resp_bytes: bytes) -> str` that decodes the byte string. If the byte string is valid UTF-8, return the dec... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decode_response(b'Hello, World!') == 'Hello, World!'\", \"assert decode_response(b'\\\\xe4\\\\xbd\\\\xa0\\\\xe5\\\\xa5\\\\xbd') == '\\u4f60\\u597d'\", \"assert decode_response(b'\\\\x54\\\\x65\\\\x73\\\\x74') == 'Test'\", \"assert decode_response(b'\\\\x31\\... | {
"split": "train",
"index": 66824,
"acecode_id": "bigcode_python_fns_32709",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a Python function that performs matrix multiplication. The function should take two matrices as inputs and return their product. If the matrices have incompatible dimensions for multiplication, the function should raise a ValueError with a message indicating the issue... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert matrix_mult([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\", \"assert matrix_mult([[1]], [[2]]) == [[2]]\", \"assert matrix_mult([[1, 2, 3]], [[4], [5], [6]]) == [[32]]\", \"assert matrix_mult([[1, 0], [0, 1]], [[1, 2], [3, 4]]) == [[1, 2], [3,... | {
"split": "train",
"index": 66825,
"acecode_id": "evol_16406",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with transforming a date and time representation into a specified string format based on given tokens. The function should take in a dictionary representing the parsed date data, another dictionary for the parsed output format data which includes tokens for year,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_date({'year': 2023, 'month': 10, 'day': 15, 'hour': 14, 'minute': 30, 'second': 45}, {'year_token': 'YYYY', 'month_token': 'MM', 'day_token': 'DD', 'hour_token': 'HH', 'minute_token': 'mm', 'second_token': 'ss'}, 'YYYY-MM-DD HH:mm:ss') == '2023-10-... | {
"split": "train",
"index": 66826,
"acecode_id": "bigcode_python_fns_25524",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating a list of commands to withdraw flow routes based on a given IP address. Implement a function `withdraw(dest: str) -> str` that takes an IP address as input and returns a string confirming the withdrawal of routes. The function should create a list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert withdraw('192.168.1.1') == 'route_withdrawn'\", \"assert withdraw('10.0.0.1') == 'route_withdrawn'\", \"assert withdraw('172.16.0.5') == 'route_withdrawn'\", \"assert withdraw('255.255.255.255') == 'route_withdrawn'\", \"assert withdraw('0.0.0.0') == 'route_... | {
"split": "train",
"index": 66827,
"acecode_id": "bigcode_python_fns_39087",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function `validate_user_input` that checks if a given user input is valid. The function should accept a single string argument, `user_input`, and return a boolean value. The input is considered valid if it meets the following criteria: 1) It must b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_user_input('Hello World') == True\", \"assert validate_user_input('') == False\", \"assert validate_user_input('This is a valid input') == True\", \"assert validate_user_input('A' * 101) == False\", \"assert validate_user_input('Valid123') == True\"... | {
"split": "train",
"index": 66828,
"acecode_id": "bigcode_python_fns_15663",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a list of integers and returns a new list containing only the unique elements from the input list, preserving the original order of their first appearance. The function should not use any built-in methods that directly remove duplicates from a list.\... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_duplicates([4, 7, 8, 2, 3, 4, 7, 8]) == [4, 7, 8, 2, 3]\", \"assert remove_duplicates([1, 2, 2, 3, 4, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert remove_duplicates([5, 5, 5, 5]) == [5]\", \"assert remove_duplicates([]) == []\", \"assert remove_duplicates([1... | {
"split": "train",
"index": 66829,
"acecode_id": "evol_14547",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function 'find_gcd' that takes a list of integers and returns their Greatest Common Divisor (GCD). If the list contains any zeros or negative integers, the function should return a meaningful error message instead of the GCD. You may assume that the input list wi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_gcd([10, 20, 30]) == 10\", \"assert find_gcd([7, 14, 21]) == 7\", \"assert find_gcd([5, 10, 15, 20]) == 5\", \"assert find_gcd([100, 200, 300]) == 100\", \"assert find_gcd([15, 45, 75]) == 15\", \"assert find_gcd([8, 4, 2]) == 2\", \"assert find_gcd([17... | {
"split": "train",
"index": 66830,
"acecode_id": "evol_8938",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers that represent the read counts from a sequencing run. Your task is to implement a function `collate_read_counts(read_counts: List[int]) -> Dict[str, int]` that collates these read counts into a summary dictionary. The dictionary should contain t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert collate_read_counts([5, 10, 5]) == {'total_reads': 20, 'unique_reads': 2, 'duplicate_reads': 1}\", \"assert collate_read_counts([1, 2, 3, 4, 5]) == {'total_reads': 15, 'unique_reads': 5, 'duplicate_reads': 0}\", \"assert collate_read_counts([1, 1, 1, 1, 1]) ... | {
"split": "train",
"index": 66831,
"acecode_id": "bigcode_python_fns_22898",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function `server_monitor` that takes a server name (string) and an alert threshold (integer). This function should determine the operating system of the given server and simulate monitoring the server's average response times to HTTP requests. If the server's simulated... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert server_monitor('LinuxServer1', 2000) == 'Alert: Response time exceeded the threshold.'\", \"assert server_monitor('invalid_server', 3000) == 'Error: Invalid server name.'\", \"assert server_monitor('LinuxServer1', 1500) == 'Alert: Response time exceeded the ... | {
"split": "train",
"index": 66832,
"acecode_id": "evol_9573",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that organizes settings from a given list of strings into a dictionary for easy access. Each string represents a line in a configuration format, where lines starting with a module name enclosed in brackets (e.g., [ModuleName]) indi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_settings(['[Calendar]', 'MaxEvents = 10', 'TimeZone = UTC', 'ClientSecretFile = client_secret_calendar.json']) == {'Calendar': {'MaxEvents': '10', 'TimeZone': 'UTC', 'ClientSecretFile': 'client_secret_calendar.json'}}\", \"assert parse_settings(['[Open... | {
"split": "train",
"index": 66833,
"acecode_id": "oss_29457",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a filename for saving a model checkpoint based on the provided epoch number. The function should take an integer epoch as input and return a string that formats the filename as 'model_valid_<epoch>.pth' where <epoch> is the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_checkpoint_filename(0) == 'model_valid_0.pth'\", \"assert generate_checkpoint_filename(1) == 'model_valid_1.pth'\", \"assert generate_checkpoint_filename(2) == 'model_valid_2.pth'\", \"assert generate_checkpoint_filename(3) == 'model_valid_3.pth'\",... | {
"split": "train",
"index": 66834,
"acecode_id": "bigcode_python_fns_30669",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a custom function that processes a sequence of integers and returns the maximum value from the encoded representation of the sequence. The encoding process involves summing the elements of the input sequence in pairs. If the input sequence has a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert maximum_encoded_value([1, 2, 3, 4]) == 7\", \"assert maximum_encoded_value([1]) == 1\", \"assert maximum_encoded_value([-1, -2, -3, -4]) == -3\", \"assert maximum_encoded_value([0, 0, 0]) == 0\", \"assert maximum_encoded_value([100, 200, 300, 400]) == 700\",... | {
"split": "train",
"index": 66835,
"acecode_id": "oss_37712",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function that checks if the cumulative sum of integers located at even indices in a given list falls within a specified range. The list must not be empty and must contain an even number of elements. The function should return True if the sum is within the specified ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert within_boundary_sum([1, 2, 4, 10], 5, 15) == True\", \"assert within_boundary_sum([2, 3, 4, 5], 4, 6) == True\", \"assert within_boundary_sum([0, 1, 2, 3], 0, 2) == True\", \"assert within_boundary_sum([1, 1, 1, 1], 2, 4) == True\", \"assert within_boundary_... | {
"split": "train",
"index": 66836,
"acecode_id": "evol_25909",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a string `string` and an integer `k`, return all distinct substrings of `string` that contain exactly `k` distinct characters. The substrings should be returned in the order they appear in the string.\nPlease reason step by step, then write a self-contained Python solutio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_substrings_with_x_distinct_chars('a', 1) == ['a']\", \"assert find_substrings_with_x_distinct_chars('abc', 3) == ['abc']\", \"assert find_substrings_with_x_distinct_chars('xyz', 2) == ['xy', 'yz']\", \"assert find_substrings_with_x_distinct_chars('abcde... | {
"split": "train",
"index": 66837,
"acecode_id": "evol_2277",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `print_linked_list_reverse(head)` that takes the head of a singly linked list as an argument and returns the elements of the linked list in reverse order as a list. If the linked list is empty, the function should return an empty list.\nPlease reason... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert print_linked_list_reverse(None) == []\", \"assert print_linked_list_reverse(Node(1)) == [1]\", \"assert print_linked_list_reverse(Node(8)) == [8]\", \"assert print_linked_list_reverse(Node(5)) == [5]\", \"assert print_linked_list_reverse(Node(1000)) == [1000... | {
"split": "train",
"index": 66838,
"acecode_id": "evol_21598",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a function `has_access` that determines if a user has access to a specific resource based on their role. The function should take two parameters: a list of roles that are allowed access and a user's role. The function should return `True` if the user's role is in the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_access(['admin', 'member'], 'admin') == True\", \"assert has_access(['admin', 'member'], 'member') == True\", \"assert has_access(['admin', 'member'], 'guest') == False\", \"assert has_access(['user'], 'user') == True\", \"assert has_access(['user', 'adm... | {
"split": "train",
"index": 66839,
"acecode_id": "evol_22536",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `get_word_vector(word: str) -> List[float]` that retrieves the vector representation of a given word using a predefined word embedding model. The model is represented as a dictionary where keys are words and values are their corresponding... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_word_vector('apple') == [0.1, 0.2, 0.3]\", \"assert get_word_vector('banana') == [0.4, 0.5, 0.6]\", \"assert get_word_vector('orange') == [0.7, 0.8, 0.9]\", \"assert get_word_vector('grape') == []\", \"assert get_word_vector('') == []\", \"assert get_wor... | {
"split": "train",
"index": 66840,
"acecode_id": "oss_29",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with developing a function that organizes a list of class definitions into sections based on their hexadecimal ranges. Each class definition is formatted as a string which may include a hexadecimal range, a class name, and a comment. Your function should take in ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert organize_classes(['0001..0FFF ; ClassX # X class', '4000..4FFF ; ClassY # Y class', 'ClassZ # Z class']) == {'default': [{'range': None, 'class': 'ClassZ', 'comment': 'Z class'}], 'Section1': [{'range': '0001..0FFF', 'class': 'ClassX', 'comment': 'X class'}]... | {
"split": "train",
"index": 66841,
"acecode_id": "oss_6056",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `removeDuplicates(array)` that removes all duplicate values from the list and returns a new list containing only unique elements. The order of elements in the output list should be the same as their first occurrence in the input li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert removeDuplicates([1, 2, 2, 3, 4, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert removeDuplicates([1, 1, 1, 1]) == [1]\", \"assert removeDuplicates([]) == []\", \"assert removeDuplicates([5, 4, 3, 2, 1]) == [5, 4, 3, 2, 1]\", \"assert removeDuplicates([1, 2, 3, 1, 2, ... | {
"split": "train",
"index": 66842,
"acecode_id": "evol_34347",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `pick_elements(data: List[List[float]], indices: List[int]) -> List[float]`. The function takes in a 2D list of floating-point numbers `data`, where each sublist represents a row of numbers, and a list of integers `indices`. Your func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pick_elements([[1.1, 2.2], [3.3, 4.4], [5.5, 6.6]], [0, 2]) == [1.1, 5.5]\", \"assert pick_elements([], [0]) == []\", \"assert pick_elements([[1.0, 2.0]], [0]) == [1.0]\", \"assert pick_elements([[1.5, 2.5], [3.5, 4.5]], [0, 1]) == [1.5, 3.5]\", \"assert pic... | {
"split": "train",
"index": 66843,
"acecode_id": "bigcode_python_fns_18490",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a file upload validation function for a web application. The function should check if a given file's extension is allowed for upload based on a predefined list of allowed extensions. You need to create a function `is_allowed_file(filename)` that... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_allowed_file('image.png') == True\", \"assert is_allowed_file('photo.jpg') == True\", \"assert is_allowed_file('document.jpeg') == True\", \"assert is_allowed_file('image.gif') == False\", \"assert is_allowed_file('archive.zip') == False\", \"assert is_al... | {
"split": "train",
"index": 66844,
"acecode_id": "oss_11985",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of events where each event is represented as an array of three integers [startDay, endDay, value], your task is to write a function that returns the maximum total value of events you can attend. You can attend an event on any day between its start and end days, b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert maxValue([[1, 1, 10], [1, 1, 20], [1, 1, 30]]) == 30\", \"assert maxValue([[1, 2, 5], [1, 2, 10], [1, 2, 8]]) == 10\", \"assert maxValue([[1, 5, 10], [6, 10, 20], [11, 15, 30]]) == 60\", \"assert maxValue([[1, 2, 30], [1, 2, 20], [1, 2, 10]]) == 30\", \"asse... | {
"split": "train",
"index": 66845,
"acecode_id": "evol_21749",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function `check_hex_color_code(code: str) -> bool` that takes a string `code` as input and returns `True` if the string is a valid hexadecimal color code, and `False` otherwise. A valid hexadecimal color code starts with a '#' symbol followed by either three or six ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_hex_color_code('#abc') == True\", \"assert check_hex_color_code('#ABCDEF') == True\", \"assert check_hex_color_code('#123456') == True\", \"assert check_hex_color_code('#fff') == True\", \"assert check_hex_color_code('#FFFFFF') == True\", \"assert chec... | {
"split": "train",
"index": 66846,
"acecode_id": "evol_27640",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `mirror_text_feed(input_string: str) -> str` that takes a string as input and returns the mirror image of the string. The mirror image should only include alphabetic characters, with all numeric elements and symbols removed. The resulting string should be rever... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert mirror_text_feed('Hello, World! 2023') == 'dlroWolleH'\", \"assert mirror_text_feed('1234') == ''\", \"assert mirror_text_feed('!@#$%^&*()') == ''\", \"assert mirror_text_feed('Python3.8') == 'nohtyP'\", \"assert mirror_text_feed('Data Science 101') == 'ecne... | {
"split": "train",
"index": 66847,
"acecode_id": "evol_10796",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates discarding events from a session in a simplified event handling system. The function should take in four parameters: an integer representing the session identifier, an integer representing the event type, an integer represe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert discard_events(1, 10, 0, True) == 'Events discarded using mechanism QUEUE'\", \"assert discard_events(2, 20, 1, True) == 'Events discarded using mechanism Handler'\", \"assert discard_events(3, 30, 2, True) == 'Events discarded using mechanism SUSPEND_HNDLR'... | {
"split": "train",
"index": 66848,
"acecode_id": "bigcode_python_fns_41561",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function `insert_bst(root: Optional[Node], key: int) -> Node` that inserts a new key into a binary search tree (BST). The function should return the root of the modified tree. If the tree is empty (root is None), the function should create a new node with the given key... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert insert_bst(None, 5).val == 5\", \"assert insert_bst(Node(10), 5).left.val == 5\", \"assert insert_bst(Node(10), 15).right.val == 15\", \"assert insert_bst(Node(10), 10).val == 10\", \"assert insert_bst(insert_bst(Node(10), 5), 15).right.val == 15\", \"assert... | {
"split": "train",
"index": 66849,
"acecode_id": "evol_32997",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates retrieving a resource given its name. The function should accept a string parameter 'name', which represents the name of the resource. The function should return a string formatted as 'Resource retrieved: <name>', where <na... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert retrieve_resource('image.png') == 'Resource retrieved: image.png'\", \"assert retrieve_resource('data.json') == 'Resource retrieved: data.json'\", \"assert retrieve_resource('config.yaml') == 'Resource retrieved: config.yaml'\", \"assert retrieve_resource(''... | {
"split": "train",
"index": 66850,
"acecode_id": "bigcode_python_fns_26802",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an input string and a minimal length, uncover and return each unique palindrome substring of at least the given length. If a palindrome is repeated consecutively, count it as a single occurrence. After retrieving the palindromes, return a tuple containing the substring li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_palindrome_substrings('a', 1) == (['a'], 1, {'a': 1})\", \"assert find_palindrome_substrings('abc', 2) == ([], 0, {})\", \"assert find_palindrome_substrings('level', 2) == (['eve', 'level'], 2, {'eve': 1, 'level': 1})\", \"assert find_palindrome_substri... | {
"split": "train",
"index": 66851,
"acecode_id": "evol_25675",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `simulate_process()` that simulates a process which has a 50% chance of succeeding or failing. The function should return 'Success' if the process completes successfully and 'Fail' if it encounters an error. Your task is to write the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_process() == 'Success'\", \"assert simulate_process() == 'Success'\", \"assert simulate_process() == 'Success'\", \"assert simulate_process() == 'Success'\", \"assert simulate_process() == 'Success'\", \"assert simulate_process() == 'Success'\", \"a... | {
"split": "train",
"index": 66852,
"acecode_id": "bigcode_python_fns_13509",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that detects occurrences of a predefined pattern within a 2D matrix representing an image. The function should take two parameters: the first parameter is a 2D list `image`, which represents the pixel values of the image, and the seco... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert detect_pattern([[1,2,3],[4,5,6],[7,8,9]], [[5,6]]) == [(1, 1)]\", \"assert detect_pattern([[1,2,3],[4,5,6],[7,8,9]], [[1,2]]) == [(0, 0)]\", \"assert detect_pattern([[0,0,0],[0,1,0],[0,0,0]], [[1]]) == [(1, 1)]\", \"assert detect_pattern([[1,1,1],[1,1,1],[1,... | {
"split": "train",
"index": 66853,
"acecode_id": "oss_4967",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function `fib(n)` that prints 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 ones. The output should be... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fib(1) == '0 '\", \"assert fib(2) == '0 1 '\", \"assert fib(3) == '0 1 1 '\", \"assert fib(4) == '0 1 1 2 '\", \"assert fib(5) == '0 1 1 2 3 '\", \"assert fib(6) == '0 1 1 2 3 5 '\", \"assert fib(7) == '0 1 1 2 3 5 8 '\", \"assert fib(8) == '0 1 1 2 3 5 8 13... | {
"split": "train",
"index": 66854,
"acecode_id": "evol_7015",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `input_string` and a string `target_word`, write a function that counts the number of times `target_word` appears in `input_string` as a whole word, ignoring case and any punctuation or special characters. The function should return an integer representing the co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_word_occurrences('The cat sat on the mat, and the cat was happy.', 'cat') == 2\", \"assert count_word_occurrences('Hello world! Hello everyone.', 'hello') == 2\", \"assert count_word_occurrences('Python is great. python is fun!', 'python') == 2\", \"as... | {
"split": "train",
"index": 66855,
"acecode_id": "oss_12797",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with developing a function that generates a search query for mining tweets based on user input. If the user provides a search query, your function should return it as is. However, if the user does not provide any input (i.e., they just press enter), your function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_search_query('Finance') == 'Finance'\", \"assert generate_search_query('Investment') == 'Investment'\", \"assert generate_search_query('Economy') == 'Economy'\", \"assert generate_search_query('Growth') == 'Growth'\", \"assert generate_search_query(... | {
"split": "train",
"index": 66856,
"acecode_id": "bigcode_python_fns_34564",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a list of unique integers, implement a function that returns a new list containing only the elements that are present in the input list but not in the specified set of exclusion integers. The output list should maintain the original order of elements in the input list. Wr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_excluded_items([1, 2, 3, 4, 5], {2, 4}) == [1, 3, 5]\", \"assert filter_excluded_items([10, 20, 30, 40, 50], {10, 30}) == [20, 40, 50]\", \"assert filter_excluded_items([7, 8, 9], {5, 6}) == [7, 8, 9]\", \"assert filter_excluded_items([], {1, 2}) == [... | {
"split": "train",
"index": 66857,
"acecode_id": "bigcode_python_fns_34710",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of binary numbers. The function should take a list of binary numbers as input and perform the following operations: 1. Remove any duplicate binary numbers from the list. 2. Sort the list of binary numbers in a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_binary_numbers(['0001', '0010', '0010', '0001', '0100']) == [1, 2, 4]\", \"assert process_binary_numbers(['111', '001', '010', '111', '000']) == [0, 1, 2, 7]\", \"assert process_binary_numbers(['101', '101', '101', '101']) == [5]\", \"assert process_... | {
"split": "train",
"index": 66858,
"acecode_id": "oss_4937",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that constructs a shell command string based on provided parameters. The function `build_shell_command` should take in four parameters: `shell_param1`, `shell_param2`, `shell_param3`, and `shell_remote`. The command string is constructed ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert build_shell_command('ls', '-l', 'file.txt', True) == 'ls -l \\\"file.txt\\\"'\", \"assert build_shell_command('echo', '', '', True) == 'echo $null $null'\", \"assert build_shell_command('mkdir', 'new_folder', '', True) == 'mkdir new_folder $null'\", \"assert... | {
"split": "train",
"index": 66859,
"acecode_id": "oss_879",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a variable `aml_run` that represents the context of a machine run. Your task is to determine if the run is associated with an AzureML environment. Implement a function `is_running_in_azure_ml(aml_run)` that checks if the `aml_run` object has an attribute named `ex... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_running_in_azure_ml(type('obj', (object,), {'experiment': True})()) == True\", \"assert is_running_in_azure_ml(type('obj', (object,), {})()) == False\", \"assert is_running_in_azure_ml(type('obj', (object,), {'experiment': 'test'})()) == True\", \"assert ... | {
"split": "train",
"index": 66860,
"acecode_id": "bigcode_python_fns_45874",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement the Sieve of Eratosthenes algorithm by writing a function `sieve_of_eratosthenes(n)` that takes an integer `n` as input and returns a list of all prime numbers less than or equal to `n`. The function should first create a list called `sieve` with `n + 1` elements, all... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sieve_of_eratosthenes(1) == []\", \"assert sieve_of_eratosthenes(2) == [2]\", \"assert sieve_of_eratosthenes(3) == [2, 3]\", \"assert sieve_of_eratosthenes(4) == [2, 3]\", \"assert sieve_of_eratosthenes(5) == [2, 3, 5]\", \"assert sieve_of_eratosthenes(10) =... | {
"split": "train",
"index": 66861,
"acecode_id": "oss_24685",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the management of roles in a user authorization system. The function, `manage_roles`, takes a list of roles and a command, which can be 'add', 'update', or 'delete'. Depending on the command, your function should add a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_roles(['admin', 'user'], 'add', 'guest') == ['admin', 'user', 'guest']\", \"assert manage_roles(['admin', 'user'], 'update', 1, 'superuser') == ['admin', 'superuser']\", \"assert manage_roles(['admin', 'user'], 'delete', 0) == ['user']\", \"assert man... | {
"split": "train",
"index": 66862,
"acecode_id": "bigcode_python_fns_48182",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers and a specific integer value, implement a function that returns a list of indices where the specified integer value occurs in the array. The function should take two parameters: an array of integers and the integer value to search for. If the integer ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_element([2, 3, 2, 4, 5], 2) == [0, 2]\", \"assert check_element([1, 2, 3, 4, 5], 6) == []\", \"assert check_element([5, 5, 5, 5, 5], 5) == [0, 1, 2, 3, 4]\", \"assert check_element([], 1) == []\", \"assert check_element([10, 20, 30, 40], 10) == [0]\", ... | {
"split": "train",
"index": 66863,
"acecode_id": "evol_2090",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing ages of individuals. Your task is to write a function that removes all individuals whose age is greater than 50 from the list. The function should return a new list containing the ages of individuals who are 50 or younger. Implement... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_ages([30, 40, 50, 60, 70]) == [30, 40, 50]\", \"assert filter_ages([25, 35, 45, 55, 65, 75]) == [25, 35, 45]\", \"assert filter_ages([51, 52, 53, 54]) == []\", \"assert filter_ages([10, 20, 30]) == [10, 20, 30]\", \"assert filter_ages([60, 70, 80, 90]... | {
"split": "train",
"index": 66864,
"acecode_id": "bigcode_python_fns_30537",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an integer representing the version ID of an artifact. Your task is to implement a Python function that simulates the process of publishing this artifact to a research data repository. The function should handle any exceptions that occur during the publishing proc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert publish_to_zenodo(1) == True\", \"assert publish_to_zenodo(2) == True\", \"assert publish_to_zenodo(3) == True\", \"assert publish_to_zenodo(10) == True\", \"assert publish_to_zenodo(100) == True\", \"assert publish_to_zenodo(0) == False\", \"assert publish_... | {
"split": "train",
"index": 66865,
"acecode_id": "oss_35605",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing mathematical constraints. A constraint consists of a value (float) and a variable (string). Your goal is to implement a function `manage_constraints` that takes a list of constraints, where each constraint is represented as a tuple (value, variable)... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_constraints([]) == ([], [])\", \"assert manage_constraints([(1.1, 'a')]) == ([1.1], ['a'])\", \"assert manage_constraints([(2.2, 'b'), (3.3, 'c')]) == ([2.2, 3.3], ['b', 'c'])\", \"assert manage_constraints([(4.4, 'd'), (5.5, 'e'), (6.6, 'f')]) == ([4... | {
"split": "train",
"index": 66866,
"acecode_id": "oss_9729",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with developing a function to preprocess clothing item names for a dataset. Some clothing item names are marked as problematic and need to be handled differently. The problematic item names are 'han', 'jakobs1', and 'jakobs2'. Additionally, there are certain shap... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert preprocess_item_name('han') == 'problematic_item'\", \"assert preprocess_item_name('jakobs1') == 'problematic_item'\", \"assert preprocess_item_name('jakobs2') == 'problematic_item'\", \"assert preprocess_item_name('shapes') == 'unhandled_category'\", \"asse... | {
"split": "train",
"index": 66867,
"acecode_id": "oss_28363",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function `peek_left_child(deque)` that takes a deque (double-ended queue) as input and returns the first element of the left child of the deque. In this context, the left child is defined as the first element in the deque if it exists, otherwise, the fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert peek_left_child([]) is None\", \"assert peek_left_child([1]) == 1\", \"assert peek_left_child([2, 3, 4]) == 2\", \"assert peek_left_child([5, 6, 7, 8]) == 5\", \"assert peek_left_child([9, 10]) == 9\", \"assert peek_left_child([11]) == 11\", \"assert peek_le... | {
"split": "train",
"index": 66868,
"acecode_id": "bigcode_python_fns_7591",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of 2D points representing the vertices of a polygon, implement a function that calculates the centroid of the polygon, the area of the polygon, and returns these details along with the coordinates of all vertices and the normal vector of the plane where the polygon... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_polygon_details([(1, 1), (4, 1), (4, 5), (1, 5)]) == {'centroid': (2.5, 3.0), 'normal': [0, 0, 1], 'all_points': [(1.0, 1.0), (4.0, 1.0), (4.0, 5.0), (1.0, 5.0)], 'area': 12.0}\", \"assert calculate_polygon_details([(0, 0), (1, 0), (1, 1), (0, 1)])... | {
"split": "train",
"index": 66869,
"acecode_id": "bigcode_python_fns_12329",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates loading a texture for a graphical application. The function should take a string parameter 'filename' and return a list containing two versions of the texture: the original texture and the horizontally flipped version of th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert load_texture_pair('texture.png') == ['texture.png', 'flipped_texture.png']\", \"assert load_texture_pair('background.jpg') == ['background.jpg', 'flipped_background.jpg']\", \"assert load_texture_pair('sprite.gif') == ['sprite.gif', 'flipped_sprite.gif']\", ... | {
"split": "train",
"index": 66870,
"acecode_id": "bigcode_python_fns_6209",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a local datetime represented as a string in the format 'YYYY-MM-DD HH:MM:SS' and an optional timezone string. Your task is to convert this local datetime to its equivalent UTC datetime, also represented as a string in the same format. If no timezone is provided, a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_utc('2023-10-01 12:00:00', 'America/New_York') == '2023-10-01 16:00:00'\", \"assert convert_to_utc('2023-10-01 12:00:00') == '2023-10-01 12:00:00'\", \"assert convert_to_utc('2023-10-01 12:00:00', 'Asia/Tokyo') == '2023-10-01 03:00:00'\", \"assert... | {
"split": "train",
"index": 66871,
"acecode_id": "bigcode_python_fns_19274",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple 2D robot simulator. The robot moves on a grid and is given instructions in the form of a string. The grid has positive x and y axes, and the robot's initial position is at the origin (0, 0). The robot's direction is initially set as the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_robot('F') == (0, 1)\", \"assert simulate_robot('FF') == (0, 2)\", \"assert simulate_robot('R') == (0, 0)\", \"assert simulate_robot('L') == (0, 0)\", \"assert simulate_robot('FFRFF') == (2, 2)\", \"assert simulate_robot('FFLFF') == (-2, 2)\", \"ass... | {
"split": "train",
"index": 66872,
"acecode_id": "oss_37419",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Design a function that performs shell sorting on a list containing both integers and strings. The function should return a sorted list where integers appear first in ascending order, followed by strings in dictionary order. If a number appears both as an integer and as a string... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shell_sort([]) == []\", \"assert shell_sort([1]) == [1]\", \"assert shell_sort(['1']) == ['1']\", \"assert shell_sort([2, '2', 1, '1']) == [1, 2, '1', '2']\", \"assert shell_sort(['a', 'b', 'c']) == ['a', 'b', 'c']\", \"assert shell_sort([3, 2, 1]) == [1, 2,... | {
"split": "train",
"index": 66873,
"acecode_id": "evol_17874",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that takes a string of text and counts the occurrences of unique words in it. The function should be named `count_unique_words_from_string` and should take a single parameter `text`, which represents the string of text to be proces... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_words_from_string('Hello world! Hello everyone.') == {'hello': 2, 'world': 1, 'everyone': 1}\", \"assert count_unique_words_from_string('This is a test. This is only a test.') == {'this': 2, 'is': 2, 'a': 2, 'test': 2, 'only': 1}\", \"assert cou... | {
"split": "train",
"index": 66874,
"acecode_id": "oss_8719",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are to implement a function `delegate_methods(delegate_obj)` that takes an instance of a class `DelegateTarget` as an argument. The `DelegateTarget` class has two methods: `do_something()` which returns the string 'Doing something' and `do_another_thing()` which returns the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delegate_methods(DelegateTarget()) == ('Doing something', 'Doing another thing')\", \"assert delegate_methods(DelegateTarget()) == ('Doing something', 'Doing another thing')\", \"assert delegate_methods(DelegateTarget()) == ('Doing something', 'Doing another... | {
"split": "train",
"index": 66875,
"acecode_id": "oss_8942",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `retrieve_and_store_data` that makes an API call to a given JSON endpoint, retrieves the data, processes it, and stores relevant results into a simulated SQL database. The function should handle errors that may arise due to failed API calls or unexpected respon... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert retrieve_and_store_data('https://invalid-url.com') == 'API call failed'\", \"assert retrieve_and_store_data('https://example.com/endpoint/data') == 'API call failed'\", \"assert retrieve_and_store_data('https://example.com/endpoint/data') == 'API call failed... | {
"split": "train",
"index": 66876,
"acecode_id": "evol_2656",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with checking the status of ECR (Elastic Container Registry) repositories to determine if they have a repository policy configured. Given a list of repositories, each represented by its name and an indication of whether it has a policy, your function should retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_repository_policies([('repo1', True), ('repo2', False)]) == [{'repository_name': 'repo1', 'compliance_status': 'PASSED', 'description': 'ECR repository repo1 has a repository policy configured.'}, {'repository_name': 'repo2', 'compliance_status': 'FAIL... | {
"split": "train",
"index": 66877,
"acecode_id": "bigcode_python_fns_19607",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of migration operation types represented as strings and returns a dictionary containing the count of each type of operation. The types of operations include 'CreateModel', 'AlterField', and 'DeleteModel'. The fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_migration_operations(['CreateModel', 'AlterField', 'AlterField', 'DeleteModel', 'AlterField', 'CreateModel', 'CreateModel']) == {'CreateModel': 3, 'AlterField': 3, 'DeleteModel': 1}\", \"assert count_migration_operations(['CreateModel', 'CreateModel', ... | {
"split": "train",
"index": 66878,
"acecode_id": "oss_5406",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of strings representing lines of code and extracts specific information based on certain patterns. Your function should identify and manipulate lines based on the following criteria:\n\n1. The function should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_lines(['', '', ' test : function testcase()', ' path : \\\"another/path/to/file.txt\\\"']) == ' test : function testcase()\\\\n path : \\\"another/path/to/file.txt\\\"\\\\n'\", \"assert process_lines(['', 'def other_function():', ' # t... | {
"split": "train",
"index": 66879,
"acecode_id": "oss_5989",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Write a function `fib_primes(N)` that computes all prime numbers within the Fibonacci sequence not exceeding a given input N. The function should return a list of the prime Fibonacci numbers. A prime number is defined as a number greater than 1 that has no positive divisors oth... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fib_primes(0) == []\", \"assert fib_primes(1) == []\", \"assert fib_primes(2) == [2]\", \"assert fib_primes(3) == [2, 3]\", \"assert fib_primes(5) == [2, 3, 5]\", \"assert fib_primes(8) == [2, 3, 5]\", \"assert fib_primes(13) == [2, 3, 5, 13]\", \"assert fib... | {
"split": "train",
"index": 66880,
"acecode_id": "evol_7281",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that configures a network service based on a given configuration. The configuration is provided as a list of dictionaries, where each dictionary contains a 'key' and a 'value'. Your goal is to determine the 'port' specified in the con... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert configure_service([{'key': 'port', 'value': '3000'}]) == 3000\", \"assert configure_service([{'key': 'host', 'value': 'localhost'}, {'key': 'port', 'value': '8081'}]) == 8081\", \"assert configure_service([{'key': 'timeout', 'value': '30'}, {'key': 'port', '... | {
"split": "train",
"index": 66881,
"acecode_id": "bigcode_python_fns_46214",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing the angles of rotation in radians for a robot, create a function that calculates the total angle the robot has rotated after executing all the rotations sequentially. The function should take the list as input and return the total angle as ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert total_rotation([0, 0, 0]) == 0\", \"assert total_rotation([1, 2, 3]) == 6\", \"assert total_rotation([-1, -2, -3]) == -6\", \"assert total_rotation([1, -1, 2, -2]) == 0\", \"assert total_rotation([3.14, 0, -3.14]) == 0\", \"assert total_rotation([10, -10, 5,... | {
"split": "train",
"index": 66882,
"acecode_id": "bigcode_python_fns_47205",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a Python function that identifies the smallest 'bottleneck' element in a list of integers. A 'bottleneck' element is defined as an element where the sum of all elements to its left is equal to the product of the non-zero elements to its right. If no 'bottleneck' is found... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_bottleneck([2, 4, 0, -8, -4, 3]) == -1\", \"assert find_bottleneck([0, 0, 0, 0]) == -1\", \"assert find_bottleneck([5, 1, -1, 0, 2]) == -1\", \"assert find_bottleneck([-1, 1, 2]) == -1\", \"assert find_bottleneck([2, -2, 0, 0, 2]) == -2\", \"assert find... | {
"split": "train",
"index": 66883,
"acecode_id": "evol_13720",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating a list of regular expression patterns for paired-end reads based on given read tags and a file extension. Write a function `generate_regex_patterns(read_tags: List[str], file_extension: str) -> List[str]` that takes in a list of read tags and a fi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_regex_patterns(['read1', 'read2'], 'txt') == ['read1\\\\.txt', 'read2\\\\.txt']\", \"assert generate_regex_patterns(['sampleA', 'sampleB', 'sampleC'], 'fastq') == ['sampleA\\\\.fastq', 'sampleB\\\\.fastq', 'sampleC\\\\.fastq']\", \"assert generate_r... | {
"split": "train",
"index": 66884,
"acecode_id": "bigcode_python_fns_30173",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function in Python that takes an input string and performs two operations: first, it swaps the case of each letter (i.e., converts uppercase letters to lowercase and vice versa), and second, it replaces all vowels (a, e, i, o, u) with asterisks (*). The function should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert swap_case_and_replace_vowels('Hello World!') == 'h*LL* w*RLD!'\", \"assert swap_case_and_replace_vowels('12345') == '12345'\", \"assert swap_case_and_replace_vowels('') == ''\", \"assert swap_case_and_replace_vowels('Vowels: A, E, I, O, U') == 'v*W*LS: *, *,... | {
"split": "train",
"index": 66885,
"acecode_id": "evol_34688",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given a string of text, write a function that splits the text into segments based on a specified maximum length. The function should take the following parameters: a string `text`, an integer `max_length`, and an optional boolean `ignore_short`. If `ignore_short` is set to True... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert split_text_by_length('Python programming', 10) == ['Python pro', 'gramming']\", \"assert split_text_by_length('', 5) == []\", \"assert split_text_by_length('Short', 10) == ['Short']\", \"assert split_text_by_length('Hello!', 3) == ['Hel', 'lo!']\", \"assert ... | {
"split": "train",
"index": 66886,
"acecode_id": "bigcode_python_fns_5963",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a list of squares defined by their top-left corner coordinates (min_x, min_y) in a Cartesian plane. Your task is to create a function that removes any squares that are within 40 pixels of each other in both x and y coordinates. Specifically, if two squares have th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_overlapping_squares([(10, 10), (15, 15), (100, 100), (105, 105)]) == [(10, 10), (100, 100)]\", \"assert remove_overlapping_squares([(0, 0), (39, 39), (38, 38), (80, 80)]) == [(0, 0), (80, 80)]\", \"assert remove_overlapping_squares([(0, 0), (0, 41), (... | {
"split": "train",
"index": 66887,
"acecode_id": "bigcode_python_fns_39545",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You need to create a function `blank_response` that constructs a response object with a blank body. The function should return a dictionary containing a single key 'data' with an empty string as its value. Implement the function without any external resources or databases.\nPle... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert blank_response() == {'data': ''}\", \"assert blank_response() == {'data': ''}\", \"assert blank_response() == {'data': ''}\", \"assert blank_response() == {'data': ''}\", \"assert blank_response() == {'data': ''}\", \"assert blank_response() == {'data': ''}\... | {
"split": "train",
"index": 66888,
"acecode_id": "bigcode_python_fns_17414",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a function that retrieves the maximum value from a given dictionary, where the values can be either integers or strings. If the maximum value is a string, return the string with the greatest lexicographical order. If the maximum value is an integer, return that integer.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fetch_max({'Name': 'Bob', 'Age': 22, 'Score': 100}) == 100\", \"assert fetch_max({'Apple': 2, 'Banana': 5, 'Cherry': 'grape'}) == 5\", \"assert fetch_max({'only_string': 'hello'}) == 'hello'\", \"assert fetch_max({'only_integer': 42}) == 42\", \"assert fetch... | {
"split": "train",
"index": 66889,
"acecode_id": "evol_34726",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `count_positive_numbers(nums)` that returns the count of positive numbers in the list. A positive number is defined as a number greater than zero. The function should take a list of integers as input and return a single integer as outp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_positive_numbers([1, 2, 3, 4, 5]) == 5\", \"assert count_positive_numbers([-1, -2, -3, -4, -5]) == 0\", \"assert count_positive_numbers([0, 0, 0, 0]) == 0\", \"assert count_positive_numbers([1, -1, 2, 3, -2]) == 3\", \"assert count_positive_numbers([])... | {
"split": "train",
"index": 66890,
"acecode_id": "bigcode_python_fns_29702",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that imports samples from a given S3 URI to a specified project. The function should take the following parameters: `s3_uri` (a string representing the S3 URI), `project_id` (a string representing the project ID), `metadata_json` (a strin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert import_samples('s3://bucket/path/', '06a5d04b-526a-4471-83ba-fb54e0941758', '{\\\"error\\\": \\\"metadata\\\"}', 'https://example.com', 'user@example.com', 'wrong_password', 'ghi789') == 'Import failed for project 06a5d04b-526a-4471-83ba-fb54e0941758 from s3... | {
"split": "train",
"index": 66891,
"acecode_id": "bigcode_python_fns_37354",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing the metadata of a prediction frame generated from a machine learning model. Your job is to implement a Python function that extracts specific information from the prediction frame metadata. The input to your function will be a dictionary that cont... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_prediction_frame_metadata({\\\"frames\\\":[{\\\"key\\\":{\\\"name\\\":\\\"frame1\\\"},\\\"vec_keys\\\":[\\\"vec1\\\",\\\"vec2\\\"],\\\"rows\\\":50,\\\"column_names\\\":[\\\"col1\\\",\\\"col2\\\"]}]}) == {\\\"prediction_frame_key\\\": \\\"frame1\\\", ... | {
"split": "train",
"index": 66892,
"acecode_id": "oss_33324",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes in a list of integers and a specified mathematical series (like Fibonacci, Geometric series, or Arithmetic series). The function should return a list of numbers that are both prime and belong to the given mathematical series. The function signatu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert series_prime_filter([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 'arithmetic', 1, 1, 10) == [2, 3, 5, 7]\", \"assert series_prime_filter([10, 20, 30, 40, 50], 'arithmetic', 10, 10, 100) == []\", \"assert series_prime_filter([5, 15, 25, 35], 'arithmetic', 5, 10, 100) == ... | {
"split": "train",
"index": 66893,
"acecode_id": "evol_15188",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Develop a function that takes a list of projects, where each project is represented as a tuple containing its Project ID, Project Name, and an optional Previous Lead (which can be None if no lead is assigned). The function should also take a list of leads, where each lead is re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert assign_lead_and_update_project([(1, 'Test Project', None)], [(1, 5), (2, 3), (3, 4)]) == [(1, 'Test Project', None, 2)]\", \"assert assign_lead_and_update_project([(1, 'Project 1', None), (2, 'Project 2', None)], [(1, 1), (2, 0)]) == [(1, 'Project 1', None, ... | {
"split": "train",
"index": 66894,
"acecode_id": "evol_26547",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that extracts the owner and repository name from a given GitHub repository URL. The function should take a string representing the GitHub repository URL as input and return a tuple containing the owner and repository name. The URL ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_repo_info('https://github.com/lennart-damen/api-tutorial') == ('lennart-damen', 'api-tutorial')\", \"assert extract_repo_info('https://github.com/facebook/react') == ('facebook', 'react')\", \"assert extract_repo_info('https://github.com/tensorflow/t... | {
"split": "train",
"index": 66895,
"acecode_id": "oss_20849",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of dictionaries representing tickets, each containing a 'bfid' key and a boolean value indicating whether the cache should be enabled, create a new list of events where each event is a dictionary containing the 'bfid' from the ticket and a key 'cache' that includes... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_events([{'bfid': '1', 'cache_enabled': True}]) == [{'bfid': '1', 'cache': {'en': True}}]\", \"assert create_events([{'bfid': '2', 'cache_enabled': False}]) == [{'bfid': '2', 'cache': {'en': False}}]\", \"assert create_events([{'bfid': '3', 'cache_enab... | {
"split": "train",
"index": 66896,
"acecode_id": "bigcode_python_fns_38243",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a keyword argument representing different platform types and returns a string indicating which platform is being used. The function should accept the following keyword arguments: 'darwin', 'linux', and 'windows'. If the argumen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert detect_platform(darwin=True) == 'Platform detected: darwin'\", \"assert detect_platform(linux=True) == 'Platform detected: linux'\", \"assert detect_platform(windows=True) == 'Platform detected: windows'\", \"assert detect_platform(darwin=True, linux=True) =... | {
"split": "train",
"index": 66897,
"acecode_id": "bigcode_python_fns_11356",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string `s` that may contain a hidden word enclosed within two parentheses `(` and `)`. Your task is to write a function `extract_hidden_word` that extracts the hidden word from the string. If there are no parentheses or the format is incorrect, the function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_hidden_word('python(is)awesome') == 'is'\", \"assert extract_hidden_word('nohiddenword') == 'No hidden word found'\", \"assert extract_hidden_word('hello(world)') == 'world'\", \"assert extract_hidden_word('multiple)closing(') == 'No hidden word foun... | {
"split": "train",
"index": 66898,
"acecode_id": "oss_10022",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that generates a 2-D array. In this 2-D array, each row is a sublist of the given list. The first row should contain the first element from the list, the second row should contain the first two elements from the list, the third row... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_2d_array([1, 2, 3]) == [[1], [1, 2], [1, 2, 3]]\", \"assert create_2d_array([4, 5, 6, 7]) == [[4], [4, 5], [4, 5, 6], [4, 5, 6, 7]]\", \"assert create_2d_array([10]) == [[10]]\", \"assert create_2d_array([]) == []\", \"assert create_2d_array([1, 2, 3,... | {
"split": "train",
"index": 66899,
"acecode_id": "evol_13969",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.