data_source
large_stringclasses
1 value
prompt
listlengths
1
1
ability
large_stringclasses
1 value
reward_model
dict
extra_info
dict
acecode
[ { "role": "user", "content": "You are given a list of video view lists and a list of collection view lists. Each view list contains the names of users who can view the video, while collection view lists contain users who cannot view it. Implement a function `has_permission(video_view_lists: List[str], colle...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert has_permission(['Alice', 'Bob'], ['Charlie'], ['Bob']) == True\", \"assert has_permission(['Alice', 'Bob'], ['Charlie'], ['Alice']) == True\", \"assert has_permission(['Alice', 'Bob'], ['Charlie'], ['Charlie']) == False\", \"assert has_permission(['Alice'], ...
{ "split": "train", "index": 300, "acecode_id": "bigcode_python_fns_10613", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the interaction with a digital encoder device. The function, `get_encoder_value`, takes an integer `encoder_count` as input. If the `encoder_count` is greater than 0, the function should raise a `PhidgetException`. Othe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_encoder_value(0) == 0\", \"assert get_encoder_value(-1) == -1\", \"assert get_encoder_value(-100) == -100\", \"assert get_encoder_value(0) == 0\", \"assert get_encoder_value(-50) == -50\", \"assert get_encoder_value(-3) == -3\", \"assert get_encoder_valu...
{ "split": "train", "index": 301, "acecode_id": "oss_37166", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a list of positive integers, implement a function that returns a sorted list of all unique elements where the sum of their digits is an even number. The returned list should be sorted in ascending order.\nPlease reason step by step, then write a self-contained Python solu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert odd_sum_elements([1, 2, 3, 4, 5, 6, 7, 8, 9]) == [2, 4, 6, 8]\", \"assert odd_sum_elements([]) == []\", \"assert odd_sum_elements([111, 222, 333]) == [222]\", \"assert odd_sum_elements([1, 2, 3, 4, 5]) == [2, 4]\", \"assert odd_sum_elements([111, 222, 333, 4...
{ "split": "train", "index": 302, "acecode_id": "evol_8614", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are given a 2D array of integers representing coordinates of nodes in a grid. Your task is to implement a function that splits this array into two separate, non-overlapping arrays based on a specified index and axis. The function should take three parameters: the 2D array `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert split([[1, 2], [3, 4]], 1, 0) == ([[1, 2]], [[3, 4]])\", \"assert split([[1, 2], [3, 4]], 1, 1) == ([[1], [3]], [[2], [4]])\", \"assert split([[1, 2, 3], [4, 5, 6]], 1, 0) == ([[1, 2, 3]], [[4, 5, 6]])\", \"assert split([[1, 2, 3], [4, 5, 6]], 2, 1) == ([[1,...
{ "split": "train", "index": 303, "acecode_id": "bigcode_python_fns_22551", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `get_download_basename_song` that generates a formatted filename for a song based on the given artist and song name. The function should take two strings as input: `artist` and `name`. The output should be a string formatted as 'artist - ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_download_basename_song(' Taylor Swift ', ' Love Story ') == 'Taylor Swift - Love Story.mp3'\", \"assert get_download_basename_song('Ed Sheeran', 'Shape of You') == 'Ed Sheeran - Shape of You.mp3'\", \"assert get_download_basename_song(' Ariana Grand...
{ "split": "train", "index": 304, "acecode_id": "oss_3632", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a 2D array of neurons, where each neuron is represented by its coordinates in the format of a list of lists, and a list of corresponding locations that specify the layer each neuron belongs to. Implement a function `get_neurons_in_layer(neurons: List[List[float]],...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_neurons_in_layer([[1, 2], [3, 4], [5, 6], [7, 8]], [[0, 0, 0], [1, 1, 1], [2, 2, 2], [3, 3, 3]], 2) == [[5, 6]]\", \"assert get_neurons_in_layer([[1, 2], [3, 4], [5, 6], [7, 8]], [[0, 0, 0], [1, 1, 1], [2, 2, 2], [3, 3, 3]], 1) == [[3, 4]]\", \"assert ge...
{ "split": "train", "index": 305, "acecode_id": "bigcode_python_fns_32253", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing application credentials for a cloud platform. You need to implement a function that allows users to manage these credentials using a dictionary. Your function should be able to handle the following operations: add a credential, retrieve a credential...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_credentials([('add', 'service1', 'user1', 'pass1'), ('add', 'service2', 'user2', 'pass2'), ('get', 'service1'), ('display')]) == {'service1': {'username': 'user1', 'password': 'pass1'}, 'service2': {'username': 'user2', 'password': 'pass2'}}\", \"asse...
{ "split": "train", "index": 306, "acecode_id": "oss_11422", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of transactions where each transaction is represented as a tuple containing a payee name and an amount, write a function `last_transaction(payee: str, transactions: List[Tuple[str, float]]) -> Optional[float]` that returns the amount of the last transaction made to...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert last_transaction('Alice', [('Alice', 100.0), ('Bob', 150.0), ('Alice', 200.0)]) == 200.0\", \"assert last_transaction('Bob', [('Alice', 100.0), ('Bob', 150.0), ('Alice', 200.0)]) == 150.0\", \"assert last_transaction('Charlie', [('Alice', 100.0), ('Bob', 150...
{ "split": "train", "index": 307, "acecode_id": "bigcode_python_fns_5702", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a bytes-like object representing game data for a cartridge. Your task is to implement a function called `extract_game_title(rom_data: bytes) -> str` that extracts the game title from the given bytes. The game title is a string that appears in the bytes and can be ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_game_title(b'GAME DATA HEADER SUPER MARIOLAND...') == 'SUPER MARIOLAND'\", \"assert extract_game_title(b'RANDOM DATA SUPER MARIO BROS...') == 'SUPER MARIO BROS'\", \"assert extract_game_title(b'NO GAME TITLE HERE...') == 'UNKNOWN GAME'\", \"assert ex...
{ "split": "train", "index": 308, "acecode_id": "bigcode_python_fns_29811", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a list of strings representing names of people, create a function `group_names_by_initial(names: List[str]) -> Dict[str, List[str]]` that groups the names by their initial letter. The keys in the result should be the initial letters, and the values should be lists of name...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert group_names_by_initial(['Alice', 'bob', 'Charlie', 'david', 'Eve']) == {'a': ['Alice'], 'b': ['bob'], 'c': ['Charlie'], 'd': ['david'], 'e': ['Eve']}\", \"assert group_names_by_initial(['Charlie', 'charlie', 'Charlie']) == {'c': ['Charlie', 'charlie', 'Charl...
{ "split": "train", "index": 309, "acecode_id": "bigcode_python_fns_24259", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with checking the success of a remote backup operation. Write a function called `check_remote_backup` that takes a string `host` representing the hostname of the remote server. The function should simulate running a remote backup command on this server and return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_remote_backup('my-backup-server') == True\", \"assert check_remote_backup('production-server') == False\", \"assert check_remote_backup('backup-test') == True\", \"assert check_remote_backup('test-server') == False\", \"assert check_remote_backup('remo...
{ "split": "train", "index": 310, "acecode_id": "bigcode_python_fns_11982", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a user registration function. The function should take in a dictionary containing the user's phone number, two passwords, and an SMS verification code. The registration process includes the following validations: 1) All fields (phone, password, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert register_user({'phone': '1234567890', 'password': 'password123', 'password2': 'password123', 'sms_code': '123456'}) == 'Registration successful'\", \"assert register_user({'phone': '1234567890', 'password': 'password123', 'password2': 'password124', 'sms_cod...
{ "split": "train", "index": 311, "acecode_id": "bigcode_python_fns_28876", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with sanitizing a dataset represented as a dictionary of lists. The dataset contains various columns, some of which are boolean indicators (represented as strings) and others are categorical values. Your function should take this dataset and convert specific bool...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sanitize_data({'has_ir': ['True', 'False', 'True', 'False', 'unknown'], 'extra_chains': ['A', 'B', 'C', 'D', 'E'], 'is_cell': ['True', 'False', 'invalid', 'False', 'True']}) == {'has_ir': ['True', 'False', 'True', 'False', 'None'], 'extra_chains': ['A', 'B',...
{ "split": "train", "index": 312, "acecode_id": "bigcode_python_fns_3542", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the lengths of frames in a sequence and a list of labels corresponding to those frames. Your task is to compute the total loss for the sequence using a simplified version of the CTC loss function. The total loss is computed as follo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_total_loss([1, 2, 3], [0, 1, 2]) == 2.0\", \"assert calculate_total_loss([1, 1, 1, 1], [0, 1, 2, 3]) == 1.0\", \"assert calculate_total_loss([5, 5, 5], [1, 2, 3]) == 5.0\", \"assert calculate_total_loss([], []) == None\", \"assert calculate_total_l...
{ "split": "train", "index": 313, "acecode_id": "bigcode_python_fns_17393", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of log configuration properties and their corresponding values. The function should set the log record format and date format based on the provided properties. If a property is not recognized, the function should raise a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert configure_log_settings([('format', 'JSON'), ('datefmt', '%Y-%m-%d')]) == {'log_record_format': 'JSON', 'log_record_datefmt': '%Y-%m-%d'}\", \"assert configure_log_settings([('format', 'TEXT'), ('datefmt', '%H:%M:%S')]) == {'log_record_format': 'TEXT', 'log_r...
{ "split": "train", "index": 314, "acecode_id": "bigcode_python_fns_5684", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Implement a function `elite_truncation(figure: str, low: int, apex: int) -> Union[int, str]` that takes a string representation of a number (either an integer or a float) and two integers representing the lower and upper bounds. The function should return the nearest integer to...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert elite_truncation('10', 0, 20) == 10\", \"assert elite_truncation('out_of_range', 5, 10) == 'Error: Invalid input.'\", \"assert elite_truncation('25', 0, 20) == 'Error: Out of range.'\", \"assert elite_truncation('3.5', 0, 5) == 4\", \"assert elite_truncation...
{ "split": "train", "index": 315, "acecode_id": "evol_15581", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that can parse a string representation of a Django migration file and extract the names of all the models being created. A Django migration file contains a series of operations to apply to the database schema. Each model creation oper...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_model_names(\\\"migrations.CreateModel(name='Component'), migrations.CreateModel(name='Product'), migrations.CreateModel(name='Order')\\\") == ['Component', 'Product', 'Order']\", \"assert extract_model_names(\\\"migrations.CreateModel(name='User'), ...
{ "split": "train", "index": 316, "acecode_id": "oss_19233", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a nested data structure represented as a dictionary (which may contain lists and other dictionaries), write a function `get_doi(node)` that retrieves the value associated with the key 'DOI' found within lists of dictionaries that are nested under the key 'occurrence'. If ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_doi({'occurrence': [{'type': 'DOI', 'value': '10.1234/example1'}, {'type': 'other', 'value': 'test'}]}) == '10.1234/example1'\", \"assert get_doi({'occurrence': [{'type': 'other', 'value': 'test'}]}) == ''\", \"assert get_doi({'data': {'occurrence': [{'t...
{ "split": "train", "index": 317, "acecode_id": "bigcode_python_fns_33837", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of filenames represented as strings. Each filename contains information encoded in it that can be extracted to identify the sensor ID, image type, test type, and sequence number. Your task is to implement a function `extract_file_info(filenames: List[str]) ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_file_info(['sensor1_typeA_test1_001', 'sensor2_typeB_test2_002']) == [{'sensor_id': 'sensor1', 'imgType': 'typeA', 'testType': 'test1', 'seqNum': '001'}, {'sensor_id': 'sensor2', 'imgType': 'typeB', 'testType': 'test2', 'seqNum': '002'}]\", \"assert ...
{ "split": "train", "index": 318, "acecode_id": "bigcode_python_fns_3715", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Implement a function `generate_fibonacci(n: int, a: int, b: int) -> List[int]` that generates a Fibonacci-like sequence. The function should take three parameters: `n`, the number of terms to generate, and `a` and `b`, which are the first two numbers of the sequence. The functi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_fibonacci(0, 0, 1) == []\", \"assert generate_fibonacci(1, 0, 1) == [0]\", \"assert generate_fibonacci(1, 5, 10) == [5]\", \"assert generate_fibonacci(2, 1, 1) == [1, 1]\", \"assert generate_fibonacci(3, 1, 2) == [1, 2, 3]\", \"assert generate_fibon...
{ "split": "train", "index": 319, "acecode_id": "evol_32987", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function to calculate the Levenshtein Distance between two given strings. The Levenshtein Distance is defined as the minimum number of single-character edits (insertions, deletions, or substitutions) required to change one string into another. For example, the dista...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert levenshtein_distance('kitten', 'sitting') == 3\", \"assert levenshtein_distance('flaw', 'lawn') == 2\", \"assert levenshtein_distance('intention', 'execution') == 5\", \"assert levenshtein_distance('abc', 'abc') == 0\", \"assert levenshtein_distance('abc', '...
{ "split": "train", "index": 320, "acecode_id": "evol_21053", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two arrays of distinct integers, write a function that finds the median of the two arrays without sorting them. You must implement the function `find_median(nums1: List[int], nums2: List[int]) -> float` that takes two lists of integers as input. The arrays may contain bot...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_median([1, 3], [2]) == 2.0\", \"assert find_median([1, 2], [3, 4]) == 2.5\", \"assert find_median([0, 1], [2]) == 1.0\", \"assert find_median([1, 2, 3], [4, 5]) == 3.0\", \"assert find_median([1], [2, 3]) == 2.0\", \"assert find_median([2, 3], [1]) == 2...
{ "split": "train", "index": 321, "acecode_id": "evol_16109", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that calculates the sum of all even numbers in a given list of integers. The function should take a list of integers as input and return the sum of all the even numbers in the list. If there are no even numbers, the function sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_even_numbers([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == 30\", \"assert sum_of_even_numbers([2, 4, 6, 8, 10]) == 30\", \"assert sum_of_even_numbers([1, 3, 5, 7, 9]) == 0\", \"assert sum_of_even_numbers([]) == 0\", \"assert sum_of_even_numbers([0, 1, 2, 3, 4])...
{ "split": "train", "index": 322, "acecode_id": "oss_19507", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function called `report_job_result` that simulates reporting a job result to a testbench system. The function takes a string parameter `job_id`, which is a unique identifier of the job. The function should return a string in the format 'report...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert report_job_result('job123') == 'report_job123'\", \"assert report_job_result('job456') == 'report_job456'\", \"assert report_job_result('test_job') == 'report_test_job'\", \"assert report_job_result('abc') == 'report_abc'\", \"assert report_job_result('xyz12...
{ "split": "train", "index": 323, "acecode_id": "oss_24021", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function called `handle_exception` that simulates a simple exception handler. This function takes two parameters: `request`, a string representing an incoming request, and `exception_type`, a string representing the type of exception that occu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert handle_exception('GET /nonexistent', 'Http404') == 'Handled Http404 for GET /nonexistent'\", \"assert handle_exception('POST /data', 'Http404') == 'Handled Http404 for POST /data'\", \"assert handle_exception('DELETE /resource', 'Http404') == 'Handled Http40...
{ "split": "train", "index": 324, "acecode_id": "bigcode_python_fns_46081", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers representing the heights of bars in a histogram, write a function `max_area(heights: List[int]) -> int` that computes the area of the largest rectangle that can be formed within the histogram. The width of each bar is 1, and the height of the rectangle ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_area([2, 1, 5, 6, 2, 3]) == 10\", \"assert max_area([1, 1, 1, 1, 1]) == 5\", \"assert max_area([0, 2, 0]) == 2\", \"assert max_area([4, 5, 1, 3, 3]) == 8\", \"assert max_area([6, 2, 5, 4, 5, 1, 6]) == 12\", \"assert max_area([1]) == 1\", \"assert max_are...
{ "split": "train", "index": 325, "acecode_id": "bigcode_python_fns_40167", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of points in a 2D plane, implement a function `calculate_smallest_enclosing_circle(points: List[List[int]]) -> float` that returns the radius of the smallest circle that can enclose all the points. The points are represented as a list of lists where each inner list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert abs(calculate_smallest_enclosing_circle([[0,0],[0,5],[5,0],[5,5]]) - 3.53553390593) < 1e-6\", \"assert abs(calculate_smallest_enclosing_circle([[1,1],[-1,-1],[1,-1],[-1,1]]) - 1.41421356237) < 1e-6\", \"assert abs(calculate_smallest_enclosing_circle([[100,10...
{ "split": "train", "index": 326, "acecode_id": "evol_5501", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Create a Python function that extracts alphanumeric characters from a given sentence and identifies the unique words in a case-insensitive manner. The function should discard any punctuation or special symbols and return two lists: one containing the alphanumeric characters and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract('Hello World! 123') == (['H', 'e', 'l', 'l', 'o', 'W', 'o', 'r', 'l', 'd', '1', '2', '3'], ['hello', 'world'])\", \"assert extract('Hello, hello!') == (['H', 'e', 'l', 'l', 'o', 'h', 'e', 'l', 'l', 'o'], ['hello'])\", \"assert extract('Just some text...
{ "split": "train", "index": 327, "acecode_id": "evol_27383", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Implement a function that performs arithmetic operations on a range of integers. You are given two integers n and l, where n is positive and l can be positive or negative. Additionally, you are provided with an integer base in the range [2, 16] (inclusive), a string complexity ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert square_rooting_and_conversion(1, 4, 1, 'squareroot', 2) == -1\", \"assert square_rooting_and_conversion(2, 2, 17, 'squareroot', 2) == -1\", \"assert square_rooting_and_conversion(-1, 2, 10, 'root', 2) == -1\", \"assert square_rooting_and_conversion(0, 3, 10,...
{ "split": "train", "index": 328, "acecode_id": "evol_470", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a chat object that contains a `chat_id` attribute. Your task is to implement a function `get_chat_id(chat)` that returns the chat ID as a string formatted with the prefix 'Chat ID: '. The function should take a single parameter `chat`, which is an object with a pr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_chat_id({'chat_id': 123}) == 'Chat ID: 123'\", \"assert get_chat_id({'chat_id': 456}) == 'Chat ID: 456'\", \"assert get_chat_id({'chat_id': 0}) == 'Chat ID: 0'\", \"assert get_chat_id({'chat_id': -1}) == 'Chat ID: -1'\", \"assert get_chat_id({'chat_id': ...
{ "split": "train", "index": 329, "acecode_id": "bigcode_python_fns_23373", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simple registry system for managing connections. The function should allow for registering, retrieving, and removing connections, as well as checking the existence of a connection. Implement the function `manage_conne...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_connections([('register', 'db', 'mysql://localhost:3306/db')]) == []\", \"assert manage_connections([('register', 'db', 'mysql://localhost:3306/db'), ('exists', 'db', '')]) == [True]\", \"assert manage_connections([('register', 'db', 'mysql://localhos...
{ "split": "train", "index": 330, "acecode_id": "oss_19227", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that filters user activity data based on a specified start date. The function `filter_activities(data, start_date)` should take the following parameters: \n- `data`: A list of dictionaries representing user activity data, where each d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_activities([{'anon_activitytime': '2022-01-15T08:00:00Z', 'activity': 'login'}], '2022-01-16T00:00:00Z') == []\", \"assert filter_activities([{'anon_activitytime': '2022-01-17T08:00:00Z', 'activity': 'logout'}], '2022-01-16T00:00:00Z') == [{'anon_acti...
{ "split": "train", "index": 331, "acecode_id": "oss_28008", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `get_searchable_models` that returns a list of all models from a given list of classes that implement a specific interface called `ISearchable`. The function should accept a list of class definitions and an interface name as inputs. Each ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_searchable_models([{'name': 'User', 'implements': ['IUser', 'ISearchable']}, {'name': 'Product', 'implements': ['IProduct']}, {'name': 'Order', 'implements': ['ISearchable', 'IOrder']}], 'ISearchable') == ['User', 'Order']\", \"assert get_searchable_mode...
{ "split": "train", "index": 332, "acecode_id": "bigcode_python_fns_19623", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the Mean Squared Error (MSE) given two lists of numbers: predictions and targets. The MSE is a measure of the average squared difference between the predicted values and the actual target values. Your function should t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert mean_squared_error([1.0, 2.0, 3.0], [1.0, 2.0, 3.0]) == 0.0\", \"assert mean_squared_error([1.0, 2.0, 3.0], [4.0, 5.0, 6.0]) == 9.0\", \"assert mean_squared_error([0.0, 0.0], [0.0, 0.0]) == 0.0\", \"assert mean_squared_error([1.0, 2.0], [1.0, 2.0, 3.0]) == -...
{ "split": "train", "index": 333, "acecode_id": "oss_10366", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with processing data for photonic integrated circuits (PICs). Each component of the PIC is represented as a dictionary containing the following keys: 'name' (a string for the component's name), 'model' (a string for the model type), 'ports' (a list of strings for...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_component_models([{'name': 'component1', 'model': 'modelA', 'ports': [], 'params': {}}, {'name': 'component2', 'model': 'modelB', 'ports': [], 'params': {}}]) == {'component1': 'modelA', 'component2': 'modelB'}\", \"assert extract_component_models([{...
{ "split": "train", "index": 334, "acecode_id": "oss_18703", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string that may contain HTML tags and excessive whitespace. Your task is to implement a function `normalize_string(s: str) -> str` that normalizes the string by removing all HTML tags and replacing multiple spaces with a single space. The function should also tr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert normalize_string('<p> Hello World! </p>') == 'Hello World!'\", \"assert normalize_string('<div> Python <b>is</b> great!</div>') == 'Python is great!'\", \"assert normalize_string(' <h1>Title</h1> ') == 'Title'\", \"assert normalize_string('No H...
{ "split": "train", "index": 335, "acecode_id": "bigcode_python_fns_39794", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `calculate_sum_of_squares` that returns the sum of the squares of all the integers in the list. The input list can contain both positive and negative integers. The function should handle an empty list by returning 0. \n\nFunction Signa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_sum_of_squares([]) == 0\", \"assert calculate_sum_of_squares([1, 2, 3]) == 14\", \"assert calculate_sum_of_squares([-1, -2, -3]) == 14\", \"assert calculate_sum_of_squares([0, 0, 0]) == 0\", \"assert calculate_sum_of_squares([1, -1]) == 2\", \"asse...
{ "split": "train", "index": 336, "acecode_id": "bigcode_python_fns_24475", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a migration class for a Django application. Your goal is to write a function that generates a Django migration class named `NewMigration` which sets a dependency on a previous migration named `0014_delete_whatsappnumber` from the `page_edits` app. T...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_migration_class().__name__ == 'NewMigration'\", \"assert generate_migration_class().dependencies == [('page_edits', '0014_delete_whatsappnumber')]\", \"assert isinstance(generate_migration_class(), type)\", \"assert 'dependencies' in generate_migrat...
{ "split": "train", "index": 337, "acecode_id": "oss_11119", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers and a shape represented by a tuple that indicates the desired dimensions of a 2D array. Your task is to convert the flat list of integers into a 2D array with the specified shape. If the total number of elements in the list does not match the pr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_2d_array([1, 2, 3, 4, 5, 6], (2, 3)) == [[1, 2, 3], [4, 5, 6]]\", \"assert create_2d_array([1, 2, 3], (1, 3)) == [[1, 2, 3]]\", \"assert create_2d_array([1, 2], (1, 2)) == [[1, 2]]\", \"assert create_2d_array([], (0, 0)) == []\", \"assert create_2d_ar...
{ "split": "train", "index": 338, "acecode_id": "bigcode_python_fns_17195", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of compliance rules and their corresponding results, implement a function that returns a list of compliance results. Each result should contain a rule ID and its compliance status (True for compliant, False for non-compliant). The function should handle pagination ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_compliance_results([(1, True), (2, False), (3, True)], 2) == [{'rule_id': 1, 'compliant': True}, {'rule_id': 2, 'compliant': False}]\", \"assert get_compliance_results([(1, True), (2, True), (3, True), (4, False)], 3) == [{'rule_id': 1, 'compliant': True...
{ "split": "train", "index": 339, "acecode_id": "bigcode_python_fns_33536", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that finds all twin primes within a specified range [start, end). A twin prime is a pair of prime numbers that differ by 2. Your function should return a list of tuples, where each tuple contains a pair of twin primes. If there are no twin primes in the spe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_twin_primes(10, 100) == [(11, 13), (17, 19), (29, 31), (41, 43), (59, 61), (71, 73)]\", \"assert find_twin_primes(1, 50) == [(3, 5), (5, 7), (11, 13), (17, 19), (29, 31), (41, 43)]\", \"assert find_twin_primes(50, 100) == [(59, 61), (71, 73)]\", \"asser...
{ "split": "train", "index": 340, "acecode_id": "evol_35022", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given a list of email aliases, implement a function `get_aliases` that takes a string `email` and returns a list of aliases associated with that email. The function should filter the provided list of aliases based on the given email. Each alias is represented as a dictionary wi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_aliases('a@a.com', [{'email': 'a@a.com', 'alias': 'alias1'}, {'email': 'b@b.com', 'alias': 'alias2'}]) == ['alias1']\", \"assert get_aliases('b@b.com', [{'email': 'a@a.com', 'alias': 'alias1'}, {'email': 'b@b.com', 'alias': 'alias2'}]) == ['alias2']\", \...
{ "split": "train", "index": 341, "acecode_id": "bigcode_python_fns_20346", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `prime_numbers(n: int) -> List[int]` that generates and returns a list of all prime numbers from 0 up to a given maximum limit `n`. The function should be optimized for efficiency and capable of handling large values of `n`, such as 1,000,000 or higher. The...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert prime_numbers(0) == []\", \"assert prime_numbers(1) == []\", \"assert prime_numbers(2) == [2]\", \"assert prime_numbers(3) == [2, 3]\", \"assert prime_numbers(10) == [2, 3, 5, 7]\", \"assert prime_numbers(20) == [2, 3, 5, 7, 11, 13, 17, 19]\", \"assert prime...
{ "split": "train", "index": 342, "acecode_id": "evol_24310", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Write a Python function that calculates the factorial of a number recursively. Additionally, modify the function to return the product of the factorial and the sum of the digits in the number. The sum of digits is found by converting the number to a string, iterating over the s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert factorial_and_sum_product(0) == 0\", \"assert factorial_and_sum_product(1) == 1\", \"assert factorial_and_sum_product(2) == 4\", \"assert factorial_and_sum_product(3) == 18\", \"assert factorial_and_sum_product(4) == 96\", \"assert factorial_and_sum_product(...
{ "split": "train", "index": 343, "acecode_id": "evol_35680", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that retrieves all unique elements from a given list of integers. The function should return a list containing these unique elements in ascending order. Implement the function `get_unique_sorted_elements(arr: List[int]) -> List[int]`,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_sorted_elements([3, 1, 2, 2, 3]) == [1, 2, 3]\", \"assert get_unique_sorted_elements([5, 5, 5, 5]) == [5]\", \"assert get_unique_sorted_elements([]) == []\", \"assert get_unique_sorted_elements([10, 9, 8, 10, 9]) == [8, 9, 10]\", \"assert get_uniq...
{ "split": "train", "index": 344, "acecode_id": "bigcode_python_fns_16945", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of atom names and a mapping of atom names to their 3D coordinates in space. Your task is to implement a function that returns a list of coordinates corresponding to the provided atom names. If an atom name does not exist in the mapping, you should return a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_atom_coordinates(['H', 'O', 'N'], {'H': [1, 0, 0], 'O': [0, 1, 0]}) == [[1, 0, 0], [0, 1, 0], [0, 0, 0]]\", \"assert get_atom_coordinates(['Na', 'Cl'], {'Na': [1, 2, 3]}) == [[1, 2, 3], [0, 0, 0]]\", \"assert get_atom_coordinates([], {'H': [1, 0, 0]}) ==...
{ "split": "train", "index": 345, "acecode_id": "bigcode_python_fns_3412", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that applies Bit Error Rate (BER) to a given input binary string. The BER is a measure of the number of bits that have been altered due to noise, interference, or other imperfections in a communication channel. Your function should si...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert apply_ber('110010', 0.2) != '110010'\", \"assert apply_ber('000000', 0.0) == '000000'\", \"assert apply_ber('111111', 0.0) == '111111'\", \"assert apply_ber('101010', 0.5) != '101010'\", \"assert apply_ber('110011', 0.5) != '110011'\", \"assert apply_ber('11...
{ "split": "train", "index": 346, "acecode_id": "oss_34485", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates an email subject line for notifying local lab staff about a proposal. The function should take a boolean parameter `is_revision` indicating whether the proposal is a revision or a new proposal. If `is_revision` is True, the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_subject(True) == 'Deelkracht: gereviseerde studie gebruikt labfaciliteiten'\", \"assert generate_subject(False) == 'Deelkracht: nieuwe studie gebruikt labfaciliteiten'\", \"assert generate_subject(True) == 'Deelkracht: gereviseerde studie gebruikt l...
{ "split": "train", "index": 347, "acecode_id": "bigcode_python_fns_40396", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Write a function `find_max_even(nums: List[int]) -> int` that returns the maximum even number from the list. If there are no even numbers, return -1. The function should handle empty lists by returning -1 as well. Your solution should only impl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_max_even([1, 3, 5, 7]) == -1\", \"assert find_max_even([2, 4, 6, 8]) == 8\", \"assert find_max_even([1, 2, 3, 4, 5]) == 4\", \"assert find_max_even([10, 15, 20, 25]) == 20\", \"assert find_max_even([]) == -1\", \"assert find_max_even([1, 2, 3, 5, 7]) ==...
{ "split": "train", "index": 348, "acecode_id": "bigcode_python_fns_25399", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary where each value can be of type string, dictionary, or list. Your task is to implement a function `template_dict(input_dict, params_dict)` that replaces placeholders in the string values of the dictionary with corresponding values from a `params_dict`...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert template_dict({'greeting': 'Hello, {name}!', 'details': {'age': '{age}', 'city': '{city}'}}, {'name': 'Alice', 'age': '30', 'city': 'Wonderland'}) == {'greeting': 'Hello, Alice!', 'details': {'age': '30', 'city': 'Wonderland'}}\", \"assert template_dict({'me...
{ "split": "train", "index": 349, "acecode_id": "bigcode_python_fns_8932", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates connecting to a database service. The function should take two parameters: 'service_name' (a string representing the name of the database service, e.g., 'RDS') and 'region' (a string representing the geographical region whe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert connect_to_service('RDS', 'us-west-2') == 'Connecting to RDS in region us-west-2.'\", \"assert connect_to_service('DynamoDB', 'eu-central-1') == 'Connecting to DynamoDB in region eu-central-1.'\", \"assert connect_to_service('S3', 'ap-south-1') == 'Connectin...
{ "split": "train", "index": 350, "acecode_id": "bigcode_python_fns_24297", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a 2D list representing fruit sales data for two days. The structure of the data is as follows: each inner list represents a day, and each element in the inner list represents the sales of a specific fruit. Your task is to implement a function that extracts the sal...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_sales([[1, 2], [3, 4]]) == ([1, 2], [1, 3])\", \"assert extract_sales([[5, 6], [7, 8]]) == ([5, 6], [5, 7])\", \"assert extract_sales([[0, 0], [0, 0]]) == ([0, 0], [0, 0])\", \"assert extract_sales([[10, 20, 30], [40, 50, 60]]) == ([10, 20, 30], [10,...
{ "split": "train", "index": 351, "acecode_id": "oss_35700", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that calculates the geometric mean of a specified numerical array. The function should return the geometric mean as a float. If the array is empty, return 'The array is empty'. If the array contains non-numerical elements, return 'The array contains non-num...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_geometric_mean([1, 2, 3]) == 1.8171205928321397\", \"assert compute_geometric_mean([]) == 'The array is empty'\", \"assert compute_geometric_mean(['a', 1, 2]) == 'The array contains non-numerical elements'\", \"assert compute_geometric_mean([0, 1, 2]...
{ "split": "train", "index": 352, "acecode_id": "evol_12355", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that takes a list of schema definitions in JSON format as input and generates a summary report based on these schemas. Each schema contains information about data structures, such as fields, data types, and constraints. Your fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_report([{'name': {'type': 'string', 'constraints': ['required']}, 'age': {'type': 'integer'}}]) == 'Schema Index: 0\\\\nTotal Number of Fields: 2\\\\nFields:\\\\n- name: string (required)\\\\n- age: integer\\\\n\\\\n'\", \"assert generate_report([{'...
{ "split": "train", "index": 353, "acecode_id": "oss_1639", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers representing the heights of a group of people, write a function `average_height(heights: List[int]) -> float` that calculates the average height of the group. The average height should be computed as the sum of the heights divided by the number of peopl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_height([170, 180, 160]) == 170.0\", \"assert average_height([150, 155, 165, 170]) == 160.0\", \"assert average_height([-1, 0, 1]) == 0.0\", \"assert average_height([180.5, 175.2, 165.0]) == 173.57\", \"assert average_height([]) == 0.0\", \"assert ave...
{ "split": "train", "index": 354, "acecode_id": "bigcode_python_fns_34442", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of named entities represented as strings. Each entity can either be a disease or not based on a predefined list of diseases. Your task is to implement a function that takes in a list of named entities and returns a list of boolean values indicating whether ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_disease(['MONDO:0005737', 'MONDO:0001234']) == [True, False]\", \"assert is_disease(['MONDO:0005737', 'MONDO:0009999']) == [True, False]\", \"assert is_disease(['MONDO:0000001', 'MONDO:0005737', 'MONDO:0000002']) == [False, True, False]\", \"assert is_dis...
{ "split": "train", "index": 355, "acecode_id": "bigcode_python_fns_42934", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer n, return a boolean indicating whether n is a prime number. A prime number is defined as a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. Your function should implement the following logic: check if n is less tha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_prime(2) == True\", \"assert is_prime(3) == True\", \"assert is_prime(4) == False\", \"assert is_prime(5) == True\", \"assert is_prime(6) == False\", \"assert is_prime(7) == True\", \"assert is_prime(8) == False\", \"assert is_prime(9) == False\", \"asser...
{ "split": "train", "index": 356, "acecode_id": "bigcode_python_fns_48858", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists: `point_labels` and `good_data`. The `point_labels` list contains integer values representing unique identifiers associated with points, while `good_data` is a list of objects that need to be associated with these point labels. Your task is to create a f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_flash_data([1, 2, 3], ['A', 'B', 'C']) == [{'flash_id': 1, 'data': 'A'}, {'flash_id': 2, 'data': 'B'}, {'flash_id': 3, 'data': 'C'}]\", \"assert create_flash_data([1, 2, 3], ['A', 'B']) == [{'flash_id': 1, 'data': 'A'}, {'flash_id': 2, 'data': 'B'}, {...
{ "split": "train", "index": 357, "acecode_id": "bigcode_python_fns_44600", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `greet_service(service_name: str) -> str` that takes a service name as input and returns a greeting message in the format 'Hello from {service_name}!' where `{service_name}` is replaced with the value of the input parameter. The function should handle cases...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert greet_service('Service 1') == 'Hello from Service 1!'\", \"assert greet_service('Service 2') == 'Hello from Service 2!'\", \"assert greet_service('Service 3') == 'Hello from Service 3!'\", \"assert greet_service('') == 'Hello from Service!'\", \"assert greet...
{ "split": "train", "index": 358, "acecode_id": "evol_10316", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string representation of a molecule in XYZ format, write a function `xyz_to_atoms_positions(xyz_str: str) -> dict` that returns a dictionary where the keys are the original indices of the atoms in the input XYZ string, and the values are the newly assigned positions bas...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert xyz_to_atoms_positions('3\\\\nH2O\\\\nO 0 0 0\\\\nH 0 0 1\\\\nH 0 1 0') == {0: 0, 1: 1, 2: 2}\", \"assert xyz_to_atoms_positions('4\\\\nMethane\\\\nC 0 0 0\\\\nH 0 0 1\\\\nH 1 0 0\\\\nH 0 1 0') == {0: 0, 1: 1, 2: 2, 3: 3}\", \"assert xyz_to_atoms_positions('...
{ "split": "train", "index": 359, "acecode_id": "bigcode_python_fns_19240", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string containing a list of URLs separated by spaces or commas. Your task is to implement a function that extracts and returns a list of valid URLs. A valid URL is defined as one that starts with 'http://' or 'https://'. Write a function `extract_valid_urls(url_...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_valid_urls('http://example.com, https://test.com, ftp://invalid.com') == ['http://example.com', 'https://test.com']\", \"assert extract_valid_urls('http://example.com http://another-example.com') == ['http://example.com', 'http://another-example.com'...
{ "split": "train", "index": 360, "acecode_id": "bigcode_python_fns_33550", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries, each representing metadata about a trial containing assay records. Each dictionary contains a 'cimac_id' and a list of 'records' which are dictionaries of cell counts for different cell types. Your task is to implement a function `combine_c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert combine_cell_counts([{'cimac_id': 'sample1', 'records': [{'CellSubset': 'T cells', 'Count': 10}, {'CellSubset': 'B cells', 'Count': 5}]}, {'cimac_id': 'sample2', 'records': [{'CellSubset': 'T cells', 'Count': 8}, {'CellSubset': 'NK cells', 'Count': 3}]}]) ==...
{ "split": "train", "index": 361, "acecode_id": "bigcode_python_fns_34821", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes a string as input and replaces all spaces with '%20'. The function should also remove any leading or trailing spaces before the replacement, and it should handle multiple consecutive spaces by replacing them with a single '%20'. The function must be ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert replace_spaces(' Hello World ') == 'Hello%20World'\", \"assert replace_spaces(' Python Programming ') == 'Python%20Programming'\", \"assert replace_spaces(' LeetCode is Great ') == 'LeetCode%20is%20Great'\", \"assert replace_spaces('NoSpacesH...
{ "split": "train", "index": 362, "acecode_id": "evol_15885", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `reverse_string(s: str) -> str` that takes a string `s` as input and returns the string reversed without using slicing or any built-in functions. You must not use any additional libraries or built-in methods for reversing the string.\nPlease reason step by ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_string('hello') == 'olleh'\", \"assert reverse_string('Python') == 'nohtyP'\", \"assert reverse_string('') == ''\", \"assert reverse_string('a') == 'a'\", \"assert reverse_string('abcdef') == 'fedcba'\", \"assert reverse_string('12345') == '54321'\",...
{ "split": "train", "index": 363, "acecode_id": "evol_25410", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of odd integers, which may include negative numbers, implement a function that sorts the array in descending order based on their absolute values. The function should return the sorted array.\nPlease reason step by step, then write a self-contained Python solutio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_odds([-1, -3, -5, -7, -9]) == [-9, -7, -5, -3, -1]\", \"assert sort_odds([1, 3, 5, 7, 9]) == [9, 7, 5, 3, 1]\", \"assert sort_odds([-15, -7, -1, 3, 9]) == [-15, 9, -7, 3, -1]\", \"assert sort_odds([11, -21, 33, -13]) == [33, -21, -13, 11]\", \"assert so...
{ "split": "train", "index": 364, "acecode_id": "evol_31784", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function `decimal_to_binary(n: int) -> str` that converts a decimal integer n into its binary representation as a string. The function should return the binary string without leading zeros. For example, given the input 5, the output should be '101'.\nPlease reason s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert decimal_to_binary(0) == '0'\", \"assert decimal_to_binary(1) == '1'\", \"assert decimal_to_binary(2) == '10'\", \"assert decimal_to_binary(3) == '11'\", \"assert decimal_to_binary(4) == '100'\", \"assert decimal_to_binary(5) == '101'\", \"assert decimal_to_b...
{ "split": "train", "index": 365, "acecode_id": "evol_27276", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of items, implement a function that converts the list into a single string where each item is separated by a comma. The input list can contain integers, strings, or both. The output string should not have any leading or trailing commas. If the input list is empty, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list_to_comma_string([]) == ''\", \"assert list_to_comma_string([1]) == '1'\", \"assert list_to_comma_string(['1']) == '1'\", \"assert list_to_comma_string([1, 2]) == '1,2'\", \"assert list_to_comma_string(['a', 'b']) == 'a,b'\", \"assert list_to_comma_strin...
{ "split": "train", "index": 366, "acecode_id": "bigcode_python_fns_44034", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a password hash in the format 'method$salt$hash', where 'method' can be 'plain', 'md5', or 'sha', and 'salt' is a string used in the hashing process, implement a function `check_password_hash(pwhash: str, password: str) -> bool` to check whether the given password matches...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_password_hash('plain$$default', 'default') == True\", \"assert check_password_hash('sha$$5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'password') == True\", \"assert check_password_hash('sha$$5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'wrong') == False\"...
{ "split": "train", "index": 367, "acecode_id": "bigcode_python_fns_1531", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Your task is to identify the largest prime number in the list and return the sum of its digits. If there are no prime numbers in the list, return 0. The list can contain up to 10^6 elements. Implement the function `largest_prime_digit_sum(arr: ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert largest_prime_digit_sum([0,3,2,1,3,5,7,4,5,5,5,2,181,32,4,32,3,2,32,324,4,3]) == 10\", \"assert largest_prime_digit_sum([1,0,1,8,2,4597,2,1,3,40,1,2,1,2,4,2,5,1]) == 25\", \"assert largest_prime_digit_sum([1,3,1,32,5107,34,83278,109,163,23,2323,32,30,1,9,3])...
{ "split": "train", "index": 368, "acecode_id": "evol_10827", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the coefficients of a polynomial. Your task is to implement a function that evaluates this polynomial at a given integer value. The polynomial is represented in the standard form where the coefficient at index i corresponds to the c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert evaluate_polynomial([1, 0, 2], 3) == 19\", \"assert evaluate_polynomial([0], 5) == 0\", \"assert evaluate_polynomial([4, 1], 1) == 5\", \"assert evaluate_polynomial([1, 2, 3, 4, 5], 0) == 1\", \"assert evaluate_polynomial([1], 10) == 1\", \"assert evaluate_p...
{ "split": "train", "index": 369, "acecode_id": "bigcode_python_fns_41909", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that constructs a dictionary based on a given list of keys. The function should take three parameters: a list of keys, a value that can be either a single value (like an integer, float, string, or None) or a dictionary, and a default valu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_value_dict(['a', 'b', 'c'], 1, 0) == {'a': 1, 'b': 1, 'c': 1}\", \"assert create_value_dict(['x', 'y'], None, 'default') == {'x': 'default', 'y': 'default'}\", \"assert create_value_dict(['key1', 'key2'], {'key1': 100}, 0) == {'key1': 100, 'key2': 0}\...
{ "split": "train", "index": 370, "acecode_id": "bigcode_python_fns_3973", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `acquire_lock` that simulates acquiring a lock on a semaphore for a given count of times. The function should take two parameters: a string `semaphore` representing the name of the semaphore and an integer `count` representing the num...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert acquire_lock('my_semaphore', 1) == 'Lock acquired successfully'\", \"assert acquire_lock('my_semaphore', 2) == 'Lock acquired successfully'\", \"assert acquire_lock('my_semaphore', 3) == 'Lock acquired successfully'\", \"assert acquire_lock('my_semaphore', 4...
{ "split": "train", "index": 371, "acecode_id": "bigcode_python_fns_24010", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that monitors a fictitious banking account's balance. The function should take a list of integers or floating-point numbers representing deposit (+ve numbers) or withdrawal (-ve numbers) operations. The function should return True as ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert below_zero([100, -50, -60], handle_float=False) == True\", \"assert below_zero([100, -50, 75], handle_float=False) == False\", \"assert below_zero([-10], handle_float=False) == True\", \"assert below_zero([100, 100, -300], handle_float=True) == True\", \"ass...
{ "split": "train", "index": 372, "acecode_id": "evol_2886", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a non-negative integer n, write a function that removes all even digits from n and returns the remaining odd digits in descending order as a new integer. If there are no odd digits, return 0.\nPlease reason step by step, then write a self-contained Python solution. Give y...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_even_and_sort(753) == 753\", \"assert remove_even_and_sort(2468) == 0\", \"assert remove_even_and_sort(0) == 0\", \"assert remove_even_and_sort(8024) == 0\", \"assert remove_even_and_sort(9876543210) == 97531\", \"assert remove_even_and_sort(111111) =...
{ "split": "train", "index": 373, "acecode_id": "evol_30046", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that takes a list of integers and returns a new list containing only the even numbers from the original list. The function should preserve the order of the even numbers as they appear in the input list. The function signature i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 21, 32, 43, 54]) == [10, 32, 54]\", \"assert filter_even_numbers([-1, -2, -3, -4]) == [-2, -4]\", \"assert filter_even_numbers([]) == []\", \"assert filter_even_numbers([1, 3...
{ "split": "train", "index": 374, "acecode_id": "oss_18887", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple key-value store in Python. The key-value store should support the following operations: setting a key-value pair, getting the value for a given key, and deleting a key-value pair. Your task is to implement a function `key_value_operatio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert key_value_operations([('set', 'name', 'Alice'), ('set', 'age', 25), ('get', 'name')]) == {'name': 'Alice'}\", \"assert key_value_operations([('set', 'name', 'Alice'), ('get', 'age')]) == {'age': None}\", \"assert key_value_operations([('set', 'name', 'Alice'...
{ "split": "train", "index": 375, "acecode_id": "oss_23256", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to modify a graph data structure based on a set of rules. The graph is represented using an adjacency list, where each key-value pair represents a node and its adjacent nodes. The function should take the graph as input and return the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert modify_graph({}) == {}\", \"assert modify_graph({1: [2], 2: [1], 3: [4], 4: [3]}) == {}\", \"assert modify_graph({1: [2, 3], 2: [1], 3: [1]}) == {}\", \"assert modify_graph({1: [2, 3, 4], 2: [1], 3: [1], 4: [1]}) == {}\", \"assert modify_graph({1: [2], 2: [1...
{ "split": "train", "index": 376, "acecode_id": "oss_1176", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Write a Python function called 'calculate_stats' that takes a list of lists of integers or floats as input and returns a dictionary containing the maximum, minimum, and average values for each sublist. The keys of the dictionary should be the index of the sublist in the input l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_stats([[1, 2, 3], [4, 5, 6]]) == {0: {'max': 3, 'min': 1, 'avg': 2.0}, 1: {'max': 6, 'min': 4, 'avg': 5.0}}\", \"assert calculate_stats([[0, -1, -2], [2.5, 3.5, 4.5]]) == {0: {'max': 0, 'min': -2, 'avg': -1.0}, 1: {'max': 4.5, 'min': 2.5, 'avg': 3....
{ "split": "train", "index": 377, "acecode_id": "evol_4838", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a download request based on specific parameters. The function takes a dictionary as input, where the dictionary contains the following keys: 'year' (an integer representing the year of interest), 'type' (a string representi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert download_request({'year': 1999, 'type': 'text', 'user_id': 1}) == 'Year not available for download.'\", \"assert download_request({'year': 2000, 'type': 'json', 'user_id': 1}) == 'Invalid download type.'\", \"assert download_request({'year': 2021, 'type': 't...
{ "split": "train", "index": 378, "acecode_id": "bigcode_python_fns_35628", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the performance metrics updates for a machine learning training process. Your function should display progress updates and record validation accuracy metrics based on the current iteration index. Implement the function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_performance_metrics(0, 2, MockProgress(), MockWriter(), MockTop1(0.85), MockTop5(0.90), 1, MockValLoader(10)) == 0.85\", \"assert update_performance_metrics(2, 2, MockProgress(), MockWriter(), MockTop1(0.75), MockTop5(0.80), 1, MockValLoader(10)) == 0...
{ "split": "train", "index": 379, "acecode_id": "oss_37506", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `multiplication_table(n: int) -> List[int]` that generates a multiplication table for the given integer `n`. The function should return a list of integers representing the first ten multiples of `n`, starting from `n * 1` to `n * 10`.\nPlease reason step by ste...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert multiplication_table(1) == [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\", \"assert multiplication_table(2) == [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]\", \"assert multiplication_table(3) == [3, 6, 9, 12, 15, 18, 21, 24, 27, 30]\", \"assert multiplication_table(4) == [4, 8, ...
{ "split": "train", "index": 380, "acecode_id": "evol_25830", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `create_star_index(arr: List[int], force: bool) -> List[int]` that creates a star index based on the input list. The star index is defined as a new list where each element is the sum of all previous elements in the input list. If the `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_star_index([1, 2, 3, 4], True) == [0, 1, 3, 6]\", \"assert create_star_index([5, 5, 5], True) == [0, 5, 10]\", \"assert create_star_index([0, 0, 0], True) == [0, 0, 0]\", \"assert create_star_index([1], True) == [0]\", \"assert create_star_index([-1, ...
{ "split": "train", "index": 381, "acecode_id": "bigcode_python_fns_16816", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks if a given word can be constructed from a collection of smaller words (sub-words). The function should take two parameters: a list of words (sub-words) and a target word. Your goal is to determine if the target word can be...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_construct_from_subwords(['cat', 'dog', 'catdog'], 'catdog') == True\", \"assert can_construct_from_subwords(['cat', 'dog', 'fish'], 'catfish') == True\", \"assert can_construct_from_subwords(['hello', 'world'], 'helloworld') == True\", \"assert can_const...
{ "split": "train", "index": 382, "acecode_id": "oss_244", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given an integer value `z`. Your task is to write a function `calculate_x(z)` that returns the value of `x`, where `x` is calculated as `z + 1`. For example, if `z` is 5, the function should return 6, since `x` would be assigned the value of `z + 1`, which is 5 + 1 = 6....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_x(0) == 1\", \"assert calculate_x(1) == 2\", \"assert calculate_x(-1) == 0\", \"assert calculate_x(5) == 6\", \"assert calculate_x(-5) == -4\", \"assert calculate_x(10) == 11\", \"assert calculate_x(-10) == -9\", \"assert calculate_x(100) == 101\",...
{ "split": "train", "index": 383, "acecode_id": "oss_2319", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing a list of authors' names for a library. Each author's name is formatted as 'First Name Last Name'. Write a function `sort_authors_by_last_name` that takes a list of author names as input and returns the list sorted alphabetically by the authors' las...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_authors_by_last_name(['John Smith', 'Alice Johnson', 'David Brown', 'Emily Davis']) == ['David Brown', 'Emily Davis', 'Alice Johnson', 'John Smith']\", \"assert sort_authors_by_last_name(['Zoe Adams', 'Alice Adams', 'Bob Adams']) == ['Alice Adams', 'Bob...
{ "split": "train", "index": 384, "acecode_id": "oss_19265", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing various parameters used in a machine learning model. Your task is to write a function that extracts and returns the unique parameters from the list, while preserving their original order. Write a function `extract_unique_parameters(p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_unique_parameters(['dataset1', 'seed0', 'seed1', 'estimator0', 'estimator1', 'criterion', 'dataset1', 'seed0']) == ['dataset1', 'seed0', 'seed1', 'estimator0', 'estimator1', 'criterion']\", \"assert extract_unique_parameters(['alpha', 'beta', 'alpha'...
{ "split": "train", "index": 385, "acecode_id": "oss_7323", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string of bytes represented as a bytes object and a block size. Your task is to implement a function that splits the given bytes into blocks of the specified size. The function should raise a ValueError if the length of the bytes object is not a multiple of the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert split_bytes_into_blocks(b'abcdef', 2) == [b'ab', b'cd', b'ef']\", \"assert split_bytes_into_blocks(b'abcdefghij', 5) == [b'abcde', b'fghij']\", \"assert split_bytes_into_blocks(b'', 1) == []\", \"assert split_bytes_into_blocks(b'abc', 1) == [b'a', b'b', b'c'...
{ "split": "train", "index": 386, "acecode_id": "bigcode_python_fns_42279", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Implement a function that categorizes prime numbers into two groups based on their digit count within a specified numerical range. The function should take two integers, `range_start` and `range_end`, and return two lists: the first list should contain all single-digit prime nu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert categorize_primes(0, 10) == ([2, 3, 5, 7], [])\", \"assert categorize_primes(0, 20) == ([2, 3, 5, 7], [11, 13, 17, 19])\", \"assert categorize_primes(10, 30) == ([], [11, 13, 17, 19, 23, 29])\", \"assert categorize_primes(20, 50) == ([], [23, 29, 31, 37, 41,...
{ "split": "train", "index": 387, "acecode_id": "evol_388", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the disabling of a service with a specified configuration. The function, `disable_service`, should take two parameters: a boolean `enabled` that indicates whether the service is currently enabled, and an integer `interval` ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert disable_service(True, 1) == {'enabled': False, 'interval': 1}\", \"assert disable_service(True, 5) == {'enabled': False, 'interval': 5}\", \"assert disable_service(True, 10) == {'enabled': False, 'interval': 10}\", \"assert disable_service(True, 0) == {'enab...
{ "split": "train", "index": 388, "acecode_id": "bigcode_python_fns_11239", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of fruit names as input and returns a new list where each fruit name is converted to uppercase. The function should handle an empty list as well. For example, if the input is ['apple', 'banana', 'mango'], the output should be ['APPLE', 'BA...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert make_uppercase(['apple', 'banana', 'mango']) == ['APPLE', 'BANANA', 'MANGO']\", \"assert make_uppercase(['orange', 'kiwi']) == ['ORANGE', 'KIWI']\", \"assert make_uppercase(['grape']) == ['GRAPE']\", \"assert make_uppercase(['watermelon', 'pineapple', 'pear'...
{ "split": "train", "index": 389, "acecode_id": "evol_36045", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two integer arrays `lst1` and `lst2`, determine if it is possible to exchange elements between the two arrays in such a way that all elements in `lst1` become even numbers while preserving the overall sum of both arrays. Return 'YES' if such an exchange is possible, and '...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert modification([2, 4, 6], [1, 3, 5]) == 'YES'\", \"assert modification([1, 2, 3], [4, 5, 6]) == 'NO'\", \"assert modification([4, 6, 8], [1]) == 'YES'\", \"assert modification([1, 2, 4], [3, 5]) == 'NO'\", \"assert modification([1, 3, 5], [2, 4, 6]) == 'YES'\"...
{ "split": "train", "index": 390, "acecode_id": "evol_1084", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a migration for a new model in a web application. The model represents a user's profile and includes fields for the user's name, email, and date of birth. Your task is to write a function that generates the necessary SQL commands to create the datab...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_user_profile_table_sql() == \\\"CREATE TABLE UserProfile (id SERIAL PRIMARY KEY, name VARCHAR(100), email VARCHAR(255), date_of_birth DATE);\\\"\", \"assert generate_user_profile_table_sql() == \\\"CREATE TABLE UserProfile (id SERIAL PRIMARY KEY, na...
{ "split": "train", "index": 391, "acecode_id": "oss_14848", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that generates a test plan ID for a software testing system. The test plan ID should be a combination of the current date and a unique identifier. Implement the function `generate_test_plan_id` that returns the generated test plan ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_test_plan_id().split('-')[2].isalnum()\", \"assert len(generate_test_plan_id()) >= 15\", \"assert generate_test_plan_id() != generate_test_plan_id()\", \"assert 'ABC' not in generate_test_plan_id().split('-')[2]\", \"assert ' ' not in generate_test_...
{ "split": "train", "index": 392, "acecode_id": "oss_24914", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a list of file paths and a specific file extension. Write a function that calculates the total size of all files with the specified extension in a specified unit (KB, MB, GB, TB). The function should ignore files that do not match the specified extension. The size...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_file_sizes(['file1.txt', 'file2.txt', 'file3.py'], 'py', 'KB') == {'file3.py': 0.0}\", \"assert calculate_file_sizes(['file1.py', 'file2.py', 'file3.py'], 'py', 'KB') == {'file1.py': 0.0, 'file2.py': 0.0, 'file3.py': 0.0}\", \"assert calculate_file...
{ "split": "train", "index": 393, "acecode_id": "bigcode_python_fns_14147", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that converts a given number of milliseconds into hours. The function should take an integer representing milliseconds and return the equivalent number of hours as a float. Note that there are 3,600,000 milliseconds in one hour.\nPlease reason step by step,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_milliseconds_to_hours(3600000) == 1.0\", \"assert convert_milliseconds_to_hours(7200000) == 2.0\", \"assert convert_milliseconds_to_hours(1800000) == 0.5\", \"assert convert_milliseconds_to_hours(0) == 0.0\", \"assert convert_milliseconds_to_hours(36...
{ "split": "train", "index": 394, "acecode_id": "evol_21397", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that takes the list as input and returns a new list containing each distinct element from the input list multiplied by 3. The output list should preserve the order of the distinct elements as they first appear in the input list.\nP...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert amplify_elements([1, 2, 3, 2, 5, 3, 7, 1, 9, 5, 7, 9]) == [3, 6, 9, 15, 21, 27]\", \"assert amplify_elements([3, 3, 3]) == [9]\", \"assert amplify_elements([4, 4, 4, 4, 4]) == [12]\", \"assert amplify_elements([1, 2, 1, 2, 1]) == [3, 6]\", \"assert amplify_e...
{ "split": "train", "index": 395, "acecode_id": "evol_21403", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that retrieves the content of a specified file based on a given file path. The function should take in two parameters: a context object which contains authentication tokens and a string representing the file path. Your function should...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_file_content(Context({'tokens': {'access_token': 'token123'}}), 'file1.txt') == 'This is the content of file1.'\", \"assert get_file_content(Context({'tokens': {'access_token': 'token456'}}), 'file2.txt') == 'This is the content of file2.'\", \"assert ge...
{ "split": "train", "index": 396, "acecode_id": "bigcode_python_fns_5739", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with analyzing a dataset containing information about public keys. The dataset is represented as a list of dictionaries, where each dictionary contains information about a public key. Write a function `analyze_public_keys(dataset)` that takes a list of dictionari...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert analyze_public_keys([{'rsa_public_key': {'length': 1024}}, {'rsa_public_key': {'length': 2048}}]) == {'rsa': {1024: 1, 2048: 1}}\", \"assert analyze_public_keys([{'dsa_public_key': {'length': 768}}, {'dsa_public_key': {'length': 768}}]) == {'dsa': {768: 2}}\...
{ "split": "train", "index": 397, "acecode_id": "oss_27737", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings, where each string represents a line of text. Your task is to implement a function `calculate_average_chars_per_line(lines)` that takes this list as input and returns the average number of characters per line, ignoring any leading or trailing whi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average_chars_per_line(['One', 'Two', 'Three']) == 3.6666666666666665\", \"assert calculate_average_chars_per_line(['']) == 0.0\", \"assert calculate_average_chars_per_line(['A', 'B', 'C', 'D']) == 1.0\", \"assert calculate_average_chars_per_line([...
{ "split": "train", "index": 398, "acecode_id": "oss_28379", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that modifies a grid based on certain conditions. The grid is represented as a 2D array of boolean values, where 'True' indicates a filled cell and 'False' indicates an empty cell. Your function should take in the grid and the coordin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert modify_grid([[False, False], [False, False]], 0, 0) == [[True, True], [True, True]]\", \"assert modify_grid([[False, False, True], [False, False, False]], 0, 0) == [[True, True, True], [True, True, False]]\", \"assert modify_grid([[True, True], [True, True]]...
{ "split": "train", "index": 399, "acecode_id": "oss_8832", "num_tests": 6 }