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 given a list of integers, and your task is to implement a function that determines the maximum value in this list. The function should return the maximum integer from the list. If the list is empty, return None. Write a function `find_maximum(nums: List[int]) -> Optiona...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_maximum([1, 2, 3, 4, 5]) == 5\", \"assert find_maximum([-1, -2, -3, -4, -5]) == -1\", \"assert find_maximum([5, 5, 5, 5]) == 5\", \"assert find_maximum([10]) == 10\", \"assert find_maximum([]) == None\", \"assert find_maximum([0, 0, 0]) == 0\", \"assert...
{ "split": "train", "index": 79900, "acecode_id": "bigcode_python_fns_43121", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a formula name and a set of terms, determine if the set of terms exactly matches the required terms for that formula. You are provided with a predefined mapping of formula names to their required terms. Implement a function that takes a string `formula_name` and a set of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert no_missing_terms('formula1', {'termA', 'termB', 'termC'}) == True\", \"assert no_missing_terms('formula1', {'termA', 'termB'}) == False\", \"assert no_missing_terms('formula2', {'termD', 'termE'}) == True\", \"assert no_missing_terms('formula2', {'termD', 't...
{ "split": "train", "index": 79901, "acecode_id": "bigcode_python_fns_8374", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given two positive integers p and q (where p <= q), an initial number (init), and a radix (base) ranging from 2 to 16 inclusive. Your task is to write a function that computes the product of all integers from p through q (inclusive), starting from the initial number ini...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert optimize_all_products(5, 3, 1, 2) == -1\", \"assert optimize_all_products(1, 1, 10, 2) == '0b1010'\", \"assert optimize_all_products(2, 6, -1, 3) == -1\", \"assert optimize_all_products(1, 10, 2, 1) == -1\", \"assert optimize_all_products(1, 3, 0, 2) == '0b0...
{ "split": "train", "index": 79902, "acecode_id": "evol_33746", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a graph represented as a list of dictionaries, where each dictionary corresponds to a node in the graph. The keys of the dictionary represent neighboring nodes and the values represent the weights of the edges connecting them. Your task is to implement a function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert graph_operations([{1: 2, 2: 1}, {2: 4, 3: 3}, {3: 8}, {4: 7}], 0, 1) == (True, 2, 2)\", \"assert graph_operations([{1: 2, 2: 1}, {2: 4, 3: 3}, {3: 8}, {4: 7}], 0, 2) == (True, 2, 1)\", \"assert graph_operations([{1: 2, 2: 1}, {2: 4, 3: 3}, {3: 8}, {4: 7}], 0...
{ "split": "train", "index": 79903, "acecode_id": "oss_1291", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a list of chromosome names as strings that represent the chromosomes of an organism. Your task is to implement a function that takes this list of chromosome names and returns the total number of chromosomes in the list as well as the list of unique chromosome name...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_chromosomes(['chr1', 'chr2', 'chr3']) == (3, ['chr1', 'chr2', 'chr3'])\", \"assert count_chromosomes(['chr1', 'chr1', 'chr1']) == (1, ['chr1'])\", \"assert count_chromosomes([]) == (0, [])\", \"assert count_chromosomes(['chrX', 'chrY', 'chrZ']) == (3, ...
{ "split": "train", "index": 79904, "acecode_id": "bigcode_python_fns_9795", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Create a function `check_sentence` that evaluates an input sentence for potential grammatical errors. The function should check the following criteria: 1. The sentence must start with a capital letter. 2. The sentence must end with a full stop. 3. There should be a space after ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_sentence('The quick brown fox jumps over the lazy dog.') == 'No grammatical errors detected.'\", \"assert check_sentence('the quick brown fox jumps over the lazy dog.') == 'Sentence should start with a capital letter.'\", \"assert check_sentence('The q...
{ "split": "train", "index": 79905, "acecode_id": "evol_20579", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given the sides of a triangle, compute the triangle's area. You need to implement a function `triangle_area(side1, side2=None, side3=None)` that calculates the area based on the following conditions: 1. If only one side is provided, it is assumed to be the side of an equilatera...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert triangle_area(4) == 6.928203230275509\", \"assert triangle_area(3, 4) == 6.0\", \"assert triangle_area(3, 5) == 7.5\", \"assert triangle_area(10, 5) == 25.0\", \"assert triangle_area(3, 4, 5) == 6.0\", \"assert triangle_area(5, 12, 13) == 30.0\", \"assert tr...
{ "split": "train", "index": 79906, "acecode_id": "evol_10967", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two integers, `start` and `end`, write a function `generate_primes(start: int, end: int) -> List[int]` that returns a list of all prime numbers within the inclusive range from `start` to `end`. A prime number is a natural number greater than 1 that cannot be formed by mul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_primes(1, 20) == [2, 3, 5, 7, 11, 13, 17, 19]\", \"assert generate_primes(10, 30) == [11, 13, 17, 19, 23, 29]\", \"assert generate_primes(0, 10) == [2, 3, 5, 7]\", \"assert generate_primes(15, 15) == []\", \"assert generate_primes(1, 1) == []\", \"a...
{ "split": "train", "index": 79907, "acecode_id": "oss_34571", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks if iterable unpacking of a given list is unnecessary. Unpacking is considered unnecessary if the list contains exactly one element; otherwise, it is necessary. Implement a function that takes a list of elements and returns...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_unnecessary_iterable_unpacking([5]) == True\", \"assert check_unnecessary_iterable_unpacking([1, 2, 3]) == False\", \"assert check_unnecessary_iterable_unpacking(['a']) == True\", \"assert check_unnecessary_iterable_unpacking([None]) == True\", \"asser...
{ "split": "train", "index": 79908, "acecode_id": "oss_25823", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that generates the Fibonacci sequence up to Fib(n) and returns a list of all prime Fibonacci numbers in that sequence. The Fibonacci sequence is defined as: Fib(0) = 0, Fib(1) = 1, and Fib(n) = Fib(n-1) + Fib(n-2) for n > 1. Remember to exclude non-prime Fi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci_primes(0) == []\", \"assert fibonacci_primes(1) == []\", \"assert fibonacci_primes(4) == [2, 3]\", \"assert fibonacci_primes(5) == [2, 3, 5]\", \"assert fibonacci_primes(6) == [2, 3, 5]\", \"assert fibonacci_primes(7) == [2, 3, 5, 13]\", \"assert f...
{ "split": "train", "index": 79909, "acecode_id": "evol_21862", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Implement a function that checks whether a given number is within a specified inclusive range. The function should take three parameters: an integer 'num', and two integers 'start' and 'end' that define the range. The function should return True if 'num' is within the range [st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_range(5, 2, 7) == True\", \"assert check_range(1, 2, 7) == False\", \"assert check_range(2, 2, 5) == True\", \"assert check_range(5, 2, 5) == True\", \"assert check_range(6, 2, 5) == False\", \"assert check_range(-1, -5, 0) == True\", \"assert check_ra...
{ "split": "train", "index": 79910, "acecode_id": "evol_27617", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes two matrices (2D lists) of integers as input and performs element-wise multiplication. The function should return a new matrix containing the products of corresponding elements. If the input matrices do not have the same dimensions, contain non-i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert multiply_matrices_elementwise([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[5, 12], [21, 32]]\", \"assert multiply_matrices_elementwise([[0, 1], [2, 3]], [[4, 5], [6, 7]]) == [[0, 5], [12, 21]]\", \"assert multiply_matrices_elementwise([[1]], [[2]]) == [[2]]\", \...
{ "split": "train", "index": 79911, "acecode_id": "evol_27889", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates the behavior of retrieving the status of an operation based on an operation ID. The function should take an operation ID as input (a string) and return a tuple containing the status of the operation and an error mess...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_operation_details('operation_1') == ('Done', None)\", \"assert get_operation_details('operation_2') == ('Failed', 'Operation failed')\", \"assert get_operation_details('operation_3') == ('Pending', None)\", \"assert get_operation_details('test_1') == ('D...
{ "split": "train", "index": 79912, "acecode_id": "oss_10874", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing a collection of bags and their contents. Each bag can contain other bags, which may also contain more bags. Your task is to determine how many unique types of bags can eventually contain a 'shiny gold' bag. Each bag is represented by its colo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert solve('light red bags contain 1 bright white bag, 2 muted yellow bags.') == 0\", \"assert solve('dark orange bags contain 3 bright white bags, 4 muted yellow bags.') == 0\", \"assert solve('bright white bags contain 1 shiny gold bag.') == 1\", \"assert solve...
{ "split": "train", "index": 79913, "acecode_id": "bigcode_python_fns_27358", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that initializes a web driver based on a user preference for mobile or desktop usage. The function should take a boolean parameter `mobile`. If `mobile` is True, the function should return the string 'Mobile WebDriver Initialized', indicat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert initialize_web_driver(True) == 'Mobile WebDriver Initialized'\", \"assert initialize_web_driver(False) == 'Desktop WebDriver Initialized'\", \"assert initialize_web_driver(True) == 'Mobile WebDriver Initialized'\", \"assert initialize_web_driver(False) == 'D...
{ "split": "train", "index": 79914, "acecode_id": "bigcode_python_fns_11696", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves a list of even numbers from a given list of integers. Implement the function `get_even_numbers` that takes a single parameter, `numbers`, which is a list of integers. The function should return a list containing only the ev...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert get_even_numbers([10, 15, 20, 25]) == [10, 20]\", \"assert get_even_numbers([1, 3, 5, 7]) == []\", \"assert get_even_numbers([-2, -1, 0, 1, 2]) == [-2, 0, 2]\", \"assert get_even_numbers([0]) == [0]\", ...
{ "split": "train", "index": 79915, "acecode_id": "oss_27894", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that removes all occurrences of a specific HTML tag from a given string containing HTML content. The function should take the main content as input and remove all occurrences of the specified HTML tag. The function signature is as fol...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_html_tag('<div>Hello</div>', 'div') == 'Hello'\", \"assert remove_html_tag('<span>Text</span>', 'div') == '<span>Text</span>'\", \"assert remove_html_tag('<div><p>Paragraph</p></div>', 'span') == '<div><p>Paragraph</p></div>'\", \"assert remove_html_t...
{ "split": "train", "index": 79916, "acecode_id": "oss_13281", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the result of a simple guessing game. The function should take in a target number and a list of user guesses. It will return a list of feedback strings based on the user's guesses. Each feedback string will indicate whether...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert guessing_game_feedback(50, [30, 70, 50]) == (['too low', 'too high', 'correct'], 3)\", \"assert guessing_game_feedback(25, [20, 30, 25]) == (['too low', 'too high', 'correct'], 3)\", \"assert guessing_game_feedback(10, [5, 15, 10]) == (['too low', 'too high'...
{ "split": "train", "index": 79917, "acecode_id": "oss_19364", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple function that simulates the handling of HTTP requests. The function should take a string input representing the type of HTTP request ('GET' or 'POST') and return the corresponding HTTP status code and message as a tuple. For a 'GET' request...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert handle_http_request('GET') == (200, 'GET request received')\", \"assert handle_http_request('POST') == (200, 'POST request received')\", \"assert handle_http_request('PUT') == (400, 'Bad Request')\", \"assert handle_http_request('DELETE') == (400, 'Bad Reque...
{ "split": "train", "index": 79918, "acecode_id": "oss_8630", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `create_db_instance(db_name: str, db_instance_class: str, engine: str, master_username: str, master_user_password: str, allocated_storage: int) -> str` that simulates the creation of a database instance in a cloud environment. The function should accept par...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_db_instance('test_db', 'db.t2.micro', 'postgres', 'admin', 'password123', 20) == 'Database instance test_db created successfully.'\", \"assert create_db_instance('', 'db.t2.micro', 'postgres', 'admin', 'password123', 20) == 'Error: Invalid database na...
{ "split": "train", "index": 79919, "acecode_id": "evol_30040", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple command-line utility to manage notes. The utility should support two main functionalities: migrating related items to a specified destination and converting notes written in Markdown format to HTML. Implement a function called `process_comm...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_command('migrate', 'config.json') == 'Migrating items without duplicates.'\", \"assert process_command('migrate', 'config.json', True) == 'Migrating items with duplicates allowed.'\", \"assert process_command('markdown-to-html', 'config.json') == 'Co...
{ "split": "train", "index": 79920, "acecode_id": "oss_9269", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that validates a count parameter for a marker tracker. The function should raise a custom exception called `InvalidCountException` if the count is negative. Implement the function `validate_count(count: int) -> None` that takes an integer...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_count(0) is None\", \"assert validate_count(5) is None\", \"assert validate_count(10) is None\", \"assert validate_count(100) is None\", \"assert validate_count(1) is None\", \"assert validate_count(50) is None\", \"assert validate_count(999) is Non...
{ "split": "train", "index": 79921, "acecode_id": "bigcode_python_fns_21671", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `predict_predictions` that returns a list of integers where each integer is either 0 or 1. The prediction logic is as follows: for each integer in the input list, if the integer is greater than or equal to 0, return 1; otherwise, retur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert predict_predictions([1, 2, 3]) == [1, 1, 1]\", \"assert predict_predictions([-1, -2, -3]) == [0, 0, 0]\", \"assert predict_predictions([0]) == [1]\", \"assert predict_predictions([5, -5, 0]) == [1, 0, 1]\", \"assert predict_predictions([10, 20, 30, -10]) == ...
{ "split": "train", "index": 79922, "acecode_id": "bigcode_python_fns_9033", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `xfork()` that simulates the behavior of the Unix `fork()` function. The `xfork()` function should return a non-negative integer representing the child process ID upon successful creation of a new process. If the process creation fails, it should return -1....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert xfork() in [-1, 1, 2, 3]\", \"assert xfork() == 1 or xfork() == -1\", \"assert xfork() == 2 or xfork() == -1\", \"assert xfork() == 3 or xfork() == -1\", \"assert xfork() == 1 or xfork() == 2 or xfork() == -1\", \"assert xfork() in [1, 2, -1]\", \"assert xfo...
{ "split": "train", "index": 79923, "acecode_id": "bigcode_python_fns_18634", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a registration form represented as a dictionary and removes any 'csrf_token' key from it, if present. The function should also ensure that a 'profile' key exists in the registration form. Write a function named `sanitize_re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sanitize_registration_form({'profile': {'name': 'John'}, 'csrf_token': 'abc123'}) == {'profile': {'name': 'John'}}\", \"assert sanitize_registration_form({'profile': {'name': 'Doe'}}) == {'profile': {'name': 'Doe'}}\", \"assert sanitize_registration_form({'c...
{ "split": "train", "index": 79924, "acecode_id": "bigcode_python_fns_25205", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a `rows x cols` matrix `grid`. Initially, you are located at the top-left corner `(0, 0)`, and in each step, you can only move right, down, or diagonally (right-down) in the matrix. Write a function `maxProductPath(grid: List[List[int]]) -> int` that finds the pat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert maxProductPath([[1,-2,1],[1,-2,1],[3,-4,1]]) == 8\", \"assert maxProductPath([[1, 3],[0,-4]]) == 0\", \"assert maxProductPath([[1]]) == 1\", \"assert maxProductPath([[0]]) == 0\", \"assert maxProductPath([[1, 2],[-1, 3]]) == 6\", \"assert maxProductPath([[1,...
{ "split": "train", "index": 79925, "acecode_id": "evol_6741", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that formats a URL by adding a GET request parameter. The function should take three input parameters: a string 'url', a string 'key', and a string 'value'. The function should append the key-value pair to the URL as a GET parameter. If t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_get_parameter('http://example.com', 'param', 'value') == 'http://example.com?param=value'\", \"assert add_get_parameter('http://example.com?existing=value', 'param', 'value') == 'http://example.com?existing=value&param=value'\", \"assert add_get_paramete...
{ "split": "train", "index": 79926, "acecode_id": "bigcode_python_fns_15355", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a list of parameter names based on a given string of comma-separated argument names and an optional boolean flag. The function should take in two parameters: a string `arg_names` consisting of argument names separated by co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert make_signature('arg1, arg2, arg3', False) == ['arg1', 'arg2', 'arg3']\", \"assert make_signature('arg1, arg2', True) == ['self', 'arg1', 'arg2']\", \"assert make_signature('self, arg1', True) == ['self', 'arg1']\", \"assert make_signature('arg1', True) == [...
{ "split": "train", "index": 79927, "acecode_id": "bigcode_python_fns_4764", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `merge_sort(data: List[str]) -> List[str]` that sorts a list of mixed graphic-symbols and characters in ascending order of their ASCII values using the Merge Sort algorithm. The function should return a new list that contains the sorted elements.\nPlease re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_sort(['d', 'c', 'b', 'a']) == ['a', 'b', 'c', 'd']\", \"assert merge_sort(['!', '@', '#', '$', '%']) == ['!', '#', '$', '%', '@']\", \"assert merge_sort(['Z', 'Y', 'X', 'W', 'V']) == ['V', 'W', 'X', 'Y', 'Z']\", \"assert merge_sort(['1', '2', '3', '0']...
{ "split": "train", "index": 79928, "acecode_id": "evol_739", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `char_frequency(statement: str) -> dict` that takes a string `statement` as input and returns a dictionary containing the frequency of each distinct character in the string. The keys of the dictionary should be the characters, and the values should be the n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert char_frequency('Hello, world!') == {'H': 1, 'e': 1, 'l': 3, 'o': 2, ',': 1, ' ': 1, 'w': 1, 'r': 1, 'd': 1, '!': 1}\", \"assert char_frequency('test') == {'t': 2, 'e': 1, 's': 1}\", \"assert char_frequency('') == {}\", \"assert char_frequency('a') == {'a': 1...
{ "split": "train", "index": 79929, "acecode_id": "evol_3153", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that adds the prefix 'Basic ' to a given token. The function should accept a single parameter, 'token', which can either be a string or a bytes-like object. If the token is not empty, the function should return the token prefixed with 'Ba...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_basic('my_token') == 'Basic my_token'\", \"assert add_basic(b'my_token') == b'Basic my_token'\", \"assert add_basic('') is None\", \"assert add_basic(None) is None\", \"assert add_basic('another_token') == 'Basic another_token'\", \"assert add_basic(b'an...
{ "split": "train", "index": 79930, "acecode_id": "bigcode_python_fns_4625", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function to determine if a given string can be rearranged to form a palindrome. A palindrome is a word, phrase, number, or other sequence of characters which reads the same backward or forward. The function should take a string as input...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_form_palindrome('A man, a plan, a canal, Panama') == True\", \"assert can_form_palindrome('racecar') == True\", \"assert can_form_palindrome('hello') == False\", \"assert can_form_palindrome('Able was I saw Elba') == True\", \"assert can_form_palindrome(...
{ "split": "train", "index": 79931, "acecode_id": "oss_2754", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `triangle_properties(a, b, c)` that takes three side lengths of a triangle as input and returns a dictionary containing the following properties of the triangle: the area (calculated using Heron's formula), the semiperimeter, the perimeter, the type of tria...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert triangle_properties(3, 4, 5) == {'Area': 6.0, 'Semiperimeter': 6.0, 'Perimeter': 12.0, 'Type': 'Scalene', 'Right angled': 'Yes'}\", \"assert triangle_properties(2, 2, 3) == {'Area': 1.984313483298443, 'Semiperimeter': 3.5, 'Perimeter': 7.0, 'Type': 'Isoscele...
{ "split": "train", "index": 79932, "acecode_id": "evol_29306", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a positive integer 'length', write a function that generates a random password of the specified length using only the characters from a predefined set: 'abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'. The password should not contain characters that can be easily...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_password(10) != generate_password(10)\", \"assert len(generate_password(5)) == 5\", \"assert len(generate_password(12)) == 12\", \"assert all(c in 'abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789' for c in generate_password(8))\", \"assert g...
{ "split": "train", "index": 79933, "acecode_id": "bigcode_python_fns_14833", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer N, generate a beautiful array A that is a permutation of the integers from 1 to N, such that for every i < j, there is no k with i < k < j where A[k] * 2 = A[i] + A[j]. Additionally, the function should accept a list of integers M that must be included in the b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert beautifulArray(4, [1, 2]) in [[1, 3, 2, 4], [3, 1, 4, 2]]\", \"assert beautifulArray(3, [1, 2]) in [[1, 3, 2]]\", \"assert beautifulArray(5, [6]) is None\", \"assert beautifulArray(1, [1]) == [1]\", \"assert beautifulArray(2, [1]) in [[1, 2]]\", \"assert bea...
{ "split": "train", "index": 79934, "acecode_id": "evol_25412", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Write a function `generate_password` that generates a random password consisting of exactly 8 characters. The password should include uppercase letters, lowercase letters, digits, and punctuation. The function should return the generated password as a string.\nPlease reason ste...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_password() is not None\", \"assert len(generate_password()) == 8\", \"assert any(c.islower() for c in generate_password())\", \"assert any(c.isupper() for c in generate_password())\", \"assert any(c.isdigit() for c in generate_password())\", \"asser...
{ "split": "train", "index": 79935, "acecode_id": "evol_31257", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that validates the correctness of a given GraphQL response for a specific channel. The function should take the GraphQL response content as a dictionary and the original channel object, which has attributes: id, name, slug, and cur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_channel_response({'data': {'channel': {'id': 'Channel:1', 'name': 'USD Channel', 'slug': 'usd-channel', 'currencyCode': 'USD'}}}, Channel(1, 'USD Channel', 'usd-channel', 'USD')) == True\", \"assert validate_channel_response({'data': {'channel': {'i...
{ "split": "train", "index": 79936, "acecode_id": "oss_2201", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that manages a collection of books in a library. The library allows users to perform the following operations on the collection of books: add a new book, remove a book, display the list of all books, and search for a specific book by its ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert library_management([('add', ('Python Programming', 'John Smith'))]) == ['Book added successfully!']\", \"assert library_management([('add', ('Python Programming', 'John Smith')), ('display',)]) == ['Book added successfully!', ['Python Programming by John Smi...
{ "split": "train", "index": 79937, "acecode_id": "oss_18987", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries representing user data. Each dictionary contains the following keys: 'id', 'name', and 'email'. Write a function `validate_and_clean_data(data: List[Dict[str, Union[int, str]]]) -> Tuple[List[Dict[str, Union[int, str]]], bool]` that validate...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_and_clean_data([{'id': 1, 'name': 'Alice', 'email': 'alice@example.com'}, {'id': 2, 'name': 'Bob', 'email': 'bob@example.com'}]) == ([{'id': 1, 'name': 'Alice', 'email': 'alice@example.com'}, {'id': 2, 'name': 'Bob', 'email': 'bob@example.com'}], Tr...
{ "split": "train", "index": 79938, "acecode_id": "evol_14065", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that validates a list of email addresses to ensure they follow a specific format. An email is considered valid if it contains exactly one '@' symbol and a domain after it. Implement a function called `validate_emails(emails: List[str]) -> ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_emails(['test@example.com', 'invalid-email', 'user@domain', 'email@domain.com']) == [True, False, False, True]\", \"assert validate_emails(['@example.com', 'test@domain.com']) == [False, True]\", \"assert validate_emails(['test@domain.com', 'test@do...
{ "split": "train", "index": 79939, "acecode_id": "oss_2931", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that updates the status of a button based on its current state. The function will take two boolean parameters: `opened` and `enabled`. The `opened` parameter indicates whether the button is currently opened or closed. The `enabled` parame...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_status_label(False, True) == 'closed'\", \"assert get_status_label(False, False) == 'closed'\", \"assert get_status_label(True, True) == 'enabled'\", \"assert get_status_label(True, False) == 'disabled'\", \"assert get_status_label(True, True) == 'enable...
{ "split": "train", "index": 79940, "acecode_id": "bigcode_python_fns_11802", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the update of lane detection information for an autonomous vehicle. The function should take in a list of new polynomial coefficients (as floats) representing a detected lane and an integer n that specifies the number o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_lane_info([1.0, -0.5, 0.3], 3) == {'detected': True, 'recent_fit': [1.0, -0.5, 0.3], 'best_fit': [1.0, -0.5, 0.3], 'current_fit': [1.0, -0.5, 0.3], 'diffs': [0.0, 0.0, 0.0]}\", \"assert update_lane_info([], 3) == {'detected': False, 'recent_fit': [], ...
{ "split": "train", "index": 79941, "acecode_id": "oss_35404", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with developing a function that simulates a simple prediction based on user input. The function takes in a list of numerical values representing input data and returns a rounded integer prediction. The prediction is calculated by taking the average of the input v...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert predict([1000.0, 2000.0, 3000.0]) == 2000\", \"assert predict([999.99, 1000.01]) == 1000\", \"assert predict([500.0, 1500.0, 2500.0]) == 2000\", \"assert predict([-1000.0, 0.0, 1000.0]) == 0\", \"assert predict([0.0, 0.0, 0.0]) == 0\", \"assert predict([1000...
{ "split": "train", "index": 79942, "acecode_id": "bigcode_python_fns_1370", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a byte array representing a firmware image. Your task is to verify whether the first few bytes of this firmware image match a given expected byte array. Write a function `verify_firmware(firmware: bytearray, expected: bytearray) -> bool` that checks if the initial...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert verify_firmware(bytearray(b'\\\\x01\\\\x02\\\\x03\\\\x04'), bytearray(b'\\\\x01\\\\x02')) == True\", \"assert verify_firmware(bytearray(b'\\\\x01\\\\x02\\\\x03\\\\x04'), bytearray(b'\\\\x01\\\\x03')) == False\", \"assert verify_firmware(bytearray(b'\\\\x01\\...
{ "split": "train", "index": 79943, "acecode_id": "bigcode_python_fns_27413", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers `existing_shapefile_info_ids` which may contain duplicates. Your task is to write a Python function `count_duplicate_ids(existing_shapefile_info_ids)` that counts how many unique integers appear more than once in the list. The function should re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_duplicate_ids([1, 2, 3, 2, 4, 5, 3, 6, 7, 7, 8]) == 3\", \"assert count_duplicate_ids([1, 1, 1, 1]) == 1\", \"assert count_duplicate_ids([1, 2, 3, 4, 5]) == 0\", \"assert count_duplicate_ids([]) == 0\", \"assert count_duplicate_ids([1, 2, 3, 1, 2, 3]) ...
{ "split": "train", "index": 79944, "acecode_id": "oss_26818", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates a simple game of rock-paper-scissors. The function should take two arguments: the player's choice and the computer's choice. The function should then determine the winner based on the standard rules of rock-paper-sci...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rock_paper_scissors('rock', 'scissors') == 'Player wins'\", \"assert rock_paper_scissors('paper', 'rock') == 'Player wins'\", \"assert rock_paper_scissors('scissors', 'paper') == 'Player wins'\", \"assert rock_paper_scissors('rock', 'paper') == 'Computer win...
{ "split": "train", "index": 79945, "acecode_id": "oss_29765", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a string s, write a function that returns True if the string is a palindrome, and False otherwise. A palindrome is a word, phrase, number, or other sequences of characters that reads the same forward and backward (ignoring spaces and case sensitivity). An empty string is ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_palindrome_v3('noon') == True\", \"assert is_palindrome_v3('racecar') == True\", \"assert is_palindrome_v3('dented') == False\", \"assert is_palindrome_v3('') == True\", \"assert is_palindrome_v3(' ') == True\", \"assert is_palindrome_v3('A man a plan a c...
{ "split": "train", "index": 79946, "acecode_id": "bigcode_python_fns_36663", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a filename as a string, replace the specified suffix with a new suffix. If the filename does not end with the specified input suffix, return the original filename. You are also given an optional delimiter; if specified, the suffix will be replaced with the new suffix rega...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert replace_suffix('file.txt', '.txt', '.bak') == 'file.bak'\", \"assert replace_suffix('document.pdf', '.doc', '.docx') == 'document.pdf'\", \"assert replace_suffix('archive.zip', '.zip', '.tar') == 'archive.tar'\", \"assert replace_suffix('notes.txt', '.txt', ...
{ "split": "train", "index": 79947, "acecode_id": "bigcode_python_fns_19110", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a Python function that finds the last non-zero digit of the factorial of a given non-negative integer n. The function should return the last non-zero digit after calculating n!. For example, if n = 5, the factorial is 120, and the last non-zero digit is 2. Write a fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert last_non_zero_digit(0) == 1\", \"assert last_non_zero_digit(1) == 1\", \"assert last_non_zero_digit(2) == 2\", \"assert last_non_zero_digit(3) == 6\", \"assert last_non_zero_digit(4) == 4\", \"assert last_non_zero_digit(6) == 2\", \"assert last_non_zero_digi...
{ "split": "train", "index": 79948, "acecode_id": "evol_4528", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a string, your task is to implement a function that removes all punctuation characters from the string and returns the modified string. Punctuation characters are defined as any character that is not a letter (a-z, A-Z) or a digit (0-9). Your implementation should only co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_punctuation('Hello, World!') == 'Hello World'\", \"assert remove_punctuation('Python3.8 is great!') == 'Python38 is great'\", \"assert remove_punctuation('') == ''\", \"assert remove_punctuation('No punctuation here') == 'No punctuation here'\", \"ass...
{ "split": "train", "index": 79949, "acecode_id": "bigcode_python_fns_40654", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates starting a process by writing a command to a given state. The function should have the following signature: `def start_process(current_state: str, start_time: Optional[int] = None) -> str:`. The function accepts two paramet...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert start_process('idle') == 'Process started immediately'\", \"assert start_process('idle', 1609459200) == 'Process started at 1609459200'\", \"assert start_process('idle', None) == 'Process started immediately'\", \"assert start_process('idle', 1612137600) == ...
{ "split": "train", "index": 79950, "acecode_id": "bigcode_python_fns_48339", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a string representing a date in various formats. Your task is to implement a function that parses this date string and returns the corresponding datetime object. The following formats are supported: '%Y-%m-%dT%H:%M:%S.%fZ', '%d/%m/%Y %H:%M:%S', '%d/%m/%Y%H:%M:%S',...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_date('2023-10-05T14:48:00.000Z') == datetime(2023, 10, 5, 14, 48)\", \"assert parse_date('05/10/2023 14:48:00') == datetime(2023, 10, 5, 14, 48)\", \"assert parse_date('05/10/202314:48:00') == datetime(2023, 10, 5, 14, 48)\", \"assert parse_date('05/10...
{ "split": "train", "index": 79951, "acecode_id": "bigcode_python_fns_4473", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `verify_ean13(ean: str) -> bool` that checks the validity of a 13-digit International Article Number (EAN-13) code. The function should return True if the EAN-13 code is valid according to the checksum rules, and False otherwise. The input `ean` will always...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert verify_ean13('9780201310054') == True\", \"assert verify_ean13('1234567890128') == True\", \"assert verify_ean13('1234567890123') == False\", \"assert verify_ean13('9781234567897') == True\", \"assert verify_ean13('0123456789012') == True\", \"assert verify_...
{ "split": "train", "index": 79952, "acecode_id": "evol_14187", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of table names represented as strings. Write a function `get_table_names()` that takes a list of table names and returns a new list containing only the names of the tables that are considered 'base tables'. A base table is defined as a table whose name does...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_table_names(['_temp', 'entities', 'events', '_archive', 'stories', 'taxonomy']) == ['entities', 'events', 'stories', 'taxonomy']\", \"assert get_table_names(['_hidden', '_secret', 'public']) == ['public']\", \"assert get_table_names(['table1', 'table2', ...
{ "split": "train", "index": 79953, "acecode_id": "bigcode_python_fns_29899", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple function that takes a string as input and returns a new string that includes a message indicating the status of a feature. The function should append the text ' - Feature status: Pending' to the input string. Implement a function called `fe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert feature_status('Payment gateway') == 'Payment gateway - Feature status: Pending'\", \"assert feature_status('User registration') == 'User registration - Feature status: Pending'\", \"assert feature_status('Search functionality') == 'Search functionality - Fe...
{ "split": "train", "index": 79954, "acecode_id": "oss_20662", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers and a specified target sum, write a function that finds all unique pairs of integers in the array that add up to the target sum. Each integer in the array can only be used once in the output pairs. The function should return a list of tuples where eac...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_dyads([0, 0, 0, 0], 0) == [(0, 0)]\", \"assert find_dyads([1, 1, 1, 1], 2) == [(1, 1)]\", \"assert find_dyads([1, 2, 3, 4, 5, 6], 7) == [(1, 6), (2, 5), (3, 4)]\", \"assert find_dyads([1, 2, 3, 4, 5, 5], 10) == [(5, 5)]\", \"assert find_dyads([5, 5, 5, ...
{ "split": "train", "index": 79955, "acecode_id": "evol_30817", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function `reverse_number(n: int) -> int` that takes an integer n and returns its digits reversed. The input will always be a non-negative integer. For example, if the input is 123, the output should be 321. You must use a recursive approach to solve this problem.\nP...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_number(0) == 0\", \"assert reverse_number(1) == 1\", \"assert reverse_number(12) == 21\", \"assert reverse_number(123) == 321\", \"assert reverse_number(100) == 1\", \"assert reverse_number(4567) == 7654\", \"assert reverse_number(890) == 98\", \"ass...
{ "split": "train", "index": 79956, "acecode_id": "evol_6718", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two sorted arrays, merge them into a single sorted array while counting the number of inversions that occur during the merge process. An inversion is defined as an instance where an element from the second array is placed before an element from the first array when mergin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_and_count([1, 3, 5], [2, 4, 6]) == ([1, 2, 3, 4, 5, 6], 3)\", \"assert merge_and_count([1, 2, 3], [4, 5, 6]) == ([1, 2, 3, 4, 5, 6], 0)\", \"assert merge_and_count([], [1, 2, 3]) == ([1, 2, 3], 0)\", \"assert merge_and_count([1, 2, 3], []) == ([1, 2, 3...
{ "split": "train", "index": 79957, "acecode_id": "evol_33432", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Implement a function `drone_telemetry(drones: List[Tuple[str, int, int, int, int, int]]) -> List[Dict[str, Union[Tuple[int, int, int], int, int, int, int]]]` that processes a list of drones' telemetry data. Each drone's data is provided as a tuple containing its name, current x...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert drone_telemetry([('Drone1', 0, 1, 1, 80, 10, 5)]) == [{'name': 'Drone1', 'current_location': (0, 1, 1), 'battery_status': 80, 'altitude': 1, 'distance_travelled': 10, 'current_speed': 5}]\", \"assert drone_telemetry([('DroneA', 10, 10, 10, 50, 100, 20), ('Dr...
{ "split": "train", "index": 79958, "acecode_id": "evol_16635", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are working on a distributed system that involves creating and managing groups of nodes. Each node in the system is identified by a unique nodeid. Your task is to implement a function `check_group_status` that takes the following parameters: \n- `group`: An instance of the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_group_status(Group(2), Server()) == False\", \"assert check_group_status(Group(4), Server()) == False\", \"assert check_group_status(Group(6), Server()) == False\", \"assert check_group_status(Group(8), Server()) == False\", \"assert check_group_status...
{ "split": "train", "index": 79959, "acecode_id": "oss_28910", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a list of sales transactions and generates a summary report. Each transaction is represented as a dictionary with the following keys: 'date' (a string in the format 'YYYY-MM-DD'), 'product' (a string representing the produc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_report([{'date': '2023-01-01', 'product': 'A', 'quantity': 100, 'revenue': 5000}, {'date': '2023-01-15', 'product': 'B', 'quantity': 150, 'revenue': 7500}], 'monthly') == 'Total revenue for January 2023 is $12500'\", \"assert generate_report([{'date...
{ "split": "train", "index": 79960, "acecode_id": "oss_2025", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that serializes a dictionary into a JSON formatted string. The function should take in a dictionary as input and return a string that represents the JSON serialization of that dictionary. Ensure that the JSON string is formatted with an i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert serialize_dict_to_json({'name': 'Alice', 'age': '30'}) == '{\\\\n \\\"name\\\": \\\"Alice\\\",\\\\n \\\"age\\\": \\\"30\\\"\\\\n}'\", \"assert serialize_dict_to_json({'city': 'New York'}) == '{\\\\n \\\"city\\\": \\\"New York\\\"\\\\n}'\", \"assert ...
{ "split": "train", "index": 79961, "acecode_id": "bigcode_python_fns_4774", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a tensor represented as a list of lists, implement a function `get_tensor_dimension(tensor: List[List[Any]]) -> int` that returns the number of dimensions of the tensor. A tensor is defined as a nested list where each inner list represents a dimension of the tensor. For e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_tensor_dimension([[1, 2], [3, 4]]) == 2\", \"assert get_tensor_dimension([[1], [2], [3]]) == 2\", \"assert get_tensor_dimension([[1]]) == 2\", \"assert get_tensor_dimension([[[1], [2]], [[3], [4]]]) == 3\", \"assert get_tensor_dimension([[1, 2], [3]]) ==...
{ "split": "train", "index": 79962, "acecode_id": "bigcode_python_fns_32983", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two lists of integers, `convergence_data` and `mu_diff`, write a function `find_spearman_correlation(convergence_data: List[int], mu_diff: List[int]) -> float` that calculates the Spearman's rank correlation coefficient between the two lists. The Spearman's rank correlati...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_spearman_correlation([], []) == 0.0\", \"assert find_spearman_correlation([1, 2, 3], [1, 2, 3]) == 1.0\", \"assert find_spearman_correlation([1, 2, 3], [3, 2, 1]) == -1.0\", \"assert find_spearman_correlation([1, 2, 3], []) == 0.0\", \"assert find_spear...
{ "split": "train", "index": 79963, "acecode_id": "bigcode_python_fns_10552", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a domain input from a user. The function should take a string `domain` as input and return the following: if the domain is an empty string, return 'Invalid domain'. If the domain is a valid non-empty string, return 'Valid d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_domain('') == 'Invalid domain'\", \"assert validate_domain('example.com') == 'Valid domain'\", \"assert validate_domain('sub.example.com') == 'Valid domain'\", \"assert validate_domain('-example.com') == 'Invalid domain'\", \"assert validate_domain(...
{ "split": "train", "index": 79964, "acecode_id": "bigcode_python_fns_3945", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with optimizing the transportation of goods from several plants to various demand points while minimizing the total transportation cost. Each plant can supply a certain volume of goods, and each demand point has a specific demand that must be met. Your goal is to...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert minimize_transportation_cost([30, 20], [10, 20]) == 50\", \"assert minimize_transportation_cost([10, 10], [5, 5]) == 20\", \"assert minimize_transportation_cost([10, 10], [30]) == -1\", \"assert minimize_transportation_cost([0], [10]) == -1\", \"assert minim...
{ "split": "train", "index": 79965, "acecode_id": "oss_8846", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a champagne tower where glasses are arranged in a pyramid pattern. Each glass can leak champagne at a specific rate between 0 and 1. You will pour a non-negative integer amount of champagne into the top glass (the only glass in the first row). Any...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert champagneTower(1, 1, 1, [[0.0], [0.0, 0.0]]) == 0.00000\", \"assert champagneTower(2, 1, 1, [[0.0], [0.0, 0.0]]) == 0.50000\", \"assert champagneTower(0, 0, 0, [[0.0]]) == 0.00000\", \"assert champagneTower(1, 1, 0, [[0.0], [0.0, 0.0]]) == 0.00000\", \"asser...
{ "split": "train", "index": 79966, "acecode_id": "evol_33723", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a structured response for a user session in a voice assistant application. The function `build_response(session_attributes, speechlet_response)` takes two parameters: `session_attributes`, a dictionary containing session-re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert build_response({'user_id': '123'}, {'outputSpeech': 'Hello, World!'}) == {'version': '1.0', 'sessionAttributes': {'user_id': '123'}, 'response': {'outputSpeech': 'Hello, World!'}}\", \"assert build_response({}, {'outputSpeech': 'Welcome!'}) == {'version': '1...
{ "split": "train", "index": 79967, "acecode_id": "bigcode_python_fns_31771", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a simple file management system. The function should take in two parameters: `touch` (a boolean indicating whether to create a new file) and `ipath` (a string representing the file path). If `touch` is `True`, the function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_file(True, 'test_file.txt') == 'hiding test cells in test_file.txt'\", \"assert manage_file(False, 'test_file.txt') == 'no changes in test_file.txt'\", \"assert manage_file(True, 'data.csv') == 'hiding test cells in data.csv'\", \"assert manage_file(F...
{ "split": "train", "index": 79968, "acecode_id": "oss_24982", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a boolean value, implement a function that encodes the boolean into a tuple of bytes. The encoding should be as follows: if the boolean value is True, it should return a tuple containing 'BSON_BOOLEAN' and 'ONE' as bytes. If the boolean value is False, it should return a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert encode_bool_to_bytes(True) == (b'\\\\x01', b'\\\\x01')\", \"assert encode_bool_to_bytes(False) == (b'\\\\x01', b'\\\\x00')\", \"assert encode_bool_to_bytes(True) == (b'\\\\x01', b'\\\\x01')\", \"assert encode_bool_to_bytes(False) == (b'\\\\x01', b'\\\\x00')\...
{ "split": "train", "index": 79969, "acecode_id": "bigcode_python_fns_41649", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that computes the length of the longest continuously ascending subsequence. A subsequence is considered continuously ascending if each subsequent number is greater than its predecessor, and duplicate numbers should not be included ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_longest_subsequence([]) == 0\", \"assert find_longest_subsequence([1]) == 1\", \"assert find_longest_subsequence([1, 2, 3, 4, 5]) == 5\", \"assert find_longest_subsequence([5, 4, 3, 2, 1]) == 1\", \"assert find_longest_subsequence([-1, 0, 1, 2]) == 4\",...
{ "split": "train", "index": 79970, "acecode_id": "evol_28555", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given a list of integers or integer tuples, implement a function that swaps the values of two distinct elements in the list based on their provided indices. The swapping must be performed in-place, and you cannot use any built-in functions or temporary variables. Write a functi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert swap_elements([10, 20, 30, 40], 1, 3) == None and [10, 40, 30, 20] == [10, 40, 30, 20]\", \"assert swap_elements([1, 2, 3, 4, 5], 2, 4) == None and [1, 2, 5, 4, 3] == [1, 2, 5, 4, 3]\", \"assert swap_elements([5, 10, 15, 20], 0, 3) == None and [20, 10, 15, 5...
{ "split": "train", "index": 79971, "acecode_id": "evol_32484", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given a string that may contain a reference to an issue number in the format '#<number>'. Write a function that extracts the issue number from the string. If an issue number is found, return a dictionary with two keys: 'issue_number' containing the extracted number as a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_issue_info('Fixing bug #123') == {'issue_number': '123', 'url': 'https://bugs.python.org/issue123'}\", \"assert extract_issue_info('No issue here') == {'issue_number': None, 'url': None}\", \"assert extract_issue_info('Issue reported in #456 and fixe...
{ "split": "train", "index": 79972, "acecode_id": "bigcode_python_fns_15029", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simple game where a player has a certain amount of health points and can perform actions that either increase or decrease their health. The player starts with a specific amount of health and can take a list of actions...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert final_health(50, [('heal', 30), ('damage', 20)], 100) == 60\", \"assert final_health(90, [('damage', 100)], 100) == 0\", \"assert final_health(0, [('heal', 50)], 100) == 50\", \"assert final_health(100, [('heal', 30), ('heal', 50)], 100) == 100\", \"assert f...
{ "split": "train", "index": 79973, "acecode_id": "bigcode_python_fns_17209", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `string_manipulator(s: str, prefix: str = '', suffix: str = '') -> str` that takes a string `s` and appends a `prefix` and a `suffix` to it. The `prefix` and `suffix` should default to empty strings if not provided. The function should return the modified s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert string_manipulator('Hello', 'Mr. ', '!') == 'Mr. Hello!'\", \"assert string_manipulator('World') == 'World'\", \"assert string_manipulator('', 'Start: ') == 'Empty string provided'\", \"assert string_manipulator('Python', '', ' is great') == 'Python is great...
{ "split": "train", "index": 79974, "acecode_id": "evol_11756", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function that takes in a list of employee names and returns a sorted list of these names in alphabetical order. Ensure that the input is a list of strings and the function raises a ValueError if the input is not a list or contains non-string elements.\nPlease reason st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_employee_names(['John', 'Alice', 'Bob']) == ['Alice', 'Bob', 'John']\", \"assert sort_employee_names(['Zara', 'Mike', 'Anna']) == ['Anna', 'Mike', 'Zara']\", \"assert sort_employee_names(['Charlie', 'Eve']) == ['Charlie', 'Eve']\", \"assert sort_employe...
{ "split": "train", "index": 79975, "acecode_id": "evol_21181", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the updating of a collaboration's attributes based on provided input. The function should accept a dictionary representing the collaboration details and return a success status if any attributes were updated. The attributes...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_collaboration({'id': '1', 'owner': 'Alice'}) == {'success': True}\", \"assert update_collaboration({'id': '2', 'size': 10}) == {'success': True}\", \"assert update_collaboration({'id': '3', 'members': ['Bob', 'Charlie']}) == {'success': True}\", \"ass...
{ "split": "train", "index": 79976, "acecode_id": "bigcode_python_fns_17450", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers and/or nested lists of integers, implement a function `intersperse(numbers: List[Union[int, List[int]]], delimiter: Union[int, float]) -> List[int]` that introduces the `delimiter` among every couple of sequential numbers in the supplied `numbers` list....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert intersperse([], 4) == []\", \"assert intersperse([1, 2, 3], 4) == [1, 4, 2, 4, 3]\", \"assert intersperse([1, 2, 3], -2) == [1, 2, 3]\", \"assert intersperse([1, [2, 3]], 4) == [1, 4, 2, 4, 3]\", \"assert intersperse([1, 2, 3], 4.5) == [1, 2, 3]\", \"assert ...
{ "split": "train", "index": 79977, "acecode_id": "evol_25560", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with processing a list of integers to determine the number of even and odd integers in that list. Write a Python function `count_even_odd(numbers)` that takes a single parameter: `numbers` (list of integers), and returns a tuple containing two integers. The first...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_even_odd([1, 2, 3, 4]) == (2, 2)\", \"assert count_even_odd([0, 1, 2, 3, 4, 5]) == (3, 3)\", \"assert count_even_odd([-1, -2, -3, -4]) == (2, 2)\", \"assert count_even_odd([]) == (0, 0)\", \"assert count_even_odd([10, 15, 20, 25]) == (2, 2)\", \"assert...
{ "split": "train", "index": 79978, "acecode_id": "oss_20342", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that allows for the creation of a new hourly rate for a member of a service. Implement a function `create_hourly_rate(member: str, hourly_rate: float) -> dict` that takes the following parameters: \n- `member`: A string representing t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_hourly_rate('Alice', 20.5) == {'member': 'Alice', 'hourly_rate': 20.5}\", \"assert create_hourly_rate('Bob', 15.0) == {'member': 'Bob', 'hourly_rate': 15.0}\", \"assert create_hourly_rate('Charlie', 30.75) == {'member': 'Charlie', 'hourly_rate': 30.75...
{ "split": "train", "index": 79979, "acecode_id": "oss_30749", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, write a function that computes the arithmetic mean of the values in the array. The function should return the mean as a float. If the array is empty, the function should return 0.0.\nPlease reason step by step, then write a self-contained Python solu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert arithmetic_mean([1, 2, 3, 4, 5]) == 3.0\", \"assert arithmetic_mean([10, 20, 30]) == 20.0\", \"assert arithmetic_mean([-1, -2, -3]) == -2.0\", \"assert arithmetic_mean([0, 0, 0]) == 0.0\", \"assert arithmetic_mean([]) == 0.0\", \"assert arithmetic_mean([5]) ...
{ "split": "train", "index": 79980, "acecode_id": "evol_17550", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a linear equation of the form x + 2y = 4, implement a function `solve_linear_equation(y)` that takes an integer y as input and returns the corresponding integer value of x that satisfies the equation.\nPlease reason step by step, then write a self-contained Python solutio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert solve_linear_equation(0) == 4\", \"assert solve_linear_equation(1) == 2\", \"assert solve_linear_equation(2) == 0\", \"assert solve_linear_equation(3) == -2\", \"assert solve_linear_equation(-1) == 6\", \"assert solve_linear_equation(-2) == 8\", \"assert sol...
{ "split": "train", "index": 79981, "acecode_id": "evol_27397", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string, your task is to implement a function that processes the string to find the number of occurrences of the character 'A', as well as the positions of its first and last occurrences within the string. The input string should be converted to uppercase and any leading...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_string('Hello World') == (0, 0, 0)\", \"assert process_string('A') == (1, 1, 1)\", \"assert process_string(' A ') == (1, 1, 1)\", \"assert process_string('ABACADA') == (4, 1, 7)\", \"assert process_string(' ') == (0, 0, 0)\", \"assert process_s...
{ "split": "train", "index": 79982, "acecode_id": "oss_11098", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `unique_namespace_count(n: int) -> int` that takes an integer n as input and returns the number of unique namespaces generated when creating n instances of a hypothetical `DataPack` class, where each instance of `DataPack` has a uniqu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_namespace_count(0) == 0\", \"assert unique_namespace_count(1) == 1\", \"assert unique_namespace_count(2) == 2\", \"assert unique_namespace_count(3) == 3\", \"assert unique_namespace_count(4) == 4\", \"assert unique_namespace_count(5) == 5\", \"assert ...
{ "split": "train", "index": 79983, "acecode_id": "oss_11873", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks if a product has expired based on its expiration date and calculates the remaining days until expiration. Implement a function `check_product_expiry` that takes two parameters: `expiry_date` (a string in the format 'YYYY-MM-DD...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_product_expiry('2023-12-31', '2023-12-30') == (False, 1)\", \"assert check_product_expiry('2023-12-31', '2024-01-01') == (True, 0)\", \"assert check_product_expiry('2023-01-01', '2023-01-01') == (True, 0)\", \"assert check_product_expiry('2023-12-31', ...
{ "split": "train", "index": 79984, "acecode_id": "oss_32979", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, write a function that returns the maximum sum of any contiguous subarray within the array. For example, given the input array [2, 4, -3, 5], the function should return 11, which is the sum of the subarray [2, 4, -3, 5].\nPlease reason step by step, t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_subarray_sum([-1, -2, -3, -4]) == -1\", \"assert max_subarray_sum([1, 2, 3, 4]) == 10\", \"assert max_subarray_sum([-2, 1, -3, 4, -1, 2, 1, -5, 4]) == 6\", \"assert max_subarray_sum([3, 2, 5, -1, 0]) == 10\", \"assert max_subarray_sum([5, 4, -1, 7, 8]) =...
{ "split": "train", "index": 79985, "acecode_id": "evol_32083", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that calculates the average of two floating-point numbers. The function should take two parameters, `num1` and `num2`, which are both floating-point numbers. It should return the average of these two numbers formatted to two decima...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average(1.0, 3.0) == '2.00'\", \"assert calculate_average(2.5, 3.5) == '3.00'\", \"assert calculate_average(-1.0, 1.0) == '0.00'\", \"assert calculate_average(0.0, 0.0) == '0.00'\", \"assert calculate_average(2.333, 4.667) == '3.50'\", \"assert cal...
{ "split": "train", "index": 79986, "acecode_id": "oss_1156", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `manage_tasks` that takes a list of tasks and a command string. The command can either be 'add', 'remove', 'mark_done', or 'list'. If the command is 'add', the function should add a task to the list. If the command is 'remove', it should remove the specifie...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_tasks([], 'add', {'title': 'Task 1', 'done': False}) == [{'title': 'Task 1', 'done': False}]\", \"assert manage_tasks([{'title': 'Task 1', 'done': False}], 'remove', {'title': 'Task 1', 'done': False}) == []\", \"assert manage_tasks([{'title': 'Task 1...
{ "split": "train", "index": 79987, "acecode_id": "evol_22057", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `divisors_and_gcd(*numbers)` that takes a variable number of integers and returns a dictionary. Each key in the dictionary corresponds to the input integer, and the value is a tuple containing the following information: 1. A boolean indicating whether the n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert divisors_and_gcd(10) == {10: (True, [1, 2, 5, 10], 18, 5, (10, 1))}\", \"assert divisors_and_gcd(28) == {28: (True, [1, 2, 4, 7, 14, 28], 56, 7, (28, 1))}\", \"assert divisors_and_gcd(7) == {7: (True, [1, 7], 8, 7, (7, 1))}\", \"assert divisors_and_gcd(11) =...
{ "split": "train", "index": 79988, "acecode_id": "evol_33130", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that takes a string representing the content of a text file and returns the number of words in that content. A word is defined as a sequence of characters separated by whitespace. Your function should handle multiple spaces and new lines c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_words('Hello world') == 2\", \"assert count_words(' ') == 0\", \"assert count_words('This is a test case.') == 5\", \"assert count_words('Word1 Word2 Word3 Word4') == 4\", \"assert count_words('') == 0\", \"assert count_words('SingleWord') == 1\", \"...
{ "split": "train", "index": 79989, "acecode_id": "bigcode_python_fns_43718", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a string of commands and returns a list of executed commands. The commands are separated by commas, and you need to filter out any empty commands. Your function should also support an optional flag that indicates if the com...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert execute_commands('cmd1,cmd2,cmd3') == ['cmd1', 'cmd2', 'cmd3']\", \"assert execute_commands('cmd1,,cmd2,cmd3') == ['cmd1', 'cmd2', 'cmd3']\", \"assert execute_commands(',,') == []\", \"assert execute_commands('cmd1', False) == ['cmd1']\", \"assert execute_co...
{ "split": "train", "index": 79990, "acecode_id": "oss_12931", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that compresses a string using a simple frequency-based method. The function should take a string as input and return a compressed representation of that string. The compression algorithm works by replacing each character in the strin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compress_string('aaabbc') == '3a2b1c'\", \"assert compress_string('') == ''\", \"assert compress_string('abcd') == '1a1b1c1d'\", \"assert compress_string('a') == '1a'\", \"assert compress_string('aaa') == '3a'\", \"assert compress_string('aabbcc') == '2a2b2c...
{ "split": "train", "index": 79991, "acecode_id": "bigcode_python_fns_918", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `registered_metrics` that returns a dictionary of standard metrics. Each key in the dictionary should be a string representing the name of the metric, and the corresponding value should be a string indicating the type of the metric. The function should retu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert registered_metrics() == {'accuracy': 'float', 'precision': 'float', 'recall': 'float', 'f1_score': 'float', 'roc_auc': 'float'}\", \"assert len(registered_metrics()) == 5\", \"assert 'accuracy' in registered_metrics()\", \"assert 'precision' in registered_me...
{ "split": "train", "index": 79992, "acecode_id": "bigcode_python_fns_19038", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with controlling a set of 24 LED channels, each capable of a PWM duty cycle value ranging from 0 to 4095. Implement a function `set_pwm(channel: int, value: int) -> None` that sets the PWM duty cycle for a specified channel. The function should ensure that the ch...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_pwm(0, 1000) == None\", \"assert set_pwm(1, 2048) == None\", \"assert set_pwm(2, 4095) == None\", \"assert set_pwm(3, 0) == None\", \"assert set_pwm(4, 3500) == None\", \"assert set_pwm(23, 500) == None\", \"assert set_pwm(10, 4095) == None\", \"assert s...
{ "split": "train", "index": 79993, "acecode_id": "oss_13014", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that calculates the expiration time of a DNS response based on the given time-to-live (TTL) value. The expiration time is determined by adding the current time in milliseconds to the TTL value in seconds, which should be converted to mill...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_expiration_time(1) == 1000 + 1000\", \"assert get_expiration_time(5) == 1000 + 5000\", \"assert get_expiration_time(10) == 1000 + 10000\", \"assert get_expiration_time(0) == 1000 + 0\", \"assert get_expiration_time(2) == 1000 + 2000\", \"assert get_expir...
{ "split": "train", "index": 79994, "acecode_id": "oss_23861", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary of user IDs where each user ID maps to a task value. Your task is to create a function that takes this dictionary as input and returns a new dictionary where each user ID maps to a list containing the user's name and email address. The names and email...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_user_info({1: 'task1', 2: 'task2', 3: 'task3'}) == {1: ['John Doe', 'john@example.com'], 2: ['Jane Smith', 'jane@example.com'], 3: ['Bob Johnson', 'bob@example.com']}\", \"assert get_user_info({1: 'task1', 4: 'task2'}) == {1: ['John Doe', 'john@example.c...
{ "split": "train", "index": 79995, "acecode_id": "bigcode_python_fns_652", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a subscription management system for a pub-sub architecture. Your function should take a list of subscription events and a list of unsubscribe events, both as strings. The function should return a list of remaining subscrip...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_subscriptions(['event1', 'event2', 'event3'], ['event2', 'event1']) == ['event3']\", \"assert manage_subscriptions(['a', 'b', 'c', 'd'], ['b', 'd']) == ['a', 'c']\", \"assert manage_subscriptions(['subscription1', 'subscription2'], ['subscription1', '...
{ "split": "train", "index": 79996, "acecode_id": "bigcode_python_fns_49515", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `photo_to_remember` that takes a list of tuples `T` as input. Each tuple in the list represents a photo, where the first element is the photo's importance (a positive integer) and the second element is the photo's timestamp (a positiv...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert photo_to_remember([(3, 123), (1, 456), (2, 789)]) == 123\", \"assert photo_to_remember([(5, 100), (7, 200), (7, 150)]) == 150\", \"assert photo_to_remember([(1, 1000), (2, 500), (1, 1500)]) == 500\", \"assert photo_to_remember([(4, 300), (4, 200), (2, 600)])...
{ "split": "train", "index": 79997, "acecode_id": "oss_12233", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 2D array (matrix) of integers, write a function `find_distinct(matrix)` that returns a dictionary containing the distinct elements of the matrix as keys and their corresponding positions (row, column) as values. If an element appears more than once, it should not be inc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_distinct([[1, 1], [1, 1]]) == {}\", \"assert find_distinct([[2, 2, 3], [3, 4, 4], [5, 5, 5]]) == {}\", \"assert find_distinct([[1, 2], [2, 3], [3, 1]]) == {}\", \"assert find_distinct([[1, 0, 0], [1, 2, 2], [2, 0, 1]]) == {}\", \"assert find_distinct([[...
{ "split": "train", "index": 79998, "acecode_id": "evol_16059", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with creating a custom exception class and implementing a program that utilizes this exception to handle specific error conditions. Create a Python class called `CustomError` that inherits from the built-in `Exception` class. The `CustomError` class should have a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_value(-1) == 'Negative value not allowed'\", \"assert validate_value(101) == 'Value too large'\", \"assert validate_value(0) == '0'\", \"assert validate_value(50) == '50'\", \"assert validate_value(100) == '100'\", \"assert validate_value(-10) == 'N...
{ "split": "train", "index": 79999, "acecode_id": "oss_36375", "num_tests": 16 }