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 a list of strings, each representing a sequence of lowercase letters, write a function that determines the number of strings that contain exactly two occurrences of the same letter and the number of strings that contain exactly three occurrences of the same letter. The fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_letters(['abcd', 'efgh', 'ijkl', 'mnop']) == (0, 0)\", \"assert count_letters(['a', 'b', 'c', 'd']) == (0, 0)\", \"assert count_letters(['abc', 'aabb', 'bbaa', 'ccccc']) == (2, 0)\", \"assert count_letters(['xyz', 'xyzz', 'xxxy', 'yyyyy']) == (1, 1)\",...
{ "split": "train", "index": 3000, "acecode_id": "oss_22279", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Develop a function that sorts a given list of alphanumeric strings in ascending order based on their numerical values. If two strings have the same numerical value, sort them lexicographically (case-insensitively). The function should handle special characters and upper-case le...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert alphanumeric_sort(['5x', '5y', '5Z', '5a']) == ['5a', '5x', '5y', '5Z']\", \"assert alphanumeric_sort(['abc2', 'abc1', 'abc10', 'abc2A']) == ['abc1', 'abc2', 'abc2A', 'abc10']\", \"assert alphanumeric_sort(['1', '2', '3', '10', '20']) == ['1', '2', '3', '10'...
{ "split": "train", "index": 3001, "acecode_id": "evol_16722", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a list of integers called `subset` and an integer `x`. Your task is to return a new list containing all the integers from `subset` that are not present in the set of integers that are multiples of `x`. Write a function `filter_multiples(subset: List[int], x: int) ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_multiples([1, 2, 3, 4, 5], 2) == [1, 3, 5]\", \"assert filter_multiples([10, 15, 20, 25], 5) == []\", \"assert filter_multiples([7, 14, 21, 28], 7) == []\", \"assert filter_multiples([1, 0, -1, -2], 1) == [0, -1, -2]\", \"assert filter_multiples([5, 1...
{ "split": "train", "index": 3002, "acecode_id": "bigcode_python_fns_43833", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement the Insertion Sort algorithm to sort a list of float numbers in ascending order. Create a function called `insertion_sort` that takes a single argument, the input list of float numbers. The function should sort the list using the Insertion Sort algorithm and return th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert insertion_sort([3.5, 2.1, 6.9, 1.5, 4.3, 7.8]) == [1.5, 2.1, 3.5, 4.3, 6.9, 7.8]\", \"assert insertion_sort([1.1, 2.2, 3.3, 4.4]) == [1.1, 2.2, 3.3, 4.4]\", \"assert insertion_sort([4.9, 3.8, 2.7, 1.6]) == [1.6, 2.7, 3.8, 4.9]\", \"assert insertion_sort([5.0...
{ "split": "train", "index": 3003, "acecode_id": "evol_1603", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with processing an array of strings and creating a dictionary where each string is a key that maps to an array containing the string 'default' followed by the string itself. Given an input array of strings, your function should return the constructed dictionary. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_places_dict(['item1', 'item2', 'item3']) == {'item1': ['default', 'item1'], 'item2': ['default', 'item2'], 'item3': ['default', 'item3']}\", \"assert create_places_dict(['apple', 'banana']) == {'apple': ['default', 'apple'], 'banana': ['default', 'ban...
{ "split": "train", "index": 3004, "acecode_id": "oss_33250", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, return a list of all unique combinations of three indices such that the corresponding values in the array sum up to a specific target. Each input will have at least one valid combination, and the same element cannot be used more than once for any sin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_indices([1, 2, 3, 4, 5], 6) == [(0, 1, 2)]\", \"assert find_indices([4, 4, 4, 4, 4, 4], 12) == [(0, 1, 2)]\", \"assert find_indices([5, 5, 5, 5, 5], 15) == [(0, 1, 2)]\", \"assert find_indices([0, 0, 0, 0, 0], 0) == [(0, 1, 2)]\", \"assert find_indices(...
{ "split": "train", "index": 3005, "acecode_id": "evol_28943", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Write a function `generate_lucas_sequence(n)` that generates the first n Lucas numbers. The function should return a list of Lucas numbers. If the input n is less than 1 or not an integer, the function should return an error message 'Error: input must be an integer greater than...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_lucas_sequence(1) == [2]\", \"assert generate_lucas_sequence(2) == [2, 1]\", \"assert generate_lucas_sequence(3) == [2, 1, 3]\", \"assert generate_lucas_sequence(4) == [2, 1, 3, 4]\", \"assert generate_lucas_sequence(5) == [2, 1, 3, 4, 7]\", \"asser...
{ "split": "train", "index": 3006, "acecode_id": "evol_22275", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a function that scales the dimensions of a video while ensuring that the bitrate adheres to certain constraints. Your task is to implement a function that takes in the current width, current height, and a target width and height, and returns a tuple containing the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert scale_video(1920, 1080, 960, 540) == (960, 540, True)\", \"assert scale_video(1280, 720, 640, 360) == (640, 360, True)\", \"assert scale_video(800, 600, 1000, 750) == (1000, 750, True)\", \"assert scale_video(300, 200, 150, 100) == (150, 100, True)\", \"asse...
{ "split": "train", "index": 3007, "acecode_id": "bigcode_python_fns_49673", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the connection result of a client to a message broker. The function should take four parameters: `client_id` (a string representing the ID of the client), `userdata` (a string representing additional user data), `flags` (a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert connection_result('client2', 'data', [], 1) == 'Client client2 connected with reason code 1. Userdata: data. Flags: []'\", \"assert connection_result('client6', 'some_data', [], 5) == 'Client client6 connected with reason code 5. Userdata: some_data. Flags: ...
{ "split": "train", "index": 3008, "acecode_id": "bigcode_python_fns_40613", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given two lists of integers, `molecular_characterization` and `raw_expression`, write a function `transform_expression_molecular_data` that takes these two lists as input and returns a new list containing the sum of elements at corresponding positions from both lists. If one li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transform_expression_molecular_data([1, 2, 3], [4, 5]) == [5, 7, 3]\", \"assert transform_expression_molecular_data([1, 2], [3, 4, 5]) == [4, 6, 5]\", \"assert transform_expression_molecular_data([1, 2, 3, 4], []) == [1, 2, 3, 4]\", \"assert transform_expres...
{ "split": "train", "index": 3009, "acecode_id": "bigcode_python_fns_49390", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the kinetic energy of an object given its mass and velocity. The formula for kinetic energy is: `kinetic_energy = 0.5 * mass * velocity^2`. Implement a function `calculate_kinetic_energy(mass: float, velocity: float) -> float` that takes in the m...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_kinetic_energy(10, 20) == 2000.0\", \"assert calculate_kinetic_energy(5, 15) == 562.5\", \"assert calculate_kinetic_energy(0, 10) == 0.0\", \"assert calculate_kinetic_energy(10, 0) == 0.0\", \"assert calculate_kinetic_energy(2, 3) == 9.0\", \"asser...
{ "split": "train", "index": 3010, "acecode_id": "oss_28356", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that returns a new list containing only the integers that appear more than once in the original list. The order of the integers in the output list should be the same as their first occurrence in the original list. If there are no d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_duplicates([1, 2, 3, 4, 5]) == []\", \"assert find_duplicates([1, 2, 3, 1, 2, 3]) == [1, 2, 3]\", \"assert find_duplicates([5, 5, 5, 5]) == [5]\", \"assert find_duplicates([10, 20, 30, 10, 20]) == [10, 20]\", \"assert find_duplicates([1, 2, 3, 4, 5, 6, ...
{ "split": "train", "index": 3011, "acecode_id": "bigcode_python_fns_7526", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a binary code string representing toys in a franchise, where '0' represents a puzzle game and '1' represents a doll, write a function that counts the number of puzzle games and dolls in that franchise. The total number of toys in each store follows the ratio of 5 puzzle g...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_toys('00000000') == (5, 3)\", \"assert count_toys('010') == (1, 1)\", \"assert count_toys('111000000') == (5, 3)\", \"assert count_toys('00001111') == (5, 3)\", \"assert count_toys('001') == (1, 1)\"]}" }
{ "split": "train", "index": 3012, "acecode_id": "evol_12719", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are asked to create a Python function that simulates retrieving the last commit date for a given file in a Git repository. The function should take a string `file` representing the file path and return a string representing the timestamp of the last commit that modified the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert last_commit_date('example.py') == '2023-10-01 12:00:00'\", \"assert last_commit_date('script.js') == '2023-09-15 08:30:00'\", \"assert last_commit_date('missing.py') == 'File not found'\", \"assert last_commit_date('unknown.txt') == 'File not found'\", \"ass...
{ "split": "train", "index": 3013, "acecode_id": "oss_14414", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function `find_max_sum_subarray(arr: List[int], k: int) -> int` that returns the maximum sum of any contiguous subarray of size `k` in the list. If the size `k` is greater than the length of the list, return 0.\nPlease reason step by step, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_max_sum_subarray([1, 2, 3, 4, 5], 3) == 12\", \"assert find_max_sum_subarray([1, 4, 2, 10, 23, 3, 1, 0, 20], 4) == 39\", \"assert find_max_sum_subarray([-1, -2, -3, -4], 2) == -3\", \"assert find_max_sum_subarray([2, 3, 4, 5, 6], 5) == 20\", \"assert fi...
{ "split": "train", "index": 3014, "acecode_id": "evol_15482", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function named `consonants_count` that takes a string `s` and computes the total number of consonants present in the string. Consonants include all alphabets except 'a', 'e', 'i', 'o', 'u', and 'y' ONLY when it appears at the end of the provided word. The function s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert consonants_count('ACEDY') == 2\", \"assert consonants_count('hello world') == 7\", \"assert consonants_count('12345!@#') == 0\", \"assert consonants_count('Python3.8') == 5\", \"assert consonants_count('Y') == 0\", \"assert consonants_count('Yard') == 3\", \...
{ "split": "train", "index": 3015, "acecode_id": "evol_28646", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a list of integers representing the heights of buildings, write a function `max_visible_buildings(heights: List[int]) -> int` that calculates the maximum number of contiguous buildings that are visible from the left. A building is visible from the left if it is taller tha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_visible_buildings([3, 1, 4, 1, 5]) == 3\", \"assert max_visible_buildings([1, 2, 3, 4, 5]) == 5\", \"assert max_visible_buildings([5, 4, 3, 2, 1]) == 1\", \"assert max_visible_buildings([2, 2, 2, 2, 2]) == 1\", \"assert max_visible_buildings([1, 3, 2, 4,...
{ "split": "train", "index": 3016, "acecode_id": "bigcode_python_fns_21636", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating the behavior of a web browser that interacts with multiple links. Your goal is to implement the `handle_links` function, which takes a list of links as input and performs a series of actions on each link. The function should iterate through the li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert handle_links(['link1', 'link2', 'link3']) == ['opened', 'opened', 'opened']\", \"assert handle_links(['linkA', 'linkB', 'linkC']) == ['not opened', 'not opened', 'not opened']\", \"assert handle_links(['link1']) == ['opened']\", \"assert handle_links([]) == ...
{ "split": "train", "index": 3017, "acecode_id": "oss_1356", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with creating a command line parser that processes a list of commands. Each command is represented as a string, and the parser should return a dictionary containing the command and its associated arguments. The commands are structured in the following way: the fi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_command('run --name Alice --age 30') == {'command': 'run', 'args': {'name': 'Alice', 'age': '30'}}\", \"assert parse_command('delete --id 42') == {'command': 'delete', 'args': {'id': '42'}}\", \"assert parse_command('list') == {'command': 'list', 'args...
{ "split": "train", "index": 3018, "acecode_id": "bigcode_python_fns_43974", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `is_afni_available()` that checks if a certain software package called AFNI is available. The function should return `True` if AFNI is not available, and `False` if it is available. For the purpose of this function, you can simulate t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_afni_available(None) == True\", \"assert is_afni_available('1.0.0') == False\", \"assert is_afni_available('2.5.1') == False\", \"assert is_afni_available('3.3.2') == False\", \"assert is_afni_available('0.0.1') == False\", \"assert is_afni_available('4.2...
{ "split": "train", "index": 3019, "acecode_id": "bigcode_python_fns_28657", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that repositions all numerical values to the end of the provided string, preserving the original sequence of non-numerical elements. The function should also return the count of distinct numbers identified in the string. The numbers can be integers, negative nu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reposition_numbers('abc 123 def 456') == ('abc def 123 456', 2)\", \"assert reposition_numbers('5 apples and 10 oranges') == ('apples and oranges 5 10', 2)\", \"assert reposition_numbers('3.14 pi is a number') == ('pi is a number 3.14', 1)\", \"assert reposi...
{ "split": "train", "index": 3020, "acecode_id": "evol_5218", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of project names and a framework name, and adds the specified framework to each project in the list. The function should return a list of projects where each project is represented as a dictionary containing its name and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_framework_to_projects(['Project A', 'Project B'], 'Flask') == [{'name': 'Project A', 'frameworks': ['Flask']}, {'name': 'Project B', 'frameworks': ['Flask']}]\", \"assert add_framework_to_projects(['Project X'], 'React') == [{'name': 'Project X', 'framew...
{ "split": "train", "index": 3021, "acecode_id": "oss_28924", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string that contains a file path pattern with a placeholder for a fold number represented by '%d'. Your task is to implement a function that takes this string and an integer representing the fold number. The function should return the formatted file path where t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_file_path('data/fold_%d.hdf5', 0) == 'data/fold_0.hdf5'\", \"assert format_file_path('data/fold_%d.hdf5', 1) == 'data/fold_1.hdf5'\", \"assert format_file_path('results/fold_%d/results.csv', 2) == 'results/fold_2/results.csv'\", \"assert format_file_p...
{ "split": "train", "index": 3022, "acecode_id": "bigcode_python_fns_49523", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of edges represented as tuples (u, v, cost), where u and v are the vertices connected by the edge and cost is the weight of that edge, implement a function called `min_cost_edge` that returns the edge with the lowest cost. If there are multiple edges with the same ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert min_cost_edge([(1, 2, 5), (2, 3, 10), (1, 3, 3)]) == (1, 3, 3)\", \"assert min_cost_edge([(0, 1, 1), (1, 2, 2), (0, 2, 3)]) == (0, 1, 1)\", \"assert min_cost_edge([(1, 4, 7), (2, 4, 7), (3, 4, 2)]) == (3, 4, 2)\", \"assert min_cost_edge([(5, 6, 4), (5, 7, 1)...
{ "split": "train", "index": 3023, "acecode_id": "bigcode_python_fns_9760", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function that takes a list of non-negative integers and returns a list of tuples. Each tuple should contain two elements: the first element is the input integer tripled, and the second element is the running average of all tripled values up to that index. If any input ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert triples_and_averages([2, 7, 15]) == [(6, 6.0), (21, 13.5), (45, 24.0)]\", \"assert triples_and_averages([0, 1, 2]) == [(0, 0.0), (3, 1.5), (6, 3.0)]\", \"assert triples_and_averages([10, 20, 30]) == [(30, 30.0), (60, 45.0), (90, 60.0)]\", \"assert triples_an...
{ "split": "train", "index": 3024, "acecode_id": "evol_31214", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that parses a time interval string and returns the total number of seconds it represents. The time interval string can have the following format: \"X days, HH:MM:SS\" or \"HH:MM:SS\" where X is the number of days, HH is the number ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_time_interval('1 day, 00:00:00') == 86400\", \"assert parse_time_interval('0 days, 00:00:01') == 1\", \"assert parse_time_interval('-2 days, 00:00:00') == -172800\", \"assert parse_time_interval('0 days, 12:00:00') == 43200\", \"assert parse_time_inter...
{ "split": "train", "index": 3025, "acecode_id": "oss_8625", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Create a function named 'getIllustrator' that takes an instance of the 'GraphicNovel' class and returns the name of the illustrator. The 'GraphicNovel' class is defined with a constructor that requires a title, author, pages, and illustrator. Implement the 'getIllustrator' func...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert getIllustrator(GraphicNovel('Title1', 'Author1', 100, 'Illustrator1')) == 'Illustrator1'\", \"assert getIllustrator(GraphicNovel('Title2', 'Author2', 200, 'Illustrator2')) == 'Illustrator2'\", \"assert getIllustrator(GraphicNovel('Title3', 'Author3', 300, 'I...
{ "split": "train", "index": 3026, "acecode_id": "evol_14951", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that transforms a provided YAML data string into a JSON string. The function should handle errors for invalid YAML data structure and return None if an error occurs. It should also support nested arrays and objects. The function should be named `yaml_to_json` a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert yaml_to_json('Invalid YAML: [\\\\n- id: 001\\\\n- name: John Doe\\\\n') is None\", \"assert yaml_to_json('Invalid Key: !@#$%^&*()') is None\", \"assert yaml_to_json('nested:\\\\n object:\\\\n key: value\\\\n') == '{\\\"nested\\\": {\\\"object\\\": {\\\"k...
{ "split": "train", "index": 3027, "acecode_id": "evol_26008", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `get_system_info()` that returns a dictionary containing system information. The dictionary should include the following keys with their corresponding values: 'commit', 'python', 'python-bits', 'OS', 'OS-release', 'Version', 'machine', 'p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_system_info() == {'commit': 'abc123', 'python': '3.9.1', 'python-bits': 64, 'OS': 'Linux', 'OS-release': '5.4.0', 'Version': '#1 SMP Debian 5.4.40-4 (2021-01-12)', 'machine': 'x86_64', 'processor': 'x86_64', 'byteorder': 'little', 'LC_ALL': None, 'LANG':...
{ "split": "train", "index": 3028, "acecode_id": "bigcode_python_fns_41674", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that processes a given image size and a list of image names. Your function should take in the following parameters: \n- `input_size`: A tuple representing the size of the input images in the format (width, height). \n- `image_n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_images((1280, 720), ['image1.jpg', 'image2.jpg']) == ((1280, 720), ['image1.jpg', 'image2.jpg'])\", \"assert process_images((640, 480), ['photo1.png', 'photo2.png', 'photo3.png']) == ((640, 480), ['photo1.png', 'photo2.png', 'photo3.png'])\", \"asser...
{ "split": "train", "index": 3029, "acecode_id": "oss_23018", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that counts the total number of characters in a list of strings. The function should take a list of strings as input and return an integer representing the total character count. The character count should include all characters in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_total_characters(['Hello', 'World']) == 10\", \"assert count_total_characters(['A', 'B', 'C']) == 3\", \"assert count_total_characters(['Spaces ', 'at the end ']) == 20\", \"assert count_total_characters(['']) == 0\", \"assert count_total_characters(...
{ "split": "train", "index": 3030, "acecode_id": "oss_3190", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a log filename based on a given prefix string. If the prefix is provided, the function should return a filename in the format '{prefix}_logfile.log'. If the prefix is not provided (i.e., it is an empty string or None), the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_log_filename('myapp') == 'myapp_logfile.log'\", \"assert generate_log_filename('') == 'logfile.log'\", \"assert generate_log_filename(None) == 'logfile.log'\", \"assert generate_log_filename('test') == 'test_logfile.log'\", \"assert generate_log_fil...
{ "split": "train", "index": 3031, "acecode_id": "bigcode_python_fns_25565", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes a list of cards and returns a shuffled version of that list. The input list will contain the following cards: ['Ace', 'King', 'Queen', 'Jack', '10', '9', '8', '7', '6', '5', '4', '3', '2']. The order of cards in the returned list should be random.\nP...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert shuffle_deck(['Ace', 'King', 'Queen', 'Jack', '10', '9', '8', '7', '6', '5', '4', '3', '2']) != ['Ace', 'King', 'Queen', 'Jack', '10', '9', '8', '7', '6', '5', '4', '3', '2']\", \"assert len(shuffle_deck(['Ace', 'King', 'Queen', 'Jack', '10', '9', '8', '7', ...
{ "split": "train", "index": 3032, "acecode_id": "evol_20656", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `format_number` that takes an integer or float `number` and a boolean `space`. The function should return a string representation of the number formatted with a separator for every thousand. If `space` is True, use spaces as the separator; otherwise, use commas...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_number(1234567, True) == '1 234 567'\", \"assert format_number(1234567, False) == '1,234,567'\", \"assert format_number(1234567.89, True) == '1 234 567.89'\", \"assert format_number(1234567.89, False) == '1,234,567.89'\", \"assert format_number(-12345...
{ "split": "train", "index": 3033, "acecode_id": "bigcode_python_fns_27857", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a sorted list of distinct integers `nums` and a target integer `target`. Write a function `searchInsert` that returns the index where the target should be inserted in the list `nums` to maintain its sorted order. If the target is already present in the list, the f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert searchInsert([1, 3, 5, 6], 5) == 2\", \"assert searchInsert([1, 3, 5, 6], 2) == 1\", \"assert searchInsert([1, 3, 5, 6], 7) == 4\", \"assert searchInsert([1, 3, 5, 6], 0) == 0\", \"assert searchInsert([], 5) == 0\", \"assert searchInsert([2, 4, 6, 8, 10], 6)...
{ "split": "train", "index": 3034, "acecode_id": "oss_2100", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that represents a 2D point with x and y coordinates. Your function should take two optional parameters, `coordX` and `coordY`, which default to 0. The function should update the coordinates to the new values provided and return a tupl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_point() == (0, 0)\", \"assert update_point(1, 2) == (1, 2)\", \"assert update_point(-1, -2) == (-1, -2)\", \"assert update_point(5, 0) == (5, 0)\", \"assert update_point(0, 5) == (0, 5)\", \"assert update_point(3, 4) == (3, 4)\", \"assert update_point...
{ "split": "train", "index": 3035, "acecode_id": "oss_28019", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function `triple_square_sum(lst)` that returns the cumulative sum of the cubes of each even, non-negative integer that is not divisible by 5 and is also not a prime number. If the list contains no valid numbers or is empty, the function sho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert triple_square_sum([2, 4, 5, 0]) == 64\", \"assert triple_square_sum([-1, -2, 0]) == 0\", \"assert triple_square_sum([8, -3]) == 512\", \"assert triple_square_sum([0]) == 0\", \"assert triple_square_sum([20, 30, 40]) == 0\", \"assert triple_square_sum([]) == ...
{ "split": "train", "index": 3036, "acecode_id": "evol_34035", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given two lists of 2D points, each representing fiducial markers in an image. Each fiducial marker is represented as a tuple of two integers (x, y). Your task is to implement a function that sorts the fiducials in the second list ('qr_b') such that their arrangement mat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_fiducials([(1, 1), (2, 2)], [(2, 2), (1, 1)]) == ([(1, 1), (2, 2)], [(1, 1), (2, 2)])\", \"assert sort_fiducials([(0, 0), (1, 1)], [(1, 1), (0, 0)]) == ([(0, 0), (1, 1)], [(0, 0), (1, 1)])\", \"assert sort_fiducials([(3, 3), (4, 4)], [(4, 4), (3, 3)]) =...
{ "split": "train", "index": 3037, "acecode_id": "bigcode_python_fns_39329", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the behavior of a screenshot capture system. The function `capture_screenshot` should take the following parameters: \n1. `x` (int): The x-coordinate of the mouse click. \n2. `y` (int): The y-coordinate of the mouse click...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert capture_screenshot(100, 200, 'left', True) == 'Screenshot captured at (100, 200) with button: left'\", \"assert capture_screenshot(150, 250, 'right', True) == 'Screenshot captured at (150, 250) with button: right'\", \"assert capture_screenshot(300, 400, 'mi...
{ "split": "train", "index": 3038, "acecode_id": "oss_8998", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with modifying a list of query points for a database system. Implement a function `modify_query_points(query_points: List[str]) -> List[str]` that takes a list of query points as input and returns a modified list. The function should ensure that any query point t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert modify_query_points(['fold', 'optional', 'class:Person', 'recursion', 'class:Company', 'class:Product']) == ['fold', 'optional', 'class:Person', 'recursion', 'class:Company', 'class:Product']\", \"assert modify_query_points(['fold', 'class:Person', 'recursio...
{ "split": "train", "index": 3039, "acecode_id": "oss_14148", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a basic logging system for a Mars rover software module. The function should handle logging messages at different levels: debug, info, warning, error, and critical. Your function should take the following parameters: a stri...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert log_message('debug', 'This is a debug message') == '[DEBUG] - This is a debug message'\", \"assert log_message('info', 'This is an info message') == '[INFO] - This is an info message'\", \"assert log_message('warning', 'This is a warning message') == '[WARNI...
{ "split": "train", "index": 3040, "acecode_id": "oss_33733", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that processes a list of integers by removing all duplicates, elements that occur more than a specified threshold, prime numbers, and negative integers. The function should return two lists: one containing the remaining elements in their original order and ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_duplicates([11, 13, 17, 19, 23, 29], 0) == ([], [11, 13, 17, 19, 23, 29])\", \"assert remove_duplicates([2, 3, 5, 7, 9, 11, 13], 1) == ([9], [2, 3, 5, 7, 11, 13])\", \"assert remove_duplicates([-1, -2, -3, -4, -5], 2) == ([], [-1, -2, -3, -4, -5])\", ...
{ "split": "train", "index": 3041, "acecode_id": "evol_22004", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Implement a function `generate_primes(start: int, end: int, count: int) -> List[int]` that generates a list of prime numbers within a given range, including both negative and positive values. The function should return exactly `count` prime numbers from the range `start` to `en...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_primes(-5, 11, 12) == [-5, -3, -2, 2, 3, 5, 7]\", \"assert generate_primes(-10, 0, 5) == [-7, -5, -3, -2]\", \"assert generate_primes(0, 10, 5) == [2, 3, 5, 7]\", \"assert generate_primes(-5, 5, 3) == [-5, -3, -2]\", \"assert generate_primes(0, 20, ...
{ "split": "train", "index": 3042, "acecode_id": "evol_18061", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Write a Python function to merge two strings together in a zigzag pattern. Given two strings, append characters from each string alternately. If the lengths of the strings are unequal, append the remaining characters of the longer string at the end of the resultant string. Defi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert zigzag_merge('abcdefg', '1234567') == 'a1b2c3d4e5f6g7'\", \"assert zigzag_merge('abc', '123456') == 'a1b2c3456'\", \"assert zigzag_merge('', '123456') == '123456'\", \"assert zigzag_merge('abcd', '') == 'abcd'\", \"assert zigzag_merge('a', '1') == 'a1'\", \"...
{ "split": "train", "index": 3043, "acecode_id": "evol_19063", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a binary number as a string, implement a function that converts it to its hexadecimal representation. The binary input will always be a valid binary number. The function should pad the binary string with leading zeros to make its length a multiple of 4 before conversion. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert binary_to_hex('1000') == '8'\", \"assert binary_to_hex('1111') == 'F'\", \"assert binary_to_hex('11010') == '1A'\", \"assert binary_to_hex('0000') == '0'\", \"assert binary_to_hex('101010') == '2A'\", \"assert binary_to_hex('11111111') == 'FF'\", \"assert bi...
{ "split": "train", "index": 3044, "acecode_id": "evol_21562", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the removal of files from a specified directory. The function should take a list of filenames and a directory path as input, and return a list of the filenames that were successfully 'removed'. For the purpose of this f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_files(['file1.txt', 'file2.txt'], '/home/user/') == ['file1.txt', 'file2.txt']\", \"assert remove_files(['document.pdf', 'image.png'], '/documents/') == ['document.pdf', 'image.png']\", \"assert remove_files(['notes.txt'], '/notes/') == ['notes.txt']\...
{ "split": "train", "index": 3045, "acecode_id": "bigcode_python_fns_40460", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two tuples representing coordinates in a 2D Cartesian plane, `cartesian_point` and `centre_point`, write a function `convert_to_origin(cartesian_point, centre_point)` that converts the coordinates in relation to a specified centre point to coordinates in relation to the o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_origin((1, 1), (2, 3)) == (3, 2)\", \"assert convert_to_origin((0, 0), (5, 5)) == (5, 5)\", \"assert convert_to_origin((-1, -1), (0, 0)) == (-1, 1)\", \"assert convert_to_origin((3, 4), (1, 1)) == (4, -3)\", \"assert convert_to_origin((10, 10), (0...
{ "split": "train", "index": 3046, "acecode_id": "bigcode_python_fns_10088", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of user feed URLs and a specific feed URL to delete, write a function `delete_feed(feed_urls: List[str], feed_url_to_delete: str) -> List[str]` that removes all occurrences of the specified feed URL from the list of user feed URLs. The function should return the up...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert delete_feed(['http://example.com/feed1', 'http://example.com/feed2', 'http://example.com/feed1'], 'http://example.com/feed1') == ['http://example.com/feed2']\", \"assert delete_feed(['http://example.com/feed1', 'http://example.com/feed2'], 'http://example.co...
{ "split": "train", "index": 3047, "acecode_id": "bigcode_python_fns_5213", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a configuration dictionary from given keyword arguments. The function should accept any number of keyword arguments and return a dictionary where each key corresponds to the keyword argument name and its value corresponds t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_config(a=1, b=2, c=3) == {'a': 1, 'b': 2, 'c': 3}\", \"assert generate_config(x='hello', y='world') == {'x': 'hello', 'y': 'world'}\", \"assert generate_config() == {}\", \"assert generate_config(name='Alice', age=30) == {'name': 'Alice', 'age': 30}...
{ "split": "train", "index": 3048, "acecode_id": "bigcode_python_fns_8361", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a function that checks if a given word can be formed by concatenating words from a given list of strings. The function should take two parameters: a list of strings `wordDict` representing the dictionary of words, and a string `word` that needs to be checked. The functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert canFormWord(['leet', 'code'], 'leetcode') == True\", \"assert canFormWord(['apple', 'pen'], 'applepenapple') == True\", \"assert canFormWord(['cats', 'dog', 'sand', 'and', 'cat'], 'catsanddog') == True\", \"assert canFormWord(['go', 'goal'], 'gogogoal') == T...
{ "split": "train", "index": 3049, "acecode_id": "oss_12794", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `find_median(nums)` that takes a list of floating point numbers and returns the median value. If the list is empty, the function should return None. The median is defined as the middle value in a sorted list of numbers. If the list has an even number of element...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_median([]) is None\", \"assert find_median([1.0]) == 1.0\", \"assert find_median([1.0, 2.0]) == 1.5\", \"assert find_median([3.0, 1.0, 2.0]) == 2.0\", \"assert find_median([-1.0, -2.0, -3.0]) == -2.0\", \"assert find_median([1.5, 2.5, 3.5, 4.5]) == 3.0\...
{ "split": "train", "index": 3050, "acecode_id": "evol_34961", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the Recall and Precision of a classification model based on two inputs: a dictionary containing predicted patterns and a dictionary containing actual patterns. The keys in the dictionaries represent different categories, and the values are lists ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_recall_precision({'A': ['p1', 'p2'], 'B': ['p3']}, {'A': ['p1', 'p2', 'p4'], 'B': ['p3', 'p5']}) == (0.6, 1.0)\", \"assert compute_recall_precision({}, {}) == (0.0, 0.0)\", \"assert compute_recall_precision({'A': ['p1', 'p2']}, {'A': ['p3', 'p4']}) =...
{ "split": "train", "index": 3051, "acecode_id": "bigcode_python_fns_23816", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function that removes all vowels, digits, and punctuation from a given string, preserving only consonants. The function should return the cleaned string. For example, given the input 'Hello, World! 123', the output should be 'HllWrld'.\nPlease reason step by step, t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_vowels_digits_and_punctuation('') == ''\", \"assert remove_vowels_digits_and_punctuation('abcdef#&*123\\\\nghijklm789') == 'bcdfghjklm'\", \"assert remove_vowels_digits_and_punctuation('abcdef456') == 'bcdf'\", \"assert remove_vowels_digits_and_punctu...
{ "split": "train", "index": 3052, "acecode_id": "evol_26122", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the ages of a group of people. Your task is to implement a function that determines the average age of the group. If the group is empty, return 0. The average age should be calculated as the sum of all ages divided by the number of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_age([20, 30, 40, 50]) == 35\", \"assert average_age([18, 22, 24, 30, 35]) == 25\", \"assert average_age([50]) == 50\", \"assert average_age([]) == 0\", \"assert average_age([100, 200, 300]) == 200\", \"assert average_age([23, 23, 23, 23]) == 23\", \"...
{ "split": "train", "index": 3053, "acecode_id": "bigcode_python_fns_38942", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Alice and Bob are playing a game with piles of stones arranged linearly. Each stone has a specific integer value as provided in the `stoneValue` array. Players take turns picking 1, 2, or 3 stones from the beginning of the remaining stones. Alice starts first. The objective is ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert stoneGameIII([1,2,3,7]) == 'Bob'\", \"assert stoneGameIII([10, -5, -3, 5]) == 'Alice'\", \"assert stoneGameIII([0,0,0]) == 'Tie'\", \"assert stoneGameIII([5, 10, 15]) == 'Alice'\", \"assert stoneGameIII([10, 20, -10, 5]) == 'Alice'\", \"assert stoneGameIII([...
{ "split": "train", "index": 3054, "acecode_id": "evol_28576", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given an array of integers representing the current state of an electric motor. Each integer corresponds to the motor's performance metrics such as current, voltage, and angular velocity. Your task is to implement a function that calculates the average of these performa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_performance_metrics([10, 20, 30]) == 20.0\", \"assert average_performance_metrics([-10, 0, 10]) == 0.0\", \"assert average_performance_metrics([0]) == 0.0\", \"assert average_performance_metrics([100, 200, 300, 400]) == 250.0\", \"assert average_perf...
{ "split": "train", "index": 3055, "acecode_id": "oss_4372", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a range of stars given in the format 'min-max' (e.g., '10-100') and returns a list of mock repository details for repositories falling within that range. Each repository detail should be represented as a dictionary containi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fetch_mock_repositories_by_stars('10-20') == [{'name': 'RepoA', 'owner': 'Owner1', 'stars': 15, 'url': 'http://repoa.com'}]\", \"assert fetch_mock_repositories_by_stars('0-10') == [{'name': 'RepoE', 'owner': 'Owner5', 'stars': 5, 'url': 'http://repoe.com'}]\...
{ "split": "train", "index": 3056, "acecode_id": "oss_12806", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries containing file information. Each dictionary represents a file with its name, chmod value, and content. Your task is to implement a function that takes this list of dictionaries and returns a new dictionary where the keys are the file names ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transform_file_info([{ 'name': 'file1.txt', 'chmod': 755, 'content': 'Hello World' }, { 'name': 'file2.txt', 'chmod': 644, 'content': 'Sample Text' }, { 'name': 'file1.txt', 'chmod': 700, 'content': 'Updated Content' }]) == {'file1.txt': {'chmod': 700, 'cont...
{ "split": "train", "index": 3057, "acecode_id": "bigcode_python_fns_28214", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of integers and returns a new list containing only the unique integers from the original list in sorted order. Your function should not modify the original list. Implement the function `get_unique_sorted_numbers(numbers:...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_sorted_numbers([3, 1, 2, 3, 2, 1]) == [1, 2, 3]\", \"assert get_unique_sorted_numbers([5, 3, 5, 7, 3, 1]) == [1, 3, 5, 7]\", \"assert get_unique_sorted_numbers([10, 9, 8, 10, 9]) == [8, 9, 10]\", \"assert get_unique_sorted_numbers([1, 1, 1, 1]) ==...
{ "split": "train", "index": 3058, "acecode_id": "oss_5506", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers and two indices, `start` and `stop`, return a sublist that includes all elements from the `start` index to the `stop` index (inclusive). If the `include_right_boundary` flag is set to False, return the sublist excluding the element at the `stop` index. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_sublist([10, 20, 30, 40, 50], 1, 3, True) == [20, 30, 40]\", \"assert get_sublist([10, 20, 30, 40, 50], 1, 3, False) == [20, 30]\", \"assert get_sublist([1, 2, 3, 4, 5], 0, 4, True) == [1, 2, 3, 4, 5]\", \"assert get_sublist([1, 2, 3, 4, 5], 0, 4, False)...
{ "split": "train", "index": 3059, "acecode_id": "bigcode_python_fns_1790", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that takes a dictionary representing configuration settings and a list of keys as input. The keys may include nested paths (e.g., 'section1.subsection2.key'). Your function should return a dictionary containing the values correspon...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_config_values({'database': {'host': 'localhost', 'port': 3306, 'credentials': {'username': 'user1', 'password': 'pass123'}, 'timeout': 30}, 'logging': {'level': 'info', 'path': '/var/log/app.log'}}, ['database.host', 'database.credentials.username', ...
{ "split": "train", "index": 3060, "acecode_id": "oss_11998", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 2D integer array, invert the elements within it such that the element in the top right corner swaps positions with the bottom left corner and do the same for all subsequent elements in the array. You must implement the solution without using any built-in functions or li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert invert_matrix([[1, 2], [3, 4]]) == [[4, 3], [2, 1]]\", \"assert invert_matrix([[1]]) == [[1]]\", \"assert invert_matrix([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == [[9, 8, 7], [6, 5, 4], [3, 2, 1]]\", \"assert invert_matrix([[1, 2], [3, 4], [5, 6]]) == [[6, 5], [4...
{ "split": "train", "index": 3061, "acecode_id": "evol_14741", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple model registry for machine learning models. Your goal is to create a function that simulates the behavior of adding models to the registry and retrieving them based on their names. The function should take in a list of model definitions...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert model_registry([{'name': 'modelA', 'instance': 'ModelAClass', 'type': 'classifier', 'input_type': 'array', 'output_type': 'label'}, {'name': 'modelB', 'instance': 'ModelBClass', 'type': 'regressor', 'input_type': 'array', 'output_type': 'value'}]) == ({'mode...
{ "split": "train", "index": 3062, "acecode_id": "oss_32090", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Write a function that takes a 3D matrix and returns a list of its elements in spiral order. The 3D matrix is structured as a list of 2D layers, where each layer is a list of lists. The function should traverse the matrix layer by layer, spirally extracting the elements. Impleme...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert spiral_order([[[1]]]) == [1]\", \"assert spiral_order([[[1, 2], [3, 4]]]) == [1, 2, 4, 3]\", \"assert spiral_order([]) == []\", \"assert spiral_order([[[1, 2]]]) == [1, 2]\", \"assert spiral_order([[[1]]]) == [1]\"]}" }
{ "split": "train", "index": 3063, "acecode_id": "evol_931", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing game names. Your task is to implement a function `find_game(game_list: List[str], game_name: str) -> Optional[str]` that checks if a specific game name exists in the list of game names. If the game is found, return the game name; oth...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_game(['The Legend of Zelda', 'Super Mario Bros', 'Minecraft'], 'Minecraft') == 'Minecraft'\", \"assert find_game(['The Legend of Zelda', 'Super Mario Bros', 'Minecraft'], 'Zelda') == None\", \"assert find_game(['Call of Duty', 'Halo', 'Valorant'], 'Halo...
{ "split": "train", "index": 3064, "acecode_id": "bigcode_python_fns_7775", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a dictionary of cases and their corresponding sections and constructs a structured response. The function should take a dictionary, `cases_db`, where each key is a case ID (an integer) and each value is a list of string...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert construct_response({1: ['Introduction', 'Background', 'Analysis'], 2: ['Introduction', 'Methodology', 'Results', 'Conclusion'], 3: ['Overview', 'Data', 'Analysis']}) == {'success': False, 'response': {'results': [{'case_id': 1, 'sections': ['Introduction', '...
{ "split": "train", "index": 3065, "acecode_id": "oss_37030", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a dictionary of parameters and their values as input and returns a formatted string representing the parameters in a URL query string format. The URL query string format consists of key-value pairs where each key-value pair...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_query_string({'name': 'John Doe', 'age': 30, 'city': 'New York'}) == 'name=John%20Doe&age=30&city=New%20York'\", \"assert format_query_string({'key with spaces': 'value with spaces'}) == 'key%20with%20spaces=value%20with%20spaces'\", \"assert format_q...
{ "split": "train", "index": 3066, "acecode_id": "oss_473", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `get_device_protocol_controller` that takes a string `protocol` as input and returns a string indicating whether the protocol is supported or not. The function should return 'Supported' if the protocol is one of the following: 'HTTP', 'FTP', 'SMTP', 'TCP', ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_device_protocol_controller('HTTP') == 'Supported'\", \"assert get_device_protocol_controller('FTP') == 'Supported'\", \"assert get_device_protocol_controller('SMTP') == 'Supported'\", \"assert get_device_protocol_controller('TCP') == 'Supported'\", \"ass...
{ "split": "train", "index": 3067, "acecode_id": "bigcode_python_fns_35590", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer length, construct a unique sequence of characters containing only the letters 'x', 'y', and 'z'. The sequence must follow a specific pattern where 'x', 'y', and 'z' occur at least once in every group of four characters. Implement a function `construct_string(le...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert construct_string(4) == 'xyzx'\", \"assert construct_string(1) == 'x'\", \"assert construct_string(2) == 'xy'\", \"assert construct_string(3) == 'xyz'\", \"assert construct_string(0) == ''\", \"assert construct_string(-4) == ''\"]}" }
{ "split": "train", "index": 3068, "acecode_id": "evol_27521", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are given a list of subjects and a list of sessions. Your task is to implement a function `generate_combinations(subjects: List[str], sessions: List[str]) -> List[str]` that generates all possible combinations of subjects and sessions in the format 'subject-session'. The in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_combinations(['Math', 'Science'], ['Morning', 'Afternoon']) == ['Math-Morning', 'Math-Afternoon', 'Science-Morning', 'Science-Afternoon']\", \"assert generate_combinations(['English'], ['Evening']) == ['English-Evening']\", \"assert generate_combina...
{ "split": "train", "index": 3069, "acecode_id": "bigcode_python_fns_43158", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given the head of a singly linked list, write a function `hasCycle(head)` that returns True if there is a cycle in the linked list, and False otherwise. A linked list is said to have a cycle if any node is visited more than once during traversal.\nPlease reason step by step, th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert hasCycle(None) == False\", \"assert hasCycle(ListNode(1, ListNode(2, ListNode(3)))) == False\", \"assert hasCycle(ListNode(1, ListNode(2, ListNode(3, ListNode(4, ListNode(5)))))) == False\", \"assert hasCycle(ListNode(1)) == False\", \"assert hasCycle(ListNo...
{ "split": "train", "index": 3070, "acecode_id": "evol_9658", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves a user based on their name from a simulated user database. If the user does not exist, you should create a new user with the specified attributes. The function should take in a dictionary containing user attributes and retu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert getUser([], {'name': 'Alice', 'email': 'alice@example.com', 'age': 30}) == {'name': 'Alice', 'email': 'alice@example.com', 'age': 30, 'status': 'created'}\", \"assert getUser([{'name': 'Alice', 'email': 'alice@example.com', 'age': 30}], {'name': 'Alice', 'em...
{ "split": "train", "index": 3071, "acecode_id": "bigcode_python_fns_26960", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing a spectrum. Your task is to find the ranges of indices where the spectrum has consecutive positive or negative values. Implement a function that takes three parameters: the spectrum (a list of integers), a string 'peak' which can be...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_ranges([-1, -2, -3, 1, 2, 3], 'negative', None) == ([3], [(0, 3)])\", \"assert find_ranges([1, 0, 2, 0, 3], 'positive', None) == ([1, 1, 1], [(0, 1), (2, 3), (4, 5)])\", \"assert find_ranges([-1, 0, 1, 2, 0, -2], 'negative', None) == ([1, 1], [(0, 1), (...
{ "split": "train", "index": 3072, "acecode_id": "bigcode_python_fns_31483", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that performs a specified arithmetic operation on a list of numbers. Write a function `perform_operation(numbers: List[int], operation: str) -> int` that takes in a list of integers `numbers` and a string `operation`. The function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert perform_operation([1, 2, 3, 4, 5], 'add') == 15\", \"assert perform_operation([1, 2, 3, 4, 5], 'multiply') == 120\", \"assert perform_operation([], 'add') == 0\", \"assert perform_operation([0, 1, 2], 'add') == 3\", \"assert perform_operation([5], 'add') == ...
{ "split": "train", "index": 3073, "acecode_id": "oss_12993", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the opening of a pool ledger configuration. The function should accept two parameters: a string 'pool_name' representing the name of the pool ledger configuration, and a string 'pool_genesis_txn_file' representing the pool ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert open_pool_ledger('TestPool', 'config.json') == 'Pool ledger opened successfully: TestPool'\", \"assert open_pool_ledger('MainPool', '') == 'Pool ledger opened successfully: MainPool'\", \"assert open_pool_ledger('UserPool', 'user_config.json') == 'Pool ledge...
{ "split": "train", "index": 3074, "acecode_id": "bigcode_python_fns_28783", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of tuples, where each tuple contains a date in the format 'YYYY-MM-DD' and a corresponding temperature in degrees Fahrenheit. Your task is to write a function that calculates the average temperature for each month and returns the result as a dictionary wher...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_monthly_avg_temperatures([('2005-07-29', 57), ('2005-07-30', 95), ('2005-07-31', 79), ('2005-08-01', 81), ('2005-08-02', 68), ('2005-08-03', 72), ('2005-09-01', 65), ('2005-09-02', 70)]) == {'2005-07': 77.0, '2005-08': 73.66666666666667, '2005-09':...
{ "split": "train", "index": 3075, "acecode_id": "oss_10773", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that determines the largest integer in an unordered array of unique as well as duplicate numbers. The function should return a tuple containing the largest integer and the count of its occurrences. Additionally, the function should raise exceptions for cases wh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert findMaxValue([6, 8, 1, 3, 4, 8]) == (8, 2)\", \"assert findMaxValue([10, 20, 30, 20, 10]) == (30, 1)\", \"assert findMaxValue([-1, -2, -3, -4, -5]) == (-1, 1)\", \"assert findMaxValue([1]) == (1, 1)\", \"assert findMaxValue([1, 2, 3, 4, 5]) == (5, 1)\", \"as...
{ "split": "train", "index": 3076, "acecode_id": "evol_12092", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers where each integer represents a unique URL identifier. Your task is to implement a function that takes this list as input and returns the sum of all the URL identifiers. The function should ignore any negative identifiers in the list. Write a fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_url_ids([1, 2, 3]) == 6\", \"assert sum_url_ids([-1, -2, -3]) == 0\", \"assert sum_url_ids([4, -5, 6]) == 10\", \"assert sum_url_ids([10, 20, 30, -10]) == 60\", \"assert sum_url_ids([]) == 0\", \"assert sum_url_ids([0]) == 0\", \"assert sum_url_ids([-1, ...
{ "split": "train", "index": 3077, "acecode_id": "bigcode_python_fns_32450", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that converts a list of string data elements to their specified data types. Write a function `cast_row(data_types, data)` that takes in two parameters: \n- `data_types` (list of str): A list of data types in string format, such as 'in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cast_row(['int', 'str', 'float'], ['10', 'hello', '3.14']) == [10, 'hello', 3.14]\", \"assert cast_row(['float', 'str', 'int'], ['2.71', 'world', '5']) == [2.71, 'world', 5]\", \"assert cast_row(['str', 'str', 'float'], ['apple', 'banana', '0.99']) == ['appl...
{ "split": "train", "index": 3078, "acecode_id": "oss_5960", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple logging system for a software application. The logging system consists of a `Logger` class and a `LogEntry` class. The `Logger` class should have an `__init__` method that initializes the logger with a default name of 'DefaultLogger'. T...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert Logger().name == 'DefaultLogger'\", \"assert Logger().log('Test message', False).message == 'Test message'\", \"assert Logger().log('Error occurred', True).is_error == True\", \"assert Logger().log('Info log', False).is_error == False\", \"assert Logger().lo...
{ "split": "train", "index": 3079, "acecode_id": "oss_5359", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given the weights of three different types of lemons: 2 kg for the first type, 3 kg for the second type, and 5 kg for the third type, write a function that determines how many of each type of lemon are needed to produce a bag of lemons weighing exactly `totalWeight` kg. The fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_lemon_weights(0) == (0, 0, 0)\", \"assert calculate_lemon_weights(2) == (1, 0, 0)\", \"assert calculate_lemon_weights(3) == (0, 1, 0)\", \"assert calculate_lemon_weights(5) == (0, 0, 1)\", \"assert calculate_lemon_weights(10) == (0, 0, 2)\", \"asse...
{ "split": "train", "index": 3080, "acecode_id": "evol_24950", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with validating configuration settings for a data processing pipeline. Specifically, you need to implement a function that checks if the given output folder and S3 bucket parameters are valid. The function should take two parameters: an output folder, which must ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_pipeline_config('data_output', 'my-s3-bucket') == True\", \"assert validate_pipeline_config('data_output', '') == False\", \"assert validate_pipeline_config('', 'my-s3-bucket') == False\", \"assert validate_pipeline_config('', '') == False\", \"asse...
{ "split": "train", "index": 3081, "acecode_id": "oss_13171", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `check_product(numbers)` that checks whether the product of numbers in a list is even or not, and identifies the index of the first odd number in the list. If there are no odd numbers, the function should return -1. The function should be optimized to handle la...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_product([2, 4, 6, 8]) == (True, -1)\", \"assert check_product([0, 0, 0]) == (True, -1)\", \"assert check_product([1, 1, 1, 1]) == (False, 0)\", \"assert check_product([5, 7, 9]) == (False, 0)\", \"assert check_product([2, 4, 0, 8]) == (True, -1)\", \"a...
{ "split": "train", "index": 3082, "acecode_id": "evol_10782", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are required to implement a function named `calculate_discounted_price` in Python that takes three parameters: `name` (a string), `price` (a float), and `discount_percentage` (a float). The function should calculate and return the discounted price based on the given percent...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_discounted_price('Product A', 100.0, 20.0) == 80.0\", \"assert calculate_discounted_price('Product B', 200.0, 30.0) == 140.0\", \"assert calculate_discounted_price('Product C', 150.0, 35.0) == 150.0\", \"assert calculate_discounted_price('Product D...
{ "split": "train", "index": 3083, "acecode_id": "evol_18787", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a Python function that takes three separate string inputs and concatenates each string's characters in reverse order. Implement a function named `reverse_concatenate` that takes three strings `s1`, `s2`, and `s3` as input and returns a single string that is the result of...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_concatenate('hello', 'world', 'python') == 'nohtypdlrowolleh'\", \"assert reverse_concatenate('a', 'b', 'c') == 'cba'\", \"assert reverse_concatenate('123', '456', '789') == '987654321'\", \"assert reverse_concatenate('abc', 'def', 'ghi') == 'ihgfedc...
{ "split": "train", "index": 3084, "acecode_id": "evol_15333", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with validating identifier names in a programming language. Implement a function `validate_identifier(name: str) -> bool` that checks if the given identifier name adheres to the following rules: 1. The name must start with a letter (uppercase or lowercase). 2. Af...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_identifier('validName123') == True\", \"assert validate_identifier('Valid_Name@1') == True\", \"assert validate_identifier('name$variable') == True\", \"assert validate_identifier('NameWithDigits123') == True\", \"assert validate_identifier('name@')...
{ "split": "train", "index": 3085, "acecode_id": "oss_36571", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function that generates a random password of length 8 characters, ensuring that the password contains at least one uppercase letter, one lowercase letter, one digit, and one special character. The function should return the generated password as a string.\nPlease...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert len(generate_password()) == 8\", \"assert any(c.isupper() for c in generate_password())\", \"assert any(c.islower() for c in generate_password())\", \"assert any(c.isdigit() for c in generate_password())\", \"assert any(c in string.punctuation for c in gener...
{ "split": "train", "index": 3086, "acecode_id": "evol_17295", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that detects whether there exists a combination of numbers from the list whose product is equal to a specified desired value. The function should return True if such a combination exists, and False otherwise. The input list can con...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert detect_combination([2, 3, 5, 10], 15) == True\", \"assert detect_combination([1, 2, 3, 4], 12) == True\", \"assert detect_combination([2, 2, 3], 12) == True\", \"assert detect_combination([5, 3, 1], 15) == True\", \"assert detect_combination([1, 1, 1, 1], 1)...
{ "split": "train", "index": 3087, "acecode_id": "evol_21161", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing a sequence of bytes in hexadecimal format. Your task is to write a function that extracts the byte values from this hexadecimal string and returns them as a list of integers. The hexadecimal string is guaranteed to have an even length and onl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_bytes('1a2b3c') == [26, 43, 60]\", \"assert extract_bytes('00ff') == [0, 255]\", \"assert extract_bytes('abcdef') == [171, 205, 239]\", \"assert extract_bytes('1234567890abcdef') == [18, 52, 86, 120, 144, 171, 205, 239]\", \"assert extract_bytes('dea...
{ "split": "train", "index": 3088, "acecode_id": "bigcode_python_fns_21246", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the deletion of power specifications for a given server instance in a virtualized environment. The function should take in two parameters: an instance identifier (UUID) and a list of existing power specifications. The f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert delete_power_spec('instance-1', ['instance-1', 'instance-2', 'instance-3']) == ['instance-2', 'instance-3']\", \"assert delete_power_spec('instance-2', ['instance-1', 'instance-2', 'instance-3']) == ['instance-1', 'instance-3']\", \"assert delete_power_spec(...
{ "split": "train", "index": 3089, "acecode_id": "bigcode_python_fns_10471", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of 2D coordinates and need to implement a function that groups these coordinates into clusters using the k-means clustering algorithm. Your task is to write a function `kmeans_clustering` that takes the following inputs: `coordinates`, a list of tuples wher...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert kmeans_clustering([(0, 0), (1, 1), (2, 2)], 1) == [0, 0, 0]\", \"assert kmeans_clustering([(5, 5), (6, 6), (7, 7)], 1) == [0, 0, 0]\", \"assert kmeans_clustering([(1, 1), (1, 1), (1, 1)], 1) == [0, 0, 0]\", \"assert kmeans_clustering([(1, 2), (2, 3), (3, 4),...
{ "split": "train", "index": 3090, "acecode_id": "oss_19545", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Write a function that calculates the absolute difference between the sum of the primary diagonal and the secondary diagonal of a given 2D list (matrix). The matrix can be rectangular and not necessarily square. The primary diagonal is defined as the sum of elements from the top...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_diagonal_sum([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == 0\", \"assert find_diagonal_sum([[1, 2], [3, 4]]) == 0\", \"assert find_diagonal_sum([[2, 4, 6], [3, 5, 7], [8, 10, 12]]) == 0\", \"assert find_diagonal_sum([[3, 2, 1], [6, 5, 4]]) == 2\", \"assert find...
{ "split": "train", "index": 3091, "acecode_id": "evol_19672", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Implement a function that finds the smallest integer in a given multi-dimensional list of integer values using recursion. The function should not use Python's built-in 'min' or 'sort' functions. If the input list contains non-integer values or is empty, the function should rais...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_min([[7, 8, 10, 4], [11, 9, 12, 5], [3, 15, 2, 4], [7, 13, 10, 1]]) == 1\", \"assert find_min([[1], [2], [3]]) == 1\", \"assert find_min([[5, 2], [3, 4], [6]]) == 2\", \"assert find_min([[100, -50, 200], [0, 150]]) == -50\", \"assert find_min([[7], [8],...
{ "split": "train", "index": 3092, "acecode_id": "evol_17337", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a custom number input widget for a web application. Your job is to implement a class `CustomNumberInput` that represents a number input field with a specific CSS class applied to it. The `CustomNumberInput` class should take an optional dictionary o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert CustomNumberInput().render() == '<input type=\\\"number\\\" class=\\\"full-width\\\">'\", \"assert CustomNumberInput({'placeholder': 'Enter a number'}).render() == '<input type=\\\"number\\\" class=\\\"full-width\\\" placeholder=\\\"Enter a number\\\">'\", \...
{ "split": "train", "index": 3093, "acecode_id": "oss_30727", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that takes a list of tuples, where each tuple contains a string representing the name of an image and an integer representing its current size. The function should resize each image to a maximum size while preserving the aspect ratio. The ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert resize_images([('image1', 1200), ('image2', 800)], 1000) == [('image1', 1000), ('image2', 800)]\", \"assert resize_images([('img1', 500), ('img2', 1500)], 600) == [('img1', 500), ('img2', 600)]\", \"assert resize_images([('photo1', 1024), ('photo2', 512), ('...
{ "split": "train", "index": 3094, "acecode_id": "bigcode_python_fns_15437", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a lookup function that maps a list of string values to their corresponding indices. Given a list of strings (mapping) and a list of indices, your function should return a list of strings where each index is replaced by the corresponding string from ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert lookup_strings(['emerson', 'lake', 'palmer'], [1, 5]) == ['lake', 'UNKNOWN']\", \"assert lookup_strings(['apple', 'banana', 'cherry'], [0, 2]) == ['apple', 'cherry']\", \"assert lookup_strings(['a', 'b', 'c'], [3, 4]) == ['UNKNOWN', 'UNKNOWN']\", \"assert lo...
{ "split": "train", "index": 3095, "acecode_id": "bigcode_python_fns_14973", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks if a given authorization code is different from a previous authorization code and, if so, generates a refresh token for a service. The function should take in two strings: the current authorization code and the previous author...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert confirm_setup_token('abc123', 'xyz456') == 'refresh_token_abc123'\", \"assert confirm_setup_token('abc123', 'abc123') == None\", \"assert confirm_setup_token('', 'xyz456') == None\", \"assert confirm_setup_token('', '') == None\", \"assert confirm_setup_toke...
{ "split": "train", "index": 3096, "acecode_id": "oss_23967", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing a chemical formula of a molecule. Your task is to implement a function `optimize_molecule(formula: str, pcm_dielectric: float) -> str` that simulates the optimization of the given molecule in two steps: first in vacuum and then in a polarizab...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert optimize_molecule('H2O', 80.0) == 'Optimizing H2O in vacuum. Optimizing H2O in PCM with dielectric 80.0.'\", \"assert optimize_molecule('C6H12O6', 78.5) == 'Optimizing C6H12O6 in vacuum. Optimizing C6H12O6 in PCM with dielectric 78.5.'\", \"assert optimize_m...
{ "split": "train", "index": 3097, "acecode_id": "bigcode_python_fns_16091", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Define a function `extract_characters(original_string: str, pos1: int, pos2: int) -> str` that extracts the characters between two given positions, inclusive, in a given string. The function should handle exceptions for incorrect data types as arguments, out-of-range positional...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_characters('Hello, World!', 0, 4) == 'Hello'\", \"assert extract_characters('Python Programming', 7, 10) == 'Prog'\", \"assert extract_characters('abcdefg', 2, 5) == 'cdef'\", \"assert extract_characters('abcdefg', 0, 0) == 'a'\", \"assert extract_ch...
{ "split": "train", "index": 3098, "acecode_id": "evol_33521", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a positive integer n, write a function that checks whether n is a palindrome. A palindrome is a number that reads the same backward as forward. Your function should return True if n is a palindrome and False otherwise.\nPlease reason step by step, then write a self-contai...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_palindrome(121) == True\", \"assert is_palindrome(12321) == True\", \"assert is_palindrome(10) == False\", \"assert is_palindrome(0) == True\", \"assert is_palindrome(11) == True\", \"assert is_palindrome(123) == False\", \"assert is_palindrome(1001) == T...
{ "split": "train", "index": 3099, "acecode_id": "evol_21457", "num_tests": 16 }