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 that returns a list of all prime numbers within a given range (inclusive). The function should accept two parameters, `start` and `end`, which represent the start and end of the range. Ensure that the function validates that the input is correct (i.e., `sta...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sieve_of_eratosthenes(1, 10) == [2, 3, 5, 7]\", \"assert sieve_of_eratosthenes(10, 30) == [11, 13, 17, 19, 23, 29]\", \"assert sieve_of_eratosthenes(15, 15) == []\", \"assert sieve_of_eratosthenes(10, 5) == []\", \"assert sieve_of_eratosthenes(20, 20) == []\...
{ "split": "train", "index": 74000, "acecode_id": "evol_35516", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes a multidimensional array containing integer values ranging from -1000 to 1000 and returns a new array that is a deep copy of the input array. The original array should remain unchanged after the operation.\nPlease reason step by step, then write a se...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert copy_array([[1, 2, 3], [4, 5, 6]]) == [[1, 2, 3], [4, 5, 6]]\", \"assert copy_array([[0, -1], [-2, 3], [4, 5]]) == [[0, -1], [-2, 3], [4, 5]]\", \"assert copy_array([[-1000, 500], [250, 1000]]) == [[-1000, 500], [250, 1000]]\", \"assert copy_array([[10, 20],...
{ "split": "train", "index": 74001, "acecode_id": "evol_29093", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that sorts a list of dictionaries based on multiple keys, where each key has a specified sort order (either ascending or descending). If a key is missing from a dictionary, it should use a default value specified for that key during sorting. The function sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_dicts([{'key1': 3, 'key2': 1}, {'key1': 2, 'key2': 2}], {'key1': 0, 'key2': 0}) == [{'key1': 2, 'key2': 2}, {'key1': 3, 'key2': 1}]\", \"assert sort_dicts([{'key1': 1}, {'key1': 3, 'key2': 1}], {'key1': 0, 'key2': 0}) == [{'key1': 1}, {'key1': 3, 'key2'...
{ "split": "train", "index": 74002, "acecode_id": "evol_22945", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function that rounds off a given floating-point number to the nearest whole number. The function should take a single parameter, a floating-point number, and return the rounded integer value. For example, rounding 3.14 should return 3, while rounding 3.5 should retu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert round_off_number(3.14) == 3\", \"assert round_off_number(3.5) == 4\", \"assert round_off_number(2.7) == 3\", \"assert round_off_number(2.3) == 2\", \"assert round_off_number(0.9) == 1\", \"assert round_off_number(-2.5) == -2\", \"assert round_off_number(-3.7...
{ "split": "train", "index": 74003, "acecode_id": "evol_31388", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string of text. Your task is to implement a function that counts the occurrences of each alphanumeric word in the text, ignoring case sensitivity. Return a dictionary where the keys are the words and the values are their respective counts. A word is defined as a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_word_occurrences('Test test Test!') == {'test': 3}\", \"assert count_word_occurrences('Hello world! Hello!') == {'hello': 2, 'world': 1}\", \"assert count_word_occurrences('One two three One two') == {'one': 2, 'two': 2, 'three': 1}\", \"assert count_w...
{ "split": "train", "index": 74004, "acecode_id": "oss_36244", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `concatenate_strings(a: str, b: str) -> str` that takes two strings as input and returns their concatenation. Ensure that the function can handle empty strings and special characters correctly.\nPlease reason step by step, then write a self-contained Python...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert concatenate_strings('Hello, ', 'world!') == 'Hello, world!'\", \"assert concatenate_strings('', 'world!') == 'world!'\", \"assert concatenate_strings('Hello, ', '') == 'Hello, '\", \"assert concatenate_strings('', '') == ''\", \"assert concatenate_strings('P...
{ "split": "train", "index": 74005, "acecode_id": "evol_18939", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates a simplified version of a web API client. Your task is to implement a function `api_get_request` that takes in two parameters: `endpoint` (string) representing the endpoint to which a GET request will be sent, and `p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert api_get_request('/valid_endpoint', {'param': 'value'}) == 200\", \"assert api_get_request('/valid_endpoint', {}) == 200\", \"assert api_get_request('/invalid_endpoint', {'param': 'value'}) == 404\", \"assert api_get_request('/missing_params.json', {'param': ...
{ "split": "train", "index": 74006, "acecode_id": "oss_23568", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `storage_operations` that simulates interactions with a cloud storage service. The function should take a list of operations represented as tuples. Each tuple contains the operation type ('upload', 'download', 'list', or 'delete') and its associated paramet...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert storage_operations([('upload', 'file1.txt', 'bucket1')]) == ['Uploaded file1.txt to bucket1']\", \"assert storage_operations([('upload', 'file3.txt', 'bucket2')]) == ['Uploaded file3.txt to bucket2']\", \"assert storage_operations([('upload', 'file_nonexiste...
{ "split": "train", "index": 74007, "acecode_id": "evol_4604", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the execution of a list of tasks. Each task is represented by a string that describes the task. Your function should accept a list of task strings and return a list of strings representing the output of each executed task i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert execute_tasks(['Task 1', 'Task 2']) == ['Task Task 1 executed', 'Task Task 2 executed']\", \"assert execute_tasks(['Task A', 'Task B', 'Task C']) == ['Task Task A executed', 'Task Task B executed', 'Task Task C executed']\", \"assert execute_tasks([]) == []\...
{ "split": "train", "index": 74008, "acecode_id": "oss_1947", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that computes the Jaccard similarity coefficient between two sets of integers. The function should take two lists of integers as input and return the Jaccard similarity coefficient as a float. The Jaccard similarity coefficient is cal...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert jaccard_similarity([1, 2, 3], [2, 3, 4]) == 0.5\", \"assert jaccard_similarity([1, 2, 3], [4, 5, 6]) == 0.0\", \"assert jaccard_similarity([], []) == 0.0\", \"assert jaccard_similarity([1, 2, 3], []) == 0.0\", \"assert jaccard_similarity([], [4, 5, 6]) == 0....
{ "split": "train", "index": 74009, "acecode_id": "evol_24871", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of user choices, where each user choice is represented by an object with an 'item' attribute. Your task is to write a function `get_unique_items(user_choices)` that returns a list of unique items from the given choices. The order of the unique items in the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_items([{'item': 'apple'}, {'item': 'banana'}, {'item': 'apple'}, {'item': 'orange'}]) == ['apple', 'banana', 'orange']\", \"assert get_unique_items([{'item': 'car'}, {'item': 'car'}, {'item': 'bike'}, {'item': 'car'}, {'item': 'bus'}]) == ['car', ...
{ "split": "train", "index": 74010, "acecode_id": "bigcode_python_fns_45021", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string representing a file name, determine if it is recognized as a HDF file. A file is considered an HDF file if its name ends with either '.hdf' or '.h5'. Implement a function `is_hdf_file(filename: str) -> bool` that takes a single argument `filename` (a string) and ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_hdf_file('data.hdf') == True\", \"assert is_hdf_file('report.h5') == True\", \"assert is_hdf_file('image.txt') == False\", \"assert is_hdf_file('archive.zip') == False\", \"assert is_hdf_file('document.hdf5') == False\", \"assert is_hdf_file('dataset.h5')...
{ "split": "train", "index": 74011, "acecode_id": "bigcode_python_fns_32038", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two types of monomers, A and B, each with their own site conditions and refinement rules. A monomer can be represented by a letter and has a set of sites that can take specific values. Implement a function `check_refinement(monomer_a: dict, monomer_b: dict, refine...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_refinement({'A': ['w', 'x'], 'conditions': {'x': ('e', 'f')}}, {'B': ['y', 'z'], 'conditions': {'z': ('g', 'h')}}, {'x': 'f', 'z': 'h'}) == True\", \"assert check_refinement({'A': ['w', 'x'], 'conditions': {'x': ('e', 'f')}}, {'B': ['y', 'z'], 'conditi...
{ "split": "train", "index": 74012, "acecode_id": "bigcode_python_fns_41903", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given a complete name string in the format 'First Last', return a tuple containing the first name and the last name. If the input string only contains a first name, return a tuple with the first name and an empty string. If the input string is empty, return a tuple with two emp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert split_name('John Doe') == ('John', 'Doe')\", \"assert split_name('Alice Wonderland') == ('Alice', 'Wonderland')\", \"assert split_name(' Bob ') == ('Bob', '')\", \"assert split_name('Eve') == ('Eve', '')\", \"assert split_name(' ') == ('', '')\", \"assert ...
{ "split": "train", "index": 74013, "acecode_id": "bigcode_python_fns_47266", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with generating a 2D array of labels for a machine learning classification problem. Each label should be a one-hot encoded vector of length `c_dims`, where the first element is set to 1, and the rest are randomly shuffled to form the one-hot encoding. Your functi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_labels(1, 2) == [[1.0, 0.0]]\", \"assert generate_labels(2, 2) == [[1.0, 0.0], [1.0, 0.0]] or [[0.0, 1.0], [0.0, 1.0]]\", \"assert len(generate_labels(5, 5)) == 5\", \"assert all(len(label) == 3 for label in generate_labels(4, 3))\", \"assert all(su...
{ "split": "train", "index": 74014, "acecode_id": "bigcode_python_fns_46774", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function to validate user login credentials. The function `validate_login` should take two parameters: an email (string) and a password (string). You will validate the credentials against a predefined dictionary named `registered_users`, where the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_login('user1@example.com', 'password1') == 'Login successful'\", \"assert validate_login('user2@example.com', 'password2') == 'Login successful'\", \"assert validate_login('user1@example.com', 'wrongpassword') == 'Incorrect password'\", \"assert val...
{ "split": "train", "index": 74015, "acecode_id": "oss_10956", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that verifies whether a given string is a valid HyperText Transfer Protocol Secure (HTTPS) web address. The function should accept a string as input and return a boolean indicating if the URL is valid according to the specified regex pattern. A valid HTTPS ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert verify_https_url('https://www.example.com') == True\", \"assert verify_https_url('https://example.com') == True\", \"assert verify_https_url('https://subdomain.example.com') == True\", \"assert verify_https_url('https://192.168.0.1') == True\", \"assert veri...
{ "split": "train", "index": 74016, "acecode_id": "evol_18477", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `setup_network_environment` that simulates the setup of a network environment. The function should take no parameters and return a dictionary containing the following keys and their respective values: \n\n1. `temp_dir`: a string repre...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert setup_network_environment() == {'temp_dir': 'temp/dir/path', 'central_data_bridge': 'cnt-data', 'central_external_bridge': 'cnt-ex'}\", \"assert setup_network_environment()['temp_dir'] == 'temp/dir/path'\", \"assert setup_network_environment()['central_data_...
{ "split": "train", "index": 74017, "acecode_id": "oss_1927", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a nested JSON object, implement a function that returns a list of all keys present in the object, including those in nested structures. The keys should be represented in a dot notation format indicating their hierarchy. For example, if the input is {'a': {'b': 1}}, the ou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_keys({'a': {'b': 1}}) == ['a.b']\", \"assert get_keys({'x': {'y': {'z': 100}}}) == ['x.y.z']\", \"assert get_keys({'foo': 'bar'}) == ['foo']\", \"assert get_keys({'level1': {'level2': {'level3': 'value'}}}) == ['level1.level2.level3']\", \"assert get_key...
{ "split": "train", "index": 74018, "acecode_id": "evol_18502", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `get_ssh_ips(config_string: str) -> List[str]` that extracts a list of SSH IP addresses from a given JSON configuration string. The configuration string will be in the following format: `{ 'ssh_ips': [ '192.168.1.1', '10.0.0.1', '172.16.0...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_ssh_ips('{ \\\"ssh_ips\\\": [ \\\"192.168.1.1\\\", \\\"10.0.0.1\\\", \\\"172.16.0.1\\\" ] }') == ['192.168.1.1', '10.0.0.1', '172.16.0.1']\", \"assert get_ssh_ips('{ \\\"ssh_ips\\\": [] }') == []\", \"assert get_ssh_ips('{ \\\"other_key\\\": [ \\\"192.16...
{ "split": "train", "index": 74019, "acecode_id": "bigcode_python_fns_27106", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to process Twitter request types. Your goal is to write a function `set_request_type_as_retweet` that takes the current state of a Twitter client and modifies its attributes based on whether the client is currently querying or not. Th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_request_type_as_retweet({'querying': False, 'status_update': True, 'status_retweet': False, 'direct_message': True, 'request_params': {'param1': 'value1'}, 'request_domain': 'original_url'}, 'retweet_url') == {'querying': False, 'status_update': False, '...
{ "split": "train", "index": 74020, "acecode_id": "oss_6488", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `s` representing a file path, implement a function that normalizes the path by removing redundant slashes and resolving any `..` segments. The resulting path should always be absolute. For example, the path `'/a//b////c/d/../..'` should be normalized to `'/a/b'`....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert normalize_path('/a//b////c/d/../..') == '/a/b'\", \"assert normalize_path('/../') == '/'\", \"assert normalize_path('/home//foo/') == '/home/foo'\", \"assert normalize_path('/a/b/c/./d/') == '/a/b/c/d'\", \"assert normalize_path('/a/./b/../../c/') == '/c'\",...
{ "split": "train", "index": 74021, "acecode_id": "bigcode_python_fns_35844", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a 2D list representing a batch of tasks, where each inner list represents a machine's assigned tasks. Write a function `shape(batch: List[List[int]]) -> Tuple[int, int]` that returns a tuple containing two integers: the number of machines (the number of inner list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert shape([]) == (0, 0)\", \"assert shape([[1, 2, 3]]) == (1, 3)\", \"assert shape([[1, 2], [3, 4], [5, 6]]) == (3, 2)\", \"assert shape([[1], [2], [3], [4]]) == (4, 1)\", \"assert shape([[1, 2, 3], [4, 5, 6]]) == (2, 3)\", \"assert shape([[1, 2, 3], [4, 5, 6], ...
{ "split": "train", "index": 74022, "acecode_id": "bigcode_python_fns_28031", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing a list of tasks for a project. You need to create a function `task_manager` that takes a list of tasks and a list of operations to perform on these tasks. The operations can include adding a task, removing a task, marking a task as completed, and re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert task_manager([], [('add', 'Task 1'), ('add', 'Task 2'), ('complete', 'Task 1')]) == (1, 50.0)\", \"assert task_manager(['Task 1', 'Task 2'], [('remove', 'Task 1'), ('add', 'Task 3'), ('complete', 'Task 2')]) == (1, 50.0)\", \"assert task_manager(['Task 1'], ...
{ "split": "train", "index": 74023, "acecode_id": "oss_36429", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a 3D crop window represented as a list of integers in the format [offset_height, offset_width, offset_channel, crop_height, crop_width, crop_channels], write a function `convert_3d_crop_window_to_2d(crop_window: List[int]) -> List[int]` that extracts the spatial parameter...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_3d_crop_window_to_2d([0, 0, 0, 10, 10, 3]) == [0, 0, 10, 10]\", \"assert convert_3d_crop_window_to_2d([1, 2, 3, 5, 5, 4]) == [1, 2, 5, 5]\", \"assert convert_3d_crop_window_to_2d([10, 20, 30, 15, 25, 2]) == [10, 20, 15, 25]\", \"assert convert_3d_cro...
{ "split": "train", "index": 74024, "acecode_id": "bigcode_python_fns_8020", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that validates the scale value for a 3D scatter plot. The scale value must be a non-negative integer. Write a function `validate_scale(scale_value: int) -> None` that takes a single parameter `scale_value` and raises a `ValueError` if...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_scale(0) is None\", \"assert validate_scale(5) is None\", \"assert validate_scale(100) is None\", \"assert validate_scale(10) is None\", \"assert validate_scale(1) is None\", \"assert validate_scale(50) is None\", \"assert validate_scale(20) is None...
{ "split": "train", "index": 74025, "acecode_id": "oss_26263", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function `process_model_options` that takes in the following parameters: \n- `return_distance_clusters`: a boolean indicating whether to return model clusters distances (default: False) \n- `return_str`: a boolean indicating whether to return a string representat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_model_options(True, False, 'KMeans') == 'Model clusters distances'\", \"assert process_model_options(True, False, 'NearestCentroids') == 'Model clusters distances'\", \"assert process_model_options(False, True, 'KMeans') == 'Function representation o...
{ "split": "train", "index": 74026, "acecode_id": "oss_23062", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates saving a figure and attaching it to a logging system. Write a function `save_and_log_figure` that takes in a `filename` (string), a `figure` (string representing the figure name), and an optional list of `attachments` (list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert save_and_log_figure('plot.png', 'Figure1', ['Image1', 'Image2']) == ['Image1', 'Image2', 'Figure1']\", \"assert save_and_log_figure('plot.png', 'Figure1') == ['Figure1']\", \"assert save_and_log_figure('plot.png', 'Figure1', ['Figure1']) == ['Figure1']\", \"...
{ "split": "train", "index": 74027, "acecode_id": "bigcode_python_fns_1409", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that accepts an array of unique numerical strings. The function should return the digit that appears most frequently across all strings. If there are multiple digits with the same maximum frequency, return the digit that appears first in the input strings.\...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert most_frequent_digit(['111', '222', '333']) == '1'\", \"assert most_frequent_digit(['456', '456', '456']) == '4'\", \"assert most_frequent_digit(['123', '456', '789', '123']) == '1'\", \"assert most_frequent_digit(['111', '222', '111']) == '1'\", \"assert mos...
{ "split": "train", "index": 74028, "acecode_id": "evol_28485", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers 'arr' and a number or an array of numbers 'num', implement a function that finds the indexed positions of each element of 'num' in 'arr'. If 'num' is a single integer, return a list of positions where that integer occurs in 'arr'. If 'num' is an array...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_positions([1, 2, 3, 2, 1], 2) == [1, 3]\", \"assert find_positions([1, 2, 3, 2, 1], 5) == []\", \"assert find_positions([1, 2, 3, 2, 1], [2, 1]) == [[1, 3], [0, 4]]\", \"assert find_positions([10, 20, 30, 40, 50], [10, 30, 50]) == [[0], [2], [4]]\", \"a...
{ "split": "train", "index": 74029, "acecode_id": "evol_9100", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with determining the range of rows to be imported from a data source based on given start and end row settings. The start row is inclusive, and the end row is exclusive. If the end row is set to -1, this indicates that all rows following the start row should be i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_import_range(3, 7) == (3, 7)\", \"assert calculate_import_range(5, -1) == (5, -1)\", \"assert calculate_import_range(2, 10) == (2, 10)\", \"assert calculate_import_range(1, 1) == (1, 1)\", \"assert calculate_import_range(0, -1) == (0, -1)\", \"asse...
{ "split": "train", "index": 74030, "acecode_id": "oss_1935", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `update_inventory(item_id: str, stock_level: int) -> dict` that simulates sending a PATCH request to update the stock level of an item in an inventory system. The function should take in two parameters: `item_id` (a string representing the unique identifier...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_inventory('12345', 20) == {'item_id': '12345', 'stock_level': 20}\", \"assert update_inventory('67890', 0) == {'item_id': '67890', 'stock_level': 0}\", \"assert update_inventory('54321', 10) == {'item_id': '54321', 'stock_level': 10}\", \"assert updat...
{ "split": "train", "index": 74031, "acecode_id": "evol_26822", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a function `get_edge_bin_standard(array)` that takes in an array of integers (0s and 1s) or booleans (True and False). Your task is to implement the `get_edge_bin_standard` function which returns a list of tuples representing the start and end indices of consecuti...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_edge_bin_standard([0, 1, 1, 0, 0, 0, 1, 0, 1]) == [(1, 3), (6, 7), (8, 9)]\", \"assert get_edge_bin_standard([0, 0, 0, 0]) == []\", \"assert get_edge_bin_standard([1, 1, 1, 1]) == []\", \"assert get_edge_bin_standard([0, 0, 1, 1, 0]) == [(2, 4)]\", \"ass...
{ "split": "train", "index": 74032, "acecode_id": "oss_12381", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Implement a function that checks if a sequence of words in a tuple is sorted in ascending order based on their second last character. The function should ignore any non-letter characters when determining the second last character. If any word has less than two characters or if ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_sorted_by_second_last_char(('apple', 'banana', 'cherry')) == True\", \"assert is_sorted_by_second_last_char(('hello', 'world')) == True\", \"assert is_sorted_by_second_last_char(('zebra', 'apple', 'banana')) == False\", \"assert is_sorted_by_second_last_c...
{ "split": "train", "index": 74033, "acecode_id": "evol_7731", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple membership management system. Your goal is to create a function named `manage_membership` that accepts a list of operations and returns a list of results. Each operation will be one of the following: `add_member(member)`, `remove_member...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_membership(['add_member(Alice)', 'add_member(Bob)', 'is_member(Alice)']) == [True]\", \"assert manage_membership(['add_member(Alice)', 'remove_member(Alice)', 'is_member(Alice)']) == [False]\", \"assert manage_membership(['add_member(Alice)', 'add_mem...
{ "split": "train", "index": 74034, "acecode_id": "oss_16446", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the negative logarithm of p-values from a given list of p-values and generates a list of corresponding y-values for a Manhattan plot. The function should take a list of p-values and return a list of negative log10 tran...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transform_p_values([0.01, 0.05, 0.001]) == [2.0, 1.3010299956639813, 3.0]\", \"assert transform_p_values([0.001, 0.05]) == [3.0, 1.3010299956639813]\", \"assert transform_p_values([0.0001]) == [4.0]\", \"assert transform_p_values([0.25, 0.75]) == [0.60205999...
{ "split": "train", "index": 74035, "acecode_id": "bigcode_python_fns_13090", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `stack_operations(operations: List[Tuple[str, Optional[int]]]) -> List[Optional[int]]` that simulates the operations of a stack based on a list of operations given as tuples. Each operation is defined as follows: \n- `('push', x)`: Ad...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert stack_operations([('push', 5), ('push', 10), ('peek',), ('pop',), ('isEmpty',)]) == [10, 10, False]\", \"assert stack_operations([('push', 1), ('push', 2), ('push', 3), ('peek',), ('isEmpty',)]) == [3, False]\", \"assert stack_operations([('isEmpty',), ('pop...
{ "split": "train", "index": 74036, "acecode_id": "oss_10545", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string s consisting of only parentheses '(', ')', '{', '}', '[' and ']', write a function to determine if the input string is valid. An input string is considered valid if the brackets are closed in the correct order. That is, each opening bracket has a corresponding cl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid('()') == True\", \"assert is_valid('()[]{}') == True\", \"assert is_valid('(]') == False\", \"assert is_valid('([)]') == False\", \"assert is_valid('{[]}') == True\", \"assert is_valid('') == True\", \"assert is_valid(')(') == False\", \"assert is_v...
{ "split": "train", "index": 74037, "acecode_id": "bigcode_python_fns_26283", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a Python function that takes a string and returns the string with all vowels removed. The function should ignore both uppercase and lowercase vowels. For example, given the input 'Hello World', the output should be 'Hll Wrld'.\nPlease reason step by step, then write a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_vowels('Hello World') == 'Hll Wrld'\", \"assert remove_vowels('Python Programming') == 'Pythn Prgrmmng'\", \"assert remove_vowels('Aeiou') == ''\", \"assert remove_vowels('bcdfgh') == 'bcdfgh'\", \"assert remove_vowels('12345') == '12345'\", \"assert ...
{ "split": "train", "index": 74038, "acecode_id": "evol_20691", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a singly linked list that contains only even integers in sorted order, implement a function `sortedInsert(head: Node, newData: int) -> Node` that inserts a new even integer node at the correct position to maintain the sorted order. If the integer is odd, the function shou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sortedInsert(Node(2), 4).data == 2\", \"assert sortedInsert(Node(2), 4).next.data == 4\", \"assert sortedInsert(Node(2), 4).next.next is None\", \"assert sortedInsert(Node(2), 6).data == 2\", \"assert sortedInsert(Node(2), 6).next.data == 6\", \"assert sorte...
{ "split": "train", "index": 74039, "acecode_id": "evol_25659", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given a list of strings, where each string consists of tab-separated values. Each string represents a record containing a contig and its corresponding taxonomic ID. Your task is to implement a function that processes this list of strings and creates a dictionary mapping...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_kraken_output(['contig1\\\\t123', 'contig2\\\\t456']) == ['contig1: 123', 'contig2: 456']\", \"assert process_kraken_output(['contigA\\\\t999', 'contigB\\\\t888']) == ['contigA: 999', 'contigB: 888']\", \"assert process_kraken_output(['contigX\\\\t11...
{ "split": "train", "index": 74040, "acecode_id": "oss_34876", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function named `count_unique` that returns a dictionary where the keys are the unique integers from the input list and the values are the counts of how many times each integer appears in the list. If the input list is empty, the function should...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_unique([1, 2, 3, 1, 2, 3, 4, 1, 2, 4, 5]) == {1: 3, 2: 3, 3: 2, 4: 2, 5: 1}\", \"assert count_unique([1, 1, 1, 1, 1]) == {1: 5}\", \"assert count_unique([3, 3, 3]) == {3: 3}\", \"assert count_unique([7, 8, 9, 7, 7, 8]) == {7: 3, 8: 2, 9: 1}\", \"assert...
{ "split": "train", "index": 74041, "acecode_id": "oss_25381", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with validating a list of URLs to determine if they belong to a set of trusted sources. Implement a function `validate_urls(urls: List[str]) -> List[bool]` that takes a list of URL strings and returns a list of boolean values indicating whether each URL is from a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_urls(['http://www.hello.com/world']) == [True]\", \"assert validate_urls(['http://www.example.com/article']) == [True]\", \"assert validate_urls(['http://www.test.com/home']) == [True]\", \"assert validate_urls(['http://untrusted.com/somepage']) == ...
{ "split": "train", "index": 74042, "acecode_id": "bigcode_python_fns_26729", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that categorizes a list of whole numbers and fractions in a unique sequence. The function should arrange the numbers by starting with the lowest value, then selecting the highest value from the remaining elements, followed by the next lowest, and continue t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert alternating_minimum_maximum_bst([1, 2, 3, 4]) == [1, 4, 2, 3]\", \"assert alternating_minimum_maximum_bst([5, 5, 5, 5]) == [5, 5, 5, 5]\", \"assert alternating_minimum_maximum_bst([]) == []\", \"assert alternating_minimum_maximum_bst([-2, 1.5, 3.5, -1]) == [...
{ "split": "train", "index": 74043, "acecode_id": "evol_33708", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `generate_sequence(n: int) -> List[int]` that generates a Fibonacci-like sequence where each number is the sum of the previous three numbers. The sequence should start with three zeros. The function should return the first `n` numbers of this sequence. If `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_sequence(1) == [0]\", \"assert generate_sequence(2) == [0, 0]\", \"assert generate_sequence(3) == [0, 0, 0]\", \"assert generate_sequence(4) == [0, 0, 0, 0]\", \"assert generate_sequence(5) == [0, 0, 0, 0, 0]\", \"assert generate_sequence(6) == [0, ...
{ "split": "train", "index": 74044, "acecode_id": "evol_6429", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `sum_of_squares(nums: List[int]) -> int` that returns the sum of the squares of all the positive integers in the list. If there are no positive integers, return 0. \n\nConstraints:\n- The input list `nums` has at most 1000 integers.\n-...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_squares([1, 2, 3, 4]) == 30\", \"assert sum_of_squares([-1, -2, -3, -4]) == 0\", \"assert sum_of_squares([-1, 0, 1, 2]) == 5\", \"assert sum_of_squares([0, 0, 0]) == 0\", \"assert sum_of_squares([5, -5, 10]) == 125\", \"assert sum_of_squares([3, 4, -2...
{ "split": "train", "index": 74045, "acecode_id": "bigcode_python_fns_32363", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of email tokens, implement a function `confirm_email_tokens(tokens: List[str]) -> List[str]` that processes the tokens and returns a list of results indicating the confirmation status of each token. Each token is a string that can either be valid or invalid. A vali...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert confirm_email_tokens(['validToken']) == ['confirmed']\", \"assert confirm_email_tokens(['validToken1', 'validToken2', 'validToken3']) == ['confirmed', 'confirmed', 'confirmed']\", \"assert confirm_email_tokens([]) == []\", \"assert confirm_email_tokens(['tok...
{ "split": "train", "index": 74046, "acecode_id": "bigcode_python_fns_47911", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that returns a list of valid communication channels used in a biological application. The function should be named `get_valid_channels` and it should not take any parameters. The expected output is a list of strings representing the names...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_valid_channels() == ['Hoechst', 'ERSyto', 'ERSytoBleed', 'Ph_golgi', 'Mito']\", \"assert len(get_valid_channels()) == 5\", \"assert 'Hoechst' in get_valid_channels()\", \"assert 'ERSyto' in get_valid_channels()\", \"assert 'ERSytoBleed' in get_valid_chan...
{ "split": "train", "index": 74047, "acecode_id": "bigcode_python_fns_47290", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary that represents a music album which contains a key 'artists' that maps to a list of dictionaries. Each dictionary in the list contains information about an artist, including their 'name'. Write a function that takes this dictionary as input and return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_artist_names({'artists': [{'name': 'Artist A'}, {'name': 'Artist B'}, {'name': 'Artist C'}]}) == 'Artist A, Artist B, Artist C'\", \"assert get_artist_names({'artists': [{'name': 'The Weeknd'}, {'name': 'Dua Lipa'}]}) == 'The Weeknd, Dua Lipa'\", \"asser...
{ "split": "train", "index": 74048, "acecode_id": "bigcode_python_fns_16322", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a function to calculate the Euclidean distance between two points in a 3D space. The function should take two tuples, each representing a point in the format (x, y, z), and return the distance as a float. For example, given the points p1 = (3, 2, 1) and p2 = (5, 4, 6), t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_distance((0, 0, 0), (1, 1, 1)) == 1.7320508075688772\", \"assert calculate_distance((-1, -1, -1), (1, 1, 1)) == 3.4641016151377544\", \"assert calculate_distance((1, 2, 3), (4, 5, 6)) == 5.196152422706632\", \"assert calculate_distance((0, 0, 0), (...
{ "split": "train", "index": 74049, "acecode_id": "evol_20820", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `generate_fibonacci(start: int, end: int) -> List[int]` that generates the Fibonacci sequence numbers that fall within the specified range `[start, end)`. The function should return a list of integers representing the Fibonacci numbers in ascending order. I...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_fibonacci(0, 10) == [0, 1, 1, 2, 3, 5, 8]\", \"assert generate_fibonacci(13, 21) == [13]\", \"assert generate_fibonacci(0, 1) == [0]\", \"assert generate_fibonacci(1, 1) == []\", \"assert generate_fibonacci(2, 3) == [2]\", \"assert generate_fibonacc...
{ "split": "train", "index": 74050, "acecode_id": "evol_26315", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given the lengths of the three sides of a triangular base and the height of a triangular prism, implement a function that calculates the volume of the prism. The function should return -1 if the given sides do not form a valid triangle or if the height is less than or equal to ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert prism_volume(0, 4, 5, 6) == -1\", \"assert prism_volume(3, 3, 3, 0) == -1\", \"assert prism_volume(1, 2, 3, 5) == -1\", \"assert prism_volume(5, 5, 10, 5) == -1\", \"assert prism_volume(2, 2, 2, -1) == -1\", \"assert prism_volume(2, 3, 4, 0) == -1\", \"asser...
{ "split": "train", "index": 74051, "acecode_id": "evol_6786", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that can parse and extract relevant information from a well-formed URL string. The URL string contains various components such as protocol, domain, path, query parameters, and fragment. Your function should be able to parse the URL an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_url('https://www.example.com/path/to/resource?param1=value1&param2=value2#section1') == {'protocol': 'https', 'domain': 'www.example.com', 'path': '/path/to/resource', 'query_params': {'param1': 'value1', 'param2': 'value2'}, 'fragment': 'section1'}\",...
{ "split": "train", "index": 74052, "acecode_id": "oss_14271", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of integers and an integer value as input and returns the index of the first occurrence of the value in the list. If the value is not found, return -1. For example, given the list [3, 1, 4, 1, 5] and the value 1, the function should return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_index([3, 1, 4, 1, 5], 1) == 1\", \"assert find_index([2, 5, 9, 15], 5) == 1\", \"assert find_index([7, 8, 9, 10], 10) == 3\", \"assert find_index([1, 2, 3, 4, 5], 6) == -1\", \"assert find_index([], 1) == -1\", \"assert find_index([1, 2, 2, 3, 4], 2) =...
{ "split": "train", "index": 74053, "acecode_id": "evol_25940", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with converting a list of integers into their corresponding binary representations. Write a function `convert_to_binary(integers: List[int]) -> List[str]` that takes a list of integers and returns a list of their binary string representations. Each integer should...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_binary([1, 2, 3]) == ['1', '10', '11']\", \"assert convert_to_binary([-1, -2, -3]) == ['-1', '-10', '-11']\", \"assert convert_to_binary([0]) == ['0']\", \"assert convert_to_binary([4, 5, 6]) == ['100', '101', '110']\", \"assert convert_to_binary(...
{ "split": "train", "index": 74054, "acecode_id": "bigcode_python_fns_42529", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that formats a notification message for a messaging application. The function should take two string inputs: a title and a URL. The output should be a string that combines the title and the URL in a Markdown format as follows: '[Title](UR...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_notification_message('Hello World', 'https://example.com') == '[Hello World](https://example.com)'\", \"assert format_notification_message('Python Tips', 'http://python.org') == '[Python Tips](http://python.org)'\", \"assert format_notification_messag...
{ "split": "train", "index": 74055, "acecode_id": "bigcode_python_fns_37611", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a class `Point` that represents a point in a 2D space with coordinates (x, y), and a class `ColoredPoint` that extends `Point` to include a color attribute, implement the `ColoredPoint` class correctly. The `ColoredPoint` constructor should take three parameters: `x`, `y`...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert ColoredPoint(1, 2, 'red').x == 1\", \"assert ColoredPoint(1, 2, 'red').y == 2\", \"assert ColoredPoint(1, 2, 'red').color == 'red'\", \"assert ColoredPoint(-3, 5, 'blue').x == -3\", \"assert ColoredPoint(-3, 5, 'blue').y == 5\", \"assert ColoredPoint(-3, 5, ...
{ "split": "train", "index": 74056, "acecode_id": "evol_5857", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Your task is to convert this list into a set, which inherently removes any duplicate values. Implement a function that takes a list of integers as input and returns a set containing all the unique integers from that list. The returned set shoul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_set([1, 2, 2, 3, 4]) == {1, 2, 3, 4}\", \"assert convert_to_set([1, 1, 1, 1]) == {1}\", \"assert convert_to_set([]) == set()\", \"assert convert_to_set([5, 3, 5, 3, 5]) == {3, 5}\", \"assert convert_to_set([0, -1, -1, -2, 0]) == {0, -1, -2}\", \"a...
{ "split": "train", "index": 74057, "acecode_id": "oss_16484", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that verifies if all required keys are present in a given dictionary. The function should also attempt to convert a specific key, 'start_date', from a string to a date object. If any of the required keys are missing, the function should r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_keys_and_parse_date({'start_date': '2023-10-01', 'other_key': 'value'}, ['start_date', 'other_key']) == {'start_date': datetime.date(2023, 10, 1), 'other_key': 'value'}\", \"assert check_keys_and_parse_date({'start_date': '2023-10-01'}, ['start_date'])...
{ "split": "train", "index": 74058, "acecode_id": "bigcode_python_fns_44458", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Write a function `square_list(num: int) -> List[int]` that takes an integer `num` as input and returns a list containing the squares of all integers from 0 to `num`, inclusive. For example, if `num` is 5, the output should be [0, 1, 4, 9, 16, 25].\nPlease reason step by step, t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert square_list(0) == [0]\", \"assert square_list(1) == [0, 1]\", \"assert square_list(2) == [0, 1, 4]\", \"assert square_list(3) == [0, 1, 4, 9]\", \"assert square_list(4) == [0, 1, 4, 9, 16]\", \"assert square_list(5) == [0, 1, 4, 9, 16, 25]\", \"assert square...
{ "split": "train", "index": 74059, "acecode_id": "evol_25394", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a sentence as input, reverse the sequence of words in the sentence and return the modified sentence as output. For example, if the input is 'Hello World', the output should be 'World Hello'.\nPlease reason step by step, then write a self-contained Python solution. Give yo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_words('Hello World') == 'World Hello'\", \"assert reverse_words('Python is awesome') == 'awesome is Python'\", \"assert reverse_words('The quick brown fox') == 'fox brown quick The'\", \"assert reverse_words('LeetCode problems are fun') == 'fun are p...
{ "split": "train", "index": 74060, "acecode_id": "evol_10425", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with extracting relevant information about a restaurant from a given dictionary. The dictionary contains keys 'id', 'name', 'state', and 'order_online_url'. Your goal is to write a function `extract_restaurant_info(data)` that takes this dictionary as input and r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_restaurant_info({'id': '001', 'name': 'Pizza Place', 'state': 'NY', 'order_online_url': 'www.pizzaplace.com'}) == ('Pizza Place', '001', 'NY', 'www.pizzaplace.com')\", \"assert extract_restaurant_info({'id': '002', 'name': 'Burger Joint', 'state': 'C...
{ "split": "train", "index": 74061, "acecode_id": "oss_8542", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two arrays of equal length, `c` and `s`, where each element satisfies the condition c[i]^2 + s[i]^2 = 1 for all valid indices i, write a function `rotation_matrix(c: List[float], s: List[float]) -> List[List[float]]` that constructs a 3x3 rotation matrix around the X-axis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rotation_matrix([1], [0]) == [[1, 0, 0], [0, 1, 0], [0, 0, 1]]\", \"assert rotation_matrix([0, 1], [1, 0]) == [[1, 0, 0], [0, 0, -1], [0, 1, 0]]\", \"assert rotation_matrix([0.707, 0.866], [0.707, 0.5]) == [[1, 0, 0], [0, 0.707, -0.707], [0, 0.707, 0.707]]\"...
{ "split": "train", "index": 74062, "acecode_id": "bigcode_python_fns_29409", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of buildings. Your task is to implement a function that returns the number of buildings that can be seen from the left side. A building can be seen from the left if it is taller than all the buildings to its left. Write ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_visible_buildings([1, 2, 3, 4, 5]) == 5\", \"assert count_visible_buildings([5, 4, 3, 2, 1]) == 1\", \"assert count_visible_buildings([0]) == 1\", \"assert count_visible_buildings([1, 1, 1, 1]) == 1\", \"assert count_visible_buildings([3, 3, 3, 5, 5, 4...
{ "split": "train", "index": 74063, "acecode_id": "bigcode_python_fns_45826", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Write a function `lowest_common_multiple(x: int, y: int) -> int` that takes two integers x and y as input and returns their Least Common Multiple (LCM). The LCM is the smallest positive integer that is divisible by both x and y. You can assume that the input integers will be no...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert lowest_common_multiple(0, 0) == 0\", \"assert lowest_common_multiple(0, 5) == 0\", \"assert lowest_common_multiple(5, 0) == 0\", \"assert lowest_common_multiple(1, 1) == 1\", \"assert lowest_common_multiple(1, 5) == 5\", \"assert lowest_common_multiple(5, 1)...
{ "split": "train", "index": 74064, "acecode_id": "evol_9234", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves the profile of a category based on its unique identifier (primary key). The function should take an integer `pk` as input, which represents the primary key of the category. If the category with the given primary key exists,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_category_profile(1) == {'id': 1, 'name': 'Books', 'description': 'A collection of written works.'}\", \"assert get_category_profile(2) == {'id': 2, 'name': 'Electronics', 'description': 'Devices and gadgets.'}\", \"assert get_category_profile(11) == None...
{ "split": "train", "index": 74065, "acecode_id": "bigcode_python_fns_27512", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a list of XML-like dictionaries, each representing a node with various attributes. Write a function `extract_attribute(nodes: List[Dict[str, str]], start_node: str, search_node: str) -> List[str]` that extracts the value of a specific attribute from all nodes of a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_attribute([{'header': {'name': 'Alice', 'age': '30'}}, {'header': {'name': 'Bob', 'age': '25'}}, {'footer': {'name': 'Charlie', 'age': '35'}}], 'header', 'name') == ['Alice', 'Bob']\", \"assert extract_attribute([{'header': {'name': 'Alice'}}, {'head...
{ "split": "train", "index": 74066, "acecode_id": "bigcode_python_fns_42081", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the behavior of a JSON formatting feature in a text editor. Write a function `handle_json_formatting` that takes the following parameters: \n- `return_code` (an integer): The return code of the child process. A non-zero...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert handle_json_formatting(0, MockStatus(), MockArea(), 'formatted json', 0, 5) == None\", \"assert handle_json_formatting(1, MockStatus(), MockArea(), 'formatted json', 0, 5) == None\", \"assert handle_json_formatting(2, MockStatus(), MockArea(), 'formatted jso...
{ "split": "train", "index": 74067, "acecode_id": "oss_7958", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing the name of an entry, and an optional string representing a database filepath. Implement a function `copy_entry(entry: str, database_filepath: Optional[str] = None) -> str` that returns a message indicating the success of copying the entry. I...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert copy_entry('test_entry', 'custom_database.db') == 'Entry test_entry copied to custom_database.db'\", \"assert copy_entry('sample_entry') == 'Entry sample_entry copied to default_database.db'\", \"assert copy_entry('') == 'Entry name cannot be empty'\", \"ass...
{ "split": "train", "index": 74068, "acecode_id": "bigcode_python_fns_47450", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Your task is to implement a function that takes this list and returns a new list where each integer is multiplied by 2. The function should handle both positive and negative integers. If the input list is empty, return an empty list. Write a fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert double_values([1, 2, 3]) == [2, 4, 6]\", \"assert double_values([-1, -2, -3]) == [-2, -4, -6]\", \"assert double_values([0, 0, 0]) == [0, 0, 0]\", \"assert double_values([]) == []\", \"assert double_values([10]) == [20]\", \"assert double_values([-10]) == [-...
{ "split": "train", "index": 74069, "acecode_id": "bigcode_python_fns_37902", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that converts a string representing a timestamp in 24-hour military time format (HHMM) into its equivalent in 12-hour civilian time format (hh:mm AM/PM). The input string will always be valid and in the format of four digits. Implement the function `convert_tim...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_time_to_12_hour('0000') == '12:00 AM'\", \"assert convert_time_to_12_hour('0030') == '12:30 AM'\", \"assert convert_time_to_12_hour('0100') == '1:00 AM'\", \"assert convert_time_to_12_hour('1200') == '12:00 PM'\", \"assert convert_time_to_12_hour('12...
{ "split": "train", "index": 74070, "acecode_id": "evol_34700", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that converts a hexadecimal number to binary, reverses that binary representation, and then converts it back to a hexadecimal number. The function should take a single string argument representing the hexadecimal number and return a string representing the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert hex_convert('0') == '0'\", \"assert hex_convert('1') == '1'\", \"assert hex_convert('3') == '3'\", \"assert hex_convert('5') == '5'\", \"assert hex_convert('7') == '7'\", \"assert hex_convert('9') == '9'\", \"assert hex_convert('10') == '1'\"]}" }
{ "split": "train", "index": 74071, "acecode_id": "evol_34495", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that generates proxy configurations for HTTP and HTTPS connections. The function should take in four parameters: `proxyHost` (string), `proxyPort` (integer), `proxyUser` (string), and `proxyPass` (string). The function should then ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_proxy_config('proxy.example.com', 8080, 'user123', 'password456') == {'http': 'http://user123:password456@proxy.example.com:8080', 'https': 'http://user123:password456@proxy.example.com:8080'}\", \"assert generate_proxy_config('localhost', 8000, 'ad...
{ "split": "train", "index": 74072, "acecode_id": "oss_30619", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers, and your task is to implement a function that returns a new list containing only the even numbers from the original list. If there are no even numbers, return an empty list. The function should maintain the order of the original list. Write a f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 13, 15, 22, 30]) == [10, 22, 30]\", \"assert filter_even_numbers([1, 3, 5]) == []\", \"assert filter_even_numbers([]) == []\", \"assert filter_even_numbers([0, 1, 2, 3]) == [...
{ "split": "train", "index": 74073, "acecode_id": "bigcode_python_fns_25345", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of positive integers, implement a function that identifies all unique integers whose frequency in the list is greater than half of the integer's value. The function should return these integers sorted in descending order of their frequencies. If two integers have t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert uncommon_elements([5, 5, 4, 4, 4]) == [4]\", \"assert uncommon_elements([1, 1, 1, 1, 1, 1, 2]) == [1]\", \"assert uncommon_elements([4, 4, 2, 2, 2]) == [2]\", \"assert uncommon_elements([1, 1, 1, 1]) == [1]\", \"assert uncommon_elements([2, 2, 3, 3, 3, 4, 4]...
{ "split": "train", "index": 74074, "acecode_id": "evol_30867", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a list of line segments in a 2D space. Each line segment is represented as a list of tuples, where each tuple contains the coordinates of the start and end points of the line segment. Write a function `total_length_of_line_segments(line_segments)` that calculates ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert total_length_of_line_segments([[(0, 0), (0, 0)]]) == 0.0\", \"assert total_length_of_line_segments([[(1, 1), (1, 4)], [(1, 4), (4, 4)]]) == 6.0\", \"assert total_length_of_line_segments([[(2, 2), (5, 2)], [(5, 2), (5, 5)]] ) == 6.0\", \"assert total_length_o...
{ "split": "train", "index": 74075, "acecode_id": "oss_18708", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Write a function that accepts a single string input and returns a boolean value indicating if the given string is a pangram or not. A pangram is defined as a sentence that uses every letter of the English alphabet at least once, and the check should be case-insensitive. For exa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_pangram('The quick brown fox jumps over the lazy dog') == True\", \"assert is_pangram('Hello World') == False\", \"assert is_pangram('Pack my box with five dozen liquor jugs') == True\", \"assert is_pangram('Sphinx of black quartz, judge my vow') == True\...
{ "split": "train", "index": 74076, "acecode_id": "evol_4686", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a string and a list of integers. The function should take two parameters: a string 'input_string' and a list of integers 'input_data'. Your goal is to implement a function named 'process_data' that performs the following op...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_data('hello world', [1, 2, 3]) == ('HELLO WORLD', 6)\", \"assert process_data('python', [10, 20, 30]) == ('PYTHON', 60)\", \"assert process_data('leet', [0, 0, 0]) == ('LEET', 0)\", \"assert process_data('code', [-1, -2, -3]) == ('CODE', -6)\", \"ass...
{ "split": "train", "index": 74077, "acecode_id": "oss_27419", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of 2-letter ISO country codes and returns a list of corresponding 3-letter ISO country codes. If an invalid ISO2 code is provided, the function should raise a ValueError with a message indicating the invalid code. Write ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_iso2_to_iso3(['US', 'CA', 'GB']) == ['USA', 'CAN', 'GBR']\", \"assert convert_iso2_to_iso3(['FR', 'DE', 'IT']) == ['FRA', 'DEU', 'ITA']\", \"assert convert_iso2_to_iso3(['JP', 'KR', 'CN']) == ['JPN', 'KOR', 'CHN']\", \"assert convert_iso2_to_iso3(['A...
{ "split": "train", "index": 74078, "acecode_id": "bigcode_python_fns_18365", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the importation of Python modules from a specified directory. The function should take a list of module filenames (as strings) and return a list of the names of those modules that can be imported. A module can be imported i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert import_modules(['module1.py', 'module2.py', '_hidden.py', 'not_a_module.txt']) == ['module1', 'module2']\", \"assert import_modules(['_temp.py', 'module3.py', 'module4.py']) == ['module3', 'module4']\", \"assert import_modules(['_private.py', '_private_modul...
{ "split": "train", "index": 74079, "acecode_id": "bigcode_python_fns_17831", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with processing a 3D matrix representing grayscale pixel values of a medical image. Your goal is to implement a function that takes this 3D matrix as input, performs normalization to scale the pixel values between 0 and 1, and returns the normalized 3D matrix. Th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert normalize_mri_data([[[0, 0], [0, 255]], [[0, 255], [255, 255]]]) == [[[0.0, 0.0], [0.0, 1.0]], [[0.0, 1.0], [1.0, 1.0]]]\", \"assert normalize_mri_data([[[1, 2], [3, 4]], [[4, 3], [2, 1]]]) == [[[0.0, 0.3333333333333333], [0.6666666666666666, 1.0]], [[1.0, 0...
{ "split": "train", "index": 74080, "acecode_id": "oss_20506", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a dictionary where the keys are strings and the values are integers. Your task is to implement a function that takes this dictionary and an integer as parameters and removes all key-value pairs from the dictionary where the value equals the specified integer. The ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert removeKeys({'a': 1, 'b': 2, 'c': 3}, 2) == {'a': 1, 'c': 3}\", \"assert removeKeys({'x': 5, 'y': 5, 'z': 10}, 5) == {'z': 10}\", \"assert removeKeys({'apple': 1, 'banana': 2, 'cherry': 2}, 2) == {'apple': 1}\", \"assert removeKeys({}, 1) == {}\", \"assert re...
{ "split": "train", "index": 74081, "acecode_id": "bigcode_python_fns_11639", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a custom residual block for a simplified neural network. The residual block consists of two operations: applying a transformation and adding a residual (original input). Your function should take an input tensor (a list of integers), apply a tra...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert custom_residual_block([1, 2, 3]) == [3, 6, 9]\", \"assert custom_residual_block([0, 0, 0]) == [0, 0, 0]\", \"assert custom_residual_block([-1, -2, -3]) == [-3, -6, -9]\", \"assert custom_residual_block([]) == []\", \"assert custom_residual_block([2, 4, 6, 8]...
{ "split": "train", "index": 74082, "acecode_id": "oss_20984", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a list of lists where each inner list contains tuples representing gradients and their corresponding variables. Each tuple consists of a float gradient value and a variable identifier (a string). Your task is to calculate the average gradient for each unique varia...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_gradients([[(-1.0, 'a'), (2.0, 'b')], [(1.0, 'a'), (3.0, 'b')]]) == [(0.0, 'a'), (2.5, 'b')]\", \"assert average_gradients([[(-1.0, 'x')], [(2.0, 'x'), (3.0, 'y')]]) == [(0.5, 'x'), (3.0, 'y')]\", \"assert average_gradients([[(-2.5, 'a'), (0.0, 'b')]...
{ "split": "train", "index": 74083, "acecode_id": "bigcode_python_fns_41802", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function that takes two binary strings as input and determines if the first binary string can be transformed into the second binary string by flipping exactly one bit. The strings are guaranteed to be of the same length.\nPlease reason step by step, then write a sel...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_transform('1100', '1101') == True\", \"assert can_transform('1010', '1000') == True\", \"assert can_transform('0000', '0001') == True\", \"assert can_transform('1111', '1110') == True\", \"assert can_transform('1111', '0000') == False\", \"assert can_tra...
{ "split": "train", "index": 74084, "acecode_id": "evol_10152", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a variable number of keyword arguments representing file metadata and returns a dictionary containing this metadata. The function should be named `get_file_metadata`. Your implementation should ensure that the function acce...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_file_metadata(title='Document', author='Alice', size=1024) == {'title': 'Document', 'author': 'Alice', 'size': 1024}\", \"assert get_file_metadata(name='file.txt', type='text', size=2048) == {'name': 'file.txt', 'type': 'text', 'size': 2048}\", \"assert ...
{ "split": "train", "index": 74085, "acecode_id": "oss_19427", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `advanced_histogram(test_string)` that takes a string input consisting of a mix of uppercase and lowercase letters, digits, and special characters. The function should treat uppercase and lowercase letters as the same and return a dictionary containing the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert advanced_histogram('Hello, World!') == {'l': 3}\", \"assert advanced_histogram('abcdABCD') == {'a': 2, 'b': 2, 'c': 2, 'd': 2}\", \"assert advanced_histogram('aabbccddeeff') == {'a': 2, 'b': 2, 'c': 2, 'd': 2, 'e': 2, 'f': 2}\", \"assert advanced_histogram('...
{ "split": "train", "index": 74086, "acecode_id": "evol_17890", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given an integer n, write a function `digitSum` that calculates and returns the sum of its digits. You need to implement the function such that it correctly handles both positive and negative integers. For example, if the input integer n is 123, the function should return 6 (as...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert digitSum(123) == 6\", \"assert digitSum(-456) == 15\", \"assert digitSum(0) == 0\", \"assert digitSum(9) == 9\", \"assert digitSum(1001) == 2\", \"assert digitSum(-1001) == 2\", \"assert digitSum(987654321) == 45\", \"assert digitSum(-987654321) == 45\", \"a...
{ "split": "train", "index": 74087, "acecode_id": "oss_4338", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Develop a function that accepts a string containing various types of parentheses (including '()', '{}', and '[]') and determines if the sequence of parentheses is valid. A valid sequence means that every opening parenthesis has a corresponding and correctly ordered closing pare...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_parentheses('()') == True\", \"assert is_valid_parentheses('()[]{}') == True\", \"assert is_valid_parentheses('(]') == False\", \"assert is_valid_parentheses('([{}])') == True\", \"assert is_valid_parentheses('{[()]}') == True\", \"assert is_valid_p...
{ "split": "train", "index": 74088, "acecode_id": "evol_13567", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two lists of integers, write a function that adds all elements from the first list to the second list if they are divisible by 3. The function should return the second list sorted in ascending order after the additions.\nPlease reason step by step, then write a self-conta...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_elements([1, 2, 4, 5], [3, 6]) == [3, 6]\", \"assert add_elements([0, 3, 6, 9], [10, 11]) == [0, 3, 6, 9, 10, 11]\", \"assert add_elements([7, 8, 10], [1, 2]) == [1, 2]\", \"assert add_elements([15, 30, 45], [5, 6, 7]) == [5, 6, 7, 15, 30, 45]\", \"asser...
{ "split": "train", "index": 74089, "acecode_id": "evol_35833", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing a collection of people represented by their first and last names. Your goal is to implement a function that takes a list of dictionaries, each representing a person with 'first_name' and 'last_name' keys, and returns a list of all people in the coll...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_people([]) == []\", \"assert sort_people([{'first_name': 'Alice', 'last_name': 'Adams'}, {'first_name': 'Charlie', 'last_name': 'Clark'}, {'first_name': 'Bob', 'last_name': 'Adams'}]) == [{'first_name': 'Alice', 'last_name': 'Adams'}, {'first_name': 'Bo...
{ "split": "train", "index": 74090, "acecode_id": "oss_4264", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a list of tuples where each tuple contains an index and a key, representing header cards in a file. Your task is to identify the orphan keys that are present in the header of a given list of header dictionaries. An orphan key is defined as a key that exists in a h...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_orphans([{ 'A': 1, 'B': 2 }, { 'C': 3, 'D': 4 }], [(0, 'A'), (1, 'D')]) == [(0, 'B'), (1, 'C')]\", \"assert find_orphans([{ 'X': 1, 'Y': 2 }, { 'Z': 3 }], [(0, 'X')]) == [(0, 'Y'), (1, 'Z')]\", \"assert find_orphans([{ 'A': 1 }, { 'B': 2, 'C': 3 }], [(0...
{ "split": "train", "index": 74091, "acecode_id": "bigcode_python_fns_38310", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function to extract specific information from a given Python dictionary. The dictionary will contain various key-value pairs, and you need to extract the values associated with the keys 'author_email', 'url', and 'install_requires'. Your fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_info({'author_email': 'test@example.com', 'url': 'https://example.com', 'install_requires': ['requests']}) == ('test@example.com', 'https://example.com', ['requests'])\", \"assert extract_info({'url': 'https://example.org', 'install_requires': ['nump...
{ "split": "train", "index": 74092, "acecode_id": "oss_9524", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `get_process_rank()` that simulates the behavior of retrieving the rank of the current process in a distributed computing environment. The rank is defined as a non-negative integer that uniquely identifies a process among other processes....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_process_rank(1) == 0\", \"assert get_process_rank(5) == 0\", \"assert get_process_rank(3) == 0\", \"assert get_process_rank(10) == 0\", \"assert get_process_rank(0) == -1\", \"assert get_process_rank(-5) == -1\", \"assert get_process_rank(2) == 0\", \"as...
{ "split": "train", "index": 74093, "acecode_id": "bigcode_python_fns_48121", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with developing a function that calculates the total time taken to process a series of web requests. Each request is represented by a dictionary that contains the request URL and a processing time in milliseconds. Your function should take a list of these request...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert total_processing_time([{'url': '/api/v1/resource', 'processing_time': 150}, {'url': '/api/v1/resource/1', 'processing_time': 200}]) == 350\", \"assert total_processing_time([{'url': '/home', 'processing_time': 50}]) == 50\", \"assert total_processing_time([{...
{ "split": "train", "index": 74094, "acecode_id": "oss_16918", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function that takes two sequences of integers and returns the longest increasing subsequence that is common to both sequences. The function should return the longest increasing subsequence as a list of integers.\nPlease reason step by step, then write a self-cont...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longest_common_increasing_subsequence([1, 3, 5, 7], [1, 2, 3, 4]) == [1, 3]\", \"assert longest_common_increasing_subsequence([1, 2, 3], [4, 5, 6]) == []\", \"assert longest_common_increasing_subsequence([], [1, 2, 3]) == []\", \"assert longest_common_increa...
{ "split": "train", "index": 74095, "acecode_id": "evol_5634", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a list of integers 'nums', your task is to implement a function that returns the maximum product of any two distinct elements from the list. If the list contains less than two elements, return -1. The function signature is as follows: `def max_product(nums: List[int]) -> ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_product([1, 2, 3, 4]) == 12\", \"assert max_product([-1, -2, -3, -4]) == 12\", \"assert max_product([1, -2, 3, -4]) == 8\", \"assert max_product([5]) == -1\", \"assert max_product([]) == -1\", \"assert max_product([-1, 0, 1]) == 0\", \"assert max_product...
{ "split": "train", "index": 74096, "acecode_id": "bigcode_python_fns_8909", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of bars in a histogram. Write a function that calculates the area of the largest rectangle that can be formed within the histogram. The function should return the maximum area of the rectangle. The input list will always...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_histogram_area([2, 1, 5, 6, 2, 3]) == 10\", \"assert max_histogram_area([1]) == 1\", \"assert max_histogram_area([1, 2]) == 2\", \"assert max_histogram_area([2, 1, 2]) == 3\", \"assert max_histogram_area([4, 2, 0, 3, 2, 5]) == 6\", \"assert max_histogram...
{ "split": "train", "index": 74097, "acecode_id": "bigcode_python_fns_49881", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a string that represents a unique identifier (ID). The ID must adhere to the following constraints: It must be no longer than 62 characters and can only contain alphanumeric characters (letters and digits) and underscores. Write a function that checks whether the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_id('valid_id_123') == True\", \"assert is_valid_id('this_is_a_valid_id') == True\", \"assert is_valid_id('id_with_underscores_and_numbers_12345') == True\", \"assert is_valid_id('a' * 62) == True\", \"assert is_valid_id('') == False\", \"assert is_v...
{ "split": "train", "index": 74098, "acecode_id": "bigcode_python_fns_42928", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with retrieving the clearance level of a user from a database. The database contains a table named 'user' with columns 'username' and 'clearance'. Write a function named `get_clearance` that takes a username as input and returns the clearance level as an integer....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_clearance('CC-2225') == 5\", \"assert get_clearance('user1') == 3\", \"assert get_clearance('unknown_user') == None\", \"assert get_clearance('user6') == None\", \"assert get_clearance('user12') == None\", \"assert get_clearance('CC-2225') == 5\", \"asse...
{ "split": "train", "index": 74099, "acecode_id": "evol_9927", "num_tests": 7 }