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": "Implement a function called `greet` that returns the string 'Hello World!'.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block."
}
] | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert greet() == 'Hello World!'\", \"assert greet() == 'Hello World!'\", \"assert greet() == 'Hello World!'\", \"assert greet() == 'Hello World!'\", \"assert greet() == 'Hello World!'\", \"assert greet() == 'Hello World!'\", \"assert greet() == 'Hello World!'\", \... | {
"split": "train",
"index": 2700,
"acecode_id": "evol_29289",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string formatted as 'value1,value2,value3|ackNumber', where 'value1', 'value2', and 'value3' are non-negative integers, and 'ackNumber' is an integer between -1 and 2^53, create a function that parses this string and returns a tuple. The tuple should consist of a list o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_sack_string('1,2,3|5') == ([1, 2, 3], 5)\", \"assert parse_sack_string('0|0') == ([0], 0)\", \"assert parse_sack_string('10,20,30|2') == ([10, 20, 30], 2)\", \"assert parse_sack_string('1,1,1|1') == ([1, 1, 1], 1)\", \"assert parse_sack_string('5,10,15... | {
"split": "train",
"index": 2701,
"acecode_id": "bigcode_python_fns_9159",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a list of flow entries. Each flow entry is represented as a dictionary with the following keys: 'source_ip', 'destination_ip', 'protocol', 'source_port', 'destination_port', and 'action'. Your function should fil... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_flow_entries([]) == []\", \"assert process_flow_entries([{'protocol': 'TCP', 'action': 'ALLOW'}]) == [{'protocol': 'TCP', 'action': 'ALLOW'}]\", \"assert process_flow_entries([{'protocol': 'UDP', 'action': 'ALLOW'}]) == []\", \"assert process_flow_en... | {
"split": "train",
"index": 2702,
"acecode_id": "oss_30527",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that generates the first n components of the Fibonacci series, where each number in the series is the sum of the two preceding ones, starting from 0 and 1. The function should return a list of the first n Fibonacci numbers.\nPlease reason step by step, then... | 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": 2703,
"acecode_id": "evol_19075",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function that generates a SQL command to drop a specified column from a given table in a database. The function should take two string parameters: `table_name` and `column_name`. The SQL command follows the pattern: `ALTER TABLE table_name DROP COLUMN co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_drop_column_sql('users', 'age') == 'ALTER TABLE users DROP COLUMN age;'\", \"assert generate_drop_column_sql('products', 'price') == 'ALTER TABLE products DROP COLUMN price;'\", \"assert generate_drop_column_sql('orders', 'order_date') == 'ALTER TAB... | {
"split": "train",
"index": 2704,
"acecode_id": "oss_24253",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary, implement a function `extract_key_value_pairs(input_dict)` that takes in a dictionary `input_dict` and returns a new dictionary containing only the key-value pairs where the key is a string and the value is a string. If a key is not a string or if the value ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_key_value_pairs({'a': 'apple', 'b': 'banana', 'c': 3}) == {'a': 'apple', 'b': 'banana'}\", \"assert extract_key_value_pairs({'1': 'one', 2: 'two', '3': 3.0}) == {'1': 'one'}\", \"assert extract_key_value_pairs({'key1': 10, 'key2': 'value2', 'key3': '... | {
"split": "train",
"index": 2705,
"acecode_id": "oss_12560",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes train journey data stored in a dictionary format. The dictionary, `train_dic`, contains information about different train journeys, including the start frame, end frame, set parts, and trajectory type. Your function should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_train_data({'A': {'start_frame': 0, 'end_frame': 10, 'set_parts': ['part1', 'part2'], 'traj_coord_file': 'coords.txt'}}, 'A', 'md') == (0, 10, ['part1', 'part2'], 'coords.txt')\", \"assert process_train_data({'B': {'start_frame': 5, 'end_frame': 15, ... | {
"split": "train",
"index": 2706,
"acecode_id": "oss_4257",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function that takes a list of strings representing browser commands and returns the first valid browser command that can be executed. A valid command is defined as a string that either contains a '%s' placeholder or is a known browser name from a predefi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_valid_browser_command(['chrome', 'firefox', 'safari']) == 'chrome'\", \"assert find_valid_browser_command(['opera', 'internet explorer']) == 'Error: No valid browser command found.'\", \"assert find_valid_browser_command(['my_browser %s', 'firefox']) ==... | {
"split": "train",
"index": 2707,
"acecode_id": "bigcode_python_fns_28449",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `convert_to_json` that takes a dictionary as input and returns a JSON string representation of the dictionary. The function should be able to handle nested dictionaries as well. The output should be a valid JSON string. For example, given the input dictiona... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_json({'software': 'foo', 'version': 1.0, 'nested': {'key1': 'value1', 'key2': 'value2'}}) == '{\\\"software\\\": \\\"foo\\\", \\\"version\\\": 1.0, \\\"nested\\\": {\\\"key1\\\": \\\"value1\\\", \\\"key2\\\": \\\"value2\\\"}}'\", \"assert convert_... | {
"split": "train",
"index": 2708,
"acecode_id": "oss_6712",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a given list of file paths and a specific file extension to find all files that match that extension. Write a function `find_files_by_extension(file_paths, file_extension)` that takes in two parameters: - `file_paths... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_files_by_extension(['file1.txt', 'file2.csv', 'file3.txt', 'file4.jpg'], 'txt') == ['file1.txt', 'file3.txt']\", \"assert find_files_by_extension(['image1.png', 'image2.jpg', 'image3.gif'], 'jpg') == ['image2.jpg']\", \"assert find_files_by_extension(['... | {
"split": "train",
"index": 2709,
"acecode_id": "oss_28593",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the process of sealing items in a game. The function `make_all_master_seals(offsets)` should take a list of integers, `offsets`, which represent the positions of items to be sealed. The function should return a tuple contai... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert make_all_master_seals([]) == (0, 0)\", \"assert make_all_master_seals([1, 2, 3]) == (3, 3)\", \"assert make_all_master_seals([1, 1, 1]) == (1, 3)\", \"assert make_all_master_seals([1, 2, 2, 3, 4]) == (4, 5)\", \"assert make_all_master_seals([5, 5, 6, 7, 8, 8... | {
"split": "train",
"index": 2710,
"acecode_id": "bigcode_python_fns_19806",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks whether a given list of car ratings is valid based on the following criteria: a car rating is considered valid if it is an integer between 1 and 5, inclusive. Your function should take in a list of integers representing car ra... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_car_ratings([1, 2, 3, 4, 5]) == [True, True, True, True, True]\", \"assert check_car_ratings([0, 1, 2, 3, 4, 5, 6]) == [False, True, True, True, True, True, False]\", \"assert check_car_ratings([]) == []\", \"assert check_car_ratings([-1, 0, 6]) == [Fa... | {
"split": "train",
"index": 2711,
"acecode_id": "oss_21250",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a directed graph represented as a list of edges where each edge is a tuple (u, v) indicating a directed edge from vertex u to vertex v. Your task is to write a function that takes this graph and an edge (u, v) as input, and finds a neighboring edge (x, y) such tha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_neighbor_edge([(1, 2), (2, 3)], (1, 2), [{'id': 1, 'z': 10}, {'id': 2, 'z': 4}, {'id': 3, 'z': 6}], column='z', direction='down', window=None) == (2, 3)\", \"assert get_neighbor_edge([(1, 2)], (1, 2), [{'id': 1, 'z': 2}, {'id': 2, 'z': 3}], column='z', d... | {
"split": "train",
"index": 2712,
"acecode_id": "bigcode_python_fns_34527",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function that accepts four integers and outputs the second smallest value among them. The function should be able to handle negative numbers and zero, and it should avoid unnecessary comparisons to optimize the performance.\nPlease reason step by step, then write a sel... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert second_smallest(1, 2, 3, 4) == 2\", \"assert second_smallest(-5, 5, -3, 0) == -3\", \"assert second_smallest(100, 200, 300, 400) == 200\", \"assert second_smallest(-1, 0, 1, 2) == 0\", \"assert second_smallest(-10, -5, -3, -1) == -5\", \"assert second_smalle... | {
"split": "train",
"index": 2713,
"acecode_id": "evol_12259",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that generates a list of full image names from a given repository name, a list of image names, and a corresponding list of image tags. Each full image name is constructed by concatenating the repository name, the image name, and th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_images('myrepo', ['image1', 'image2', 'image3'], ['tag1', 'tag2', 'tag3']) == ['myrepo/image1:tag1', 'myrepo/image2:tag2', 'myrepo/image3:tag3']\", \"assert process_images('repo', ['imgA', 'imgB'], ['v1', 'v2']) == ['repo/imgA:v1', 'repo/imgB:v2']\",... | {
"split": "train",
"index": 2714,
"acecode_id": "oss_18792",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that returns the default configuration string for a budgeting application. The function should return a specific string that represents the user-related functionalities configuration. Implement a function named 'get_user_config' th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_user_config() == 'greenbudget.app.user.apps.UserConfig'\", \"assert get_user_config() == 'greenbudget.app.user.apps.UserConfig'\", \"assert get_user_config() == 'greenbudget.app.user.apps.UserConfig'\", \"assert get_user_config() == 'greenbudget.app.user... | {
"split": "train",
"index": 2715,
"acecode_id": "oss_33063",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `service_name`, return the corresponding configuration type as a string based on the following mapping: 'HDFS' maps to 'hdfs-site', 'MAPREDUCE' maps to 'mapred-site', 'HBASE' maps to 'hbase-site', 'OOZIE' maps to 'oozie-site', 'HIVE' maps to 'hive-site', 'WEBHCAT... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_config_type('HDFS') == 'hdfs-site'\", \"assert get_config_type('MAPREDUCE') == 'mapred-site'\", \"assert get_config_type('HBASE') == 'hbase-site'\", \"assert get_config_type('OOZIE') == 'oozie-site'\", \"assert get_config_type('HIVE') == 'hive-site'\", \... | {
"split": "train",
"index": 2716,
"acecode_id": "bigcode_python_fns_26994",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing signal strengths. Your task is to implement a function `connect_signals(signal_strengths: List[int], threshold: int) -> List[int]` that connects signals based on a given threshold. The function should return a list of integers, wher... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert connect_signals([10, 20, 30], 15) == [20, 30]\", \"assert connect_signals([5, 3, 8, 1], 7) == [8]\", \"assert connect_signals([1, 2, 3, 4, 5], 0) == [1, 2, 3, 4, 5]\", \"assert connect_signals([1, 2, 3, 4], 5) == []\", \"assert connect_signals([100, 200, 300... | {
"split": "train",
"index": 2717,
"acecode_id": "bigcode_python_fns_43221",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a string `line` and a character `marker`, write a function that finds the indices of the start and end positions of the sections marked by the `marker` in the `line`. The function should return two lists: one containing the start indices and the other containing the end i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert _get_marker_indices('#', 'No markers here.') == ([], [])\", \"assert _get_marker_indices('~', 'No match here.') == ([], [])\", \"assert _get_marker_indices('*', '****') == ([0, 2], [1, 3])\", \"assert _get_marker_indices('*', '') == ([], [])\", \"assert _get... | {
"split": "train",
"index": 2718,
"acecode_id": "bigcode_python_fns_22959",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function to validate book information for a library management system. Implement a function `validate_book_data(name: str, author: str, isbn: str) -> bool` that checks if the input data meets the following criteria: The `name` must be a non-empty ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_book_data('Python Programming', 'John Doe', '978-0134444321') == True\", \"assert validate_book_data('A Brief History of Time', 'Stephen Hawking', '978-0553380163') == True\", \"assert validate_book_data('The Great Gatsby', '', '978-0743273565') == ... | {
"split": "train",
"index": 2719,
"acecode_id": "oss_11148",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing the parameters for configuring an optimizer in a machine learning model. The dictionary contains the following keys: 'optimizer', 'freeze_backbone', and 'zero_bn_bias_decay'. Your task is to implement a function that returns the appropria... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_optimizer_type({'optimizer': 'adam', 'freeze_backbone': True, 'zero_bn_bias_decay': False}) == 'layer_specific_adam'\", \"assert get_optimizer_type({'optimizer': 'adam', 'freeze_backbone': False, 'zero_bn_bias_decay': False}) == 'plain_adam'\", \"assert ... | {
"split": "train",
"index": 2720,
"acecode_id": "bigcode_python_fns_9241",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `generate_password` that generates a cryptic password consisting of exactly 12 characters. The password must include at least one character from the Greek alphabet, one special character from the ASCII set, one Roman numeral (I, V, X, L, C, D, M), and one r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_password() is not None\", \"assert any(char in string.punctuation for char in generate_password())\", \"assert any(char in 'IVXLCDM' for char in generate_password())\", \"assert any(char.isdigit() for char in generate_password())\", \"assert sum(1 f... | {
"split": "train",
"index": 2721,
"acecode_id": "evol_33716",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python class called `VGG` that simulates a neural network model. The class should support three different modes of operation: 'pre-train', 'fine-tune', and 'test'. Your task is to implement the `__init__` method of the `VGG` class, which accep... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert VGG('pre-train') is not None\", \"assert VGG('fine-tune') is not None\", \"assert VGG('test') is not None\", \"assert VGG('pre-train') is not None\", \"assert VGG('fine-tune') is not None\", \"assert VGG('test') is not None\"]}"
} | {
"split": "train",
"index": 2722,
"acecode_id": "oss_33635",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given two ordered lists of whole numbers, implement a function `longest_increasing_subsequence(seq1, seq2)` that identifies and returns the longest increasing subsequence that is present in both sequences. The function should return the subsequence as a list. If there is no com... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longest_increasing_subsequence([], []) == []\", \"assert longest_increasing_subsequence([1, 3, 5, 7], [1, 2, 3, 4, 5]) == [1, 3, 5]\", \"assert longest_increasing_subsequence([3, 5, 6, 7], [1, 2, 3, 4, 5]) == [3, 5]\", \"assert longest_increasing_subsequence... | {
"split": "train",
"index": 2723,
"acecode_id": "evol_29097",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates retrieving the content of a web page given a URL. Your function should take a string as input representing the URL and return a string that mimics the content of the page. The content should simply be the URL prefixed with ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert getPageContent('https://example.com') == 'Content of https://example.com'\", \"assert getPageContent('http://testsite.com') == 'Content of http://testsite.com'\", \"assert getPageContent('https://openai.com') == 'Content of https://openai.com'\", \"assert ge... | {
"split": "train",
"index": 2724,
"acecode_id": "bigcode_python_fns_33719",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a token string that is generated to validate an email address. The token is valid if it has a specific format: it should start with 'token-' followed by a sequence of alphanumeric characters. Additionally, the token should not exceed 50 characters in length. Write... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_token('token-abc123') == True\", \"assert validate_token('token-xyz9876543210') == True\", \"assert validate_token('token-') == False\", \"assert validate_token('not_a_token-abc') == False\", \"assert validate_token('token-12345678901234567890123456... | {
"split": "train",
"index": 2725,
"acecode_id": "bigcode_python_fns_48418",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a generator function `process_in_flight_cogs(in_flight_cogs)` that processes a queue of in-flight cogs. The `drain` function is provided to you, which takes the in-flight cogs queue as input and returns a tuple containing two elements. The first... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert list(process_in_flight_cogs(['cog1', 'cog2'])) == ['cog1_result', 'cog2_result']\", \"assert list(process_in_flight_cogs([])) == []\", \"assert list(process_in_flight_cogs(['cog3'])) == ['cog3_result']\", \"assert list(process_in_flight_cogs(['cog4', 'cog5',... | {
"split": "train",
"index": 2726,
"acecode_id": "oss_37388",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a function that takes a list of integers named 'numbers' and iterates over it in reverse order. If the function encounters the number '7', it should raise a custom exception called 'FoundSevenException' with the message 'Found 7'. The function should handle this excepti... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert iterate_reverse([1, 2, 3, 4, 5]) == [5, 4, 3, 2, 1]\", \"assert iterate_reverse([7, 1, 2, 3]) == [3, 2, 1]\", \"assert iterate_reverse([1, 7, 3, 7, 4]) == [4, 3, 1]\", \"assert iterate_reverse([5, 6, 7, 8, 9]) == [9, 8, 6, 5]\", \"assert iterate_reverse([1, ... | {
"split": "train",
"index": 2727,
"acecode_id": "evol_4951",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that takes a dictionary representing a feature's configuration and returns a unique identifier based on the specified rules. The dictionary can contain the following keys: 'class', 'args', and 'kwargs'. If 'class' is a callable... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert instantiate_feature({'class': Feature, 'args': ['feature_1']})() == 'feature_1'\", \"assert instantiate_feature({'class': Feature, 'kwargs': {'id': 'feature_2'}})() == 'feature_2'\", \"assert instantiate_feature({'class': Feature, 'kwargs': {'id': 'feature_4... | {
"split": "train",
"index": 2728,
"acecode_id": "oss_22644",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary of shopping platforms and their corresponding URLs. Your task is to implement a function that takes this dictionary as input and returns a formatted string that lists the shopping platforms along with their URLs. The string should be formatted with ea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_shopping_links({'Lazada': 'https://www.couponese.com/store/lazada.sg/'}) == '- Lazada: https://www.couponese.com/store/lazada.sg/'\", \"assert format_shopping_links({'Amazon': 'https://www.couponese.com/store/amazon.com.sg/'}) == '- Amazon: https://ww... | {
"split": "train",
"index": 2729,
"acecode_id": "bigcode_python_fns_31656",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that generates a list of dense blocks based on the given parameters. A dense block is a list of integers that follows a specific pattern. The function should take in two parameters: `number_of_dense_blocks` (an integer represen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_dense_blocks(3, 2) == [[1], [3, 3], [5, 5, 5]]\", \"assert generate_dense_blocks(1, 0) == [[1]]\", \"assert generate_dense_blocks(5, 1) == [[1], [2, 2], [3, 3, 3], [4, 4, 4, 4], [5, 5, 5, 5, 5]]\", \"assert generate_dense_blocks(0, 2) == []\", \"ass... | {
"split": "train",
"index": 2730,
"acecode_id": "oss_35021",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to manage a viewer in a simple rendering environment. The function should take two parameters: `mode` (default value: 'human') and `close` (default value: False). If `close` is set to True, the function should simulate closing the vie... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_viewer('human', True) == None\", \"assert manage_viewer('human', False) == None\", \"assert manage_viewer('AI', True) == None\", \"assert manage_viewer('AI', False) == None\", \"assert manage_viewer('human', True) == None\", \"assert manage_viewer('hu... | {
"split": "train",
"index": 2731,
"acecode_id": "oss_23666",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Convert an integer value into its corresponding Mayan numeral representation for numbers ranging from 0 to 19. The function should return a string that represents the Mayan numeral. If the input is not a valid integer or is outside the range of 0 to 19, the function should retu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert int_to_mayan(0) == '0'\", \"assert int_to_mayan(1) == '.'\", \"assert int_to_mayan(2) == '..'\", \"assert int_to_mayan(3) == '...'\", \"assert int_to_mayan(4) == '....'\"]}"
} | {
"split": "train",
"index": 2732,
"acecode_id": "evol_31429",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the vertices of a subject's cortical surfaces. Your task is to write a function `count_vertices(vertices: List[int]) -> dict` that takes this list as input and returns a dictionary where the keys are the surface names ('lh' for the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_vertices([1, 2, 3, 4, 5, 6]) == {'lh': 3, 'rh': 3}\", \"assert count_vertices([1, 2, 3, 4, 5]) == {'lh': 2, 'rh': 2}\", \"assert count_vertices([1]) == {'lh': 0, 'rh': 0}\", \"assert count_vertices([]) == {'lh': 0, 'rh': 0}\", \"assert count_vertices([... | {
"split": "train",
"index": 2733,
"acecode_id": "oss_27152",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `predict_language(sentence: str) -> str` that takes a string `sentence` as input and returns 'English' if the sentence is in English or 'German' if it is in German. You can assume that the input will only contain valid English or German sentences.\nPlease r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert predict_language('Hi, how are you?') == 'English'\", \"assert predict_language('Ich bin gut.') == 'German'\", \"assert predict_language('What is your name?') == 'English'\", \"assert predict_language('Wie hei\\u00dft du?') == 'German'\", \"assert predict_lan... | {
"split": "train",
"index": 2734,
"acecode_id": "evol_12904",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `compress_string(s: str) -> str` that takes a string `s` as input and compresses it by replacing all consecutive repeating characters with a single instance of the character followed by its count. If a character does not repeat, it should remain unchanged. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compress_string('aabbbbbbcccc') == 'a2b6c4'\", \"assert compress_string('abc') == 'abc'\", \"assert compress_string('aa') == 'a2'\", \"assert compress_string('a') == 'a'\", \"assert compress_string('') == ''\", \"assert compress_string('ab') == 'ab'\", \"ass... | {
"split": "train",
"index": 2735,
"acecode_id": "evol_29058",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `update_and_get_statistics(data: List[int], position: int, number: int) -> Tuple[int, int, float]` that takes a list of integers `data`, updates the value at the specified `position` with `number`, and returns a tuple containing the minimum, maximum, and av... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_and_get_statistics([1, 2, 3], 1, 5) == (1, 5, 3.0)\", \"assert update_and_get_statistics([1, 2, 3], 3, 4) == (1, 3, 2.0)\", \"assert update_and_get_statistics([5], 0, 10) == (10, 10, 10.0)\", \"assert update_and_get_statistics([3, 3, 3], 2, 6) == (3, ... | {
"split": "train",
"index": 2736,
"acecode_id": "evol_36153",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function that converts a given hexadecimal number (as a string) to its octal representation (as a string). The function should handle valid hexadecimal inputs from '0' to 'F' and should return the octal equivalent without any prefix.\nPlease reason step by step, the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hex_to_oct('1') == '1'\", \"assert hex_to_oct('A') == '12'\", \"assert hex_to_oct('F') == '17'\", \"assert hex_to_oct('10') == '20'\", \"assert hex_to_oct('11') == '21'\", \"assert hex_to_oct('12') == '22'\", \"assert hex_to_oct('13') == '23'\", \"assert hex... | {
"split": "train",
"index": 2737,
"acecode_id": "evol_18149",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `find_duplicates` that returns a list of integers that appear more than once in the input list. The output list should contain unique values of the duplicates in ascending order. If there are no duplicates, return an empty list. The in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_duplicates([1, 2, 3, 4, 5, 1, 2]) == [1, 2]\", \"assert find_duplicates([5, 5, 5, 1, 2, 3, 4]) == [5]\", \"assert find_duplicates([1, 2, 3]) == []\", \"assert find_duplicates([-1, -2, -3, -1]) == [-1]\", \"assert find_duplicates([0, 0, 1, 2, 0]) == [0]\... | {
"split": "train",
"index": 2738,
"acecode_id": "bigcode_python_fns_761",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that calculates the average of the even positive integers in the list. If there are no even positive integers, the function should return None.\nPlease reason step by step, then write a self-contained Python solution. Give your fin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_even_positive_numbers([2, 7, 15, 25, -2, 4]) == 3.0\", \"assert average_even_positive_numbers([-1, -2, -3, -4]) == None\", \"assert average_even_positive_numbers([1, 3, 5, 7]) == None\", \"assert average_even_positive_numbers([2, 2, 2, 2]) == 2.0\", ... | {
"split": "train",
"index": 2739,
"acecode_id": "evol_19066",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a 2D board represented by a list of strings, count how many battleships are in it. Battleships are represented by 'X's, while empty slots are represented by '.'s. A battleship can be placed horizontally, vertically, or diagonally, and there must be at least one empty cell... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert countBattleships(['X..X', '...X', '...X']) == 2\", \"assert countBattleships(['X']) == 1\", \"assert countBattleships(['..']) == 0\", \"assert countBattleships(['X..X', '....', 'X..X']) == 4\", \"assert countBattleships(['XX.', 'XX.']) == 1\", \"assert count... | {
"split": "train",
"index": 2740,
"acecode_id": "evol_6953",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function named 'create_project' that takes in parameters projectID (int), projectTitle (str), deadline (str), and associatedEmployeeID (int). The function should return a dictionary representing the project with keys 'projectID', 'projectTitle', 'deadline', and 'ass... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_project(1, 'Project Alpha', '2023-12-31', 101) == {'projectID': 1, 'projectTitle': 'Project Alpha', 'deadline': '2023-12-31', 'associatedEmployeeID': 101}\", \"assert create_project(2, 'Project Beta', '2024-01-15', 102) == {'projectID': 2, 'projectTit... | {
"split": "train",
"index": 2741,
"acecode_id": "evol_34086",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that generates a valid HTML page with a CSS stylesheet link, given a list of body contents and a dictionary of CSS properties. The body contents will be a list of tuples, where each tuple contains a tag (like 'h1' or 'p') and its corresponding content. The CSS ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_html([('h1', 'Hello World!'), ('p', 'This is a more complex HTML page.')], {'h1': {'color': 'blue'}, 'p': {'font-size': '20px'}}) == '<!DOCTYPE html>\\\\n<html>\\\\n<head>\\\\n<style>\\\\nh1 {\\\\n color: blue;\\\\n}\\\\np {\\\\n font-size: 20px;\... | {
"split": "train",
"index": 2742,
"acecode_id": "evol_21480",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that filters a list of device manufacturers based on specific criteria. Write a function `filter_manufacturers(manufacturers: List[str]) -> List[str]` that takes a list of manufacturer names as input and returns a list containing only the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_manufacturers(['Apple', 'Samsung', 'Sony', 'Huawei']) == ['Samsung', 'Huawei']\", \"assert filter_manufacturers(['LG', 'Nokia', 'Motorola']) == []\", \"assert filter_manufacturers(['Samsung', 'Samsung', 'Huawei', 'Apple']) == ['Samsung', 'Samsung', 'H... | {
"split": "train",
"index": 2743,
"acecode_id": "bigcode_python_fns_2828",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of bounding boxes represented by their coordinates (x1, y1, x2, y2), implement a function to determine how many boxes overlap with a specified bounding box using the Intersection over Union (IoU) metric. The function should take in the bounding box and a list of ot... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_overlapping_boxes([0, 0, 2, 2], [[0, 0, 1, 1]], 0.1) == 1\", \"assert count_overlapping_boxes([1, 1, 3, 3], [[0, 0, 2, 2], [1, 1, 3, 3]], 0.6) == 1\", \"assert count_overlapping_boxes([1, 1, 3, 3], [[0, 0, 2, 2], [1, 1, 3, 3]], 0.1) == 2\", \"assert co... | {
"split": "train",
"index": 2744,
"acecode_id": "bigcode_python_fns_14950",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D list of holding values, where each row represents a different entity and each column represents a different value associated with that entity. You are also given a list of integers representing the lengths of groups. Your task is to implement a function that ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert grouped_sum([[1, 2, 3, 4], [5, 6, 7, 8]], [2, 2]) == [[3, 7], [11, 15]]\", \"assert grouped_sum([[1, 1, 1, 1], [2, 2, 2, 2]], [1, 3]) == [[1, 3], [2, 6]]\", \"assert grouped_sum([[1]], [1]) == [[1]]\", \"assert grouped_sum([[1, 2, 3], [4, 5, 6]], [1, 2]) == ... | {
"split": "train",
"index": 2745,
"acecode_id": "bigcode_python_fns_47195",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, implement a function that rearranges the strings in such a way that no two adjacent strings are the same while maintaining the original order of their first appearance. If it is not possible to arrange them, return an empty list.\nPlease reason step by ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rearrange_strings(['a', 'b', 'a', 'b', 'a']) == ['a', 'b', 'a', 'b', 'a']\", \"assert rearrange_strings(['cat', 'dog', 'cat', 'cat', 'dog']) == ['cat', 'dog', 'cat', 'dog', 'cat']\", \"assert rearrange_strings(['single']) == ['single']\", \"assert rearrange_... | {
"split": "train",
"index": 2746,
"acecode_id": "evol_21433",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given two integers n and r, write a function that calculates the number of combinations of n items taken r at a time. The function should return 0 if r is greater than n, and return 1 if n is equal to r. Otherwise, return the number of distinct ways to choose r items from n ite... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert choose(5, 5) == 1\", \"assert choose(0, 0) == 1\", \"assert choose(0, 1) == 0\", \"assert choose(10, 10) == 1\", \"assert choose(6, 7) == 0\", \"assert choose(3, 3) == 1\", \"assert choose(2, 2) == 1\"]}"
} | {
"split": "train",
"index": 2747,
"acecode_id": "bigcode_python_fns_37594",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function `first_unique_char(s: str) -> Tuple[int, str]` that returns the index and the character of the first unique character in the given string `s`. If there are no unique characters, return (-1, '') instead.\nPlease reason step by step, then write a self-contain... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert first_unique_char('leetcode') == (0, 'l')\", \"assert first_unique_char('loveleetcode') == (2, 'v')\", \"assert first_unique_char('aabbcc') == (-1, '')\", \"assert first_unique_char('') == (-1, '')\", \"assert first_unique_char('a') == (0, 'a')\", \"assert f... | {
"split": "train",
"index": 2748,
"acecode_id": "evol_18625",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes a string as input and splits it into individual characters. The function should also count the number of vowels in the string, treating uppercase and lowercase vowels equivalently. The function should return a tuple containing the list of spli... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert split_string('hello') == (['h', 'e', 'l', 'l', 'o'], 2)\", \"assert split_string('Python') == (['P', 'y', 't', 'h', 'o', 'n'], 1)\", \"assert split_string('AEIOU') == (['A', 'E', 'I', 'O', 'U'], 5)\", \"assert split_string('abcdefghijklmnopqrstuvwxyz') == ([... | {
"split": "train",
"index": 2749,
"acecode_id": "evol_30467",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple port scanner. The function should take an IP address and a port number as its parameters and return a message indicating whether the specified port on the given IP address is open, closed, or if there was a connect... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert port_scanner('192.168.1.1', 80) == 'Port 80 is open'\", \"assert port_scanner('192.168.1.1', 0) == 'Invalid input: Port number must be between 1 and 65535'\", \"assert port_scanner('192.168.1.1', 70000) == 'Invalid input: Port number must be between 1 and 65... | {
"split": "train",
"index": 2750,
"acecode_id": "oss_9025",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of secure tags and returns a list of translated secure tags. Each secure tag can either be a namespaced tag starting with 'tagValues/' or a regular tag. For namespaced tags, the function should keep them as is. For r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert translate_secure_tags(['tagValues/tag1', 'namespace/tag2', 'tagValues/tag3', 'namespace/tag4']) == ['tagValues/tag1', 'tag2', 'tagValues/tag3', 'tag4']\", \"assert translate_secure_tags(['tagValues/test', 'namespace/example']) == ['tagValues/test', 'example'... | {
"split": "train",
"index": 2751,
"acecode_id": "bigcode_python_fns_33757",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a simple banking system using a function. Implement a function `bank_operations(operations: List[Tuple[str, int]]) -> int` that takes a list of operations where each operation is a tuple of a string and an integer. The string can either be 'deposi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bank_operations([('deposit', 100), ('withdraw', 50)]) == 50\", \"assert bank_operations([('deposit', 200), ('withdraw', 100), ('withdraw', 150)]) == 100\", \"assert bank_operations([('withdraw', 100)]) == 0\", \"assert bank_operations([('deposit', 50), ('wit... | {
"split": "train",
"index": 2752,
"acecode_id": "oss_21598",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with determining the size of a data feed based on a given JWT token and feed ID. The data feed contains a list of results, and the maximum number of results that can be returned is capped at 1000. Given the inputs, your function should return the total number of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_feed_size('valid_jwt_token', 'feed_3') == 0\", \"assert get_feed_size('invalid_jwt_token', 'feed_4') == 0\", \"assert get_feed_size('valid_jwt_token', 'feed_7') == 0\", \"assert get_feed_size('expired_jwt_token', 'feed_12') == 0\", \"assert get_feed_size... | {
"split": "train",
"index": 2753,
"acecode_id": "bigcode_python_fns_28012",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a boxing rule based on the presence of a 'data' section in a given box object. The function should take two parameters: 'output', which is a string representing the output of the boxing rule, and 'box', which is an object t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_boxing_rule('output1', {'sections': [{'name': 'data'}, {'name': 'other'}]}) == 'create boxing rule for embedding an elf'\", \"assert create_boxing_rule('output2', {'sections': [{'name': 'other'}, {'name': 'data'}]}) == 'create boxing rule for embeddin... | {
"split": "train",
"index": 2754,
"acecode_id": "oss_30362",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that formats a block of text into a Markdown-styled message. The function will take a single string input, which may contain multiple words, and return a formatted string that wraps the entire input in Markdown syntax. Specifically, the o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_block('Hello World') == '**Hello World**'\", \"assert format_block('This is a test') == '**This is a test**'\", \"assert format_block('LeetCode is fun') == '**LeetCode is fun**'\", \"assert format_block('Markdown formatting') == '**Markdown formatting... | {
"split": "train",
"index": 2755,
"acecode_id": "bigcode_python_fns_47719",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two arrays `A` and `B`, each containing words made up of lowercase letters, implement a function `wordSubsets(A, B)` that returns a list of all words in `A` that are universal. A word `a` from `A` is considered universal if for every word `b` in `B`, all letters in `b` (i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert wordSubsets(['amazon','apple','facebook','google','leetcode'], ['e','o']) == ['facebook','google','leetcode']\", \"assert wordSubsets(['abc','def','gh','ijkl'], ['g','h']) == ['gh']\", \"assert wordSubsets(['apple','banana','cherry'], ['x','y']) == []\", \"a... | {
"split": "train",
"index": 2756,
"acecode_id": "evol_12969",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a sequence of integers, predict the next n numbers based on the identified common difference in the arithmetic progression. The input will be a list of at least four integers representing the last numbers in the sequence, and an integer n representing how many numbers to ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert next_numbers([3, 7, 11, 15], 2) == [19, 23]\", \"assert next_numbers([10, 20, 30, 40], 3) == [50, 60, 70]\", \"assert next_numbers([1, 3, 5, 7], 1) == [9]\", \"assert next_numbers([5, 10, 15, 20], 4) == [25, 30, 35, 40]\", \"assert next_numbers([-2, 0, 2, 4]... | {
"split": "train",
"index": 2757,
"acecode_id": "evol_35446",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `check_palindromes(entries: List[str]) -> List[bool]` that takes a list of strings and returns a list of boolean values indicating whether each corresponding input string is a palindrome. A string is considered a palindrome if it reads the same backward as ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_palindromes(['malayalam']) == [True]\", \"assert check_palindromes(['A man, a plan, a canal, Panama']) == [True]\", \"assert check_palindromes(['hello']) == [False]\", \"assert check_palindromes(['Able, was I saw Elba']) == [True]\", \"assert check_pal... | {
"split": "train",
"index": 2758,
"acecode_id": "evol_26016",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `calc_det_sarrus(matrix)` that calculates the determinant of a 3x3 matrix using the method of Sarrus. The matrix is represented as a list of three lists, each containing three integers. For example, the input matrix `[[1,2,3],[4,5,6],[7,8,9]]` corresponds t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calc_det_sarrus([[1,2,3],[4,5,6],[7,8,9]]) == 0\", \"assert calc_det_sarrus([[1,0,0],[0,1,0],[0,0,1]]) == 1\", \"assert calc_det_sarrus([[2,2,2],[2,2,2],[2,2,2]]) == 0\", \"assert calc_det_sarrus([[0,0,0],[0,0,0],[0,0,0]]) == 0\", \"assert calc_det_sarrus([[... | {
"split": "train",
"index": 2759,
"acecode_id": "evol_24304",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a Bitcoin address, implement a function `check_address(btc_addr: str, network: str) -> bool` that checks if the Bitcoin address is valid for a specified network type. The network can be 'mainnet' or 'testnet'. A Bitcoin address is valid if: \n1. For ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_address('1234567890abcdef1234567890abcdef1', 'mainnet') == True\", \"assert check_address('1abcde1234567890abcdef1234567890abc', 'mainnet') == True\", \"assert check_address('mabcdef1234567890abcdef1234567890ab', 'testnet') == True\", \"assert check_ad... | {
"split": "train",
"index": 2760,
"acecode_id": "bigcode_python_fns_42155",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `check_route_existence(url: str) -> Tuple[int, str]` that takes a URL as input and simulates checking whether a route exists on a web server. The function should return a tuple containing the HTTP status code and a message. If the URL... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_route_existence('/') == (200, 'OK')\", \"assert check_route_existence('/about') == (404, 'The requested URL was not found on the server')\", \"assert check_route_existence('/contact') == (404, 'The requested URL was not found on the server')\", \"asser... | {
"split": "train",
"index": 2761,
"acecode_id": "bigcode_python_fns_4911",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries where each dictionary represents a child's records with the following keys: 'cpims_id', 'child_names', 'age', 'case_category', 'dqa_sex', 'dqa_dob', 'dqa_age', 'case_status', and 'case_date'. Your task is to implement a function that identif... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_dqa_issues([{ 'cpims_id': 1, 'child_names': 'Alice', 'age': 5, 'case_category': 'A', 'dqa_sex': 'OK', 'dqa_dob': '2000-01-01', 'dqa_age': 'OK', 'case_status': 'Closed', 'case_date': '2023-01-01' }]) == []\", \"assert get_dqa_issues([{ 'cpims_id': 1, 'chi... | {
"split": "train",
"index": 2762,
"acecode_id": "bigcode_python_fns_24060",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing user settings for a file management application. Your goal is to create a function that accepts a dictionary of settings and allows the user to retrieve and update the values of these settings. Implement a function `manage_settings(options, key, val... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_settings({'confirm_trash': True, 'confirm_archive': False}, 'confirm_trash', None) == True\", \"assert manage_settings({'confirm_trash': True, 'confirm_archive': False}, 'confirm_archive', None) == False\", \"assert manage_settings({'confirm_trash': T... | {
"split": "train",
"index": 2763,
"acecode_id": "oss_22500",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer n, write a function that returns a list containing the squares of the first n elements of 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. I... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci_squared(0) == []\", \"assert fibonacci_squared(1) == [0]\", \"assert fibonacci_squared(2) == [0, 1]\", \"assert fibonacci_squared(3) == [0, 1, 1]\", \"assert fibonacci_squared(4) == [0, 1, 1, 4]\", \"assert fibonacci_squared(5) == [0, 1, 1, 4, 9]\"... | {
"split": "train",
"index": 2764,
"acecode_id": "evol_6742",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Write a function `find_insert_position` that takes an integer `value` and a list of integers `sorted_primes` sorted in descending order, which contains only prime numbers. The function should first check if `value` is a prime number. If it is not prime, the function should retu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_insert_position(11, [7, 5, 3]) == 0\", \"assert find_insert_position(2, []) == 0\", \"assert find_insert_position(3, [5]) == 1\", \"assert find_insert_position(13, [11, 7, 5]) == 0\", \"assert find_insert_position(23, [19, 17, 13, 11]) == 0\", \"assert ... | {
"split": "train",
"index": 2765,
"acecode_id": "evol_34981",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Write a function `invert_dict` that takes a dictionary as an argument and returns an inverted dictionary. In the inverted dictionary, the keys are the original values and the values are the original keys. If there are duplicate values in the original dictionary, only one of the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert invert_dict({'a': 1, 'b': 2}) == {1: 'a', 2: 'b'}\", \"assert invert_dict({'x': 10, 'y': 20, 'z': 10}) == {10: 'z', 20: 'y'}\", \"assert invert_dict({'apple': 3, 'banana': 2, 'cherry': 2}) == {2: 'cherry', 3: 'apple'}\", \"assert invert_dict({'k1': 100, 'k2'... | {
"split": "train",
"index": 2766,
"acecode_id": "evol_31999",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two dictionaries A and B, write a function `mutual_coherence(A: Dict[str, int], B: Dict[str, int]) -> int` that returns the maximum value of the absolute difference between the values of the same key in both dictionaries. If a key does not exist in one of the dictionaries... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert mutual_coherence({'a': 1, 'b': 2}, {'a': 3, 'b': 4}) == 2\", \"assert mutual_coherence({'a': 1}, {'b': 2}) == 0\", \"assert mutual_coherence({}, {}) == 0\", \"assert mutual_coherence({'a': 1, 'b': 2, 'c': 5}, {'a': 6, 'b': 2, 'c': 3}) == 5\", \"assert mutual... | {
"split": "train",
"index": 2767,
"acecode_id": "bigcode_python_fns_37233",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that checks if a given username and password pair is valid for a hypothetical login system. The function should take in a username and password as input parameters. The valid username and password pairs are predefined in the system... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_login_successful('user123', 'pass456') == True\", \"assert is_login_successful('admin', 'adminpass') == True\", \"assert is_login_successful('guest', 'guest123') == True\", \"assert is_login_successful('user123', 'wrongpass') == False\", \"assert is_login... | {
"split": "train",
"index": 2768,
"acecode_id": "oss_11318",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `remove_duplicates(data)` that takes a list of elements and returns a new list with all duplicate elements removed, preserving the order of the first occurrences. You may not use any built-in functions for removing duplicates, and your solution should itera... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_duplicates([1, 2, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert remove_duplicates(['a', 'b', 'a', 'c']) == ['a', 'b', 'c']\", \"assert remove_duplicates([1, 1, 1, 1]) == [1]\", \"assert remove_duplicates([]) == []\", \"assert remove_duplicates(['x', 'y', 'z',... | {
"split": "train",
"index": 2769,
"acecode_id": "evol_8529",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple key-value storage system. Your task is to create a function `manage_context` that can set and get context information. The function takes three parameters: an action (either 'set' or 'get'), a key, and a value. If the action is 'set', i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_context('set', 'user_id', 123) == None\", \"assert manage_context('get', 'non_existent_key', None) == None\", \"assert manage_context('set', 'session_id', 'abc123') == None\", \"assert manage_context('set', 'user_id', 456) == None\", \"assert manage_c... | {
"split": "train",
"index": 2770,
"acecode_id": "oss_35506",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of nodes, each represented as a dictionary with a unique identifier and an associated binary filter pruning mask. Your task is to initialize a new output mask for each node based on the provided list of nodes. Each node in the list has a unique 'nncf_node_i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_masks([{'nncf_node_id': 1, 'operand': {'binary_filter_pruning_mask': [1, 0, 1]}}, {'nncf_node_id': 2, 'operand': {'binary_filter_pruning_mask': [0, 1, 0]}}]) == [{'nncf_node_id': 1, 'output_mask': [1, 0, 1]}, {'nncf_node_id': 2, 'output_mask': [0,... | {
"split": "train",
"index": 2771,
"acecode_id": "bigcode_python_fns_28090",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `manage_lexicon(commands: List[Tuple[str, str]]) -> Dict[str, str]` that processes a list of commands to manage a lexicon. Each command is a tuple where the first element is one of the following operations: 'insert', 'remove', or 'get'. The second element f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_lexicon([('insert', 'apple', 'A fruit')]) == {'apple': 'A fruit'}\", \"assert manage_lexicon([('insert', 'banana', 'A yellow fruit'), ('get', 'banana')]) == {'banana': 'A yellow fruit'}\", \"assert manage_lexicon([('insert', 'carrot', 'A vegetable'), ... | {
"split": "train",
"index": 2772,
"acecode_id": "evol_19458",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a string leaf representing a potential list, set, or dictionary comprehension, determine if it is the beginning of a comprehension. A comprehension starts with either '[', '(', or '{' followed by a structure of a list/set/dict comprehension. You need to return True if the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_comprehension('[x for x in range(5)]') == True\", \"assert is_comprehension('(x for x in range(5))') == True\", \"assert is_comprehension('{x: x for x in range(5)}') == True\", \"assert is_comprehension('x + y') == False\", \"assert is_comprehension('') =... | {
"split": "train",
"index": 2773,
"acecode_id": "bigcode_python_fns_27671",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of timestamps in seconds representing the times at which certain events occurred. Your task is to find all the gaps (time differences) between consecutive events that are greater than or equal to a specified minimum time difference. Implement a function `fi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_time_gaps([1, 2, 3, 10, 11, 20], 5) == [(3, 10, 7), (11, 20, 9)]\", \"assert find_time_gaps([1, 2, 3], 3) == []\", \"assert find_time_gaps([10, 20, 30, 50], 15) == [(30, 50, 20)]\", \"assert find_time_gaps([0, 10, 20, 30, 100], 50) == [(30, 100, 70)]\",... | {
"split": "train",
"index": 2774,
"acecode_id": "bigcode_python_fns_45348",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given an integer array, remove all elements that appear more than a specified threshold number of times, while preserving the order of the remaining elements. Implement the function `remove_duplicates(numbers: List[int], threshold: int) -> List[int]` that takes in a list of int... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_duplicates([1, 2, 3, 2, 4], 1) == [1, 3, 4]\", \"assert remove_duplicates([1, 1, 2, 3, 3, 4, 4, 4], 2) == [1, 1, 2, 3, 3]\", \"assert remove_duplicates([5, 6, 5, 7, 8, 6, 6], 1) == [7, 8]\", \"assert remove_duplicates([1, 2, 2, 3, 4, 4, 4, 5, 6], 2) =... | {
"split": "train",
"index": 2775,
"acecode_id": "evol_12857",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing the power limits of a series of servers. Each server has a unique ID ranging from 1 to N. You need to implement a function `set_power_limit(N: int, power_limit: int) -> List[str]` that sets a specified power limit for each server from 1 to N. The fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_power_limit(1, 100) == ['Server 1: Power limit set to 100']\", \"assert set_power_limit(2, 150) == ['Server 1: Power limit set to 150', 'Server 2: Failed to set power limit']\", \"assert set_power_limit(3, 200) == ['Server 1: Power limit set to 200', 'Se... | {
"split": "train",
"index": 2776,
"acecode_id": "bigcode_python_fns_46510",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D list of integers representing a matrix. Your task is to implement a function that returns the sum of all elements in the matrix along a specified axis. The axis can be either 0 (sum by columns) or 1 (sum by rows). Write a function `matrix_sum(matrix: List[Lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert matrix_sum([[1, 2], [3, 4]], 0) == [4, 6]\", \"assert matrix_sum([[1, 2], [3, 4]], 1) == [3, 7]\", \"assert matrix_sum([[0, 0], [0, 0]], 0) == [0, 0]\", \"assert matrix_sum([[5]], 0) == [5]\", \"assert matrix_sum([[5]], 1) == [5]\", \"assert matrix_sum([[1, ... | {
"split": "train",
"index": 2777,
"acecode_id": "bigcode_python_fns_9784",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list `populations` containing the populations of various cities. Your task is to calculate the total population of all the cities in the list. Write a Python function `calculate_total_population` that takes the list `populations` as input and returns the total p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_population([100, 200, 300]) == 600\", \"assert calculate_total_population([0, 0, 0]) == 0\", \"assert calculate_total_population([1, 2, 3, 4, 5]) == 15\", \"assert calculate_total_population([99999, 88888, 77777]) == 266664\", \"assert calcul... | {
"split": "train",
"index": 2778,
"acecode_id": "oss_20900",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the average field goal percentage (FG%) for a basketball team based on a list of statistics. Each team's statistics are provided as a list of dictionaries, where each dictionary contains the keys: 'Team Name', 'FG%', and other statistics. Write a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_fg_percentage([{'Team Name': 'TeamA', 'FG%': 50.0}, {'Team Name': 'TeamB', 'FG%': 50.0}]) == {'TeamA': 50.0, 'TeamB': 50.0}\", \"assert calculate_average_fg_percentage([{'Team Name': 'TeamA', 'FG%': 60.0}, {'Team Name': 'TeamA', 'FG%': 40.0... | {
"split": "train",
"index": 2779,
"acecode_id": "oss_660",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are asked to manage a list of days of the week. Your task is to implement a function that takes a list of days (as strings) and adds a new day, 'Sunday', to that list. The function should return the original list of days and the updated list of days (including 'Sunday') as ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_sunday(['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']) == (['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'])\", \"assert add_sunday(... | {
"split": "train",
"index": 2780,
"acecode_id": "oss_17743",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a Docker build command string based on given parameters. The function `generate_docker_command(dockerhub_repo: str, system_version: str) -> str` should take in a Docker Hub repository name and a system version, and return a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_docker_command('myrepo', '1.0') == 'docker build --tag myrepo/scpca_portal_api --build-arg SYSTEM_VERSION=1.0 --build-arg HTTP_PORT=8081 -f Dockerfile.prod .'\", \"assert generate_docker_command('example/repo', '2.1.3') == 'docker build --tag exampl... | {
"split": "train",
"index": 2781,
"acecode_id": "bigcode_python_fns_48712",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that finds the shortest path through a 2D maze represented by a grid of 0s and 1s. In this maze, 0 represents walls and 1 represents paths. The function should start at the top-left corner of the maze (0, 0) and try to reach the bottom-right corner of the m... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shortest_path([[0]]) == -1\", \"assert shortest_path([[1, 0], [0, 0]]) == -1\", \"assert shortest_path([[0, 0, 0], [0, 0, 1], [1, 1, 1]]) == -1\", \"assert shortest_path([[1, 0, 1, 1], [1, 1, 0, 1], [0, 1, 1, 1]]) == 6\", \"assert shortest_path([[1, 1], [1, ... | {
"split": "train",
"index": 2782,
"acecode_id": "evol_2022",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary that may contain various query parameters, write a function called `is_metageneration_specified` that checks if the key 'ifMetagenerationMatch' is present in the dictionary and its value is not None. If the key exists and its value is not None, return True. O... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_metageneration_specified({'ifMetagenerationMatch': 1}) == True\", \"assert is_metageneration_specified({'ifMetagenerationMatch': None}) == False\", \"assert is_metageneration_specified({'ifMetagenerationMatch': 'value'}) == True\", \"assert is_metagenerat... | {
"split": "train",
"index": 2783,
"acecode_id": "bigcode_python_fns_37897",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that performs a binary search on a sorted array to find the index of a specified element. If the element is found, return its index. If the element is not found, return -1. The function should have the following signature: `def binary_search(arr: List[int],... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binary_search([1, 3, 5, 7, 8, 10], 8) == 4\", \"assert binary_search([1, 2, 3, 4, 5], 1) == 0\", \"assert binary_search([1, 2, 3, 4, 5], 5) == 4\", \"assert binary_search([1, 2, 3, 4, 5], 3) == 2\", \"assert binary_search([1, 3, 5, 7, 9], 7) == 3\", \"assert... | {
"split": "train",
"index": 2784,
"acecode_id": "evol_33884",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a sequence of characters. Your task is to implement a function `count_characters(s)` that counts the number of occurrences of each character in the string, ignoring case and spaces. The function should return a dictionary where the keys are t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_characters('Hello World') == {'h': 1, 'e': 1, 'l': 3, 'o': 2, 'w': 1, 'r': 1, 'd': 1}\", \"assert count_characters(' ') == {}\", \"assert count_characters('aA') == {'a': 2}\", \"assert count_characters('OpenAI') == {'o': 1, 'p': 1, 'e': 1, 'n': 1, 'a':... | {
"split": "train",
"index": 2785,
"acecode_id": "oss_14234",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating a list of random points in a multi-dimensional space based on a given height. Write a function `generate_random_points(n: int, height: float, baseshape: List[int]) -> List[List[float]]` that generates `n` points in an (d+1)-dimensional space, wher... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_random_points(3, 2.0, [3, 4]) is not None\", \"assert len(generate_random_points(5, 1.0, []) ) == 5\", \"assert len(generate_random_points(0, 1.0, [3, 4])) == 0\", \"assert len(generate_random_points(2, 5.0, [1])) == 2\", \"assert all(len(point) == ... | {
"split": "train",
"index": 2786,
"acecode_id": "bigcode_python_fns_16646",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to implement a function that determines the sum of all even numbers in the list. The function should take a single parameter, a list of integers, and return the sum of the even integers. If there are no even integers, the function ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([0, 1, 2, 3, 4]) == 6\", \"assert sum_of_evens([-2, -4, 0, 3, 5]) == -6\", \"assert sum_of_evens([1, 3, 5, 7]) == 0\", \"assert sum_of_evens([10, 20, 30, 40]) == 100\", \"assert sum_of_evens([1, 2, ... | {
"split": "train",
"index": 2787,
"acecode_id": "oss_34129",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of performance statistics, where each statistic is a tuple containing the function name, the number of calls made to that function, the total time spent in that function, and the cumulative time spent in that function (including calls to sub-functions). You... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_performance_stats([('func_a', 10, 0.5, 1.0), ('func_b', 5, 0.2, 0.4)], 'cumulative', True, 2) == [('func_a', 10, 0.5, 1.0), ('func_b', 5, 0.2, 0.4)]\", \"assert analyze_performance_stats([('func_a', 2, 0.1, 0.3), ('func_b', 6, 0.4, 0.5)], 'time', Fal... | {
"split": "train",
"index": 2788,
"acecode_id": "oss_8932",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a tuple of exactly 15 integers and returns the maximum value in the tuple without using the built-in max() function or sorting the tuple.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ``... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max((5, 21, 1, 15, 3, 74, 12, 47, 2, 6, 88, 29, 30, 45, 67)) == 88\", \"assert find_max((10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150)) == 150\", \"assert find_max((-1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15)) =... | {
"split": "train",
"index": 2789,
"acecode_id": "evol_3247",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two floating-point numbers, write a function that determines their greatest common divisor (GCD) and least common multiple (LCM). The function should return the results rounded to two decimal places. The GCD should be calculated using the mathematical definition, and the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert gcd_lcm(2.5, 5.0) == (2.5, 5.0)\", \"assert gcd_lcm(3.5, 7.0) == (3.5, 7.0)\", \"assert gcd_lcm(1.1, 2.2) == (1.1, 2.2)\", \"assert gcd_lcm(4.0, 10.0) == (2.0, 20.0)\", \"assert gcd_lcm(6.0, 9.0) == (3.0, 18.0)\", \"assert gcd_lcm(8.5, 17.0) == (8.5, 17.0)\"... | {
"split": "train",
"index": 2790,
"acecode_id": "evol_17290",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D list of rotation vectors, where each inner list represents a rotation vector in a batch. Your task is to calculate the average magnitude of these rotation vectors using the Euclidean norm. Write a function `average_magnitude(rot_vecs: List[List[float]]) -> fl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_magnitude([[1.0, 0.0], [0.0, 1.0]]) == 1.0\", \"assert average_magnitude([[1.0, 1.0], [1.0, 1.0], [1.0, 1.0]]) == 1.4142135623730951\", \"assert average_magnitude([[0.0, 0.0], [0.0, 0.0]]) == 0.0\", \"assert average_magnitude([[1.0, 1.0], [1.0, 1.0],... | {
"split": "train",
"index": 2791,
"acecode_id": "oss_19215",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that retrieves a specific metadata configuration for a Geographic Markup Language (GML) document. The function should return the namespace value, which is hardcoded as 'http://www.opengis.net/gml'. Write a function `get_gml_namespace(... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_gml_namespace() == 'http://www.opengis.net/gml'\", \"assert get_gml_namespace() == 'http://www.opengis.net/gml'\", \"assert get_gml_namespace() == 'http://www.opengis.net/gml'\", \"assert get_gml_namespace() == 'http://www.opengis.net/gml'\", \"assert ge... | {
"split": "train",
"index": 2792,
"acecode_id": "oss_14760",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are asked to create a Python function `count_vowels` that takes a string as input and returns the number of vowels (a, e, i, o, u) in that string. The function should be case-insensitive, meaning it should count both uppercase and lowercase vowels. If the input string is em... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_vowels('Hello World') == 3\", \"assert count_vowels('Python') == 1\", \"assert count_vowels('AEIOU') == 5\", \"assert count_vowels('aeiou') == 5\", \"assert count_vowels('abcde') == 2\", \"assert count_vowels('xyz') == 0\", \"assert count_vowels('') ==... | {
"split": "train",
"index": 2793,
"acecode_id": "oss_18241",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing control points of a curve, and a list of tuples where each tuple contains a control point index and its desired multiplicity. Your task is to modify the control points so that each specified control point has the specified multiplic... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert modifyControlPoints([1, 2, 3], [(0, 2), (1, 1)]) == [1, 1, 2, 3]\", \"assert modifyControlPoints([4, 5], [(0, 1), (1, 1), (2, 2)]) == [4, 5]\", \"assert modifyControlPoints([], [(0, 1)]) == []\", \"assert modifyControlPoints([10, 20, 30], [(0, 1), (1, 3), (3... | {
"split": "train",
"index": 2794,
"acecode_id": "bigcode_python_fns_5114",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a JSON Web Token (JWT) as a string. Your task is to decode the JWT and extract the payload. The JWT is composed of three parts: a header, a payload, and a signature, separated by dots ('.'). The payload is Base64Url encoded. Write a function `decode_jwt(jwt_token:... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decode_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.5c8b6e6e2f3d6a7f4f3f4f3f4f3f4f3f') == {'sub': '1234567890', 'name': 'John Doe', 'iat': 1516239022}\", \"assert decode_jwt('eyJhbGciOiJ... | {
"split": "train",
"index": 2795,
"acecode_id": "oss_493",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the creation of a summary object. The function should take a string `tag`, a data input of type `bytes`, `str`, or a list of strings, and an optional description string. If the data input is not of the supported types, the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_summary('tag1', b'some bytes') == {'tag': 'tag1', 'description': None, 'data': b'some bytes'}\", \"assert create_summary('tag2', 'some string') == {'tag': 'tag2', 'description': None, 'data': 'some string'}\", \"assert create_summary('tag3', ['string1... | {
"split": "train",
"index": 2796,
"acecode_id": "bigcode_python_fns_15571",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of file names representing validated input files. Your task is to implement a function that takes this list and an integer input representing the index of the file to read. The function should return the contents of the specified file as a string. If the in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert read_file_content(['file1.txt', 'file2.txt', 'file3.txt'], 3) == 'Index out of bounds'\", \"assert read_file_content([], 0) == 'Index out of bounds'\", \"assert read_file_content(['file1.txt', 'file2.txt'], -1) == 'Index out of bounds'\", \"assert read_file_... | {
"split": "train",
"index": 2797,
"acecode_id": "bigcode_python_fns_41743",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple scoring system for a guessing game. The function `update_score` takes three parameters: `key_id` (a unique identifier for a player), `guess` (a string representing the player's guess), and `correct` (a boolean indi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_score('player1', 'apple', False) == {'key_id': 'player1', 'score': 0, 'message': 'Wrong guess: apple'}\", \"assert update_score('player1', 'banana', True) == {'key_id': 'player1', 'score': 1, 'message': 'Correct guess!'}\", \"assert update_score('play... | {
"split": "train",
"index": 2798,
"acecode_id": "bigcode_python_fns_17833",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_bool(var)` that determines whether the given variable `var` is of boolean type. A boolean variable can only be `True` or `False`. The function should return `True` if `var` is a boolean, and `False` otherwise. For example, if `var` is `True`, the functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_bool(True) == True\", \"assert is_bool(False) == True\", \"assert is_bool(1) == False\", \"assert is_bool(0) == False\", \"assert is_bool('True') == False\", \"assert is_bool('False') == False\", \"assert is_bool([]) == False\", \"assert is_bool([True]) =... | {
"split": "train",
"index": 2799,
"acecode_id": "oss_8608",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.