data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "You are given a 2D grid represented as a list of lists, where each element is either 0 or 1. Your task is to implement a function that counts the number of empty blocks in the grid, where an empty block is defined as a cell containing the value 0. The function should take an in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_empty_blocks(2, [[1, 1], [1, 1]]) == 0\", \"assert count_empty_blocks(1, [[0]]) == 1\", \"assert count_empty_blocks(1, [[1]]) == 0\", \"assert count_empty_blocks(4, [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]) == 16\", \"assert count_empty... | {
"split": "train",
"index": 79000,
"acecode_id": "bigcode_python_fns_16713",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary of headers and a string body. The headers may contain a 'Content-Type' key, which indicates the format of the body. If the content type is 'application/xml', you need to return the body formatted as pretty-printed XML. If the content type is 'applicat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_pretty_body({}, 'Just a plain body') == 'Just a plain body'\", \"assert get_pretty_body({'Content-Type': 'text/plain'}, 'Just some text') == 'Just some text'\", \"assert get_pretty_body({'Content-Type': 'application/xml'}, '<empty/>') == '<?xml version=\... | {
"split": "train",
"index": 79001,
"acecode_id": "bigcode_python_fns_44380",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that accepts a log level type, a message string, and an optional log value. The log level type is an integer where 0 represents INFO, 1 represents WARNING, and 2 represents ERROR. The function should return a formatted string that combine... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_log(0, 'System is booting up') == 'INFO: System is booting up'\", \"assert format_log(1, 'Low disk space', 'Alert') == 'WARNING: Low disk space Alert'\", \"assert format_log(2, 'Connection failed', 'Retrying') == 'ERROR: Connection failed Retrying'\",... | {
"split": "train",
"index": 79002,
"acecode_id": "bigcode_python_fns_1107",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing file paths in a project. Your task is to categorize these file paths into different components based on their directory structure. Implement a function `categorize_paths(paths: List[str], n_clusters: int) -> List[str]` where: \n\n- `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert categorize_paths(['src/api/user.py', 'src/api/admin.py', 'src/utils/logger.py'], 3) == ['api', 'api', 'utils']\", \"assert categorize_paths(['src/redux/actions.js', 'src/redux/reducers.js'], 2) == ['redux', 'redux']\", \"assert categorize_paths(['src/service... | {
"split": "train",
"index": 79003,
"acecode_id": "bigcode_python_fns_36872",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks if a given string is a palindrome. A palindrome is a string that reads the same backward as forward, ignoring spaces, punctuation, and capitalization. Write a function `is_palindrome(s: str) -> bool` that takes a string `s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_palindrome('A man, a plan, a canal, Panama') == True\", \"assert is_palindrome('Was it a car or a cat I saw?') == True\", \"assert is_palindrome('No lemon, no melon') == True\", \"assert is_palindrome('Hello, World!') == False\", \"assert is_palindrome('M... | {
"split": "train",
"index": 79004,
"acecode_id": "bigcode_python_fns_16199",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates creating a database and returns a unique identifier (ID) for the newly created database. The function should take in the following parameters: a string 'db_name', and an optional list of strings 'encoding' which contains tw... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_database_id('test_db') == 'id_1'\", \"assert create_database_id('prod_db') == 'id_2'\", \"assert create_database_id('dev_db') == 'id_3'\", \"assert create_database_id('other_db') == 'id_0'\", \"assert create_database_id('test_db', ['UTF-8', 'en_US']) ... | {
"split": "train",
"index": 79005,
"acecode_id": "bigcode_python_fns_46296",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that manages a university course. The function should take a course name, course code, instructor name, and a list of student names as input. It should return a string that displays the course details, including the course name, course co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_university_course('Computer Science', 'CS101', 'Dr. Smith', ['Alice', 'Bob']) == 'Course Name: Computer Science\\\\nCourse Code: CS101\\\\nInstructor: Dr. Smith\\\\nEnrolled Students: Alice, Bob'\", \"assert manage_university_course('Mathematics', 'MA... | {
"split": "train",
"index": 79006,
"acecode_id": "oss_19066",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python class that manages the execution of a sequence of tasks. Your implementation should provide the following functionalities:\n\n1. A method `start_stuff` that prints \"Starting stuff...\".\n2. A method `end_stuff` that prints \"Ending stu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert TaskManager().start_stuff() == 'Starting stuff...'\", \"assert TaskManager().print_message('Test message') == 'Test message'\", \"assert TaskManager().end_stuff() == 'Ending stuff...'\", \"assert TaskManager().print_message('Hello, World!') == 'Hello, World!... | {
"split": "train",
"index": 79007,
"acecode_id": "oss_26339",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representation of a range in the format 'start,end' where 'start' and 'end' are integers. Your task is to implement a function that validates this range according to the following rules: 1. The range should have exactly two values separated by a comma. 2.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validateRange('1,5') == True\", \"assert validateRange('5,5') == False\", \"assert validateRange('10,5') == False\", \"assert validateRange('-1,5') == False\", \"assert validateRange('1,-5') == False\", \"assert validateRange(',,') == False\", \"assert valid... | {
"split": "train",
"index": 79008,
"acecode_id": "bigcode_python_fns_17417",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a string as input and returns a masked version of the string where each character is replaced by an asterisk ('*'). The function should also ensure that if the input string is empty, it returns an empty string. Implement a func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert mask_password('abc') == '***'\", \"assert mask_password('') == ''\", \"assert mask_password('a') == '*'\", \"assert mask_password('Hello, World!') == '*************'\", \"assert mask_password('LeetCode') == '********'\", \"assert mask_password('P@ssw0rd') ==... | {
"split": "train",
"index": 79009,
"acecode_id": "bigcode_python_fns_12094",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the sum of the first `n` even numbers. The function should take a single integer input `n` (1 <= n <= 1000) and return the sum of the first `n` even numbers starting from 0. For example, if `n` is 3, the function shoul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_even_numbers(1) == 0\", \"assert sum_of_even_numbers(2) == 2\", \"assert sum_of_even_numbers(3) == 6\", \"assert sum_of_even_numbers(4) == 12\", \"assert sum_of_even_numbers(5) == 20\", \"assert sum_of_even_numbers(6) == 30\", \"assert sum_of_even_num... | {
"split": "train",
"index": 79010,
"acecode_id": "bigcode_python_fns_25717",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a frame represented as a 2D list containing integer values, where each integer represents a pixel value. You need to implement a function that takes three arguments: the frame, the frame number (an integer), and a y-value (an integer). The function should return a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert annotate_frame([[0, 0, 0], [0, 0, 0], [0, 0, 0]], 1, 5) == [[0, 0, 0], [0, 0, 0], [0, 0, 0]]\", \"assert annotate_frame([[255, 255, 255], [255, 255, 255], [255, 255, 255]], 2, 10) == [[255, 255, 255], [255, 255, 255], [255, 255, 255]]\", \"assert annotate_fr... | {
"split": "train",
"index": 79011,
"acecode_id": "bigcode_python_fns_20521",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers and returns a new list containing only the unique integers from the original list, maintaining the order of their first appearance. Write a Python function `unique_integers` that takes a single parameter ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_integers([1, 2, 2, 3, 4, 4, 5]) == [1, 3, 5]\", \"assert unique_integers([1, 1, 1, 1, 1]) == []\", \"assert unique_integers([3, 5, 3, 7, 9, 5, 2]) == [7, 9, 2]\", \"assert unique_integers([]) == []\", \"assert unique_integers([10, 20, 10, 30, 40, 30, ... | {
"split": "train",
"index": 79012,
"acecode_id": "oss_25161",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a module path, which is a dot-separated list of identifiers (e.g., 'abscal.wfc3.reduce_grism_extract'). Your task is to implement a function that takes this module path and a variable number of keyword arguments (as strings). The function sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_file_name('abscal.wfc3.reduce_grism_extract') == 'abscal.wfc3.defaults.reduce_grism_extract.yaml'\", \"assert generate_file_name('com.example.module.some_function') == 'com.example.module.defaults.some_function.yaml'\", \"assert generate_file_name('... | {
"split": "train",
"index": 79013,
"acecode_id": "bigcode_python_fns_28446",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a version comparison and manipulation system for software packages. Your goal is to create a function that can perform the following operations based on version strings: \n\n1. Compare two version strings and determine their relationship. The fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert version_operations('1.0.0', '1.0.1', 'patch') == (-1, '1.0.1')\", \"assert version_operations('1.0.0', '1.0.0', 'minor') == (0, '1.1.0')\", \"assert version_operations('1.2.3', '1.2.3', 'major') == (0, '2.0.0')\", \"assert version_operations('1.2.9', '1.3.0'... | {
"split": "train",
"index": 79014,
"acecode_id": "oss_4390",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `sum_odd_length_subarrays(arr)` that calculates the sum of all subarrays of odd length. A subarray is defined as a contiguous segment of the array. The function should return the total sum of all such subarrays with odd lengths.\nPleas... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_odd_length_subarrays([1]) == 1\", \"assert sum_odd_length_subarrays([]) == 0\", \"assert sum_odd_length_subarrays([0, 0, 0]) == 0\", \"assert sum_odd_length_subarrays([7]) == 7\", \"assert sum_odd_length_subarrays([100, 1]) == 101\"]}"
} | {
"split": "train",
"index": 79015,
"acecode_id": "evol_1100",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates a system reservation process. The function should take in a list of system statuses and return a corresponding list of reservation codes based on the following criteria: Return code 0: The system is accessible and av... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reserve_systems(['accessible', 'inaccessible', 'reserved', 'accessible']) == [0, 1, 2, 0]\", \"assert reserve_systems(['accessible']) == [0]\", \"assert reserve_systems(['inaccessible']) == [1]\", \"assert reserve_systems(['reserved']) == [2]\", \"assert res... | {
"split": "train",
"index": 79016,
"acecode_id": "oss_36474",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simplified version of a version control system. Your program should be able to handle basic operations such as creating a new repository, adding files to the repository, committing changes, and checking the commit history. You need to implement a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert execute_commands([\\\"create myrepo\\\", \\\"add myrepo file1.txt\\\", \\\"commit myrepo -m 'Initial commit'\\\", \\\"history myrepo\\\"]) == ['Commit History:\\\\n1. Initial commit']\", \"assert execute_commands([\\\"create myrepo\\\", \\\"history myrepo\\\... | {
"split": "train",
"index": 79017,
"acecode_id": "oss_37205",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of a series of buildings in a city skyline. Your task is to implement a function `maxHeight(buildings: List[int]) -> int` that returns the maximum height among the buildings. The function should take a list of integers a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert maxHeight([3, 5, 2, 7, 4]) == 7\", \"assert maxHeight([1, 2, 3, 4, 5]) == 5\", \"assert maxHeight([10, 20, 30]) == 30\", \"assert maxHeight([0, 0, 0]) == 0\", \"assert maxHeight([100]) == 100\", \"assert maxHeight([]) == 0\", \"assert maxHeight([1]) == 1\", ... | {
"split": "train",
"index": 79018,
"acecode_id": "bigcode_python_fns_11182",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string, count the number of words in the string. A word is defined as a sequence of characters separated by spaces. You need to implement a function `count_words(my_str: str) -> int` that takes a single string input and returns the total count of words in that string. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_words('This is a test') == 4\", \"assert count_words(' Hello world ') == 2\", \"assert count_words('') == 0\", \"assert count_words('word') == 1\", \"assert count_words(' word ') == 1\", \"assert count_words('one two three four five') == 5\", ... | {
"split": "train",
"index": 79019,
"acecode_id": "bigcode_python_fns_15136",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two strings `s` and `t`, return `true` if `t` is an anagram of `s`, and `false` otherwise. The comparison should be case-sensitive and special characters should be considered. Implement the function `isAnagram(s: str, t: str) -> bool`.\nPlease reason step by step, then wr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isAnagram('Anagram', 'nagaramA') == False\", \"assert isAnagram('rat!', '!tar') == True\", \"assert isAnagram('hello', 'olleh') == True\", \"assert isAnagram('abc123', '321cba') == True\", \"assert isAnagram('test', 'tset') == True\", \"assert isAnagram('aab... | {
"split": "train",
"index": 79020,
"acecode_id": "evol_22675",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a version comparison tool that compares two version strings formatted according to Semantic Versioning (SemVer). Each version string consists of three non-negative integers separated by periods (e.g., '1.2.3'). Your goal is to implement a function t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compare_versions('1.0.0', '1.0.0') == 0\", \"assert compare_versions('1.0.1', '1.0.0') == 1\", \"assert compare_versions('1.0.0', '1.0.1') == -1\", \"assert compare_versions('2.0.0', '1.9.9') == 1\", \"assert compare_versions('1.2.3', '1.2.3') == 0\", \"asse... | {
"split": "train",
"index": 79021,
"acecode_id": "oss_33762",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with extracting the domain names from a list of email addresses. Create a Python function `extract_domains` that takes a list of email addresses and returns a list of unique domain names. The domain name is defined as the part of the email address that comes afte... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_domains(['user@invalid', 'user@domain.com']) == ['domain.com']\", \"assert extract_domains(['user@domain.com', 'user1@domain.com', 'user2@domain.com']) == ['domain.com']\", \"assert extract_domains(['@domain.com', 'user@.com', 'user@domain.com']) == ... | {
"split": "train",
"index": 79022,
"acecode_id": "oss_11227",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of integers and returns a new list containing only the unique integers from the original list while preserving their original order. Write a function called `unique_integers` that implements this behavior. The input will... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_integers([1, 2, 2, 3, 4, 3, 5]) == [1, 2, 3, 4, 5]\", \"assert unique_integers([1, 1, 1, 1]) == [1]\", \"assert unique_integers([]) == []\", \"assert unique_integers([5, 5, 5, 5, 5]) == [5]\", \"assert unique_integers([1, 2, 3, 4]) == [1, 2, 3, 4]\", ... | {
"split": "train",
"index": 79023,
"acecode_id": "oss_3523",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string containing a series of dates and comments. Each date is represented in the format YYYYMMDD, followed by a series of comments denoted by the '#' character. Your task is to extract the dates and comments and store them in a structured format. Write a functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_dates_comments('20210101\\\\n# New Year Celebration\\\\n20201231\\\\n# Last Day of Year') == [('20210101', ['New Year Celebration']), ('20201231', ['Last Day of Year'])]\", \"assert extract_dates_comments('20220315\\\\n# I am happy\\\\n# Excited for ... | {
"split": "train",
"index": 79024,
"acecode_id": "oss_11716",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that calculates the prevalence of a certain condition based on age groups. The prevalence values for different age groups are defined as follows: For ages 0 to 39, the prevalence is 0.0428; for ages 40 to 44, it is 0.0489; for ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_prevalence(0) == 0.0428\", \"assert calculate_prevalence(25) == 0.0428\", \"assert calculate_prevalence(39) == 0.0428\", \"assert calculate_prevalence(40) == 0.0489\", \"assert calculate_prevalence(42) == 0.0489\", \"assert calculate_prevalence(44)... | {
"split": "train",
"index": 79025,
"acecode_id": "oss_23393",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of submission records, where each record is a dictionary containing an 'alias' (a string representing the submitter) and a 'score' (a float representing the score of the submission). Your task is to implement a function that retrieves the alias and score of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_best_submission([{'alias': 'user1', 'score': 3.5}, {'alias': 'user2', 'score': 2.1}, {'alias': 'user3', 'score': 4.0}]) == ('user2', 2.1)\", \"assert get_best_submission([{'alias': 'userA', 'score': 10.0}, {'alias': 'userB', 'score': 10.0}]) == ('userA',... | {
"split": "train",
"index": 79026,
"acecode_id": "bigcode_python_fns_35918",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a class with a method that has an attribute called 'method'. Your task is to implement a function that checks if this attribute is equal to 'multidim_parameter_study'. The function should return True if they are equal, otherwise return False. You will be given an ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_method_attribute(type('obj', (), {'method': 'multidim_parameter_study'})()) == True\", \"assert check_method_attribute(type('obj', (), {'method': 'single_param_study'})()) == False\", \"assert check_method_attribute(type('obj', (), {'method': 'multidim... | {
"split": "train",
"index": 79027,
"acecode_id": "bigcode_python_fns_322",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of stock prices for a specific stock symbol over a series of dates. Each entry in the list is represented as a dictionary with the keys 'date', 'open', 'high', 'low', 'close', 'adj_close', and 'volume'. Your task is to implement a function that takes this l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_stock_data([{'date': '2023/01/01', 'open': 100, 'high': 110, 'low': 90, 'close': 105, 'adj_close': 105, 'volume': 1000}, {'date': '2023/01/01', 'open': 100, 'high': 110, 'low': 90, 'close': 105, 'adj_close': 105, 'volume': 1000}]) == [{'date': '2023-0... | {
"split": "train",
"index": 79028,
"acecode_id": "bigcode_python_fns_20047",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes in a date string in the format 'Month Day, Year' and returns the corresponding day of the week as a string. For example, given the input 'June 3, 2020', the output should be 'Wednesday'.\nPlease reason step by step, then write a self-contained Py... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_day_of_week('January 1, 2020') == 'Wednesday'\", \"assert get_day_of_week('February 29, 2020') == 'Saturday'\", \"assert get_day_of_week('March 15, 2021') == 'Monday'\", \"assert get_day_of_week('April 1, 2021') == 'Thursday'\", \"assert get_day_of_week(... | {
"split": "train",
"index": 79029,
"acecode_id": "evol_9935",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists: one containing feature names (strings) and the other containing their corresponding importance scores (floats). Write a function that returns a sorted list of tuples, where each tuple contains a feature name and its importance score, sorted in descendin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_feature_importances(['feature1', 'feature2', 'feature3'], [0.2, 0.5, 0.3]) == [('feature2', 0.5), ('feature3', 0.3), ('feature1', 0.2)]\", \"assert sort_feature_importances(['a', 'b', 'c'], [1.0, 1.0, 0.5]) == [('a', 1.0), ('b', 1.0), ('c', 0.5)]\", \"a... | {
"split": "train",
"index": 79030,
"acecode_id": "bigcode_python_fns_13172",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `SieveOfEratosthenes(n)` that returns a list of all prime numbers between 2 and n (inclusive) using the Sieve of Eratosthenes algorithm. The input parameter n is a positive integer. Your function should not print the results directly but return the list of prim... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert SieveOfEratosthenes(10) == [2, 3, 5, 7]\", \"assert SieveOfEratosthenes(20) == [2, 3, 5, 7, 11, 13, 17, 19]\", \"assert SieveOfEratosthenes(1) == []\", \"assert SieveOfEratosthenes(2) == [2]\", \"assert SieveOfEratosthenes(3) == [2, 3]\", \"assert SieveOfEra... | {
"split": "train",
"index": 79031,
"acecode_id": "evol_33871",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary that represents a hash test vector for Linux's crypto tests, implement a function `format_hash_test_vector(test_vector: Dict[str, Any]) -> List[str]` that formats the hash test vector into a list of strings. The input dictionary `test_vector` will have the fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_hash_test_vector({'input': {'key': 'abcdef', 'message': '123456'}, 'hash': '789abc'}) == ['key: abcdef', 'ksize: 6', 'plaintext: 123456', 'psize: 6', 'digest: 789abc']\", \"assert format_hash_test_vector({'input': {'key': '1a2b3c', 'message': '4d5e6f'... | {
"split": "train",
"index": 79032,
"acecode_id": "bigcode_python_fns_36891",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a variable `v` which could be of any type. Your task is to implement a function `laxnodeset(v)` that checks if `v` is an instance of `NodeSet`. If it is, the function should return `v` unchanged. If `v` is not an instance of `NodeSet`, you should convert `v` into ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isinstance(laxnodeset(5), NodeSet)\", \"assert isinstance(laxnodeset('hello'), NodeSet)\", \"assert isinstance(laxnodeset([1, 2, 3]), NodeSet)\", \"assert isinstance(laxnodeset({'key': 'value'}), NodeSet)\", \"assert isinstance(laxnodeset((1, 2)), NodeSet)\"... | {
"split": "train",
"index": 79033,
"acecode_id": "bigcode_python_fns_24786",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of items represented by their weights and values, and a maximum capacity for a knapsack, implement a function `knapsack(weights, values, capacity)` that returns the maximum value that can be obtained by selecting items without exceeding the capacity of the knapsack... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert knapsack([10, 20, 30], [60, 100, 120], 50) == 220\", \"assert knapsack([3, 4, 5], [50, 60, 70], 7) == 110\", \"assert knapsack([2, 2, 2], [10, 20, 30], 3) == 30\", \"assert knapsack([3, 5, 7], [20, 30, 40], 7) == 40\", \"assert knapsack([1, 2, 3], [10, 15, 4... | {
"split": "train",
"index": 79034,
"acecode_id": "evol_4151",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `validate_and_set_loaders` that takes in three parameters: a list of strings `template_loaders`, a boolean `app_dirs`, and a boolean `custom_loaders`. The function should validate the input parameters and set the template loaders and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_and_set_loaders(['loader1', 'loader2'], False, True) == ('custom_loaders', (['loader1', 'loader2'], False))\", \"assert validate_and_set_loaders([], True, False) == ('default_loaders', (None, True))\", \"assert validate_and_set_loaders([], False, Fa... | {
"split": "train",
"index": 79035,
"acecode_id": "oss_21593",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a string as input and returns the string in reverse order without using any built-in functions or iterative constructs. You must use recursion in your solution. For example, given the input 'Hello World', the output should be 'dlroW olleH'.\nPlease r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_string('Hello World') == 'dlroW olleH'\", \"assert reverse_string('Python') == 'nohtyP'\", \"assert reverse_string('OpenAI') == 'IAnepO'\", \"assert reverse_string('Recursion') == 'noisruceR'\", \"assert reverse_string('12345') == '54321'\", \"assert... | {
"split": "train",
"index": 79036,
"acecode_id": "evol_14959",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that performs a 2D interpolation search on a sorted matrix. Given a matrix 'mtx' which is sorted in ascending order both row-wise and column-wise, and a target value 'y', the function should return the indices of 'y' in the matrix as a tuple (row_index, col... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert interpolationSearchMatrix([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 5) == (1, 1)\", \"assert interpolationSearchMatrix([[10, 20, 30], [40, 50, 60], [70, 80, 90]], 10) == (0, 0)\", \"assert interpolationSearchMatrix([[5, 10, 15], [20, 25, 30], [35, 40, 45]], 25) == ... | {
"split": "train",
"index": 79037,
"acecode_id": "evol_20090",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that generates a summary report based on image format data. The function will take a list of format dictionaries as input, where each dictionary contains information about the channel order and channel data type. Each format di... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_format_summary([{'channel_order': 1, 'channel_data_type': 'RGB'}, {'channel_order': 1, 'channel_data_type': 'RGB'}]) == '1 RGB FORMATS: 2\\\\n'\", \"assert generate_format_summary([{'channel_order': 1, 'channel_data_type': 'RGB'}, {'channel_order': ... | {
"split": "train",
"index": 79038,
"acecode_id": "oss_28350",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Write a function `largest_prime_factor(n: int) -> int` that returns the largest prime factor of the given integer n. The function should only return prime factors that are less than n. You may assume that n is a positive integer greater than 1.\nPlease reason step by step, then... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert largest_prime_factor(100) == 5\", \"assert largest_prime_factor(81) == 3\", \"assert largest_prime_factor(77) == 11\", \"assert largest_prime_factor(60) == 5\", \"assert largest_prime_factor(49) == 7\", \"assert largest_prime_factor(91) == 13\", \"assert lar... | {
"split": "train",
"index": 79039,
"acecode_id": "evol_9006",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of numerical values representing pixel intensities from an image, write a function `ci_color_limits(imData: List[float], sigma: float = 2.5) -> List[float]` that calculates the confidence interval color limits for the image data. The function should return a list c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert ci_color_limits([5, 5, 5]) == [5.0, 5.0]\", \"assert ci_color_limits([]) == []\", \"assert ci_color_limits([0, 0, 0, 0]) == [0.0, 0.0]\", \"assert ci_color_limits([1.0, 1.0, 1.0, 1.0]) == [1.0, 1.0]\", \"assert ci_color_limits([1000, 1000, 1000]) == [1000.0,... | {
"split": "train",
"index": 79040,
"acecode_id": "bigcode_python_fns_38905",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the sum of all the even numbers in a given list of integers. The function should take a list of integers as input and return the sum of all the even numbers in the list. If the list is empty or does not contain any eve... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_even_numbers([1, 2, 3, 4, 5, 6]) == 12\", \"assert sum_of_even_numbers([0, 1, 2, 3, 4]) == 6\", \"assert sum_of_even_numbers([1, 3, 5]) == 0\", \"assert sum_of_even_numbers([]) == 0\", \"assert sum_of_even_numbers([2, 4, 6]) == 12\", \"assert sum_of_e... | {
"split": "train",
"index": 79041,
"acecode_id": "oss_7220",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a nested list of integers as input, implement a function that calculates the sum of all the integers located at odd indices within each sub-list of the nested structure. The index counting starts at 0. For instance, for the input [1, 2, [3, 4, [5, 6], 7], 8, 9], the outpu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_sum_at_odd_index([1, 2, 3, 4, 5]) == 6\", \"assert get_sum_at_odd_index([1, [2, 3, [4]], 5]) == 3\", \"assert get_sum_at_odd_index([[1, 2], [3, 4, 5], 6]) == 6\", \"assert get_sum_at_odd_index([1, 3, 5, 7]) == 10\", \"assert get_sum_at_odd_index([0, 0, [... | {
"split": "train",
"index": 79042,
"acecode_id": "evol_3661",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that handles errors when a user tries to access a non-existent page on a website. Your function should take a URL as an input and determine if the page exists. If the page does not exist, it should return a message indicating that the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert handle_page_error('nonexistent_page', 'homepage') == ('Page Not Found', 'homepage')\", \"assert handle_page_error('another_nonexistent_page', None) == ('Page Not Found', None)\", \"assert handle_page_error('missing_page', 'contact') == ('Page Not Found', 'co... | {
"split": "train",
"index": 79043,
"acecode_id": "bigcode_python_fns_26434",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a joint chain in a 3D space defined by a start and end position. Write a function `build_joint_chain(prefix: str, suffix: str, start_pos: List[float], end_pos: List[float], joint_num: int, orient_joint: str = 'xyz', sao_type: str = 'yup') -> List[st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert build_joint_chain('joint', 'A', [0.0, 0.0, 0.0], [0.0, 0.0, 1.0], 3) == ['joint_0_A', 'joint_1_A', 'joint_2_A']\", \"assert build_joint_chain('joint', 'B', [1.0, 1.0, 1.0], [1.0, 1.0, 3.0], 2) == ['joint_0_B', 'joint_1_B']\", \"assert build_joint_chain('join... | {
"split": "train",
"index": 79044,
"acecode_id": "bigcode_python_fns_45784",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a URL, write a function `is_live_site(url: str) -> bool` that checks whether the URL belongs to any of the Isaac websites related to physics, chemistry, maths, biology, or science. The function should return `True` if the URL belongs to one of the fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_live_site('http://isaacphysics.org') == True\", \"assert is_live_site('https://isaacchemistry.org') == True\", \"assert is_live_site('http://isaacmaths.org') == True\", \"assert is_live_site('https://isaacbiology.org') == True\", \"assert is_live_site('ht... | {
"split": "train",
"index": 79045,
"acecode_id": "bigcode_python_fns_8727",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of buildings in a city. Your task is to write a function that returns the total number of visible buildings when viewed from the left side. A building is considered visible if it is taller than all the previous buildings... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_visible_buildings([1, 2, 3, 4, 5]) == 5\", \"assert count_visible_buildings([5, 4, 3, 2, 1]) == 1\", \"assert count_visible_buildings([2, 2, 2, 2, 2]) == 1\", \"assert count_visible_buildings([1, 3, 2, 4, 1]) == 3\", \"assert count_visible_buildings([]... | {
"split": "train",
"index": 79046,
"acecode_id": "bigcode_python_fns_45288",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing a user's permissions and an action that they want to perform. Your task is to implement a function `check_permission(user_permissions: Dict[str, bool], action: str) -> bool` that checks if the user has the required permission for the spec... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_permission({'read': True, 'write': False}, 'read') == True\", \"assert check_permission({'read': True, 'write': False}, 'write') == False\", \"assert check_permission({'read': True, 'write': True}, 'delete') == False\", \"assert check_permission({}, 'r... | {
"split": "train",
"index": 79047,
"acecode_id": "bigcode_python_fns_28458",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the scores of a game. The game has a special rule where if the current score is the same as the previous score, the current score is not counted towards the total score. Write a function `calculate_total_score(scores: List[int]) -> ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_score([1, 2, 2, 3, 4]) == 10\", \"assert calculate_total_score([1, 1, 1, 1, 1]) == 1\", \"assert calculate_total_score([5, 5, 6, 6, 7, 8]) == 26\", \"assert calculate_total_score([3, 3, 3, 3, 4, 5]) == 12\", \"assert calculate_total_score([1]... | {
"split": "train",
"index": 79048,
"acecode_id": "oss_34538",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a Python function that calculates the average execution time of a given function when it is called a specified number of times. Your function should take two parameters: a callable (a function) and an integer (the number of times to execute the funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert abs(average_execution_time(lambda: 1 + 1, 10) - 0.0) < 1e-6\", \"assert average_execution_time(lambda: 1, 0) == 0.0\", \"assert abs(average_execution_time(lambda: 1 + 1, 100) - 0.0) < 1e-6\", \"assert abs(average_execution_time(lambda: 1 + 1, 50) - 0.0) < 1e... | {
"split": "train",
"index": 79049,
"acecode_id": "oss_16672",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function `merge_sort_asc_abs(arr: List[int]) -> List[int]` that accepts a list of integers, which may include negative numbers and zeros. The function should return a new list where the integers are sorted in ascending order based on their absolute values. If two in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_sort_asc_abs([3, -3, 2, -2, 1, -1]) == [-1, 1, -2, 2, -3, 3]\", \"assert merge_sort_asc_abs([-1, -2, -3, -4]) == [-1, -2, -3, -4]\", \"assert merge_sort_asc_abs([1, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert merge_sort_asc_abs([-5, 5, -1, 1]) == [-1, 1, -5,... | {
"split": "train",
"index": 79050,
"acecode_id": "evol_17387",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple chatbot that can respond to user messages. The chatbot should be able to handle various types of user input and provide appropriate responses based on the following rules: If the user message contains the word 'understand' (case insensitive... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert chatbot_response('I do not understand this') == 'I not understand you.'\", \"assert chatbot_response('Can you explain it again?') == 'Sorry, I cannot comprehend your message.'\", \"assert chatbot_response('I understand your point now') == 'I not understand y... | {
"split": "train",
"index": 79051,
"acecode_id": "oss_12538",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `quicksort(arr)` that takes a list of floating-point numbers and sorts it in-place using the QuickSort algorithm. Do not use any standardized library function for sorting. The function should return the sorted list.\nPlease reason step by step, then write a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert quicksort([9.1, 7.6, 5.3, 3.9, 2.8, 1.5]) == [1.5, 2.8, 3.9, 5.3, 7.6, 9.1]\", \"assert quicksort([5.5, 2.2, 8.8, 1.1, 3.3]) == [1.1, 2.2, 3.3, 5.5, 8.8]\", \"assert quicksort([2.5, 1.5, 3.5, 4.5, 0.5]) == [0.5, 1.5, 2.5, 3.5, 4.5]\", \"assert quicksort([-1.... | {
"split": "train",
"index": 79052,
"acecode_id": "evol_24147",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that formats information about a database field. You need to create a function `get_field_info(model_name: str, name: str) -> str` that takes two string parameters: `model_name` (the name of the database model) and `name` (the name of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_field_info('user', 'date_of_birth') == \\\"Field 'date_of_birth' in model 'user'\\\"\", \"assert get_field_info('product', 'price') == \\\"Field 'price' in model 'product'\\\"\", \"assert get_field_info('order', 'order_id') == \\\"Field 'order_id' in mod... | {
"split": "train",
"index": 79053,
"acecode_id": "oss_6961",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_polygon(polygon_type: str, color: str) -> dict` that creates a representation of a polygon based on the provided type and color. The `polygon_type` can be one of the following: 'Triangle', 'Rectangle', 'Pentagon', or 'Hexagon'. The function should r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_polygon('Triangle', 'Red') == {'num_sides': 3, 'color': 'Red'}\", \"assert create_polygon('Rectangle', 'Blue') == {'num_sides': 4, 'color': 'Blue'}\", \"assert create_polygon('Pentagon', 'Green') == {'num_sides': 5, 'color': 'Green'}\", \"assert creat... | {
"split": "train",
"index": 79054,
"acecode_id": "evol_8608",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that calculates the sum of three given numbers based on the following conditions: 1. If all three values are equal, return triple their sum. 2. If any two values are equal but the third one is not, return the square of the sum. 3. If all values are diffe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_triple([3, 3, 3]) == 27\", \"assert sum_triple([1, 2, 3]) == 6\", \"assert sum_triple([4, 4, 4]) == 36\", \"assert sum_triple([0, 0, 0]) == 0\", \"assert sum_triple([0, 0, 1]) == 1\", \"assert sum_triple([-1, -1, -1]) == -9\", \"assert sum_triple([-1, -1... | {
"split": "train",
"index": 79055,
"acecode_id": "evol_18083",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates sending notifications to users based on their preferences. The function takes three parameters: `auth_token` (a string representing the authentication token), `from_number` (a string representing the sender's phone numb... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert send_notification(None, '1234567890', 'text') == 'no-credentials'\", \"assert send_notification('', '1234567890', 'text') == 'no-credentials'\", \"assert send_notification('valid_token', None, 'text') == 'no-credentials'\", \"assert send_notification('valid_... | {
"split": "train",
"index": 79056,
"acecode_id": "oss_14194",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a function that reads in a date string with the format 'DD/MM/YYYY' and returns the date in 'MMMM D, YYYY' format. For example, if the input is '15/08/2020', the output should be 'August 15, 2020'.\nPlease reason step by step, then write a self-contained Python solution... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reformat_date('31/12/2020') == 'December 31, 2020'\", \"assert reformat_date('15/05/2022') == 'May 15, 2022'\", \"assert reformat_date('29/02/2020') == 'February 29, 2020'\", \"assert reformat_date('30/06/2023') == 'June 30, 2023'\", \"assert reformat_date('... | {
"split": "train",
"index": 79057,
"acecode_id": "evol_5865",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of binary values, `y` and `z`, where each list represents the predicted and actual outcomes of a binary classification problem respectively, return the true negative rate (TNR), defined as the ratio of true negatives (TN) to the sum of true negatives (TN) and fa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert true_negative_rate([0, 0, 0, 0], [0, 0, 0, 0]) == 1.0\", \"assert true_negative_rate([1, 1, 0, 0], [1, 0, 0, 1]) == 0.5\", \"assert true_negative_rate([1, 0, 1, 0], [0, 0, 0, 0]) == 0.5\", \"assert true_negative_rate([0, 1, 0, 1], [1, 1, 1, 1]) == 0.0\", \"a... | {
"split": "train",
"index": 79058,
"acecode_id": "bigcode_python_fns_42597",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Design a Python function that rounds off a collection of complex numbers to the nearest integer part while maintaining their imaginary components intact. The function should validate if the input is a complex number and ignore any invalid inputs. Implement a function named 'rou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert round_complex_numbers([3+5j, 4.7+2j, 7.9+3j, -2.6+4j]) == [3+5j, 5+2j, 8+3j, -3+4j]\", \"assert round_complex_numbers([-1.1-2.2j, 0+0j, 3+4j]) == [-1-2.2j, 0+0j, 3+4j]\", \"assert round_complex_numbers(['3+5j', 4.7, 7.9]) == []\", \"assert round_complex_numb... | {
"split": "train",
"index": 79059,
"acecode_id": "evol_7712",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a list of dictionaries representing mount targets, each containing the keys 'MountTargetId', 'AvailabilityZoneId', 'AvailabilityZoneName', 'FileSystemId', 'LifeCycleState', and 'IpAddress', write a function `filter_mount_targets_by_availability_zone(mount_targets: List[Di... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_mount_targets_by_availability_zone([{'MountTargetId': 'fsmt-ijklmnop', 'AvailabilityZoneId': 'use2-az3', 'AvailabilityZoneName': 'us-east-2c', 'FileSystemId': 'fs-12345', 'LifeCycleState': 'available', 'IpAddress': '192.1.2.3'}, {'MountTargetId': 'fsm... | {
"split": "train",
"index": 79060,
"acecode_id": "bigcode_python_fns_563",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function called `get_container_info` that takes a list of dictionaries representing Docker containers and returns a list of dictionaries for the running containers. Each dictionary in the input list will have the following keys: `id`, `name`, `image`, `s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_container_info([{'id': 'abc123', 'name': 'container1', 'image': 'nginx:latest', 'status': 'Up 2 minutes', 'ports': ['0.0.0.0:8080->80/tcp']}, {'id': 'xyz789', 'name': 'container2', 'image': 'redis:alpine', 'status': 'Exited (0) 5 minutes ago', 'ports': [... | {
"split": "train",
"index": 79061,
"acecode_id": "oss_16551",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the addition of a region entry to a predefined data structure. The function should take in the following parameters: an integer Id representing the unique identifier of the address, an integer parentId representing the exis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert addRegionEntry(1, 0, 'Region A', 'Type 1') == True\", \"assert addRegionEntry(6, 10, 'Region F', 'Type 3') == False\", \"assert addRegionEntry(10, 5, 'Region J', 'Type 1') == False\", \"assert addRegionEntry(11, 0, 'Region K', 'Type 3') == True\", \"assert a... | {
"split": "train",
"index": 79062,
"acecode_id": "bigcode_python_fns_32309",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a whitelist of words for a chat system in a virtual world game called ToonTown. Implement a function called `manage_whitelist` that takes a list of operations as input. Each operation is a tuple, where the first element is a string representing the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_whitelist([('add', 'apple'), ('add', 'banana'), ('remove', 'apple')]) == ['banana']\", \"assert manage_whitelist([('add', 'apple'), ('add', 'banana'), ('add', 'apple')]) == ['apple', 'banana']\", \"assert manage_whitelist([('add', 'apple'), ('remove',... | {
"split": "train",
"index": 79063,
"acecode_id": "oss_10792",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that takes a list of configuration file names (strings) and returns a list of those names which have the '.config' extension. Implement the function `filter_config_files` that takes a list of strings as input and returns a filtered... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_config_files(['file1.txt', 'file2.config', 'file3.cfg', 'file4.config']) == ['file2.config', 'file4.config']\", \"assert filter_config_files(['config1.config', 'config2.config', 'not_a_config.txt']) == ['config1.config', 'config2.config']\", \"assert ... | {
"split": "train",
"index": 79064,
"acecode_id": "oss_21962",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of commands for managing an inventory of items. The commands can be to add, remove, or list items in the inventory. Implement a function `process_commands` that takes a list of commands as input and returns the final... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_commands(['ADD apple', 'ADD banana', 'REMOVE apple', 'LIST']) == ['banana']\", \"assert process_commands(['ADD orange', 'ADD pear', 'LIST']) == ['orange', 'pear']\", \"assert process_commands(['REMOVE apple', 'LIST']) == []\", \"assert process_comman... | {
"split": "train",
"index": 79065,
"acecode_id": "bigcode_python_fns_1303",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of regions, where each region is represented as a dictionary containing two keys: 'l' (the line number) and 'index' (the index of the region on that line). Your task is to implement a function that takes a specific line number and a boolean value indicating... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_lines_with_regions([{'l': '1', 'index': 3}, {'l': '1', 'index': 1}, {'l': '2', 'index': 2}], 1, False) == {1: [1, 3]}\", \"assert find_lines_with_regions([{'l': '1', 'index': 3}, {'l': '1', 'index': 1}, {'l': '2', 'index': 2}], 1, True) == {1: [3, 1]}\"... | {
"split": "train",
"index": 79066,
"acecode_id": "bigcode_python_fns_5774",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with analyzing sales data for a retail company. You are given a list of dictionaries where each dictionary represents sales data for a product with the following keys: 'product_id' (unique integer identifier for each product), 'product_name' (string name of the p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_sales_data([{'product_id': 1, 'product_name': 'Product A', 'unit_price': 10.0, 'quantity_sold': 2, 'total_price': 20.0}, {'product_id': 2, 'product_name': 'Product B', 'unit_price': 15.0, 'quantity_sold': 3, 'total_price': 45.0}, {'product_id': 3, 'p... | {
"split": "train",
"index": 79067,
"acecode_id": "oss_34640",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given two lists of strings, `a` and `b`, implement a function `compare_lines(a: List[str], b: List[str]) -> List[str]` that compares each line in `a` to the corresponding line in `b`. If the line in `a` does not match the line in `b` using regular expression matching, the funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compare_lines(['abc', 'def'], ['abc', 'xyz']) == ['c2', '< def', '---', '> xyz']\", \"assert compare_lines(['hello', 'world'], ['hello', 'world']) == []\", \"assert compare_lines(['foo', 'bar'], ['foo', '']) == ['c2', '< bar', '---', '> ']\", \"assert compar... | {
"split": "train",
"index": 79068,
"acecode_id": "bigcode_python_fns_2082",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that adds a favorite directory to a list. The function `add_favorite_directory(name: str, directory: str, type: str = None, icon: str = None, tooltip: str = None, key: str = None) -> None` should take the following parameters: \n\n- `name... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_favorite_directory('Home', '/home/user', 'folder', 'home_icon.png', 'User home directory', 'ctrl+h') is None\", \"assert add_favorite_directory('Desktop', '/home/user/Desktop', 'folder', 'desktop_icon.png', 'User desktop directory', 'ctrl+d') is None\", ... | {
"split": "train",
"index": 79069,
"acecode_id": "bigcode_python_fns_19246",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing notebook metadata. Each string contains a notebook's title and its corresponding validator name in the format 'Title:Validator'. Your task is to implement a function that checks if all notebooks in the list are valid according to the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert are_notebooks_valid(['Notebook1:ValidatorA', 'Notebook2:ValidatorB']) == True\", \"assert are_notebooks_valid(['Notebook1:ValidatorA', 'Notebook2:']) == False\", \"assert are_notebooks_valid([':ValidatorA', 'Notebook2:ValidatorB']) == False\", \"assert are_n... | {
"split": "train",
"index": 79070,
"acecode_id": "bigcode_python_fns_38687",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that verifies if the sum of squares of integers in a list is a prime number and computes the standard deviation of the list. Additionally, check if the fractional part of the standard deviation (when expressed in decimal form) is a prime number. The functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_squares_is_prime_and_std_dev([1, 5, 4, 10]) == (False, False)\", \"assert sum_of_squares_is_prime_and_std_dev([2, 2, 2]) == (False, False)\", \"assert sum_of_squares_is_prime_and_std_dev([0, 0, 0]) == (False, False)\", \"assert sum_of_squares_is_prime... | {
"split": "train",
"index": 79071,
"acecode_id": "evol_26647",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of integers according to the following rules: \n\n- If the list is empty, the function should return 0. \n- If the list contains a single integer, the function should return that integer. \n- If the list contains... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_result([]) == 0\", \"assert calculate_result([5]) == 5\", \"assert calculate_result([1, 2, 3]) == 4\", \"assert calculate_result([-1, 2, -3]) == -4\", \"assert calculate_result([10, 20, 30, 40]) == 50\", \"assert calculate_result([0]) == 0\", \"ass... | {
"split": "train",
"index": 79072,
"acecode_id": "oss_5158",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes an array of integers and modifies it such that every element that is less than 50 is replaced with 50, and every element that is greater than 50 is replaced with 100. Return the modified array.\nPlease reason step by step, then write a self-contained... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert optimize_array([10, 45, 63, 66, 100, 101, 45, 15]) == [50, 50, 100, 100, 100, 100, 50, 50]\", \"assert optimize_array([50, 49, 51]) == [100, 50, 100]\", \"assert optimize_array([0]) == [50]\", \"assert optimize_array([100, 200, 30]) == [100, 100, 50]\", \"as... | {
"split": "train",
"index": 79073,
"acecode_id": "evol_34268",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary that represents a JSON-RPC response object. Your task is to validate whether this dictionary is a well-formed JSON-RPC response. A valid JSON-RPC response must be a dictionary that contains the key 'response'. If the key 'response' is missing, you sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_json_rpc_response({'response': 1}) is None\", \"assert validate_json_rpc_response({'response': 'success'}) is None\", \"assert validate_json_rpc_response({'response': {'data': 'test'}}) is None\", \"assert validate_json_rpc_response({'response': [1,... | {
"split": "train",
"index": 79074,
"acecode_id": "bigcode_python_fns_11497",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to parse a configuration for a machine learning model. The configuration is specified as a dictionary where the keys represent various settings for the model, and the values represent the respective values for those settings. Your goa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_model_configuration({'max_gradient_norm': 5.0, 'batch_size': 16, 'size': 128, 'word_embedding_size': 128, 'num_layers': 1, 'in_vocab_size': 10000, 'out_vocab_size': 10000, 'data_dir': '/tmp', 'train_dir': '/tmp', 'max_train_data_size': 0}) == {'max_gra... | {
"split": "train",
"index": 79075,
"acecode_id": "oss_3510",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary that stores the contact information of your friends, where each friend's name is associated with their phone number and email address. Implement a function called `search_contact` that takes a friend's name as input and returns their contact informati... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert search_contact('John') == {'phone': '123456789', 'email': 'john@email.com'}\", \"assert search_contact('Doe') == {'phone': '987654321', 'email': 'doe@email.com'}\", \"assert search_contact('Alice') == None\", \"assert search_contact('Bob') == None\", \"asser... | {
"split": "train",
"index": 79076,
"acecode_id": "evol_7103",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a recursive function in Python that calculates the sum of all integers from 1 to n, inclusive. The function should take a single integer n as input, where n is greater than or equal to 1, and return the sum of the integers from 1 to n.\nPlease reason step by step, the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_integers(1) == 1\", \"assert sum_integers(2) == 3\", \"assert sum_integers(3) == 6\", \"assert sum_integers(4) == 10\", \"assert sum_integers(5) == 15\", \"assert sum_integers(6) == 21\", \"assert sum_integers(7) == 28\", \"assert sum_integers(8) == 36\"... | {
"split": "train",
"index": 79077,
"acecode_id": "evol_9314",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string containing multiple words. Your task is to count the frequency of each word in the string while excluding common stop words (e.g., 'the', 'and', 'is'). Your program should return a list of strings, where each string contains a word and its frequency in th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert word_frequency('The quick quick brown fox') == ['quick:2', 'brown:1', 'fox:1']\", \"assert word_frequency('Hello world, hello!') == ['hello:2', 'world:1']\", \"assert word_frequency('Dog and cat are friends.') == ['dog:1', 'cat:1', 'are:1', 'friends:1']\", \... | {
"split": "train",
"index": 79078,
"acecode_id": "oss_7922",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary representing a configuration, write a function that checks if the dictionary contains a special key named '_load'. If it does, the function should remove this key, read a configuration file specified by its value, and merge the resulting configuration with th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert load_and_merge_config({'_load': 'file1', 'key1': 'value1'}) == {'key1': 'value1', 'key2': 'value2'}\", \"assert load_and_merge_config({'_load': 'file2', 'keyA': 10, 'keyB': 20}) == {'keyA': 10, 'keyB': 20, 'keyC': 30}\", \"assert load_and_merge_config({'keyX... | {
"split": "train",
"index": 79079,
"acecode_id": "bigcode_python_fns_30619",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a URL, implement a function `is_absolute_url(url: str) -> bool` that checks if the given URL is an absolute URL. An absolute URL is defined as a URL that contains both a scheme (such as 'http' or 'https') and a network location (or hostname). For thi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_absolute_url('http://example.com') == True\", \"assert is_absolute_url('https://example.com/path') == True\", \"assert is_absolute_url('ftp://fileserver.com/resource.txt') == True\", \"assert is_absolute_url('example.com') == False\", \"assert is_absolute... | {
"split": "train",
"index": 79080,
"acecode_id": "bigcode_python_fns_43778",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple URL routing system for a web application. Your task is to write a function that takes a list of URL patterns and a URL string, and returns the corresponding view function name associated with that URL pattern. Each URL pattern is a stri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert url_router(['/update', '/delete', '/'], '/update') == 'save_or_update'\", \"assert url_router(['/update', '/delete', '/'], '/delete') == 'delete'\", \"assert url_router(['/update', '/delete', '/'], '/') == 'index'\", \"assert url_router(['/update', '/delete'... | {
"split": "train",
"index": 79081,
"acecode_id": "oss_590",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that interprets a given mode string and returns two dictionaries based on the specified mode. The function should take a string input called 'mode', which can be one of the following: 'H+S & B3LYP+TPSS0', 'H+S & B3LYP', or 'H+S & TPSS0'. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_od_base('H+S & B3LYP+TPSS0') == (OrderedDict([('QC Models (Family ID)', [['B3LYP', 'TPSS0']]), ('H + S', [True]), ('CV Mode', ['10*5KF/LOO']), ('Em type', ['Chemical potential']), ('Regularization', ['None']), ('Bounds/Constraints', ['None'])]), OrderedD... | {
"split": "train",
"index": 79082,
"acecode_id": "bigcode_python_fns_34370",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function to manage the volume control of a media player. The function should simulate the volume control based on a series of commands. The function takes a list of commands as input, where each command is a string that can be one of the following:... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_volume_control(['set_volume 30']) == (30, False)\", \"assert manage_volume_control(['set_volume 110']) == (100, False)\", \"assert manage_volume_control(['set_volume -10']) == (0, False)\", \"assert manage_volume_control(['increase_volume']) == (51, F... | {
"split": "train",
"index": 79083,
"acecode_id": "oss_12148",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates an object detection model. The function should take a list of objects as input and return two outputs: a list of detected object classes and a list of bounding boxes for those objects. Each object in the input list i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert predict_objects([{'class': 'cat', 'coordinates': (10, 10, 50, 50)}, {'class': 'dog', 'coordinates': (60, 60, 80, 80)}]) == (['cat', 'dog'], [(10, 10, 50, 50), (60, 60, 80, 80)])\", \"assert predict_objects([{'class': 'car', 'coordinates': (0, 0, 100, 50)}, {... | {
"split": "train",
"index": 79084,
"acecode_id": "oss_14907",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function that counts the number of times the digit 5 appears in decreasing arithmetic sequences that only contain integers less than a provided 'n' and are divisible by either 9 or 14. The sequences should start from a given 'start' number and end at a given 'end' numb... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_fives_in_seq(90, 100, 91) == 0\", \"assert count_fives_in_seq(30, 40, 20) == 0\", \"assert count_fives_in_seq(40, 50, 30) == 0\", \"assert count_fives_in_seq(70, 80, 60) == 0\", \"assert count_fives_in_seq(140, 160, 130) == 1\", \"assert count_fives_in... | {
"split": "train",
"index": 79085,
"acecode_id": "evol_4230",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with handling cryptocurrency transaction outputs. Implement a function `transaction_output(amount: int, fee: int) -> Tuple[int, bool]` that calculates the value of the transaction output based on the given amount and fee, and validates the transaction output base... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transaction_output(150, 10) == (140, True)\", \"assert transaction_output(0, 10) == (-10, False)\", \"assert transaction_output(100, 0) == (100, False)\", \"assert transaction_output(200, 50) == (150, True)\", \"assert transaction_output(500, 250) == (250, T... | {
"split": "train",
"index": 79086,
"acecode_id": "oss_28372",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `jaccard_similarity(text1: str, text2: str) -> float` that computes the Jaccard Similarity Index between two given texts. The similarity should be calculated as the percentage of unique words shared between the two texts, rounded to two decimal places. The ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert jaccard_similarity('', 'non-empty') == 0.0\", \"assert jaccard_similarity('same words', 'same words') == 100.0\", \"assert jaccard_similarity('one two three', 'four five six') == 0.0\", \"assert jaccard_similarity('a b c d', 'a b c d e f') == 66.67\", \"asse... | {
"split": "train",
"index": 79087,
"acecode_id": "evol_30326",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with analyzing diastolic blood pressure readings from a healthcare dataset. Your goal is to implement a Python function `calculate_diastolic_stats(data: List[float]) -> Tuple[float, float]` that takes a list of diastolic blood pressure readings as input and retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_diastolic_stats([80, 85, 90, 95, 100]) == (7.1, 20)\", \"assert calculate_diastolic_stats([100]) == (0, 0)\", \"assert calculate_diastolic_stats([]) == (0, 0)\", \"assert calculate_diastolic_stats([150, 160, 170, 180, 190]) == (14.1, 40)\", \"asser... | {
"split": "train",
"index": 79088,
"acecode_id": "oss_6132",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Design a function that receives an array of complex numbers. The function should return the conjugate product of all complex numbers in the array. If any input in the array is not a complex number, the function should throw a ValueError with an appropriate error message. You ar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert conjugate_product([1+2j, 3+4j, 5+6j]) == (1-2j)*(3-4j)*(5-6j)\", \"assert conjugate_product([2+3j, 4+5j]) == (2-3j)*(4-5j)\", \"assert conjugate_product([-1-1j, -2-2j]) == (-1+1j)*(-2+2j)\", \"assert conjugate_product([0+0j]) == (0+0j)\", \"assert conjugate_... | {
"split": "train",
"index": 79089,
"acecode_id": "evol_15293",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of integers and returns a new list where each integer is replaced by its corresponding type: 'odd' for odd integers and 'even' for even integers. Your function should take a single parameter, 'nums', which is a list ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_numbers([1, 2, 3, 4]) == ['odd', 'even', 'odd', 'even']\", \"assert process_numbers([5, 7, 10, 12]) == ['odd', 'odd', 'even', 'even']\", \"assert process_numbers([0, -1, -2, -3]) == ['even', 'odd', 'even', 'odd']\", \"assert process_numbers([11, 13, ... | {
"split": "train",
"index": 79090,
"acecode_id": "bigcode_python_fns_25286",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing a graph where each index represents a node and the value at that index represents the number of directed edges from that node to the nodes with a higher index. Your task is to implement a function that returns a new list where each ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert collapse_subgraph([1, 0]) == [1, 0]\", \"assert collapse_subgraph([0, 0, 0, 0]) == [0, 0, 0, 0]\", \"assert collapse_subgraph([]) == []\", \"assert collapse_subgraph([0]) == [0]\", \"assert collapse_subgraph([5, 0, 0, 0, 0]) == [5, 0, 0, 0, 0]\", \"assert co... | {
"split": "train",
"index": 79091,
"acecode_id": "bigcode_python_fns_35878",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given two dictionaries that may contain nested dictionaries or lists as values, write a function that checks if the two dictionaries are equivalent. The function should return True if both dictionaries have the same keys and values, and False otherwise. The keys must be the sam... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert tensor_dict_eq({'a': 1, 'b': 2}, {'a': 1, 'b': 2}) == True\", \"assert tensor_dict_eq({'a': 1, 'b': 2}, {'a': 1, 'b': 3}) == False\", \"assert tensor_dict_eq({'a': {'x': 1}}, {'a': {'x': 1}}) == True\", \"assert tensor_dict_eq({'a': {'x': 1}}, {'a': {'y': 1}... | {
"split": "train",
"index": 79092,
"acecode_id": "bigcode_python_fns_25751",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of integers and returns a new list containing only the even integers from the original list, maintaining the order of their first appearance. If there are no even integers, return an empty list. Implement the function 'f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([1, 3, 5]) == []\", \"assert filter_even_numbers([2, 4, 6, 8]) == [2, 4, 6, 8]\", \"assert filter_even_numbers([0, -2, -3, 5, 8]) == [0, -2, 8]\", \"assert filter_even_numbers([10... | {
"split": "train",
"index": 79093,
"acecode_id": "bigcode_python_fns_7109",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing URLs. Your task is to implement a function `extract_technical_item_urls(urls: List[str]) -> List[str]` that extracts the technical item URLs from the provided list. A technical item URL is defined as any URL that contains the substri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_technical_item_urls(['https://example.com/technical-item/1', 'https://example.com/home', 'https://example.com/technical-item/2']) == ['https://example.com/technical-item/1', 'https://example.com/technical-item/2']\", \"assert extract_technical_item_u... | {
"split": "train",
"index": 79094,
"acecode_id": "oss_28961",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a configuration string and extracts specific information from it. The configuration string contains key-value pairs in a custom format. Your task is to implement a function `extract_config_info` that takes a string `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_config_info('key1=value1\\\\nkey2=value2') == {'key1': 'value1', 'key2': 'value2'}\", \"assert extract_config_info(' name = John Doe \\\\nage = 30 ') == {'name': 'John Doe', 'age': '30'}\", \"assert extract_config_info('key=value\\\\n foo=ba... | {
"split": "train",
"index": 79095,
"acecode_id": "oss_34678",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the lengths of the edges of a cube. Your task is to implement a function that returns a new list where each edge length is increased by 3 units. The function should take in a list of integers and return a new list of integers with t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert increase_edge_lengths([1, 2, 3]) == [4, 5, 6]\", \"assert increase_edge_lengths([0]) == [3]\", \"assert increase_edge_lengths([-1, -2, -3]) == [2, 1, 0]\", \"assert increase_edge_lengths([5, 5, 5]) == [8, 8, 8]\", \"assert increase_edge_lengths([10, 20, 30])... | {
"split": "train",
"index": 79096,
"acecode_id": "bigcode_python_fns_34330",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple in-memory database simulation. Implement a function `execute_query(query_string: str, commit: bool) -> str` that simulates executing a database query. The function takes a query string as input and a boolean parameter `commit`. If `commit` ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert execute_query('SELECT * FROM users', True) == 'Executed and committed: SELECT * FROM users'\", \"assert execute_query('DELETE FROM orders', False) == 'Executed but not committed: DELETE FROM orders'\", \"assert execute_query('INSERT INTO products (name) VALU... | {
"split": "train",
"index": 79097,
"acecode_id": "oss_25581",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two strings `s` and `t`, return the minimum window in `s` which will contain all the characters in `t` in the same order as they appear in `t`. If there is no such window in `s` that covers all characters in `t` in the correct order, return the empty string \"\". Note tha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert min_window('ADOBECODEBANC', 'ABC') == 'BANC'\", \"assert min_window('a', 'a') == 'a'\", \"assert min_window('a', 'b') == ''\", \"assert min_window('ABCDDEFG', 'ADG') == 'ABCDDEFG'\", \"assert min_window('abcde', 'ace') == 'abcde'\", \"assert min_window('abcd... | {
"split": "train",
"index": 79098,
"acecode_id": "evol_1893",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function `detect_fraud(customer: Customer) -> bool` that takes a `Customer` object as input and returns `True` if the customer is suspected of fraud, and `False` otherwise. The fraud detection logic should be based on the following conditions: a) If the account bala... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert detect_fraud(Customer('Alice', 25, 1000, ['Loan', 'Credit Card', 'Savings Account'])) == False\", \"assert detect_fraud(Customer('Bob', 17, 500, [])) == True\", \"assert detect_fraud(Customer('Charlie', 30, -50, ['Checking Account'])) == True\", \"assert det... | {
"split": "train",
"index": 79099,
"acecode_id": "evol_35935",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.