data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "Given an array of numbers, implement a function that returns the mode of the array. The mode is defined as the number that appears most frequently in the array. If there are multiple modes, return any one of them. You can assume that the input array will always have at least on... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_mode([1, 2, 2, 3, 4]) == 2\", \"assert find_mode([1, 1, 2, 2, 3]) in [1, 2]\", \"assert find_mode([3, 3, 3, 1, 1, 2]) == 3\", \"assert find_mode([4, 5, 6, 5, 4, 4]) == 4\", \"assert find_mode([10, 20, 30, 20, 10, 30, 30]) == 30\", \"assert find_mode([1]... | {
"split": "train",
"index": 82600,
"acecode_id": "evol_8415",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that generates a list of all prime numbers between a given start and end number, along with their binary representations. The function should take two integers, start and end, as parameters and return a list of tuples, where each tuple contains a prime number a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert primeList(10, 20) == [(11, '1011'), (13, '1101'), (17, '10001'), (19, '10011')]\", \"assert primeList(1, 10) == [(2, '10'), (3, '11'), (5, '101'), (7, '111')]\", \"assert primeList(20, 30) == [(23, '10111'), (29, '11101')]\", \"assert primeList(30, 40) == [(... | {
"split": "train",
"index": 82601,
"acecode_id": "evol_25330",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the identifiers of images. Your task is to generate a list of URLs for these images based on the given identifiers. Each URL should follow the format 'https://konachan.net/post/show/{identifier}'. Write a Python function `generate_i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_image_urls([1000, 1001, 1002]) == ['https://konachan.net/post/show/1000', 'https://konachan.net/post/show/1001', 'https://konachan.net/post/show/1002']\", \"assert generate_image_urls([2000]) == ['https://konachan.net/post/show/2000']\", \"assert ge... | {
"split": "train",
"index": 82602,
"acecode_id": "oss_10833",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function that calculates the factorial of a non-negative integer. The function should accept two optional parameters: the first optional parameter is a power to which the factorial should be raised, and the second optional parameter is a modulo value. If the modulo val... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert factorial(0) == 1\", \"assert factorial(1) == 1\", \"assert factorial(5) == 120\", \"assert factorial(5, 2) == 14400\", \"assert factorial(5, 0) == 1\", \"assert factorial(5, -1) == 1/120\", \"assert factorial(5, 2, 1000) == 400\", \"assert factorial(5, 2, -... | {
"split": "train",
"index": 82603,
"acecode_id": "evol_2072",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of binary hypotheses represented as strings of '0's and '1's, implement a function `max_shatterable_instances(hypotheses: List[str]) -> int` that determines the maximum number of instances that can be shattered by the provided hypothesis space. A hypothesis can sha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_shatterable_instances(['00', '01', '10', '11']) == 2\", \"assert max_shatterable_instances(['01', '10']) == 1\", \"assert max_shatterable_instances(['0000', '1111', '0101', '1010']) == 2\", \"assert max_shatterable_instances(['000', '001', '010', '011', ... | {
"split": "train",
"index": 82604,
"acecode_id": "evol_16846",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a list of bounding boxes and points, write a function that serializes these geometrical objects into a string representation. The function should remove any 'null' values from the serialized output. A bounding box is represented by its coordinates (x_min, y_min, width, he... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert serialize_geometries([(0.0, 0.0, 0.5, None), (1.0, 1.0, None, 1.0)], [(None, None), (0.5, 0.5)]) == 'BoundingBox(0.0,0.0,0.5)BoundingBox(1.0,1.0,1.0)Point(0.5,0.5)'\", \"assert serialize_geometries([(0.1, 0.2, 0.3, None)], [(0.1, 0.1)]) == 'BoundingBox(0.1,0... | {
"split": "train",
"index": 82605,
"acecode_id": "bigcode_python_fns_11068",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple banner printing system. The function should display a banner with a message 'Welcome to Our Application' and must return the banner as a string. Your function should ensure that the banner is visually appealing by ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_banner().startswith('*')\", \"assert 'Welcome to Our Application' in create_banner()\", \"assert create_banner().count('\\\\n') == 1\", \"assert create_banner().splitlines()[0] == '****************************************'\", \"assert create_banner().... | {
"split": "train",
"index": 82606,
"acecode_id": "oss_13572",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a simple banking system. Create a function called `manage_bank_account` that accepts a list of operations to perform on a bank account. Each operation is a tuple containing a string and a number. The string can be 'deposit', 'withdraw', or 'calcul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_bank_account([('deposit', 1000), ('withdraw', 500), ('calculate_interest', 0.05)]) == 525.0\", \"assert manage_bank_account([('deposit', 200), ('withdraw', 100), ('withdraw', 150)]) == 100.0\", \"assert manage_bank_account([('withdraw', 100)]) == 0.0\... | {
"split": "train",
"index": 82607,
"acecode_id": "oss_33501",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the scores of a group of students. Implement a function `calculate_metrics(scores: List[int]) -> Dict[str, float]` that computes the following metrics: the average score, the maximum score, and the minimum score. The function should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_metrics([85, 90, 78, 92, 88]) == {'average': 86.6, 'max': 92, 'min': 78}\", \"assert calculate_metrics([100]) == {'average': 100.0, 'max': 100, 'min': 100}\", \"assert calculate_metrics([60, 70, 80, 90]) == {'average': 75.0, 'max': 90, 'min': 60}\"... | {
"split": "train",
"index": 82608,
"acecode_id": "bigcode_python_fns_20375",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a function that simulates storing data in a database. The function accepts a project name and a function name as inputs and returns a success message if the data is stored successfully. However, there is a chance that the function may encounter a conflict if anoth... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert store_function('project1', 'function1') == 'Data stored successfully'\", \"assert store_function('project2', 'function2') == 'Data stored successfully'\", \"assert store_function('project3', 'function3') == 'Data stored successfully'\", \"assert store_functi... | {
"split": "train",
"index": 82609,
"acecode_id": "bigcode_python_fns_34547",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Please implement a function `transfer_funds(account_from: BankAccount, account_to: BankAccount, amount: float) -> str` that transfers a specified amount of money from one bank account to another. If the source account does not have sufficient balance, raise a custom exception `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transfer_funds(BankAccount(500), BankAccount(100), 200) == 'Transfer successful.'\", \"assert transfer_funds(BankAccount(1000), BankAccount(500), 300) == 'Transfer successful.'\", \"assert transfer_funds(BankAccount(50), BankAccount(50), 50) == 'Transfer suc... | {
"split": "train",
"index": 82610,
"acecode_id": "evol_27224",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a configuration function for a web application. This function should take a string input representing a configuration name, and it should return a dictionary containing the configuration settings for that application environment. The function should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_config('development') == {'DEBUG': True, 'HOST': 'localhost', 'PORT': 5000}\", \"assert create_config('production') == {'DEBUG': False, 'HOST': '0.0.0.0', 'PORT': 80}\", \"assert create_config('testing') == {'DEBUG': True, 'HOST': 'localhost', 'PORT':... | {
"split": "train",
"index": 82611,
"acecode_id": "bigcode_python_fns_45852",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that takes a list of file sizes (in bytes) and their corresponding last modified timestamps (in a specific format) as input. Your function should return a list of strings, where each string contains the file size and the last modif... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_file_info([1024, 2048], ['2023-10-01 12:00:00', '2023-10-02 13:30:00']) == ['Size: 1024 bytes, Last Modified: 2023-10-01 12:00:00', 'Size: 2048 bytes, Last Modified: 2023-10-02 13:30:00']\", \"assert format_file_info([500, 1500, 2500], ['2023-09-15 09... | {
"split": "train",
"index": 82612,
"acecode_id": "oss_6134",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing product data from a JSON object representing product information. Your goal is to write a function `process_product(product_json)` that takes in a dictionary `product_json` containing the following keys: 'dataLayer', 'image', 'price', and 'stock'.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_product({'dataLayer': {'pdt_name': 'Product A'}, 'image': 'http://example.com/image.jpg', 'price': {'salePrice': {'value': '19.99'}}, 'stock': 5}) == {'vendor': 'ExampleVendor', 'product_url': 'http://example.com/product', 'name': 'Product A', 'image... | {
"split": "train",
"index": 82613,
"acecode_id": "oss_24932",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers, `xaxis` and `yaxis`, representing frequency values in MHz and their corresponding power levels respectively, write a function `convert_to_db` that converts the power levels from linear scale to decibels (dB) using the formula `y_dB = 10 * log10(y)`.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_db([10, 20, 30], [1, 10, 100]) == {'data': [(10, 0.0), (20, 10.0), (30, 20.0)], 'peaks': []}\", \"assert convert_to_db([1, 2, 3], [10, 100, 1000], [1]) == {'data': [(1, 10.0), (2, 20.0), (3, 30.0)], 'peaks': [2]}\", \"assert convert_to_db([5, 15, ... | {
"split": "train",
"index": 82614,
"acecode_id": "bigcode_python_fns_17022",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a drag-and-drop functionality for a particle simulation application. You need to create a function called `drag_particle` that takes three parameters: `selected_particle`, `new_x`, and `new_y`. The function should update the position of the `sel... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert drag_particle(particle1, 10, 20) is None\", \"assert drag_particle(particle2, 5, 15) is None\", \"assert drag_particle(particle1, 100, 200) is None\", \"assert drag_particle(None, 10, 20) is None\", \"assert drag_particle(particle1, 25, 30) is None\", \"asse... | {
"split": "train",
"index": 82615,
"acecode_id": "oss_688",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_pivot(lst)` that determines the index of a unique pivot element in a list of integers. The pivot element is defined as the element for which the sum of all elements to its left is equal to the average of all distinct elements to its right. If no such ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_pivot([0, 1, 2, 3, 4]) == -1\", \"assert find_pivot([10, 20, 30, 40, 50]) == -1\", \"assert find_pivot([4, 3, 2, 1, 0]) == -1\", \"assert find_pivot([1, 2, 3, 4, 5, 6, 7, 8]) == -1\", \"assert find_pivot([5, 10, 15, 20]) == -1\", \"assert find_pivot([1,... | {
"split": "train",
"index": 82616,
"acecode_id": "evol_16156",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a list of action identifiers represented as strings, where each identifier is formatted as 'id=value'. Your task is to sort these actions based on their order in the input list and assign a position to each action starting from 10 and incrementing by 10 for each s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_actions(['id1=1', 'id2=2', 'id3=3']) == {'message': 'The actions have been sorted.', 'positions': {'1': 10, '2': 20, '3': 30}}\", \"assert sort_actions(['id1=10', 'id2=20']) == {'message': 'The actions have been sorted.', 'positions': {'10': 10, '20': 2... | {
"split": "train",
"index": 82617,
"acecode_id": "bigcode_python_fns_15552",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary where each key is a bead ID and each value is a list of atom IDs associated with that bead. Additionally, you are given a mapping type, either 'COM' (Center of Mass) or 'COG' (Center of Geometry). Your task is to create two dictionaries: one that maps... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_beads_atom_groups({'bead1': [0, 1], 'bead2': [2]}, 'COM', {'bead1': 2.0, 'bead2': 3.0}, {0: 1.0, 1: 1.5, 2: 2.0}) == ({'bead1': [0, 1], 'bead2': [2]}, {'bead1': [2.0, 3.0], 'bead2': [6.0]})\", \"assert get_beads_atom_groups({'bead1': [0, 1], 'bead2': [2]... | {
"split": "train",
"index": 82618,
"acecode_id": "bigcode_python_fns_777",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes in a count and a link, and returns a dictionary representation of a 'Links' model. The model should have two keys: 'count' for the number of items, and 'link' for a URL. Your function should be named 'create_links_model' an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_links_model(5, 'http://example.com') == {'count': 5, 'link': 'http://example.com'}\", \"assert create_links_model(0, None) == {'count': 0, 'link': ''}\", \"assert create_links_model(None, 'http://example.com') == {'count': 0, 'link': 'http://example.c... | {
"split": "train",
"index": 82619,
"acecode_id": "oss_27254",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers where each integer represents the height of a bar in a histogram. Write a function `max_histogram_area(heights: List[int]) -> int` that calculates the area of the largest rectangle that can be formed within the histogram. The function should ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_histogram_area([2, 1, 5, 6, 2, 3]) == 10\", \"assert max_histogram_area([1, 1, 1, 1]) == 4\", \"assert max_histogram_area([4, 2, 0, 3, 2, 5]) == 6\", \"assert max_histogram_area([1, 2, 3, 4, 5]) == 9\", \"assert max_histogram_area([5, 4, 3, 2, 1]) == 9\"... | {
"split": "train",
"index": 82620,
"acecode_id": "bigcode_python_fns_29307",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that merges two lists of integers into a single list. The first list contains audio track samples, while the second list contains video frame data. The merged list should contain elements from both lists, alternating between elements from... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_audio_video([1, 2, 3], [4, 5, 6]) == [1, 4, 2, 5, 3, 6]\", \"assert merge_audio_video([1, 2], [3, 4, 5, 6]) == [1, 3, 2, 4, 5, 6]\", \"assert merge_audio_video([], [1, 2, 3]) == [1, 2, 3]\", \"assert merge_audio_video([1, 2, 3], []) == [1, 2, 3]\", \"a... | {
"split": "train",
"index": 82621,
"acecode_id": "bigcode_python_fns_48939",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing items. Your task is to implement a function `classify_items_based_on_length` that takes in this list of items and a minimum length threshold. The function should return a dictionary where each key is an item from the list, and the co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert classify_items_based_on_length(['a', 'b', 'c'], 1) == {'a': [], 'b': [], 'c': []}\", \"assert classify_items_based_on_length(['hello', 'world'], 4) == {'hello': ['world'], 'world': ['hello']}\", \"assert classify_items_based_on_length(['x', 'y', 'z'], 0) == ... | {
"split": "train",
"index": 82622,
"acecode_id": "oss_16076",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function `lowest_common_multiple(x: int, y: int) -> int` that takes two positive integers `x` and `y` as input and returns their Lowest Common Multiple (LCM). The LCM of two integers is the smallest positive integer that is divisible by both numbers. You may not use... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lowest_common_multiple(1, 1) == 1\", \"assert lowest_common_multiple(4, 5) == 20\", \"assert lowest_common_multiple(7, 3) == 21\", \"assert lowest_common_multiple(12, 15) == 60\", \"assert lowest_common_multiple(9, 6) == 18\", \"assert lowest_common_multiple... | {
"split": "train",
"index": 82623,
"acecode_id": "evol_19421",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers, implement a function that returns a new list containing the elements that are present in both lists (i.e., the intersection of the two lists). The output list should contain only unique elements and should be sorted in ascending order. You may assum... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert intersection([2, 5, 9, 12, 17], [3, 5, 9, 10]) == [5, 9]\", \"assert intersection([1, 2, 3], [4, 5, 6]) == []\", \"assert intersection([], [1, 2, 3]) == []\", \"assert intersection([1, 1, 1], [1, 1, 1]) == [1]\", \"assert intersection([10, 20, 30], [30, 40, ... | {
"split": "train",
"index": 82624,
"acecode_id": "evol_20312",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating the creation of website objects. Implement a function called `create_and_log_site` that takes in two parameters: `name` (a string) and `slug` (a string). The function should create a website object with the given name and slug, and then return a s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_and_log_site('Site One', 'site-one') == 'Successfully created a new site: Site One'\", \"assert create_and_log_site('Site Two', 'site-two') == 'Successfully created a new site: Site Two'\", \"assert create_and_log_site('My Blog', 'my-blog') == 'Succes... | {
"split": "train",
"index": 82625,
"acecode_id": "oss_6106",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that copies sketches of nucleotides and peptides based on their respective sketch IDs. The function should take in two lists of sketch IDs, one for nucleotides and one for peptides, and return a combined list of all sketch IDs. Additi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert copy_sketches(['nuc1', 'nuc2'], ['pep1', 'pep2'], ['nuc1', 'pep1']) == ['nuc1', 'pep1']\", \"assert copy_sketches(['nucA', 'nucB', 'nucC'], ['pepX', 'pepY'], ['nucB', 'pepY']) == ['nucB', 'pepY']\", \"assert copy_sketches(['nuc1'], ['pep1'], ['nuc1', 'pep1']... | {
"split": "train",
"index": 82626,
"acecode_id": "bigcode_python_fns_4281",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `solve_expression(expression: str) -> str` that takes a string representing a complex mathematical expression. The expression can include parentheses to dictate order of operations and may contain the basic mathematical operations: addition (+), subtraction... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert solve_expression('3 + 2 * 4') == '11.00'\", \"assert solve_expression('(2 + 3) * (4 - 1)') == '15.00'\", \"assert solve_expression('10 / 2 + 5') == '10.00'\", \"assert solve_expression('7 * (3 + 2)') == '35.00'\", \"assert solve_expression('10 + 2 * (3 + 5)'... | {
"split": "train",
"index": 82627,
"acecode_id": "evol_12310",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a list of floating-point numbers representing cross-section values, implement a function that computes the average of the cross-section values at a specific energy point, which defaults to 14.2 MeV. The function should also accept a boolean flag that determines whether to... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_average([1.0, 2.0, 3.0]) == 2.0\", \"assert compute_average([1.0, 2.0, 3.0], 14.2) == 2.0\", \"assert compute_average([1.0, 2.0, 3.0], include_uncertainty=True, uncertainty=1.0) == 3.0\", \"assert compute_average([0.0, 0.0, 0.0]) == 0.0\", \"assert c... | {
"split": "train",
"index": 82628,
"acecode_id": "bigcode_python_fns_17552",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `convert_time_12_to_24(time_str: str) -> str` that converts a time given in 12-hour format (with AM/PM) to military (24-hour) time format. The input `time_str` is a string formatted as 'hh:mm AM' or 'hh:mm PM', where 'hh' is the hour (01 to 12), 'mm' is the min... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_time_12_to_24('12:00 AM') == '00:00'\", \"assert convert_time_12_to_24('12:30 AM') == '00:30'\", \"assert convert_time_12_to_24('01:00 AM') == '01:00'\", \"assert convert_time_12_to_24('11:59 AM') == '11:59'\", \"assert convert_time_12_to_24('12:00 P... | {
"split": "train",
"index": 82629,
"acecode_id": "evol_1955",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a Python function that calculates the day of the week for a given date in the Gregorian calendar. The function should take three integers as input parameters: day, month, and year. It should return the name of the day (e.g., 'Sunday', 'Monday', etc.) if the date is va... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert day_of_week(1, 1, 2023) == 'Sunday'\", \"assert day_of_week(29, 2, 2020) == 'Saturday'\", \"assert day_of_week(31, 12, 1999) == 'Friday'\", \"assert day_of_week(15, 8, 1947) == 'Friday'\", \"assert day_of_week(30, 4, 2021) == 'Friday'\", \"assert day_of_week... | {
"split": "train",
"index": 82630,
"acecode_id": "evol_29712",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `binary_to_unicode(binary_str: str, bit_endianness: str = 'big') -> str` that converts a provided sequence of binary values into their corresponding Unicode symbols. The input `binary_str` is a space-separated string of binary values, and the optional param... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binary_to_unicode('01000001', 'big') == 'A'\", \"assert binary_to_unicode('01000001 01000010', 'big') == 'AB'\", \"assert binary_to_unicode('01000001 01000010 01000011', 'big') == 'ABC'\", \"assert binary_to_unicode('00000001', 'big') == '\\\\u0001'\", \"ass... | {
"split": "train",
"index": 82631,
"acecode_id": "evol_24384",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that identifies all unique adverbs ending with 'ly' in a given string, along with their frequency of occurrence. The function should be case-insensitive and ignore any punctuation marks. The input will be a single string, and the output should be a dictionary w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_adverbs('She ran quickly but he slowly walked. They happily agreed.') == {'quickly': 1, 'slowly': 1, 'happily': 1}\", \"assert find_adverbs('He ran beautifully and she sang softly.') == {'beautifully': 1, 'softly': 1}\", \"assert find_adverbs('Quickly, ... | {
"split": "train",
"index": 82632,
"acecode_id": "evol_19678",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary that maps sequences of strings to dictionaries containing tuples as keys and floating-point numbers as values, write a function `get_max_total(map_of_maps)` that returns the maximum value among all the floating-point numbers in the nested dictionaries. If the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_max_total({}) == 0.0\", \"assert get_max_total({'a': {(1, 2): 1.5}}) == 1.5\", \"assert get_max_total({'a': {(1, 2): 1.5}, 'b': {(3, 4): 2.5}}) == 2.5\", \"assert get_max_total({'a': {(1, 2): 1.5}, 'b': {(3, 4): 2.5}, 'c': {(5, 6): 3.0}}) == 3.0\", \"ass... | {
"split": "train",
"index": 82633,
"acecode_id": "bigcode_python_fns_8251",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of features represented as strings in the format 'X:Y', where X is a single uppercase letter (from 'A' to 'D') and Y is a non-negative integer. Your task is to implement a function that calculates the total sum of the values Y for features 'A', 'B', 'C', an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_feature_proportions(['A:10', 'B:20', 'C:30', 'D:40', 'U:50']) == ['A:0.1', 'B:0.2', 'C:0.3', 'D:0.4']\", \"assert calculate_feature_proportions(['A:0', 'B:0', 'C:0', 'D:0', 'U:10']) == ['A:0.0', 'B:0.0', 'C:0.0', 'D:0.0']\", \"assert calculate_feat... | {
"split": "train",
"index": 82634,
"acecode_id": "oss_20499",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a string as input and returns the sum of the ASCII values of each character in the string. The function should be named `string_to_ascii_sum`, and it should accept a single parameter, `input_string`, which is the string to be processed.\nPlease reaso... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert string_to_ascii_sum('') == 0\", \"assert string_to_ascii_sum('a') == 97\", \"assert string_to_ascii_sum('abc') == 294\", \"assert string_to_ascii_sum('A') == 65\", \"assert string_to_ascii_sum('World!') == 87 + 111 + 114 + 108 + 100 + 33\", \"assert string_t... | {
"split": "train",
"index": 82635,
"acecode_id": "evol_4038",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a file name. Implement a function `check_file_existence(file_name: str) -> str` that checks if the file exists on the server. If the file name is 'BOT_TOKEN.session' or 'config.env', return 'File is a protected configuration file'. If the fil... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_file_existence('file1.txt') == 'File uploaded successfully'\", \"assert check_file_existence('file2.txt') == 'File uploaded successfully'\", \"assert check_file_existence('document.pdf') == 'File uploaded successfully'\", \"assert check_file_existence(... | {
"split": "train",
"index": 82636,
"acecode_id": "bigcode_python_fns_45226",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_employee(employeeID: int, moniker: str, service_length: int) -> dict` that takes an integer `employeeID`, a string `moniker`, and an integer `service_length`, and returns a dictionary representing an employee with the following keys: 'employeeID', '... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_employee(1, 'Alice', 5) == {'employeeID': 1, 'moniker': 'Alice', 'service_length': 5}\", \"assert create_employee(2, 'Bob', 10) == {'employeeID': 2, 'moniker': 'Bob', 'service_length': 10}\", \"assert create_employee(3, 'Charlie', 0) == {'employeeID':... | {
"split": "train",
"index": 82637,
"acecode_id": "evol_14175",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that verifies the presence of a specific button on a webpage. The function takes two arguments: a list of button identifiers (strings) and a target button identifier (string). Your function should return True if the target button is presen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_button_present(['btn-add-to-basket', 'btn-checkout'], 'btn-add-to-basket') == True\", \"assert is_button_present(['btn-checkout', 'btn-remove'], 'btn-add-to-basket') == False\", \"assert is_button_present(['btn-login', 'btn-add-to-basket', 'btn-register']... | {
"split": "train",
"index": 82638,
"acecode_id": "oss_14692",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that checks if a given string is a palindrome. A palindrome is a string that reads the same backward as forward. The function should take a single string argument and return True if it is a palindrome, and False otherwise.\nPlease reason step by step, then ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_palindrome('redder') == True\", \"assert is_palindrome('level') == True\", \"assert is_palindrome('hello') == False\", \"assert is_palindrome('A man a plan a canal Panama') == False\", \"assert is_palindrome('') == True\", \"assert is_palindrome('a') == T... | {
"split": "train",
"index": 82639,
"acecode_id": "evol_10226",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the IDs of event classes. Your task is to implement a function `remove_event_class(class_ids: List[int], class_id_to_remove: int) -> List[int]` that removes the specified class ID from the list and returns the updated list of class ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_event_class([1, 2, 3, 2, 4], 2) == [1, 3, 4]\", \"assert remove_event_class([1, 1, 1, 1], 1) == []\", \"assert remove_event_class([5, 6, 7], 8) == [5, 6, 7]\", \"assert remove_event_class([], 0) == []\", \"assert remove_event_class([10, 20, 30], 20) =... | {
"split": "train",
"index": 82640,
"acecode_id": "bigcode_python_fns_27420",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a set of integers, implement a function `copy_set` that creates a new set containing the same elements as the input set. The input set will be represented as a list of integers, where each integer is unique. Your function should return a new list representing the copied s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert copy_set([1, 2, 3]) == [1, 2, 3]\", \"assert copy_set([5, 7, 9]) == [5, 7, 9]\", \"assert copy_set([0]) == [0]\", \"assert copy_set([-1, -2, -3]) == [-1, -2, -3]\", \"assert copy_set([100, 200, 300]) == [100, 200, 300]\", \"assert copy_set([]) == []\", \"ass... | {
"split": "train",
"index": 82641,
"acecode_id": "bigcode_python_fns_45472",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to implement a function that takes this list and returns a new list containing only the unique elements from the original list, maintaining their original order. For example, if the input list is [1, 2, 2, 3, 4, 4, 5], the output s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_elements([1, 2, 2, 3, 4, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert unique_elements([1, 1, 1, 1, 1]) == [1]\", \"assert unique_elements([]) == []\", \"assert unique_elements([5, 4, 3, 2, 1]) == [5, 4, 3, 2, 1]\", \"assert unique_elements([1, 2, 3, 1, 2, 3]... | {
"split": "train",
"index": 82642,
"acecode_id": "bigcode_python_fns_48488",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that constructs a project list based on a specified version and filter criteria. The function `build_project_list(ctx: str, version: str = 'DEBUG', filter: str = '', delphi_version: str = 'DEFAULT') -> List[str]` takes the following param... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert build_project_list('test_ctx', 'DEBUG', '', 'DEFAULT') == ['ProjectA', 'ProjectB', 'ProjectC']\", \"assert build_project_list('test_ctx', 'RELEASE', 'ProjectA', 'DEFAULT') == ['ProjectA']\", \"assert build_project_list('test_ctx', 'DEBUG', 'ProjectX', 'DEFAU... | {
"split": "train",
"index": 82643,
"acecode_id": "bigcode_python_fns_43902",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with constructing a video URL for a video streaming server. You are given a server address as a tuple containing the IP address and port number, and a video URL as a string. Your goal is to implement a function that constructs a complete video URL using the provi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert construct_video_url(('127.0.0.1', 8080), 'example_video.mp4') == 'http://127.0.0.1:8080/example_video.mp4'\", \"assert construct_video_url(('192.168.1.1', 3000), 'test_video.mp4') == 'http://192.168.1.1:3000/test_video.mp4'\", \"assert construct_video_url(('... | {
"split": "train",
"index": 82644,
"acecode_id": "oss_23728",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes events and executes operations based on the event data. The function should handle different types of operations based on the event payload. Specifically, it should check for the presence of an 'op' key in the 'payload'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert handler({'data': {'payload': {'op': 'CREATE'}}}, {}) == 'CREATE operation executed'\", \"assert handler({'data': {'payload': {'op': 'UPDATE'}}}, {}) == 'Unknown operation'\", \"assert handler({'data': {'payload': {'op': 'DELETE'}}}, {}) == 'Unknown operation... | {
"split": "train",
"index": 82645,
"acecode_id": "oss_19149",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the deletion of a user account in a system. The function should take the name of the user account and a boolean flag for verbose logging. If the account name is valid (i.e., not empty), the function should return True indic... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delete_account('user123', True) == True\", \"assert delete_account('user123', False) == True\", \"assert delete_account('', True) == False\", \"assert delete_account('', False) == False\", \"assert delete_account('admin', True) == True\", \"assert delete_acc... | {
"split": "train",
"index": 82646,
"acecode_id": "bigcode_python_fns_7311",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a unique username for a new user. The username should consist of a combination of the user's first name and a random string of characters. The random string should be of a specified length and can include uppercase letters,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_username('Alice', 5) != generate_username('Alice', 5)\", \"assert len(generate_username('Bob', 3)) == 3 + len('Bob')\", \"assert generate_username('Eve', 0) == 'Eve'\", \"assert len(generate_username('John', 8)) == 8 + len('John')\", \"assert genera... | {
"split": "train",
"index": 82647,
"acecode_id": "oss_14221",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a simple reaction time game. Your function should take two parameters: a random delay time (in seconds) which is between 1 and 3, and a player's reaction time (in seconds) which is the time taken by the player to press the Enter key after a prompt... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reaction_time_feedback(2.5, 0.4) == 'Outstanding! Your reaction time is exceptional!'\", \"assert reaction_time_feedback(1.5, 0.7) == 'Well done! You have a good reaction time.'\", \"assert reaction_time_feedback(3.0, 1.2) == 'Keep practicing! Your reaction ... | {
"split": "train",
"index": 82648,
"acecode_id": "oss_19496",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of tuples, each containing an integer id and a tuple representing the position (x, y) on a 2D grid. Your task is to implement a function that returns a list of tuples where each tuple contains the id and the corresponding position. However, if the id is eve... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_positions([(1, (1, 1)), (2, (2, 2)), (3, (3, 3))]) == [(1, (1, 1)), (2, (4, 4)), (3, (3, 3))]\", \"assert transform_positions([(4, (0, 0)), (5, (1, 2))]) == [(4, (0, 0)), (5, (1, 2))]\", \"assert transform_positions([(0, (1, 1)), (1, (0, 0)), (2, (... | {
"split": "train",
"index": 82649,
"acecode_id": "bigcode_python_fns_223",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that calculates the nth term of the Fibonacci series and the golden ratio, which is the ratio of the nth term to the (n-1)th term, assuming n > 1. If n is 0, return 0 and None. If n is 1, return 1 and None. The function should be implemented using an efficient ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci_golden_ratio(0) == (0, None)\", \"assert fibonacci_golden_ratio(1) == (1, None)\", \"assert fibonacci_golden_ratio(2) == (1, 1.0)\", \"assert fibonacci_golden_ratio(3) == (2, 2.0)\", \"assert fibonacci_golden_ratio(4) == (3, 1.5)\", \"assert fibona... | {
"split": "train",
"index": 82650,
"acecode_id": "evol_12522",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Write a function `primes_in_list(lst)` that takes a list of integers (denoted by `lst`) and returns a list of booleans where each element of the output list is `True` if the corresponding element in the input list is a prime number, and `False` otherwise.\nPlease reason step by... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert primes_in_list([7, 8, 12, 19, 22, 23]) == [True, False, False, True, False, True]\", \"assert primes_in_list([1, 2, 3, 4, 5]) == [False, True, True, False, True]\", \"assert primes_in_list([0, -1, -5, 6, 9]) == [False, False, False, False, False]\", \"assert... | {
"split": "train",
"index": 82651,
"acecode_id": "evol_28906",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an integer matrix `isWater` of dimensions `m x n`, representing a geographical map where `1` indicates a water cell and `0` indicates a land cell. Your task is to implement a function `highestPeak(isWater: List[List[int]]) -> List[List[int]]` that assigns a non-ne... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert highestPeak([[0,1],[0,0]]) == [[1,0],[2,1]]\", \"assert highestPeak([[0,0,1],[1,0,0],[0,0,0]]) == [[1,1,0],[0,1,1],[1,2,2]]\", \"assert highestPeak([[1]]) == [[0]]\", \"assert highestPeak([[1,1,1],[1,1,1]]) == [[0,0,0],[0,0,0]]\", \"assert highestPeak([[0,1]... | {
"split": "train",
"index": 82652,
"acecode_id": "evol_543",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a list of URLs, and your task is to extract and return the domain names from these URLs, formatted as follows: remove any subdomains and the top-level domain (TLD), and return only the primary domain name. If the input list is empty, return an empty list. Write a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_domains(['https://example.org', 'http://example.net']) == ['example', 'example']\", \"assert extract_domains(['https://www.mysite.com/path/to/resource']) == ['mysite']\", \"assert extract_domains([]) == []\", \"assert extract_domains(['http://example... | {
"split": "train",
"index": 82653,
"acecode_id": "bigcode_python_fns_14191",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a LaTeX equation, write a function that extracts the width and height of the rendered SVG output based on a predefined scaling factor. The scaling factor is 1.00375. You will be provided with a dictionary of parameters including the font size and a L... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_svg_dimensions('width=200pt height=100pt', {'fontsize': 20}) == {'width': 10.0375, 'height': 5.01875}\", \"assert extract_svg_dimensions('width=250pt height=125pt', {'fontsize': 25}) == {'width': 10.0375, 'height': 5.01875}\", \"assert extract_svg_di... | {
"split": "train",
"index": 82654,
"acecode_id": "bigcode_python_fns_11992",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that performs subsampling of regions of interest (ROIs), ground truth offsets, and their corresponding labels based on given criteria. The function takes in three input lists: `sample_rois`, `sample_gt_offsets`, and `sample_labels`. E... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert _subsampling_roi_and_gt([1, 2, 3, 4], [0.1, 0.2, 0.3, 0.4], ['a', 'b', 'c', 'd']) == ([1, 3], [0.1, 0.3], ['a', 'c'])\", \"assert _subsampling_roi_and_gt([10, 20, 30, 40, 50], [0.5, 0.6, 0.7, 0.8, 0.9], ['x', 'y', 'z', 'w', 'v']) == ([10, 30, 50], [0.5, 0.7,... | {
"split": "train",
"index": 82655,
"acecode_id": "oss_22783",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Develop a function that sorts an input list into two unique subgroups based on a given rule. The first subgroup should contain non-prime numbers, while the second subgroup should contain prime numbers. The sorting within each subgroup should be determined by a provided sorting ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_function([4, 2, 9, 5, 1], lambda x: x) == [[1, 4, 9], [2, 5]]\", \"assert sort_function([10, 3, 8, 7, 6], lambda x: x) == [[6, 8, 10], [3, 7]]\", \"assert sort_function([15, 11, 22, 17, 9], lambda x: x) == [[9, 15, 22], [11, 17]]\", \"assert sort_functi... | {
"split": "train",
"index": 82656,
"acecode_id": "evol_23067",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two binary numbers represented as arrays of integers (where each integer is either 0 or 1), implement a function that performs binary addition and returns the result as an array. The addition should handle carrying over values, similar to how binary addition is done on pa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binary_addition([1], [1]) == [1,0]\", \"assert binary_addition([0,1], [1,1]) == [1,0,0]\", \"assert binary_addition([0], [1]) == [1]\", \"assert binary_addition([1,0], [1]) == [1,1]\", \"assert binary_addition([1], [0]) == [1]\", \"assert binary_addition([0]... | {
"split": "train",
"index": 82657,
"acecode_id": "evol_30061",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a basic error handling mechanism in a web application. Your function, named `generate_404_message`, should take a string input representing a URL. The function should return a dictionary containing two keys: 'status' an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_404_message('/home') == {'status': '404', 'message': 'The requested URL /home was not found on this server.'}\", \"assert generate_404_message('/about') == {'status': '404', 'message': 'The requested URL /about was not found on this server.'}\", \"a... | {
"split": "train",
"index": 82658,
"acecode_id": "oss_28544",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `validate_numeric_sequence(sequence: str) -> bool` that checks if a given string `sequence` represents a valid numerical value. The function should return `True` if the sequence is a valid integer or floating-point number (including negative numbers), and `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_numeric_sequence('10') == True\", \"assert validate_numeric_sequence('-10') == True\", \"assert validate_numeric_sequence('10.5') == True\", \"assert validate_numeric_sequence('-10.5') == True\", \"assert validate_numeric_sequence(' 1000 ') == Tru... | {
"split": "train",
"index": 82659,
"acecode_id": "evol_7511",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `s` consisting of lowercase letters, return a new string where each character in `s` is repeated a number of times equal to its position in the string (1-indexed). For example, the character at index 1 will be repeated once, the character at index 2 will be repea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert repeat_characters('a') == 'a'\", \"assert repeat_characters('ab') == 'abb'\", \"assert repeat_characters('abc') == 'abbccc'\", \"assert repeat_characters('abcd') == 'abbcccdddd'\", \"assert repeat_characters('x') == 'x'\", \"assert repeat_characters('aaa') =... | {
"split": "train",
"index": 82660,
"acecode_id": "bigcode_python_fns_3443",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the configuration of a platform for a specific hardware device. The function should take two optional parameters: `toolchain` (default value 'ise') and `programmer` (default value 'openocd'). The function should return a di... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert configure_platform() == {'name': 'sp3_kit', 'default_clk_name': 'clk50', 'default_clk_period': 20.0, 'toolchain': 'ise', 'programmer': 'openocd'}\", \"assert configure_platform('vivado') == {'name': 'sp3_kit', 'default_clk_name': 'clk50', 'default_clk_period... | {
"split": "train",
"index": 82661,
"acecode_id": "oss_20808",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that represents a humorous text post in a social media application. The function should take a string representing the text content of the post and a string representing a unique identifier based on a Git hash. The function should return ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_humorous_post('Why did the scarecrow win an award?', '1234567890abcdef1234567890abcdef12345678') == {'text': 'Why did the scarecrow win an award?', 'score_not_funny': 0, 'git_hash': '1234567890abcdef1234567890abcdef12345678'}\", \"assert create_humoro... | {
"split": "train",
"index": 82662,
"acecode_id": "oss_27889",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `max_cumulative_total(arr: List[int]) -> int` that calculates the highest cumulative total of sequential elements within a provided array of integers. The array may contain both positive and negative numbers. The function should return the maximum cumulative to... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_cumulative_total([2, 3, -6, 7, -6, 7, -10]) == 8\", \"assert max_cumulative_total([-1, -2, -3, -4]) == -1\", \"assert max_cumulative_total([1, 2, 3, 4, 5]) == 15\", \"assert max_cumulative_total([0, 0, 0, 0]) == 0\", \"assert max_cumulative_total([5, -1,... | {
"split": "train",
"index": 82663,
"acecode_id": "evol_7875",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates headers for an API request. Your function should accept an optional GitHub token as a string input. If the token is provided, the function should return a dictionary containing an 'Authorization' key with the value 'token '... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_headers('my_github_token') == {'Authorization': 'token my_github_token'}\", \"assert generate_headers(None) == {}\", \"assert generate_headers('1234567890abcdef') == {'Authorization': 'token 1234567890abcdef'}\", \"assert generate_headers('token_abc... | {
"split": "train",
"index": 82664,
"acecode_id": "bigcode_python_fns_34593",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of tuples, where each tuple contains two elements. Your task is to sort the list based on the first element of each tuple. If two tuples have the same first element, they should maintain their original relative order (this is known as stable sorting). The f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_tuples([(1, 2), (3, 4), (2, 5)], False) == [(1, 2), (2, 5), (3, 4)]\", \"assert sort_tuples([(1, 2), (3, 4), (2, 5)], True) == [(3, 4), (2, 5), (1, 2)]\", \"assert sort_tuples([(1, 2), (1, 3), (1, 1)], False) == [(1, 2), (1, 3), (1, 1)]\", \"assert sort... | {
"split": "train",
"index": 82665,
"acecode_id": "bigcode_python_fns_26549",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a custom Word2Vec model in Python. The Word2Vec model is a popular technique used for natural language processing and is capable of learning word embeddings from a given corpus. Your task is to complete the implementation of a function called `i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_word2vec({'sentences': [], 'corpus_file': 'file.txt', 'size': 100}) == {'size': 100}\", \"assert initialize_word2vec({'size': 200, 'window': 5, 'corpus_file': 'data.txt'}) == {'size': 200, 'window': 5}\", \"assert initialize_word2vec({'min_count':... | {
"split": "train",
"index": 82666,
"acecode_id": "oss_21511",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string input. Your task is to implement a function that takes this string and returns a dictionary with the following statistics: the length of the string, the number of lowercase letters, the number of uppercase letters, and the number of digits. The dictionary... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert string_statistics('') == {'length': 0, 'lowercase': 0, 'uppercase': 0, 'digits': 0}\", \"assert string_statistics('123456') == {'length': 6, 'lowercase': 0, 'uppercase': 0, 'digits': 6}\", \"assert string_statistics('abcdef') == {'length': 6, 'lowercase': 6,... | {
"split": "train",
"index": 82667,
"acecode_id": "bigcode_python_fns_17335",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function `update_student_score(roster: List[List[Union[str, int]]], name: str, score: int) -> List[List[Union[str, int]]]` that updates the score of a student in a roster. The roster is represented as a list of lists, where each inner list contains a student's name ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_student_score([['John', 90], ['Tom', 80], ['Jill', 95], ['Stacy', 75]], 'John', 100) == [['John', 100], ['Tom', 80], ['Jill', 95], ['Stacy', 75]]\", \"assert update_student_score([['John', 90], ['Tom', 80], ['Jill', 95]], 'Tom', 85) == [['John', 90], ... | {
"split": "train",
"index": 82668,
"acecode_id": "evol_23509",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing tile values, write a function `calculate_outliers(tile_values: List[int], num_outliers: int) -> List[int]` that returns the largest `num_outliers` integers from the list. If there are fewer than `num_outliers` integers in the list, return a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_outliers([1, 3, 5, 7, 9], 3) == [9, 7, 5]\", \"assert calculate_outliers([10, 20, 30, 40, 50], 2) == [50, 40]\", \"assert calculate_outliers([7, 5, 3, 9, 0], 5) == [9, 7, 5, 3, 0]\", \"assert calculate_outliers([1, 2, 3], 0) == []\", \"assert calcu... | {
"split": "train",
"index": 82669,
"acecode_id": "bigcode_python_fns_17901",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two arrays of integers, `arr1` and `arr2`, which may have different shapes. Implement a function `broadcast_sum(arr1: List[List[int]], arr2: List[List[int]]) -> List[List[int]]` that performs element-wise addition of these arrays while applying the rules of broadc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert broadcast_sum([[1], [2], [3]], [[4, 5, 6]]) == [[5, 6, 7], [6, 7, 8], [7, 8, 9]]\", \"assert broadcast_sum([[1, 2]], [[3], [4]]) == [[4, 5], [5, 6]]\", \"assert broadcast_sum([[1]], [[2, 3], [4, 5]]) == [[3, 4], [5, 6]]\", \"assert broadcast_sum([[1, 2], [3,... | {
"split": "train",
"index": 82670,
"acecode_id": "bigcode_python_fns_30050",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a tuple representing the shape of a multi-dimensional array, implement a function that inserts a new axis of size 1 at a specified position in the shape. The function should take in two parameters: 'shape', a tuple of integers representing the current dimensions of the ar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert insert((2, 3), 1) == (2, 1, 3)\", \"assert insert((4, 5), 0) == (1, 4, 5)\", \"assert insert((1, 2, 3), 2) == (1, 2, 1, 3)\", \"assert insert((10, 20, 30), 0) == (1, 10, 20, 30)\", \"assert insert((6, 7, 8), -2) == (6, 1, 7, 8)\", \"assert insert((5, 5), 2) ... | {
"split": "train",
"index": 82671,
"acecode_id": "bigcode_python_fns_31904",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of lists, where each inner list represents a row of data, and a unique declaration ID. Your function should generate a new list of lists by prepending the declaration ID to each inner list. Implement a function called `p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert prepend_declaration_id([['name1', 'value1'], ['name2', 'value2']], 'ID123') == [['ID123', 'name1', 'value1'], ['ID123', 'name2', 'value2']]\", \"assert prepend_declaration_id([['a', 'b'], ['c', 'd']], 'ID456') == [['ID456', 'a', 'b'], ['ID456', 'c', 'd']]\",... | {
"split": "train",
"index": 82672,
"acecode_id": "bigcode_python_fns_23098",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `kebab_case(sentence)` that converts a given sentence into kebab-case. The function should handle unexpected inputs gracefully. Specifically, if the input is not a string, it should return the message 'Input must be a string.'. If the input is an empty stri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert kebab_case('Hello World') == 'hello-world'\", \"assert kebab_case('This is a Test!') == 'this-is-a-test'\", \"assert kebab_case('Make it@kebab-case') == 'make-it-kebab-case'\", \"assert kebab_case('') == ''\", \"assert kebab_case(123) == 'Input must be a str... | {
"split": "train",
"index": 82673,
"acecode_id": "evol_10215",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of employee records, where each record is represented as a dictionary containing 'Employee_ID', 'Name', 'Department', and 'Salary'. Write a function that calculates the average salary per department and the overall average salary using a recursive approach.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_avg_salaries([{'Employee_ID': 1, 'Name': 'Alice', 'Department': 'HR', 'Salary': 50000}, {'Employee_ID': 2, 'Name': 'Bob', 'Department': 'HR', 'Salary': 60000}, {'Employee_ID': 3, 'Name': 'Charlie', 'Department': 'IT', 'Salary': 70000}, {'Employee_ID': 4... | {
"split": "train",
"index": 82674,
"acecode_id": "evol_17654",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that determines the status of a password based on certain criteria. The function should take a single string input, which represents the password, and return a dictionary containing the `status` of the password. The password status can be... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert password_status('P@ssw0rd') == {'status': 'strong'}\", \"assert password_status('password') == {'status': 'change'}\", \"assert password_status('PASSWORD') == {'status': 'change'}\", \"assert password_status('Passw0rd') == {'status': 'change'}\", \"assert pa... | {
"split": "train",
"index": 82675,
"acecode_id": "bigcode_python_fns_10187",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Write a function that solves a Sudoku puzzle. The function should take a 9x9 2D list as input, where empty cells are represented by 0. It should fill the empty cells with numbers from 1 to 9, such that each number appears exactly once in each row, each column, and each 3x3 subg... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert solve_sudoku([[0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0,... | {
"split": "train",
"index": 82676,
"acecode_id": "evol_20752",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a string that may contain various punctuation characters. Your task is to write a function that replaces all punctuation in the string with a specified character. The function should take two parameters: the input string and the character to replace the punctuatio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_punctuation_with_char('Hello, World!', 'X') == 'HelloX WorldX'\", \"assert replace_punctuation_with_char('This is a test.', '*') == 'This is a test*'\", \"assert replace_punctuation_with_char('Python is awesome!', '#') == 'Python is awesome#'\", \"as... | {
"split": "train",
"index": 82677,
"acecode_id": "evol_33549",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes frequency data from two different types of project files represented as strings. The function takes in a string `projfile` that contains the content of the project file. If the string contains the substring 'rtpr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_project_file('rtproj: [1, 2, 3], imag: [0.1, 0.2, 0.3]') == ([1, 2, 3], [], [0.1, 0.2, 0.3], [])\", \"assert process_project_file('hrproj: [4, 5, 6], imag: [0.4, 0.5, 0.6]') == ([], [4, 5, 6], [], [0.4, 0.5, 0.6])\", \"assert process_project_file('ra... | {
"split": "train",
"index": 82678,
"acecode_id": "oss_16480",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that generates a custom style for a GUI application based on the provided font family and font size. The function should return a dictionary representing the styles applied to specific GUI elements, such as a header label and a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_custom_style('Arial', 12) == {'header_style': {'font_family': 'Arial', 'font_size': 12}, 'message_style': {'font_family': 'Arial', 'font_size': 12}}\", \"assert generate_custom_style('Verdana', 14) == {'header_style': {'font_family': 'Verdana', 'fon... | {
"split": "train",
"index": 82679,
"acecode_id": "oss_8863",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a function that removes repeated elements from a 2D list while maintaining the original order of elements. Your function should take a 2D list with m rows and n columns as input and return a new 2D list with duplicates removed from each sublist. The elements in the retu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_duplicates_2D_list([[1, 2, 2], [3, 3, 4], [5, 5, 5]]) == [[1, 2], [3, 4], [5]]\", \"assert remove_duplicates_2D_list([[1, 2], [2, 1], [1, 2]]) == [[1, 2], [2, 1], [1, 2]]\", \"assert remove_duplicates_2D_list([[1, 1, 1], [2, 2, 2], [3, 3, 3]]) == [[1]... | {
"split": "train",
"index": 82680,
"acecode_id": "evol_16313",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a Python function that takes an integer as input and returns True if the number is a prime number, and False otherwise. A prime number is defined as a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. Your solution should ... | 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": 82681,
"acecode_id": "evol_4772",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of names. Your task is to write a function that takes in a list of strings and returns a new list containing only the names that have a length greater than 5 characters. If there are no names that meet this criterion, return an empty list.\nPlease reason st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_long_names(['Max', 'Alexander', 'Chris', 'Katherine']) == ['Alexander', 'Katherine']\", \"assert filter_long_names(['Avery', 'Mason', 'Logan', 'James']) == []\", \"assert filter_long_names(['Mia', 'Ella', 'Abigail', 'Madison']) == ['Abigail', 'Madison... | {
"split": "train",
"index": 82682,
"acecode_id": "bigcode_python_fns_40198",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given the dimensions of a vehicle's bounding box defined by its width (x), length (y), and height (z), implement a function that calculates the eight vertices of the bounding box in 3D space. The bounding box vertices should be represented as a 2D array where each vertex is a 1... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_bb_points(2, 3, 1) == [[2, 3, -1, 1], [-2, 3, -1, 1], [-2, -3, -1, 1], [2, -3, -1, 1], [2, 3, 1, 1], [-2, 3, 1, 1], [-2, -3, 1, 1], [2, -3, 1, 1]]\", \"assert create_bb_points(1, 1, 1) == [[1, 1, -1, 1], [-1, 1, -1, 1], [-1, -1, -1, 1], [1, -1, -1, 1]... | {
"split": "train",
"index": 82683,
"acecode_id": "bigcode_python_fns_8237",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple logging system for a weather modeling application. Your goal is to create a function that simulates the logging of messages from different modules, each of which can have its own logging level and message format. Your function should al... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_message('module1', 'This is a test message', 'DEBUG', '{level} - {message}') == 'DEBUG - This is a test message'\", \"assert log_message('module2', 'Warning issued', 'WARNING') == 'WARNING: Warning issued'\", \"assert log_message('module3', 'Info logged'... | {
"split": "train",
"index": 82684,
"acecode_id": "oss_23213",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries, where each dictionary represents a test case with various attributes (keys). Your task is to verify that all dictionaries in the list have the same set of keys. The function should return True if all dictionaries have the same keys and Fals... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert verify_keys_consistency([{'a': 1}, {'a': 2}, {'a': 3}]) == True\", \"assert verify_keys_consistency([{'a': 1, 'b': 2}, {'b': 3, 'a': 4}]) == True\", \"assert verify_keys_consistency([{'x': 1, 'y': 2}, {'x': 3, 'y': 4}, {'x': 5, 'y': 6}]) == True\", \"assert ... | {
"split": "train",
"index": 82685,
"acecode_id": "bigcode_python_fns_33031",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of time series data points, where each data point is represented as a dictionary with 'idx_datapoint', 'timestamp', and 'value'. Your task is to write a function that returns the last updated value for each unique data point within a specified time range. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert last_updated_values([{'idx_datapoint': 1, 'timestamp': 1000, 'value': 10.0}, {'idx_datapoint': 1, 'timestamp': 2000, 'value': 15.0}, {'idx_datapoint': 2, 'timestamp': 1500, 'value': 20.0}], 500) == [{'idx_datapoint': 1, 'timestamp': 2000, 'value': 15.0}, {'i... | {
"split": "train",
"index": 82686,
"acecode_id": "bigcode_python_fns_48572",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing topics from a news dataset. Your task is to write a function that calculates the frequency of each topic in the list and returns the top 10 most common topics along with their respective counts in the form of a dictionary. If there a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_topic_distribution(['Health', 'Education', 'Health', 'Sports']) == {'Health': 2, 'Education': 1, 'Sports': 1}\", \"assert calculate_topic_distribution(['Economy', 'Economy', 'Politics', 'Politics', 'Sports', 'Sports', 'Sports']) == {'Sports': 3, 'E... | {
"split": "train",
"index": 82687,
"acecode_id": "oss_9561",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function to retrieve all even numbers from a given list of integers. The function should take a single parameter, which is a list of integers, and return a new list containing only the even integers from the input list. If there are no ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_even_numbers([1, 2, 3, 4, 5, 6]) == [2, 4, 6]\", \"assert get_even_numbers([1, 3, 5]) == []\", \"assert get_even_numbers([-2, -1, 0, 1, 2]) == [-2, 0, 2]\", \"assert get_even_numbers([0, 4, 8, 12]) == [0, 4, 8, 12]\", \"assert get_even_numbers([7, 9, 11]... | {
"split": "train",
"index": 82688,
"acecode_id": "oss_17176",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of pairs representing current (I) and voltage (V) values for multiple photovoltaic (PV) circuits. Your task is to combine these circuits into a single resultant circuit using the following rules: For each set of circuits, the resultant current (I) for any g... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert combine_parallel_circuits([(1, 5), (2, 5)]) == (3.0, 5)\", \"assert combine_parallel_circuits([(2, 10), (2, 10)]) == (4.0, 10)\", \"assert combine_parallel_circuits([(0, 0), (0, 0)]) == (0.0, 0)\", \"assert combine_parallel_circuits([(1.5, 12), (2.5, 12)]) =... | {
"split": "train",
"index": 82689,
"acecode_id": "bigcode_python_fns_34119",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the instantiation of an error model for a software release update. Implement a function called `create_release_update_error` that takes in two parameters: `error_message`, a string representing the error message, and `error... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_release_update_error('Example error message', 500) == {'error_message': 'Example error message', 'error_code': 500}\", \"assert create_release_update_error('Network error', 404) == {'error_message': 'Network error', 'error_code': 404}\", \"assert crea... | {
"split": "train",
"index": 82690,
"acecode_id": "oss_1925",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the exponentially decayed learning rate for a training process. The learning rate should start from an initial value and decay exponentially based on the number of training steps processed, the decay steps, and a decay... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_learning_rate(0.1, 0, 100, 0.96) == 0.1\", \"assert calculate_learning_rate(0.1, 100, 100, 0.96) == 0.096\", \"assert calculate_learning_rate(0.1, 200, 100, 0.96) == 0.09216\", \"assert calculate_learning_rate(0.1, 0, 1, 1) == 0.1\", \"assert calcu... | {
"split": "train",
"index": 82691,
"acecode_id": "bigcode_python_fns_8476",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `update_url_and_headers(old_host: str, new_host: str, headers: Dict[str, str], body: str) -> Tuple[str, Dict[str, str]]`. The function should replace all occurrences of `old_host` in the `body` string and in the values of the `headers... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_url_and_headers('old.com', 'new.com', {'Content-Type': 'text/html', 'X-Custom': 'value'}, 'Visit old.com for more info.') == ('Visit new.com for more info.', {'Content-Type': 'text/html', 'X-OAuth-Redirect': 'https://old.com'})\", \"assert update_url_... | {
"split": "train",
"index": 82692,
"acecode_id": "bigcode_python_fns_41922",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of named entities represented as strings and two specific names, A and B. Your task is to count the number of named entities that are not equal to A or B. Implement a function named `count_named_entities` that takes in three parameters: a list of strings `e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_named_entities(['Alice', 'Bob', 'Charlie'], 'Alice', 'Bob') == 1\", \"assert count_named_entities(['Alice', 'Alice', 'Bob'], 'Alice', 'Bob') == 0\", \"assert count_named_entities(['Charlie', 'Delta', 'Echo'], 'Alpha', 'Bravo') == 3\", \"assert count_na... | {
"split": "train",
"index": 82693,
"acecode_id": "bigcode_python_fns_40687",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing metadata of an example with a specific structure. Your task is to transform the value of the key 'eo:platform' to uppercase. Additionally, you need to ensure that a certain validation rule is applied: if the formatting of 'eo:platform' is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_platform({'properties': {'eo:platform': 'MODIS'}}) == ('No warnings', {'properties': {'eo:platform': 'MODIS'}})\", \"assert format_platform({'properties': {'eo:platform': 'worldview-3'}}) == ('Warning: Invalid format', {'properties': {'eo:platform': '... | {
"split": "train",
"index": 82694,
"acecode_id": "bigcode_python_fns_15745",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `default_to` that accepts two parameters: `value` and `default_value`. The function should return `value` if it is not `None`, otherwise, it should return `default_value`. Implement the function `default_to(value: Optional[Any], default_v... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert default_to(None, 42) == 42\", \"assert default_to(5, 42) == 5\", \"assert default_to('Hello', 'World') == 'Hello'\", \"assert default_to(None, 'Fallback') == 'Fallback'\", \"assert default_to(0, 10) == 0\", \"assert default_to([], [1, 2, 3]) == []\", \"asser... | {
"split": "train",
"index": 82695,
"acecode_id": "bigcode_python_fns_1470",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that finds the shortest non-repeated subsequence common to a pair of input strings, ensuring the function can handle large strings efficiently. The function should return the shortest common subsequence without any repeating characters. If no common subsequ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shortest_common('ABC', 'XYZ') == ''\", \"assert shortest_common('PYTHON', 'JAVA') == ''\", \"assert shortest_common('abcdef', 'ghijkl') == ''\", \"assert shortest_common('Python', 'Java') == ''\", \"assert shortest_common('A', 'A') == 'A'\"]}"
} | {
"split": "train",
"index": 82696,
"acecode_id": "evol_17571",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_smallest(numbers)` that takes a list of integers as input and returns a tuple containing the smallest integer in the list and a list of indices where this smallest integer appears. If the input list is empty, raise a custom exception `EmptyListError` ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_smallest([7, 8, 10, 4]) == (4, [3])\", \"assert find_smallest([7, 8, 4, 10, 4]) == (4, [2, 4])\", \"assert find_smallest([-1, -2, -3, -2]) == (-3, [2])\", \"assert find_smallest([2, 2, 2]) == (2, [0, 1, 2])\", \"assert find_smallest([0, 1, 2, 3]) == (0,... | {
"split": "train",
"index": 82697,
"acecode_id": "evol_15057",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a string representing the path of a handler and returns a description of that handler. The description should be a string that indicates the type of handler based on its path. The handler types are determined by the followi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_handler_description('anthill.framework.core.files.uploadhandler.TemporaryFileUploadHandler') == 'Temporary File Upload Handler'\", \"assert get_handler_description('anthill.framework.core.files.uploadhandler.PermanentFileUploadHandler') == 'Permanent Fil... | {
"split": "train",
"index": 82698,
"acecode_id": "bigcode_python_fns_13357",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a Python function that converts a list of strings into a dictionary. The keys of the dictionary should be the unique characters found in the strings, and the values should be the number of times each character appears across all strings in the list. For example, given th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert list_strings_to_char_count(['a', 'b', 'c']) == {'a': 1, 'b': 1, 'c': 1}\", \"assert list_strings_to_char_count(['aaa', 'bbb', 'ccc']) == {'a': 3, 'b': 3, 'c': 3}\", \"assert list_strings_to_char_count(['abcd', 'efgh', 'ijkl']) == {'a': 1, 'b': 1, 'c': 1, 'd'... | {
"split": "train",
"index": 82699,
"acecode_id": "evol_31379",
"num_tests": 9
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.