data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "You are tasked with generating a summary of COVID-19 statistics from a dataset. The dataset contains various counts of cases, recoveries, and deaths over a series of dates. Given a list of dates and four lists of integers representing total cases, active cases, cured cases, and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_statistics_summary(['2020-03-01', '2020-03-02'], [100, 150], [50, 70], [40, 60], [10, 20]) == 'Total Cases: 150\\\\nActive Cases: 70\\\\nCured Cases: 60\\\\nDeath Cases: 20'\", \"assert generate_statistics_summary(['2020-03-01', '2020-03-02'], [0, 0... | {
"split": "train",
"index": 83900,
"acecode_id": "bigcode_python_fns_23228",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers and an integer k, write a Python function that returns a list of all consecutive subarrays whose sum is equal to the given integer k. A subarray is defined as a contiguous part of the array. The function should return an empty list if no such subarrays ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert subarray_sum([1, 2, 3, 4, 5], 5) == [[2, 3], [5]]\", \"assert subarray_sum([1, 2, 3, 4, 5], 15) == [[1, 2, 3, 4, 5]]\", \"assert subarray_sum([1, 2, 3, 4], 0) == []\", \"assert subarray_sum([], 5) == []\", \"assert subarray_sum([10, 20, 30], 60) == [[10, 20,... | {
"split": "train",
"index": 83901,
"acecode_id": "evol_22053",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that determines if a given list of product prices meets a minimum price requirement. The function should take a list of integers representing product prices and an integer representing the minimum price. It should return True if all price... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert are_prices_valid([10, 20, 15], 10) == True\", \"assert are_prices_valid([5, 10, 15], 10) == False\", \"assert are_prices_valid([12, 14, 16], 11) == True\", \"assert are_prices_valid([11, 12, 13], 14) == False\", \"assert are_prices_valid([], 5) == True\", \"... | {
"split": "train",
"index": 83902,
"acecode_id": "bigcode_python_fns_32603",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that extracts specific metadata from a given dictionary and returns a formatted string. The metadata includes a long description, URL, author, and author email. Write a function called `extract_metadata` that takes a dictionary `me... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_metadata({'long_description': 'Sample Project', 'url': 'https://sample.com', 'author': 'Alice', 'author_email': 'alice@example.com'}) == 'Project: Sample Project\\\\nURL: https://sample.com\\\\nAuthor: Alice (Email: alice@example.com)'\", \"assert ex... | {
"split": "train",
"index": 83903,
"acecode_id": "oss_11142",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to process a list of coordinates and perform specific operations based on the type of each coordinate. The function should take in a list of coordinates `xy`, where each coordinate can be either a tuple of two integers representing Ca... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_coordinates([]) == ([], [])\", \"assert process_coordinates([(0, 0)]) == ([], [])\", \"assert process_coordinates([(1, 1), (4, 5)]) == ([5.0], [])\", \"assert process_coordinates([1 + 1j]) == ([], [1.4142135623730951])\", \"assert process_coordinates... | {
"split": "train",
"index": 83904,
"acecode_id": "oss_17931",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of strings, `cds_list1` and `cds_list2`, representing collections of CDs. Each CD is represented by a unique string. Your task is to create a function `add_alternative_cds(cds1: List[str], cds2: List[str]) -> int` that takes two lists of CDs and adds all... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_alternative_cds(['CD1', 'CD2', 'CD3'], ['CD4', 'CD2', 'CD5']) == 2\", \"assert add_alternative_cds([], ['CD1', 'CD2']) == 0\", \"assert add_alternative_cds(['CD1', 'CD2'], []) == 0\", \"assert add_alternative_cds(['A'], ['A', 'B', 'C']) == 2\", \"assert ... | {
"split": "train",
"index": 83905,
"acecode_id": "bigcode_python_fns_29090",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a strictly upper-case alphabetic string, implement a function `get_permutations(string: str) -> List[str]` that returns a list of all possible permutations of the characters in the string. The permutations should be returned in lexicographical order. The input string will... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_permutations('A') == ['A']\", \"assert get_permutations('AB') == ['AB', 'BA']\", \"assert get_permutations('ABC') == ['ABC', 'ACB', 'BAC', 'BCA', 'CAB', 'CBA']\", \"assert get_permutations('ABCD') == ['ABCD', 'ABDC', 'ACBD', 'ACDB', 'ADBC', 'ADCB', 'BACD... | {
"split": "train",
"index": 83906,
"acecode_id": "evol_13075",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the results of different runners in a race. Your task is to implement a function that returns a dictionary containing three values: the total number of runners, the average result of the runners, and the maximum result from the list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_runner_statistics([1, 2, 3, 4, 5]) == {'total_runners': 5, 'average_result': 3.0, 'max_result': 5}\", \"assert calculate_runner_statistics([10, 20, 30]) == {'total_runners': 3, 'average_result': 20.0, 'max_result': 30}\", \"assert calculate_runner_... | {
"split": "train",
"index": 83907,
"acecode_id": "bigcode_python_fns_7094",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the behavior of a version control system command. Write a function `describe_version` that takes a list of version strings in the format 'vX.Y.Z' (where X, Y, and Z are non-negative integers) and returns the latest version ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert describe_version(['v1.0.0', 'v1.0.1', 'v1.0.2']) == 'v1.0.2'\", \"assert describe_version(['v1.2.3', 'v1.2.3', 'v1.2.3']) == 'v1.2.3'\", \"assert describe_version(['v2.0.0', 'v1.9.9', 'v2.0.1']) == 'v2.0.1'\", \"assert describe_version(['v1.0.0', 'v1.0.0', '... | {
"split": "train",
"index": 83908,
"acecode_id": "bigcode_python_fns_48177",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a keymap configuration for a desktop environment. The keymap can be in two formats: it can either use a Gnome-compatible format with a tab separator (e.g., 'fi\\tnodeadkeys') or a colon-separated format (e.g., 'fi:nodeadkeys'). Your task is t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_keymap('fi:nodeadkeys') == 'fi\\\\tnodeadkeys'\", \"assert convert_keymap('us') == 'us'\", \"assert convert_keymap('de:nodeadkeys') == 'de\\\\tnodeadkeys'\", \"assert convert_keymap('fr') == 'fr'\", \"assert convert_keymap('es:latin1') == 'es\\\\tlat... | {
"split": "train",
"index": 83909,
"acecode_id": "bigcode_python_fns_29513",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `find_matching_number(num1: int, num2: int, numbers: List[int], limit: int) -> Union[int, str]` that takes two integers, `num1` and `num2`, and a list of integers, `numbers`, along with an integer `limit`. The function should first multiply `num1` and `num2`, a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_matching_number(2, 3, [6, 12, 18], 10) == 6\", \"assert find_matching_number(5, 5, [10, 25, 30], 10) == 25\", \"assert find_matching_number(4, 7, [28, 14, 21], 5) == 28\", \"assert find_matching_number(1, 9, [10, 19, 9], 10) == 9\", \"assert find_matchi... | {
"split": "train",
"index": 83910,
"acecode_id": "evol_29814",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list as an argument and returns a tuple containing the first element of the list and its length. If the list is empty, the function should return a tuple containing a default value (0) and the length of the list (which will b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_first_and_length([]) == (0, 0)\", \"assert get_first_and_length([1]) == (1, 1)\", \"assert get_first_and_length([2, 3]) == (2, 2)\", \"assert get_first_and_length([5, 6, 7]) == (5, 3)\", \"assert get_first_and_length([0, -1, -2]) == (0, 3)\", \"assert ge... | {
"split": "train",
"index": 83911,
"acecode_id": "oss_22494",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function `generate_password` that creates a random password with a specified length. The password should contain a mix of uppercase letters, lowercase letters, digits, and special characters, ensuring that the length of the password is exactly 10 characters. The functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert len(generate_password()) == 10\", \"assert len(generate_password(10)) == 10\", \"assert len(generate_password(10)) == 10\", \"assert len(generate_password(10)) == 10\", \"assert len(generate_password(10)) == 10\", \"assert len(generate_password(10)) == 10\",... | {
"split": "train",
"index": 83912,
"acecode_id": "evol_32864",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple game environment. In this game, you have a player represented by the character 'P' and a ball represented by the character 'b'. The game is played on a grid of size `n x m` where each cell can either be empty (' ')... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert make_game(2, 2) == [['P', ' '], [' ', 'b']]\", \"assert make_game(3, 3) == [['P', ' ', ' '], [' ', 'b', ' '], [' ', ' ', ' ']]\", \"assert make_game(1, 1) == [['P']]\", \"assert make_game(4, 4) == [['P', ' ', ' ', ' '], [' ', 'b', ' ', ' '], [' ', ' ', ' ', ... | {
"split": "train",
"index": 83913,
"acecode_id": "bigcode_python_fns_39647",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple metadata store for managing artifacts. The metadata store allows users to define artifact types, create artifacts of those types, and retrieve artifacts by their IDs. Your goal is to implement a function called... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert metadata_store_operations([{'name': 'Type1'}, {'name': 'Type2'}], [{'type_id': 1, 'properties': {'foo': 3, 'bar': 'Hello'}}, {'type_id': 2, 'properties': {'foo': 5, 'bar': 'World'}}]) == [{'id': 1, 'type_id': 1, 'properties': {'foo': 3, 'bar': 'Hello'}}, {'i... | {
"split": "train",
"index": 83914,
"acecode_id": "oss_10027",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Write a function that calculates the cumulative total of all numeric elements within a given list. The function should take the list as an input along with optional parameters for start and end indices to calculate the total for a specific subarray. If the list contains any non... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cumulative_total([1, 2, 3, 4]) == 10\", \"assert cumulative_total([10, 20, 30], 0, 2) == 30\", \"assert cumulative_total([5, 5, 5, 5], 1, 3) == 10\", \"assert cumulative_total([-1, -2, -3, -4]) == -10\", \"assert cumulative_total([0, 0, 0]) == 0\", \"assert ... | {
"split": "train",
"index": 83915,
"acecode_id": "evol_36066",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that determines if a given list of integers can be rearranged to form a palindrome. A palindrome is a sequence that reads the same backward as forward. Your function should take a list of integers as input and return a boolean value i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_form_palindrome([1, 2, 3, 2, 1]) == True\", \"assert can_form_palindrome([1, 2, 2, 1, 1]) == True\", \"assert can_form_palindrome([1, 2, 3, 4]) == False\", \"assert can_form_palindrome([1, 1, 1, 2, 2]) == True\", \"assert can_form_palindrome([1]) == True... | {
"split": "train",
"index": 83916,
"acecode_id": "bigcode_python_fns_26682",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a default URL based on a user's primary key. The URL should follow the format 'www.tecnologiasdedicadas.com/Curriculum/{{ user_pk }}', where {{ user_pk }} is replaced with the user's primary key provided as input. Implement... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_default_url(1) == 'www.tecnologiasdedicadas.com/Curriculum/1'\", \"assert generate_default_url(2) == 'www.tecnologiasdedicadas.com/Curriculum/2'\", \"assert generate_default_url(3) == 'www.tecnologiasdedicadas.com/Curriculum/3'\", \"assert generate_... | {
"split": "train",
"index": 83917,
"acecode_id": "oss_17703",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of news items and categorizes them based on their categories. Each news item is represented by a dictionary with the keys 'url', 'slug', 'serial_no', and 'category'. Your function should take a list of such dicti... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert categorize_news_items([]) == {}\", \"assert categorize_news_items([{'url': 'http://news1.com', 'slug': 'news1', 'serial_no': 1, 'category': 'Tech'}]) == {'Tech': [{'url': 'http://news1.com', 'slug': 'news1', 'serial_no': 1, 'category': 'Tech'}]}\", \"assert ... | {
"split": "train",
"index": 83918,
"acecode_id": "oss_35696",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `calculate_even_sum(numbers)` that returns the sum of all even numbers in the list. An even number is defined as any integer that is divisible by 2. If there are no even numbers in the list, the function should return 0. The input list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_even_sum([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == 30\", \"assert calculate_even_sum([-10, -2, 1, 3, 5]) == -12\", \"assert calculate_even_sum([0, 1, 2, 3]) == 2\", \"assert calculate_even_sum([1, 3, 5, 7]) == 0\", \"assert calculate_even_sum([]) == 0\",... | {
"split": "train",
"index": 83919,
"acecode_id": "oss_8307",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two DNA sequences represented as strings, return the number of matching characters between them when they are aligned globally. The alignment is performed such that each character in the first sequence is matched against each character in the second sequence, and mismatch... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_matching_characters('AGCT', 'AG-T') == 3\", \"assert count_matching_characters('A', 'A') == 1\", \"assert count_matching_characters('A', 'C') == 0\", \"assert count_matching_characters('AGCT', 'AGCT') == 4\", \"assert count_matching_characters('AGC', '... | {
"split": "train",
"index": 83920,
"acecode_id": "bigcode_python_fns_5589",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function to distribute parts of a table to two servers while ensuring that the part sizes are balanced based on file sizes. Each part of the table is represented by a list of file sizes, and the goal is to distribute these parts across two servers... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert distribute_parts_to_servers([[1, 2], [3, 4]], [[], []]) == [[1, 2], [3, 4]]\", \"assert distribute_parts_to_servers([[1, 1], [2, 2]], [[0], [0]]) == [[0, 1, 1], [0, 2, 2]]\", \"assert distribute_parts_to_servers([[6], [2, 3]], [[2], [4]]) == [[2, 6], [4, 2, ... | {
"split": "train",
"index": 83921,
"acecode_id": "oss_26671",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, where each string represents a line from a script. Your task is to clean each line according to specific rules. The rules are as follows: 1. If a line ends with a backslash (`\\`), it indicates that the line continues onto the next line. You sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sanitize_script_lines(['This is a line.','This is another line.']) == [(1, 'This is a line.'), (2, 'This is another line.')]\", \"assert sanitize_script_lines(['This is a comment // it should be removed']) == [(1, 'This is a comment')]\", \"assert sanitize_s... | {
"split": "train",
"index": 83922,
"acecode_id": "bigcode_python_fns_9343",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a single character as input and returns a specific string based on the character provided. The function should follow these rules: if the character is 'a', return 'Alpha'; if the character is 'b', return 'Bravo'; if the cha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert character_to_string('a') == 'Alpha'\", \"assert character_to_string('A') == 'Alpha'\", \"assert character_to_string('b') == 'Bravo'\", \"assert character_to_string('B') == 'Bravo'\", \"assert character_to_string('c') == 'Charlie'\", \"assert character_to_str... | {
"split": "train",
"index": 83923,
"acecode_id": "oss_35847",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `manage_job_state(job_id: int, new_state: str) -> str` that simulates the management of job states in a job processing system. The function will take two parameters: an integer `job_id` representing the unique identifier of the job and a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_job_state(1, 'queued') == 'Job 1 Status: queued'\", \"assert manage_job_state(2, 'running') == 'Job 2 Status: running'\", \"assert manage_job_state(3, 'completed') == 'Job 3 Status: completed'\", \"assert manage_job_state(4, 'failed') == 'Job 4 Status... | {
"split": "train",
"index": 83924,
"acecode_id": "oss_22105",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the total cost of a job based on the number of hours it runs and a predefined hourly rate. The function should take two parameters: `hours`, which is an integer representing the number of hours the job runs and `hourly... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_cost(0, 10) == 0\", \"assert calculate_total_cost(1, 10) == 10\", \"assert calculate_total_cost(5, 10) == 50\", \"assert calculate_total_cost(10, 10) == 100\", \"assert calculate_total_cost(3, 15) == 45\", \"assert calculate_total_cost(4, 20)... | {
"split": "train",
"index": 83925,
"acecode_id": "oss_34580",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an array `coordinates`, where `coordinates[i] = [x, y]`, representing the coordinate of a point in the XY plane. Implement a function that checks if these points form a straight line. If they do, return the slope of the line. If they do not, return 'N/A' for the s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert checkStraightLine([[1,2],[2,3],[3,4],[4,5],[5,6],[6,7]]) == [True, 1]\", \"assert checkStraightLine([[1,1],[2,2],[3,4],[4,5],[5,6],[7,7]]) == [False, 'N/A']\", \"assert checkStraightLine([[0,0],[1,1],[2,2],[3,3],[4,4]]) == [True, 1]\", \"assert checkStraight... | {
"split": "train",
"index": 83926,
"acecode_id": "evol_16551",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates a given database URL string based on specific criteria. The function should take a string input representing a database URL and return a boolean value indicating whether the URL is valid. A valid database URL must adhere to... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_db_url('sqlite:///mydatabase.db') == True\", \"assert validate_db_url('mysql://user@localhost/dbname') == False\", \"assert validate_db_url('sqlite://mydatabase.db?mode=memory') == True\", \"assert validate_db_url('mysql://user:password@localhost') ... | {
"split": "train",
"index": 83927,
"acecode_id": "bigcode_python_fns_49094",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function that checks if a given input string is a valid Base64 encoded string. A valid Base64 string must consist only of characters A-Z, a-z, 0-9, +, /, and = (padding). The input string may have leading or trailing whitespace, which should be ignored. The function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_base64('U29tZSBzdHJpbmc=') == True\", \"assert is_base64('U29tZSBzdHJpbmc==') == True\", \"assert is_base64(' U29tZSBzdHJpbmc= ') == True\", \"assert is_base64('!@#$%^&*()') == False\", \"assert is_base64('U29tZSBAc3RyaW5n') == True\", \"assert is_base6... | {
"split": "train",
"index": 83928,
"acecode_id": "bigcode_python_fns_45391",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `get_user_data(user_id: str, access_token: str) -> Union[Dict[str, str], None]` that simulates the retrieval of user data based on a provided user ID and access token. The function should handle potential errors based on the following... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_user_data('valid_id', 'valid_token') == {'user_id': 'valid_id', 'name': 'John Doe', 'email': 'john.doe@example.com'}\", \"assert get_user_data('valid_id', 'invalid_token') is None\", \"assert get_user_data('invalid_id', 'valid_token') is None\", \"assert... | {
"split": "train",
"index": 83929,
"acecode_id": "oss_23051",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `quick_sort_descending(lst)` that takes a list of integers and sorts it in descending order using the Quick Sort algorithm. The function should correctly handle negative numbers and duplicates. You may assume that the input list will contain only integers.\... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert quick_sort_descending([3, 6, 8, 10, 1, 2, 1]) == [10, 8, 6, 3, 2, 1, 1]\", \"assert quick_sort_descending([5, 5, 5, 5]) == [5, 5, 5, 5]\", \"assert quick_sort_descending([-1, -2, -3, -4, -5]) == [-1, -2, -3, -4, -5]\", \"assert quick_sort_descending([1, -1, ... | {
"split": "train",
"index": 83930,
"acecode_id": "evol_20001",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a basic data structure called a 'hash map' that stores key-value pairs and allows for efficient retrieval of values based on their associated keys. Your task is to complete the `get` method for the hash map, which retrieves the value associated with a given key. If th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hash_map.get(0) == -1\", \"assert hash_map.get(100) == -1\", \"assert hash_map.get(-1) == -1\", \"assert hash_map.get(3) == -1\", \"assert hash_map.get(4) == -1\", \"assert hash_map.get(5) == -1\", \"assert hash_map.get(-100) == -1\", \"assert hash_map.get(1... | {
"split": "train",
"index": 83931,
"acecode_id": "oss_11113",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are playing a solitaire game with `n` piles of stones of sizes `a1, a2, ..., an` respectively. Each turn, you choose two different non-empty piles, take one stone from each, and add `1` point to your score. The game stops when there are fewer than two non-empty piles. Howev... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert maxScore(4, [1, 2, 3, 4]) == 4\", \"assert maxScore(2, [5, 5]) == 5\", \"assert maxScore(6, [2, 3, 4, 5, 6, 7]) == 12\", \"assert maxScore(2, [1, 100]) == 1\", \"assert maxScore(3, [1, 2, 2]) == 2\", \"assert maxScore(3, [10, 1, 10]) == 10\", \"assert maxSco... | {
"split": "train",
"index": 83932,
"acecode_id": "evol_27643",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a list of numbers, implement a function that returns a new list containing the exponential of each number in the original list. The exponential of a number x is defined as e^x, where e is Euler's number (approximately equal to 2.71828). The input list can contain both pos... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_exponential([0]) == [1.0]\", \"assert calculate_exponential([1]) == [2.718281828459045]\", \"assert calculate_exponential([-1]) == [0.36787944117144233]\", \"assert calculate_exponential([1, 2, 3]) == [2.718281828459045, 7.38905609893065, 20.085536... | {
"split": "train",
"index": 83933,
"acecode_id": "bigcode_python_fns_28918",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that returns a new list containing only the unique elements from the original list, in the order they first appeared. The function should maintain the original order of the elements and should not use any external libraries. The input ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_elements([1, 2, 2, 3, 1, 4]) == [1, 2, 3, 4]\", \"assert unique_elements([5, 5, 5, 5, 5]) == [5]\", \"assert unique_elements([1, -1, 0, 1, -1]) == [1, -1, 0]\", \"assert unique_elements([]) == []\", \"assert unique_elements([1]) == [1]\", \"assert uni... | {
"split": "train",
"index": 83934,
"acecode_id": "bigcode_python_fns_12063",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing multiple lines of text, write a function that counts the number of non-empty lines in the string. A non-empty line is defined as a line that contains at least one non-whitespace character. The function should take a single string input and return an ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert _nonempty_line_count('Hello\\\\n\\\\nWorld') == 2\", \"assert _nonempty_line_count('\\\\n\\\\n\\\\n') == 0\", \"assert _nonempty_line_count('Line 1\\\\nLine 2\\\\n\\\\nLine 3') == 3\", \"assert _nonempty_line_count(' \\\\n ') == 0\", \"assert _nonempty_lin... | {
"split": "train",
"index": 83935,
"acecode_id": "bigcode_python_fns_6661",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of positive integers representing the import rates of various components in a growth medium, write a function `adjust_growth_medium` that adjusts any import rate below a specified minimum threshold to that threshold. The function should ensure that all import rates... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert adjust_growth_medium([0.0, 0.5, 1.0], 0.000001) == [0.000001, 0.5, 1.0]\", \"assert adjust_growth_medium([0.0000001, 0.1, 0.2], 0.000001) == [0.000001, 0.1, 0.2]\", \"assert adjust_growth_medium([1, 2, 3]) == [1, 2, 3]\", \"assert adjust_growth_medium([0.000... | {
"split": "train",
"index": 83936,
"acecode_id": "bigcode_python_fns_41926",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a web application framework that provides various details about a web application. Your goal is to implement a function that returns the following information as a dictionary: the name of the web application, its manifest JSON, the store path, the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_web_app_info() == {'app_name': 'MyWebApp', 'manifest_json': {'name': 'MyWebApp', 'version': '1.0'}, 'store_path': '/path/to/store', 'root_path': '/path/to/root', 'base_url': 'https://www.mywebapp.com'}\", \"assert get_web_app_info()['app_name'] == 'MyWeb... | {
"split": "train",
"index": 83937,
"acecode_id": "oss_22925",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes study data and constructs a dictionary with specific key-value pairs. The function should handle different scenarios for obtaining the center name and should sanitize the study abstract and name before adding them to th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_study_data({'center_name': 'Center A'}, {'center_name': 'Center B', 'description': 'Study abstract 1', 'study_title': 'Study Name 1'}, True, 'Dataset 1') == {'centre_name': 'Center A', 'is_public': True, 'study_abstract': 'Study abstract 1', 'study_n... | {
"split": "train",
"index": 83938,
"acecode_id": "oss_1872",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with designing a simple maze game where a bot navigates through a grid to reach a target position. The maze is represented as a 2D list of characters, where '0' represents an open cell, '1' represents a wall, and 'T' represents the target position. Your goal is t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_reach_target([['0', '0', '0'], ['1', '1', '0'], ['0', '1', 'T']]) == True\", \"assert can_reach_target([['0', '1'], ['1', 'T']]) == False\", \"assert can_reach_target([['0', '1', '0', '0'], ['0', '1', '1', '0'], ['0', '0', '0', 'T']]) == True\", \"assert... | {
"split": "train",
"index": 83939,
"acecode_id": "bigcode_python_fns_18549",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a string `sequence` representing a polypeptide sequence, and a string `rule` representing a regular expression for cleavage sites, implement a function that counts the number of sites where the `sequence` can be cleaved based on the given `rule`. The cleavage is defined a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_cleavage_sites('ACDEFGHIKLMNPQRSTVWY', '[DE]') == 2\", \"assert count_cleavage_sites('ACDEFGHIKLMNPQRSTVWY', 'X') == 0\", \"assert count_cleavage_sites('KLMNPQRST', 'K|L|M') == 3\", \"assert count_cleavage_sites('PQRS', 'P|Q|R|S') == 4\", \"assert coun... | {
"split": "train",
"index": 83940,
"acecode_id": "bigcode_python_fns_11984",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Write a Python function called 'sector_area' that calculates the surface area of a circular sector. The function should take two parameters: 'radius' (a positive float representing the radius of the sector) and 'angle' (a float representing the central angle in degrees). The fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sector_area(5, 90) == 19.634954084936208\", \"assert sector_area(7, 360) == 153.93804002589985\", \"assert sector_area(1, 0) == 0.0\", \"assert sector_area(10, 400) == None\", \"assert sector_area(6, 360) == 113.09733552923255\", \"assert sector_area(0, 180)... | {
"split": "train",
"index": 83941,
"acecode_id": "evol_2573",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Develop a function that, given two input strings, yields a sorted string of unique characters shared by both strings, excluding any character that appears more than the length of the shorter string. The algorithm must have a time complexity of O(nlogn) or lower without using in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert common_characters('abc', 'cde') == 'c'\", \"assert common_characters('xyz', 'abc') == ''\", \"assert common_characters('abcd', 'ab') == 'ab'\", \"assert common_characters('12345', '23456') == '2345'\", \"assert common_characters('abcd', 'abcd') == 'abcd'\", ... | {
"split": "train",
"index": 83942,
"acecode_id": "evol_18355",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing daily temperatures. Write a function `dailyTemperatures(temperatures: List[int]) -> List[int]` that returns a list such that for each day in the input list, tells you how many days you have to wait until a warmer temperature. If the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dailyTemperatures([73, 74, 75, 71, 69, 72, 76, 73]) == [1, 1, 4, 2, 1, 1, 0, 0]\", \"assert dailyTemperatures([30, 40, 50, 60]) == [1, 1, 1, 0]\", \"assert dailyTemperatures([30, 60, 90]) == [1, 1, 0]\", \"assert dailyTemperatures([30, 30, 30, 30]) == [0, 0,... | {
"split": "train",
"index": 83943,
"acecode_id": "bigcode_python_fns_38247",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a positive integer, implement a function that returns the integer with its digits reversed. For example, if the input is 12345, the output should be 54321.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```pyt... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_number(12345) == 54321\", \"assert reverse_number(100) == 1\", \"assert reverse_number(987654321) == 123456789\", \"assert reverse_number(0) == 0\", \"assert reverse_number(1) == 1\", \"assert reverse_number(10) == 1\", \"assert reverse_number(321) =... | {
"split": "train",
"index": 83944,
"acecode_id": "evol_36063",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a variable declaration string in a custom language and returns the data type and variable name. The input will be a valid declaration string formatted as '<type> <variable_name>;'. Your goal is to implement the function `pr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_variable_declaration('int count;') == ('int', 'count')\", \"assert process_variable_declaration('float temperature;') == ('float', 'temperature')\", \"assert process_variable_declaration('string name;') == ('string', 'name')\", \"assert process_varia... | {
"split": "train",
"index": 83945,
"acecode_id": "oss_33969",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing a stream of values. Implement a function called `roberts_filter` that takes in this list and applies the Roberts filter. The Roberts filter is a simple edge detection operator that works by calculating the gradient of the image inte... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert roberts_filter([1, 2, 3, 4]) == [1, 1, 1, 0]\", \"assert roberts_filter([5, 1, 3, 2]) == [-4, 2, -1, 0]\", \"assert roberts_filter([0, 0, 0, 0]) == [0, 0, 0, 0]\", \"assert roberts_filter([10, 20, 30]) == [10, 10, 0]\", \"assert roberts_filter([100, 200, 300... | {
"split": "train",
"index": 83946,
"acecode_id": "bigcode_python_fns_27620",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer n, write a function `fib(n)` that returns the first n elements of the Fibonacci sequence. The Fibonacci sequence is defined as follows: the first two elements are 0 and 1, and each subsequent element is the sum of the two preceding elements. The function should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fib(1) == [0]\", \"assert fib(2) == [0, 1]\", \"assert fib(3) == [0, 1, 1]\", \"assert fib(4) == [0, 1, 1, 2]\", \"assert fib(5) == [0, 1, 1, 2, 3]\", \"assert fib(6) == [0, 1, 1, 2, 3, 5]\", \"assert fib(7) == [0, 1, 1, 2, 3, 5, 8]\", \"assert fib(8) == [0,... | {
"split": "train",
"index": 83947,
"acecode_id": "evol_30350",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with designing a function that simulates the behavior of a simple spreadsheet cell editor. The function should take a list of tuples, where each tuple represents a cell in the format (tag, content). When a cell is clicked, the function should return a string indi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cell_edit([('A1', 'Hello'), ('A2', 'World')], ['A1', 'A2']) == ['clicked on cell tag A1, content Hello', 'clicked on cell tag A2, content World']\", \"assert cell_edit([('B1', 'Data'), ('B2', 'Science')], ['B2']) == ['clicked on cell tag B2, content Science'... | {
"split": "train",
"index": 83948,
"acecode_id": "bigcode_python_fns_9138",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function to calculate the date of the next \"Festa Major\" based on a given date. A \"Festa Major\" is a traditional festival celebrated in some regions of Spain, occurring on the first Sunday of August each year. Write a function `next_festa_majo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert next_festa_major(dt.date(2025, 8, 2)) == dt.date(2025, 8, 3)\", \"assert next_festa_major(dt.date(2025, 7, 31)) == dt.date(2025, 8, 3)\", \"assert next_festa_major(dt.date(2024, 8, 1)) == dt.date(2024, 8, 4)\", \"assert next_festa_major(dt.date(2023, 8, 6)) ... | {
"split": "train",
"index": 83949,
"acecode_id": "oss_34592",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a scheduler. The function `start_scheduler(interval_seconds: int) -> str` should accept an integer `interval_seconds` representing the interval in seconds at which a job is scheduled to run. The function should return a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert start_scheduler(5) == 'Job scheduled every 5 seconds.'\", \"assert start_scheduler(10) == 'Job scheduled every 10 seconds.'\", \"assert start_scheduler(1) == 'Job scheduled every 1 seconds.'\", \"assert start_scheduler(15) == 'Job scheduled every 15 seconds.... | {
"split": "train",
"index": 83950,
"acecode_id": "bigcode_python_fns_27414",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_min_value(x, y)` that takes two integer inputs, `x` and `y`, and returns the smaller of the two values. If both values are equal, return either value.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_min_value(3, 5) == 3\", \"assert find_min_value(10, -2) == -2\", \"assert find_min_value(-1, -1) == -1\", \"assert find_min_value(0, 0) == 0\", \"assert find_min_value(7, 7) == 7\", \"assert find_min_value(-5, 2) == -5\", \"assert find_min_value(100, 50... | {
"split": "train",
"index": 83951,
"acecode_id": "evol_26740",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer array `nums` and two integers `k` and `m`, implement a function that computes the maximum sum of a non-empty subsequence from the array such that for every pair of consecutive integers in the subsequence, the indices of the integers differ by no more than `k`. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert constrained_subset_sum([-1,-2,-3], 1, -1) == -1\", \"assert constrained_subset_sum([1,2,3,4,5], 2, 10) == 10\", \"assert constrained_subset_sum([-5,-4,-3,-2,-1], 3, -1) == -1\", \"assert constrained_subset_sum([5,4,3,2,1], 1, 5) == 5\", \"assert constrained_... | {
"split": "train",
"index": 83952,
"acecode_id": "evol_3625",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary containing EXIF (Exchangeable Image File Format) metadata for an image. Your task is to create a function `extract_exif_info(exif_infos)` that processes this dictionary and returns a new dictionary containing the following keys and their corresponding... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_exif_info({'ImageWidth': 1920, 'ImageHeight': 1080, 'DateTimeOriginal': '2022:01:15 14:30:00', 'Make': 'Canon', 'Model': 'EOS 5D Mark IV', 'ExposureTime': '1/100', 'FNumber': 'f/2.8', 'ISOSpeedRatings': 200}) == {'Dimensions': '1920 x 1080', 'DateTim... | {
"split": "train",
"index": 83953,
"acecode_id": "oss_10973",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that clears all elements from a given list. The function should take a single parameter, a list of integers, and return an empty list. Implement the function `clear_list(arr: List[int]) -> List[int]` that behaves as described. For example... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert clear_list([1, 2, 3, 4]) == []\", \"assert clear_list([]) == []\", \"assert clear_list([10]) == []\", \"assert clear_list([5, 10, 15]) == []\", \"assert clear_list([0, -1, -2]) == []\", \"assert clear_list([100, 200, 300, 400]) == []\", \"assert clear_list([... | {
"split": "train",
"index": 83954,
"acecode_id": "bigcode_python_fns_22674",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `fibonacci(n: int) -> List[int]` that returns the first `n` numbers in the Fibonacci sequence. The Fibonacci sequence is defined as follows: the first two numbers are 0 and 1, and each subsequent number is the sum of the two preceding ones. The function should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(1) == [0]\", \"assert fibonacci(2) == [0, 1]\", \"assert fibonacci(3) == [0, 1, 1]\", \"assert fibonacci(4) == [0, 1, 1, 2]\", \"assert fibonacci(5) == [0, 1, 1, 2, 3]\", \"assert fibonacci(6) == [0, 1, 1, 2, 3, 5]\", \"assert fibonacci(7) == [0, 1... | {
"split": "train",
"index": 83955,
"acecode_id": "evol_21100",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with validating user input for a specific action in a system. Implement a function `validate_user_input(data: dict, action: str) -> None` that checks the validity of the `data` based on the specified `action`. The function should raise an exception with a specifi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_user_input({'key': 'value'}, 'create') == None\", \"assert validate_user_input({'key': 'value'}, 'update') == None\", \"assert validate_user_input({'name': 'John'}, 'create') == None\", \"assert validate_user_input({'name': 'John'}, 'update') == Non... | {
"split": "train",
"index": 83956,
"acecode_id": "bigcode_python_fns_2682",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates retrieving the current position of a file pointer in a hypothetical file handling system. The function `get_file_pointer_position` takes an integer input representing the file pointer position. If the position is non-ne... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_file_pointer_position(0) == 0\", \"assert get_file_pointer_position(5) == 5\", \"assert get_file_pointer_position(10) == 10\", \"assert get_file_pointer_position(20) == 20\", \"assert get_file_pointer_position(15) == 15\", \"assert get_file_pointer_posit... | {
"split": "train",
"index": 83957,
"acecode_id": "oss_19013",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that manages a collection of network entities. Your function should take a series of operations to add, remove, and list entities. The operations will be provided as a list of tuples, where each tuple represents an operation. The oper... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_network_entities([('add', 'router1'), ('add', 'switch1'), ('list',), ('remove', 'router1'), ('list',)]) == [['router1', 'switch1'], ['switch1']]\", \"assert manage_network_entities([('add', 'server1'), ('remove', 'server2'), ('list',)]) == [['server1'... | {
"split": "train",
"index": 83958,
"acecode_id": "oss_30302",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that increments the names of unnamed colormaps in a list of colormap names. An unnamed colormap is denoted by the format '[unnamed colormap X]', where X is a non-negative integer. The function should increment the integer value for ea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert increment_unnamed_colormaps(['[unnamed colormap 0]', '[unnamed colormap 1]']) == ['[unnamed colormap 0]', '[unnamed colormap 1]']\", \"assert increment_unnamed_colormaps(['[unnamed colormap 2]', 'custom_colormap']) == ['[unnamed colormap 0]', 'custom_colorma... | {
"split": "train",
"index": 83959,
"acecode_id": "oss_34045",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that verifies whether a module has a version specified in a given JSON object. The JSON object contains a list of modules, each with a name and a corresponding git SHA. Your function should take two arguments: the JSON object representing... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_module_version({'modules': {'moduleA': {'git_sha': 'abc123'}}}, 'moduleA') == 'abc123'\", \"assert check_module_version({'modules': {'moduleB': {'git_sha': 'def456'}}}, 'moduleB') == 'def456'\", \"assert check_module_version({'modules': {'moduleC': {'g... | {
"split": "train",
"index": 83960,
"acecode_id": "bigcode_python_fns_16493",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a tree data structure called `NamedTree`. Your task is to implement a function `print_named_tree(tree: NamedTree) -> str` that returns a string representation of the tree. If the tree is empty (i.e., it contains no values), the function should return the string '<... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert print_named_tree(NamedTree()) == '<NamedTree empty object>'\", \"assert print_named_tree(NamedTree(['A'])) == '<A>'\", \"assert print_named_tree(NamedTree(['A', 'B'])) == '<A, B>'\", \"assert print_named_tree(NamedTree(['C', 'A', 'B'])) == '<C, A, B>'\", \"a... | {
"split": "train",
"index": 83961,
"acecode_id": "bigcode_python_fns_17717",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that maps numeric labels to their corresponding clothing item classes from the Fashion MNIST dataset. The dataset contains 10 classes of clothing items, which are: T-shirts/tops, trousers, pullovers, dresses, coats, sandals, shirts... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert output_label(0) == 'T-shirt/top'\", \"assert output_label(1) == 'Trouser'\", \"assert output_label(2) == 'Pullover'\", \"assert output_label(3) == 'Dress'\", \"assert output_label(4) == 'Coat'\", \"assert output_label(5) == 'Sandal'\", \"assert output_label(... | {
"split": "train",
"index": 83962,
"acecode_id": "oss_8539",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two integers, return their sum. Implement a function `sum_of_two_integers(a: int, b: int) -> int` that takes two integer parameters `a` and `b`, and returns the sum of these two integers. The function should not print anything and should directly return the result.\nPleas... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_two_integers(3, 5) == 8\", \"assert sum_of_two_integers(-1, 1) == 0\", \"assert sum_of_two_integers(0, 0) == 0\", \"assert sum_of_two_integers(10, 15) == 25\", \"assert sum_of_two_integers(-10, -15) == -25\", \"assert sum_of_two_integers(100, 200) == ... | {
"split": "train",
"index": 83963,
"acecode_id": "oss_32961",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You have a list of words. Your task is to implement a function `game_over(remaining_words: List[str]) -> bool` that determines if the game is over. The game is considered over when there are no remaining words. The function should return `True` if the list is empty and `False` ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert game_over(['apple', 'banana', 'cherry']) == False\", \"assert game_over(['']) == False\", \"assert game_over(['word']) == False\", \"assert game_over([]) == True\", \"assert game_over(['a', 'b', 'c', 'd', 'e']) == False\", \"assert game_over(['one', 'two']) ... | {
"split": "train",
"index": 83964,
"acecode_id": "bigcode_python_fns_11073",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Write a function `sum_even_numbers(numbers)` that returns the sum of all the even numbers in the list. If the input list contains any non-integer values, the function should catch the exception and print a message 'An exception occurred while p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_even_numbers([2, 4, 6, 8]) == 20\", \"assert sum_even_numbers([1, 3, 5, 7]) == 0\", \"assert sum_even_numbers([]) == 0\", \"assert sum_even_numbers([10, 15, 20, 25]) == 30\", \"assert sum_even_numbers([2, 'a', 4]) == 6\", \"assert sum_even_numbers([-2, -... | {
"split": "train",
"index": 83965,
"acecode_id": "oss_11312",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a simple banking operation. Write a function `final_balance(initial_balance: float, interest_rate: float, deposit_amount: float, withdraw_amount: float) -> float` that calculates the final account balance after performing a series of operations. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert final_balance(1000, 5, 0, 0) == 1050.0\", \"assert final_balance(1000, 0, 500, 500) == 1000.0\", \"assert final_balance(0, 5, 1000, 500) == 525.0\", \"assert final_balance(600, 1, 0, 0) == 606.0\", \"assert final_balance(300, 5, 0, 0) == 315.0\"]}"
} | {
"split": "train",
"index": 83966,
"acecode_id": "oss_16945",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a device ID and a list of trigger types and their corresponding subtypes for a device in a smart home system. Write a function `get_device_triggers(device_id: str) -> List[Dict[str, str]]` that returns a list of dictionaries, where each dictionary represents a tri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_device_triggers('device_123') == [{'device_id': 'device_123', 'domain': 'deconz', 'platform': 'device', 'type': 'short_press', 'subtype': 'turn_on'}, {'device_id': 'device_123', 'domain': 'deconz', 'platform': 'device', 'type': 'long_press', 'subtype': '... | {
"split": "train",
"index": 83967,
"acecode_id": "bigcode_python_fns_22752",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with updating a configuration dictionary with new values provided in another dictionary. Your function should take two parameters: a configuration dictionary `cfg` and a dictionary `cfg_in` containing the new values. For each key in `cfg_in`, if the key exists in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_config({'a': 1, 'b': 2}, {'a': 3}) == {'a': '3', 'b': 2}\", \"assert update_config({'x': 5, 'y': 10}, {'y': 20}) == {'x': 5, 'y': '20'}\", \"assert update_config({'name': 'Alice', 'age': 30}, {'age': 25, 'name': 'Bob'}) == {'name': 'Bob', 'age': '25'}... | {
"split": "train",
"index": 83968,
"acecode_id": "bigcode_python_fns_13682",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `calculate_time_difference(start: str, end: str) -> List[int]` that calculates the gap between two date and time values in years, months, days, hours, minutes, and seconds. The function should accept two ISO 8601 formatted datetime strings as input. If the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_time_difference('2021-01-01T00:00:00', '2021-01-01T00:00:00') == [0, 0, 0, 0, 0, 0]\", \"assert calculate_time_difference('2000-01-01T00:00:00', '2023-01-01T00:00:00') == [23, 0, 0, 0, 0, 0]\", \"assert calculate_time_difference('2000-01-01T00:00:0... | {
"split": "train",
"index": 83969,
"acecode_id": "evol_23458",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `largestDivisibleSubset(nums: List[int]) -> List[int]` that returns the largest subset of numbers such that every pair of elements in the subset is divisible. If there are multiple valid subsets of the same size, return any one of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert largestDivisibleSubset([1, 2, 3, 4, 6, 12]) == [1, 2, 4, 12]\", \"assert largestDivisibleSubset([11, 22, 33]) == []\", \"assert largestDivisibleSubset([1, 1, 1]) == [1, 1, 1]\", \"assert largestDivisibleSubset([2, 3, 5, 7]) == []\", \"assert largestDivisible... | {
"split": "train",
"index": 83970,
"acecode_id": "evol_10854",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given two words, determine if the second word or any of its rotations can be a substring of the first word. If not, check if the second word can become a substring of the first word through a limited number of adjacent letter swaps (maximum of 3 swaps). Additionally, note that ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cycpattern_check('hello', 'ell') == True\", \"assert cycpattern_check('abab', 'baa') == True\", \"assert cycpattern_check('himenss', 'simen') == True\", \"assert cycpattern_check('abcd', 'bcda') == True\", \"assert cycpattern_check('aabbcc', 'abc') == True\"... | {
"split": "train",
"index": 83971,
"acecode_id": "evol_12298",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given two one-dimensional arrays, `rv` and `zv`, representing positions on a particle's surface. Your task is to implement a function that simulates a focal scan by generating a new array based on the combination of these two input arrays. The function should return an ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert focal_scan([0.0, 0.1], [-1.0, 1.0]) == [0.0, 0.1]\", \"assert focal_scan([1.0, 2.0], [3.0, 4.0]) == [3.0, 8.0]\", \"assert focal_scan([-1.0, -0.5], [2.0, 4.0]) == [-2.0, -2.0]\", \"assert focal_scan([0.5, 0.5], [0.5, 0.5]) == [0.25, 0.25]\", \"assert focal_s... | {
"split": "train",
"index": 83972,
"acecode_id": "bigcode_python_fns_30311",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `replace_and_compress` that takes a string as input, replaces all occurrences of the indefinite article 'a' (surrounded by spaces) with the definite article 'the', compresses the modified string by replacing consecutive identical characters with their count... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_and_compress('I am learning a lot of new things!') == 'I am learning the lot of new things!'\", \"assert replace_and_compress('this is a test') == 'this is the test'\", \"assert replace_and_compress('I have a dream') == 'I have the dream'\", \"assert... | {
"split": "train",
"index": 83973,
"acecode_id": "evol_21885",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates an HTTP GET request with a specified URL and headers. The function should accept a URL template and optional headers as keyword arguments. The function should return a dictionary representing the HTTP request with the follo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert build_http_request() == {'method': 'GET', 'url': '/http/redirect/301', 'headers': {'Accept': 'application/json'}}\", \"assert build_http_request(template_url='/api/data') == {'method': 'GET', 'url': '/api/data', 'headers': {'Accept': 'application/json'}}\", ... | {
"split": "train",
"index": 83974,
"acecode_id": "bigcode_python_fns_29471",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of student scores and returns the top N students based on their scores. The function should take in a list of student scores, a list of corresponding student names, and an integer N indicating the number of to... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert top_n_students([90, 80, 70], ['Alice', 'Bob', 'Charlie'], 2) == ['Alice', 'Bob']\", \"assert top_n_students([90, 90, 80], ['Alice', 'Bob', 'Charlie'], 2) == ['Alice', 'Bob']\", \"assert top_n_students([50, 60, 70, 80], ['Alice', 'Bob', 'Charlie', 'David'], 3... | {
"split": "train",
"index": 83975,
"acecode_id": "oss_7802",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `factorial` that calculates the factorial of a non-negative integer. The function should raise a TypeError if the input is not an integer and a ValueError if the input is a negative integer. You must use recursion to solve the problem without using a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert factorial(0) == 1\", \"assert factorial(1) == 1\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", \"assert factorial(5) == 120\", \"assert factorial(6) == 720\", \"assert factorial(7) == 5040\", \"assert factorial(... | {
"split": "train",
"index": 83976,
"acecode_id": "evol_7428",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with analyzing DNS log entries to determine how many times a specific IP address has queried different domain names, excluding those that contain the 'SOA' record type. You are given a list of log entries, where each entry is a string formatted as 'IP_ADDRESS QNA... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_queries('192.168.1.1', ['192.168.1.1 QNAME example.com', '192.168.1.1 QNAME example.org', '192.168.1.1 QNAME example.com SOA']) == 2\", \"assert count_unique_queries('10.0.0.1', ['10.0.0.1 QNAME test.com', '10.0.0.1 QNAME test.net', '10.0.0.1 QN... | {
"split": "train",
"index": 83977,
"acecode_id": "bigcode_python_fns_43910",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `find_max_sum(arr: List[int], k: int) -> int` that returns the maximum sum of any contiguous subarray of size `k`. If the array has fewer than `k` elements, return 0. The function should operate in O(n) time complexity, where n is ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max_sum([1, 2, 3, 4, 5], 2) == 9\", \"assert find_max_sum([5, 5, 5, 5], 3) == 15\", \"assert find_max_sum([1, -1, 2, 3, -5, 4], 2) == 5\", \"assert find_max_sum([-1, -2, -3, -4], 2) == -3\", \"assert find_max_sum([1, 3, 2, 5, 4], 1) == 5\", \"assert fin... | {
"split": "train",
"index": 83978,
"acecode_id": "bigcode_python_fns_41363",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `stopListening` that simulates stopping a listening server. The function should take no parameters and return a string indicating the status of the server. If the server is currently listening, the function should return 'Server stopped',... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert stopListening() == 'Server was not listening'\", \"assert stopListening() == 'Server was not listening'\", \"assert stopListening() == 'Server was not listening'\", \"assert stopListening() == 'Server was not listening'\", \"assert stopListening() == 'Server... | {
"split": "train",
"index": 83979,
"acecode_id": "bigcode_python_fns_33078",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that modifies the version of a software package in a simulation environment for testing purposes. The function `set_version(package, version)` takes two parameters: a string `package` representing the name of the package and a string `ver... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_version('erd', '1.0.0') == 'The version of erd has been set to 1.0.0'\", \"assert set_version('requests', '2.25.1') == 'The version of requests has been set to 2.25.1'\", \"assert set_version('numpy', '1.21.0') == 'The version of numpy has been set to 1.... | {
"split": "train",
"index": 83980,
"acecode_id": "bigcode_python_fns_10358",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a mock dictionary for email personalization. The function should return a dictionary containing the following keys and their respective values: \n\n1. 'to_list': A list of dictionaries, each containing an 'email' key with a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_mock_personalization_dict() == {'to_list': [{'email': 'test1@example.com', 'name': 'Example User'}, {'email': 'test2@example.com', 'name': 'Example User'}], 'cc_list': [{'email': 'test3@example.com', 'name': 'Example User'}, {'email': 'test4@example.com'... | {
"split": "train",
"index": 83981,
"acecode_id": "bigcode_python_fns_39872",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of a series of buildings. Your task is to determine the maximum area of a rectangle that can be formed within these buildings. The rectangle can span multiple contiguous buildings, and its height is determined by the sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert maxRectangleArea([2, 1, 5, 6, 2, 3]) == 10\", \"assert maxRectangleArea([1, 1, 1, 1]) == 4\", \"assert maxRectangleArea([2, 4]) == 4\", \"assert maxRectangleArea([5, 4, 1, 2, 6]) == 8\", \"assert maxRectangleArea([1, 0, 0, 1]) == 1\", \"assert maxRectangleAr... | {
"split": "train",
"index": 83982,
"acecode_id": "bigcode_python_fns_37160",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given an integer array `nums` and an integer `k`. In one operation, you can pick two numbers from the array whose sum equals `k` and remove them from the array. Your task is to implement a function `maxOperations(nums: List[int], k: int) -> int` that returns the maximum... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert maxOperations([1,2,3,4], 5) == 2\", \"assert maxOperations([3,1,3,4,3], 6) == 1\", \"assert maxOperations([1,1,1,1,1], 2) == 2\", \"assert maxOperations([], 5) == 0\", \"assert maxOperations([2,2,2,2,2], 4) == 2\", \"assert maxOperations([5,5,5,5], 10) == 2\... | {
"split": "train",
"index": 83983,
"acecode_id": "evol_20776",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function that manipulates currency values. The function should be named `manipulate_currency`. It will take three parameters: `price` (a float representing the original price), `percentage` (a float representing the percentage to increase or decrease the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manipulate_currency(100, 20, 'increase') == '$120.00'\", \"assert manipulate_currency(100, 20, 'decrease') == 80.0\", \"assert manipulate_currency(200, 10, 'increase') == '$220.00'\", \"assert manipulate_currency(200, 10, 'decrease') == 180.0\", \"assert man... | {
"split": "train",
"index": 83984,
"acecode_id": "oss_24213",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You need to create a function `createBankAccount()` that initializes a bank account with a specific account number, bank name, and bank location. The function should return a dictionary representing the bank account with the keys 'account_number', 'bank_name', and 'bank_locatio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert createBankAccount(123456, 'My Piggy Bank', 'Tunja Downtown') == {'account_number': 123456, 'bank_name': 'My Piggy Bank', 'bank_location': 'Tunja Downtown'}\", \"assert createBankAccount(987654, 'National Bank', 'New York') == {'account_number': 987654, 'bank... | {
"split": "train",
"index": 83985,
"acecode_id": "bigcode_python_fns_38266",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a sentence, implement a function that removes all vowels (a, e, i, o, u) from the sentence and returns the modified sentence. The input will be a string that may contain spaces and punctuation. The output should be a string without any vowels.\nPlease reason step by step,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert disemvowel('hello world') == 'hll wrld'\", \"assert disemvowel('The quick brown fox') == 'Th qck brwn fx'\", \"assert disemvowel('Python programming') == 'Pythn prgrmmng'\", \"assert disemvowel('This is a test sentence.') == 'Ths s tst sntnc.'\", \"assert d... | {
"split": "train",
"index": 83986,
"acecode_id": "bigcode_python_fns_14807",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a string as input and replaces all occurrences of the word 'hello' with 'goodbye'. The function should be case-insensitive, meaning it should replace 'hello', 'Hello', 'HELLO', etc. The function should return the modified string.\nPlease reason s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_hello('hello there!') == 'goodbye there!'\", \"assert replace_hello('HELLO') == 'goodbye'\", \"assert replace_hello('This is a test: hello, hello, HELLO!') == 'This is a test: goodbye, goodbye, goodbye!'\", \"assert replace_hello('Say hello to everyo... | {
"split": "train",
"index": 83987,
"acecode_id": "evol_3417",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes an array of alphanumeric strings and returns a dictionary where each key is a unique string from the array, and the value is the length of that string. The dictionary should only include strings that have a length greater than zero.\nPlease reaso... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert string_length_dictionary(['apple', 'banana', 'cherry']) == {'apple': 5, 'banana': 6, 'cherry': 6}\", \"assert string_length_dictionary(['hello', 'world']) == {'hello': 5, 'world': 5}\", \"assert string_length_dictionary(['']) == {}\", \"assert string_length_... | {
"split": "train",
"index": 83988,
"acecode_id": "evol_1966",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates a network device's properties based on given constraints. The function should take three parameters: an IP address (string), a hostname (string), and a list of interface details (list of strings). The function should return... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_network_device('192.168.1.1', 'my-device', ['eth0', 'eth1']) == True\", \"assert validate_network_device('256.100.50.25', 'my-device', ['eth0']) == False\", \"assert validate_network_device('192.168.1.1', '', ['eth0']) == False\", \"assert validate_... | {
"split": "train",
"index": 83989,
"acecode_id": "oss_33449",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function `setup_directories(base_dir: str, fqdn: str, mode: int, uid: int, gid: int) -> List[str]` that simulates setting up a directory structure needed for certificate updating operations. The function takes the following parameters: \n\n- `base_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert setup_directories('/etc/ssl', 'example.com', 755, 1000, 1000) == ['Success setting up: /etc/ssl/example.com/certs', 'Success setting up: /etc/ssl/example.com/private', 'Success setting up: /etc/ssl/example.com/csr']\", \"assert setup_directories('/var/www', ... | {
"split": "train",
"index": 83990,
"acecode_id": "bigcode_python_fns_24810",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the creation of virtual environments. The function takes a single string input representing the name of the virtual environment and returns a message indicating whether the environment was successfully created or if it ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_virtual_environment('new_env') == 'Environment created successfully'\", \"assert create_virtual_environment('another_env') == 'Environment created successfully'\", \"assert create_virtual_environment('test_env') == 'Environment created successfully'\"... | {
"split": "train",
"index": 83991,
"acecode_id": "bigcode_python_fns_30738",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of buildings in a row. Your task is to implement a function `max_visible_buildings(heights: List[int]) -> int` that returns the maximum number of visible buildings from the left side. A building is considered visible if ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_visible_buildings([1, 3, 2, 4, 5]) == 4\", \"assert max_visible_buildings([5, 4, 3, 2, 1]) == 1\", \"assert max_visible_buildings([1, 2, 3, 4, 5]) == 5\", \"assert max_visible_buildings([2, 2, 2, 2, 2]) == 1\", \"assert max_visible_buildings([1]) == 1\",... | {
"split": "train",
"index": 83992,
"acecode_id": "bigcode_python_fns_22636",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that determines whether editing a cell in a grid is allowed based on the column index and specific rules. The grid is represented as a 2D array, and the rules for allowing cell editing are as follows: 1. If the column index is less th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isCellEditingAllowed([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 0) == True\", \"assert isCellEditingAllowed([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 1) == False\", \"assert isCellEditingAllowed([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 2) == True\", \"assert isCellEditingAllowed... | {
"split": "train",
"index": 83993,
"acecode_id": "oss_26982",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a given layout type exists within a predefined list of layout types. The function should take a string as input representing the layout type and return a boolean indicating whether the layout type is present in the list. Th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert contains_layout_type('on/off switch') == True\", \"assert contains_layout_type('slider') == True\", \"assert contains_layout_type('map view') == True\", \"assert contains_layout_type('button bar') == True\", \"assert contains_layout_type('video') == True\", ... | {
"split": "train",
"index": 83994,
"acecode_id": "oss_13932",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `get_options` that simulates the behavior of an argument parser. The function should take a list of command-line arguments as input and return a dictionary containing the parsed options. The input list will contain the following comma... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_options(['-c', 'config.json', '--profiling']) == {'config': 'config.json', 'profiling': True}\", \"assert get_options(['-c', 'config.json', '--no-profiling']) == {'config': 'config.json', 'profiling': False}\", \"assert get_options(['-c', 'config.json'])... | {
"split": "train",
"index": 83995,
"acecode_id": "bigcode_python_fns_21237",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of exposure levels represented as a list of dictionaries. Each dictionary contains the keys 'month_year', 'geography', and 'value', representing the month and year of the exposure, the geographical location, and the value of exposure respectively. Your task... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert make_exposure_shares([{'month_year': '2023-01', 'geography': 'A', 'value': 50}, {'month_year': '2023-01', 'geography': 'A', 'value': 150}, {'month_year': '2023-02', 'geography': 'A', 'value': 100}]) == [{'month_year': '2023-01', 'geography': 'A', 'value': 20... | {
"split": "train",
"index": 83996,
"acecode_id": "bigcode_python_fns_27686",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with finding the indices of the first pair of adjacent identical characters in a given sentence. Write a function `find_first_pair_indices(sentence: str) -> Union[Tuple[int, int], str]` that takes a string `sentence` as input and returns a tuple of two integers r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_first_pair_indices('abccdeff') == (3, 4)\", \"assert find_first_pair_indices('aabbcc') == (1, 2)\", \"assert find_first_pair_indices('abcdd') == (4, 5)\", \"assert find_first_pair_indices('noon') == (2, 3)\", \"assert find_first_pair_indices('') == 'No ... | {
"split": "train",
"index": 83997,
"acecode_id": "oss_27718",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a screen with dimensions `rows x cols` and a sentence represented by a list of non-empty words, implement a function that determines the number of times the provided sentence can be fully accommodated on the screen. A word cannot be split across two lines, the sequence of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert screen_fit(['hello', 'world'], 2, 8) == 1\", \"assert screen_fit(['a', 'bcd', 'e'], 3, 6) == 2\", \"assert screen_fit(['I', 'had', 'apple', 'pie'], 4, 5) == 1\", \"assert screen_fit(['the', 'quick', 'brown', 'fox'], 1, 20) == 1\", \"assert screen_fit(['short... | {
"split": "train",
"index": 83998,
"acecode_id": "evol_11461",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the process of suggesting an addition of a network and its corresponding IX (Internet Exchange) details based on certain conditions. Given a list of existing networks (each represented as a dictionary with 'asn', 'ipadd... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert suggest_network_addition([{'asn': 1001, 'ipaddr4': '195.69.150.250', 'ipaddr6': '2001:7f8:1::a500:2906:3', 'status': 'ok', 'is_rs_peer': True, 'operational': True}], {'asn': 1001, 'ipaddr4': '195.69.147.250', 'ipaddr6': '2001:7f8:1::a500:2906:1', 'status': '... | {
"split": "train",
"index": 83999,
"acecode_id": "bigcode_python_fns_28404",
"num_tests": 12
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.