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 function that simulates the selection of computational problem solvers based on user input. Your function should take a string input representing the name of a solver and return the corresponding solver function output based on predefined mappings... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert select_solver('convscorenegv1_solver') == 'Solution from convscorenegv1_solver'\", \"assert select_solver('convscorencev1_solver') == 'Solution from convscorencev1_solver'\", \"assert select_solver('ruberu_solver') == 'Solution from ruberu_solver'\", \"asser... | {
"split": "train",
"index": 68400,
"acecode_id": "oss_6796",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of integers representing two different datasets. Your task is to implement a function that merges these two lists into a single sorted list without using any built-in sorting functions. You should return the merged sorted list. The input lists may contai... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_sorted_lists([1, 3, 5], [2, 4, 6]) == [1, 2, 3, 4, 5, 6]\", \"assert merge_sorted_lists([], [1, 2, 3]) == [1, 2, 3]\", \"assert merge_sorted_lists([5, 10, 15], [1, 2, 3]) == [1, 2, 3, 5, 10, 15]\", \"assert merge_sorted_lists([1, 2, 3], []) == [1, 2, 3... | {
"split": "train",
"index": 68401,
"acecode_id": "bigcode_python_fns_16496",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a custom logging system for a Python application. Your goal is to create a function `create_logger(name)` that initializes and configures a logger instance with the provided name. The logger should log messages at the DEBUG level and format the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_logger('test_logger').name == 'test_logger'\", \"assert create_logger('error_logger').level == logging.DEBUG\", \"assert isinstance(create_logger('info_logger').handlers[0], logging.StreamHandler)\", \"assert create_logger('debug_logger').propagate ==... | {
"split": "train",
"index": 68402,
"acecode_id": "oss_8548",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that marks a string as safe for HTML output and then truncates it after a specific number of characters. Your function, `safe_truncate`, should take two parameters: a string `input_string` and an integer `length`. The function should firs... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert safe_truncate('Hello, World!', 5) == 'Hello'\", \"assert safe_truncate('Hello, World!', 20) == 'Hello, World!'\", \"assert safe_truncate('This is a test string.', 10) == 'This is a '\", \"assert safe_truncate('Short', 10) == 'Short'\", \"assert safe_truncate... | {
"split": "train",
"index": 68403,
"acecode_id": "oss_21214",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that removes all the even numbers from the list and returns the resulting list containing only the odd numbers. The function should maintain the order of the original list. Write a function `remove_even_numbers(num_list)` where `nu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_even_numbers([2, 3, 4, 5, 6, 7, 8, 9, 10]) == [3, 5, 7, 9]\", \"assert remove_even_numbers([1, 2, 3, 4, 5]) == [1, 3, 5]\", \"assert remove_even_numbers([0, 1, 2, 3]) == [1, 3]\", \"assert remove_even_numbers([]) == []\", \"assert remove_even_numbers(... | {
"split": "train",
"index": 68404,
"acecode_id": "evol_23711",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string s, write a function that switches every character at an odd index with the character positioned at the next even index. The function should return the modified string. For example, given the input 'KJfHgEdCbA', the output should be 'JKfHgCdAbE'.\nPlease reason st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert switch_chars('abcdef') == 'badcfe'\", \"assert switch_chars('123456') == '214365'\", \"assert switch_chars('!@#$%^') == '@!$#^%'\", \"assert switch_chars('') == ''\", \"assert switch_chars('ab') == 'ba'\", \"assert switch_chars('abcdefgh') == 'badcfehg'\", \... | {
"split": "train",
"index": 68405,
"acecode_id": "evol_35322",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a Python dictionary, create a function `json_response(data: dict) -> bytes` that converts the dictionary into a JSON string and returns it as a UTF-8 encoded byte string prefixed with HTTP response headers indicating a successful response. The response headers should incl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert json_response({'key': 'value'}) == b'HTTP/1.1 200 OK\\\\r\\\\nContent-Type: application/json\\\\r\\\\n\\\\r\\\\n{\\\\n \\\"key\\\": \\\"value\\\"\\\\n}'\", \"assert json_response({'name': 'Alice', 'age': 30}) == b'HTTP/1.1 200 OK\\\\r\\\\nContent-Type... | {
"split": "train",
"index": 68406,
"acecode_id": "bigcode_python_fns_40999",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of strings representing metadata for Python modules. Each string contains information about a module, including its topic and whether it is zip-safe. Your goal is to extract and organize this information into ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_metadata(['Topic :: A', 'zip_safe=True']) == {'A': True}\", \"assert process_metadata(['Topic :: A', 'zip_safe=True', 'Topic :: B', 'zip_safe=False']) == {'A': True, 'B': False}\", \"assert process_metadata(['Topic :: A', 'zip_safe=False', 'Topic :: ... | {
"split": "train",
"index": 68407,
"acecode_id": "oss_18122",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `data_operations()` that demonstrates the use of the main data types in Python. The function should perform the following operations: add two integers, find the average of two floats, concatenate two strings, merge two lists, create a tuple from three integers,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert data_operations() == {'int_sum': 15, 'float_avg': 8.0, 'string_concat': 'HelloWorld', 'list_merge': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 'tuple_created': (1, 2, 3), 'set_union': {1, 2, 3, 4, 5, 6, 7}, 'dict_value': 2}\", \"assert data_operations() != {'int_sum':... | {
"split": "train",
"index": 68408,
"acecode_id": "evol_29774",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a character's attack abilities in a game. Your task is to implement a function that calculates the number of frames required for an animation based on the following parameters: the number of attacks per second, the length of the base animation in frames, a speed c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_frames_per_animation(1.0, 60, 1.0, 60, True) == 60\", \"assert compute_frames_per_animation(3.0, 45, 1.5, 60, True) == 13\", \"assert compute_frames_per_animation(5.0, 50, 1.0, 60, True) == 12\", \"assert compute_frames_per_animation(10.0, 100, 1.0, ... | {
"split": "train",
"index": 68409,
"acecode_id": "bigcode_python_fns_18280",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with maintaining a histogram of email addresses in a dictionary. Write a function `update_histogram` that takes in a dictionary `hist` representing the current histogram of email addresses and a list `emails` containing email addresses. The function should update... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_histogram({'a@example.com': 2, 'b@example.com': 1}, ['a@example.com', 'c@example.com', 'a@example.com']) == {'a@example.com': 4, 'b@example.com': 1, 'c@example.com': 1}\", \"assert update_histogram({}, ['test@example.com']) == {'test@example.com': 1}\... | {
"split": "train",
"index": 68410,
"acecode_id": "oss_28637",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that validates a list of user data dictionaries against a predefined schema. Each dictionary contains fields: 'name', 'age', and 'email'. The validation rules are as follows: the 'name' must be a string that consists only of alphan... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_user_data([{'name': 'John_Doe', 'age': 30, 'email': 'john.doe@example.com'}]) == []\", \"assert validate_user_data([{'name': 'Jane_Doe', 'age': 25, 'email': 'jane.doe@example.com'}, {'name': 'InvalidEmail', 'age': 30, 'email': 'invalid-email'}]) == ... | {
"split": "train",
"index": 68411,
"acecode_id": "oss_24455",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are building a simple auction system and need to manage bids made by users. Each bid consists of a unique identifier and a bid amount. Write a function `remove_bid_price(bid_list: List[Dict[str, Union[int, float]]]) -> List[Dict[str, int]]` that takes a list of bids, where ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_bid_price([{'id': 1, 'bidprice': 10.0}, {'id': 2, 'bidprice': 20.5}]) == [{'id': 1}, {'id': 2}]\", \"assert remove_bid_price([{'id': 3, 'bidprice': 15.0}]) == [{'id': 3}]\", \"assert remove_bid_price([{'id': 4, 'bidprice': 0.0}, {'id': 5, 'bidprice': ... | {
"split": "train",
"index": 68412,
"acecode_id": "oss_33692",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list containing two strings, each consisting solely of opening '(' and closing ')' parentheses. Your task is to determine if these strings can be concatenated in the provided order to form a valid nested parentheses string. A valid nested parentheses string is d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_nested_parens(['))', '(']) == 'Invalid'\", \"assert validate_nested_parens(['(', ')']) == 'Valid'\", \"assert validate_nested_parens(['(', '(', ')', ')']) == 'Valid'\", \"assert validate_nested_parens(['(', '(', '(', ')', ')', ')']) == 'Valid'\", \"... | {
"split": "train",
"index": 68413,
"acecode_id": "evol_35218",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that manages a collection of benchmarking sessions. The function should accept a list of tuples, where each tuple contains a session ID (a string) and session data (a dictionary). The function should return a dictionary that maps each ses... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_benchmark_sessions([('session1', {'data': 1}), ('session2', {'data': 2}), ('session1', {'data': 3})]) == {'session1': {'data': 3}, 'session2': {'data': 2}}\", \"assert manage_benchmark_sessions([('session1', {'data': 1})]) == {'session1': {'data': 1}}... | {
"split": "train",
"index": 68414,
"acecode_id": "oss_13044",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to write a function `count_even_numbers(nums)` that takes a list of integers and returns the count of even numbers in that list. An even number is defined as any integer that is divisible by 2. For example, given the input list [1,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_even_numbers([1, 2, 3, 4, 5]) == 2\", \"assert count_even_numbers([2, 4, 6, 8]) == 4\", \"assert count_even_numbers([1, 3, 5, 7]) == 0\", \"assert count_even_numbers([-2, -4, -6]) == 3\", \"assert count_even_numbers([0]) == 1\", \"assert count_even_num... | {
"split": "train",
"index": 68415,
"acecode_id": "oss_11180",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a given HTTP response is a plain text response. The function should take two parameters: an integer status code and a string content type. The function should return True if the status code is 200 and the content type is 't... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_plaintext_response(200, 'text/plain') == True\", \"assert is_plaintext_response(200, 'application/json') == False\", \"assert is_plaintext_response(404, 'text/plain') == False\", \"assert is_plaintext_response(500, 'text/html') == False\", \"assert is_pla... | {
"split": "train",
"index": 68416,
"acecode_id": "bigcode_python_fns_5228",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates the completion of a pretest epoch for a machine learning model. The function should take an integer `pretest_idx` as input, which represents the index of the pretest epoch. The function should return a message indica... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pretest_epoch(0) == 'Pretest epoch 0 completed. Models are in evaluation mode.'\", \"assert pretest_epoch(1) == 'Pretest epoch 1 completed. Models are in evaluation mode.'\", \"assert pretest_epoch(2) == 'Pretest epoch 2 completed. Models are in evaluation m... | {
"split": "train",
"index": 68417,
"acecode_id": "oss_25580",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a matrix of size m x n, where each cell contains a distinct integer. Some cells may contain obstacles represented by the value -1. Write a function `spiralTraversal(matrix: List[List[int]]) -> List[int]` that collects the integers in the order of a clockwise spira... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert spiralTraversal([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == [1, 2, 3, 6, 9, 8, 7, 4, 5]\", \"assert spiralTraversal([[1, -1, 3], [4, 5, 6], [7, 8, 9]]) == [1, 3, 6, 9, 8, 7, 4, 5]\", \"assert spiralTraversal([[1, 2], [3, 4]]) == [1, 2, 4, 3]\", \"assert spiralTrav... | {
"split": "train",
"index": 68418,
"acecode_id": "oss_19451",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function `generic_model_to_dict(attr1: Any, attr2: Any, model_type: Optional[str] = None) -> Dict[str, Any]` that simulates the behavior of a generic model's attributes as described below. The function should return a dictionary representation of the mod... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generic_model_to_dict('value1', 'value2') == {'attr1': 'value1', 'attr2': 'value2'}\", \"assert generic_model_to_dict('value3', 'value4', 'TypeA') == {'attr1': 'value3', 'attr2': 'value4', 'model_type': 'TypeA'}\", \"assert generic_model_to_dict(10, 20) == {... | {
"split": "train",
"index": 68419,
"acecode_id": "oss_26998",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the population growth rates of different regions. Your task is to write a function to categorize these growth rates into three groups: positive growth rates, negative growth rates, and zero growth rates. Write a function `categorize... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert categorize_growth_rates([5, -3, 0, 8, -2, 0, 4]) == ([5, 8, 4], [-3, -2], [0, 0])\", \"assert categorize_growth_rates([0, 0, 0]) == ([], [], [0, 0, 0])\", \"assert categorize_growth_rates([-1, -2, -3]) == ([], [-1, -2, -3], [])\", \"assert categorize_growth_... | {
"split": "train",
"index": 68420,
"acecode_id": "oss_23624",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string of comma-separated integers and a ring size. Your task is to implement a function that calculates a hash check based on a specific hashing algorithm. The algorithm works as follows: First, split the input string into a list of integers. Then, create a rin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert computeHashCheck('3,4,1,5', 5) == 12\", \"assert computeHashCheck('1,1,1,1', 5) == 0\", \"assert computeHashCheck('1,0,1', 4) == 0\", \"assert computeHashCheck('1,2,3,4,5,6', 10) == 0\", \"assert computeHashCheck('9,8,7,6,5', 12) == 30\"]}"
} | {
"split": "train",
"index": 68421,
"acecode_id": "bigcode_python_fns_31585",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a hexadecimal value. Your task is to write a function that converts this hexadecimal string into its equivalent decimal integer. If the input string is empty or has invalid characters (not in the range 0-9 or A-F), return -1. The function sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hex_to_decimal('1A') == 26\", \"assert hex_to_decimal('FF') == 255\", \"assert hex_to_decimal('10') == 16\", \"assert hex_to_decimal('0') == 0\", \"assert hex_to_decimal('a') == 10\", \"assert hex_to_decimal('abc') == 2748\", \"assert hex_to_decimal('') == -... | {
"split": "train",
"index": 68422,
"acecode_id": "bigcode_python_fns_49524",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes context information related to tasks and subcontexts. The function should take in a dictionary `daccess` containing context information and return a formatted string based on the number of direct undone tasks and sub... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_context_info({'get_basic_context_tally': lambda: (3, 2)}) == 'This context contains 3 direct undone task(s) and 2 subcontext(s).'\", \"assert process_context_info({'get_basic_context_tally': lambda: (1, 0)}) == 'This context contains 1 direct undone ... | {
"split": "train",
"index": 68423,
"acecode_id": "oss_3779",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python decorator called `log_execution_time`. This decorator should take a single argument, which is the function to be decorated. When the decorated function is called, the decorator should print the name of the function and the time taken fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_execution_time(lambda: time.sleep(0.001)) is not None\", \"assert log_execution_time(lambda: sum(range(1000))) is not None\", \"assert log_execution_time(lambda: [x**2 for x in range(1000)]) is not None\", \"assert log_execution_time(lambda: 'Hello World... | {
"split": "train",
"index": 68424,
"acecode_id": "oss_18053",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string containing only parentheses '(', ')', and any other characters, write a function that finds the length of the longest valid (well-formed) parentheses substring. The parentheses sequence will also contain special characters and integers, which should be ignored wh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert findMaxValid('()') == 2\", \"assert findMaxValid('(()') == 2\", \"assert findMaxValid(')()())') == 4\", \"assert findMaxValid('') == 0\", \"assert findMaxValid('()()') == 4\", \"assert findMaxValid('(((((') == 0\", \"assert findMaxValid(')))))') == 0\", \"as... | {
"split": "train",
"index": 68425,
"acecode_id": "evol_23010",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the lengths of various video frames. Write a function `group_and_sort_frames(frames: List[int]) -> List[List[int]]` that groups the frames by their lengths and sorts each group in ascending order. The output should be a list of list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert group_and_sort_frames([1, 2, 2, 3, 1]) == [[1, 1], [2, 2], [3]]\", \"assert group_and_sort_frames([5, 3, 5, 3, 5]) == [[3, 3], [5, 5, 5]]\", \"assert group_and_sort_frames([]) == []\", \"assert group_and_sort_frames([7, 8, 7, 6, 8]) == [[6], [7, 7], [8, 8]]\... | {
"split": "train",
"index": 68426,
"acecode_id": "bigcode_python_fns_20597",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with analyzing resource usage data for a cloud computing company. Your goal is to identify resources that have exceeded a specified usage threshold based on the percentage of usage relative to a given value. You need to implement a function `analyze_resource_usag... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_resource_usage([{'storage_usage': [100]}, {'storage_usage': [150]}], {'key': 'storage_usage'}, 1000, 15) == []\", \"assert analyze_resource_usage([{'storage_usage': [100, 200]}, {'storage_usage': [300]}], {'key': 'storage_usage'}, 1000, 20) == [Resou... | {
"split": "train",
"index": 68427,
"acecode_id": "oss_1104",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes an array of integers and returns the least common multiple (LCM) of the integers in the array. The function should only accept non-negative integers and the array should contain at least one element. You can assume that the integers in the array ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_lcm_of_array([2, 7, 3]) == 42\", \"assert find_lcm_of_array([4, 5, 6]) == 60\", \"assert find_lcm_of_array([1, 1, 1]) == 1\", \"assert find_lcm_of_array([12, 15]) == 60\", \"assert find_lcm_of_array([21, 6]) == 42\", \"assert find_lcm_of_array([3]) == 3... | {
"split": "train",
"index": 68428,
"acecode_id": "evol_5753",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program that processes and displays information from a set of articles. The program should take in two lists: `headers` and `paragraphs`, where each element in `headers` represents the title of an article and each element in `paragraphs` represent... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert display_articles(['Title 1'], ['Content 1']) == 'Article 1:\\\\nTitle 1\\\\nMore: Content 1\\\\n'\", \"assert display_articles(['Title 1', 'Title 2'], ['Content 1', 'Content 2']) == 'Article 1:\\\\nTitle 1\\\\nMore: Content 1\\\\n\\\\nArticle 2:\\\\nTitle 2\... | {
"split": "train",
"index": 68429,
"acecode_id": "oss_4068",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a behavior-based robot control system in Python. The robot can perform three distinct behaviors: move to a specific point, catch an object, and move back to a specific point. The robot's behaviors are triggered by integer commands that represent... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert robot_behavior(14) == 'Moving to a specific point'\", \"assert robot_behavior(15) == 'Catching an object'\", \"assert robot_behavior(16) == 'Moving back to a specific point'\", \"assert robot_behavior(17) == 'Invalid command'\", \"assert robot_behavior(14) =... | {
"split": "train",
"index": 68430,
"acecode_id": "oss_8529",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that divides two lists element-wise. The function should handle cases where the lists are of different lengths by treating missing elements in the shorter list as zeros. Additionally, it should manage division by zero and ensure that only numeric inputs (intege... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert divide_lists([10, 20, 30], [2, 5, 0]) == [5.0, 4.0, 'Infinity']\", \"assert divide_lists([5, 'a', 15], [1, 2, 3]) == [5.0, 'Error: non-numeric input', 5.0]\", \"assert divide_lists([], [1, 2, 3]) == [0.0, 0.0, 0.0]\", \"assert divide_lists([1.5, 2.5, 3.5], [... | {
"split": "train",
"index": 68431,
"acecode_id": "evol_25508",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that returns a specific backend instance based on a given configuration. The backend instance is determined by a string parameter representing the backend type. Implement a function called `get_backend_instance` that takes one paramet... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_backend_instance('sso') == 'SingleSignOnBackend'\", \"assert get_backend_instance('oauth') == 'OAuthBackend'\", \"assert get_backend_instance('ldap') == 'LDAPBackend'\", \"assert get_backend_instance('token') == 'TokenBackend'\", \"assert get_backend_ins... | {
"split": "train",
"index": 68432,
"acecode_id": "bigcode_python_fns_29592",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with estimating the value of π using a Monte Carlo simulation. Implement a Python function `estimate_pi` that takes two parameters: a boolean `det_eval` which specifies whether to use deterministic evaluation (with a fixed seed for reproducibility), and an intege... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert abs(estimate_pi(True, 1) - 3.14) < 0.1\", \"assert abs(estimate_pi(True, 10) - 3.14) < 0.1\", \"assert abs(estimate_pi(True, 100) - 3.14) < 0.1\", \"assert abs(estimate_pi(False, 1) - 3.14) < 0.1\", \"assert abs(estimate_pi(False, 10) - 3.14) < 0.1\", \"asse... | {
"split": "train",
"index": 68433,
"acecode_id": "oss_5864",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `stop_service()` that simulates stopping a service. The function should perform the following actions: print 'Trying to stop service thread', then print 'Server stopped'. Finally, the function should return `True` to indicate that the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert stop_service() == True\", \"assert stop_service() == True\", \"assert stop_service() == True\", \"assert stop_service() == True\", \"assert stop_service() == True\", \"assert stop_service() == True\", \"assert stop_service() == True\", \"assert stop_service(... | {
"split": "train",
"index": 68434,
"acecode_id": "bigcode_python_fns_31686",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that registers a decorator for a given class. The decorator should take an optional parameter which, when provided, is used as a unique key in a mapping dictionary. The function should return a decorator that, when applied to a function, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert register('MyClass') is not None\", \"assert register('MyClass', 'option1') is not None\", \"assert register('MyClass', get_funcs={'func1': lambda x: x}) is not None\", \"assert register('MyClass', 'option1', {'func2': lambda x: x + 1}) is not None\", \"asser... | {
"split": "train",
"index": 68435,
"acecode_id": "bigcode_python_fns_12785",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of groups represented as strings, a tenant ID which is a string, and optional parameters for a relationship type and pagination. Your task is to implement a function that takes in these three parameters and returns a list of links to these groups, formatted... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_group_links(['group1', 'group2', 'group3'], 'tenant123', 'self', 2, None) == ['https://example.com/tenant123/group1/link', 'https://example.com/tenant123/group2/link']\", \"assert generate_group_links(['group1', 'group2', 'group3'], 'tenant123', 'se... | {
"split": "train",
"index": 68436,
"acecode_id": "bigcode_python_fns_27463",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing locations. Your task is to implement a function that returns the longest location from the list. If there are multiple locations with the same maximum length, return the first one encountered. If the list is empty, return an empty st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longest_location(['Right here. Exactly here.', 'Somewhere over the rainbow', 'In the middle of nowhere']) == 'Somewhere over the rainbow'\", \"assert longest_location(['Beach', 'Mountain', 'Desert']) == 'Mountain'\", \"assert longest_location(['A', 'B', 'C',... | {
"split": "train",
"index": 68437,
"acecode_id": "bigcode_python_fns_19312",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given two lists of latitude and longitude values, write a function that processes these values to create a bounding box defined by a pair of coordinates (min_lat, max_lat, min_lon, max_lon). If the `correct_360` flag is set to True, convert any longitude values greater than 180... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_lat_lon([10, 20, 30], [190, 170, 150], (15, 25, 160, 200), True) == ([20], [170])\", \"assert filter_lat_lon([25, 35, 45], [190, 170, 150], (20, 40, 160, 200), False) == ([25, 35], [190, 170])\", \"assert filter_lat_lon([10, 15, 20], [170, 160, 190], ... | {
"split": "train",
"index": 68438,
"acecode_id": "bigcode_python_fns_9107",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with analyzing a block of text to count the occurrences of specific license URLs. Write a function `countLicenseURLs` that takes a string input representing the text and returns a dictionary containing the count of each unique license URL found in the text. The U... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert countLicenseURLs('No URLs here.') == {}\", \"assert countLicenseURLs('http://www.example.com/licenses/Apache-2.0') == {'http://www.example.com/licenses/apache-2.0': 1}\", \"assert countLicenseURLs('''Sample text with http://example.com/licenses/License-3.0 a... | {
"split": "train",
"index": 68439,
"acecode_id": "oss_5592",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that retrieves information from a given dictionary based on an invitation code. The function should take an invite_code (a string) and a table (a dictionary) as inputs. The dictionary contains invitation codes as keys and their corres... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_invitee_from_table('123', {'123': {'name': 'Alice', 'email': 'alice@example.com'}, '456': {'name': 'Bob', 'email': 'bob@example.com'}}) == {'name': 'Alice', 'email': 'alice@example.com'}\", \"assert get_invitee_from_table('456', {'123': {'name': 'Alice',... | {
"split": "train",
"index": 68440,
"acecode_id": "bigcode_python_fns_20984",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the configuration of a network switch interface. The function should accept three parameters: a string representing the device name, a string representing the interface name, and a string representing the mode (which can be... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert configure_interface_switchport_mode('Switch1', 'GigabitEthernet0/1', 'access') == 'Configuring switchport mode on GigabitEthernet0/1 with mode = access'\", \"assert configure_interface_switchport_mode('Switch2', 'GigabitEthernet0/2', 'trunk') == 'Configuring... | {
"split": "train",
"index": 68441,
"acecode_id": "bigcode_python_fns_18952",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `evaluate(x, y, z)` that takes three integers x, y, and z as input. The function should evaluate the following conditions: If x is greater than y, return the result of x modulo y. If x is less than y, return the result of y modulo x. If x is equal to y and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate(6, 3, 9) == 0\", \"assert evaluate(5, 5, 10) == 9765625\", \"assert evaluate(4, 2, 3) == 0\", \"assert evaluate(0, 0, 0) == 'undefined'\", \"assert evaluate(10, 5, 2) == 0\", \"assert evaluate(2, 2, 3) == 8\", \"assert evaluate(7, 3, 2) == 1\", \"as... | {
"split": "train",
"index": 68442,
"acecode_id": "evol_10456",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `get_station_suffix(station_type: str) -> str` that takes a string representing the type of a space station and returns a corresponding suffix based on the type of station. The suffixes are defined as follows: if the station type contains... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_station_suffix('Planetary Base') == '(P)'\", \"assert get_station_suffix('Starport Alpha') == '(L)'\", \"assert get_station_suffix('Asteroid Mine') == '(AB)'\", \"assert get_station_suffix('Outpost Zeta') == '(M)'\", \"assert get_station_suffix('Carrier ... | {
"split": "train",
"index": 68443,
"acecode_id": "bigcode_python_fns_19100",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two matrices `matrix1` and `matrix2`, both of size m x n, consisting of integers. Your task is to implement a function `getPeak(matrix1, matrix2)` that calculates the peak value based on the element-wise multiplication of the two matrices. The peak value is define... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert getPeak([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == 32\", \"assert getPeak([[0, 0], [0, 0]], [[1, 2], [3, 4]]) == 0\", \"assert getPeak([[1]], [[1]]) == 1\", \"assert getPeak([[10, 20], [30, 40]], [[1, 2], [3, 4]]) == 160\", \"assert getPeak([[1, 1], [1, 1]], [[1... | {
"split": "train",
"index": 68444,
"acecode_id": "oss_28707",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function `average_temperature` that takes a list of daily temperature readings for a week and returns the average temperature for that week. The temperature readings will be given in degrees Celsius and the list will always contain exactly 7 values, each representin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_temperature([20, 22, 19, 23, 21, 20, 22]) == 21.0\", \"assert average_temperature([15, 17, 16, 18, 19, 20, 21]) == 18.0\", \"assert average_temperature([10, 10, 10, 10, 10, 10, 10]) == 10.0\", \"assert average_temperature([17, 18, 19, 20, 21, 22, 23]... | {
"split": "train",
"index": 68445,
"acecode_id": "evol_35651",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a list of migration files represented as strings, where each migration file can either be a direct file name or a reference to another migration file (in the form of 'include: filename'), write a function `find_target_migration_file(migration_files: List[str], index: int)... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_target_migration_file(['file1.xml'], 0) == 'file1.xml'\", \"assert find_target_migration_file(['include: file1.xml'], 0) == 'Invalid Index'\", \"assert find_target_migration_file([], 0) == 'No Files'\", \"assert find_target_migration_file(['include: fil... | {
"split": "train",
"index": 68446,
"acecode_id": "bigcode_python_fns_33583",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a date in the form MM/DD/YY or MM/DD/YYYY, implement a function that returns a tuple containing three integers: the month (MM), the day (DD), and the year (YYYY or YY) in this order. Your function should handle both formats correctly and ensure that the values are parsed ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_date('01/01/20') == (1, 1, 20)\", \"assert parse_date('12/31/1999') == (12, 31, 1999)\", \"assert parse_date('02/28/21') == (2, 28, 21)\", \"assert parse_date('03/15/2022') == (3, 15, 2022)\", \"assert parse_date('07/04/1776') == (7, 4, 1776)\", \"asse... | {
"split": "train",
"index": 68447,
"acecode_id": "bigcode_python_fns_8924",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `hex_to_binary(hex_num: str) -> str` that converts a hexadecimal number (represented as a string) into its binary format (also as a string). The input hexadecimal number will only contain valid hexadecimal characters (0-9, a-f, A-F) and will not have any leadin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hex_to_binary('1') == '1'\", \"assert hex_to_binary('A') == '1010'\", \"assert hex_to_binary('10') == '10000'\", \"assert hex_to_binary('FF') == '11111111'\", \"assert hex_to_binary('0') == '0'\", \"assert hex_to_binary('2F') == '101111'\", \"assert hex_to_b... | {
"split": "train",
"index": 68448,
"acecode_id": "evol_24598",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers that may contain errors, implement a function `cleaned_list` that returns a list of all unique positive integers in the range of 1 to 10 in ascending order. The input list may contain negative integers, zero, positive integers greater than 10, and dupli... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cleaned_list([1, 3, -2, 10, 7, 15, 0, 7, 9, 9, -5, 12]) == [1, 3, 7, 9, 10]\", \"assert cleaned_list([2, 2, 2, 2]) == [2]\", \"assert cleaned_list([-1, -2, -3]) == []\", \"assert cleaned_list([0, 11, 12]) == []\", \"assert cleaned_list([4, 5, 6]) == [4, 5, 6... | {
"split": "train",
"index": 68449,
"acecode_id": "evol_24132",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function `process_numbers` that accepts a list of integers and a string indicating the sorting order ('asc' for ascending and 'desc' for descending). The function should return a sorted list based on the specified order. If the order is not recognized, the function sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_numbers([3, 1, 4, 1, 5, 9], 'asc') == [1, 1, 3, 4, 5, 9]\", \"assert process_numbers([3, 1, 4, 1, 5, 9], 'desc') == [9, 5, 4, 3, 1, 1]\", \"assert process_numbers([10, 20, 30], 'asc') == [10, 20, 30]\", \"assert process_numbers([10, 20, 30], 'desc') ... | {
"split": "train",
"index": 68450,
"acecode_id": "evol_25939",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a configuration dictionary containing details about variables, attributes, and a cmorization table. The input dictionary will have the following structure: \\n - 'cmor_table': a string that represents the name of the c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_cmorization({'cmor_table': 'table1', 'attributes': {}, 'variables': {'var1': {'name': 'Variable 1', 'mip': 'MIP1'}, 'var2': {'name': 'Variable 2', 'mip': 'MIP2'}}, 'custom': {'reference_year': 2020}}) == [{'var': 'var1', 'mip': 'MIP1', 'reference_yea... | {
"split": "train",
"index": 68451,
"acecode_id": "bigcode_python_fns_17438",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two distinct, non-identical input strings, implement a function that merges them by first checking if they are of the same length. If they are not, extend the shorter string by appending '*' until both strings are of equal length. Finally, concatenate the two strings and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_strings('abc', 'defg') == 'abc*defg'\", \"assert merge_strings('Hello', 'World') == 'HelloWorld'\", \"assert merge_strings('apple', 'banana') == 'apple*banana'\", \"assert merge_strings('x', 'yz') == 'x*yz'\", \"assert merge_strings('cat', 'cats') == '... | {
"split": "train",
"index": 68452,
"acecode_id": "evol_18582",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers called `valores`, write a function `count_even_numbers` to count the number of even numbers in this list. The function should take the list of integers `valores` as input and return the count of even numbers in the list. For example, if the input is `va... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_even_numbers([1, 2, 3, 4, 5, 6]) == 3\", \"assert count_even_numbers([0, 1, 2, 3, 4]) == 3\", \"assert count_even_numbers([1, 3, 5, 7, 9]) == 0\", \"assert count_even_numbers([2, 4, 6, 8, 10]) == 5\", \"assert count_even_numbers([-2, -1, 0, 1, 2]) == 3... | {
"split": "train",
"index": 68453,
"acecode_id": "oss_12339",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Construct a function in Python that takes a string as input and returns a new string with all punctuation marks removed. The function should handle any string and effectively eliminate punctuation without altering other characters, including letters, numbers, and whitespace.\nP... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_punctuation('Hello, world!') == 'Hello world'\", \"assert remove_punctuation('Python is fun.') == 'Python is fun'\", \"assert remove_punctuation('What time is it?') == 'What time is it'\", \"assert remove_punctuation('A quick brown fox: jumps over the... | {
"split": "train",
"index": 68454,
"acecode_id": "evol_4375",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Write a function `display_numbers(num: int) -> List[int]` that takes an integer `num` as input and returns a list of integers from 0 to `num - 1`. The function should not solicit input from the user and should directly return the list based on the given integer. If `num` is les... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert display_numbers(5) == [0, 1, 2, 3, 4]\", \"assert display_numbers(0) == []\", \"assert display_numbers(1) == [0]\", \"assert display_numbers(10) == [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\", \"assert display_numbers(-3) == []\", \"assert display_numbers(2) == [0, 1]\... | {
"split": "train",
"index": 68455,
"acecode_id": "evol_33585",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a logging function that controls the output of log messages based on their severity level. Write a function `log_at_level(message_level: int, verbose_level: int, msg: str) -> bool` that takes in the following parameters: \n\n- `message_level` (i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_at_level(5, 3, 'Log this message') == True\", \"assert log_at_level(2, 3, 'Do not log this') == False\", \"assert log_at_level(4, 4, 'Equal levels, do not log') == False\", \"assert log_at_level(7, 5, 'Higher severity, log this') == True\", \"assert log_... | {
"split": "train",
"index": 68456,
"acecode_id": "bigcode_python_fns_10777",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple language detection function in Python. Your function should take a string input representing a piece of text and return the language of the text as a string. The language should be detected using a predefined dictionary of language codes an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert detect_language('Bonjour tout le monde') == 'French'\", \"assert detect_language('Hello everyone') == 'English'\", \"assert detect_language('') == 'Invalid Input'\", \"assert detect_language('') == 'Invalid Input'\", \"assert detect_language('Some random tex... | {
"split": "train",
"index": 68457,
"acecode_id": "oss_15486",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a function `greet_person(name: str) -> int` that takes a string `name` as input and returns the length of the name without using any built-in function or library to calculate the length. The function should not print anything. You should assume that the input `name` w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert greet_person('Jane') == 4\", \"assert greet_person('John Doe') == 8\", \"assert greet_person('Alice') == 5\", \"assert greet_person('Bob') == 3\", \"assert greet_person('Charlie') == 7\", \"assert greet_person('Zoe') == 3\", \"assert greet_person('') == 0\",... | {
"split": "train",
"index": 68458,
"acecode_id": "evol_7459",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `parse_schedule(input_string: str) -> dict` that takes a string consisting of space-separated integers representing priorities for three categories: low, medium, and high. The input string will contain three sections, each prefixed by... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_schedule('low 1 2 3 medium 4 5 high 6') == {'low': [1, 2, 3], 'medium': [4, 5], 'high': [6]}\", \"assert parse_schedule('low 10 20 medium 30 high 40 50') == {'low': [10, 20], 'medium': [30], 'high': [40, 50]}\", \"assert parse_schedule('low 5 medium 6 ... | {
"split": "train",
"index": 68459,
"acecode_id": "bigcode_python_fns_31954",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string that may contain a URL. Your task is to create a function that identifies the first URL in the string and formats it as a clickable hyperlink in HTML format. The function should return the hyperlink if a URL is found, or a message 'No URL found in the inp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_url_as_hyperlink('Visit us at https://example.com for more info') == '<a href=\\\"https://example.com\\\">https://example.com</a>'\", \"assert format_url_as_hyperlink('No URL here!') == 'No URL found in the input string'\", \"assert format_url_as_hype... | {
"split": "train",
"index": 68460,
"acecode_id": "oss_37708",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of numerical values representing the pH levels in a dataset. Some values in this list may be missing (represented by None). Your task is to create a function that replaces all missing pH values with the mean of the non-missing values in the list. You need t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert clean_ph_data([None, None, None]) == []\", \"assert clean_ph_data([5.0, 5.5, 6.0]) == [5.0, 5.5, 6.0]\", \"assert clean_ph_data([None, 10.0, 8.0, None, 7.0]) == [8.333333333333334, 10.0, 8.0, 8.333333333333334, 7.0]\", \"assert clean_ph_data([3.0, None, 4.0,... | {
"split": "train",
"index": 68461,
"acecode_id": "bigcode_python_fns_37562",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that determines whether a webpage is being requested to be rendered without navigation. The function should take a dictionary as input, which simulates the parameters of a GET request. This dictionary may contain a key 'nav' that can be s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_isolated_page({'nav': 'no'}) == True\", \"assert is_isolated_page({'nav': 'yes'}) == False\", \"assert is_isolated_page({'nav': ''}) == False\", \"assert is_isolated_page({}) == False\", \"assert is_isolated_page({'nav': 'maybe'}) == False\", \"assert is_... | {
"split": "train",
"index": 68462,
"acecode_id": "bigcode_python_fns_47238",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the operation of a service daemon with a specific configuration. Your function should take in a boolean parameter `is_active` to represent whether the daemon is running and a string parameter `config_name` which represents ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert run_daemon(True, 'default') == 'Daemon running with default configuration.'\", \"assert run_daemon(False, 'default') == 'Daemon stopped.'\", \"assert run_daemon(True, 'custom') == 'Daemon running with custom configuration.'\", \"assert run_daemon(False, 'cus... | {
"split": "train",
"index": 68463,
"acecode_id": "bigcode_python_fns_31855",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of triplets and returns a dictionary containing the triplets grouped by their phase. Each triplet is represented as a tuple of three elements, where the first element is the phase identifier (a string) and the re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert group_triplets([('A', 1, 10), ('B', 2, 20), ('A', 3, 30), ('C', 4, 40), ('B', 5, 50)]) == {'A': [('A', 1, 10), ('A', 3, 30)], 'B': [('B', 2, 20), ('B', 5, 50)], 'C': [('C', 4, 40)]}\", \"assert group_triplets([]) == {}\", \"assert group_triplets([('X', 1, 't... | {
"split": "train",
"index": 68464,
"acecode_id": "oss_9808",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer n, generate an image represented as a 2D list of size n x n filled with random colors. Each color is represented as a tuple of three integers (R, G, B), where R, G, and B are integers in the range [0, 255]. Implement a function `generate_random_image(n: int) ->... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert len(generate_random_image(2)) == 2\", \"assert len(generate_random_image(2)[0]) == 2\", \"assert len(generate_random_image(3)) == 3\", \"assert len(generate_random_image(3)[0]) == 3\", \"assert all(0 <= color[0] <= 255 for row in generate_random_image(5) for... | {
"split": "train",
"index": 68465,
"acecode_id": "bigcode_python_fns_34918",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_max` that takes two inputs and returns the maximum of the two if both inputs are numbers (either integers or floats). If either input is not a number, the function should return 'Invalid inputs'.\nPlease reason step by step, then write a self-containe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max(3, 4) == 4\", \"assert find_max(5.2, 3.1) == 5.2\", \"assert find_max('foo', 3) == 'Invalid inputs'\", \"assert find_max(7, 'bar') == 'Invalid inputs'\", \"assert find_max('foo', 'bar') == 'Invalid inputs'\", \"assert find_max(10, 10) == 10\", \"ass... | {
"split": "train",
"index": 68466,
"acecode_id": "evol_32401",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that returns the sum of all the integers in the list that are greater than a specified threshold value. The function should ignore any non-integer values in the list. You may assume the list is not empty and the threshold is an integer... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_greater_than_threshold([10, 20, 30], 15) == 50\", \"assert sum_greater_than_threshold([1, 2, 3, 4, 5], 3) == 9\", \"assert sum_greater_than_threshold([5, 'a', 10, None, 15], 7) == 25\", \"assert sum_greater_than_threshold([10, 20, 'b', 30, 40], 25) == 70... | {
"split": "train",
"index": 68467,
"acecode_id": "evol_20484",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function to calculate the total supply of a token given a list of token balances for various addresses. Your function should take a list of integers, where each integer represents the balance of a token for a specific address. The goal ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_total_supply([10, 20, 30]) == 60\", \"assert get_total_supply([0, 0, 0]) == 0\", \"assert get_total_supply([5, 15, 25]) == 45\", \"assert get_total_supply([100, 200, 300]) == 600\", \"assert get_total_supply([1, 2, 3, 4, 5]) == 15\", \"assert get_total_s... | {
"split": "train",
"index": 68468,
"acecode_id": "oss_29584",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of application names. Your task is to implement a function that checks whether each application name in the list has a corresponding definition in a predefined set of applications. If an application name exists, you should return a dictionary containing the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_project_apps(['App1', 'App2']) == ([{'name': 'App1'}, {'name': 'App2'}], {})\", \"assert get_project_apps(['App1', 'App4']) == ([{'name': 'App1'}], {'Missing definition of application': ['App4']})\", \"assert get_project_apps(['App3', 'App5']) == ([{'nam... | {
"split": "train",
"index": 68469,
"acecode_id": "bigcode_python_fns_24353",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function to verify the accuracy of a given item count. You will receive a list of item counts and a target count. Your goal is to determine if the sum of the item counts matches the target count. Write a Python function `verify_item_count` ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert verify_item_count([1, 2, 3], 6) == True\", \"assert verify_item_count([5, 5, 5], 15) == True\", \"assert verify_item_count([0, 0, 0], 0) == True\", \"assert verify_item_count([10, 20, 30], 60) == True\", \"assert verify_item_count([1, 1, 1, 1], 4) == True\",... | {
"split": "train",
"index": 68470,
"acecode_id": "oss_36",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_musician(age: int, name: str, instrument: str, genre: str, start_year: int) -> dict` that simulates the creation of a musician with the specified attributes. The function should return a dictionary with the musician's details and calculate the numbe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_musician(30, 'John Doe', 'Piano', 'Classical', 2000) == {'age': 30, 'name': 'John Doe', 'instrument': 'Piano', 'genre': 'Classical', 'career_years': 22}\", \"assert create_musician(25, 'Alice Smith', 'Guitar', 'Rock', 2015) == {'age': 25, 'name': 'Ali... | {
"split": "train",
"index": 68471,
"acecode_id": "evol_15879",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You need to create a function that generates a full file path for storing or loading a configuration file based on a given run ID. The configuration files are stored in a directory named 'conf', and each configuration file is named with the given run ID followed by the '.ini' e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_conf_path('123') == 'conf/123.ini'\", \"assert get_conf_path('test_run') == 'conf/test_run.ini'\", \"assert get_conf_path('001') == 'conf/001.ini'\", \"assert get_conf_path('abc') == 'conf/abc.ini'\", \"assert get_conf_path('run_2023') == 'conf/run_2023.... | {
"split": "train",
"index": 68472,
"acecode_id": "bigcode_python_fns_33089",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of integers, `flux` and `variance`, representing the flux values and their corresponding variances of a certain astronomical observation. Your task is to calculate the standard deviation of the difference between the flux values of two observations for e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_flux_scatter([5, 5, 5], [0, 0, 0]) == 0.0\", \"assert calculate_flux_scatter([], []) == 0.0\", \"assert calculate_flux_scatter([1, 2, 3], [0, 0, 0]) == 0.0\", \"assert calculate_flux_scatter([0], [1]) == 0.0\", \"assert calculate_flux_scatter([1], ... | {
"split": "train",
"index": 68473,
"acecode_id": "bigcode_python_fns_18828",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a network connection. The function should accept two parameters: `commands`, a list of strings that represent commands to either 'start', 'stop', or 'receive' data, and `data`, a string that represents the data to be re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert network_simulation(['start', 'receive'], 'Hello') == ['Received data: Hello']\", \"assert network_simulation(['start', 'receive', 'stop', 'receive'], 'Hello') == ['Received data: Hello', 'Connection is inactive']\", \"assert network_simulation(['start', 'sta... | {
"split": "train",
"index": 68474,
"acecode_id": "oss_35213",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `sum_of_evens(nums)` that returns the sum of all even numbers in the list. If there are no even numbers, return 0. The input list can contain both positive and negative integers. Please implement the function such that it runs in linea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([2, 4, 6, 8]) == 20\", \"assert sum_of_evens([-2, -4, -6, -8]) == -20\", \"assert sum_of_evens([1, 3, 5, 7]) == 0\", \"assert sum_of_evens([0]) == 0\", \"assert sum_of_evens([1, 2, 3, 4]) == 6\", \"... | {
"split": "train",
"index": 68475,
"acecode_id": "bigcode_python_fns_10167",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the behavior of an asynchronous request handler for a hypothetical web application. The function takes three boolean parameters: `datastore`, `obj_store`, and `log_store`. If `datastore` is True, the function should return ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert async_resources(True, False, False) == 'DynamoDB client available'\", \"assert async_resources(False, True, False) == 'S3 object store available'\", \"assert async_resources(False, False, True) == 'S3 log storage available'\", \"assert async_resources(True, ... | {
"split": "train",
"index": 68476,
"acecode_id": "bigcode_python_fns_31",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "In a simulation with two cars starting from the same point at the same time. Car A is going east at a speed determined by a function speedA = f(t), where t is the time in hours and speedA is in km/h. Car B is going west and is going 25% slower than car A. After n hours, where n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert distanceApart(0, lambda t: 60 * t) == 0\", \"assert distanceApart(1, lambda t: 60 * t) == 105\", \"assert distanceApart(1, lambda t: 0 * t) == 0\", \"assert distanceApart(10, lambda t: 0 * t) == 0\", \"assert distanceApart(3, lambda t: 15 * t) == 78.75\", \"... | {
"split": "train",
"index": 68477,
"acecode_id": "evol_13224",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given a string `sub_s`, write a function `has_prefix(sub_s: str, dictionary: List[str]) -> bool` that checks if there is any word in the provided list of words `dictionary` that starts with the string `sub_s`. The function should return `True` if at least one word starts with `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_prefix('app', ['apple', 'banana', 'application']) == True\", \"assert has_prefix('ban', ['apple', 'banana', 'application']) == True\", \"assert has_prefix('cat', ['dog', 'caterpillar', 'fish']) == True\", \"assert has_prefix('fish', ['dog', 'fishbowl', '... | {
"split": "train",
"index": 68478,
"acecode_id": "bigcode_python_fns_10099",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of file names with a .tex extension. Write a function `process_tex_files(file_names: List[str]) -> List[str]` that takes this list of file names and returns a list of processed job names (without the .tex extension) from the input list. The function should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_tex_files(['project.tex', 'project.tex', 'summary.tex']) == ['project', 'summary']\", \"assert process_tex_files(['presentation.tex', 'notes.txt', 'script.tex']) == ['presentation', 'script']\", \"assert process_tex_files(['test.doc', 'example.tex', ... | {
"split": "train",
"index": 68479,
"acecode_id": "bigcode_python_fns_9000",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that simulates the downloading of model files based on a given model ID and file format. The function should take the following parameters: a string `model_id` representing the ID of the model, and a string `file_format` indicating the for... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert download_model('model123', 'json') == 'Model model123 downloaded as json'\", \"assert download_model('model456', 'xml') == 'Model model456 downloaded as xml'\", \"assert download_model('model789', 'mat') == 'Model model789 downloaded as mat'\", \"assert down... | {
"split": "train",
"index": 68480,
"acecode_id": "bigcode_python_fns_4366",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a simple Tic-Tac-Toe game. Implement a function `play_tic_tac_toe(moves: List[Tuple[int, int]]) -> str` that takes a list of moves, where each move is represented as a tuple containing the row and column index (0-based) of the cell where a player ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert play_tic_tac_toe([(0, 0), (1, 1), (0, 1), (1, 0), (0, 2)]) == 'X'\", \"assert play_tic_tac_toe([(0, 0), (0, 0)]) == 'Invalid move'\", \"assert play_tic_tac_toe([(0, 0), (1, 1), (0, 1), (1, 0), (1, 1)]) == 'Invalid move'\", \"assert play_tic_tac_toe([(0, 0), ... | {
"split": "train",
"index": 68481,
"acecode_id": "bigcode_python_fns_21875",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the compilation of a machine learning model. The function, `compile_model`, takes two floating-point parameters: `learning_rate` and `value_weight`. The function does not need to perform any actual model compilation but... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compile_model(5e-3, 0.5) == {'optimizer': 'Adam', 'loss': {'policy': 'categorical_crossentropy', 'value': 'custom_BCE_loss'}, 'loss_weights': {'policy': 0.5, 'value': 0.5}, 'metrics': {'policy': 'CategoricalAccuracy'}}\", \"assert compile_model(1e-4, 0.75) =... | {
"split": "train",
"index": 68482,
"acecode_id": "bigcode_python_fns_17816",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that simulates retrieving an access token from a cloud environment using a managed identity. The function should take a single string input representing the scope of the token and return a dictionary containing the access token and its exp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_access_token('scope1') == {'access_token': 'AccessToken', 'expires_on': int(time.time()) + 3600}\", \"assert get_access_token('scope2') == {'access_token': 'AccessToken', 'expires_on': int(time.time()) + 3600}\", \"assert get_access_token('scope3') == {'... | {
"split": "train",
"index": 68483,
"acecode_id": "bigcode_python_fns_40598",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function 'create_foo' that accepts a list of numbers and returns an instance of the class 'Foo'. The class 'Foo' should store the provided list in an instance variable. If no list is provided, the class should store an empty list. The class should be defined as foll... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_foo([1, 2, 3]).lst == [1, 2, 3]\", \"assert create_foo([]).lst == []\", \"assert create_foo([5]).lst == [5]\", \"assert create_foo([10, 20]).lst == [10, 20]\", \"assert create_foo([0]).lst == [0]\", \"assert create_foo([-1, -2, -3]).lst == [-1, -2, -3... | {
"split": "train",
"index": 68484,
"acecode_id": "evol_15408",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, write a function that finds the subarray of size 'n' that has the maximum sum and returns this maximum sum. If the array has fewer than 'n' elements, return 0. The function should handle both positive and negative integers.\nPlease reason step by ste... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert maxSumSubArrayOfSizeN([1, -2, 3, -4], 2) == 1\", \"assert maxSumSubArrayOfSizeN([-1, -2, -3, -4], 2) == -3\", \"assert maxSumSubArrayOfSizeN([1, 2, 3, 4, 5], 3) == 12\", \"assert maxSumSubArrayOfSizeN([3, -1, 2, 4, -5], 2) == 6\", \"assert maxSumSubArrayOfSi... | {
"split": "train",
"index": 68485,
"acecode_id": "evol_9434",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates executing a program with given arguments and environment variables. Write a function `execute_program(path: str, args: List[str], env: Dict[str, str]) -> None` that takes in three parameters: `path`, a string representing t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert execute_program('/usr/bin/python', ['script.py', '--option'], {'PATH': '/usr/bin'}) == None\", \"assert execute_program('/bin/bash', ['-c', 'echo Hello'], {'USER': 'test'}) == None\", \"assert execute_program('/usr/local/bin/myapp', [], {'ENV_VAR': 'value'})... | {
"split": "train",
"index": 68486,
"acecode_id": "bigcode_python_fns_21525",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries, where each dictionary contains information about an image or video file, represented by a unique identifier and a caption. Your task is to group these dictionaries by their unique identifier. Implement a function `group_by_visual_id(data: L... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert group_by_visual_id([{'vis_id': '1', 'caption': 'A cat'}, {'vis_id': '2', 'caption': 'A dog'}, {'vis_id': '1', 'caption': 'Another cat'}]) == {'1': [{'vis_id': '1', 'caption': 'A cat'}, {'vis_id': '1', 'caption': 'Another cat'}], '2': [{'vis_id': '2', 'captio... | {
"split": "train",
"index": 68487,
"acecode_id": "bigcode_python_fns_49443",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a rate-limiting function for a web service. The rate limiter should restrict the number of requests a client can make within a specific time interval. Your task is to implement a function `calculate_query_time_in_minutes(max_requests, interval_m... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_query_time_in_minutes(3, 5, 1) == 0\", \"assert calculate_query_time_in_minutes(3, 5, 3) == 0\", \"assert calculate_query_time_in_minutes(3, 5, 5) == 5\", \"assert calculate_query_time_in_minutes(3, 5, 6) == 5\", \"assert calculate_query_time_in_mi... | {
"split": "train",
"index": 68488,
"acecode_id": "oss_36611",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing node centralities in a directed graph, write a function that returns a new list where each element is the minimum centrality between each pair of adjacent nodes in the input list. If the list has less than two elements, return an empty list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert min_centrality_pairs([3, 5, 2, 8]) == [3, 2, 2]\", \"assert min_centrality_pairs([10, 20, 5, 15]) == [10, 5, 5]\", \"assert min_centrality_pairs([1]) == []\", \"assert min_centrality_pairs([]) == []\", \"assert min_centrality_pairs([7, 7, 7]) == [7, 7]\", \"... | {
"split": "train",
"index": 68489,
"acecode_id": "bigcode_python_fns_28710",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `generate_improvised_password()` that constructs an improvised password using only non-alphanumeric symbols and glyphs. The password must contain a minimum of fourteen characters, including at least one numeral, one Greek letter, and one Cyrillic letter. Additi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert len(generate_improvised_password()) >= 14\", \"assert any(char in generate_improvised_password() for char in '\\u03b1\\u03b2\\u03b3\\u03b4\\u03b5\\u03b6\\u03b7\\u03b8\\u03b9\\u03ba\\u03bb\\u03bc\\u03bd\\u03be\\u03bf\\u03c0\\u03c1\\u03c2\\u03c4\\u03c5\\u03c6\... | {
"split": "train",
"index": 68490,
"acecode_id": "evol_18699",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of hexadecimal strings representing memory addresses and their corresponding offsets. Each hexadecimal string contains an offset followed by several memory addresses. Your function should take a string input, spl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_memory_addresses('0x10 0x1A 0x1B 0x1C') == {16: [26, 27, 28]}\", \"assert process_memory_addresses('0x0 0x1 0x2') == {0: [1, 2]}\", \"assert process_memory_addresses('0x1F 0xFF 0xFE') == {31: [255, 254]}\", \"assert process_memory_addresses('0x0 0x0'... | {
"split": "train",
"index": 68491,
"acecode_id": "bigcode_python_fns_6137",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes a list of user dictionaries and performs CRUD operations on a simulated database. Each user dictionary contains 'name' and 'email' keys. The function should create users, read their information, update their email addresses, and delete them fr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert crud_operations([{'name': 'Charlie', 'email': 'charlie@example.com'}]) == [{'name': 'Charlie', 'email': 'charlie@example.com'}]\", \"assert crud_operations([{'name': 'David', 'email': 'david@example.com'}, {'name': 'Eve', 'email': 'eve@example.com'}]) == [{'... | {
"split": "train",
"index": 68492,
"acecode_id": "evol_12838",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `sum_product(numbers)` that returns a tuple containing the sum and the product of the integers in the list. The function should take a single parameter, `numbers`, which is a list of integers. If the list is empty, the function sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_product([1, 2, 3, 4]) == (10, 24)\", \"assert sum_product([5, 5, 5]) == (15, 125)\", \"assert sum_product([-1, -2, -3]) == (-6, -6)\", \"assert sum_product([0, 1, 2]) == (3, 0)\", \"assert sum_product([10]) == (10, 10)\", \"assert sum_product([]) == (0, ... | {
"split": "train",
"index": 68493,
"acecode_id": "evol_16270",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer n, compute the sum of the first n positive integers, and return the result modulo 1234567891. The function should implement a single function that takes an integer n as input and returns the computed sum. For example, for n = 5, the sum is 1 + 2 + 3 + 4 + 5 = 1... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert S(1) == 1\", \"assert S(2) == 3\", \"assert S(3) == 6\", \"assert S(4) == 10\", \"assert S(5) == 15\", \"assert S(6) == 21\", \"assert S(7) == 28\", \"assert S(8) == 36\", \"assert S(9) == 45\", \"assert S(10) == 55\", \"assert S(11) == 66\", \"assert S(12) ... | {
"split": "train",
"index": 68494,
"acecode_id": "evol_15635",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to validate the attributes of a digital library item. The attributes include the title, owner, a list of authorized users, and a boolean flag indicating whether the item is public or not. The function should take in these four paramet... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_library_item('Book1', 'John', ['user1', 'user2'], True) is None\", \"assert validate_library_item('', 'Alice', ['user1', 'user2'], True) == 'The title must not be empty.'\", \"assert validate_library_item('Book1', '', ['user1', 'user2'], True) == 'T... | {
"split": "train",
"index": 68495,
"acecode_id": "oss_27930",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that counts the number of different types of tiles in a given tileset for a tile-based game. The tileset is represented as a 2D array where each element corresponds to a specific tile type, represented by an integer. Your function sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_tiles([[0, 0, 0], [0, 0, 0]]) == {0: 6}\", \"assert count_tiles([[1]]) == {1: 1}\", \"assert count_tiles([[1, 1], [1, 1]]) == {1: 4}\", \"assert count_tiles([[1, 2], [2, 1]]) == {1: 2, 2: 2}\", \"assert count_tiles([]) == {}\", \"assert count_tiles([[1... | {
"split": "train",
"index": 68496,
"acecode_id": "oss_37421",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing the sleep duration of various guards over a series of shifts, write a function `determine_sleepiest_guard(sleep_durations: List[int]) -> int` that returns the guard number who has the maximum total sleep time. Each guard is represented by a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert determine_sleepiest_guard([5, 3, 8, 6, 2, 10]) == 5\", \"assert determine_sleepiest_guard([1, 2, 3, 4, 5]) == 4\", \"assert determine_sleepiest_guard([10, 10, 10, 10]) == 0\", \"assert determine_sleepiest_guard([1, 1, 1, 1, 1]) == 0\", \"assert determine_sle... | {
"split": "train",
"index": 68497,
"acecode_id": "bigcode_python_fns_40524",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `reverse_list` that takes the list as input and returns a new list that contains the elements of the original list in reverse order.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_list([1,2,3,4,5]) == [5,4,3,2,1]\", \"assert reverse_list([]) == []\", \"assert reverse_list([10, 20, 30]) == [30, 20, 10]\", \"assert reverse_list([5]) == [5]\", \"assert reverse_list([-1, -2, -3]) == [-3, -2, -1]\", \"assert reverse_list([1, 3, 2, ... | {
"split": "train",
"index": 68498,
"acecode_id": "evol_190",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D grid represented as a list of lists containing integer values. Each cell in the grid can have a value of either 0 or 255. Your task is to implement a function that adds a 'glider' pattern to the grid. The glider is a specific 3x3 configuration defined as foll... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_glider(0, 0, [[0, 0, 0], [0, 0, 0], [0, 0, 0]]) == None\", \"assert add_glider(1, 1, [[0, 0, 0], [0, 0, 0], [0, 0, 0]]) == None\", \"assert add_glider(0, 0, [[0, 0, 0], [0, 0, 0], [0, 0, 0]]) == None\", \"assert add_glider(2, 2, [[0, 0, 0], [0, 0, 0], [0... | {
"split": "train",
"index": 68499,
"acecode_id": "bigcode_python_fns_22230",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.