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 tasked with creating a Python function that generates a robots.txt file for a website based on the given context. The robots.txt file is used to instruct web robots (such as search engine crawlers) on how to interact with the website's pages. Implement a function `gener...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_robots_txt({'robots_txt': 'User-agent: *\\\\nDisallow: /example'}) == 'User-agent: *\\\\nDisallow: /example'\", \"assert generate_robots_txt({'website_name': 'Sample Site'}) == 'User-agent: *\\\\nDisallow: /private\\\\nDisallow: /admin'\", \"assert ...
{ "split": "train", "index": 4800, "acecode_id": "oss_18256", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings where each string may contain multiple words separated by non-alphanumeric characters. Write a function `extract_variables(examples: List[str]) -> List[str]` that takes this list of strings as input and returns a list of unique alphanumeric 'word...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_variables(['Test-1 test; test.']) == ['Test', '1', 'test']\", \"assert extract_variables(['123 456 123']) == ['123', '456']\", \"assert extract_variables(['']) == []\", \"assert extract_variables(['Multiple... punctuations!!!']) == ['Multiple', 'punc...
{ "split": "train", "index": 4801, "acecode_id": "bigcode_python_fns_17177", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `find_duplicates` that returns a list of integers that appear more than once in the input list. The returned list should contain only unique duplicates, and it should be sorted in ascending order. If there are no duplicates, return an ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_duplicates([1, 2, 3, 4, 5]) == []\", \"assert find_duplicates([1, 2, 2, 3, 4, 4, 5]) == [2, 4]\", \"assert find_duplicates([1, 1, 1, 2, 2, 3]) == [1, 2]\", \"assert find_duplicates([-1, -2, -2, -3, -1]) == [-2, -1]\", \"assert find_duplicates([5, 5, 5, ...
{ "split": "train", "index": 4802, "acecode_id": "bigcode_python_fns_49248", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of tuples, where each tuple contains two elements: a string representing the name of an attribute and a float representing a width. Your task is to implement a function `extract_widths(data: List[Tuple[str, float]]) -> Dict[str, float]` that takes this list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_widths([]) == {}\", \"assert extract_widths([('width1', 1.0)]) == {'width1': 1.0}\", \"assert extract_widths([('width1', 1.0), ('width2', 2.0)]) == {'width1': 1.0, 'width2': 2.0}\", \"assert extract_widths([('width1', 1.0), ('width1', 1.5)]) == {'wid...
{ "split": "train", "index": 4803, "acecode_id": "bigcode_python_fns_16863", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with converting action strings from a specific format to camel case. The input is a string that describes an action and an object, using snake case and spaces. Your function should convert the string to camel case, where the first letter of each word is capitaliz...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert snake_to_camel('toggle object on') == 'ToggleObjectOn'\", \"assert snake_to_camel('toggle object off') == 'ToggleObjectOff'\", \"assert snake_to_camel('look down') == 'LookDown_15'\", \"assert snake_to_camel('move ahead') == 'MoveAhead_25'\", \"assert snake_...
{ "split": "train", "index": 4804, "acecode_id": "bigcode_python_fns_26394", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of buildings in a city. Your task is to implement a function that calculates the total amount of water that can be trapped between the buildings after raining. The water trapped at any building is determined by the heigh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert trap_water([0,1,0,2,1,0,1,3,2,1,2,1]) == 6\", \"assert trap_water([4,2,0,3,2,5]) == 9\", \"assert trap_water([1,0,2]) == 1\", \"assert trap_water([3,0,0,2,0,4]) == 10\", \"assert trap_water([1,1,1,1]) == 0\", \"assert trap_water([0,2,0]) == 0\", \"assert tra...
{ "split": "train", "index": 4805, "acecode_id": "oss_18953", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a string as input, representing a filename. The function should simulate creating a new file with the given filename. If a file with that name already exists, it should 'erase' it by removing it first. Your function does not ne...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_or_erase_file('test.txt') == 'File created: test.txt'\", \"assert create_or_erase_file('data.csv') == 'File created: data.csv'\", \"assert create_or_erase_file('report.doc') == 'File created: report.doc'\", \"assert create_or_erase_file('presentation....
{ "split": "train", "index": 4806, "acecode_id": "bigcode_python_fns_4021", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a string S representing a 2-dimensional coordinate in the format '(x, y)', where x and y are digits without any commas, decimal points, or spaces. Your task is to return a list of all possible valid (x, y) coordinate pairs that could have led to the string S. The ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert ambiguousCoordinates('(100)') == ['(10, 0)']\", \"assert ambiguousCoordinates('(1)') == []\", \"assert ambiguousCoordinates('(000)') == []\", \"assert ambiguousCoordinates('(10)') == ['(1, 0)']\", \"assert ambiguousCoordinates('(00000)') == []\"]}" }
{ "split": "train", "index": 4807, "acecode_id": "evol_429", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a dataset represented as a list of lists, where each inner list contains numerical features for a data point. Your task is to implement a function that performs K-means clustering on this dataset. The function should take the dataset and an integer representing th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert perform_kmeans_clustering([[1, 1], [2, 2], [3, 3], [8, 8], [9, 9]], 2) == [0, 0, 0, 1, 1]\", \"assert perform_kmeans_clustering([[0, 0], [1, 1], [2, 2], [3, 3]], 1) == [0, 0, 0, 0]\", \"assert perform_kmeans_clustering([[1, 2], [2, 1], [2, 2], [1, 1]], 1) ==...
{ "split": "train", "index": 4808, "acecode_id": "oss_16332", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Your task is to implement a function that returns the sum of all the even numbers in the list. If there are no even numbers, return 0. The function should be named `sum_of_evens` and should take a single parameter, which is the list of integers...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([10, 15, 20, 25]) == 30\", \"assert sum_of_evens([1, 3, 5]) == 0\", \"assert sum_of_evens([]) == 0\", \"assert sum_of_evens([2, 4, 6]) == 12\", \"assert sum_of_evens([-2, -4, -6]) == -12\", \"assert...
{ "split": "train", "index": 4809, "acecode_id": "bigcode_python_fns_27397", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to add two non-negative integers, x and y (0 <= x, y < 2^31), without using the '+' operator or any arithmetic operation like subtraction or multiplication. Implement a function that takes two integers x and y as input and returns their sum.\nPlease reason step by step...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add(0, 0) == 0\", \"assert add(1, 1) == 2\", \"assert add(2, 3) == 5\", \"assert add(10, 20) == 30\", \"assert add(100, 200) == 300\", \"assert add(15, 45) == 60\", \"assert add(5, 7) == 12\", \"assert add(255, 1) == 256\", \"assert add(1023, 1024) == 2047\"...
{ "split": "train", "index": 4810, "acecode_id": "evol_17060", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a string representing a library identifier formatted as 'library.module.version' and checks whether it is valid. A valid library identifier should have three parts separated by dots (.), where each part is a non-empty string. T...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_library_identifier('invalid library.module.v1') == False\", \"assert is_valid_library_identifier('library..v1') == False\", \"assert is_valid_library_identifier('library.module.') == False\", \"assert is_valid_library_identifier('.module.v1') == Fal...
{ "split": "train", "index": 4811, "acecode_id": "bigcode_python_fns_8933", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Write a function that calculates the distance between two points on a two-dimensional plane. The function should take two tuples as parameters, where each tuple represents the coordinates of a point (x, y). Return the distance as a float. For example, given Point1 (x1: 3, y1: 4...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert abs(calculate_distance((0, 0), (0, 0)) - 0.0) < 1e-9\", \"assert abs(calculate_distance((1, 1), (4, 5)) - 5.0) < 1e-9\", \"assert abs(calculate_distance((-1, -1), (1, 1)) - 2.8284271247461903) < 1e-9\", \"assert abs(calculate_distance((2, 3), (2, 5)) - 2.0) ...
{ "split": "train", "index": 4812, "acecode_id": "evol_25792", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the behavior of a pool monitoring system by managing user login and device data retrieval. The function `pool_monitor(username: str, password: str) -> dict` should take a username and password as input parameters and re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert pool_monitor('user1', 'pass1') == {'access_token': 'token123', 'devices': ['Pool', 'Spa']}\", \"assert pool_monitor('user2', 'pass2') == {'access_token': 'token456', 'devices': ['Pool', 'Hot Tub']}\", \"assert pool_monitor('user1', 'wrongpass') == {}\", \"as...
{ "split": "train", "index": 4813, "acecode_id": "oss_27221", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes a string of alphabetical characters as input and returns a Boolean value indicating if that string is a pangram (contains every letter of the alphabet at least once).\nPlease reason step by step, then write a self-contained Python solution. Give your...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_pangram('The quick brown fox jumps over the lazy dog') == True\", \"assert is_pangram('abcdefghijklmnopqrstuvwxyz') == True\", \"assert is_pangram('Pack my box with five dozen liquor jugs') == True\", \"assert is_pangram('Sphinx of black quartz, judge my ...
{ "split": "train", "index": 4814, "acecode_id": "evol_3889", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string 'mystring', implement a function that returns a dictionary where the keys are unique characters from the string and the values are the counts of how many times each character appears in the string. The function signature should be: def char_count(mystring: str) -...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert char_count('hello') == {'h': 1, 'e': 1, 'l': 2, 'o': 1}\", \"assert char_count('aabbcc') == {'a': 2, 'b': 2, 'c': 2}\", \"assert char_count('') == {}\", \"assert char_count('abc') == {'a': 1, 'b': 1, 'c': 1}\", \"assert char_count('aA') == {'a': 1, 'A': 1}\"...
{ "split": "train", "index": 4815, "acecode_id": "evol_28199", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with simulating the training of various machine learning models on specified datasets for either classification or regression tasks. Implement a function `simulate_model_training(model_to_run: str, dataset_name: str, task: str, verbose: bool = False) -> None` tha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_model_training('LR', 'water', 'classification', False) is None\", \"assert simulate_model_training('RF', 'stroke', 'regression', True) is None\", \"assert simulate_model_training('GBM', 'telco', 'classification', True) is None\", \"assert simulate_m...
{ "split": "train", "index": 4816, "acecode_id": "bigcode_python_fns_41923", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that aggregates results from multiple areas in a given dataset. The dataset is represented as a list of tuples, where each tuple contains a location and its corresponding data. Your function should take a list of locations and a dataset a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert aggregate_data(['New York', 'San Francisco'], [('New York', 'Data1'), ('Los Angeles', 'Data2'), ('San Francisco', 'Data3')]) == ['Data1', 'Data3']\", \"assert aggregate_data(['Miami'], [('Chicago', 'Data4'), ('Miami', 'Data5'), ('Seattle', 'Data6')]) == ['Da...
{ "split": "train", "index": 4817, "acecode_id": "bigcode_python_fns_32524", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates fetching user information from a social media platform based on user IDs. The function, `get_user_info`, should take two parameters: a list of user IDs and a fixed access token string. The function should return a dictionar...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_user_info(['1'], 'my_access_token') == {'1': {'city': 'New York', 'birthdate': '1990-01-01', 'photo_url': 'http://example.com/photo1.jpg'}}\", \"assert get_user_info(['1', '2'], 'my_access_token') == {'1': {'city': 'New York', 'birthdate': '1990-01-01', ...
{ "split": "train", "index": 4818, "acecode_id": "bigcode_python_fns_34553", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a summary document from a list of reports. Each report consists of a file path and a dictionary containing messages, statistics, and other variables. Your function should take a string representing the document name, a list of reports, and a diction...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert modelize_summary('foo.html', [('/html/foo.html', {'messages': ['ping', 'pong'], 'statistics': {'foo': 1, 'bar': 1}, 'dummyvar': ['michou']}), ('/html/bar.html', {'messages': ['pang', 'pung'], 'statistics': {'foo': 0, 'bar': 1}, 'dummyvar': ['dumdum']})], {'p...
{ "split": "train", "index": 4819, "acecode_id": "bigcode_python_fns_9202", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a class type, determine if it is a subclass of a specific base class named `Actor`. Implement a function `is_dapr_actor(cls: Type[Actor]) -> bool` that checks whether the provided class `cls` inherits from the `Actor` class. The function should return `True` if it is a su...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_dapr_actor(ChildActor) == True\", \"assert is_dapr_actor(AnotherChildActor) == True\", \"assert is_dapr_actor(Actor) == True\", \"assert is_dapr_actor(object) == False\", \"assert is_dapr_actor(Actor) == True\"]}" }
{ "split": "train", "index": 4820, "acecode_id": "bigcode_python_fns_10843", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Implement a function `fibonacci(n: int) -> int` that calculates the nth Fibonacci number using recursion with memoization. Ensure that your function handles edge cases, such as negative inputs, zero, and inputs larger than a predefined maximum limit of 30. If the input is negat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci(0) == 0\", \"assert fibonacci(1) == 1\", \"assert fibonacci(2) == 1\", \"assert fibonacci(3) == 2\", \"assert fibonacci(4) == 3\", \"assert fibonacci(5) == 5\", \"assert fibonacci(6) == 8\", \"assert fibonacci(7) == 13\", \"assert fibonacci(8) == 2...
{ "split": "train", "index": 4821, "acecode_id": "evol_7582", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that compares two lists of expense categories. The function will take two lists as input: the first list contains all expense categories retrieved from a database, while the second list contains categories obtained from an advanced se...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compare_expense_categories(['Food', 'Travel', 'Utilities'], ['Travel', 'Food', 'Entertainment']) == True\", \"assert compare_expense_categories(['Food', 'Travel'], ['Travel', 'Food', 'Utilities']) == False\", \"assert compare_expense_categories([], []) == Tr...
{ "split": "train", "index": 4822, "acecode_id": "bigcode_python_fns_4543", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function `inclusive_range(start: int, end: int) -> List[int]` that takes two integers, `start` and `end`, and returns a list of all integers in the inclusive range from `start` to `end`. The list should contain numbers starting from `start` to `end` in ascending ord...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert inclusive_range(1, 5) == [1, 2, 3, 4, 5]\", \"assert inclusive_range(0, 0) == [0]\", \"assert inclusive_range(-3, 3) == [-3, -2, -1, 0, 1, 2, 3]\", \"assert inclusive_range(2, 2) == [2]\", \"assert inclusive_range(10, 15) == [10, 11, 12, 13, 14, 15]\", \"ass...
{ "split": "train", "index": 4823, "acecode_id": "bigcode_python_fns_20618", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `image_resizer(max_size: int, initial_size: Tuple[int, int]) -> Tuple[int, int]` that takes in a maximum size for the dimensions of an image and the initial size of the image as a tuple (width, height). The function should return the new dimensions of the image...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert image_resizer(500, (800, 600)) == (500, 375)\", \"assert image_resizer(300, (600, 400)) == (300, 200)\", \"assert image_resizer(100, (50, 50)) == (50, 50)\", \"assert image_resizer(200, (300, 150)) == (200, 100)\", \"assert image_resizer(700, (700, 700)) == ...
{ "split": "train", "index": 4824, "acecode_id": "evol_14751", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that reverses a given string in-place by a specified number of characters to the right. The function should handle negative values for leftward reversals and should correctly accommodate reversal values that exceed the length of the string. The function mus...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_string('hello', 2) == 'lohel'\", \"assert reverse_string('world', -1) == 'orldw'\", \"assert reverse_string('abcdef', 6) == 'abcdef'\", \"assert reverse_string('abcdef', 7) == 'fabcde'\", \"assert reverse_string('abcdef', 0) == 'abcdef'\", \"assert r...
{ "split": "train", "index": 4825, "acecode_id": "evol_27721", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a string representing a sequence of characters. Your task is to write a function that counts the number of vowels (a, e, i, o, u) in the string. The function should be case-insensitive, meaning it should count both uppercase and lowercase vowels. The function shou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_vowels('Hello World') == 3\", \"assert count_vowels('Python') == 1\", \"assert count_vowels('AEIOU') == 5\", \"assert count_vowels('abcdefghijklmnopqrstuvwxyz') == 5\", \"assert count_vowels('') == 0\", \"assert count_vowels('1234567890') == 0\", \"ass...
{ "split": "train", "index": 4826, "acecode_id": "bigcode_python_fns_42946", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a list of four integers representing the four octets of an IPv4 address, implement a function that constructs the IP address in the standard dot-decimal notation format (e.g., '192.168.1.1'). The function should return a dictionary with two keys: 'ip', which contains the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_ip_address([192, 168, 1, 1]) == {'ip': '192.168.1.1', 'sanity': []}\", \"assert format_ip_address([0, 0, 0, 0]) == {'ip': '0.0.0.0', 'sanity': []}\", \"assert format_ip_address([255, 255, 255, 255]) == {'ip': '255.255.255.255', 'sanity': []}\", \"asse...
{ "split": "train", "index": 4827, "acecode_id": "bigcode_python_fns_6708", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string representing a wrapped word, return a dictionary containing the following keys and their respective meanings: 'basic', 'phrase', 'synonyms', 'rel_word_tab', and 'discriminate'. If the word does not exist, return None. For the purpose of this problem, you can assu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert youdao_definition('word3') == None\", \"assert youdao_definition('word7') == None\", \"assert youdao_definition('word10') == None\", \"assert youdao_definition('word14') == None\", \"assert youdao_definition('word17') == None\", \"assert youdao_definition('w...
{ "split": "train", "index": 4828, "acecode_id": "bigcode_python_fns_44850", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are given a list of strings, where each string represents a line of text containing an ID followed by other information. Your task is to implement a function that extracts the unique IDs from the list of strings. Each ID is the first word in the string. The function should ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_unique_ids(['id1 info1', 'id2 info2', 'id1 info3']) == {'id1', 'id2'}\", \"assert extract_unique_ids(['id1', 'id1', 'id1']) == {'id1'}\", \"assert extract_unique_ids(['idA data', 'idB data', 'idC data']) == {'idA', 'idB', 'idC'}\", \"assert extract_u...
{ "split": "train", "index": 4829, "acecode_id": "bigcode_python_fns_38027", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string representation of a UUID (Universally Unique Identifier), implement a function `make_uuid(value: str) -> str` that converts the string into a UUID object. If the input is already a UUID object, return it as a string. The function should handle invalid UUID string...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert make_uuid('123e4567-e89b-12d3-a456-426614174000') == '123e4567-e89b-12d3-a456-426614174000'\", \"assert make_uuid('550e8400-e29b-41d4-a716-446655440000') == '550e8400-e29b-41d4-a716-446655440000'\", \"assert make_uuid('f47ac10b-58cc-4372-a567-0e02b2c3d479') ...
{ "split": "train", "index": 4830, "acecode_id": "bigcode_python_fns_379", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `is_geometric(lst)` that takes a list of numbers as input and returns `True` if the list forms a geometric progression, and `False` otherwise. A geometric progression is a sequence of numbers where each term after the first is found by multiplying the previous ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_geometric([3, 9, 27, 81]) == True\", \"assert is_geometric([1]) == True\", \"assert is_geometric([]) == True\", \"assert is_geometric([2, 6, 18]) == True\", \"assert is_geometric([5, 10, 15]) == False\", \"assert is_geometric([10, 5, 2.5]) == True\", \"as...
{ "split": "train", "index": 4831, "acecode_id": "evol_2095", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with analyzing web page views to determine the day(s) with the highest number of views. You will be given a list of dictionaries, where each dictionary represents a day and contains two keys: 'timestamp' (a string representing the date in 'YYYY-MM-DD' format) and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_max_view_days([{'timestamp': '2022-01-01', 'views': 150}, {'timestamp': '2022-01-02', 'views': 200}, {'timestamp': '2022-01-03', 'views': 200}, {'timestamp': '2022-01-04', 'views': 180}, {'timestamp': '2022-01-05', 'views': 200}]) == '2022-01-02, 2022-0...
{ "split": "train", "index": 4832, "acecode_id": "oss_31417", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given the roots of two binary trees, implement a function that checks if the two trees are structurally identical and have the same node values. The function should return True if the trees are identical, and False otherwise. A binary tree is defined by its root node, and a tre...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert isSameTree(None, None) == True\", \"assert isSameTree(Node(1), None) == False\", \"assert isSameTree(None, Node(1)) == False\", \"assert isSameTree(Node(1), Node(1)) == True\", \"assert isSameTree(Node(1), Node(2)) == False\", \"assert isSameTree(Node(1), No...
{ "split": "train", "index": 4833, "acecode_id": "evol_14986", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of strings `params` and a list of integers `point`, implement a function `make_values(params: List[str], point: List[int]) -> Dict[str, int]` that returns a dictionary. The dictionary should map each string in `params` (sorted in ascending order) to the correspondi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert make_values(['a', 'b', 'c'], [1, 2, 3]) == {'a': 1, 'b': 2, 'c': 3}\", \"assert make_values([], []) == {}\", \"assert make_values(['x', 'y', 'z'], [0, 0, 0]) == {'x': 0, 'y': 0, 'z': 0}\", \"assert make_values(['apple', 'banana', 'cherry'], [100, 200, 300]) ...
{ "split": "train", "index": 4834, "acecode_id": "bigcode_python_fns_11689", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a modified version of the Huber loss function. The modified Huber loss function should behave as follows: For an absolute error less than or equal to a threshold `delta`, the loss should be the L2 loss (mean squared error). For absolute errors g...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert abs(modified_huber_loss([1.0], [1.0], 1.0) - 0.0) < 1e-6\", \"assert abs(modified_huber_loss([1.0], [2.0], 1.0) - 0.5) < 1e-6\", \"assert abs(modified_huber_loss([1.0, 2.0], [1.0, 2.0], 1.0) - 0.0) < 1e-6\", \"assert abs(modified_huber_loss([1.0, 2.0], [2.0,...
{ "split": "train", "index": 4835, "acecode_id": "oss_36323", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given a string representing the name of an option and a list of available options. Write a function `option_not_exist_msg(option_name: str, existing_options: List[str]) -> str` that returns a formatted message indicating that the specified option does not exist. The mes...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert option_not_exist_msg('alpha', ['beta', 'gamma']) == \\\"'options.alpha' doesn't exist\\\\nPossible options are ['beta', 'gamma']\\\"\", \"assert option_not_exist_msg('gamma', ['beta', 'alpha']) == \\\"'options.gamma' doesn't exist\\\\nPossible options are ['...
{ "split": "train", "index": 4836, "acecode_id": "bigcode_python_fns_17435", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a waypoint mapping system for a robot's navigation module. The robot has a set of waypoints represented as unique identifiers. Each waypoint identifier needs to be mapped to a name based on a set of odometry vertex identifiers. Your task is to w...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert map_waypoint_name_to_number([1, 2, 3], [5]) == {1: 'Waypoint_6', 2: 'Waypoint_7', 3: 'Waypoint_8'}\", \"assert map_waypoint_name_to_number([1, 3, 5], [0, 2, 4]) == {1: 'Waypoint_5', 3: 'Waypoint_6', 5: 'Waypoint_7'}\", \"assert map_waypoint_name_to_number([]...
{ "split": "train", "index": 4837, "acecode_id": "oss_3227", "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 checks if there are two distinct indices in the list such that the sum of the integers at those indices equals the target integer. If such indices exist, return a list containing th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_indices([3, 2, 4], 6) == [1, 2]\", \"assert find_indices([1, 2, 3, 4, 5], 10) == []\", \"assert find_indices([-1, -2, -3, -4, -5], -8) == [2, 4]\", \"assert find_indices([], 1) == []\", \"assert find_indices([1, 2, 3, 4], 7) == [2, 3]\", \"assert find_i...
{ "split": "train", "index": 4838, "acecode_id": "bigcode_python_fns_581", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a dictionary containing data on the number of joins by day. The function should calculate the average number of joins for each day of the week and return a new dictionary with the average values. The input dictionary...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average_joins({'Monday': [10, 15, 20], 'Tuesday': [5, 10, 15], 'Wednesday': [8, 12, 16]}) == {'Monday': 15.0, 'Tuesday': 10.0, 'Wednesday': 12.0}\", \"assert calculate_average_joins({'Monday': [1, 2, 3], 'Tuesday': [4, 5, 6]}) == {'Monday': 2.0, 'T...
{ "split": "train", "index": 4839, "acecode_id": "oss_1503", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `is_balanced_parentheses(s: str) -> bool` that checks if the given string `s` containing parentheses is balanced. A string is considered balanced if every opening parenthesis has a corresponding closing parenthesis and they are correctly nested. The functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_balanced_parentheses('()') == True\", \"assert is_balanced_parentheses('(())') == True\", \"assert is_balanced_parentheses('(()())') == True\", \"assert is_balanced_parentheses(')(') == False\", \"assert is_balanced_parentheses('((())') == False\", \"asse...
{ "split": "train", "index": 4840, "acecode_id": "evol_4793", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a 2D list representing a matrix of integers. Your task is to implement a function that takes this matrix as input and returns the sum of all the elements in the matrix. The function should handle any rectangular matrix (including square matrices) with dimensions m...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_matrix([[1, 2], [3, 4]]) == 10\", \"assert sum_matrix([[5]]) == 5\", \"assert sum_matrix([[0, 0], [0, 0]]) == 0\", \"assert sum_matrix([[1, 1, 1], [1, 1, 1]]) == 6\", \"assert sum_matrix([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == 45\", \"assert sum_matrix([[1...
{ "split": "train", "index": 4841, "acecode_id": "oss_14638", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function named 'median' that returns the median of elements in a given list 'l' without sorting it or utilizing built-in functions. The function should handle lists that may include negative numbers, floating-point numbers, duplicates, and should employ a provided c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert median([3, 1, 2, 4, 5], lambda a, b: a - b) == 3\", \"assert median([1, -2, 2.5, 4, 5], lambda a, b: a - b) == 2.5\", \"assert median([2.2, 3.3, 1.1, 4.4, 2.2], lambda a, b: a - b) == 2.2\", \"assert median([7, 7, 7, 7, 7], lambda a, b: a - b) == 7\", \"asse...
{ "split": "train", "index": 4842, "acecode_id": "evol_28480", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with processing a list of patterns from a structured input format. Each pattern has associated flags and parameters that dictate its behavior. Implement a function that takes a list of strings, where each string represents a line of input. The first line contains...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_patterns(['Pattern1', '3 1 0 1', '0.5 0.7 0.3', '1 0 1']) == {'name': 'Pattern1', 'patterns': {0: {'is_refined': True, 'weight': 0.5}, 1: {'is_refined': False, 'weight': 0.7}, 2: {'is_refined': True, 'weight': 0.3}}, 'global_flags': {'flag1': 1, 'fla...
{ "split": "train", "index": 4843, "acecode_id": "bigcode_python_fns_20526", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates the behavior of a network ARP cache. The Address Resolution Protocol (ARP) cache is used to store mappings of IP addresses to MAC addresses for devices on a local network. Your function should handle the addition, re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert (add_mapping := arp_cache())[0]('192.168.1.1', '00:0a:95:9d:68:16') is None\", \"assert (add_mapping := arp_cache())[0]('192.168.1.2', '00:0a:95:9d:68:17') is None\", \"assert (remove_mapping := arp_cache())[2]('192.168.1.1') is None\", \"assert (retrieve_ma...
{ "split": "train", "index": 4844, "acecode_id": "oss_36077", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a command-line interface (CLI) tool that initializes a configuration. Your function should accept a configuration parameter and check if it meets certain validation criteria. If the configuration is valid, return a success ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_config({'name': 'MyApp', 'version': 1}) == 'Configuration is valid.'\", \"assert validate_config({'name': '', 'version': 1}) == 'ValidationError: Name cannot be empty.'\", \"assert validate_config({'name': 'MyApp', 'version': -1}) == 'ValidationErro...
{ "split": "train", "index": 4845, "acecode_id": "bigcode_python_fns_1299", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string s, write a function that removes all the vowels (a, e, i, o, u) from the string and returns the modified string. The function should handle both lowercase and uppercase vowels.\nPlease reason step by step, then write a self-contained Python solution. Give your fi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_vowels('hello') == 'hll'\", \"assert remove_vowels('leetcode') == 'ltcd'\", \"assert remove_vowels('Python') == 'Pythn'\", \"assert remove_vowels('aeiou') == ''\", \"assert remove_vowels('AEIOU') == ''\", \"assert remove_vowels('abcde') == 'bcd'\", \"...
{ "split": "train", "index": 4846, "acecode_id": "evol_28404", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of various buildings. Your task is to implement a function that calculates the total area of the skyline formed by these buildings. The skyline is defined as the outline of the buildings when viewed from a distance. Each...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert total_skyline_area([2, 1, 3]) == 6\", \"assert total_skyline_area([5, 3, 4]) == 12\", \"assert total_skyline_area([1, 2, 3, 4]) == 10\", \"assert total_skyline_area([0, 0, 0]) == 0\", \"assert total_skyline_area([1]) == 1\", \"assert total_skyline_area([4, 4...
{ "split": "train", "index": 4847, "acecode_id": "bigcode_python_fns_40770", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `phrase`, write a function that returns the third unique character in the string. If the string does not contain three unique characters, return the message 'Error: not enough unique characters'.\nPlease reason step by step, then write a self-contained Python sol...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert third_unique_char('he') == 'Error: not enough unique characters'\", \"assert third_unique_char('abcde') == 'c'\", \"assert third_unique_char('abcd') == 'c'\", \"assert third_unique_char('') == 'Error: not enough unique characters'\", \"assert third_unique_ch...
{ "split": "train", "index": 4848, "acecode_id": "evol_21580", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes an input string by modifying its uppercase alphabetic characters based on a given integer value. Specifically, your function should iterate through each character in the input string. For each character, if it is an upp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_string('HELLO', 1) == 'GDKKN'\", \"assert process_string('ABCDEFG', 0) == 'ABCDEFG'\", \"assert process_string('', 1) == ''\", \"assert process_string('Z', 1) == 'Y'\", \"assert process_string('Z', 2) == 'X'\", \"assert process_string('abc', 3) == 'a...
{ "split": "train", "index": 4849, "acecode_id": "oss_5732", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given an unsorted list of 'n' integers, implement a function that finds the maximum element in the list using a linear search approach. The function should take a list of integers as input and return the maximum integer found in the list.\nPlease reason step by step, then write...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_max([10, 5, 15, 80, 25, -5, 100, 75, 35, 55]) == 100\", \"assert find_max([1, 2, 3, 4, 5]) == 5\", \"assert find_max([-10, -20, -30, -1]) == -1\", \"assert find_max([0, 0, 0, 0]) == 0\", \"assert find_max([7]) == 7\", \"assert find_max([-1, -2, -3, 0]) ...
{ "split": "train", "index": 4850, "acecode_id": "evol_21179", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the process of uploading a file to a cloud storage bucket. The function, `upload_file`, takes three parameters: `bucket_name` (a string representing the name of the cloud storage bucket), `source_file_name` (a string repres...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert upload_file('my_bucket', 'local_file.txt', 'remote_file.txt') == 'File local_file.txt has been uploaded to my_bucket/remote_file.txt'\", \"assert upload_file('user_photos', 'photo1.jpg', 'uploads/photo1.jpg') == 'File photo1.jpg has been uploaded to user_pho...
{ "split": "train", "index": 4851, "acecode_id": "bigcode_python_fns_47933", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that updates a value within a nested dictionary based on a given notation string. The notation string represents the path to the value within the nested dictionary, and the function should set the value at the specified path. If any o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_value({'a': {'b': {'c': 5}}}, 'a.b.c', 10) == None\", \"assert set_value({'x': {}}, 'x.y.z', 20) == None\", \"assert set_value({}, 'key1.key2', 15) == None\", \"assert set_value({'a': {'b': {}}}, 'a.b.c', 30) == None\", \"assert set_value({'root': {'chil...
{ "split": "train", "index": 4852, "acecode_id": "oss_3357", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates an unguessable reference. An unguessable reference is a unique identifier that is difficult for an outsider to predict or guess. Implement a function called `generate_unguessable_reference()` that generates a random referen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert len(generate_unguessable_reference()) == 10\", \"assert all(c.isalnum() for c in generate_unguessable_reference())\", \"assert any(c.isupper() for c in generate_unguessable_reference())\", \"assert any(c.islower() for c in generate_unguessable_reference())\"...
{ "split": "train", "index": 4853, "acecode_id": "oss_23011", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a text string, implement a function that calculates the frequency of each individual word present in the string. The words should be parsed by splitting the string using whitespace as the delimiter. Return a dictionary where the keys are the unique words and the values ar...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert word_frequency('Hello world') == {'Hello': 1, 'world': 1}\", \"assert word_frequency('Hello Hello') == {'Hello': 2}\", \"assert word_frequency('Python is fun') == {'Python': 1, 'is': 1, 'fun': 1}\", \"assert word_frequency('Python Python Python') == {'Python...
{ "split": "train", "index": 4854, "acecode_id": "evol_31351", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `can_fly(q: List[int], w: int, k: int) -> bool` that determines whether an object represented by the list `q` can achieve a stable flight. The function should return `True` if the following conditions are met: 1) `q` is a palindrome (the list reads the same...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_fly([3, 2, 3], 9, 1) == False\", \"assert can_fly([1, 2, 1], 5, 2) == True\", \"assert can_fly([1, 1, 1], 3, 1) == True\", \"assert can_fly([1, 2, 3], 6, 3) == False\", \"assert can_fly([2, 2, 2], 6, 2) == True\", \"assert can_fly([0, 0, 0], 1, 0) == Tru...
{ "split": "train", "index": 4855, "acecode_id": "evol_32662", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of negative integers, write a function `min_magnitude(lst)` that returns the integer in the list that has the smallest absolute value. If there are multiple integers with the same smallest absolute value, return the first one encountered in the list.\nPlease reason...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert min_magnitude([-2, -5, -10, -15]) == -2\", \"assert min_magnitude([-3, -1, -4]) == -1\", \"assert min_magnitude([-8, -8, -3, -7]) == -3\", \"assert min_magnitude([-10, -2, -3]) == -2\", \"assert min_magnitude([-1]) == -1\", \"assert min_magnitude([-100, -50,...
{ "split": "train", "index": 4856, "acecode_id": "evol_5014", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a configuration string and a boolean value as input. The function should return a list of database names found in a simulated database directory. For the purpose of this problem, assume that the database names are derived f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert db_list('db_alpha db_beta db_gamma', True) == ['DB_ALPHA', 'DB_BETA', 'DB_GAMMA']\", \"assert db_list('db_one db_two', False) == ['db_one', 'db_two']\", \"assert db_list('no_databases_here', True) == []\", \"assert db_list('db_x db_y db_z ', False) == ['db_x...
{ "split": "train", "index": 4857, "acecode_id": "bigcode_python_fns_5726", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks if a user has valid GCP (Google Cloud Platform) credentials. The function should take a string input representing the user's credentials. If the credentials are valid (i.e., the string is not empty), the function should re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_gcp_credentials('valid_credentials') == 'Valid Credentials'\", \"assert check_gcp_credentials('') == 'Invalid Credentials'\", \"assert check_gcp_credentials('my_service_account') == 'Valid Credentials'\", \"assert check_gcp_credentials('user123@myproje...
{ "split": "train", "index": 4858, "acecode_id": "bigcode_python_fns_38177", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the effect of a learning rate multiplier on a set of gradients during an optimization process. The function `apply_learning_rate_multiplier` takes two parameters: a list of floating-point numbers representing gradients ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert apply_learning_rate_multiplier([1.0, 2.0, 3.0], 0.5) == [0.5, 1.0, 1.5]\", \"assert apply_learning_rate_multiplier([4.0, 5.0, 6.0], 2.0) == [8.0, 10.0, 12.0]\", \"assert apply_learning_rate_multiplier([-1.0, -2.0, -3.0], 1.0) == [-1.0, -2.0, -3.0]\", \"asser...
{ "split": "train", "index": 4859, "acecode_id": "bigcode_python_fns_17693", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with finding the length of the longest contiguous subarray within a given list of integers, `nums`, that sums up to a specified integer `k`. If no such subarray exists, return `0`. Your function should be named `maxSubArrayLen` and should accept a list of integer...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert maxSubArrayLen([1, -1, 5, -2, 3], 3) == 4\", \"assert maxSubArrayLen([-2, -1, 2, 1], 1) == 2\", \"assert maxSubArrayLen([0, 0, 0, 0], 0) == 4\", \"assert maxSubArrayLen([-1, -2, -3, -4, -5], -10) == 4\", \"assert maxSubArrayLen([3, 1, -4, 2, 5], 0) == 3\", \...
{ "split": "train", "index": 4860, "acecode_id": "evol_31057", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of dictionaries, where each dictionary represents a database row with its primary keys and their corresponding values. Your function should return a new dictionary that maps the hash of the primary key values to the orig...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert map_primary_keys([{'primary_key': ['id'], 'id': 1, 'name': 'Alice'}, {'primary_key': ['id'], 'id': 2, 'name': 'Bob'}]) == {hash((1,)): {'primary_key': ['id'], 'id': 1, 'name': 'Alice'}, hash((2,)): {'primary_key': ['id'], 'id': 2, 'name': 'Bob'}}\", \"assert...
{ "split": "train", "index": 4861, "acecode_id": "bigcode_python_fns_655", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function named `calculate_volume` that computes the volume of a specified 3D geometric shape. The function should accept a shape type (as a string) and the necessary dimensions as arguments. The supported shapes are 'cuboid', 'sphere', 'cylinder', and 'cone'. If the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_volume('cuboid', 2, 3, 4) == 24\", \"assert calculate_volume('cuboid', 1.5, 2.5, 3.5) == 13.125\", \"assert calculate_volume('sphere', 3) == (4/3) * math.pi * (3 ** 3)\", \"assert calculate_volume('sphere', 0) == 'Invalid dimensions.'\", \"assert c...
{ "split": "train", "index": 4862, "acecode_id": "evol_12201", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given three lists of strings: `kmers`, `codons`, and `minhashes`. Each list contains elements that can be joined based on a common key, which is the first element of each string in the lists. Your task is to implement a function that merges these three lists in the foll...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_lists(['A,1', 'B,2', 'C,3'], ['A,x', 'B,y'], ['A,foo', 'B,bar']) == ['A,1,x,foo', 'B,2,y,bar']\", \"assert merge_lists(['A,1'], ['B,y'], ['C,foo']) == []\", \"assert merge_lists([], [], []) == []\", \"assert merge_lists(['A,1'], ['A,x'], ['A,foo']) == ...
{ "split": "train", "index": 4863, "acecode_id": "bigcode_python_fns_37155", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function that takes a dictionary where the keys are names and the values are their respective frequencies. Your task is to return the name that has the lowest frequency. If multiple names have the same minimum frequency, return any one of them.\nPlease reason step b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert min_freq_name({'Jon': 3, 'Arya': 1, 'Tyrion': 1, 'Cersei': 1}) == 'Arya' or min_freq_name({'Jon': 3, 'Arya': 1, 'Tyrion': 1, 'Cersei': 1}) == 'Tyrion' or min_freq_name({'Jon': 3, 'Arya': 1, 'Tyrion': 1, 'Cersei': 1}) == 'Cersei'\", \"assert min_freq_name({'A...
{ "split": "train", "index": 4864, "acecode_id": "evol_4270", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that finds the two shortest strings in a given list of strings. The function should return a list containing the two shortest strings in ascending order of their lengths. If there are multiple strings with the same length, they should be included in the res...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert shortest_strings(['apple', 'banana', 'kiwi', 'pear']) == ['kiwi', 'pear']\", \"assert shortest_strings(['a', 'ab', 'abc', 'abcd']) == ['a', 'ab']\", \"assert shortest_strings(['hello', 'world']) == ['hello', 'world']\", \"assert shortest_strings(['apple', 'b...
{ "split": "train", "index": 4865, "acecode_id": "evol_14524", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Create a function `process_russian_word(word)` that takes a Russian word as input and categorizes it based on the following rules: If the word matches the perfective gerund regular expression, return 'Perfective Gerund'. If the word matches the adjective regular expression, ret...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_russian_word('\\u0432\\u044b\\u043f\\u0438\\u0432\\u0448\\u0438') == 'Perfective Gerund'\", \"assert process_russian_word('\\u043a\\u0440\\u0430\\u0441\\u0438\\u0432\\u043e\\u0435') == 'Adjective'\", \"assert process_russian_word('\\u043f\\u043e\\u04...
{ "split": "train", "index": 4866, "acecode_id": "oss_765", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a character matrix, `grid`, of dimensions `m x n`, which consists of the following types of cells: `'*'` signifies your current position (there is exactly one `'*'` cell), `'#'` represents a food cell (there could be multiple food cells), `'O'` denotes free space ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert getFood([['X', 'X', 'X', 'X', 'X', 'X'], ['X', '*', 'O', 'O', 'O', 'X'], ['X', 'O', 'O', '#', 'O', 'X'], ['X', 'X', 'X', 'X', 'X', 'X']]) == 3\", \"assert getFood([['X', 'X', 'X', 'X'], ['X', '*', 'O', 'X'], ['X', 'O', '#', 'X'], ['X', 'X', 'X', 'X']]) == 2\...
{ "split": "train", "index": 4867, "acecode_id": "evol_27887", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given a string that represents a subnet in CIDR notation (e.g., '10.0.2.0/24'). Write a function that takes this string as input and returns a new string that represents a less greedy subnet in CIDR notation. The less greedy subnet should have the same prefix but a diff...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert change_subnet('10.0.2.0/24') == '10.174.2.0/24'\", \"assert change_subnet('172.16.0.0/12') == '172.174.0.0/12'\", \"assert change_subnet('10.0.0.0/8') == '10.174.0.0/8'\", \"assert change_subnet('10.1.1.0/24') == '10.174.1.0/24'\", \"assert change_subnet('10...
{ "split": "train", "index": 4868, "acecode_id": "bigcode_python_fns_33781", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `block_randomizer` representing the name of a block producer, write a function `transition_with_random_block` that takes this string as input and returns a dictionary containing a single key-value pair, where the key is 'block_producer' and the value is the input...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transition_with_random_block('ProducerA') == {'block_producer': 'ProducerA'}\", \"assert transition_with_random_block('BlockMaster') == {'block_producer': 'BlockMaster'}\", \"assert transition_with_random_block('RandomizerX') == {'block_producer': 'Randomize...
{ "split": "train", "index": 4869, "acecode_id": "bigcode_python_fns_14240", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with verifying if specific company details are present in a given response string. You will be provided with the company's title, a list of keywords, the company's website, the number of employees, and the company's sector. Each of these details can be either req...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert are_company_details_visible('Tech Corp', ['innovation', 'technology'], 'www.techcorp.com', '501-1000', 'Technology', ['NAME', 'KEYWORDS', 'WEBSITE', 'SIZE', 'SECTOR'], 'Tech Corp is a leading company in innovation and technology. Visit us at www.techcorp.com...
{ "split": "train", "index": 4870, "acecode_id": "bigcode_python_fns_38341", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a unique identifier for a given type. The identifier should be composed of a specified type (a string) followed by a unique random alphanumeric string of a specified length. Write a function `generate_unique_id(type: str, l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_unique_id('user', 6).startswith('user-')\", \"assert len(generate_unique_id('item', 8).split('-')[1]) == 8\", \"assert generate_unique_id('product', 10).startswith('product-')\", \"assert generate_unique_id('test', 5).startswith('test-')\", \"assert...
{ "split": "train", "index": 4871, "acecode_id": "bigcode_python_fns_43114", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the number of photos in various albums. Write a function `count_photos_in_album(albums: List[int], album_name: str) -> int` that returns the number of photos in the specified album. Each album is represented by its index in the list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_photos_in_album([10, 20, 30], ['Vacation', 'Birthday', 'Pumpkin Farm'], 'Pumpkin Farm') == 30\", \"assert count_photos_in_album([5, 15, 25], ['Summer', 'Winter', 'Spring'], 'Winter') == 15\", \"assert count_photos_in_album([1, 2, 3], ['A', 'B', 'C'], '...
{ "split": "train", "index": 4872, "acecode_id": "bigcode_python_fns_30750", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a mathematical expression as a string, implement a function that converts the expression into a specific XML format. The function should take a single parameter, 'content', which is a string representing the mathematical expression. The output should be a string that repl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert xml_ind('a + b') == '<math xmlns:ml=\\\"http://schemas.mathsoft.com/math30\\\">a + b</math>'\", \"assert xml_ind('x * y') == '<math xmlns:ml=\\\"http://schemas.mathsoft.com/math30\\\">x * y</math>'\", \"assert xml_ind('sin(x)') == '<math xmlns:ml=\\\"http://...
{ "split": "train", "index": 4873, "acecode_id": "bigcode_python_fns_9354", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings, each representing a vertex group name. Your task is to sort these vertex group names based on a specific pattern. The vertex group names that start with a specified prefix should be moved to the beginning of the list. Specifically, you need to i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_special_vertex_groups(['STYMO:Character1', 'STYMO:Character2', 'OtherGroup', 'STYMO:Character3'], 'STYMO:', 'Character') == ['STYMO:Character1', 'STYMO:Character2', 'STYMO:Character3', 'OtherGroup']\", \"assert sort_special_vertex_groups(['GroupA', 'Gro...
{ "split": "train", "index": 4874, "acecode_id": "bigcode_python_fns_13966", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an event name and a dictionary of fields, write a function `validate_event` that checks if the fields in the dictionary match the required schema. The schema specifies that the event's fields must be an object with specific properties, where each property has a designated...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_event('my_event', {'field': 'Hello'}) == True\", \"assert validate_event('my_event', {'field': 123}) == False\", \"assert validate_event('my_event', {'field': True}) == False\", \"assert validate_event('my_event', {}) == False\", \"assert validate_e...
{ "split": "train", "index": 4875, "acecode_id": "bigcode_python_fns_2222", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings, each representing a block of data associated with a key. Your task is to implement a function `parse_block_data(blocks: List[str]) -> Dict[str, str]` that parses each block and returns a dictionary where the keys are the original keys from the b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_block_data(['key1:data1', 'key2:data2', 'key3:data3']) == {'key1': 'data1', 'key2': 'data2', 'key3': 'data3'}\", \"assert parse_block_data(['key1:data1', 'unknown_key:data4']) == {'key1': 'data1', 'unknown_key': 'data4'}\", \"assert parse_block_data(['...
{ "split": "train", "index": 4876, "acecode_id": "bigcode_python_fns_29874", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an object `target`, implement a function `get_object_representation(target)` that returns a string representation of the object's module and name in the format 'module.name'. If the input is not a valid object that has a module and name attribute, the function should retu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_object_representation(int) == 'builtins.int'\", \"assert get_object_representation(str) == 'builtins.str'\", \"assert get_object_representation(list) == 'builtins.list'\", \"assert get_object_representation(dict) == 'builtins.dict'\", \"assert get_object...
{ "split": "train", "index": 4877, "acecode_id": "bigcode_python_fns_48705", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Implement a function `decrypt_caesar_cipher(ciphertext: str, shift: int) -> str` that takes an encrypted string `ciphertext` using the Caesar Cipher technique and an integer `shift`, and returns the decrypted plain text. The shift is the number of positions each letter in the a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert decrypt_caesar_cipher('Khoor Zruog!', 3) == 'Hello World!'\", \"assert decrypt_caesar_cipher('Uifsf jt b tfdsfu!', 1) == 'There is a secret!'\", \"assert decrypt_caesar_cipher('Wklv lv d whvw.', 3) == 'This is a test.'\", \"assert decrypt_caesar_cipher('Z', ...
{ "split": "train", "index": 4878, "acecode_id": "evol_360", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simple bank account operation. The function should accept a list of operations to perform on the bank account, which includes 'deposit', 'withdraw', 'check_balance', and 'apply_interest'. Each operation will have its ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bank_account_operations([('deposit', 100), ('withdraw', 50), 'check_balance', ('apply_interest', 10)]) == 55.0\", \"assert bank_account_operations([('deposit', 200), 'check_balance']) == 200.0\", \"assert bank_account_operations([('deposit', 150), ('withdraw...
{ "split": "train", "index": 4879, "acecode_id": "oss_21228", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that performs a specific operation on a 3D tensor (a multi-dimensional array) using a simple mathematical operation. The function should take a tensor and a scalar value as inputs, apply a mathematical operation, and return the result...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert apply_operation([[[0, 0], [0, 0]]], 2) == [[[0, 0], [0, 0]]]\", \"assert apply_operation([[[1, 1], [1, 1]]], 1) == [[[2, 2], [2, 2]]]\", \"assert apply_operation([[[10, 20], [30, 40]]], 0) == [[[10, 20], [30, 40]]]\", \"assert apply_operation([[[5, 5], [5, 5...
{ "split": "train", "index": 4880, "acecode_id": "oss_27569", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Develop a function in Python that checks if two lists of strings representing animal categories contain the same elements, regardless of their order. Implement a function called `are_identical(list1, list2)` that takes two lists of strings as input and returns `True` if they co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert are_identical(['cat', 'dog', 'mouse'], ['mouse', 'dog', 'cat']) == True\", \"assert are_identical(['lion', 'tiger'], ['tiger', 'lion']) == True\", \"assert are_identical(['bird', 'fish'], ['fish', 'bird']) == True\", \"assert are_identical(['elephant'], ['el...
{ "split": "train", "index": 4881, "acecode_id": "evol_9943", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that counts the occurrences of each unique word in a given string. A word is defined as a sequence of alphanumeric characters, excluding any punctuation or whitespace. Your function should take a single input string and return a dictionar...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_words('The quick brown fox jumps over the lazy dog. The dog barks, and the fox jumps.') == {'the': 4, 'quick': 1, 'brown': 1, 'fox': 2, 'jumps': 2, 'over': 1, 'lazy': 1, 'dog': 2, 'barks': 1, 'and': 1}\", \"assert count_words('Hello world! Hello everyo...
{ "split": "train", "index": 4882, "acecode_id": "oss_27795", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string s consisting of individual alphabetic characters, and an integer k (where 0 <= k <= s.length), implement a function that first reverses the entire string s and then reverses the order of characters in groups of k. If k is greater than the length of the string, re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_string('apple', 2) == 'leppa'\", \"assert reverse_string('apple', 5) == 'elppa'\", \"assert reverse_string('apple', 0) == 'apple'\", \"assert reverse_string('a', 1) == 'a'\", \"assert reverse_string('', 1) == ''\", \"assert reverse_string('abcdefg', ...
{ "split": "train", "index": 4883, "acecode_id": "evol_34171", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Implement a function that calculates the median and mode of a list of integers, which can include negative numbers. The function should return a tuple containing the median and mode. The function must avoid using built-in functions or sorting the list. The input list can have v...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert median_and_mode([]) == (None, None)\", \"assert median_and_mode([3, 1, 2, 4, 5]) == (3, None)\", \"assert median_and_mode([1, 2, 2, 4, 5]) == (2, 2)\", \"assert median_and_mode([1, 1, 2, 2, 3]) == (2, None)\", \"assert median_and_mode([10, 10, 10, 15, 20]) =...
{ "split": "train", "index": 4884, "acecode_id": "evol_33533", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a string `content` representing a template and a dictionary `context` containing specific values to be rendered within that template. The function should replace placeholders in the `content` string with corresponding value...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert render_template('Hello, {name}!', {'name': 'Alice'}) == 'Hello, Alice!'\", \"assert render_template('Your balance is {balance}.', {'balance': '100 dollars'}) == 'Your balance is 100 dollars.'\", \"assert render_template('The weather is {weather}.', {}) == 'T...
{ "split": "train", "index": 4885, "acecode_id": "bigcode_python_fns_28103", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a nested sequence that can contain integers, lists, or tuples, implement a function `flatten` that returns a single, flat list containing all the elements retrieved from the sequence and all recursively contained sub-sequences. The function should handle any level of nest...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert flatten([1, 2, [3, 4], (5, 6)]) == [1, 2, 3, 4, 5, 6]\", \"assert flatten([[[1, 2, 3], (42, None)], [4, 5], [6], 7, (8, 9, 10)]) == [1, 2, 3, 42, None, 4, 5, 6, 7, 8, 9, 10]\", \"assert flatten([]) == []\", \"assert flatten([1, 2, 3]) == [1, 2, 3]\", \"asser...
{ "split": "train", "index": 4886, "acecode_id": "bigcode_python_fns_38246", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes a list of integers and returns a new list that contains only the unique elements from the original list, maintaining the order of their first occurrence. The function should be named `get_unique_elements`.\nPlease reason step by step, then write a se...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_elements([1, 2, 3, 2, 1, 4]) == [1, 2, 3, 4]\", \"assert get_unique_elements([5, 5, 5, 5]) == [5]\", \"assert get_unique_elements([]) == []\", \"assert get_unique_elements([10, 20, 10, 30, 20, 40]) == [10, 20, 30, 40]\", \"assert get_unique_elemen...
{ "split": "train", "index": 4887, "acecode_id": "evol_19018", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing the names of various counties. Your task is to write a function that takes this list as input and returns a new list containing only the names of counties that start with the prefix 'St.' in alphabetical order. Please implement a fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_counties(['Seminole', 'St. Johns', 'St. Lucie', 'Orange', 'St. Petersburg', 'Santa Rosa']) == ['St. Johns', 'St. Lucie', 'St. Petersburg']\", \"assert filter_counties(['St. Augustine', 'St. George', 'St. Thomas', 'Miami']) == ['St. Augustine', 'St. Ge...
{ "split": "train", "index": 4888, "acecode_id": "oss_25832", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that sorts a list of integers in descending order without using any built-in sorting functions. The function should take a list of integers as input and return a new list that contains the sorted integers in descending order.\nPlease reason step by step, th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bubbleSort([315, 25, 207, 98, 679]) == [679, 315, 207, 98, 25]\", \"assert bubbleSort([10, 1, 0, -1, -10]) == [10, 1, 0, -1, -10]\", \"assert bubbleSort([5]) == [5]\", \"assert bubbleSort([]) == []\", \"assert bubbleSort([3, 3, 3]) == [3, 3, 3]\", \"assert b...
{ "split": "train", "index": 4889, "acecode_id": "evol_28030", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of package recipes, where each recipe is represented as a string. Your task is to filter out and return the list of valid recipes that contain a 'meta.yaml' file. A recipe is considered valid if its name exists in the input list and has a corresponding dire...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_valid_recipes(['recipe1_valid', 'recipe2_invalid', 'recipe3_valid']) == ['recipe1_valid', 'recipe3_valid']\", \"assert filter_valid_recipes(['recipeA_valid', 'recipeB_valid', 'recipeC_invalid']) == ['recipeA_valid', 'recipeB_valid']\", \"assert filter...
{ "split": "train", "index": 4890, "acecode_id": "bigcode_python_fns_21600", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a user profile manager for a web application. The system should allow for adding an email to a user's profile and adding interests to a user. You need to implement a function 'update_user_profile' that takes two parameters: 'bodyUsuario', which ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_user_profile({'user': {'email': '', 'interests': []}}, 'user@example.com', ['sports', 'music']) == {'user': {'email': 'user@example.com', 'interests': ['sports', 'music']}}\", \"assert update_user_profile({'user': {'email': '', 'interests': []}}, 'tes...
{ "split": "train", "index": 4891, "acecode_id": "oss_18898", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `line`, write a function `line_is_root(line)` that determines if the given line represents the root directory in a file system. The root directory is denoted by a forward slash `/` character. If the input string represents the root directory, the function should ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert line_is_root('/') == True\", \"assert line_is_root('/home') == False\", \"assert line_is_root('/user') == False\", \"assert line_is_root('/home/user') == False\", \"assert line_is_root('') == False\", \"assert line_is_root('/../') == False\", \"assert line_i...
{ "split": "train", "index": 4892, "acecode_id": "oss_4716", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a dictionary representation of DICOM image metadata from a given dataset. The dataset is provided as a list of tuples, where each tuple contains the metadata key and its corresponding value. Your function should return a di...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_dicom_metadata([('PatientID', '12345'), ('StudyDate', '2022-01-01'), ('PatientID', '12345'), ('Modality', 'CT')]) == {'PatientID': ['12345', '12345'], 'StudyDate': '2022-01-01', 'Modality': 'CT'}\", \"assert generate_dicom_metadata([('PatientID', '5...
{ "split": "train", "index": 4893, "acecode_id": "bigcode_python_fns_5245", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of non-negative integers, implement a function that sorts the list in ascending order using the Counting Sort algorithm. The function should take a single parameter, which is the list of integers, and return a new list that contains the sorted integers. The input l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert counting_sort([4, 2, 2, 8, 3, 3, 1]) == [1, 2, 2, 3, 3, 4, 8]\", \"assert counting_sort([0, 1, 0, 1, 0]) == [0, 0, 0, 1, 1]\", \"assert counting_sort([5, 4, 3, 2, 1]) == [1, 2, 3, 4, 5]\", \"assert counting_sort([10, 9, 8, 7, 6, 5]) == [5, 6, 7, 8, 9, 10]\",...
{ "split": "train", "index": 4894, "acecode_id": "bigcode_python_fns_8807", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that constructs a URL for updating match information in a tournament management system. The function takes in two parameters: `tournament_id` (a string representing the unique identifier for a tournament) and `match_id` (a string represen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert getUpdateUrl('123', '456') == 'https://api.tournament.com/v1/tournaments/123/matches/456.json'\", \"assert getUpdateUrl('abc', 'def') == 'https://api.tournament.com/v1/tournaments/abc/matches/def.json'\", \"assert getUpdateUrl('tournament1', 'match1') == 'ht...
{ "split": "train", "index": 4895, "acecode_id": "oss_7300", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a function that checks if two given strings consist of the exact same set of words, with each word appearing the same number of times in both strings. The comparison should be case insensitive. Implement the function `verify_word_set_frequency(expression1: str, expressio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert verify_word_set_frequency('apple banana mango', 'Mango banana apple') == True\", \"assert verify_word_set_frequency('hello world hello', 'Hello Hello world') == True\", \"assert verify_word_set_frequency('dog cat', 'cat dog') == True\", \"assert verify_word_...
{ "split": "train", "index": 4896, "acecode_id": "evol_22910", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers and a scalar value, write a function that multiplies each element in the list by the scalar and returns a new list with the results. If the scalar is zero, the function should return a list of zeros of the same length as the input list. Implement the fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert multiply_list_by_scalar([1, 2, 3], 2) == [2, 4, 6]\", \"assert multiply_list_by_scalar([5, 10, 15], 0) == [0, 0, 0]\", \"assert multiply_list_by_scalar([-1, -2, -3], 3) == [-3, -6, -9]\", \"assert multiply_list_by_scalar([0, 0, 0], 5) == [0, 0, 0]\", \"asser...
{ "split": "train", "index": 4897, "acecode_id": "bigcode_python_fns_16864", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `product_of_unique_keys(d: dict) -> int` that calculates the product of all unique dictionary keys converted to integers. The input dictionary may contain non-string keys and values could be nested dictionaries. Only integer-convertible string keys should be co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert product_of_unique_keys({'a': 'b', 'b': 'c'}) == 1\", \"assert product_of_unique_keys({}) == 1\", \"assert product_of_unique_keys({'1': 'a', '1': 'b'}) == 1\", \"assert product_of_unique_keys({'five': 5, 1: 'one', 2: 'two'}) == 2\", \"assert product_of_unique...
{ "split": "train", "index": 4898, "acecode_id": "evol_32849", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with determining whether a given number of tasks have been completed based on a specified limit. Write a function `tasks_completed(completed_tasks: List[int], limit: int) -> bool` that takes in a list of integers `completed_tasks` representing the number of tasks...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert tasks_completed([], 0) == True\", \"assert tasks_completed([1], 1) == True\", \"assert tasks_completed([4, 5], 4) == False\", \"assert tasks_completed([10, 20, 30], 3) == False\", \"assert tasks_completed([1, 1, 1], 3) == True\", \"assert tasks_completed([1,...
{ "split": "train", "index": 4899, "acecode_id": "bigcode_python_fns_15670", "num_tests": 12 }