data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that takes a list of integers and returns a new list containing only the unique elements from the original list, preserving the order of their first occurrence. Implement a function called `unique_elements` that accepts a list of i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_elements([1, 2, 2, 3, 4, 1]) == [1, 2, 3, 4]\", \"assert unique_elements([1, 1, 1, 1]) == [1]\", \"assert unique_elements([]) == []\", \"assert unique_elements([5, 4, 3, 4, 5]) == [5, 4, 3]\", \"assert unique_elements([10, 20, 20, 30, 10]) == [10, 20,... | {
"split": "train",
"index": 78800,
"acecode_id": "oss_637",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that reshapes a given multi-dimensional list (tensor) into a 1D list (array). The input will be a list of lists, where each inner list can have varying lengths. Your function should process this input and return a single flat list con... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert flatten_list([[1, 2], [3, 4], [5]]) == [1, 2, 3, 4, 5]\", \"assert flatten_list([[1], [2], [3]]) == [1, 2, 3]\", \"assert flatten_list([[], [1, 2, 3]]) == [1, 2, 3]\", \"assert flatten_list([[0, 1], [2], [3, 4, 5]]) == [0, 1, 2, 3, 4, 5]\", \"assert flatten_... | {
"split": "train",
"index": 78801,
"acecode_id": "oss_14140",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a function signature formatted as a string and a type of reference (either 'api' or 'suite'). Your task is to extract the function name and its parameters from the input string, then return a dictionary that maps the parameters to their respective values based on ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_function_signature('api_v1_Account_Login_POST($UserName)', 'api') == 'call args mismatch defined args!'\", \"assert parse_function_signature('api_v1_Account_Login_POST($UserName, $Password, $Email)', 'api') == 'call args mismatch defined args!'\", \"as... | {
"split": "train",
"index": 78802,
"acecode_id": "bigcode_python_fns_12206",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Write a function that takes this list and returns a new list containing only the unique integers from the original list, in the order they first appeared. For example, if the input list contains duplicates, the output list should contain each i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_integers([1, 2, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert unique_integers([5, 5, 5]) == [5]\", \"assert unique_integers([]) == []\", \"assert unique_integers([1, 2, 3, 1, 2, 3]) == [1, 2, 3]\", \"assert unique_integers([10, 20, 10, 30]) == [10, 20, 30]\",... | {
"split": "train",
"index": 78803,
"acecode_id": "bigcode_python_fns_12123",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that calculates the recall, precision, and test scores based on a provided dataset and results array. The dataset is represented as a list of dictionaries where each dictionary contains 'label' (0 or 1) and 'prediction' (0 or 1). T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_metrics([{'label': 1, 'prediction': 1}, {'label': 1, 'prediction': 1}, {'label': 0, 'prediction': 0}], [1, 2]) == {'recall': 1.0, 'precision': 1.0, 'test_score': 3}\", \"assert calculate_metrics([{'label': 0, 'prediction': 0}, {'label': 0, 'predict... | {
"split": "train",
"index": 78804,
"acecode_id": "oss_33420",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of intervals representing intron start and end positions along with their corresponding chromosome and strand information. Your task is to identify introns that do not overlap with any specified excluded regions and return a list of these retained intron in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_retained_introns([('chr1', 100, 200, '+'), ('chr1', 300, 400, '+')], [('chr1', 100, 200), ('chr1', 300, 400)]) == []\", \"assert extract_retained_introns([('chr1', 100, 200, '+'), ('chr2', 150, 250, '+')], []) == [('chr1', 100, 200, '+'), ('chr2', 15... | {
"split": "train",
"index": 78805,
"acecode_id": "bigcode_python_fns_37393",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `get_contact_view_id(views: List[Dict[str, str]]) -> Union[int, None]` that retrieves the ID of the first contact view whose name matches the pattern 'all' (case-insensitive) from a list of views. Each view is represented as a diction... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_contact_view_id([{'name': 'Recent Contacts', 'id': 3}, {'name': 'all', 'id': 4}]) == 4\", \"assert get_contact_view_id([{'name': 'All', 'id': 5}, {'name': 'Work', 'id': 6}]) == 5\", \"assert get_contact_view_id([{'name': 'Friends', 'id': 7}, {'name': 'Fa... | {
"split": "train",
"index": 78806,
"acecode_id": "oss_10971",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that authenticates a user based on their username and password. The function `authenticate_user` should take in two parameters: `username` (a string) and `password` (also a string). The function should adhere to the following crite... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert authenticate_user('user1', 'password1') == {'username': 'user1', 'password': 'password1'}\", \"assert authenticate_user('user2', 'wrongpassword') == 'Incorrect password'\", \"assert authenticate_user('user3', 'password3') == {'username': 'user3', 'password':... | {
"split": "train",
"index": 78807,
"acecode_id": "oss_32627",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that counts the number of valid visas for a person based on a list of visa dictionaries. Each visa dictionary contains the visa type and its expiration date. A valid visa is defined as one that has not expired based on a given date... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_valid_visas([{'type': 'work', 'expiration_date': '2023-12-31'}, {'type': 'tourist', 'expiration_date': '2022-06-15'}, {'type': 'student', 'expiration_date': '2024-08-20'}, {'type': 'business', 'expiration_date': '2021-04-30'}], '2023-05-01') == 2\", \"... | {
"split": "train",
"index": 78808,
"acecode_id": "oss_22976",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes a string as input and reverses each individual word in the string without using any Python built-in reverse functions or slicing. The function should handle punctuation and whitespace efficiently. For example, if the input is 'Hello, World', t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_words_in_string('Python is fun!') == 'nohtyP si !nuf'\", \"assert reverse_words_in_string('Keep it simple.') == 'peeK ti .elpmis'\", \"assert reverse_words_in_string('Hello World!') == 'olleH !dlroW'\", \"assert reverse_words_in_string('A quick brown... | {
"split": "train",
"index": 78809,
"acecode_id": "evol_18317",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given the lengths of two sides of a parallelogram and the angle between them, write a function `calculate_area(a: float, b: float, C: float) -> float` that calculates the area of the parallelogram. The function should validate the inputs such that the lengths of the sides must ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_area(8, 12, 90) == 96.0\", \"assert calculate_area(0, 10, 30) == 'Invalid input. Sides and angle must be positive. Angle must be less than 180.'\", \"assert calculate_area(10, 0, 30) == 'Invalid input. Sides and angle must be positive. Angle must b... | {
"split": "train",
"index": 78810,
"acecode_id": "evol_21030",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a file path based on a specified database path, directory, and leaf hash. The file path should have the format of '<db_path>/<directory>/<leaf_hash>.csv'. Write a function `create_data_path(db_path: str, directory: str, lea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_data_path('/data', '2023', 'abc123') == '/data/2023/abc123.csv'\", \"assert create_data_path('/home/user', 'documents', 'file1') == '/home/user/documents/file1.csv'\", \"assert create_data_path('/var/tmp', 'uploads', 'file_xyz') == '/var/tmp/uploads/f... | {
"split": "train",
"index": 78811,
"acecode_id": "oss_4256",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a collection ID and an optional integer representing a version, write a function that returns a formatted string as a memcache key for the collection. If a version is provided, the key should be formatted as 'collection-version:<collection_id>:<versi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_collection_memcache_key('abc123') == 'collection:abc123'\", \"assert get_collection_memcache_key('xyz456', 1) == 'collection-version:xyz456:1'\", \"assert get_collection_memcache_key('test_collection') == 'collection:test_collection'\", \"assert get_coll... | {
"split": "train",
"index": 78812,
"acecode_id": "bigcode_python_fns_7684",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of bins representing different categories of items. Your task is to create a function that returns a string indicating the type of scheme used for categorizing these items based on the number of bins provided. If the number of bins is 0, return 'No items'. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert categorize_items([]) == 'No items'\", \"assert categorize_items([1]) == 'Few items'\", \"assert categorize_items([1, 2]) == 'Few items'\", \"assert categorize_items([1, 2, 3]) == 'Few items'\", \"assert categorize_items([1, 2, 3, 4]) == 'Moderate items'\", \... | {
"split": "train",
"index": 78813,
"acecode_id": "bigcode_python_fns_5692",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of stock prices and returns the maximum price, minimum price, and the average price of the stocks. The input list will contain floating point numbers representing the stock prices. Implement the function `calculate_price... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_price_statistics([100.0, 200.0, 150.0]) == (200.0, 100.0, 150.0)\", \"assert calculate_price_statistics([1.5]) == (1.5, 1.5, 1.5)\", \"assert calculate_price_statistics([3.14, 2.71, 1.41]) == (3.14, 1.41, 2.42)\", \"assert calculate_price_statistic... | {
"split": "train",
"index": 78814,
"acecode_id": "bigcode_python_fns_2498",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Write a function `is_valid_name(word: str) -> bool` that checks if a given string `word` is a valid name. A valid name can only contain ASCII letters (a-z, A-Z), digits (0-9), hyphens (-), and underscores (_). The function should return True if the name is valid and False other... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_name('valid_name') == True\", \"assert is_valid_name('valid-name') == True\", \"assert is_valid_name('validName123') == True\", \"assert is_valid_name('123valid') == True\", \"assert is_valid_name('valid_name-123') == True\", \"assert is_valid_name(... | {
"split": "train",
"index": 78815,
"acecode_id": "bigcode_python_fns_4819",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that initializes a list of binary sensors based on a given list of sensor types. Each binary sensor should be represented as a dictionary with two keys: 'type' which indicates the type of the sensor, and 'active' which is a boolean indica... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_sensors(['motion', 'door', 'window']) == [{'type': 'motion', 'active': False}, {'type': 'door', 'active': False}, {'type': 'window', 'active': False}]\", \"assert initialize_sensors(['temperature', 'humidity']) == [{'type': 'temperature', 'active'... | {
"split": "train",
"index": 78816,
"acecode_id": "bigcode_python_fns_24325",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, implement a function that groups the strings based on their lengths. The function should return a dictionary where the keys are the lengths of the strings and the values are lists of strings that have that length. The order of the strings in the output ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert group_strings(['cat', 'dog', 'elephant', 'rat']) == {3: ['cat', 'dog', 'rat'], 8: ['elephant']}\", \"assert group_strings(['a', 'b', 'c', 'd']) == {1: ['a', 'b', 'c', 'd']}\", \"assert group_strings(['longest', 'short', 'tiny', 'big']) == {7: ['longest'], 5:... | {
"split": "train",
"index": 78817,
"acecode_id": "evol_27623",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given two arrays `rowSum` and `colSum` of non-negative integers where `rowSum[i]` is the sum of the elements in the `i`th row and `colSum[j]` is the sum of the elements of the `j`th column of a 2D matrix, find any matrix of size `rowSum.length x colSum.length` that satisfies th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert findMatrix([3, 8], [4, 7]) == [[3, 0], [1, 7]]\", \"assert findMatrix([1, 0], [1]) == [[1], [0]]\", \"assert findMatrix([0], [0]) == [[0]]\", \"assert findMatrix([10], [10]) == [[10]]\", \"assert findMatrix([0, 0], [0, 0]) == [[0, 0], [0, 0]]\", \"assert fin... | {
"split": "train",
"index": 78818,
"acecode_id": "evol_34070",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with designing a function that alters a representation of a database column in Python. Specifically, you need to implement a function named `alter_column` that takes the following parameters: a table name (a string), a column name (a string), the existing data ty... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert alter_column('Platforms', 'identifier', 'VARCHAR(length=30)', 'String(length=50)', False, False) == {'table': 'Platforms', 'column': 'identifier', 'type': 'String(length=50)', 'nullable': False}\", \"assert alter_column('Orders', 'order_id', 'INTEGER', 'BIGI... | {
"split": "train",
"index": 78819,
"acecode_id": "oss_17235",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to map a given value from one range to another. The function should take in three parameters: the value to be mapped (an integer), the original range (a list of two integers), and the target range (a list of two integers). Your task i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert abs(map_range(0, [0, 100], [2, 62]) - 2.0) < 1e-9\", \"assert abs(map_range(50, [0, 100], [2, 62]) - 32.0) < 1e-9\", \"assert abs(map_range(100, [0, 100], [2, 62]) - 62.0) < 1e-9\", \"assert abs(map_range(75, [0, 100], [2, 62]) - 47.0) < 1e-9\", \"assert abs... | {
"split": "train",
"index": 78820,
"acecode_id": "oss_16501",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a sorted array that has been rotated at an unknown pivot. Write a function `rotated_array_search(nums: List[int], target: int) -> int` that returns the index of a target value in the array. If the target is not found, return -1. The function should maintain a loga... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rotated_array_search([4,5,6,7,0,1,2], 0) == 4\", \"assert rotated_array_search([4,5,6,7,0,1,2], 3) == -1\", \"assert rotated_array_search([1], 0) == -1\", \"assert rotated_array_search([], 1) == -1\", \"assert rotated_array_search([1, 3], 3) == 1\", \"assert... | {
"split": "train",
"index": 78821,
"acecode_id": "evol_34776",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a project name and several parameters that define the context of the project. Your task is to generate a descriptive label for the project based on the following rules: \n\n1. Start with the project name. \n2. If the parameter 'runtime' is True, append 'run time' ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_project_label('ProjectA', True, True, True) == 'ProjectA run time direct reverse dependencies'\", \"assert generate_project_label('ProjectB', False, False, False) == 'ProjectB build time dependencies dependencies'\", \"assert generate_project_label(... | {
"split": "train",
"index": 78822,
"acecode_id": "bigcode_python_fns_19339",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of document sources, implement a function `fetch_documents(sources: List[str]) -> List[Document]` that retrieves a list of documents from those sources. Each document is represented as a dictionary with the following structure: {'id': int, 'title': str, 'content': ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fetch_documents(['source1', 'source2']) == [{'id': 1, 'title': 'Doc 1', 'content': 'Content of document 1'}, {'id': 2, 'title': 'Doc 2', 'content': 'Content of document 2'}]\", \"assert fetch_documents(['source3']) == [{'id': 3, 'title': 'Doc 3', 'content': ... | {
"split": "train",
"index": 78823,
"acecode_id": "bigcode_python_fns_32730",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that filters a list of dictionaries based on a specified key-value pair. Given a list of dictionaries and a key-value pair, your function should return a new list containing only the dictionaries that match the specified key and value... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_dicts([{'a': 'b'}, {'a': 'c'}, {'a': 'b'}], 'a', 'b') == [{'a': 'b'}, {'a': 'b'}]\", \"assert filter_dicts([], 'a', 'b') == []\", \"assert filter_dicts([{'x': 1}, {'x': 2}], 'x', 1) == [{'x': 1}]\", \"assert filter_dicts([{'name': 'Alice'}, {'name': '... | {
"split": "train",
"index": 78824,
"acecode_id": "bigcode_python_fns_3677",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that computes the n-th Fibonacci number using an iterative algorithm. The function should take a single integer argument n (0 <= n <= 30) and return the n-th Fibonacci number, where the Fibonacci sequence is defined as follows: Fib(0) = 0, Fib(1) = 1, and F... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(0) == 0\", \"assert fibonacci(1) == 1\", \"assert fibonacci(2) == 1\", \"assert fibonacci(3) == 2\", \"assert fibonacci(4) == 3\", \"assert fibonacci(5) == 5\", \"assert fibonacci(6) == 8\", \"assert fibonacci(7) == 13\", \"assert fibonacci(8) == 2... | {
"split": "train",
"index": 78825,
"acecode_id": "evol_28330",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of bars in a histogram. Your task is to implement a function that calculates the area of the largest rectangle that can be formed within the histogram. The rectangle can be formed using one or more contiguous bars. The f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert largest_rectangle_area([2,1,5,6,2,3]) == 10\", \"assert largest_rectangle_area([1,1,1,1]) == 4\", \"assert largest_rectangle_area([]) == 0\", \"assert largest_rectangle_area([5]) == 5\", \"assert largest_rectangle_area([1,2,3,4,5]) == 9\", \"assert largest_r... | {
"split": "train",
"index": 78826,
"acecode_id": "oss_13126",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `create_log` that simulates the creation of a log message with various levels of severity. The function should take in a message, a log level, and an optional dictionary of supplementary details. The function should construct a log di... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_log('Disk space low', 'ERROR', {'disk_usage': '95%', 'server': 'prod-01'}) == {'message': 'Disk space low', 'timestamp': '2023-10-01T12:00:00', 'log_level': 'ERROR', 'origin': 'localhost', 'disk_usage': '95%', 'server': 'prod-01'}\", \"assert create_l... | {
"split": "train",
"index": 78827,
"acecode_id": "oss_12458",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating a configuration string for a package based on the package type, name, version, and optional additional arguments. Create a function `generate_package_config` that takes the following parameters: `pkg_type` (a string, either 'python' or 'node'), `p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_package_config('node', 'my_app', '2.0.1') == 'Node Package: my_app, Version: 2.0.1, Additional Args: []'\", \"assert generate_package_config('python', 'test_package', '0.1.0') == 'Python Package: test_package, Version: 0.1.0, Additional Args: []'\",... | {
"split": "train",
"index": 78828,
"acecode_id": "bigcode_python_fns_9813",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a list of funding records, where each funding record is represented by a dictionary containing the fields 'id', 'is_active', and 'processed_at'. Write a function `process_funding_records(records: List[Dict[str, Union[int, bool, Optional[str]]]]) -> List[str]` that... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_funding_records([{'id': 12, 'is_active': True, 'processed_at': '2023-03-01 00:00:00'}, {'id': 13, 'is_active': False, 'processed_at': None}]) == ['Processed at 2023-03-01 00:00:00', 'Not processed']\", \"assert process_funding_records([{'id': 20, 'is... | {
"split": "train",
"index": 78829,
"acecode_id": "bigcode_python_fns_26873",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a list of tuples, `props`, where each tuple contains a property name and its corresponding value. Your task is to write a function that checks if all the property names are unique. If all property names are unique, the function should return `True`; otherwise, it ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_unique_properties([('color', 'red'), ('size', 'medium'), ('weight', 'light')]) == True\", \"assert check_unique_properties([('color', 'red'), ('size', 'medium'), ('color', 'blue')]) == False\", \"assert check_unique_properties([('length', 'short'), ('w... | {
"split": "train",
"index": 78830,
"acecode_id": "oss_1900",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string that represents a series of chunked HTTP request messages. Each chunk is separated by a newline character and consists of a hexadecimal number indicating the size of the chunk followed by the chunk data and ending with '0' to indicate the end of the messa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_chunked_request('0\\\\r\\\\n0\\\\r\\\\n') == False\", \"assert validate_chunked_request('g\\\\r\\\\nabc\\\\r\\\\n0\\\\r\\\\n') == False\", \"assert validate_chunked_request('1\\\\r\\\\n\\\\r\\\\n0\\\\r\\\\n') == False\", \"assert validate_chunked_re... | {
"split": "train",
"index": 78831,
"acecode_id": "bigcode_python_fns_4662",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that manages VLAN assignments for service profiles in a virtual network interface card (vNIC) environment. The function, `assign_vlan`, will take two parameters: an integer `vlan` representing the VLAN ID to assign or remove from the serv... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert assign_vlan(10, False) == 'VLAN 10 assigned to the service profile vNIC.'\", \"assert assign_vlan(20, True) == 'VLAN 20 removed from the service profile vNIC.'\", \"assert assign_vlan(30, False) == 'VLAN 30 assigned to the service profile vNIC.'\", \"assert ... | {
"split": "train",
"index": 78832,
"acecode_id": "oss_10730",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that converts a given temperature from degrees Celsius to degrees Fahrenheit. The conversion formula is: Fahrenheit = (9/5) * Celsius + 32. Your function should take a single parameter, which is the temperature in Celsius, and return the equivalent temperat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert celsius_to_fahrenheit(-40) == -40.0\", \"assert celsius_to_fahrenheit(0) == 32.0\", \"assert celsius_to_fahrenheit(100) == 212.0\", \"assert celsius_to_fahrenheit(25) == 77.0\", \"assert celsius_to_fahrenheit(-10) == 14.0\", \"assert celsius_to_fahrenheit(50... | {
"split": "train",
"index": 78833,
"acecode_id": "evol_35928",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates moving a robotic arm to a specific pose based on a given request. The function `move_robot_arm` takes a `PoseRequest` object as input, which contains the target pose represented as a dictionary with keys 'x', 'y', and '... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert move_robot_arm({'pose': {'x': 0, 'y': 0, 'z': 0}}) == {'success': True}\", \"assert move_robot_arm({'pose': {'x': 5, 'y': -5, 'z': 5}}) == {'success': True}\", \"assert move_robot_arm({'pose': {'x': -10, 'y': 10, 'z': 0}}) == {'success': True}\", \"assert mo... | {
"split": "train",
"index": 78834,
"acecode_id": "oss_16281",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the process of adding a new record to a database table called 'sub_sellos'. The function should accept a dictionary representing the record to be added. If the record contains the key 'submit' with the value 'Aceptar', the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_record_to_sub_sellos({'submit': 'Aceptar'}) == 'Registro ingresado'\", \"assert add_record_to_sub_sellos({'submit': 'Cancelar'}) == 'Registro no ingresado'\", \"assert add_record_to_sub_sellos({}) == 'Registro no ingresado'\", \"assert add_record_to_sub_... | {
"split": "train",
"index": 78835,
"acecode_id": "bigcode_python_fns_48088",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists representing bounding boxes in a 2D plane and a threshold for Intersection over Union (IoU). The first list contains the ground truth bounding boxes, while the second list contains predicted bounding boxes with their corresponding confidence scores. Your... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_bounding_boxes([[0, 0, 1, 1]], [[0, 0, 1, 1]], 0.5) == {'true_pos': 1, 'false_pos': 0, 'false_neg': 0}\", \"assert count_bounding_boxes([[0, 0, 1, 1]], [[1, 1, 2, 2]], 0.5) == {'true_pos': 0, 'false_pos': 1, 'false_neg': 1}\", \"assert count_bounding_b... | {
"split": "train",
"index": 78836,
"acecode_id": "bigcode_python_fns_16762",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of rectangles defined by their coordinates in a 2D space. Each rectangle is represented by a tuple of four integers (x1, y1, x2, y2), where (x1, y1) is the bottom left corner and (x2, y2) is the top right corner. Your task is to write a function that identi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_ports_from_rectangles([], 1, 4) == []\", \"assert add_ports_from_rectangles([(1, 1, 3, 3), (2, 2, 4, 4)], 1, 1) == []\", \"assert add_ports_from_rectangles([(0, 0, 2, 2), (2, 2, 0, 0)], 0, 2) == []\", \"assert add_ports_from_rectangles([(0, 0, 2, 3)], 2,... | {
"split": "train",
"index": 78837,
"acecode_id": "bigcode_python_fns_3143",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a function `erroneous_slice(numbers, delimiter)` that takes a list of integers `numbers` and an integer `delimiter`. The function should verify that both the `numbers` list and the `delimiter` are integers. If they are not, return an empty list. Otherwise, create a ne... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert erroneous_slice([1, 2, 3], 0) == [1, 0, 2, 0, 3]\", \"assert erroneous_slice([], 5) == []\", \"assert erroneous_slice([5, 10], 2) == [5, 2, 10]\", \"assert erroneous_slice([1], 1) == [1]\", \"assert erroneous_slice([0, 0], 1) == [0, 1, 0]\", \"assert erroneo... | {
"split": "train",
"index": 78838,
"acecode_id": "evol_5337",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a software license agreement. Your task is to write a Python function that extracts and counts the occurrences of unique words in the license agreement. The function should perform the following steps: 1. Tokenize the string into words, remov... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_words('Hello world! Hello again.') == [('hello', 2), ('world', 1), ('again', 1)]\", \"assert count_unique_words('Python is great. Python is fun!') == [('python', 2), ('is', 2), ('great', 1), ('fun', 1)]\", \"assert count_unique_words('A quick br... | {
"split": "train",
"index": 78839,
"acecode_id": "oss_32250",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates a list of the first `n` numbers in an infinite sequence based on a given step value. The sequence starts from 0 and each subsequent number is incremented by the step value. Your function should take two parameters: an i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_sequence(2, 5) == [0, 2, 4, 6, 8]\", \"assert generate_sequence(3, 4) == [0, 3, 6, 9]\", \"assert generate_sequence(1, 6) == [0, 1, 2, 3, 4, 5]\", \"assert generate_sequence(5, 3) == [0, 5, 10]\", \"assert generate_sequence(0, 5) == [0, 0, 0, 0, 0]\... | {
"split": "train",
"index": 78840,
"acecode_id": "oss_31546",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a class name in the format 'module.module.classname', implement a function that extracts and returns the class name without importing the module. The input will be a single string, and the output should be a string containing only the class name. If ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_class_name('math.sqrt') == 'sqrt'\", \"assert extract_class_name('os.path.join') == 'join'\", \"assert extract_class_name('collections.Counter') == 'Counter'\", \"assert extract_class_name('json') == ''\", \"assert extract_class_name('sys.modules') =... | {
"split": "train",
"index": 78841,
"acecode_id": "bigcode_python_fns_12165",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string consisting of alphanumeric characters and punctuation marks. Your task is to implement a function that counts the number of unique words in the string, treating words as case-insensitive and ignoring punctuation. Write a function `unique_words(string: str... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_words('The quick brown fox brown quick!') == 4\", \"assert unique_words('Hello, world! Hello.') == 2\", \"assert unique_words('Python is great. Python is fun!') == 4\", \"assert unique_words('') == 0\", \"assert unique_words('What a wonderful world!')... | {
"split": "train",
"index": 78842,
"acecode_id": "evol_17711",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks if a given file size is above a specified limit. The function should take two parameters: an integer `file_size`, which represents the size of the file in bytes, and an integer `limit`, which represents the size limit in b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_file_size_valid(10240, 10000) == True\", \"assert is_file_size_valid(2048, 10000) == False\", \"assert is_file_size_valid(10000, 10000) == False\", \"assert is_file_size_valid(15000, 12000) == True\", \"assert is_file_size_valid(500, 500) == False\", \"as... | {
"split": "train",
"index": 78843,
"acecode_id": "bigcode_python_fns_28764",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `stack_operations(operations: List[Tuple[str, str, Union[int, None]]]) -> List[Union[int, str]]` that simulates the operations of a stack manager. The function takes a list of operations where each operation is represented as a tuple.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert stack_operations([('create_stack', 'stack1', None), ('push', 'stack1', 5), ('push', 'stack1', 10), ('pop', 'stack1', None)]) == [ 'created', None, None, 10 ]\", \"assert stack_operations([('create_stack', 'stack1', None), ('push', 'stack1', 5), ('is_empty', ... | {
"split": "train",
"index": 78844,
"acecode_id": "oss_31301",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of 7 numerical values representing data points sampled at equal time intervals, implement a function that computes the approximate derivative of the data at the first entry using a sixth-order forward difference scheme. The derivative at the first entry should be c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert abs(derivative([0, 0, 0, 0, 0, 0, 0], 1) - 0) < 1e-9\", \"assert abs(derivative([1, 1, 1, 1, 1, 1, 1], 1) - 0) < 1e-9\", \"assert abs(derivative([10, 15, 20, 25, 30, 35, 40], 1) - 5) < 1e-9\", \"assert abs(derivative([1, 1, 1, 1, 1, 1, 1], 2) - 0) < 1e-9\", ... | {
"split": "train",
"index": 78845,
"acecode_id": "bigcode_python_fns_8836",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing names of parameters in a machine learning model. Your task is to implement a function that takes this list and a list of patterns (also strings) as inputs. For each string in the parameter names, if it matches any of the patterns, yo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unfreeze_params(['layer1.weight', 'layer1.bias', 'layer2.weight'], ['layer1.*']) == ['unfrozen', 'unfrozen', 'frozen']\", \"assert unfreeze_params(['layer1.weight', 'layer2.bias', 'layer3.weight'], ['layer2.*']) == ['frozen', 'unfrozen', 'frozen']\", \"asser... | {
"split": "train",
"index": 78846,
"acecode_id": "bigcode_python_fns_3096",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a tuple representing a point in a two-dimensional space, where the first element is the x-coordinate and the second element is the y-coordinate. Your task is to implement a function `calculate_distance(point: Tuple[float, float]) -> float` that calculates the Eucl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_distance((3, 4)) == 5.0\", \"assert calculate_distance((0, 0)) == 0.0\", \"assert calculate_distance((1, 1)) == 1.41\", \"assert calculate_distance((-3, -4)) == 5.0\", \"assert calculate_distance((6, 8)) == 10.0\", \"assert calculate_distance((5, 1... | {
"split": "train",
"index": 78847,
"acecode_id": "bigcode_python_fns_13920",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that changes the ownership group of a file or directory given its pathname and the desired group name. The function should take two parameters: a string `pathname` which represents the path to the file or directory, and a string `grou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_group('/path/to/file.txt', 'staff') == 'Group changed to staff for /path/to/file.txt.'\", \"assert set_group('/path/to/directory', 'admin') == 'Group changed to admin for /path/to/directory.'\", \"assert set_group('C:/path/to/file.txt', 'staff') == 'Grou... | {
"split": "train",
"index": 78848,
"acecode_id": "bigcode_python_fns_193",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function that accepts a string as an argument and returns a dictionary with each distinct character as a key and its frequency in the string as a value. Note that capital and small letters are considered distinct characters, and white spaces should be ignored. For e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert char_frequency('Hello World') == {'H': 1, 'e': 1, 'l': 3, 'o': 2, 'W': 1, 'r': 1, 'd': 1}\", \"assert char_frequency('') == {}\", \"assert char_frequency('Python 3.8') == {'P': 1, 'y': 1, 't': 1, 'h': 1, 'o': 1, 'n': 1, '3': 1, '.': 1, '8': 1}\", \"assert ch... | {
"split": "train",
"index": 78849,
"acecode_id": "evol_23207",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, implement a function that sorts these strings in ascending alphabetical order. Your function should take a list of strings as input and return a new list containing the sorted strings. Do not modify the original list.\nPlease reason step by step, then w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_lex(['daisy', 'apple', 'cat', 'zebra']) == ['apple', 'cat', 'daisy', 'zebra']\", \"assert sort_lex(['banana', 'apple', 'cherry']) == ['apple', 'banana', 'cherry']\", \"assert sort_lex(['orange', 'kiwi', 'grape', 'apple']) == ['apple', 'grape', 'kiwi', '... | {
"split": "train",
"index": 78850,
"acecode_id": "evol_822",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a given event represented as a dictionary. Your function should extract a specific value from the event, log it, and return a modified version of the event that includes an additional key-value pair. The key to extra... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_event({'Choice': 'A'}) == {'Choice': 'A', 'Processed': True}\", \"assert process_event({'Choice': 'B', 'Other': 1}) == {'Choice': 'B', 'Other': 1, 'Processed': True}\", \"assert process_event({'Choice': 'C', 'Data': 'Sample'}) == {'Choice': 'C', 'Dat... | {
"split": "train",
"index": 78851,
"acecode_id": "oss_17722",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of valid SCTs (Signed Certificate Timestamps) associated with different log URLs. Your task is to implement a function `filter_valid_scts` that takes a list of SCTs (as tuples of log URL and SCT string) and returns a dictionary where the keys are the log UR... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_valid_scts([('log1', 'sct1'), ('log2', 'sct2'), ('log1', 'sct3')]) == {'log1': {'sct': 'sct3', 'valid': True}, 'log2': {'sct': 'sct2', 'valid': True}}\", \"assert filter_valid_scts([('logA', 'sctA'), ('logB', 'sctB')]) == {'logA': {'sct': 'sctA', 'val... | {
"split": "train",
"index": 78852,
"acecode_id": "bigcode_python_fns_436",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that initializes a dataset for a computer vision project. The dataset contains images and segmentation maps, with three classes: 'background', 'stone', and 'border'. The function should take in a split parameter indicating which subse... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_dataset('train') == {'img_suffix': '.png', 'seg_map_suffix': '.png', 'split': 'train'}\", \"assert initialize_dataset('val') == {'img_suffix': '.png', 'seg_map_suffix': '.png', 'split': 'val'}\", \"assert initialize_dataset('test') == {'img_suffix... | {
"split": "train",
"index": 78853,
"acecode_id": "oss_124",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of boolean values, implement a function that returns a new list where each boolean value is negated (True becomes False and False becomes True). You can assume that the input list will only contain boolean values (True or False). The function should be defined as `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert not_list([True, False, True]) == [False, True, False]\", \"assert not_list([False, False, False]) == [True, True, True]\", \"assert not_list([True, True, True]) == [False, False, False]\", \"assert not_list([True]) == [False]\", \"assert not_list([False]) ==... | {
"split": "train",
"index": 78854,
"acecode_id": "bigcode_python_fns_41068",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_resident(user_units: List[str]) -> bool` that determines if a user has resident privileges based on their association with community units. A user is considered a resident if they have at least one unit associated with them. The function should take a l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_resident(['unit1', 'unit2']) == True\", \"assert is_resident(['unit1']) == True\", \"assert is_resident(['unit2', 'unit3']) == True\", \"assert is_resident(['unit1', 'unit2', 'unit3']) == True\", \"assert is_resident([]) == False\", \"assert is_resident([... | {
"split": "train",
"index": 78855,
"acecode_id": "bigcode_python_fns_49725",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a list of iterators based on training and knowledge base data inputs. The function should take four parameters: a list of training data strings, a list of knowledge base strings, a batch size integer, and a flag indicating ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_iterators(['data1', 'data2'], ['kb1', 'kb2'], 2, True) == (['train_iterator', 'self_play_iterator'], ['data_placeholder', 'kb_placeholder', 'batch_size_placeholder', 'skip_count_placeholder'])\", \"assert create_iterators(['data1'], ['kb1'], 1, False)... | {
"split": "train",
"index": 78856,
"acecode_id": "bigcode_python_fns_48501",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple clock management system for a smart home device. Your task is to implement a function called `alarm_status(current_hour, current_minute, alarm_hour, alarm_minute)` that checks if the alarm should ring based on the current time and the s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert alarm_status(7, 30, 7, 30) == 'Alarm is ringing!'\", \"assert alarm_status(6, 45, 7, 30) == 'No alarm at the current time.'\", \"assert alarm_status(7, 29, 7, 30) == 'No alarm at the current time.'\", \"assert alarm_status(8, 30, 7, 30) == 'No alarm at the c... | {
"split": "train",
"index": 78857,
"acecode_id": "oss_33221",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of prefixes, topics, and segments, write a function that generates a formatted string representation of a hierarchical topic-based unigram model. The output should follow a specific format where each line corresponds to the relationships between words, topics, and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_model((['A', 'B'], ['Topic1', 'Topic2'], ['Segment1', 'Segment2'])) == '1 1 Sentence --> Words\\\\n1 1 Words --> Words Word\\\\n1 1 Words --> T_A\\\\n1 1 Words --> T_B\\\\n1 1 Words --> Topic_Topic1 Word_Topic1\\\\n1 1 Topic_Topic1 --> Topic_Topic1 ... | {
"split": "train",
"index": 78858,
"acecode_id": "bigcode_python_fns_8698",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of movie titles and a filmmaker's name as input. The function should return a dictionary where the keys are the movie titles and the values are the filmmaker's name. If the input list is empty, the function should return... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_movie_dict(['Inception', 'The Dark Knight', 'Interstellar'], 'Christopher Nolan') == {'Inception': 'Christopher Nolan', 'The Dark Knight': 'Christopher Nolan', 'Interstellar': 'Christopher Nolan'}\", \"assert create_movie_dict(['Titanic', 'Avatar'], '... | {
"split": "train",
"index": 78859,
"acecode_id": "evol_33182",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string str_ that may contain spaces, write a function that converts the string to snake case. Snake case means that all spaces in the string are replaced with underscores (_) and all letters are converted to lowercase. For example, the string 'Hello World' should be con... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert snakify('Hello World') == 'hello_world'\", \"assert snakify('Python is Awesome') == 'python_is_awesome'\", \"assert snakify('LeetCode Challenge') == 'leetcode_challenge'\", \"assert snakify('Convert THIS String') == 'convert_this_string'\", \"assert snakify(... | {
"split": "train",
"index": 78860,
"acecode_id": "bigcode_python_fns_4393",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a string representing an image ID, you need to determine if the image entry has expired based on a specific timestamp encoded in the image ID. The expiration timestamp can be extracted from the image ID using a function called `extract_timestamp(image_id)`, which returns ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_expired('img_2023-10-01T10:00:00Z') == True\", \"assert is_expired('img_2023-09-30T10:00:00Z') == True\", \"assert is_expired('img_2023-10-01T12:00:00Z') == True\", \"assert is_expired('img_2023-09-29T23:59:59Z') == True\", \"assert is_expired('img_2023-1... | {
"split": "train",
"index": 78861,
"acecode_id": "bigcode_python_fns_11512",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a simulated switch control system that operates based on the state of coils. Implement a function `test_coil_switch(switch_name: str, coil_number: int, slave_id: int, expected_state: bool) -> bool` that simulates checking the state of a coil switch. The function t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert test_coil_switch('modbus_test_switch', 1234, 1, True) == True\", \"assert test_coil_switch('modbus_test_switch', 1235, 1, False) == True\", \"assert test_coil_switch('modbus_test_switch', 0, 1, True) == True\", \"assert test_coil_switch('modbus_test_switch',... | {
"split": "train",
"index": 78862,
"acecode_id": "bigcode_python_fns_8735",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that returns a specific color from a color palette based on the input tone and an optional index. The function should take two parameters: a string 'tones' which can either be 'hot' or 'cold', and an optional integer 'i'. If 'i' is provid... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert use_colors('hot') == ['#fed976', '#feb24c', '#fd8d3c', '#fc4e2a', '#e31a1c', '#b10026']\", \"assert use_colors('cold') == ['#a6bddb', '#67a9cf', '#3690c0', '#02818a', '#016c59', '#014636']\", \"assert use_colors('hot', 0) == '#fed976'\", \"assert use_colors(... | {
"split": "train",
"index": 78863,
"acecode_id": "bigcode_python_fns_26307",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function that sorts a list of integers in ascending order using your own implementation of the Quicksort algorithm. Do not use the sort() method or any other built-in sorting methods. Ensure that your implementation can handle lists with duplicate values effectively... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert quicksort([3, 2, 1]) == [1, 2, 3]\", \"assert quicksort([1, 2, 3]) == [1, 2, 3]\", \"assert quicksort([2, 2, 2]) == [2, 2, 2]\", \"assert quicksort([5, 3, 8, 1, 2]) == [1, 2, 3, 5, 8]\", \"assert quicksort([4, 5, 6, 4, 3]) == [3, 4, 4, 5, 6]\", \"assert quic... | {
"split": "train",
"index": 78864,
"acecode_id": "evol_14258",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates securely uploading data to a database. Write a function `simulate_upload_to_database` that takes in the following parameters: \n- `data_df`: A list of dictionaries representing the data to be uploaded. \n- `user`: A ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_upload_to_database([{'id': 1, 'value': 'test'}], 'user', 'pass', 'localhost', '5432', 'test_db') == (True, \\\"Data uploaded to database 'test_db' successfully.\\\")\", \"assert simulate_upload_to_database([], 'user', 'pass', 'localhost', '5432', 't... | {
"split": "train",
"index": 78865,
"acecode_id": "oss_19958",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that generates a random sample from a given dataset. The function should accept a dataset (a list of integers) and an optional boolean parameter `use_small_samples`. If `use_small_samples` is set to True, the function should re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_samples([1, 2, 3, 4, 5], False) == [1, 2, 3, 4, 5]\", \"assert generate_samples([1], True) == [1]\", \"assert generate_samples([1], False) == [1]\", \"assert generate_samples([], True) == []\", \"assert generate_samples([], False) == []\", \"assert ... | {
"split": "train",
"index": 78866,
"acecode_id": "oss_34979",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple environment variable manager that enforces certain rules when accessing environment variables. Specifically, you need to implement a function `manage_env` which takes a dictionary of environment variables and a list of variable names to acc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_env({'MYAPP_PORT': '8080', 'MYAPP_ENV': 'production', 'OTHER_VAR': 'test'}, ['MYAPP_PORT', 'MYAPP_ENV', 'OTHER_VAR']) == {'MYAPP_PORT': '8080', 'MYAPP_ENV': 'production'}\", \"assert manage_env({'MYAPP_USERNAME': 'admin', 'MYAPP_PASSWORD': 'secret'}, ... | {
"split": "train",
"index": 78867,
"acecode_id": "bigcode_python_fns_40771",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an XML document as a string, implement a function that extracts and returns a sorted list of tuples containing the name, age, and job title of all 'employee' elements that have a 'department' sub-element equal to 'sales'. Each employee must also contain 'name', 'age', and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_sales_employees('<doc><employee><name>John Doe</name><age>45</age><department>sales</department><job-title>Manager</job-title></employee><employee><name>Jane Doe</name><age>30</age><department>sales</department><job-title>Asst. Manager</job-title></emplo... | {
"split": "train",
"index": 78868,
"acecode_id": "evol_32752",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `modify_list` that takes a list and a string indicating a state. The function should perform the following operations based on the state: 1. If the state is 'add', append the integer 10 to the list. 2. If the state is 'remove', remove ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert modify_list([1, 2, 3], 'add') == [1, 2, 3, 10]\", \"assert modify_list([1, 2, 3], 'remove') == [1, 2, 3]\", \"assert modify_list([1, 2, 10], 'remove') == [1, 2]\", \"assert modify_list([], 'add') == [10]\", \"assert modify_list([5, 10], 'remove') == [5]\", \... | {
"split": "train",
"index": 78869,
"acecode_id": "bigcode_python_fns_17159",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers and returns a new list containing only the elements that appear more than once in the original list, preserving the order of their first appearance. Write a function `find_duplicates(arr: List[int]) -> Li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_duplicates([1, 2, 3, 4, 5]) == []\", \"assert find_duplicates([1, 2, 3, 3, 4, 5]) == [3]\", \"assert find_duplicates([1, 1, 2, 2, 3, 3]) == [1, 2, 3]\", \"assert find_duplicates([5, 5, 5, 1, 1]) == [5, 1]\", \"assert find_duplicates([1, 2, 3, 4, 5, 6, 7... | {
"split": "train",
"index": 78870,
"acecode_id": "bigcode_python_fns_43597",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string that may contain multiple special characters and question marks, your task is to replace all the question marks with plus signs. Additionally, return the revised text and the count of replaced characters. If the input is not a string, throw an appropriate error m... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_question_mark('Hello? World?') == ('Hello+ World+', 2)\", \"assert convert_question_mark('What? Is this?') == ('What+ Is this+', 2)\", \"assert convert_question_mark('No questions here') == ('No questions here', 0)\", \"assert convert_question_mark('... | {
"split": "train",
"index": 78871,
"acecode_id": "evol_30307",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function `swap_and_track(sequence: List[int], i: int, j: int) -> List[List[int]]` that takes an integer sequence and two unique positions `i` and `j`. The function should swap the elements at these positions and return a list of all sequences leading up to and includin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert swap_and_track([1, 2, 3, 4], 0, 2) == [[1, 2, 3, 4], [3, 2, 1, 4]]\", \"assert swap_and_track([10, 20, 30, 40], 1, 3) == [[10, 20, 30, 40], [10, 40, 30, 20]]\", \"assert swap_and_track([5, 5, 5, 5], 0, 3) == [[5, 5, 5, 5], [5, 5, 5, 5]]\", \"assert swap_and_... | {
"split": "train",
"index": 78872,
"acecode_id": "evol_5811",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a multidimensional array, where some elements may be nested arrays of strings, implement a function that transforms all string type elements into integer type elements at any depth of nesting. The function should be able to handle any level of array nesting. For example, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert string_to_int(['1', ['2', '3'], [['4'], '5']]) == [1, [2, 3], [[4], 5]]\", \"assert string_to_int(['10', '20', ['30', '40']]) == [10, 20, [30, 40]]\", \"assert string_to_int([['1', '2'], '3']) == [[1, 2], 3]\", \"assert string_to_int(['1', '2', '3']) == [1, ... | {
"split": "train",
"index": 78873,
"acecode_id": "evol_12204",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `fibonacci(n: int) -> int` that computes the nth Fibonacci number. The Fibonacci sequence is defined as follows: the first Fibonacci number is 0, the second is 1, and each subsequent number is the sum of the two preceding ones. Your function should return t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(1) == 0\", \"assert fibonacci(2) == 1\", \"assert fibonacci(3) == 1\", \"assert fibonacci(4) == 2\", \"assert fibonacci(5) == 3\", \"assert fibonacci(6) == 5\", \"assert fibonacci(7) == 8\", \"assert fibonacci(8) == 13\", \"assert fibonacci(9) == 2... | {
"split": "train",
"index": 78874,
"acecode_id": "evol_27506",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `unique_char_index(s: str) -> int` that takes a string `s` as input and returns the index of the first unique (distinct) character in the string. If all characters in the string are repeating, return -1. The function should also handle special cases such as... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_char_index('leetcode') == 0\", \"assert unique_char_index('aabbcc') == -1\", \"assert unique_char_index('abcdefg') == 0\", \"assert unique_char_index('aabbccdd') == -1\", \"assert unique_char_index('') == -1\", \"assert unique_char_index('abcabc') == ... | {
"split": "train",
"index": 78875,
"acecode_id": "evol_34197",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of integers and returns the count of elements that are less than the mean of the list. The mean is calculated as the sum of the elements divided by the number of elements. If the list is empty, the function should return 0.\nPlease reason ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_numbers_below_mean([1, 2, 3, 4, 5]) == 2\", \"assert count_numbers_below_mean([10, 20, 30, 40]) == 2\", \"assert count_numbers_below_mean([5, 5, 5, 5]) == 0\", \"assert count_numbers_below_mean([]) == 0\", \"assert count_numbers_below_mean([1]) == 0\",... | {
"split": "train",
"index": 78876,
"acecode_id": "evol_23044",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function to parse a list of strings that represent package information. Each string contains a key-value pair separated by a colon. For example, a string may look like 'Name: name' or 'Version: 1.0'. Your function should take a list of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_pkg_info(['Name: name', 'Version: 1.0']) == {'Name': 'name', 'Version': '1.0'}\", \"assert parse_pkg_info(['Author: John Doe', 'License: MIT']) == {'Author': 'John Doe', 'License': 'MIT'}\", \"assert parse_pkg_info(['Name: test_package', 'Description: ... | {
"split": "train",
"index": 78877,
"acecode_id": "oss_11805",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a non-negative integer n, implement a function `factorial(n)` that returns the factorial of n. The factorial of a non-negative integer n is the product of all positive integers less than or equal to n. For example, factorial(5) = 5 * 4 * 3 * 2 * 1 = 120.\nPlease reason st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert factorial(0) == 1\", \"assert factorial(1) == 1\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", \"assert factorial(5) == 120\", \"assert factorial(6) == 720\", \"assert factorial(7) == 5040\", \"assert factorial(... | {
"split": "train",
"index": 78878,
"acecode_id": "evol_11722",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers and returns a new list containing only the unique integers from the original list, while preserving their original order. Write a function `unique_integers(arr: List[int]) -> List[int]` where `arr` is the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_integers([1, 2, 2, 3, 4, 3, 5]) == [1, 2, 3, 4, 5]\", \"assert unique_integers([5, 5, 5, 5]) == [5]\", \"assert unique_integers([]) == []\", \"assert unique_integers([10, 20, 10, 30, 20, 40]) == [10, 20, 30, 40]\", \"assert unique_integers([1, 1, 2, 2... | {
"split": "train",
"index": 78879,
"acecode_id": "bigcode_python_fns_36388",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a sorted list of integers. Your task is to implement a function to remove the duplicates in-place such that each element appears only once. After modifying the input list in-place, return the new length of the list. Note that you should not allocate extra space fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_duplicates([1, 1, 2]) == 2\", \"assert remove_duplicates([0, 0, 1, 1, 1, 2, 2, 3, 3, 4]) == 5\", \"assert remove_duplicates([]) == 0\", \"assert remove_duplicates([1]) == 1\", \"assert remove_duplicates([1, 2, 3, 4]) == 4\", \"assert remove_duplicates... | {
"split": "train",
"index": 78880,
"acecode_id": "oss_23550",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simplified JSON parser in Python. Your parser should take a JSON string as input and return the corresponding Python dictionary. The parser should support parsing of JSON objects (key-value pairs), arrays, strings, numbers, and boolean values.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_json('{\\\"name\\\": \\\"John\\\", \\\"age\\\": 30, \\\"is_student\\\": false, \\\"grades\\\": [85, 92, 78]}') == {'name': 'John', 'age': 30, 'is_student': False, 'grades': [85, 92, 78]}\", \"assert parse_json('{\\\"title\\\": \\\"Hello World\\\", \\\"... | {
"split": "train",
"index": 78881,
"acecode_id": "oss_35575",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a flash message system for a web application. The flash message system should display a message to the user, indicating either an error or a success message. Your task is to implement the function `flash_and_set_code` that takes a message as inp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert flash_and_set_code('openid \\u6216\\u8005isbn\\u4e0d\\u5b58\\u5728') == ('openid \\u6216\\u8005isbn\\u4e0d\\u5b58\\u5728', -1)\", \"assert flash_and_set_code('\\u767b\\u5f55\\u6210\\u529f') == ('\\u767b\\u5f55\\u6210\\u529f', 0)\", \"assert flash_and_set_cod... | {
"split": "train",
"index": 78882,
"acecode_id": "oss_22998",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the deletion of a contact from a contact management system. The function `delete_contact` takes two parameters: `contact_key` (an integer representing the unique identifier of the contact) and `hash` (a string representing ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delete_contact(1, 'abc123') == '204 No Content'\", \"assert delete_contact(2, 'xyz456') == '409 Conflict'\", \"assert delete_contact(3, 'test789') == '204 No Content'\", \"assert delete_contact(4, 'hash000') == '409 Conflict'\", \"assert delete_contact(5, 'a... | {
"split": "train",
"index": 78883,
"acecode_id": "bigcode_python_fns_22105",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a custom function to process a set of points in 3D space for a simplified point cloud processing task. The function, called `process_point_cloud`, takes in two inputs: a list of points represented as tuples of (x, y, z) coordinates and a boolean... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_point_cloud([(1, 2, 3), (4, 5, 6)], True) == (2.5, 3.5, 4.5)\", \"assert process_point_cloud([(1, 1, 1), (2, 2, 2)], True) == (1.5, 1.5, 1.5)\", \"assert process_point_cloud([(0, 0, 0), (1, 1, 1)], True) == (0.5, 0.5, 0.5)\", \"assert process_point_c... | {
"split": "train",
"index": 78884,
"acecode_id": "oss_12882",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates URLs for different sections of a website. Your function, `build_url`, will take a section name as input and return the corresponding URL. The base URL for the website is 'https://example.com/'. Your function should ensu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert build_url('home') == 'https://example.com/home'\", \"assert build_url('about-us') == 'https://example.com/about-us'\", \"assert build_url('contact') == 'https://example.com/contact'\", \"assert build_url('products') == 'https://example.com/products'\", \"ass... | {
"split": "train",
"index": 78885,
"acecode_id": "oss_22931",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple data storage system. Your goal is to implement a function `data_storage` that simulates storing and loading an integer value. The function should have two operations: storing a value and loading the last stored value. The specifications are... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert data_storage(42, 'store') == None\", \"assert data_storage(100, 'store') == None\", \"assert data_storage(200, 'store') == None\", \"assert data_storage(300, 'store') == None\", \"assert data_storage(999, 'store') == None\", \"assert data_storage(-1, 'store'... | {
"split": "train",
"index": 78886,
"acecode_id": "oss_8135",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Implement a function that checks if a given string is a palindrome. A string is considered a palindrome if it reads the same forward and backward, ignoring spaces, punctuation, and capitalization. The input string will only contain printable ASCII characters. Your function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_palindrome('A man, a plan, a canal, Panama') == True\", \"assert is_palindrome('No lemon, no melon') == True\", \"assert is_palindrome('Was it a car or a cat I saw?') == True\", \"assert is_palindrome('Hello, World!') == False\", \"assert is_palindrome('A... | {
"split": "train",
"index": 78887,
"acecode_id": "evol_10948",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the IDs of vehicles. Your task is to implement a function `get_num_vehicles_with_filter(vehicle_ids: List[int], filters: List[Callable[[int], bool]]) -> int` that returns the total number of vehicles whose IDs pass all the given fil... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_num_vehicles_with_filter([1, 2, 3, 4, 5], [lambda x: x > 2]) == 3\", \"assert get_num_vehicles_with_filter([1, 2, 3, 4, 5], [lambda x: x % 2 == 0]) == 2\", \"assert get_num_vehicles_with_filter([7, 14, 21, 28], [lambda x: x % 7 == 0]) == 4\", \"assert ge... | {
"split": "train",
"index": 78888,
"acecode_id": "bigcode_python_fns_7706",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a singly linked list, determine if the linked list is circular. A circular linked list is defined as a linked list where a node's next pointer points back to a previous node, creating a cycle. You need to implement a function `is_circular(head: Optional[Node]) -> bool` wh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_circular(Node(1, Node(2, Node(3, None)))) == False\", \"assert is_circular(Node(1, None)) == False\", \"assert is_circular(Node(1, Node(1, Node(1, None)))) == False\", \"assert is_circular(Node(1, Node(2, Node(3, Node(4, None))))) == False\", \"assert is_... | {
"split": "train",
"index": 78889,
"acecode_id": "bigcode_python_fns_3116",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a function `run_check_handler_sync` that takes a `check` object, a `handler` function, and optional positional and keyword arguments. Your task is to implement a function `execute_check` that simulates the behavior of `run_check_handler_sync`. The function should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert execute_check(Check(), lambda x: x + 1, 1) == 2\", \"assert execute_check(Check(), lambda x: x / 0, 1) == 'Error'\", \"assert execute_check(Check(), lambda: 'Success') == 'Success'\", \"assert execute_check(Check(), lambda x, y: x * y, 3, 4) == 12\", \"asser... | {
"split": "train",
"index": 78890,
"acecode_id": "bigcode_python_fns_19976",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes an image given as a 2D list of pixel values, where each pixel is represented as a tuple of three integers (representing the RGB values). The function should convert the image to grayscale using the average method and re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_grayscale([[(255, 0, 0), (0, 255, 0)], [(0, 0, 255), (255, 255, 255)]]) == [[85, 85], [85, 255]]\", \"assert convert_to_grayscale([[(0, 0, 0), (0, 0, 0)], [(0, 0, 0), (0, 0, 0)]]) == [[0, 0], [0, 0]]\", \"assert convert_to_grayscale([[(255, 255, 2... | {
"split": "train",
"index": 78891,
"acecode_id": "bigcode_python_fns_43162",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of integers, performing a specific operation on each integer and handling any potential errors that may occur during the processing. Your function should take a list of integers as input and attempt to perform... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_numbers([-4, -2, -8]) == ['Number -4 processed successfully', 'Number -2 processed successfully', 'Number -8 processed successfully']\", \"assert process_numbers([5]) == ['Number 5 processed successfully']\", \"assert process_numbers([]) == []\", \"a... | {
"split": "train",
"index": 78892,
"acecode_id": "oss_32028",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are designing a function that allows a player to set the number of chances they receive per question in a game. Write a function `set_chances(chances: int) -> int` that takes an integer input representing the number of chances. The function should return the number of chanc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_chances(3) == 3\", \"assert set_chances(5) == 5\", \"assert set_chances(1) == 1\", \"assert set_chances(10) == 10\", \"assert set_chances(0) == -1\", \"assert set_chances(-1) == -1\", \"assert set_chances(-10) == -1\", \"assert set_chances(100) == 100\",... | {
"split": "train",
"index": 78893,
"acecode_id": "bigcode_python_fns_32471",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `generate_password(length: int) -> str` that generates a random password consisting of alphanumeric characters and special punctuation. The password must be of a specified length and should include at least one letter, one digit, and one special character. The ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_password(16) is not None\", \"assert len(generate_password(16)) == 16\", \"assert any(char.isalpha() for char in generate_password(16))\", \"assert any(char.isdigit() for char in generate_password(16))\", \"assert any(char in string.punctuation for ... | {
"split": "train",
"index": 78894,
"acecode_id": "evol_12748",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two integers, `num_samples_per_epoch` and `global_step`. Your task is to implement a function that calculates the decay steps for a learning rate based on the following formula: decay_steps = num_samples_per_epoch // (batch_size * num_clones) * num_epochs_per_deca... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_decay_steps(640, 0) == 100\", \"assert calculate_decay_steps(320, 0) == 50\", \"assert calculate_decay_steps(1280, 0) == 200\", \"assert calculate_decay_steps(960, 0) == 150\", \"assert calculate_decay_steps(0, 0) == 0\", \"assert calculate_decay_s... | {
"split": "train",
"index": 78895,
"acecode_id": "bigcode_python_fns_37431",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with validating email addresses using regular expressions. Write a function `validate_email(email: str) -> bool` that takes a string representing an email address and returns True if it is valid according to the following criteria: the email must contain characte... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_email('example@email.com') == True\", \"assert validate_email('user@domain') == False\", \"assert validate_email('@domain.com') == False\", \"assert validate_email('username@.com') == False\", \"assert validate_email('username@domain..com') == False... | {
"split": "train",
"index": 78896,
"acecode_id": "oss_15509",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a given context and returns a tuple containing specific values. The context may be None, in which case the corresponding value in the tuple should also be None. If the context is not None, the function should ext... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_context(None) == (mock_s_value, mock_p_value, mock_o_value, mock_o_lit_value, None)\", \"assert process_context(MockContext(identifier=1)) == (mock_s_value, mock_p_value, mock_o_value, mock_o_lit_value, '1')\", \"assert process_context(MockContext(id... | {
"split": "train",
"index": 78897,
"acecode_id": "oss_11068",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two strings, determine if they are anagrams of each other. An anagram is a word or phrase formed by rearranging the letters of a different word or phrase. Return True if the two strings are anagrams, and False otherwise. Your function should be case-sensitive and should i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert are_anagrams('listen', 'silent') == True\", \"assert are_anagrams('triangle', 'integral') == True\", \"assert are_anagrams('apple', 'papel') == True\", \"assert are_anagrams('rat', 'car') == False\", \"assert are_anagrams('Astronomer', 'Moon starer') == Fals... | {
"split": "train",
"index": 78898,
"acecode_id": "evol_10957",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D list of integers representing a grid of values. Your task is to write a function `process_grid(grid)` that takes this grid as input and performs the following operations: 1. Calculate the sum of all the integers in the grid. 2. Find the maximum value in the g... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_grid([[1, 2], [3, 4]]) == {'total_sum': 10, 'max_value': 4, 'squared_values': [1, 4, 9, 16]}\", \"assert process_grid([[0, -1], [-2, -3]]) == {'total_sum': -6, 'max_value': 0, 'squared_values': [0, 1, 4, 9]}\", \"assert process_grid([[5, 5], [5, 5]])... | {
"split": "train",
"index": 78899,
"acecode_id": "oss_12294",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.