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": "Given a string that represents a block of thermochemical data for various species, write a function `data_block(block_str: str) -> List[Tuple[str, List[float], List[float], List[float]]]` that parses this string and returns a list of tuples. Each tuple should contain the specie... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert data_block('species1 100 200 0.1 0.2 0.3 0.4\\\\nspecies2 150 250 0.5 0.6 0.7 0.8') == [('species1', [100, 200], [0.1, 0.2, 0.3, 0.4], []), ('species2', [150, 250], [0.5, 0.6, 0.7, 0.8], [])]\", \"assert data_block('speciesA 300 400 0.1 0.2 0.3 0.4\\\\nspeci... | {
"split": "train",
"index": 75700,
"acecode_id": "bigcode_python_fns_28538",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a rotated sorted array 'nums' and a target value 'target'. Write a function 'search' that returns the index of 'target' in 'nums' if it exists, or -1 if it does not. The array 'nums' is guaranteed to be rotated at some pivot point. You may assume that there are no... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert search([4, 5, 6, 7, 0, 1, 2], 0) == 4\", \"assert search([4, 5, 6, 7, 0, 1, 2], 3) == -1\", \"assert search([1], 0) == -1\", \"assert search([1], 1) == 0\", \"assert search([3, 1], 1) == 1\", \"assert search([1, 3], 3) == 1\", \"assert search([5, 1, 3], 5) =... | {
"split": "train",
"index": 75701,
"acecode_id": "evol_18668",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with analyzing product information and their reviews. You have a list of products, where each product is represented as a dictionary containing an 'id' and 'name'. Additionally, you have a list of review statements, where each review statement is a dictionary con... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert retrieve_product_info([{'id': 1, 'name': 'Product A'}, {'id': 2, 'name': 'Product B'}], [{'product_id': 1, 'review_count': 10, 'avg_rating': 4.5}]) == [{'product': 'Product A', 'review_count': 10, 'avg_rating': 4.5}, {'product': 'Product B', 'review_count': ... | {
"split": "train",
"index": 75702,
"acecode_id": "oss_21722",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_prime(n)` that checks whether a given integer n is a prime number. The function should return `True` if n is a prime number and `False` otherwise. The function must also handle negative integers and non-integer types by returning `False`. A prime number... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_prime(-1) == False\", \"assert is_prime(-10) == False\", \"assert is_prime(0) == False\", \"assert is_prime(1) == False\", \"assert is_prime(2) == True\", \"assert is_prime(3) == True\", \"assert is_prime(4) == False\", \"assert is_prime(5) == True\", \"a... | {
"split": "train",
"index": 75703,
"acecode_id": "evol_16465",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple bank account. The function should support the following operations: deposit funds, withdraw funds, and check the current balance. The function should maintain the current balance and keep track of the total num... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bank_account([{'operation': 'deposit', 'amount': 100, 'account_id': 1}, {'operation': 'withdraw', 'amount': 50, 'account_id': 1}]) == (50, 2)\", \"assert bank_account([{'operation': 'deposit', 'amount': 200, 'account_id': 1}, {'operation': 'withdraw', 'amoun... | {
"split": "train",
"index": 75704,
"acecode_id": "oss_22685",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a string 'input_string', write a function 'reverse_string' that returns the reversed version of the string. The function should handle any printable characters and return an empty string when the input is an empty string.\nPlease reason step by step, then write a self-con... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_string('hello') == 'olleh'\", \"assert reverse_string('') == ''\", \"assert reverse_string('a') == 'a'\", \"assert reverse_string('abc123') == '321cba'\", \"assert reverse_string('Python!') == '!nohtyP'\", \"assert reverse_string('1234567890') == '09... | {
"split": "train",
"index": 75705,
"acecode_id": "evol_10876",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a custom calendar that recognizes weekends (Saturday and Sunday) as business days. Write a function `is_business_day(date: datetime.date) -> bool` that takes a date as input and returns True if the date is a weekend (Saturday or Sunday), otherwise r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_business_day(datetime.date(2023, 10, 14)) == True\", \"assert is_business_day(datetime.date(2023, 10, 15)) == True\", \"assert is_business_day(datetime.date(2023, 10, 16)) == False\", \"assert is_business_day(datetime.date(2023, 11, 4)) == True\", \"asser... | {
"split": "train",
"index": 75706,
"acecode_id": "evol_29223",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves the default configuration file name based on a list of specified locations. You are given a list of configuration file names (strings) in the order of specificity, where the first element is the most specific configuration.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_default_config_location(['config1', 'config2']) == 'config1.yml'\", \"assert get_default_config_location(['settings', 'default']) == 'settings.yml'\", \"assert get_default_config_location(['a', 'b', 'c']) == 'a.yml'\", \"assert get_default_config_locatio... | {
"split": "train",
"index": 75707,
"acecode_id": "bigcode_python_fns_10038",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating an Amazon Resource Name (ARN) for a Virtual Private Cloud (VPC) in a cloud infrastructure. The ARN format for a VPC is `arn:aws:ec2:<region>:<account-id>:vpc/<vpc-id>`, where `<region>` is the AWS region, `<account-id>` is the AWS account ID, and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_vpc_arn('us-east-1', '123456789012', 'vpc-1a2b3c4d') == 'arn:aws:ec2:us-east-1:123456789012:vpc/vpc-1a2b3c4d'\", \"assert get_vpc_arn('us-west-2', '987654321098', 'vpc-4d3c2b1a') == 'arn:aws:ec2:us-west-2:987654321098:vpc/vpc-4d3c2b1a'\", \"assert get_vp... | {
"split": "train",
"index": 75708,
"acecode_id": "oss_5167",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that converts a given string into title case, where the first letter of each word is capitalized while the rest of the letters are in lowercase. However, certain words such as 'and', 'the', and 'of' should remain in lowercase u... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert to_title_case('the quick brown fox') == 'The Quick Brown Fox'\", \"assert to_title_case('aND tHE sECRET oF mANA') == 'And the Secret of Mana'\", \"assert to_title_case('hello world') == 'Hello World'\", \"assert to_title_case('the cat and the hat') == 'The C... | {
"split": "train",
"index": 75709,
"acecode_id": "oss_10700",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function that checks if two given phrases contain the same unique letters. The function should return the number of unique letters in each phrase as a tuple and also return the common and distinct letters between both phrases as sets. Note: Space and punctuation are no... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compare_letter_sets('abc', 'def') == (3, 3, set(), {'d', 'f', 'e', 'a', 'b', 'c'})\", \"assert compare_letter_sets('same', 'same') == (4, 4, {'s', 'a', 'm', 'e'}, set())\", \"assert compare_letter_sets('hello', 'hel lo') == (4, 4, {'h', 'e', 'l', 'o'}, set()... | {
"split": "train",
"index": 75710,
"acecode_id": "evol_13512",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates a Cloud Storage directory URI for exporting data. The function should check if the given URI starts with 'gs://' and is followed by a valid bucket name and optional folder path. A valid bucket name must consist of lowercase... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_gcs_uri('gs://my-bucket/folder/') == True\", \"assert is_valid_gcs_uri('gs://my_bucket/folder/') == False\", \"assert is_valid_gcs_uri('gs://my-bucket/') == True\", \"assert is_valid_gcs_uri('gs://my-bucket.123/') == True\", \"assert is_valid_gcs_ur... | {
"split": "train",
"index": 75711,
"acecode_id": "oss_267",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a keypoint annotation. The function should take in three parameters: a string representing the class name, a float representing the x-coordinate, and a float representing the y-coordinate for the keypoint. The function will... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert make_keypoint('PointA', 1.0, 2.0) == {'class': {'name': 'PointA', 'type': 'keypoint'}, 'coordinates': {'x': 1.0, 'y': 2.0}, 'sub_annotations': []}\", \"assert make_keypoint('PointB', 0.5, 1.5, [{'sub_name': 'sub1'}]) == {'class': {'name': 'PointB', 'type': '... | {
"split": "train",
"index": 75712,
"acecode_id": "bigcode_python_fns_5777",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing the ratings of beers, write a function that returns the average rating of the beers rounded to two decimal places. The function should take in a list of integers and return a float. If the list is empty, return 0.0.\nPlease reason step by s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_rating([5, 4, 3, 2, 1]) == 3.0\", \"assert average_rating([1, 2, 3]) == 2.0\", \"assert average_rating([5, 5, 5]) == 5.0\", \"assert average_rating([2, 3, 4]) == 3.0\", \"assert average_rating([1]) == 1.0\", \"assert average_rating([]) == 0.0\", \"as... | {
"split": "train",
"index": 75713,
"acecode_id": "bigcode_python_fns_33860",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_perfect_squares(nums: List[int]) -> List[int]` that takes a list of integers and returns a list of all the perfect square numbers found in the input list. A perfect square is an integer that is the square of an integer. For example, 16 and 36 are perf... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_perfect_squares([16, 23, 45, 36]) == [16, 36]\", \"assert find_perfect_squares([1, 4, 9, 16]) == [1, 4, 9, 16]\", \"assert find_perfect_squares([2, 3, 5, 7]) == []\", \"assert find_perfect_squares([0, 1, 2, 3]) == [0, 1]\", \"assert find_perfect_squares... | {
"split": "train",
"index": 75714,
"acecode_id": "evol_28274",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `max_subarray_sum(arr: List[int]) -> int` that returns the maximum sum of a contiguous subarray within the given list. The function should handle both positive and negative integers. If the list is empty, return 0.\nPlease reason step ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_subarray_sum([-1, -2, -3, -4]) == -1\", \"assert max_subarray_sum([5, 4, -1, 7, 8]) == 23\", \"assert max_subarray_sum([]) == 0\", \"assert max_subarray_sum([1, 2, 3, 4]) == 10\", \"assert max_subarray_sum([-2, 1, -3, 4, -1, 2, 1, -5, 4]) == 6\", \"asser... | {
"split": "train",
"index": 75715,
"acecode_id": "bigcode_python_fns_37737",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Define a function that accepts a list of strings containing alphanumeric characters. The function should return the alphanumeric character that appears the most frequently across all strings. If multiple characters have the same frequency, return the one that appears first in t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_frequent(['abcAB', 'bbcCD', 'bccdeEF']) == 'b'\", \"assert find_frequent(['hello', 'world']) == 'l'\", \"assert find_frequent(['123', 'abc']) == '1'\", \"assert find_frequent(['xXyYzZ', 'aaaabb']) == 'a'\", \"assert find_frequent(['', '']) == None\", \"... | {
"split": "train",
"index": 75716,
"acecode_id": "evol_2036",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes a string containing alphanumeric characters and replaces all numeric digits with their respective English words. For example, given the input 'a3b2c4', the function should return 'athreebtwocfour'.\nPlease reason step by step, then write a sel... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_numbers('a3b2c4') == 'athreebtwocfour'\", \"assert replace_numbers('noDigitsHere') == 'noDigitsHere'\", \"assert replace_numbers('12345') == 'onetwothreefourfive'\", \"assert replace_numbers('abc0xyz') == 'abczeroxyz'\", \"assert replace_numbers('tes... | {
"split": "train",
"index": 75717,
"acecode_id": "evol_4526",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function `ternary_search(arr: List[int], key: int) -> int` that performs a ternary search on a sorted list of integers. The function should return the index of the key if it is found in the array, and -1 if it is not found. The input list will always be sorted in as... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert ternary_search([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 5) == 4\", \"assert ternary_search([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 1) == 0\", \"assert ternary_search([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 10) == 9\", \"assert ternary_search([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 0) ==... | {
"split": "train",
"index": 75718,
"acecode_id": "evol_15935",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary representation of a virtual machine (VM) instance and a list of updates, implement a function `update_instance(instance, updates)` that modifies the instance dictionary in place according to the updates provided. The updates can include modifications to any k... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_instance({'uuid': '1234', 'name': 'vm1', 'status': 'running'}, {'name': 'vm1_updated', 'power_specs': {'cpu': 4, 'ram': 16}}) == {'uuid': '1234', 'name': 'vm1_updated', 'status': 'running', 'current_power_specs': {'cpu': 4, 'ram': 16}}\", \"assert upd... | {
"split": "train",
"index": 75719,
"acecode_id": "bigcode_python_fns_49675",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of reports. Each report is represented as a dictionary containing the keys: 'date', 'report_name', and 'status'. Your goal is to implement a function called `process_reports` that takes a list of these report ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_reports([{'date': '2022-01-01', 'report_name': 'Sales Report', 'status': 'completed'}, {'date': '2022-01-01', 'report_name': 'Financial Report', 'status': 'completed'}]) == {'reports_per_date': {'2022-01-01': 2}, 'reports_per_status': {'completed': 2... | {
"split": "train",
"index": 75720,
"acecode_id": "oss_36064",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to compare two dictionaries representing order books in a financial trading system. The dictionaries contain price levels as keys and order quantities as values. Your goal is to identify the differences between two order books, return... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert DictDiff({'100': 5, '200': 10}, {'100': 5, '300': 5}) == {'200': 10, '300': -5}\", \"assert DictDiff({'150': 20, '250': 0}, {'150': 15}) == {'250': 0, '150': 5}\", \"assert DictDiff({'300': 10}, {'300': 10}) == {}\", \"assert DictDiff({}, {'400': 7}) == {'40... | {
"split": "train",
"index": 75721,
"acecode_id": "oss_30974",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an array `nums` containing `n` unique integers within the range `[0, n]`. Your task is to find the single integer in this range that is missing from the array. Implement a function `missingNumber(nums: List[int]) -> int` that returns the missing number. Note that ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert missingNumber([3,0,1]) == 2\", \"assert missingNumber([0,1]) == 2\", \"assert missingNumber([9,6,4,2,3,5,7,0,1]) == 8\", \"assert missingNumber([0]) == 1\", \"assert missingNumber([1]) == 0\", \"assert missingNumber([2,0]) == 1\", \"assert missingNumber([0,2... | {
"split": "train",
"index": 75722,
"acecode_id": "evol_5313",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of lists representing features of data points for classification. Each inner list contains 10 integer values representing different features of a data point, with the last value being the class label (2 for benign, 4 for malignant). Implement a function `cl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert classify_data_points([[5, 1, 1, 1, 2, 1, 3, 1, 1, 2], [5, 4, 4, 5, 7, 10, 3, 2, 1, 2]], [4, 2, 1, 1, 2, 1, 2, 1, 1, 2], 1) == 2\", \"assert classify_data_points([[5, 1, 1, 1, 2, 1, 3, 1, 1, 2], [5, 4, 4, 5, 7, 10, 3, 2, 1, 2]], [5, 4, 4, 4, 5, 5, 5, 5, 5, 2]... | {
"split": "train",
"index": 75723,
"acecode_id": "oss_4227",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `evaluate(input_val)` that takes a single parameter `input_val`. The function should evaluate the input based on the following criteria and return 'Passed' or 'Failed':\n1. For numerical inputs (both integers and floating-point numbers), it should return 'P... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate(80) == 'Passed'\", \"assert evaluate(79.9) == 'Failed'\", \"assert evaluate('P') == 'Passed'\", \"assert evaluate(False) == 'Failed'\", \"assert evaluate('A') == 'Failed'\", \"assert evaluate(100) == 'Passed'\", \"assert evaluate(79) == 'Failed'\", ... | {
"split": "train",
"index": 75724,
"acecode_id": "evol_1529",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a method declaration in a programming language. Your task is to implement a function that replaces the existing method in the string with a new method passed as an argument. The method declaration will always start with the keyword 'method' f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_method_declaration('method oldMethod;', 'newMethod') == 'method newMethod;'\", \"assert replace_method_declaration('method processData;', 'computeData') == 'method computeData;'\", \"assert replace_method_declaration('method calculateSum;', 'sumTotal... | {
"split": "train",
"index": 75725,
"acecode_id": "bigcode_python_fns_45763",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that generates a C++ code snippet based on a given connection information. The function `generate_cpp_code` takes in five parameters: \n- `connection`: a dictionary containing connection information, including 'In' and 'Out' attrib... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_cpp_code({'In': 'A', 'Out': 'B', 'attr1': 'value1'}, {'A': 0, 'B': 1}, 'material') == '\\\\t\\\\t\\\\tstd::map<std::string, std::string> params_0*1;\\\\n\\\\t\\\\t\\\\tparams_0*1[\\\"attr1\\\"] = \\\"value1\\\";\\\\n'\", \"assert generate_cpp_code({... | {
"split": "train",
"index": 75726,
"acecode_id": "oss_13949",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple web crawler that processes URLs from a queue. Your goal is to implement the `crawl` function, which will check if there are any URLs in the queue and process them. You must ensure that each URL is only processed once, even if it appears... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert crawl(queue.Queue(['http://example.com', 'http://example.com']), set()) == None\", \"assert crawl(queue.Queue(['http://example.com', 'http://example.com', 'http://test.com']), {'http://example.com'}) == None\", \"assert crawl(queue.Queue([]), set()) == None\... | {
"split": "train",
"index": 75727,
"acecode_id": "oss_27161",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the insertion of user account information into a database. The function should take a tuple of values representing the account details and return a success message if the insertion is successful. The input tuple `vals` will... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert insert_account(('12345', 'john_doe', 'securePassword123', 'john@example.com', 'tagValue', 'ivValue', 'saltValue')) == 'Account inserted successfully.'\", \"assert insert_account(('67890', 'jane_doe', 'anotherSecurePassword456', 'jane@example.com', 'anotherTa... | {
"split": "train",
"index": 75728,
"acecode_id": "bigcode_python_fns_43594",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the process of re-sending an email verification link to a user. The function takes two parameters: a list of users and a user ID. The function should check if the user ID exists in the list of users. If the user exists, the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert resend_verification_email([1, 2, 3], 4) == {'user_id': 4, 'message': 'User does not exist'}\", \"assert resend_verification_email([], 1) == {'user_id': 1, 'message': 'User does not exist'}\", \"assert resend_verification_email([100, 200], 150) == {'user_id':... | {
"split": "train",
"index": 75729,
"acecode_id": "bigcode_python_fns_35813",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `find_max_min(nums)` that returns a dictionary with the maximum and minimum values from the list. The dictionary should have two keys: 'max' for the maximum value and 'min' for the minimum value. If the list is empty, return {'max': No... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max_min([3, 1, 4, 1, 5, 9, 2, 6]) == {'max': 9, 'min': 1}\", \"assert find_max_min([-1, -2, -3, -4]) == {'max': -1, 'min': -4}\", \"assert find_max_min([0]) == {'max': 0, 'min': 0}\", \"assert find_max_min([5, 5, 5, 5]) == {'max': 5, 'min': 5}\", \"asse... | {
"split": "train",
"index": 75730,
"acecode_id": "bigcode_python_fns_11846",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to convert a given time in seconds to a string representation of hours, minutes, and seconds. The function should take an integer representing the time in seconds and return a string in the format \"hh:mm:ss\". The hours, minutes, and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convertSecondsToTime(0) == '0:0:0'\", \"assert convertSecondsToTime(59) == '0:0:59'\", \"assert convertSecondsToTime(60) == '0:1:0'\", \"assert convertSecondsToTime(61) == '0:1:1'\", \"assert convertSecondsToTime(3600) == '1:0:0'\", \"assert convertSecondsTo... | {
"split": "train",
"index": 75731,
"acecode_id": "oss_18203",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that converts a given book's details into a JSON string. The function should take three parameters: title (a string), author (a string), and year (an integer). It should return a JSON string representation of the book containing its t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert book_to_json('The Catcher in the Rye', 'J.D. Salinger', 1951) == '{\\\"title\\\": \\\"The Catcher in the Rye\\\", \\\"author\\\": \\\"J.D. Salinger\\\", \\\"year\\\": 1951}'\", \"assert book_to_json('1984', 'George Orwell', 1949) == '{\\\"title\\\": \\\"1984... | {
"split": "train",
"index": 75732,
"acecode_id": "oss_32543",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a large text data T, write a function that identifies the first position where a specific sequence q appears in T, counts the total occurrences of q in T, and creates a dictionary where keys are the positions at which q appears in T, and values are the words from T that c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert locate_sequence('apple banana apricot apple', 'ap') == (0, 3, {0: ['apple', 'apricot', 'apple']})\", \"assert locate_sequence('data science data analysis', 'data') == (0, 2, {0: ['data', 'data']})\", \"assert locate_sequence('a b c d e f g h', 'z') == (-1, 0... | {
"split": "train",
"index": 75733,
"acecode_id": "evol_949",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the Levenshtein distance between two strings. The Levenshtein distance is defined as the minimum number of single-character edits (insertions, deletions, or substitutions) required to change one string into the other. Write a function `leven... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert levenshtein_distance('cat', 'bat') == 1\", \"assert levenshtein_distance('kitten', 'sitting') == 3\", \"assert levenshtein_distance('flaw', 'lawn') == 2\", \"assert levenshtein_distance('intention', 'execution') == 5\", \"assert levenshtein_distance('abcdef'... | {
"split": "train",
"index": 75734,
"acecode_id": "evol_13975",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists: a list of barcodes and a list of UMI (Unique Molecular Identifier) values associated with those barcodes. Your task is to create a function that merges these two lists into a dictionary where the keys are 'barcode', 'UMI', and 'virus_UMI'. If a barcode ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_barcode_data(['barcode1', 'barcode2', 'barcode3'], [10, None, 5]) == {'barcode': ['barcode1', 'barcode2', 'barcode3'], 'UMI': [10, 0, 5], 'virus_UMI': [10, 0, 5]}\", \"assert merge_barcode_data(['barcodeA', 'barcodeB'], [None, None]) == {'barcode': ['b... | {
"split": "train",
"index": 75735,
"acecode_id": "bigcode_python_fns_18540",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `term` and a list of strings `dictionary`, implement a function `match_term(term: str, dictionary: List[str], case_sensitive: bool, lemmatize: bool) -> bool` that checks if the `term` exists in the `dictionary`. The function should return True if the `term` is fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert match_term('apple', ['apple', 'banana', 'cherry'], False, True) == True\", \"assert match_term('Apple', ['apple', 'banana', 'cherry'], False, True) == True\", \"assert match_term('apple', ['Apple', 'banana', 'cherry'], True, True) == False\", \"assert match_... | {
"split": "train",
"index": 75736,
"acecode_id": "bigcode_python_fns_651",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are required to implement a function that takes a string representation of a number, a format specifier, and returns the integer value of that number according to the specified format. The function signature is as follows: `def convert_to_integer(value: str, format: str) ->... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_integer('10', 'decimal') == 10\", \"assert convert_to_integer('0xA', 'hexadecimal') == 10\", \"assert convert_to_integer('255', 'decimal') == 255\", \"assert convert_to_integer('0xFF', 'hexadecimal') == 255\", \"assert convert_to_integer('0', 'dec... | {
"split": "train",
"index": 75737,
"acecode_id": "bigcode_python_fns_13517",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are responsible for maintaining a unique list of trajectory IDs for a delivery service. Each trajectory ID is a string containing alphanumeric characters. Implement a function `add_unique_trajectory_id(traj_ids, new_id)` that takes two parameters: `traj_ids`, a list of stri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_unique_trajectory_id(['TR001', 'TR002', 'TR003'], 'TR003') == ['TR001', 'TR002', 'TR003', 'TR0031']\", \"assert add_unique_trajectory_id([], 'TR001') == ['TR001']\", \"assert add_unique_trajectory_id(['TR001'], 'TR001') == ['TR001', 'TR0011']\", \"assert... | {
"split": "train",
"index": 75738,
"acecode_id": "oss_3772",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a simple banking system. Your goal is to implement a function `bank_account_operations(operations: List[Tuple[str, float]]) -> float` that processes a list of banking operations and returns the final balance of the account. The operations can be o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bank_account_operations([('deposit', 100)]) == 100\", \"assert bank_account_operations([('deposit', 50), ('withdraw', 20)]) == 30\", \"assert bank_account_operations([('deposit', 200), ('withdraw', 100), ('withdraw', 50)]) == 50\", \"assert bank_account_oper... | {
"split": "train",
"index": 75739,
"acecode_id": "oss_12186",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Write a function `extract_elements_with_depth` that takes a nested list as input and returns a list of tuples. Each tuple should contain an element from the list and its corresponding depth level. The depth level starts at 0 for the root elements. For example, given the input [... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_elements_with_depth(['A', ['B', ['C', 'D']], 'E']) == [('A', 0), ('B', 1), ('C', 2), ('D', 2), ('E', 0)]\", \"assert extract_elements_with_depth(['X', ['Y', ['Z']]]) == [('X', 0), ('Y', 1), ('Z', 2)]\", \"assert extract_elements_with_depth([]) == []\... | {
"split": "train",
"index": 75740,
"acecode_id": "evol_32873",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing file paths in a local file system. Implement a function `update_or_clone(repo_name: str, file_paths: List[str]) -> str` that checks if a directory with the name `repo_name` exists in the file paths. If it exists, check if it contains... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_or_clone('my_repo', ['other_repo']) == 'Clone repo'\", \"assert update_or_clone('invalid_repo', ['test_repo/.git', 'another_repo']) == 'Clone repo'\", \"assert update_or_clone('example_repo', ['example_repo', 'example_repo/.git']) == 'Update repo'\", ... | {
"split": "train",
"index": 75741,
"acecode_id": "bigcode_python_fns_22324",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `max_ascending_sum(nums)` that returns the maximum sum of a strictly increasing subsequence of the list, where at least one prime number exists in that subsequence. If no such subsequence exists, return -1.\nPlease reason step by step,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_ascending_sum([1, 2, 3, 4, 5]) == 15\", \"assert max_ascending_sum([5, 6, 7, 8]) == 26\", \"assert max_ascending_sum([2, 3, 5, 7, 11]) == 28\", \"assert max_ascending_sum([15, 16, 17]) == 48\", \"assert max_ascending_sum([1, 2, 3, 1]) == 6\", \"assert ma... | {
"split": "train",
"index": 75742,
"acecode_id": "evol_18351",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function `calculate_modulus(a: int, b: int, c: int, d: int) -> Tuple[Union[int, str], Union[int, str]]` that takes four integers as input and computes the modulus of the first two integers and the modulus of the last two integers. If there is an attempt to divide by... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_modulus(10, 3, 20, 6) == (1, 2)\", \"assert calculate_modulus(5, 0, 15, 4) == ('Error: Division by zero is not allowed for the first pair of numbers.', 3)\", \"assert calculate_modulus(10, 3, 0, 0) == (1, 'Error: Division by zero is not allowed for... | {
"split": "train",
"index": 75743,
"acecode_id": "evol_18125",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `celebrate_birthday(name: str, age: int) -> str` that takes a person's name and age as inputs and returns a birthday greeting in the format: 'Happy {age}th Birthday, {name}'. Make sure to properly format the age as a string in the greeting.\nPlease reason step ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert celebrate_birthday('Alice', 30) == 'Happy 30th Birthday, Alice'\", \"assert celebrate_birthday('Bob', 5) == 'Happy 5th Birthday, Bob'\", \"assert celebrate_birthday('Diana', 0) == 'Happy 0th Birthday, Diana'\", \"assert celebrate_birthday('George', 18) == 'H... | {
"split": "train",
"index": 75744,
"acecode_id": "evol_32617",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of integers and returns a new list containing only the even numbers from the original list, sorted in ascending order. Your function should maintain the following requirements:\n\n1. The function should take a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_and_sort_evens([1, 2, 3, 4, 5, 6]) == [2, 4, 6]\", \"assert filter_and_sort_evens([10, 3, 5, 7, 2]) == [2, 10]\", \"assert filter_and_sort_evens([1, 3, 5, 7]) == []\", \"assert filter_and_sort_evens([]) == []\", \"assert filter_and_sort_evens([8, 4, 2... | {
"split": "train",
"index": 75745,
"acecode_id": "oss_3440",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates dropping tables from a database. The function should take an integer input representing the total number of tables in a database and return a confirmation message indicating how many tables were 'dropped'. If the total numb... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert drop_tables(5) == 'Dropped 5 tables.'\", \"assert drop_tables(0) == 'No tables to drop.'\", \"assert drop_tables(-3) == 'No tables to drop.'\", \"assert drop_tables(10) == 'Dropped 10 tables.'\", \"assert drop_tables(2) == 'Dropped 2 tables.'\", \"assert dro... | {
"split": "train",
"index": 75746,
"acecode_id": "bigcode_python_fns_30169",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that counts the occurrences of zeros in a given integer matrix. The function should take an additional optional parameter `strict_zero`. If `strict_zero` is set to `True`, the function should only count the actual zeros (i.e., the integer... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_zeros([[1, 0, 3], [4, 0, 0]]) == 3\", \"assert count_zeros([[0, 0], [0, 0]], True) == 4\", \"assert count_zeros([[0, 1], [1, 1]], True) == 1\", \"assert count_zeros([[0, 1], [1, 1]], False) == 1\", \"assert count_zeros([[1, 2], [3, 4]]) == 0\", \"asser... | {
"split": "train",
"index": 75747,
"acecode_id": "evol_18101",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary that contains user requests, where each key is a user identifier and the value is a list of requests made by that user. Your task is to implement a function `get_all_requests(requests: Dict[str, List[str]]) -> List[str]` that returns a flat list of al... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_all_requests({'user1': ['req1', 'req2'], 'user2': ['req3']}) == ['req1', 'req2', 'req3']\", \"assert get_all_requests({'user1': [], 'user2': []}) == []\", \"assert get_all_requests({'user1': ['req1'], 'user2': ['req2', 'req3'], 'user3': ['req4']}) == ['r... | {
"split": "train",
"index": 75748,
"acecode_id": "bigcode_python_fns_40689",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a given list of integers contains any duplicate values. The function should return True if there are duplicates, and False otherwise. Your function should be named `contains_duplicate(nums)` and it should take a single para... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert contains_duplicate([1, 2, 3, 4]) == False\", \"assert contains_duplicate([1, 2, 2, 3]) == True\", \"assert contains_duplicate([]) == False\", \"assert contains_duplicate([5, 5, 5]) == True\", \"assert contains_duplicate([10, 20, 30]) == False\", \"assert con... | {
"split": "train",
"index": 75749,
"acecode_id": "bigcode_python_fns_1839",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of numbers, `hy_vec` and `ref_vec`, representing two vectors in a multi-dimensional space, write a function `get_cos_similarity(hy_vec: List[float], ref_vec: List[float]) -> float` that calculates the cosine similarity between these two vectors. The cosine simil... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_cos_similarity([1, 0, 0], [0, 1, 0]) == 0.0\", \"assert get_cos_similarity([1, 1, 1], [1, 1, 1]) == 1.0\", \"assert get_cos_similarity([1, 2, 3], [0, 0, 0]) == 0.0\", \"assert get_cos_similarity([], [1, 2, 3]) == 0.0\", \"assert get_cos_similarity([], []... | {
"split": "train",
"index": 75750,
"acecode_id": "bigcode_python_fns_15132",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function `factorial(n: int) -> int` that calculates the factorial of a given non-negative integer `n`. The factorial of a number `n` is the product of all positive integers less than or equal to `n`. For example, the factorial of 5 is 5 * 4 * 3 * 2 * 1 = 120. The fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert factorial(0) == 1\", \"assert factorial(1) == 1\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", \"assert factorial(5) == 120\", \"assert factorial(6) == 720\", \"assert factorial(7) == 5040\", \"assert factorial(... | {
"split": "train",
"index": 75751,
"acecode_id": "evol_24495",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple tag reading system. The function `read_tag(tid)` takes a string `tid` representing a tag identifier and returns a string indicating the status of the tag read operation. If the tag identifier is 'valid', return 'Ta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert read_tag('valid') == 'Tag read successfully'\", \"assert read_tag('invalid') == 'Tag not found'\", \"assert read_tag('unknown') == 'Unknown tag status'\", \"assert read_tag('123') == 'Unknown tag status'\", \"assert read_tag('') == 'Unknown tag status'\", \"... | {
"split": "train",
"index": 75752,
"acecode_id": "bigcode_python_fns_20902",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `configure_repo` that will check if a repository exists within a given organization. If the repository does not exist and the `create` flag is set to True, the function should simulate the creation of the repository and return a success m... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert configure_repo('test-repo', 'dummy-token', True, 'test-org') == '\\u2714\\ufe0f test-repo created.'\", \"assert configure_repo('existing-repo', 'dummy-token', True, 'test-org') == '\\u2714\\ufe0f Successfully configured existing-repo according to convention.... | {
"split": "train",
"index": 75753,
"acecode_id": "bigcode_python_fns_48288",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function `character_frequency(sentence: str) -> List[Tuple[str, int]]` that takes a string sentence as input and returns a list of tuples containing the three most frequent characters (ignoring blank spaces, punctuation, and case differences) along with their freque... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert character_frequency('Hello, World!') == [('l', 3), ('o', 2), ('h', 1)]\", \"assert character_frequency('') == []\", \"assert character_frequency('aaa bbb ccc') == [('a', 3), ('b', 3), ('c', 3)]\", \"assert character_frequency('abc!@#123') == [('a', 1), ('b',... | {
"split": "train",
"index": 75754,
"acecode_id": "evol_14427",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a messaging system for a social networking platform. Your goal is to create a function that processes a friend request message. The function should accept a dictionary containing the 'message_type' and 'friend_list', where 'friend_list' is a lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_friend_request({'message_type': 'friend_request', 'friend_list': ['Alice', 'Bob']}) == {'message_type': 'friend_request', 'friend_list': ['Alice', 'Bob']}\", \"assert process_friend_request({'message_type': 'friend_request'}) == {'message_type': 'fri... | {
"split": "train",
"index": 75755,
"acecode_id": "oss_20402",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates rolling a specified number of dice with a specified number of sides. The function should take two parameters: `num_dice` (the number of dice to roll) and `num_sides` (the number of sides on each die). The function shoul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert roll_dice(2, 6)[0][0] in [1, 2, 3, 4, 5, 6]\", \"assert roll_dice(2, 6)[0][1] in [1, 2, 3, 4, 5, 6]\", \"assert roll_dice(3, 4)[0][0] in [1, 2, 3, 4]\", \"assert roll_dice(3, 4)[0][1] in [1, 2, 3, 4]\", \"assert roll_dice(3, 4)[0][2] in [1, 2, 3, 4]\", \"ass... | {
"split": "train",
"index": 75756,
"acecode_id": "oss_19332",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function `get_user_info()` that simulates retrieving user information from a web application. The function should return a dictionary containing user details with the following fields: 'username', 'email', and 'role'. The expected output for a user with ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_user_info() == {'username': 'example_user', 'email': 'user@example.com', 'role': 'user'}\", \"assert get_user_info() is not None\", \"assert isinstance(get_user_info(), dict)\", \"assert 'username' in get_user_info()\", \"assert 'email' in get_user_info(... | {
"split": "train",
"index": 75757,
"acecode_id": "oss_9318",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that calculates the total value and overall profit or loss of a stock portfolio based on current market prices. Each stock in the portfolio is represented by a symbol, number of shares, and purchase price. The function should take a list ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_portfolio_value([('TSLA', 5, 700.0)], 800.0) == (4000.0, 500.0)\", \"assert calculate_portfolio_value([('NFLX', 10, 300.0)], 350.0) == (3500.0, 500.0)\", \"assert calculate_portfolio_value([], 100.0) == (0.0, 0.0)\", \"assert calculate_portfolio_va... | {
"split": "train",
"index": 75758,
"acecode_id": "oss_33821",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function called `check_git_installed()` that checks if the `git` command-line tool is installed on the system. The function should return True if `git` is installed and False otherwise. You can simulate the presence of `git` by using a predefined list of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_git_installed(['git', 'python', 'node']) == True\", \"assert check_git_installed(['python', 'node']) == False\", \"assert check_git_installed(['git', 'ruby', 'java']) == True\", \"assert check_git_installed(['npm', 'docker', 'git']) == True\", \"assert... | {
"split": "train",
"index": 75759,
"acecode_id": "bigcode_python_fns_43651",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `suppress_warnings` that takes a function as an argument and executes it while ignoring any warnings that may be raised during its execution. The function should return the result of the executed function. If the argument passed is not a callable, the funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert suppress_warnings(lambda: 1 + 1) == 2\", \"assert suppress_warnings(lambda: sum([1, 2, 3, 4])) == 10\", \"assert suppress_warnings(lambda: 'Hello' + ' World') == 'Hello World'\", \"assert suppress_warnings(lambda: [x**2 for x in range(5)]) == [0, 1, 4, 9, 16... | {
"split": "train",
"index": 75760,
"acecode_id": "bigcode_python_fns_8656",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to write a function `cumulative_sum` that returns a new list containing the cumulative sum of the input list. The cumulative sum at each index `i` in the output list should be the sum of all elements from index 0 to index `i` in th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cumulative_sum([1, 2, 3, 4]) == [1, 3, 6, 10]\", \"assert cumulative_sum([0, 0, 0]) == [0, 0, 0]\", \"assert cumulative_sum([-1, -2, -3]) == [-1, -3, -6]\", \"assert cumulative_sum([5]) == [5]\", \"assert cumulative_sum([]) == []\", \"assert cumulative_sum([... | {
"split": "train",
"index": 75761,
"acecode_id": "oss_9445",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a simplified version of a version control system's pull operation. Write a function `git_pull(remote: str, branch: str) -> str` that takes in two parameters: a remote repository name and a branch name. The function should return a string that desc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert git_pull('origin', 'main') == 'Successfully updated to main from origin'\", \"assert git_pull('origin', 'prod') == 'Failed to update: Invalid remote or branch'\", \"assert git_pull('upstream', 'main') == 'Failed to update: Invalid remote or branch'\", \"asse... | {
"split": "train",
"index": 75762,
"acecode_id": "bigcode_python_fns_45626",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of Fibonacci numbers, identify the elements which qualify as perfect squares and substitute these specific numbers with a value that is four times the original. Implement a function `replace_perfect_squares(fibonacci: List[int]) -> List[int]` that takes a list of i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_perfect_squares([1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144]) == [4, 4, 2, 3, 5, 8, 13, 21, 34, 55, 89, 576]\", \"assert replace_perfect_squares([0, 1, 1, 2, 3, 5, 8]) == [0, 4, 4, 2, 3, 5, 8]\", \"assert replace_perfect_squares([1, 4, 9, 16]) == [4, ... | {
"split": "train",
"index": 75763,
"acecode_id": "evol_11026",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer n (2 ≤ n ≤ 10^6), implement a function `factorize(n: int) -> Tuple[List[int], Dict[int, int]]` that returns a sorted list of prime factors of n and a dictionary that counts the occurrences of these factors in its factorization. The output should include all pri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert factorize(8) == ([2, 2, 2], {2: 3})\", \"assert factorize(25) == ([5, 5], {5: 2})\", \"assert factorize(70) == ([2, 5, 7], {2: 1, 5: 1, 7: 1})\", \"assert factorize(1) == ([], {})\", \"assert factorize(2) == ([2], {2: 1})\", \"assert factorize(3) == ([3], {3... | {
"split": "train",
"index": 75764,
"acecode_id": "evol_5903",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "In a simplified version of the Prisoner's Dilemma, there exists a strategy that always chooses to defect. Implement a function `play_always_defect()` that simulates this strategy. The function should take a list of tuples as input, where each tuple represents the actions of two... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert play_always_defect([]) == False\", \"assert play_always_defect([(True, True)]) == False\", \"assert play_always_defect([(True, False)]) == False\", \"assert play_always_defect([(False, True)]) == False\", \"assert play_always_defect([(False, False)]) == Fals... | {
"split": "train",
"index": 75765,
"acecode_id": "bigcode_python_fns_46488",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a class `Outcome` that has two attributes: `qt` and `trio`, both of which are integers. Your task is to implement a function `unwrap_outcome(outcome: Outcome) -> int` that returns the value of `trio` if it is greater than `qt`, otherwise return the value of `qt`. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unwrap_outcome(Outcome(2, 3)) == 3\", \"assert unwrap_outcome(Outcome(5, 4)) == 5\", \"assert unwrap_outcome(Outcome(1, 1)) == 1\", \"assert unwrap_outcome(Outcome(0, 10)) == 10\", \"assert unwrap_outcome(Outcome(-1, -5)) == -1\", \"assert unwrap_outcome(Out... | {
"split": "train",
"index": 75766,
"acecode_id": "bigcode_python_fns_30775",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `generate_password(size: int, chars: str) -> str` that generates a password of a specified size using the given characters. The function should return a string that consists of randomly selected characters from the `chars` string. The `size` parameter determine... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert len(generate_password(10, 'abc')) == 10\", \"assert generate_password(0, 'abc') == ''\", \"assert generate_password(1, 'xyz') in 'xyz'\", \"assert len(generate_password(25, 'pass123!')) == 25\", \"assert len(generate_password(7, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')... | {
"split": "train",
"index": 75767,
"acecode_id": "bigcode_python_fns_26451",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the weights of parcels and an integer representing a capacity limit. Your task is to determine the maximum total weight of parcels that can be selected without exceeding the capacity limit. You must implement a function `max_parcel_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_parcel_weight([1, 2, 3, 4, 5], 5) == 5\", \"assert max_parcel_weight([10, 20, 30], 25) == 20\", \"assert max_parcel_weight([5, 10, 15], 30) == 30\", \"assert max_parcel_weight([2, 4, 6, 8], 10) == 10\", \"assert max_parcel_weight([1, 1, 1, 1, 1], 3) == 3... | {
"split": "train",
"index": 75768,
"acecode_id": "bigcode_python_fns_6506",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the behavior of replacing a node in a tree structure. Given a list of nodes where each node has a unique identifier and a potential replacement node represented by its identifier, design a function `replace_nodes(nodes: Lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_nodes(['A', 'B', 'C'], {'A': 'X', 'B': 'Y'}) == ['X', 'Y', 'C']\", \"assert replace_nodes(['A', 'B', 'C'], {'B': 'X', 'C': 'Y'}) == ['A', 'X', 'Y']\", \"assert replace_nodes(['A', 'B'], {'C': 'D'}) == ['A', 'B']\", \"assert replace_nodes([], {'A': 'B... | {
"split": "train",
"index": 75769,
"acecode_id": "bigcode_python_fns_16544",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, implement a function that returns an array containing only the unique prime numbers in ascending order. If the input array contains any non-integer values, raise a ValueError. The function should be defined as `def get_unique_primes(arr: List[int]) -... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_primes([3, 5, 3, 7, 11]) == [3, 5, 7, 11]\", \"assert get_unique_primes([4, 6, 8, 9, 10]) == []\", \"assert get_unique_primes([2, 2, 2, 2]) == [2]\", \"assert get_unique_primes([1, 4, 6, 8, 9]) == []\", \"assert get_unique_primes([3, 5, 7, 11, 13,... | {
"split": "train",
"index": 75770,
"acecode_id": "evol_28040",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `update_parameters(beta1: float, beta2: float, eps: float, lr: float, weight_decay: float, global_step: int, param: float, m: float, v: float, gradient: float, decay_flag: bool) -> float` that simulates the update of parameters in an optimization algorithm ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_parameters(0.8, 0.98, 1e-7, 0.1, 0.0, 2, 0.3, 0.2, 0.2, 0.2, False) == 0.2\", \"assert update_parameters(0.85, 0.995, 1e-6, 0.05, 0.1, 3, 0.6, 0.3, 0.4, 0.2, False) == 0.2\", \"assert update_parameters(0.9, 0.999, 1e-8, 0.01, 0.0, 1, 0.0, 0.0, 0.0, 0.... | {
"split": "train",
"index": 75771,
"acecode_id": "bigcode_python_fns_47541",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Implement a function `generate_random_token(length: int) -> str` that generates a random hexadecimal token of the specified length. The token should be represented as a string of hexadecimal characters (0-9, a-f). The function should ensure that the output token is exactly `len... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_random_token(1) in '0123456789abcdef'\", \"assert len(generate_random_token(3)) == 3\", \"assert len(generate_random_token(4)) == 4\", \"assert len(generate_random_token(5)) == 5\", \"assert len(generate_random_token(6)) == 6\", \"assert len(generat... | {
"split": "train",
"index": 75772,
"acecode_id": "bigcode_python_fns_47529",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a list of module version pairs and returns a dictionary representing the modules and their corresponding versions in a structured format. Each module is represented as a string, and its version is also represente... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_modules([]) == {}\", \"assert process_modules([('moduleA', '1.0')]) == {'moduleA': ['1.0']}\", \"assert process_modules([('moduleA', '1.0'), ('moduleA', '1.1')]) == {'moduleA': ['1.0', '1.1']}\", \"assert process_modules([('moduleB', '2.0'), ('module... | {
"split": "train",
"index": 75773,
"acecode_id": "oss_37358",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates an XML-like string representation for a specified number of people. The function should take an integer input, `n`, which represents the number of people and is guaranteed to be between 1 and 500 (inclusive). The output sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert people_interp(1) == '<enumeratedValueSet variable=\\\"People\\\"> <value value=\\\"1\\\"/></enumeratedValueSet>'\", \"assert people_interp(5) == '<enumeratedValueSet variable=\\\"People\\\"> <value value=\\\"5\\\"/></enumeratedValueSet>'\", \"assert people_i... | {
"split": "train",
"index": 75774,
"acecode_id": "bigcode_python_fns_16857",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `getSum(a: int, b: int) -> int` that calculates the sum of two integers using only unary operators (increment and decrement). You cannot use any binary operators such as + or -. The function should repeatedly apply the unary increment operator to achieve th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert getSum(1, 1) == 2\", \"assert getSum(0, 0) == 0\", \"assert getSum(3, 4) == 7\", \"assert getSum(100, 200) == 300\", \"assert getSum(50, 0) == 50\", \"assert getSum(0, 50) == 50\", \"assert getSum(5, 5) == 10\", \"assert getSum(7, 3) == 10\", \"assert getSum... | {
"split": "train",
"index": 75775,
"acecode_id": "evol_26005",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function `match_words` that takes a list of words and returns a list of words that contain only lowercase letters and have at least one palindrome substring of length 3 or more. A palindrome is a string that reads the same forwards and backwards. The function should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert match_words(['hello', 'mom', 'world']) == ['mom']\", \"assert match_words(['dad', 'racecar', 'abcba']) == ['dad', 'racecar', 'abcba']\", \"assert match_words(['python', 'noon', 'level']) == ['noon', 'level']\", \"assert match_words(['a', 'b', 'c']) == []\", ... | {
"split": "train",
"index": 75776,
"acecode_id": "evol_22147",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a source bounding box defined by its coordinates (min_x, min_y, max_x, max_y) and a zoom level strategy. Your task is to calculate the output parameters for a virtual raster tile. The function should return a dictionary containing the following keys: 'crs', 'trans... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_vrt_parameters((0, 0, 100, 100), 'auto') == {'crs': 'EPSG:3857', 'transform': (1.0, 0, 0, 0, -1.0, 100), 'width': 100, 'height': 100}\", \"assert compute_vrt_parameters((10, 10, 110, 110), 'auto') == {'crs': 'EPSG:3857', 'transform': (1.0, 0, 10, 0, ... | {
"split": "train",
"index": 75777,
"acecode_id": "bigcode_python_fns_41271",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with designing a function `schedule_tasks(tasks)` that takes a list of tasks, each represented as a dictionary with keys 'name', 'hours', and 'priority'. The function should return a list of tasks sorted first by priority (in ascending order) and then by hours (i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert schedule_tasks([{'name': 'Task1', 'hours': 2, 'priority': 1}, {'name': 'Task2', 'hours': 1, 'priority': 2}, {'name': 'Task3', 'hours': 3, 'priority': 1}]) == [{'name': 'Task1', 'hours': 2, 'priority': 1}, {'name': 'Task3', 'hours': 3, 'priority': 1}, {'name'... | {
"split": "train",
"index": 75778,
"acecode_id": "evol_34612",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function `rank_trending_topics(trending_topics: List[Dict[str, Union[str, int]]]) -> List[Dict[str, Union[str, int]]]` that takes a list of trending topics, where each topic is represented as a dictionary with keys 'name' (string) and 'tweet_volume' (integer). The f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rank_trending_topics([{'name': 'Topic A', 'tweet_volume': 1000}, {'name': 'Topic B', 'tweet_volume': 2000}, {'name': 'Topic C', 'tweet_volume': 1500}]) == [{'name': 'Topic B', 'tweet_volume': 2000}, {'name': 'Topic C', 'tweet_volume': 1500}, {'name': 'Topic ... | {
"split": "train",
"index": 75779,
"acecode_id": "evol_12528",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of four positive numbers, implement a function `geometric_mean(nums: List[float]) -> float` that calculates and returns the geometric mean of these numbers. The geometric mean is defined as the fourth root of the product of the numbers. Ensure that the input list a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert geometric_mean([1, 2, 3, 4]) == 2.213363839400643\", \"assert geometric_mean([4, 1, 8, 2]) == 2.8284271247461903\", \"assert geometric_mean([5, 5, 5, 5]) == 5.0\", \"assert geometric_mean([1, 1, 1, 1]) == 1.0\", \"assert geometric_mean([6, 6, 6, 6]) == 6.0\"... | {
"split": "train",
"index": 75780,
"acecode_id": "evol_19048",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that converts an error message or a list of error messages into a structured JSON response. The function should take two parameters: a string `error_message`, which represents the error message or a list of error messages, and an integer ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_error_to_response('Not Found', 404) == {'errors': ['Not Found'], 'jsonapi': '1.0'}\", \"assert convert_error_to_response(['Not Found', 'Unauthorized'], 400) == {'errors': ['Not Found', 'Unauthorized'], 'jsonapi': '1.0'}\", \"assert convert_error_to_r... | {
"split": "train",
"index": 75781,
"acecode_id": "bigcode_python_fns_19905",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `word_count(string: str) -> int` that takes a string as input and returns the number of words in that string. A word is defined as a sequence of characters separated by whitespace. Consider leading and trailing whitespace as well as multiple spaces between ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert word_count('This is a simple test') == 5\", \"assert word_count(' Leading and trailing spaces ') == 4\", \"assert word_count('') == 0\", \"assert word_count(' ') == 0\", \"assert word_count('OneWord') == 1\", \"assert word_count('Multiple spaces') ==... | {
"split": "train",
"index": 75782,
"acecode_id": "evol_1218",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that determines if a given integer is even or odd. The function should take an integer as input and return the string 'even' if the number is even and 'odd' if the number is odd.\nPlease reason step by step, then write a self-contained Python solution. Give... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_even_or_odd(0) == 'even'\", \"assert is_even_or_odd(1) == 'odd'\", \"assert is_even_or_odd(2) == 'even'\", \"assert is_even_or_odd(3) == 'odd'\", \"assert is_even_or_odd(4) == 'even'\", \"assert is_even_or_odd(5) == 'odd'\", \"assert is_even_or_odd(10) ==... | {
"split": "train",
"index": 75783,
"acecode_id": "evol_4049",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of file names, implement a function that filters out any files that do not have the specified file extension. The function should return a list of the filtered file names. If no files match the specified extension, return an empty list. The function signature is: `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_files_by_extension(['file1.txt', 'file2.txt', 'image.png', 'document.pdf'], 'txt') == ['file1.txt', 'file2.txt']\", \"assert filter_files_by_extension(['file1.txt', 'file2.txt', 'image.png', 'document.pdf'], 'png') == ['image.png']\", \"assert filter_... | {
"split": "train",
"index": 75784,
"acecode_id": "oss_25048",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary `adata` that represents some data structure. This dictionary contains a key `obsp`, which itself is another dictionary. Your task is to implement a function that checks if the keys 'connectivities' and 'distances' exist within the `obsp` dictionary. I... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_method({'obsp': {'connectivities': [], 'distances': []}}) == True\", \"assert check_method({'obsp': {'connectivities': []}}) == False\", \"assert check_method({'obsp': {'distances': []}}) == False\", \"assert check_method({'obsp': {}}) == False\", \"as... | {
"split": "train",
"index": 75785,
"acecode_id": "bigcode_python_fns_27697",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers, implement a function `rolling_max(numbers1: List[int], numbers2: List[int]) -> Tuple[List[int], List[int]]` that generates a list of rolling maximum elements from both lists. The rolling maximum at each index is defined as the maximum value encounte... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rolling_max([1, 2, 3, 2, 3, 4, 2], [1, 4, 2, 4, 1, 5, 1]) == ([1, 2, 3, 3, 3, 4, 4], [1, 4, 4, 4, 4, 5, 5])\", \"assert rolling_max([5, 3, 7, 8, 4], [2, 3, 1, 6, 4]) == ([5, 5, 7, 8, 8], [2, 3, 3, 6, 6])\", \"assert rolling_max([], []) == ([], [])\", \"asser... | {
"split": "train",
"index": 75786,
"acecode_id": "evol_31409",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of non-negative integers, implement a function that rearranges the array such that all even integers come before all odd integers. The order of the even and odd integers can be any, but the grouping must be maintained. Write a function `sort_array_by_parity(arr: ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_array_by_parity([3, 1, 2, 4]) in [[2, 4, 3, 1], [4, 2, 3, 1], [2, 4, 1, 3], [4, 2, 1, 3]]\", \"assert sort_array_by_parity([0, 1, 2, 3]) in [[0, 2, 1, 3], [2, 0, 1, 3], [0, 2, 3, 1], [2, 0, 3, 1]]\", \"assert sort_array_by_parity([2, 4, 6, 8]) in [[2, 4... | {
"split": "train",
"index": 75787,
"acecode_id": "evol_31045",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of constant signals, represented as a list of floats. Your task is to implement a function that applies exponential attenuation to each signal in the list over a specified duration and factor. The attenuation should be calculated using the formula: `attenua... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert attenuate_signals([100.0], 0.01, 1.0) == [99.0]\", \"assert attenuate_signals([10.0, 20.0, 30.0], 0.05, 1.0) == [9.5, 19.0, 28.5]\", \"assert attenuate_signals([1.0, 2.0, 3.0], 0.0, 1.0) == [1.0, 2.0, 3.0]\", \"assert attenuate_signals([0.0], 0.5, 1.0) == [0... | {
"split": "train",
"index": 75788,
"acecode_id": "bigcode_python_fns_33572",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a specified substring is present in a given list of strings. If the substring is found, the function should return the index of the first occurrence of that substring; if it is not found, the function should return -1. Writ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_substring_index(['hello', 'world', 'python', 'code'], 'py') == 2\", \"assert find_substring_index(['apple', 'banana', 'cherry'], 'banana') == 1\", \"assert find_substring_index(['test', 'example', 'sample'], 'sample') == 2\", \"assert find_substring_ind... | {
"split": "train",
"index": 75789,
"acecode_id": "bigcode_python_fns_19999",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with designing a function that takes a list of team names and returns a dictionary where each team name is a key and its corresponding value is the number of times that team appears in the list. If a team name appears more than once, it should count all occurrenc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_teams([]) == {}\", \"assert count_teams(['Team A']) == {'Team A': 1}\", \"assert count_teams(['Team A', 'Team B', 'Team A']) == {'Team A': 2, 'Team B': 1}\", \"assert count_teams(['Team C', 'Team C', 'Team C']) == {'Team C': 3}\", \"assert count_teams(... | {
"split": "train",
"index": 75790,
"acecode_id": "oss_15126",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of file names representing the contents of a ZIP file. Your task is to create a function that checks if there is exactly one file in the list. If there is exactly one file, return its name; otherwise, return an error message indicating how many files were f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_ical_file_name(['event.ics']) == 'event.ics'\", \"assert get_ical_file_name(['file1.txt', 'file2.txt']) == 'ZIP archive had 2 files; expected 1.'\", \"assert get_ical_file_name([]) == 'ZIP archive had 0 files; expected 1.'\", \"assert get_ical_file_name(... | {
"split": "train",
"index": 75791,
"acecode_id": "bigcode_python_fns_6545",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates the next unique ID for newly added coaches based on the current maximum ID in a list of existing coach IDs. The function should take a list of integers representing the current coach IDs and return the next unique ID th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert next_coach_id([1, 2, 3]) == 4\", \"assert next_coach_id([5, 7, 8]) == 9\", \"assert next_coach_id([10, 20, 30]) == 31\", \"assert next_coach_id([]) == 1\", \"assert next_coach_id([100]) == 101\", \"assert next_coach_id([1, 3, 4, 5, 6]) == 7\", \"assert next_... | {
"split": "train",
"index": 75792,
"acecode_id": "bigcode_python_fns_34193",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a training process for a reinforcement learning model. Your function should accept the following parameters: an environment ID (string), the number of timesteps for training (integer), a run identifier (integer), a kappa value (float), and a value... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_training('CartPole-v1', 1000, 1, 0.5, 10) == {'env_id': 'CartPole-v1', 'num_timesteps': 1000, 'run': 1, 'kappa': 0.5, 'vf_phi_update_interval': 10, 'status': 'training initiated'}\", \"assert simulate_training('MountainCar-v0', 2000, 2, 0.1, 5) == {... | {
"split": "train",
"index": 75793,
"acecode_id": "bigcode_python_fns_27714",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of file information tuples and returns a filtered list containing only the information of files that are larger than a specified size threshold. Each tuple in the input list contains the file name (string), file size (in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_large_files([('file1.txt', 500, 1620000000.0), ('file2.txt', 1000, 1620000001.0), ('file3.txt', 200, 1620000002.0)], 300) == [('file1.txt', 500, 1620000000.0), ('file2.txt', 1000, 1620000001.0)]\", \"assert filter_large_files([('a.txt', 150, 162000000... | {
"split": "train",
"index": 75794,
"acecode_id": "oss_5537",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple stack-based virtual machine that supports two operations: `loadInt32` and `dumpInt32`. The `loadInt32` operation pushes a 32-bit integer onto the stack, while the `dumpInt32` operation pops the top integer from the stack and returns it.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulateVM(['loadInt32 5', 'dumpInt32', 'dumpInt32']) == [5]\", \"assert simulateVM(['loadInt32 7', 'loadInt32 15', 'loadInt32 25', 'dumpInt32', 'dumpInt32']) == [25, 15]\", \"assert simulateVM(['dumpInt32', 'loadInt32 100', 'dumpInt32']) == [100]\", \"asser... | {
"split": "train",
"index": 75795,
"acecode_id": "oss_13704",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates the initialization of a database by performing operations to drop and create tables. Your goal is to implement a function that takes a list of table names as input and returns a string indicating the success of the o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert init_db(['users', 'products', 'orders']) == 'Database Initialized'\", \"assert init_db(['customers']) == 'Database Initialized'\", \"assert init_db([]) == 'Initialization Failed'\", \"assert init_db(['employees', 'departments']) == 'Database Initialized'\", ... | {
"split": "train",
"index": 75796,
"acecode_id": "oss_26788",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of semi-aligned image pairs represented as tuples. Each tuple contains two strings: the first string is the filename of the original image and the second string is the filename of the cropped image. Your function sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert map_semi_aligned_images([('image1_original.jpg', 'image1_cropped.jpg'), ('image2_original.jpg', 'image2_cropped.jpg')]) == {'image1_original.jpg': 'image1_cropped.jpg', 'image2_original.jpg': 'image2_cropped.jpg'}\", \"assert map_semi_aligned_images([('imgA.... | {
"split": "train",
"index": 75797,
"acecode_id": "oss_11935",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers and a target integer. Your task is to implement a function that finds all unique pairs of integers in the list that sum up to the target integer. Each pair should be represented as a tuple of two integers. The pairs should be returned in a list,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_pairs([1, 2, 3, 4, 5], 10) == []\", \"assert find_pairs([1, 1, 1, 1], 2) == [(1, 1)]\", \"assert find_pairs([1, 2, 3, 4, 5, 6], 7) == [(1, 6), (2, 5), (3, 4)]\", \"assert find_pairs([], 1) == []\", \"assert find_pairs([0, 0, 0], 0) == [(0, 0)]\", \"asse... | {
"split": "train",
"index": 75798,
"acecode_id": "bigcode_python_fns_36436",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks the output of a command-line program. Your function should take a string input representing the output of the program. The function should return True if the output indicates an error (the output contains the word 'error' in a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_program_output('Usage: program [options]') == False\", \"assert check_program_output('ERROR: Invalid argument') == True\", \"assert check_program_output('error: file not found') == True\", \"assert check_program_output('This program is for demonstratio... | {
"split": "train",
"index": 75799,
"acecode_id": "bigcode_python_fns_972",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.