data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "Given a string containing multiple lines of text, write a function `get_lines(text: str) -> List[str]` that returns a list of lines from the input string. Each line in the output list should not include any newline characters. The input string may contain different characters a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_lines('Hello\\\\nWorld') == ['Hello', 'World']\", \"assert get_lines('Line 1\\\\nLine 2\\\\nLine 3') == ['Line 1', 'Line 2', 'Line 3']\", \"assert get_lines('Single line') == ['Single line']\", \"assert get_lines('\\\\nFirst line\\\\nSecond line') == ['F... | {
"split": "train",
"index": 5600,
"acecode_id": "bigcode_python_fns_27125",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that constructs a model based on the given parameters. The function should take in four arguments: a dictionary `data` containing the keys 'age_specific_death_rate' (a list of floats) and 'locations' (a list of integers), a dictionary `lo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert construct_model({'age_specific_death_rate': [0.0], 'locations': [1]}, {'settings': {'model': {'default_age_grid': [0, 50], 'default_time_grid': [2000]}}, 'parent_location_id': 1}, [0.2], ['covariateA']) == {'nonzero_rates': [0.2], 'parent_location': 1, 'chil... | {
"split": "train",
"index": 5601,
"acecode_id": "bigcode_python_fns_8152",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `filter_and_count_bmps` that filters out integers that are less than a specified threshold and counts how many integers remain after filtering. The function should take two parameters: a list of integers `data` and an integer `threshol... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_and_count_bmps([1, 2, 3, 4, 5], 3) == 3\", \"assert filter_and_count_bmps([10, 20, 30], 15) == 2\", \"assert filter_and_count_bmps([], 5) == 0\", \"assert filter_and_count_bmps([5, 6, 7, 8, 9], 10) == 0\", \"assert filter_and_count_bmps([0, 1, 2, 3, 4... | {
"split": "train",
"index": 5602,
"acecode_id": "bigcode_python_fns_36425",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a custom layout manager for a graphical user interface (GUI) application. The function should accept a list of widget items and an integer for the margin and spacing. The function should return a dictionary containing the l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert custom_layout_manager(['button1', 'button2'], 10, 5) == {'margin': 10, 'spacing': 5, 'items': ['button1', 'button2']}\", \"assert custom_layout_manager([], 0, 0) == {'margin': 0, 'spacing': 0, 'items': []}\", \"assert custom_layout_manager(['label'], 3, 2) =... | {
"split": "train",
"index": 5603,
"acecode_id": "oss_886",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a JSON object representing a JSON Web Token (JWT), which contains the claims 'header', 'payload', and 'signature'. Implement a function that takes this JWT JSON and a URL as input, constructs a new JWT by concatenating the encoded JWT with its signature, and retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_jwt_url({'header': 'header_data', 'payload': 'payload_data', 'signature': 'abcd1234'}, 'localhost:8000') == ('header_data.payload_data.abcd1234', 'Please run python -m http.server --bind localhost:8000 .')\", \"assert generate_jwt_url({'header': 'te... | {
"split": "train",
"index": 5604,
"acecode_id": "bigcode_python_fns_42029",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `set_busy_cursor` that simulates changing the cursor to a busy state when executing a given function. The function should take two parameters: `func`, a callable that represents the function to be executed, and `*args` and `**kwargs` which are the arguments... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_busy_cursor(lambda: 1 + 1) == 2\", \"assert set_busy_cursor(lambda x: x * 2, 5) == 10\", \"assert set_busy_cursor(lambda: 'Hello, World!') == 'Hello, World!'\", \"assert set_busy_cursor(lambda x, y: x + y, 3, 4) == 7\", \"assert set_busy_cursor(lambda: [... | {
"split": "train",
"index": 5605,
"acecode_id": "bigcode_python_fns_20286",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a formatted string based on user information. The function `generate_key_info` should take the following parameters: `name` (a string representing the user's name), `email` (a string representing the user's email), `comment... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_key_info('Alice', 'alice@example.com', 'First key', '2024-12-31') == 'Key-Type: rsa\\\\nKey-Length: 4096\\\\nKey-Usage: sign\\\\nName-Real: Alice\\\\nName-Email: alice@example.com\\\\nName-Comment: First key\\\\nExpire-Date: 2024-12-31\\\\n%%no-prot... | {
"split": "train",
"index": 5606,
"acecode_id": "bigcode_python_fns_37672",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program that extracts specific conditions from a given software license text. The license text is provided as a string, and the conditions are specified after the phrase \"the following conditions are met:\". Each condition is listed as a bullet p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_license_conditions('Redistribution is allowed if the following conditions are met:\\\\n- Condition one\\\\n- Condition two') == ['Condition one', 'Condition two']\", \"assert extract_license_conditions('No conditions specified.') == []\", \"assert ex... | {
"split": "train",
"index": 5607,
"acecode_id": "oss_35360",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `register_enum_flag` that registers a flag which can accept multiple string values from a given list of allowed values. The function takes the following parameters: `name` (a string representing the flag name), `default` (either a single ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert register_enum_flag('color', 'red', ['red', 'green', 'blue']) == {'color': ['red']}\", \"assert register_enum_flag('color', ['red'], ['red', 'green', 'blue']) == {'color': ['red']}\", \"assert register_enum_flag('color', 'RED', ['red', 'green', 'blue'], case_... | {
"split": "train",
"index": 5608,
"acecode_id": "bigcode_python_fns_25472",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a template rendering function that takes a template string and a dictionary of variables as input. The function should replace placeholders in the template with corresponding values from the dictionary. The placeholders are defined in the templa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert render_template('Hello, {{ name }}!', {'name': 'Alice'}) == 'Hello, Alice!'\", \"assert render_template('Your balance is {{ balance }} dollars.', {'balance': 100}) == 'Your balance is 100 dollars.'\", \"assert render_template('Welcome to {{ place }}.', {'pla... | {
"split": "train",
"index": 5609,
"acecode_id": "bigcode_python_fns_48382",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that validates an image resizing configuration. The configuration can be either a 'keep_aspect_ratio_resizer' or a 'fixed_shape_resizer'. For 'keep_aspect_ratio_resizer', you need to ensure that the minimum dimension is less than or e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_image_resizer_config({'keep_aspect_ratio_resizer': {'min_dimension': 100, 'max_dimension': 200}}) == True\", \"assert validate_image_resizer_config({'keep_aspect_ratio_resizer': {'min_dimension': 200, 'max_dimension': 200}}) == True\", \"assert vali... | {
"split": "train",
"index": 5610,
"acecode_id": "bigcode_python_fns_46618",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing pixel values of a grayscale image of size 28x28 (i.e., a total of 784 pixels). Your task is to write a function that normalizes these pixel values to be in the range [0, 1] and reshapes the image into a flat 1D array of length 784. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert preprocess_image_and_label([255] * 784, 9) == ([1.0] * 784, [0, 0, 0, 0, 0, 0, 0, 0, 0, 1])\", \"assert preprocess_image_and_label([10] * 784, 1) == ([0.0392156862745098] * 784, [0, 1, 0, 0, 0, 0, 0, 0, 0, 0])\", \"assert preprocess_image_and_label([50] * 78... | {
"split": "train",
"index": 5611,
"acecode_id": "oss_30406",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a string that represents a version reference in the format 'refs/tags/vX.Y.Z', where X, Y, and Z are non-negative integers. Your task is to implement a function that extracts and returns the version number in the format 'X.Y.Z' from the input string. If the input ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_version('refs/tags/v1.0.0') == '1.0.0'\", \"assert extract_version('refs/tags/v2.1.5') == '2.1.5'\", \"assert extract_version('refs/tags/v0.9.8') == '0.9.8'\", \"assert extract_version('refs/tags/v3.14.159') == '3.14.159'\", \"assert extract_version(... | {
"split": "train",
"index": 5612,
"acecode_id": "bigcode_python_fns_21737",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes two lists of numbers (either integers or floats) as parameters and returns a new list that contains the element-wise multiplication of the two input lists. If the input lists are of different lengths, return an empty list. For example, given List1: [... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multiply_lists([1, 2, 3], [4, 5, 6]) == [4, 10, 18]\", \"assert multiply_lists([0, 1, 2], [3, 4, 5]) == [0, 4, 10]\", \"assert multiply_lists([1.5, 2.5], [2, 4]) == [3.0, 10.0]\", \"assert multiply_lists([], []) == []\", \"assert multiply_lists([1, 2, 3], [4... | {
"split": "train",
"index": 5613,
"acecode_id": "evol_25691",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, write a function that returns a new array where each element at index i is the product of all the numbers in the original array except the one at index i. You must not use division in your implementation and aim for a time complexity of O(n).\nPlease... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert solve([1, 2, 3, 4]) == [24, 12, 8, 6]\", \"assert solve([0, 1, 2, 3]) == [6, 0, 0, 0]\", \"assert solve([5, 1, 2, 3]) == [6, 30, 15, 10]\", \"assert solve([-1, -2, -3, -4]) == [-24, -12, -8, -6]\", \"assert solve([1, 0, 3, 4]) == [0, 12, 0, 0]\", \"assert so... | {
"split": "train",
"index": 5614,
"acecode_id": "evol_30657",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a Python function that checks if a given string is a valid hexadecimal color code. A valid hexadecimal color code starts with a '#' followed by either 6 or 3 hexadecimal characters (0-9, A-F, a-f). The function should return True if the input string is a valid hexadec... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_hex_color('#FFFFFF') == True\", \"assert is_hex_color('#000000') == True\", \"assert is_hex_color('#123456') == True\", \"assert is_hex_color('#ABC') == True\", \"assert is_hex_color('#abc') == True\", \"assert is_hex_color('#FF5733') == True\", \"assert ... | {
"split": "train",
"index": 5615,
"acecode_id": "evol_22162",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `apply_operations(lst)` that takes a list of integers and applies the following sequence of operations on each element: first square the element, then find the square root of the squared value, and finally round off the resultant value to the nearest intege... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert apply_operations([2, 5, 8]) == [2, 5, 8]\", \"assert apply_operations([4, 9, 16]) == [4, 9, 16]\", \"assert apply_operations([]) == []\", \"assert apply_operations(['a', 2, 3]) == []\", \"assert apply_operations([2.5, 3.5, 4.5]) == []\", \"assert apply_opera... | {
"split": "train",
"index": 5616,
"acecode_id": "evol_27935",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with allocating unique IDs within a specified inclusive range. Implement a function `allocate_ids` that takes two parameters: `start` and `end`, representing the range of IDs from `start` to `end`. The function should allocate and return a list of unique IDs in a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert allocate_ids(0, 5) == [0, 1, 2, 3, 4, 5]\", \"assert allocate_ids(1, 3) == [1, 2, 3]\", \"assert allocate_ids(5, 5) == [5]\", \"assert allocate_ids(10, 15) == [10, 11, 12, 13, 14, 15]\", \"assert allocate_ids(-3, 2) == [-3, -2, -1, 0, 1, 2]\", \"assert alloc... | {
"split": "train",
"index": 5617,
"acecode_id": "oss_17623",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `fibonacci(n: int) -> int` that computes the n-th Fibonacci number using memoization to optimize the calculation. The Fibonacci sequence is defined as follows: F(0) = 0, F(1) = 1, and F(n) = F(n-1) + F(n-2) for n > 1. Your function should return the n-th Fi... | 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": 5618,
"acecode_id": "evol_8785",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a tag cloud for a document management system. You are given two lists of tags: `new_tags` and `old_tags`. The `new_tags` list contains tags that are currently being added or updated, while the `old_tags` list contains tags that were previously assoc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_tags(['python', 'java', 'c++'], ['java']) == [('c++', 1), ('python', 1)]\", \"assert count_tags(['python', 'python', 'java'], ['java', 'java']) == [('python', 2)]\", \"assert count_tags([], ['java']) == []\", \"assert count_tags(['ruby', 'python'], ['p... | {
"split": "train",
"index": 5619,
"acecode_id": "bigcode_python_fns_16834",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two strings representing commit hashes, `base_commit` and `head_commit`, and a string `subdir` that represents a directory path. Your task is to implement a function `get_changed_files(base_commit: str, head_commit: str, subdir: str = '.') -> List[str]` that simul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_changed_files('abc123', 'def456', '.') == ['file1.txt', 'file2.txt']\", \"assert get_changed_files('ghi789', 'jkl012', '.') == ['file3.txt', 'file4.txt']\", \"assert get_changed_files('abc123', 'ghi789', '.') == []\", \"assert get_changed_files('def456',... | {
"split": "train",
"index": 5620,
"acecode_id": "bigcode_python_fns_36972",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that counts the number of occurrences of a specific integer in a given list of integers. Your function should take two parameters: a list of integers and the target integer to count. The function should return the count of how many ti... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_occurrences([1, 2, 3, 1, 2, 1], 1) == 3\", \"assert count_occurrences([1, 2, 3, 4, 5], 6) == 0\", \"assert count_occurrences([], 1) == 0\", \"assert count_occurrences([1, 1, 1, 1], 1) == 4\", \"assert count_occurrences([2, 3, 4, 2, 2, 2], 2) == 4\", \"... | {
"split": "train",
"index": 5621,
"acecode_id": "oss_26550",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing file sizes in bytes. Write a function that calculates the total size of all files in the list and returns this total size. If the list is empty, return 0.\nPlease reason step by step, then write a self-contained Python solution. Giv... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert total_file_size([]) == 0\", \"assert total_file_size([100, 200, 300]) == 600\", \"assert total_file_size([1, 1, 1, 1, 1]) == 5\", \"assert total_file_size([0]) == 0\", \"assert total_file_size([10, 20, 30, 40]) == 100\", \"assert total_file_size([50, 150, 25... | {
"split": "train",
"index": 5622,
"acecode_id": "bigcode_python_fns_39253",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a byte stream representing a file, implement a function `is_excel_file(stream: bytes) -> bool` that returns `True` if the byte stream is a readable Excel file (either .xls or .xlsx), and `False` otherwise. You may assume the byte stream is provided in valid bytes format. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_excel_file(b'\\\\x50\\\\x4b\\\\x03\\\\x04\\\\x14\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\... | {
"split": "train",
"index": 5623,
"acecode_id": "bigcode_python_fns_29506",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of integers and returns the maximum integer value from that list. If the list is empty, the function should return None. Implement the function `find_maximum(lst)` where `lst` is a list of integers. Your function should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_maximum([1, 3, 5, 7, 9]) == 9\", \"assert find_maximum([-1, -3, -5, -7, -9]) == -1\", \"assert find_maximum([-1, 0, 1]) == 1\", \"assert find_maximum([0, 0, 0]) == 0\", \"assert find_maximum([5]) == 5\", \"assert find_maximum([]) == None\", \"assert fin... | {
"split": "train",
"index": 5624,
"acecode_id": "oss_29455",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two arrays of strings, implement a function that merges the arrays, removes any duplicates, and sorts the merged result in reverse lexicographical order. However, only include strings that contain alphabetic characters without any numerical values or special characters. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_strings(['hello', 'world'], ['python', 'code']) == ['world', 'python', 'hello', 'code']\", \"assert sort_strings(['123', '@@', 'abc'], ['def', 'ghi']) == ['ghi', 'def', 'abc']\", \"assert sort_strings(['same', 'same', 'same'], ['same', 'same']) == ['sam... | {
"split": "train",
"index": 5625,
"acecode_id": "evol_2870",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function that converts a given decimal integer into its equivalent hexadecimal representation. The function should take a single integer as input and return its hexadecimal string without the '0x' prefix.\nPlease reason step by step, then write a self-contained Pyth... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dec_to_hex(0) == '0'\", \"assert dec_to_hex(1) == '1'\", \"assert dec_to_hex(10) == 'a'\", \"assert dec_to_hex(15) == 'f'\", \"assert dec_to_hex(16) == '10'\", \"assert dec_to_hex(255) == 'ff'\", \"assert dec_to_hex(256) == '100'\", \"assert dec_to_hex(511) ... | {
"split": "train",
"index": 5626,
"acecode_id": "evol_30965",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function called `get_max_sum` that takes a list of integers as input and returns the maximum sum of any contiguous subarray within that list. A contiguous subarray is defined as a sequence of adjacent elements in the array. If the input list i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_max_sum([-2, 1, -3, 4, -1, 2, 1, -5, 4]) == 6\", \"assert get_max_sum([1, 2, 3, 4]) == 10\", \"assert get_max_sum([-1, -2, -3, -4]) == -1\", \"assert get_max_sum([5, 4, -1, 7, 8]) == 23\", \"assert get_max_sum([0, 0, 0, 0]) == 0\", \"assert get_max_sum([... | {
"split": "train",
"index": 5627,
"acecode_id": "oss_13321",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that upgrades a given filesystem path. The function takes a string representing the filesystem path and returns a string indicating the status of the upgrade operation. If the upgrade is successful, return 'Upgrade successful'. If the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert upgrade_filesystem('/valid/path') == 'Upgrade successful'\", \"assert upgrade_filesystem('/another/valid/path') == 'Upgrade successful'\", \"assert upgrade_filesystem('') == 'Invalid path'\", \"assert upgrade_filesystem('/invalid/path*') == 'Invalid path'\",... | {
"split": "train",
"index": 5628,
"acecode_id": "bigcode_python_fns_41046",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with validating a gene identifier and its corresponding namespace. Given a list of valid gene symbols and a query to check, implement a function that takes the following inputs: a list of valid gene symbols, a queried identifier, and its namespace. The function s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_gene_identifier(['geneA', 'geneB', 'geneC'], 'geneA', 'HGNC') == ('HGNC', 'geneA', 'geneA')\", \"assert validate_gene_identifier(['geneA', 'geneB', 'geneC'], 'geneX', 'HGNC') == ('HGNC', 'geneX', 'geneX')\", \"assert validate_gene_identifier(['geneA... | {
"split": "train",
"index": 5629,
"acecode_id": "bigcode_python_fns_9571",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of pet names and returns a formatted string that lists the pets in a human-readable way. The function should accept a list of strings, each representing a pet's name, and return a string in the format: 'Pets: pet1, pet2,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert list_pets(['Buddy', 'Max', 'Bella']) == 'Pets: Buddy, Max, Bella.'\", \"assert list_pets(['Charlie']) == 'Pets: Charlie.'\", \"assert list_pets(['Luna', 'Lucy']) == 'Pets: Luna, Lucy.'\", \"assert list_pets([]) == 'No pets available.'\", \"assert list_pets([... | {
"split": "train",
"index": 5630,
"acecode_id": "bigcode_python_fns_24747",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the deletion of a recipe from a user's collection. The function will take two integer inputs: `category_id` and `recipe_id`, which represent the category and unique identifier of the recipe to be deleted, respectively. The ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delete_a_recipe(1, 1) == 'Recipe deleted successfully'\", \"assert delete_a_recipe(1, 2) == 'Invalid recipe ID'\", \"assert delete_a_recipe(2, 1) == 'Recipe deleted successfully'\", \"assert delete_a_recipe(3, 3) == 'Invalid recipe ID'\", \"assert delete_a_r... | {
"split": "train",
"index": 5631,
"acecode_id": "bigcode_python_fns_39828",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that performs a binary search on a sorted list of integers, which can include both negative and positive numbers, as well as zero. The function should return the index of the target integer if it is found in the list; otherwise, return -1. The function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binary_search([-4, -2, 0, 6, 7, 8], 6) == 3\", \"assert binary_search([-4, -2, 0, 6, 7, 8], -4) == 0\", \"assert binary_search([-4, -2, 0, 6, 7, 8], 8) == 5\", \"assert binary_search([-4, -2, 0, 6, 7, 8], -2) == 1\", \"assert binary_search([-4, -2, 0, 6, 7, ... | {
"split": "train",
"index": 5632,
"acecode_id": "evol_11068",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that calculates the average trade volume for a cryptocurrency pair within a specified time range based on a list of trades. Each trade is represented as a dictionary containing the following keys: 'timestamp' (a datetime object), '... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_trade_volume([], datetime(2021, 1, 1), datetime(2021, 1, 2)) == 0.0\", \"assert average_trade_volume([{ 'timestamp': datetime(2021, 1, 1, 12, 0, 0), 'volume': 1.0, 'count': 1 }], datetime(2021, 1, 1, 11, 0, 0), datetime(2021, 1, 1, 13, 0, 0)) == 1.0\... | {
"split": "train",
"index": 5633,
"acecode_id": "oss_24874",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a title, create a function that returns the title wrapped in Unicode characters. The function should accept a single string parameter, `title`, and return a Unicode representation of the title. The Unicode representation should be the original string... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert wrap_title('Hello') == '\\\\u202eHello\\\\u202e'\", \"assert wrap_title('\\u041b\\u0443\\u043d\\u0442\\u0438\\u043a') == '\\\\u202e\\u041b\\u0443\\u043d\\u0442\\u0438\\u043a\\\\u202e'\", \"assert wrap_title('Test Title') == '\\\\u202eTest Title\\\\u202e'\", ... | {
"split": "train",
"index": 5634,
"acecode_id": "bigcode_python_fns_18396",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function named `reconstruct_interpreter` that simulates the reconstruction of an interpreter. The function does not take any parameters and returns a string 'Interpreter Reconstructed'. This function is intended to represent the concept of loading or reconstructing ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reconstruct_interpreter() == 'Interpreter Reconstructed'\", \"assert reconstruct_interpreter() == 'Interpreter Reconstructed'\", \"assert reconstruct_interpreter() == 'Interpreter Reconstructed'\", \"assert reconstruct_interpreter() == 'Interpreter Reconstru... | {
"split": "train",
"index": 5635,
"acecode_id": "bigcode_python_fns_41262",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a configuration string and a server name as input. Your function should parse the configuration and return a tuple containing the server name and a list of entities represented in the configuration. The entity list will be deri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert build_entity_bucket('entity1, entity2, entity3', 'Server1') == ('Server1', ['entity1', 'entity2', 'entity3'])\", \"assert build_entity_bucket(' entity1 , entity2 ', 'Server2') == ('Server2', ['entity1', 'entity2'])\", \"assert build_entity_bucket('entityA'... | {
"split": "train",
"index": 5636,
"acecode_id": "bigcode_python_fns_26158",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of tuples, where each tuple contains the height and width of a rectangle, write a function that computes the aspect ratio of each rectangle. The aspect ratio is defined as the width divided by the height. The function should return a list of the computed aspect rat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_aspect_ratios([(10, 20), (15, 45), (0, 5)]) == [2.0, 3.0, 'undefined']\", \"assert compute_aspect_ratios([(5, 5), (10, 10), (20, 5)]) == [1.0, 1.0, 0.25]\", \"assert compute_aspect_ratios([(1, 2)]) == [2.0]\", \"assert compute_aspect_ratios([(3, 9), ... | {
"split": "train",
"index": 5637,
"acecode_id": "bigcode_python_fns_38276",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of decimal numbers. Implement a function that sorts both lists independently using bubble sort and returns a combined sorted list. The function should take two parameters: list1 and list2, which are the two lists to be sorted. The bubble sort algorithm m... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bubble_sort_and_combine([5.5, 3.3, 8.8], [2.2, 1.1, 4.4]) == [1.1, 2.2, 3.3, 4.4, 5.5, 8.8]\", \"assert bubble_sort_and_combine([1.0, 2.0, 3.0], [6.0, 5.0, 4.0]) == [1.0, 2.0, 3.0, 4.0, 5.0, 6.0]\", \"assert bubble_sort_and_combine([], []) == []\", \"assert ... | {
"split": "train",
"index": 5638,
"acecode_id": "evol_21903",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to determine the number of lives remaining for a player in a simple game after a ball has reached the bottom of a window a specified number of times. The function should take in three parameters: an integer representing the current nu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remaining_lives(3, 1, 5) == 2\", \"assert remaining_lives(3, 3, 5) == 0\", \"assert remaining_lives(5, 0, 5) == 5\", \"assert remaining_lives(5, 1, 5) == 4\", \"assert remaining_lives(1, 1, 5) == 0\", \"assert remaining_lives(0, 1, 5) == 0\", \"assert remain... | {
"split": "train",
"index": 5639,
"acecode_id": "oss_31409",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given five distinct integers, implement a function `median_of_five(a: int, b: int, c: int, d: int, e: int) -> int` that calculates and returns the median of the five numbers. The median is the middle number when the numbers are sorted in ascending order. If the input numbers ar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert median_of_five(1, 3, 5, 7, 9) == 5\", \"assert median_of_five(10, 20, 30, 40, 50) == 30\", \"assert median_of_five(-1, -2, -3, -4, -5) == -3\", \"assert median_of_five(5, 4, 3, 2, 1) == 3\", \"assert median_of_five(100, 200, 300, 400, 500) == 300\", \"assert... | {
"split": "train",
"index": 5640,
"acecode_id": "evol_32556",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `prime_vowels(s: str) -> bool` that determines if the number of vowels (a, e, i, o, u) in the input string `s` is a prime number. The function should ignore case and consider only the vowels. Return `True` if the count of vowels is a prime number, otherwise... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert prime_vowels('aeiou') == True\", \"assert prime_vowels('abcde') == True\", \"assert prime_vowels('How many vowels?') == False\", \"assert prime_vowels('Python programming') == False\", \"assert prime_vowels('') == False\", \"assert prime_vowels('Vowels are f... | {
"split": "train",
"index": 5641,
"acecode_id": "evol_31845",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a list of time stamps represented as strings in the format 'HH:MM:SS'. Your task is to calculate the average time difference in seconds between consecutive time stamps in the list. You can assume that the list contains at least two time stamps, and that they are i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_time_difference(['12:00:00', '12:30:00', '13:00:00']) == 1800.0\", \"assert average_time_difference(['00:00:00', '00:01:00', '00:02:00', '00:03:00']) == 60.0\", \"assert average_time_difference(['01:00:00', '01:00:30', '01:01:00']) == 30.0\", \"asser... | {
"split": "train",
"index": 5642,
"acecode_id": "oss_27523",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers and an integer k, implement a function that shifts the array to the right by k positions. The shift should be performed in-place, and the function should return the modified array. If k is greater than the length of the array, it should wrap around. F... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shift_array([1, 2, 3, 4, 5], 3) == [3, 4, 5, 1, 2]\", \"assert shift_array([1, 2, 3, 4, 5], 5) == [1, 2, 3, 4, 5]\", \"assert shift_array([1, 2, 3, 4, 5], 0) == [1, 2, 3, 4, 5]\", \"assert shift_array([1], 1) == [1]\", \"assert shift_array([1, 2, 3, 4, 5], 1... | {
"split": "train",
"index": 5643,
"acecode_id": "evol_24",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to calculate the effective projection of an object in a three-dimensional space based on its spherical coordinates. The object's movement is defined by the spherical coordinates (distance, angle, and inclination) represented by the va... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculateProjection(5.0, 0.8, 0.6) == 2.4\", \"assert calculateProjection(10.0, 1.0, 1.0) == 10.0\", \"assert calculateProjection(3.0, 0.5, 0.5) == 0.75\", \"assert calculateProjection(1.0, 0.0, 1.0) == 0.0\", \"assert calculateProjection(7.0, 0.9, 0.5) == 3... | {
"split": "train",
"index": 5644,
"acecode_id": "oss_29206",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function that counts the Fibonacci numbers within a specified range, from startnum to endnum, that are also perfect squares. The function should only process integers within the range. Implement the function `count_fib_square_numbers(startnum: int, endnum: int) -> i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_fib_square_numbers(2, 3) == 0\", \"assert count_fib_square_numbers(0, 100) == 3\", \"assert count_fib_square_numbers(144, 144) == 1\", \"assert count_fib_square_numbers(0, 144) == 4\", \"assert count_fib_square_numbers(13, 21) == 0\", \"assert count_fi... | {
"split": "train",
"index": 5645,
"acecode_id": "evol_15073",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers and a batch size. Your task is to partition this list into smaller batches of the specified size. Each batch should be formed by taking elements sequentially from the list. If the number of elements in the list is not a multiple of the batch siz... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert partition_into_batches([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\", \"assert partition_into_batches([1, 2, 3], 1) == [[1], [2], [3]]\", \"assert partition_into_batches([], 3) == []\", \"assert partition_into_batches([10, 20, 30, 40, 50, 60], 3) == [[10, 2... | {
"split": "train",
"index": 5646,
"acecode_id": "bigcode_python_fns_33144",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a string of text as input and returns a new string where all spelling errors are corrected. You may use a predefined dictionary of correct words to identify and correct misspelled words. The function should be case-insensitive and should preserve... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert spell_check('The quick braown fox jumps over the layzy dog') == 'The quick brown fox jumps over the lazy dog'\", \"assert spell_check('Quick brawn fox') == 'Quick brown fox'\", \"assert spell_check('the quikc brown fox') == 'the quick brown fox'\", \"assert ... | {
"split": "train",
"index": 5647,
"acecode_id": "evol_17353",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates a password based on certain criteria. The function should be named `generate_password` and should take a single parameter, `length`, which represents the desired length of the password. The generated password must meet ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_password(8) is not None\", \"assert len(generate_password(10)) == 10\", \"assert len(generate_password(12)) == 12\", \"assert generate_password(8).isalpha() == False\", \"assert generate_password(15).isalpha() == False\", \"assert generate_password(... | {
"split": "train",
"index": 5648,
"acecode_id": "oss_21459",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing an email address. Your task is to implement a function that validates whether the given email address is well-formed according to the following criteria: it must contain exactly one '@' symbol, at least one character before the '@', and a dom... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_email('example@example.com') == True\", \"assert validate_email('user@domain.co.uk') == True\", \"assert validate_email('name.surname@company.org') == True\", \"assert validate_email('firstname.lastname@sub.domain.com') == True\", \"assert validate_... | {
"split": "train",
"index": 5649,
"acecode_id": "bigcode_python_fns_28724",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given three lists of integers: `seqlet_H`, `seqlet_W`, and `seqlet_dna`. Your task is to create a function called `process_sequences` that takes these three lists as input and returns a list of tuples. Each tuple should contain the sum of corresponding elements from the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_sequences([1, 2, 3], [4, 5, 6], [7, 8, 9]) == [(1, 4, 7), (2, 5, 8), (3, 6, 9)]\", \"assert process_sequences([1, 2], [3, 4, 5], [6, 7, 8]) == []\", \"assert process_sequences([], [], []) == []\", \"assert process_sequences([10, 20, 30], [1, 2, 3], [... | {
"split": "train",
"index": 5650,
"acecode_id": "bigcode_python_fns_10037",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes a single email address as input and returns a boolean indicating whether the given email address is valid according to the following criteria: 1) It must start with a letter or a number, 2) It can contain letters, numbers, dots (.), underscore... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_email('example.user@gmail.com') == True\", \"assert validate_email('bad@example') == False\", \"assert validate_email('user@domain.com') == True\", \"assert validate_email('user@sub.domain.com') == True\", \"assert validate_email('user@domain.c') ==... | {
"split": "train",
"index": 5651,
"acecode_id": "evol_3581",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a tracking system for attributes in a Python program. The system should identify and track the usage of specific attributes within the program. The attributes to be tracked are denoted by comments in the code, using the format `$tracked=attr` or... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert track_attributes('$tracked=attr1 $tracked=attr2') == ['attr1', 'attr2']\", \"assert track_attributes('$tracked=attr1') == ['attr1']\", \"assert track_attributes('No tracked attributes here') == []\", \"assert track_attributes('$tracked=') == []\", \"assert t... | {
"split": "train",
"index": 5652,
"acecode_id": "oss_16407",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a list of design names in a project. Your task is to implement a function that returns a list of unique top-level design names sorted in alphabetical order. Each design name is a string. The function should take a list of design names as input and return a sorted ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_sorted_designs(['designA', 'designB', 'designA', 'designC']) == ['designA', 'designB', 'designC']\", \"assert get_unique_sorted_designs(['designX', 'designY', 'designZ', 'designX']) == ['designX', 'designY', 'designZ']\", \"assert get_unique_sorte... | {
"split": "train",
"index": 5653,
"acecode_id": "bigcode_python_fns_794",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of articles, where each article is represented by a dictionary containing various fields (e.g., title, author) and a list of citations. Each citation is a dictionary containing a value and a type. Your task is to create a function `convert_articles_to_csv_r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_articles_to_csv_rows([{'title': 'Article 1', 'author': 'Author A', 'citations': [{'value': 'Citation 1A', 'type': 'Type A'}, {'value': 'Citation 1B', 'type': 'Type B'}]}]) == [{'title': 'Article 1', 'author': 'Author A', 'citation': 'Citation 1A', 't... | {
"split": "train",
"index": 5654,
"acecode_id": "bigcode_python_fns_20564",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that generates a string consisting of a specified number of dollar signs ('$'). The function should take an integer n as input, which represents the number of dollar signs to include in the output string. If n is less than or equal to zero, the function should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_dollar_signs(0) == ''\", \"assert generate_dollar_signs(1) == '$'\", \"assert generate_dollar_signs(2) == '$$'\", \"assert generate_dollar_signs(3) == '$$$'\", \"assert generate_dollar_signs(4) == '$$$$'\", \"assert generate_dollar_signs(5) == '$$$$... | {
"split": "train",
"index": 5655,
"acecode_id": "evol_17379",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string `data` that represents a JSON serialized object, which may include embedded Python objects (like tuples, sets, etc.). Your task is to implement a function `decode(data: str) -> Any` that decodes the JSON string and returns the corresponding Python object.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decode('\\\"Hello, World!\\\"') == 'Hello, World!'\", \"assert decode('[1, 2, 3]') == [1, 2, 3]\", \"assert decode('{\\\"key\\\": \\\"value\\\"}') == {'key': 'value'}\", \"assert decode('{\\\"num\\\": 123}') == {'num': 123}\", \"assert decode('[]') == []\", ... | {
"split": "train",
"index": 5656,
"acecode_id": "bigcode_python_fns_26002",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a list of strings representing all the dates between a given start date and end date, inclusive. Each date should be formatted in ISO 8601 format (YYYY-MM-DD). Write a function `generate_date_list(start_date: str, end_date:... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_date_list('2023-01-01', '2023-01-03') == ['2023-01-01', '2023-01-02', '2023-01-03']\", \"assert generate_date_list('2023-02-28', '2023-03-02') == ['2023-02-28', '2023-03-01', '2023-03-02']\", \"assert generate_date_list('2023-03-01', '2023-03-01') =... | {
"split": "train",
"index": 5657,
"acecode_id": "bigcode_python_fns_38786",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of elements, implement a function that appends '5' to every integer in the list while leaving string and floating-point elements unchanged. The function should return a new list with the modified elements. Do not modify the original elements in the list.\nPlease re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert example_func([1, 2, 'hello', 2.0, 'world', 3.0]) == ['15', '25', 'hello', 2.0, 'world', 3.0]\", \"assert example_func([10, 20]) == ['105', '205']\", \"assert example_func(['test', 5, 3.5, 'example']) == ['test', '55', 3.5, 'example']\", \"assert example_func... | {
"split": "train",
"index": 5658,
"acecode_id": "evol_704",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that determines whether a given integer is even or not. The function should return `True` if the input integer is even and `False` if it is odd. The function must correctly handle both positive and negative integers. Implement ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert even(0) == True\", \"assert even(1) == False\", \"assert even(2) == True\", \"assert even(3) == False\", \"assert even(4) == True\", \"assert even(5) == False\", \"assert even(-1) == False\", \"assert even(-2) == True\", \"assert even(-3) == False\", \"asser... | {
"split": "train",
"index": 5659,
"acecode_id": "oss_11626",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that adjusts the volume of a media player. The volume can be set between 0 and 2, inclusive. Your function should take a floating-point number as an input and return a string indicating whether the volume was successfully set, or if t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_volume(0.0) == 'Volume set to 0.0'\", \"assert set_volume(1.0) == 'Volume set to 1.0'\", \"assert set_volume(2.0) == 'Volume set to 2.0'\", \"assert set_volume(0.5) == 'Volume set to 0.5'\", \"assert set_volume(1.5) == 'Volume set to 1.5'\", \"assert set... | {
"split": "train",
"index": 5660,
"acecode_id": "bigcode_python_fns_15298",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the SHA-256 hash of a given string input and compares it with a reference hash to determine if the string's integrity is intact. Implement a function `check_string_integrity(input_string: str, reference_hash: bytes) ->... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_string_integrity('hello', b'\\\\x2c\\\\x4e\\\\x6a\\\\x8e\\\\x5a\\\\x8e\\\\x7b\\\\xb8\\\\xd9\\\\x0f\\\\x45\\\\x26\\\\x2f\\\\xc3\\\\x8c\\\\x3e\\\\xe8\\\\xf9\\\\x6f\\\\xf8\\\\x0f\\\\x2d\\\\x05\\\\x0e\\\\x77\\\\x2a\\\\x84\\\\x5a\\\\x3a\\\\x77\\\\xd9\\\\x56... | {
"split": "train",
"index": 5661,
"acecode_id": "oss_20712",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates various scenarios based on given specifications. Your function should take a dictionary of named scenarios and return a list of tuples, where each tuple contains the parameters needed for the simulation. Each named scenario... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_simulation_parametrization({'scenario1': {'is_resumed': 'fall', 'save_last_states': False, 'n_seeds': 2, 'sim_input_scenario': 'input1', 'params_scenario': 'params1', 'start_date': '2023-01-01', 'end_date': '2023-01-10'}}) == [( {'initial_states': Non... | {
"split": "train",
"index": 5662,
"acecode_id": "bigcode_python_fns_3348",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of text strings and reverses the sequence of characters in each string while preserving the original order of the list. Each string should not exceed 500 characters. The function should return a new list containing the reversed strings.\nP... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_strings(['Hello', 'World']) == ['olleH', 'dlroW']\", \"assert reverse_strings(['Python', 'Programming']) == ['nohtyP', 'gnimmargorP']\", \"assert reverse_strings(['a', 'b', 'c']) == ['a', 'b', 'c']\", \"assert reverse_strings(['Single']) == ['elgniS'... | {
"split": "train",
"index": 5663,
"acecode_id": "evol_1379",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of words, write a Python function that takes this list as input and returns a new list containing the lengths of each word in the original list. Your function should handle empty strings and single-character words correctly. The function signature is: `def word_len... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert word_lengths(['apple', 'banana', 'cherry']) == [5, 6, 6]\", \"assert word_lengths(['', 'a', 'ab', 'abc']) == [0, 1, 2, 3]\", \"assert word_lengths(['hello', 'world']) == [5, 5]\", \"assert word_lengths(['x', 'y', 'z']) == [1, 1, 1]\", \"assert word_lengths([... | {
"split": "train",
"index": 5664,
"acecode_id": "oss_23141",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a nested tuple structure representing a phrase, where each phrase is defined as a tuple containing three elements: (source, target, relation), implement a function `get_head_path(phrase)` that will yield all phrases along the path to the right-most item (the head) of the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_head_path(('A', ('B', ('C', 'D', 'modifies'), 'modifies'), 'modifies')) == [('A', ('B', ('C', 'D', 'modifies'), 'modifies'), 'modifies'), ('B', ('C', 'D', 'modifies'), 'modifies'), ('C', 'D', 'modifies'), 'D']\", \"assert get_head_path(('X', ('Y', 'Z', '... | {
"split": "train",
"index": 5665,
"acecode_id": "bigcode_python_fns_49218",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of numbers, `x_axis` and `y_axis`, where `x_axis` represents the x-coordinates and `y_axis` represents the corresponding y-coordinates of a curve. Your task is to implement a function `calculate_AUC(x_axis: List[float], y_axis: List[float]) -> float` tha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert abs(calculate_AUC([0, 1, 2], [0, 2, 4]) - 4.0) < 1e-9\", \"assert abs(calculate_AUC([1, 1, 1], [1, 2, 1]) - 0.0) < 1e-9\", \"assert abs(calculate_AUC([0, 0, 0], [0, 0, 0]) - 0.0) < 1e-9\", \"assert abs(calculate_AUC([1, 2], [3, 3]) - 3.0) < 1e-9\", \"assert ... | {
"split": "train",
"index": 5666,
"acecode_id": "bigcode_python_fns_48852",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function named `find_object_by_id` that searches for an object by its ID within a predefined list of objects. Each object in the list is represented as a dictionary with a unique 'id' key. Your function should take an integer `id` as input and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_object_by_id(1) == {'id': 1, 'name': 'Object A'}\", \"assert find_object_by_id(2) == {'id': 2, 'name': 'Object B'}\", \"assert find_object_by_id(3) == {'id': 3, 'name': 'Object C'}\", \"assert find_object_by_id(4) == None\", \"assert find_object_by_id(6... | {
"split": "train",
"index": 5667,
"acecode_id": "oss_5527",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a string s, determine if it is a 'super happy' string. A 'super happy' string meets the following criteria: 1. The string must be at least 6 characters long. 2. The string can be divided into groups of 3 consecutive characters that are identical. 3. Each unique character ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert(is_super_happy('ababab') == False)\", \"assert(is_super_happy('aaabbbccc') == True)\", \"assert(is_super_happy('aaa') == False)\", \"assert(is_super_happy('abcabc') == False)\", \"assert(is_super_happy('cccccc') == True)\", \"assert(is_super_happy('aabbcc') ... | {
"split": "train",
"index": 5668,
"acecode_id": "evol_24799",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Determine if two given strings are anagrams of each other, considering that uppercase and lowercase letters are treated as different characters. An anagram is a word or phrase formed by rearranging the letters of a different word or phrase, using all the original letters exactl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_anagram('listen', 'silent') == True\", \"assert is_anagram('triangle', 'integral') == True\", \"assert is_anagram('apple', 'pale') == False\", \"assert is_anagram('Dormitory', 'Dirty Room') == False\", \"assert is_anagram('aabbcc', 'abcabc') == True\", \"... | {
"split": "train",
"index": 5669,
"acecode_id": "evol_10474",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple guessing game function in Python. Your task is to create a function `guess_number(target: int, number: int) -> str` that takes two integers as input: a target number and a guessed number. The function should return a string based on the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert guess_number(50, 40) == 'LOW'\", \"assert guess_number(50, 60) == 'HIGH'\", \"assert guess_number(50, 50) == 'BINGO'\", \"assert guess_number(75, 60) == 'LOW'\", \"assert guess_number(75, 90) == 'HIGH'\", \"assert guess_number(75, 75) == 'BINGO'\", \"assert ... | {
"split": "train",
"index": 5670,
"acecode_id": "oss_18401",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of requests made to a specific endpoint over a range of days. Each request has a timestamp and a count indicating how many requests were made at that time. Your task is to implement a function `get_hourly_load(requests: List[Tuple[str, int]], start_date: st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_hourly_load([], '2023-10-01', '2023-10-01') == {'days': ['2023-10-01'], 'data': [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]}\", \"assert get_hourly_load([('2023-10-01 00:00:00', 1)], '2023-10-01', '2023-10-01') == {'days': ... | {
"split": "train",
"index": 5671,
"acecode_id": "bigcode_python_fns_10869",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given the root of a binary search tree and an integer key, implement a function to delete the node corresponding to the key from the binary search tree. The function should return the root of the modified tree after the deletion. If the key does not exist in the tree, the tree ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert deleteNode(Node(10), 10) is None\", \"assert deleteNode(Node(10), 5).data == 10\", \"assert deleteNode(Node(10), 20).data == 10\", \"assert deleteNode(Node(10), 2).data == 10\", \"assert deleteNode(Node(10), 8).data == 10\", \"assert deleteNode(Node(10), 15)... | {
"split": "train",
"index": 5672,
"acecode_id": "evol_34645",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a string, write a function that determines the word that appears most frequently in the string, excluding common English words such as 'the', 'is', 'in', and others. The function should ignore case variations of the words as well. Write a function called `find_most_freque... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_most_frequent_word('This is a sample string containing a few words, where a few words are repeated several times') == 'few'\", \"assert find_most_frequent_word('Hello world hello') == 'hello'\", \"assert find_most_frequent_word('Sample text with some co... | {
"split": "train",
"index": 5673,
"acecode_id": "evol_28223",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that returns the most frequently occurring integer in the list. If there is a tie for the most frequent integer, return the first one that appears in the list. If the list is empty, return None.\nPlease reason step by step, then wr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_most_frequent([1, 2, 3, 3, 2, 2, 2, 1, 1, 4]) == 2\", \"assert find_most_frequent([4, 4, 5, 5, 5, 4]) == 5\", \"assert find_most_frequent([1, 1, 1, 2, 2, 3]) == 1\", \"assert find_most_frequent([1]) == 1\", \"assert find_most_frequent([]) == None\", \"a... | {
"split": "train",
"index": 5674,
"acecode_id": "evol_24393",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a network object. The function should perform the following operations: \n1. Initialize a network object with a name attribute set to 'Normal'. \n2. Allow setting the name attribute to a new value. \n3. Retrieve the cur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert network_object_operations([('get',)]) == ['Normal']\", \"assert network_object_operations([('set', 'NewNetwork'), ('get',)]) == ['NewNetwork']\", \"assert network_object_operations([('set', 'AnotherName'), ('get',), ('set', 'FinalName'), ('get',)]) == ['Anot... | {
"split": "train",
"index": 5675,
"acecode_id": "oss_32115",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function `check_string(input_string: str) -> bool` that checks if the input string consists entirely of alphabetical characters (a-z, A-Z) and does not contain any numbers, symbols, or whitespace. The function should return True if the string is valid, and False oth... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_string('HelloWorld') == True\", \"assert check_string('hello') == True\", \"assert check_string('WORLD') == True\", \"assert check_string('Hello World') == False\", \"assert check_string('Hello123') == False\", \"assert check_string('Hello!') == False\... | {
"split": "train",
"index": 5676,
"acecode_id": "evol_16120",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `most_frequent_word(text: str) -> str` that finds the most frequently used word in a given text. The function should ignore case sensitivity and special characters (only letters and numbers should be considered as part of words). The function must not use a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert most_frequent_word('Hello world! Hello everyone.') == 'hello'\", \"assert most_frequent_word('Python is great. Python is fun!') == 'python'\", \"assert most_frequent_word('Data science is fun. Science is great.') == 'science'\", \"assert most_frequent_word('... | {
"split": "train",
"index": 5677,
"acecode_id": "evol_33365",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a string as input and removes all occurrences of a specified prefix from the string. The function should return the modified string after all prefixes have been removed. You need to implement a function called `remove_prefixes(... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_prefixes('experimental factor ontology', 'experimental ') == 'factor ontology'\", \"assert remove_prefixes('factor ontology', 'experimental ') == 'factor ontology'\", \"assert remove_prefixes('data science', 'data ') == 'science'\", \"assert remove_pr... | {
"split": "train",
"index": 5678,
"acecode_id": "bigcode_python_fns_7073",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D list of integers representing a grid of values and an integer `fwhm`. Your task is to implement a function `smooth_grid` that applies a Gaussian smoothing filter to each element in the grid based on the `fwhm` value. The smoothing operation should consider al... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert smooth_grid([[1]], 1) == [[1.0]]\", \"assert smooth_grid([[1, 1], [1, 1]], 1) == [[1.0, 1.0], [1.0, 1.0]]\", \"assert smooth_grid([[1]], 2) == [[1.0]]\", \"assert smooth_grid([[5], [10], [15]], 1) == [[7.5], [10.0], [12.5]]\", \"assert smooth_grid([[1, 1], [... | {
"split": "train",
"index": 5679,
"acecode_id": "bigcode_python_fns_49647",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a monthly salary and a dictionary of budget splits representing various expense categories and their corresponding percentages, write a function `calculate_budget(salary, budget_splits)` that calculates the amount spent on each category, the amount for 'others', and the s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_budget(5000, {'groceries': 0.25, 'rent': 0.50}) == {'groceries': 1250.0, 'rent': 2500.0, 'others': 0.0, 'savings': 1250.0}\", \"assert calculate_budget(3000, {'leisure': 0.10, 'transportation': 0.20}) == {'leisure': 300.0, 'transportation': 600.0, ... | {
"split": "train",
"index": 5680,
"acecode_id": "evol_33003",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You need to create a Python function that extracts version number and copyright information from a given string representing the content of a file. The content will always start with a comment line in the format `# __init__.py/{Feature Name}, Version {Version Number} (C) Copyri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_info('# __init__.py/Open GoPro, Version 2.0 (C) Copyright 2021 GoPro, Inc. (http://gopro.com/OpenGoPro).') == {'feature_name': 'Open GoPro', 'version_number': '2.0', 'copyright_year': '2021', 'company_name': 'GoPro, Inc.'}\", \"assert extract_info('#... | {
"split": "train",
"index": 5681,
"acecode_id": "oss_26188",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string s, implement a function that returns the mirror image of the string. The mirror image of a string is defined as the string read in reverse order. For example, if the input string is 'hello', the output should be 'olleh'. Implement the function `mirror_string(s)` ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert mirror_string('hello') == 'olleh'\", \"assert mirror_string('world') == 'dlrow'\", \"assert mirror_string('Python') == 'nohtyP'\", \"assert mirror_string('12345') == '54321'\", \"assert mirror_string('!@#$%') == '%$#@!'\", \"assert mirror_string('') == ''\",... | {
"split": "train",
"index": 5682,
"acecode_id": "evol_28359",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers `prices`, where `prices[i]` represents the cost of a stock on the `ith` day, and an integer `fee` which represents the brokerage fee for each transaction. Your task is to implement a function `maxProfit(prices: List[int], fee: int) -> int` that ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert maxProfit([1,3,2,8,4,9], 2) == 8\", \"assert maxProfit([1,3,7,5,10,3], 3) == 6\", \"assert maxProfit([5, 4, 3, 2, 1], 1) == 0\", \"assert maxProfit([1, 2, 3], 0) == 2\", \"assert maxProfit([1, 1, 1, 1], 1) == 0\", \"assert maxProfit([50, 40, 30, 20, 10], 2) ... | {
"split": "train",
"index": 5683,
"acecode_id": "evol_26726",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a custom exception handling mechanism for a SCORM (Sharable Content Object Reference Model) compliant e-learning platform. Create a Python class `ScormException` that inherits from the built-in `Exception` class. This custom exception class shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert ScormException().message == 'An error occurred in the SCORM framework'\", \"assert ScormException('Custom error message').message == 'Custom error message'\", \"assert isinstance(ScormException(), ScormException) == True\", \"assert isinstance(ScormException... | {
"split": "train",
"index": 5684,
"acecode_id": "oss_25124",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of integers. Your function should take a list of integers as input and return a new list containing only the even numbers from the input list, sorted in ascending order. If there are no even numbers in the inp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_and_sort_evens([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_and_sort_evens([10, 5, 1, 3, 6]) == [6, 10]\", \"assert filter_and_sort_evens([7, 9, 11]) == []\", \"assert filter_and_sort_evens([2, 4, 6, 8]) == [2, 4, 6, 8]\", \"assert filter_and_sort_ev... | {
"split": "train",
"index": 5685,
"acecode_id": "oss_30377",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D grid of integers where each cell represents a piece of land, and the value in each cell indicates the continent to which it belongs. A continent is defined as a connected region of land cells with the same value. Your task is to implement a function `largestC... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert largestContinent([[1]]) == 1\", \"assert largestContinent([[0, 0], [0, 0]]) == 4\", \"assert largestContinent([[9, 9, 9], [9, 1, 9], [9, 9, 9]]) == 8\", \"assert largestContinent([[1, 2], [3, 4]]) == 1\", \"assert largestContinent([[1, 1, 1], [1, 1, 0], [0, ... | {
"split": "train",
"index": 5686,
"acecode_id": "oss_4468",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `get_media_type_and_year(dvd_title: str, year: str) -> Tuple[str, str]`. This function should take in a movie or TV show title (`dvd_title`) and an optional release year (`year`) and return a tuple containing the media type (either 'movie... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_media_type_and_year('Inception', '') == ('movie', '2010')\", \"assert get_media_type_and_year('Breaking Bad', '') == ('series', '2008')\", \"assert get_media_type_and_year('The Office', '') == ('series', '2005')\", \"assert get_media_type_and_year('Inter... | {
"split": "train",
"index": 5687,
"acecode_id": "bigcode_python_fns_16221",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function called `replace_special_symbols` that takes a string as input and transforms each unique special symbol present in the string into its corresponding ASCII numerical equivalent. Special symbols are defined as any character that is not a letter or a number... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_special_symbols('Hello@World!') == 'Hello64World33'\", \"assert replace_special_symbols('No special symbols here') == 'No special symbols here'\", \"assert replace_special_symbols('Spaces are fine ') == 'Spaces are fine '\", \"assert replace_spec... | {
"split": "train",
"index": 5688,
"acecode_id": "evol_31553",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing data related to molecules and their spectral information. You are given two dictionaries: `candidates` and `df_spec2model`. The `candidates` dictionary contains prediction lists for different models, where each prediction list is a set of tuples. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_data({1: {1, ('cid1', 'smi1'), ('cid2', 'smi2')}, 2: {2, ('cid3', 'smi3'), ('cid4', 'smi4')}}, {1: [('acc1', 'cid1', 1, 1, 'key1'), ('acc2', 'cid2', 2, 1, 'key2')], 2: [('acc3', 'cid3', 1, 2, 'key3'), ('acc4', 'cid4', 2, 2, 'key4')]}) == ({'cid1', 'c... | {
"split": "train",
"index": 5689,
"acecode_id": "oss_1738",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given three integers x, y, and z, write a function that calculates the Least Common Multiple (LCM) of these three numbers. You must ensure that the inputs are within the range of 1 to 10^9. Implement the function 'lcm_three_numbers(x: int, y: int, z: int) -> int'.\nPlease reaso... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lcm_three_numbers(4, 6, 8) == 24\", \"assert lcm_three_numbers(5, 15, 25) == 75\", \"assert lcm_three_numbers(3, 7, 14) == 42\", \"assert lcm_three_numbers(9, 18, 24) == 72\", \"assert lcm_three_numbers(12, 15, 21) == 420\", \"assert lcm_three_numbers(2, 3, ... | {
"split": "train",
"index": 5690,
"acecode_id": "evol_23818",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You have been given a dataset representing stock prices for a single day. The dataset is structured as a list of integers, where each integer represents the stock price at each hour of the trading day. Your task is to implement a function that determines if there was a time dur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_price_increased([100, 105, 102]) == True\", \"assert has_price_increased([50, 50, 50]) == False\", \"assert has_price_increased([10, 20, 30]) == True\", \"assert has_price_increased([90, 80, 70]) == False\", \"assert has_price_increased([1, 2, 3, 2, 4]) ... | {
"split": "train",
"index": 5691,
"acecode_id": "oss_6597",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates video playback controls based on keyboard input. The function should take an integer key code as input and return a string command based on the following rules: \n- If the input key code is 27, the function should retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert handle_key_press(27) == 'stop'\", \"assert handle_key_press(32) == 'toggle_play'\", \"assert handle_key_press(97) == 'prev_frame'\", \"assert handle_key_press(100) == 'next_frame'\", \"assert handle_key_press(65) == 'noop'\", \"assert handle_key_press(99) ==... | {
"split": "train",
"index": 5692,
"acecode_id": "oss_14219",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a migration for a model called `Theme`. The `Theme` model has a field named `time_end`, which needs to be altered to use a `DateTimeField` with a verbose name of `结束时间` (Chinese for 'end time'). Write a function that returns a migration code snippet... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert migration_code() == \\\"from django.db import migrations, models\\\\n\\\\nclass Migration(migrations.Migration):\\\\n\\\\n dependencies = [\\\\n ('yourappname', 'previous_migration_number'), # Replace 'yourappname' and 'previous_migration_number' ... | {
"split": "train",
"index": 5693,
"acecode_id": "oss_23615",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple task management system. The function, `manage_tasks`, will take a list of operations to perform on a task list. Each operation is represented as a tuple where the first element is a string indicating the action ('a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_tasks([('add', 'task1'), ('add', 'task2'), ('list', None)]) == ['task1: pending', 'task2: pending']\", \"assert manage_tasks([('add', 'task1'), ('complete', 'task1'), ('list', None)]) == ['task1: completed']\", \"assert manage_tasks([('add', 'task1'),... | {
"split": "train",
"index": 5694,
"acecode_id": "oss_19872",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a non-negative integer radius, write a function `create_kernel(radius: int, invert: bool) -> List[List[int]]` that generates a square binary kernel of size (2 * radius + 1) x (2 * radius + 1). The kernel should consist of 1s and 0s, where 1s represent points inside or on ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_kernel(0, False) == [[1]]\", \"assert create_kernel(0, True) == [[0]]\", \"assert create_kernel(1, False) == [[0, 1, 0], [1, 1, 1], [0, 1, 0]]\", \"assert create_kernel(1, True) == [[1, 0, 1], [0, 0, 0], [1, 0, 1]]\", \"assert create_kernel(2, False) ... | {
"split": "train",
"index": 5695,
"acecode_id": "bigcode_python_fns_29576",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with determining whether a user has permission to update a given record. The permission is governed by a simple rule: if the user is an admin or the user ID matches the record owner's ID, then the user has permission to update the record. Your function should ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_update_permission('user123', {'owner_id': 'user123', 'is_admin': False}) == True\", \"assert has_update_permission('user456', {'owner_id': 'user123', 'is_admin': False}) == False\", \"assert has_update_permission('admin_user', {'owner_id': 'user123', 'is... | {
"split": "train",
"index": 5696,
"acecode_id": "bigcode_python_fns_30574",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a dictionary of shot data and updates certain fields based on the information provided in a separate dictionary. Your function should handle cases where the shot data is missing and log a warning message in such instanc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_shot_data({}, 1, {'confirmed': True, 'double_check': False}, mock_logger) == None\", \"assert process_shot_data({1: {}}, 1, {'confirmed': True, 'double_check': False}, mock_logger) == None\", \"assert process_shot_data({1: {'revision_confirmed': Fals... | {
"split": "train",
"index": 5697,
"acecode_id": "oss_30918",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that determines the total number of freight shipments recorded in the month of September for a given dataset. Your function should take a list of tuples as input, where each tuple contains information about a shipment. Each tuple has the f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_freight_in_september([('001', 'Freight', 'New York', 'Los Angeles', 'September', 2014, 10), ('002', 'Freight', 'Chicago', 'Miami', 'September', 2014, 20), ('003', 'Passenger', 'Seattle', 'Denver', 'September', 2014, 15)]) == 30\", \"assert count_freigh... | {
"split": "train",
"index": 5698,
"acecode_id": "bigcode_python_fns_5610",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of datetime objects, implement a function that returns a list where each element represents the quarter of the year for the corresponding datetime in the input list. The quarters are defined as follows: January to March is Quarter 1, April to June is Quarter 2, Jul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert quarter_of_year([datetime(2023, 1, 15), datetime(2023, 4, 10), datetime(2023, 7, 20), datetime(2023, 10, 5)]) == [1, 2, 3, 4]\", \"assert quarter_of_year([datetime(2020, 2, 28), datetime(2020, 5, 1), datetime(2020, 8, 15), datetime(2020, 11, 30)]) == [1, 2, ... | {
"split": "train",
"index": 5699,
"acecode_id": "bigcode_python_fns_43348",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.