data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a basic traffic management system. The function `traffic_management` takes a list of integers representing the number of vehicles on different roads and returns the total number of vehicles across all roads. Each road is re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert traffic_management([10, 5, 15]) == 30\", \"assert traffic_management([0, 0, 0]) == 0\", \"assert traffic_management([1, 2, 3]) == 6\", \"assert traffic_management([100, 200, 300]) == 600\", \"assert traffic_management([5]) == 5\", \"assert traffic_management... | {
"split": "train",
"index": 67500,
"acecode_id": "bigcode_python_fns_27991",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists: `lr_array` and `batch_loss`. The `lr_array` represents a series of learning rates used during training iterations, while `batch_loss` represents the corresponding losses obtained after each iteration. Write a function `calculate_min_loss(lr_array: List[... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_min_loss([0.001, 0.01, 0.1, 1.0], [0.5, 0.3, 0.1, 0.4]) == (0.1, 0.1)\", \"assert calculate_min_loss([0.1, 0.01, 0.001, 0.1], [0.4, 0.3, 0.2, 0.2]) == (0.001, 0.2)\", \"assert calculate_min_loss([0.1, 0.2, 0.3, 0.4], [0.5, 0.5, 0.5, 0.5]) == (0.1, ... | {
"split": "train",
"index": 67501,
"acecode_id": "bigcode_python_fns_48204",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a representation of a grid of wells, where each row represents a well and each item represents a unit of water. The value '1' denotes the presence of one unit of water. Your task is to calculate the total number of hours needed to extract all the water from the gr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert minTimeToEmptyWells([[0,0,1,0], [0,1,0,0], [1,1,1,1]], 1) == 6\", \"assert minTimeToEmptyWells([[0,0,1,1], [0,0,0,0], [1,1,1,1], [0,1,1,1]], 2) == 5\", \"assert minTimeToEmptyWells([[0,0,0], [0,0,0]], 5) == 0\", \"assert minTimeToEmptyWells([[1,1,1], [1,1,1]... | {
"split": "train",
"index": 67502,
"acecode_id": "evol_18769",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the scores of a model on multiple test cases. Your task is to implement a function that calculates the average score of these test cases and also determines the maximum score achieved. The function should return both the average sco... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_and_max([70, 80, 90]) == (80.0, 90)\", \"assert calculate_average_and_max([10, 20, 30]) == (20.0, 30)\", \"assert calculate_average_and_max([100, 90, 85, 95]) == (92.5, 100)\", \"assert calculate_average_and_max([50, 60, 70, 80, 90]) == (70... | {
"split": "train",
"index": 67503,
"acecode_id": "bigcode_python_fns_23333",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `generate_triangular_numbers(n)` that takes an integer n and returns a list of the first n triangular numbers. A triangular number is defined as T(n) = n * (n + 1) / 2, where n is a positive integer starting from 1. For example, the first triangular number is T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_triangular_numbers(1) == [1]\", \"assert generate_triangular_numbers(2) == [1, 3]\", \"assert generate_triangular_numbers(3) == [1, 3, 6]\", \"assert generate_triangular_numbers(4) == [1, 3, 6, 10]\", \"assert generate_triangular_numbers(5) == [1, 3... | {
"split": "train",
"index": 67504,
"acecode_id": "evol_10621",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing counts of emails in different mailboxes. Write a function `get_total_email_count(email_counts: List[int]) -> int` that calculates the total number of emails across all mailboxes. The function should take one argument: a list of inte... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_total_email_count([10, 5, 20]) == 35\", \"assert get_total_email_count([0, 0, 0]) == 0\", \"assert get_total_email_count([1]) == 1\", \"assert get_total_email_count([100, 200, 300]) == 600\", \"assert get_total_email_count([999, 1]) == 1000\", \"assert g... | {
"split": "train",
"index": 67505,
"acecode_id": "bigcode_python_fns_23810",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the process of downloading a file. The function should check if a user is logged in and if they have the correct permissions to download a specific file. Your function should take two parameters: a boolean 'is_logged_in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert download_file(True, True, 'report.pdf') == 'Downloading report.pdf'\", \"assert download_file(True, False, 'report.pdf') == 'Access Denied'\", \"assert download_file(False, True, 'report.pdf') == 'Access Denied'\", \"assert download_file(False, False, 'repor... | {
"split": "train",
"index": 67506,
"acecode_id": "bigcode_python_fns_25476",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a graph that represents relationships between biological entities. Your function should add nodes and edges to the graph based on the predecessors of a given node. Specifically, you are provided with a graph object and a node. For each predecessor o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_nodes_and_edges_to_graph(graph, 'A', universe) is None\", \"assert graph.has_node('B') == True\", \"assert graph.has_node('C') == True\", \"assert graph.has_edge('B', 'A') == True\", \"assert graph.has_edge('C', 'A') == True\", \"assert graph.number_of_n... | {
"split": "train",
"index": 67507,
"acecode_id": "oss_20803",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of dictionaries representing networking clients and returns a formatted string that contains the IP address, port, and an enabled/disabled status for each client. Each dictionary in the list contains a key 'ip' for the c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_clients_info([{'ip': '192.168.1.1', 'port': 8080, 'enabled': True}]) == 'IP: 192.168.1.1, Port: 8080, Enabled: Yes'\", \"assert format_clients_info([{'ip': '10.0.0.1', 'port': 1234, 'enabled': False}]) == 'IP: 10.0.0.1, Port: 1234, Enabled: No'\", \"a... | {
"split": "train",
"index": 67508,
"acecode_id": "oss_34568",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that extracts ticker symbols from a given HTML table represented as a string. The function should take this HTML table as input and return a list of ticker symbols found in the table. The HTML table is structured as follows: <table... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_tickers('<table><tr><th>Company</th><th>Ticker</th><th>Price</th></tr><tr><td>Company A</td><td>COMP_A</td><td>$100</td></tr><tr><td>Company B</td><td>COMP_B</td><td>$150</td></tr></table>') == ['COMP_A', 'COMP_B']\", \"assert extract_tickers('<table... | {
"split": "train",
"index": 67509,
"acecode_id": "oss_20505",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `multiply_numbers(*args)` that accepts multiple lists of integers and/or floating point numbers. The function should return the product of all numbers in all provided lists. If any input is not a list, contains elements that are not numbers, or is an empty ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multiply_numbers([1, 2, 3], [4, 5]) == 120\", \"assert multiply_numbers([0], [1, 2]) == 0\", \"assert multiply_numbers([1, 2], [3, 4], [5]) == 120\", \"assert multiply_numbers([1.0, 2.0], [3.0], [4.0]) == 24.0\", \"assert multiply_numbers([1, 2], [3, 4], [0]... | {
"split": "train",
"index": 67510,
"acecode_id": "evol_19752",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that resizes an image based on a given sample. The function takes in a sample, which is a dictionary containing the image size information, as well as the desired output size. The sample dictionary contains the following key-value pai... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert resize_image({'size': [100, 200]}, [300, 400]) == [300, 400]\", \"assert resize_image({'size': [300, 400]}, [300, 400]) == [300, 400]\", \"assert resize_image({'size': [200, 150]}, [100, 50]) == [200, 150]\", \"assert resize_image({'size': [500, 300]}, [600,... | {
"split": "train",
"index": 67511,
"acecode_id": "oss_37501",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers `bgr` and `oflow`, each containing 6 elements, your task is to create a function `visualize_warp(bgr: List[int], oflow: List[int]) -> float` that computes the average of the absolute values of the elements in the 5th index (index 4) of both lists and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert visualize_warp([0, 0, 0, 0, 255, 255], [0, 0, 0, 0, 255, 255]) == 255.0\", \"assert visualize_warp([0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]) == 0.0\", \"assert visualize_warp([255, 255, 255, 255, 255, 255], [0, 0, 0, 0, 0, 0]) == 127.5\", \"assert visualize_wa... | {
"split": "train",
"index": 67512,
"acecode_id": "bigcode_python_fns_35017",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that accepts a variable number of arguments and calculates the total number of bytes used by all the given arguments. Each argument can be of any data type, including integers, strings, lists, and dictionaries. The function should return ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_bytes(100, [1, 2, 3, 4, 5], 'abcdefg') == 39\", \"assert calculate_total_bytes() == 0\", \"assert calculate_total_bytes('a') == 1\", \"assert calculate_total_bytes(['one', 'two'], {'key': 'value'}) == 28\", \"assert calculate_total_bytes(10, ... | {
"split": "train",
"index": 67513,
"acecode_id": "bigcode_python_fns_20735",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function `send_email` that takes four parameters: `recipient_name`, `recipient_email`, `subject`, and `message`. The function should format an email message addressed to the recipient with the provided subject and message body. The function should return the formatt... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert send_email('John Smith', 'john@example.com', 'Hello World', 'This is a test email.') == 'Hello John Smith,\\\\n\\\\nThis is a test email.'\", \"assert send_email('Alice', 'alice@example.com', 'Greetings', 'Welcome to our service!') == 'Hello Alice,\\\\n\\\\n... | {
"split": "train",
"index": 67514,
"acecode_id": "evol_5307",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that searches for files containing a specific keyword within a given list of file paths. Your function should return a list of all file paths that match the keyword. The function should take two parameters: a list of file paths and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert list_all_files(['file1.txt', 'file2.txt', 'keyword_file.txt'], 'keyword') == ['keyword_file.txt']\", \"assert list_all_files(['test.doc', 'example.txt', 'sample_keyword.doc'], 'keyword') == ['sample_keyword.doc']\", \"assert list_all_files(['data.csv', 'info... | {
"split": "train",
"index": 67515,
"acecode_id": "oss_21844",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `query_data(database: str) -> List[Dict[str, Any]]` that simulates querying a database and returns a list of dictionaries representing the rows of data. Each dictionary should contain the columns 'id', 'name', and 'age' with sample values. The function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert query_data('test_database') == [{'id': 1, 'name': 'Alice', 'age': 30}, {'id': 2, 'name': 'Bob', 'age': 25}, {'id': 3, 'name': 'Charlie', 'age': 35}]\", \"assert query_data('test_database') != [{'id': 1, 'name': 'Alice', 'age': 31}]\", \"assert len(query_data... | {
"split": "train",
"index": 67516,
"acecode_id": "evol_19475",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `convert_hex_to_binary_and_back(hex_string: str) -> str` that takes a hexadecimal string as input and converts it to its binary representation, then back to its hexadecimal representation. The function should return the final hexadecimal output. If the inpu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_hex_to_binary_and_back('A') == 'A'\", \"assert convert_hex_to_binary_and_back('F') == 'F'\", \"assert convert_hex_to_binary_and_back('1A') == '1A'\", \"assert convert_hex_to_binary_and_back('2B') == '2B'\", \"assert convert_hex_to_binary_and_back('10... | {
"split": "train",
"index": 67517,
"acecode_id": "evol_28097",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that filters a list of plugin names based on a blacklist and a condition regarding their backreference. Write a function `filter_plugin_names` that takes the following parameters: \n\n- `plugin_names`: a list of strings representing the n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_plugin_names(['plugin1', 'plugin2', 'default', 'plugin3'], None, False) == ['plugin1', 'plugin2', 'plugin3']\", \"assert filter_plugin_names(['plugin1', 'plugin2', 'default', 'plugin3'], 'plugin2', False) == ['plugin1', 'plugin3']\", \"assert filter_p... | {
"split": "train",
"index": 67518,
"acecode_id": "bigcode_python_fns_37093",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates rendering a webpage for a sign-up process. The function, `render_signup_page`, should take no parameters and return a string that indicates the page is loaded successfully. The returned string should be 'Sign Up Page Loaded... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert render_signup_page() == 'Sign Up Page Loaded'\", \"assert render_signup_page() == 'Sign Up Page Loaded'\", \"assert render_signup_page() == 'Sign Up Page Loaded'\", \"assert render_signup_page() == 'Sign Up Page Loaded'\", \"assert render_signup_page() == 'S... | {
"split": "train",
"index": 67519,
"acecode_id": "bigcode_python_fns_7185",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that determines whether an object can achieve flight based on a set of criteria. The function should be defined as follows: \n\n```python\ndef can_it_fly(q, w, x, y, z):\n``` \n\nThe parameter `q` is a nested list containing integers ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_it_fly([1, 'a', 2, 'b'], 5, 6, 7, 500) == False\", \"assert can_it_fly([3, '2a', 2, '3b', 3], 1, 4, 8, 500) == False\", \"assert can_it_fly([3, 'a'], 5, 3, 4, 400) == True\", \"assert can_it_fly([5, 'c', 5, 'd'], 10, 3, 6, 200) == False\", \"assert can_i... | {
"split": "train",
"index": 67520,
"acecode_id": "evol_1317",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers `A`, write a function `rearrange_max_to_front` that rearranges the elements of the list such that the element with the maximum absolute value is moved to the front of the list. If there are multiple elements with the same maximum absolute value, the ele... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rearrange_max_to_front([-1, -3, 2, 5, -5]) == [5, -1, -3, 2, -5]\", \"assert rearrange_max_to_front([1, -1, 2, -2, 3, -3]) == [3, 1, -1, 2, -2, -3]\", \"assert rearrange_max_to_front([0, 0, 0, 0]) == [0, 0, 0, 0]\", \"assert rearrange_max_to_front([1, 2, 3, ... | {
"split": "train",
"index": 67521,
"acecode_id": "oss_10620",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `get_next_element(elements: List[int]) -> Iterator[int]` that returns a custom iterator. Each time the iterator is called, it should return the next integer from the list. If there are no more integers in the list, it should raise ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_next_element([1, 2, 3]).__next__() == 1\", \"assert get_next_element([10, 20]).__next__() == 10\", \"assert get_next_element([5]).__next__() == 5\", \"assert get_next_element([100, 200, 300]).__next__() == 100\", \"assert get_next_element(['a', 'b', 'c']... | {
"split": "train",
"index": 67522,
"acecode_id": "oss_23700",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a function `sieve_of_eratosthenes(N)` that takes a positive integer 'N' (N > 2) as input and returns a list of all prime numbers from 2 up to N using the Sieve of Eratosthenes algorithm. The function should only return the prime numbers in ascending order. You can ass... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sieve_of_eratosthenes(3) == [2, 3]\", \"assert sieve_of_eratosthenes(4) == [2, 3]\", \"assert sieve_of_eratosthenes(5) == [2, 3, 5]\", \"assert sieve_of_eratosthenes(10) == [2, 3, 5, 7]\", \"assert sieve_of_eratosthenes(11) == [2, 3, 5, 7, 11]\", \"assert si... | {
"split": "train",
"index": 67523,
"acecode_id": "bigcode_python_fns_12054",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a dictionary containing information about a webpage. The function should accept two parameters: a string `page_title` representing the title of the page, and a string `template_name` representing the name of the template to... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_webpage_info('Home', 'index.html') == {'site_title': 'Home', 'template': 'index.html'}\", \"assert generate_webpage_info('About Us', 'about.html') == {'site_title': 'About Us', 'template': 'about.html'}\", \"assert generate_webpage_info('Contact', '... | {
"split": "train",
"index": 67524,
"acecode_id": "bigcode_python_fns_26768",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of lists of integers and an integer x, your task is to implement a function that returns a list of integers that appear exactly x times across all the lists combined. The order of the elements in the output list should be the same as the order of their first appear... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_elements([[1, 2, 3], [4, 5], [6]], 1) == [1, 2, 3, 4, 5, 6]\", \"assert find_elements([[1, 2], [2, 3, 4], [4, 5]], 1) == [1, 3, 5]\", \"assert find_elements([[7], [7], [7]], 3) == [7]\", \"assert find_elements([[4, 4, 4], [5, 5], [5, 6]], 1) == [6]\", \... | {
"split": "train",
"index": 67525,
"acecode_id": "oss_13235",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, you need to implement a function that converts this list into a single string. Each integer in the list should be converted to a string and separated by a comma and a space. Note that there should be no trailing comma and space at the end of the string... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert list_to_string([1, 2, 3]) == '1, 2, 3'\", \"assert list_to_string([10, 20, 30, 40]) == '10, 20, 30, 40'\", \"assert list_to_string([-1, -2, -3]) == '-1, -2, -3'\", \"assert list_to_string([0]) == '0'\", \"assert list_to_string([]) == ''\", \"assert list_to_s... | {
"split": "train",
"index": 67526,
"acecode_id": "bigcode_python_fns_34018",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of complex numbers represented as tuples (real, imaginary), write a function that generates a dictionary of complex conjugate pairs. The keys of the dictionary should be the original complex number, and the values should be its complex conjugate. For example, if th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_complex_conjugates([(1, 2), (3, 4)]) == {(1, 2): (1, -2), (3, 4): (3, -4)}\", \"assert generate_complex_conjugates([(0, 0), (1, 1)]) == {(0, 0): (0, 0), (1, 1): (1, -1)}\", \"assert generate_complex_conjugates([(5, 6)]) == {(5, 6): (5, -6)}\", \"ass... | {
"split": "train",
"index": 67527,
"acecode_id": "bigcode_python_fns_37198",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a recursive function in Python to find the sum of all odd numbers between 0 and a given non-negative integer. The function should return an error message if the input is not a non-negative integer. If the input is valid, return the sum of all odd numbers up to that intege... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert recursive_sum_odd(0) == 0\", \"assert recursive_sum_odd(1) == 1\", \"assert recursive_sum_odd(2) == 1\", \"assert recursive_sum_odd(3) == 4\", \"assert recursive_sum_odd(4) == 4\", \"assert recursive_sum_odd(5) == 9\", \"assert recursive_sum_odd(6) == 9\", \... | {
"split": "train",
"index": 67528,
"acecode_id": "evol_32329",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `make_palindrome(s: str) -> str` that finds the shortest palindrome that begins with the supplied string. The function should ignore case sensitivity and any non-alphanumeric characters. The algorithm to achieve this is as follows: first, identify the longe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert make_palindrome('') == ''\", \"assert make_palindrome('cat') == 'catac'\", \"assert make_palindrome('cata') == 'catac'\", \"assert make_palindrome('race') == 'racecar'\", \"assert make_palindrome('madam') == 'madam'\", \"assert make_palindrome('12321') == '1... | {
"split": "train",
"index": 67529,
"acecode_id": "evol_22997",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a data processing algorithm that generates a list of paths based on specific parameters. Your function should create a list of unique paths, where each path is constructed using a constant namespace 'perfsonar', a provided key prefix, and a gene... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_paths(1, 'test_prefix', None, 100) == [['perfsonar', 'test_prefix', 'metadata_key_0']]\", \"assert generate_paths(2, 'example', 'summary', 200) == [['perfsonar', 'example', 'metadata_key_0', 'summary', '200'], ['perfsonar', 'example', 'metadata_key_... | {
"split": "train",
"index": 67530,
"acecode_id": "oss_10072",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of calibration data, where each entry is a dictionary containing various fields. Your goal is to filter out the entries that fall within a specified range of Modified Julian Dates (MJD). Implement a function `filter_calibration_data(data: List[Dict[str, Any... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_calibration_data([{'mjd1': 55600, 'mjd2': 56860, 'name': 'test1', 'frames': 'frame1'}, {'mjd1': 57000, 'mjd2': 58000, 'name': 'test2', 'frames': 'frame2'}], 55600, 57000) == [{'mjd1': 55600, 'mjd2': 56860, 'name': 'test1', 'frames': 'frame1'}]\", \"as... | {
"split": "train",
"index": 67531,
"acecode_id": "bigcode_python_fns_16904",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function `reverse_alpha_string(s: str) -> str` that takes a string `s` as input and returns the string in reverse order, excluding any numerical values and special characters. The output should only include the alphabetic characters from the input string, presented ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_alpha_string('Hello123!') == 'olleH'\", \"assert reverse_alpha_string('Python@3.9') == 'nohtyP'\", \"assert reverse_alpha_string('12345!@#') == ''\", \"assert reverse_alpha_string('abc!def?ghi') == 'ihgfedcba'\", \"assert reverse_alpha_string('a1b2c3... | {
"split": "train",
"index": 67532,
"acecode_id": "evol_2671",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a trading order request based on the order type, price, volume, symbol, and exchange. The function should take the following parameters: an integer `orderType` (0 for BUY, 1 for SELL, 2 for SELL_TODAY, 3 for SHORT, 4 for CO... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_order_request(0, 100.0, 10, 'AAPL', 'NASDAQ') == {'direction': '0', 'offset': '0', 'symbol': 'AAPL', 'volume': 10, 'price': 100.0, 'hedgeflag': '1', 'ordertype': '1', 'exchange': 'NASDAQ'}\", \"assert generate_order_request(1, 150.5, 5, 'GOOGL', 'NY... | {
"split": "train",
"index": 67533,
"acecode_id": "bigcode_python_fns_2811",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers `nums` and a variable `k`. If `k` is equal to the string 'rev', you need to reverse the list `nums`. If `k` is an integer, you should perform the following operations based on the value of `k`: If `k` is even, remove the element at index `k` fro... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert perform_operation([1, 2, 3, 4, 5], 'rev') == [5, 4, 3, 2, 1]\", \"assert perform_operation([1, 2, 3, 4, 5], 3) == [1, 2, 3, 8, 5]\", \"assert perform_operation([10, 20, 30, 40], 'rev') == [40, 30, 20, 10]\", \"assert perform_operation([10, 20, 30, 40], 0) ==... | {
"split": "train",
"index": 67534,
"acecode_id": "oss_25705",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the duration in minutes between a start and an end time, given specific parameters. Write a function `calculate_duration(task_name: str, start_date: str, start_time: str, end_date: str, end_time: str, message: str) -> int` that takes the followin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_duration('Task 1', '2023-10-01', '08:00', '2023-10-01', '10:00', 'First task duration') == 120\", \"assert calculate_duration('Task 2', '2023-10-01', '09:00', '2023-10-01', '09:30', 'Second task duration') == 30\", \"assert calculate_duration('Task... | {
"split": "train",
"index": 67535,
"acecode_id": "bigcode_python_fns_41061",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `render_variable` that takes two parameters: `context` (a dictionary) and `raw` (can be of any type). The function should process the `raw` input based on its type. If `raw` is `None`, the function should return `None`. If `raw` is a string, it should retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert render_variable({}, None) == None\", \"assert render_variable({}, 'test') == render_string({}, 'test')\", \"assert render_variable({}, {'key1': 'value1'}) == {'key1': render_string({}, 'value1')}\", \"assert render_variable({}, {'key1': None}) == {'key1': No... | {
"split": "train",
"index": 67536,
"acecode_id": "bigcode_python_fns_35959",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function `freq_counter(nested_lst: List[Union[str, int]], word: str) -> int` that examines a nested list containing strings and integers, and returns the frequency of a specified word within it. The function should count complete matches of the word as well as pa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert freq_counter(['hello', ['world', 'python', 3, 'hello'], ['hello', 'python', 'world'], 2], 'hello') == 3\", \"assert freq_counter(['grape', 'grapefruit', 'banana'], 'grape') == 2\", \"assert freq_counter(['orange', 'banana', 5, 'grapefruit'], 'grapefruit') ==... | {
"split": "train",
"index": 67537,
"acecode_id": "evol_19859",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a grid represented as a 2D integer array where 0 represents an empty cell and 1 represents an obstacle. You start at the top-left corner of the grid (0, 0) and need to reach the bottom-right corner (n-1, m-1). Write a function `findShortestPath(grid: List[List[int... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert findShortestPath([[0,0,0],[0,1,0],[0,0,0]]) == 4\", \"assert findShortestPath([[0,0,0],[0,0,0],[0,0,0]]) == 4\", \"assert findShortestPath([[0]]) == 0\", \"assert findShortestPath([[0,1],[1,1]]) == -1\", \"assert findShortestPath([[1,1],[1,1]]) == -1\"]}"
} | {
"split": "train",
"index": 67538,
"acecode_id": "evol_0",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a Python function that generates the Fibonacci sequence up to a specified positive integer n. The function should return a list of Fibonacci numbers that are less than n. Do not use recursion or any built-in Python libraries.\nPlease reason step by step, then write a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(1) == []\", \"assert fibonacci(5) == [0, 1, 1, 2, 3]\", \"assert fibonacci(6) == [0, 1, 1, 2, 3, 5]\", \"assert fibonacci(7) == [0, 1, 1, 2, 3, 5]\", \"assert fibonacci(10) == [0, 1, 1, 2, 3, 5, 8]\", \"assert fibonacci(11) == [0, 1, 1, 2, 3, 5, 8]... | {
"split": "train",
"index": 67539,
"acecode_id": "evol_32707",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given two integers representing the plate number and fiber number, return a dictionary containing the DLA wavelengths and the corresponding mean column density predictions based on predefined parameters for two DLAs. The first DLA has a wavelength range of (3925, 4025) and the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_dla_info(4484, 364) == {'DLA1': ((3925, 4025), 1.5), 'DLA2': ((4100, 4240), 2.0)}\", \"assert calculate_dla_info(1234, 567) == {'DLA1': ((3925, 4025), 1.5), 'DLA2': ((4100, 4240), 2.0)}\", \"assert calculate_dla_info(1000, 1) == {'DLA1': ((3925, 40... | {
"split": "train",
"index": 67540,
"acecode_id": "bigcode_python_fns_38152",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with extracting placeholder names from a URL pattern for a web application. A URL pattern can contain dynamic URL segments wrapped in curly braces, such as in the pattern '/users/{user_id}'. Your task is to implement a function `parse_url_pattern` that takes a UR... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_url_pattern('/users/{user_id}') == ['user_id']\", \"assert parse_url_pattern('/products/{category}/{product_id}') == ['category', 'product_id']\", \"assert parse_url_pattern('/home') == []\", \"assert parse_url_pattern('/api/{version}/data/{data_id}') ... | {
"split": "train",
"index": 67541,
"acecode_id": "oss_10985",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `fibfib(n: int) -> int` that calculates the n-th value of the FibFib series. The FibFib series is defined as follows: fibfib(0) == 0, fibfib(1) == 0, fibfib(2) == 1, and for n > 2, fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3). Your implementation sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibfib(0) == 0\", \"assert fibfib(1) == 0\", \"assert fibfib(2) == 1\", \"assert fibfib(3) == 1\", \"assert fibfib(4) == 2\", \"assert fibfib(5) == 4\", \"assert fibfib(6) == 7\", \"assert fibfib(7) == 13\", \"assert fibfib(8) == 24\", \"assert fibfib(9) == ... | {
"split": "train",
"index": 67542,
"acecode_id": "evol_7221",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates a URI for deleting a method configuration in a specified workspace. The function should take four string parameters: 'namespace', 'workspace', 'cnamespace', and 'config'. The output should be a formatted string that fol... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_uri('project1', 'workspaceA', 'methodNamespace1', 'config1') == 'workspaces/project1/workspaceA/method_configs/methodNamespace1/config1'\", \"assert generate_uri('namespace2', 'workspaceB', 'methodNamespace2', 'config2') == 'workspaces/namespace2/wo... | {
"split": "train",
"index": 67543,
"acecode_id": "bigcode_python_fns_20401",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string that contains sample data formatted in a specific way. The first line of the string contains the number of samples, denoted by the keyword 'numberOfSamples' followed by an equal sign and the actual number. The subsequent lines contain data for each sample... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_samples('numberOfSamples=2\\\\n Sample 1 Data\\\\n Sample 2 Data') == [['Sample 1 Data'], ['Sample 2 Data']]\", \"assert process_samples('numberOfSamples=1\\\\n Single Sample Data') == [['Single Sample Data']]\", \"assert process_samples('numberOfSam... | {
"split": "train",
"index": 67544,
"acecode_id": "oss_2973",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a 4x4 square matrix containing integers, write a function `solve(matrix)` that rearranges the elements in such a way that each number from 1 to 4 appears exactly once in each row and exactly once in each column. If it's not possible to achieve this configuration, the func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert solve([[1, 2, 3, 4], [4, 3, 2, 1], [2, 1, 4, 3], [3, 4, 1, 2]]) == True\", \"assert solve([[1, 1, 1, 1], [2, 2, 2, 2], [3, 3, 3, 3], [4, 4, 4, 4]]) == False\", \"assert solve([[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]) == True\", \"assert solve... | {
"split": "train",
"index": 67545,
"acecode_id": "evol_5622",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of home automation presets. Each preset is represented as a dictionary with a unique name and a list of actions to be executed when the preset is activated. Each action is represented as a dictionary with a ty... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_service_calls({'Preset1': [{'type': 'call_service', 'domain': 'input_select', 'service': 'select_option', 'service_data': {'entity_id': 'input_select.masterbedroom_fireplace_duration', 'option': '30 Minutes'}}], 'Preset2': [{'type': 'call_service', 'doma... | {
"split": "train",
"index": 67546,
"acecode_id": "oss_18885",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with setting up an environment for a local deployment configuration. Given a deployment name, return a dictionary containing environment variable names as keys and their corresponding values as entries. The deployment name will be 'local-grapl'. The required envi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert setup_env('local-grapl') == {'AWS_REGION': 'us-east-1', 'S3_ENDPOINT': 'http://localhost:4566', 'S3_ACCESS_KEY_ID': 'test', 'S3_ACCESS_KEY_SECRET': 'test', 'SQS_ENDPOINT': 'http://localhost:4566', 'SQS_ACCESS_KEY_ID': 'test', 'SQS_ACCESS_KEY_SECRET': 'test'}... | {
"split": "train",
"index": 67547,
"acecode_id": "bigcode_python_fns_31558",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that retrieves elements from a list based on a given condition. Write a function `retrieve_elements` that takes two parameters: a list of integers `arr` and a single integer `threshold`. The function should return a new list containin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert retrieve_elements([1, 5, 10, 3], 4) == [5, 10]\", \"assert retrieve_elements([1, 2, 3, 4], 5) == []\", \"assert retrieve_elements([10, 20, 30], 15) == [20, 30]\", \"assert retrieve_elements([], 5) == []\", \"assert retrieve_elements([5, 5, 5], 5) == []\", \"... | {
"split": "train",
"index": 67548,
"acecode_id": "oss_22137",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that returns a list of volumes in a library. Each volume is represented as a dictionary with keys 'title' and 'author'. You need to implement a function called 'get_volumes' that takes in a list of tuples, where each tuple represents ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_volumes([('Book1', 'Author1'), ('Book2', 'Author2')]) == [{'title': 'Book1', 'author': 'Author1'}, {'title': 'Book2', 'author': 'Author2'}]\", \"assert get_volumes([]) == []\", \"assert get_volumes([('1984', 'George Orwell')]) == [{'title': '1984', 'auth... | {
"split": "train",
"index": 67549,
"acecode_id": "oss_17271",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a SPARQL query. Your task is to compress this query by replacing all instances of a specific URI with a provided prefix. Write a function `compress_sparql_query(text: str, prefix: str, uri: str) -> str` that takes in three parameters: `text` ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compress_sparql_query('<http://example.org/resource> SELECT * WHERE { ?s ?p <http://example.org/resource> }', 'ex', 'http://example.org/resource') == 'ex: SELECT * WHERE { ?s ?p ex: }'\", \"assert compress_sparql_query('SELECT * WHERE { ?s ?p <http://example... | {
"split": "train",
"index": 67550,
"acecode_id": "bigcode_python_fns_21609",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of names and email addresses. The function should take in a list of strings, where each string contains a name and an email address separated by a comma. Your goal is to search for a specific email address within thi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_email_in_list(['John Doe, john@example.com', 'Jane Smith, jane@example.com', 'Bob Johnson, bob@example.com'], 'john@example.com') == '{\\\"name\\\": \\\"John Doe\\\", \\\"email\\\": \\\"john@example.com\\\"}'\", \"assert find_email_in_list(['John Doe, j... | {
"split": "train",
"index": 67551,
"acecode_id": "oss_18479",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the training process of a Named Entity Recognition (NER) model. The function should take the following parameters: `hidden_size` (an integer for the hidden layer size), `learning_rate` (a float for the learning rate), `mini... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert train_ner_model(256, 0.1, 32, 20) == {'hidden_size': 256, 'learning_rate': 0.1, 'mini_batch_size': 32, 'max_epochs': 20, 'is_crf': True}\", \"assert train_ner_model(128, 0.05, 16, 15) == {'hidden_size': 128, 'learning_rate': 0.05, 'mini_batch_size': 16, 'max... | {
"split": "train",
"index": 67552,
"acecode_id": "oss_28371",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a non-negative integer n, implement a function `sum_of_digits_of_factorial(n)` that computes the factorial of n and returns the sum of the digits of that factorial. The factorial of a non-negative integer n, denoted as n!, is the product of all positive integers less than... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_digits_of_factorial(0) == 1\", \"assert sum_of_digits_of_factorial(1) == 1\", \"assert sum_of_digits_of_factorial(2) == 2\", \"assert sum_of_digits_of_factorial(3) == 6\", \"assert sum_of_digits_of_factorial(4) == 6\", \"assert sum_of_digits_of_factor... | {
"split": "train",
"index": 67553,
"acecode_id": "oss_16094",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of buildings in a skyline. Your task is to implement a function `max_height(buildings: List[int]) -> int` that returns the maximum height of any building in the skyline. The input list will contain at least one height an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_height([1, 3, 2, 5, 4]) == 5\", \"assert max_height([10, 20, 30, 40, 50]) == 50\", \"assert max_height([5, 4, 3, 2, 1]) == 5\", \"assert max_height([7]) == 7\", \"assert max_height([0, 0, 0, 0]) == 0\", \"assert max_height([1, 2, 3, 2, 1]) == 3\", \"asse... | {
"split": "train",
"index": 67554,
"acecode_id": "bigcode_python_fns_43619",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that extracts and processes IPv4 addresses from a list of strings representing lines in LXC (Linux Containers) configuration files. Your function should take a list of strings as input, where each string represents a line from an L... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_ipv4_addresses(['lxc.network.ipv4 = 192.168.0.10/24', 'lxc.network.ipv4 = 192.168.0.10']) == ['192.168.0.10']\", \"assert extract_ipv4_addresses(['lxc.network.ipv4 = 192.168.1.2', 'lxc.network.ipv4 = 192.168.1.3']) == ['192.168.1.2', '192.168.1.3']\"... | {
"split": "train",
"index": 67555,
"acecode_id": "oss_30699",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of tokens and a set of pretrained vocabulary words. The function should count the occurrences of each token in the list and determine how many of those tokens are present in the pretrained vocabulary. Your fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_tokens(['hello', 'world', 'hello'], {'hello', 'world', 'python'}) == (3, 2, 100.0)\", \"assert process_tokens(['a', 'b', 'c'], {'d', 'e', 'f'}) == (3, 3, 0.0)\", \"assert process_tokens(['x', 'y', 'z', 'x', 'y'], {'x', 'y', 'z'}) == (3, 3, 100.0)\", ... | {
"split": "train",
"index": 67556,
"acecode_id": "oss_20247",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple function that validates a music album's details based on specific criteria. The function should take an album represented as a dictionary with the following fields: 'title', 'artist', 'genre', 'release_date', and 'duration'. The function sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_album({'title': 'Greatest Hits', 'artist': 'The Band', 'genre': 'Rock', 'release_date': '2023-10-01', 'duration': 45}) == True\", \"assert is_valid_album({'title': 'New Album', 'artist': 'Artist Name', 'genre': 'Pop', 'release_date': '2022-05-01', '... | {
"split": "train",
"index": 67557,
"acecode_id": "oss_37326",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of positive definite matrices represented as 2D lists. Write a function `cholesky_decomposition(matrices: List[List[List[float]]]) -> List[List[List[float]]]` that returns a list of lower triangular matrices obtained by applying Cholesky decomposition to ea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cholesky_decomposition([[[4, 2], [2, 2]]]) == [[[2.0, 0.0], [1.0, 1.0]]]\", \"assert cholesky_decomposition([[[1]]]) == [[[1.0]]]\", \"assert cholesky_decomposition([[[9, 3], [3, 5]]]) == [[[3.0, 0.0], [1.0, 2.0]]]\", \"assert cholesky_decomposition([[[25, 1... | {
"split": "train",
"index": 67558,
"acecode_id": "bigcode_python_fns_9139",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a seed value, simulate the rolling of two six-sided dice and return the sum of the two dice rolls. The seed value will be an integer that initializes the random number generator to ensure consistent results. Write a function `dice_roll_sum(seed: int) -> int` that takes a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dice_roll_sum(7) in [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]\", \"assert dice_roll_sum(10) in [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]\", \"assert dice_roll_sum(0) in [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]\", \"assert dice_roll_sum(1) in [2, 3, 4, 5, 6, 7, 8, 9, 10, 1... | {
"split": "train",
"index": 67559,
"acecode_id": "oss_22700",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a recursive function that checks whether a given word is a palindrome. A palindrome is a word that reads the same backward as forward. Your function should return True if the word is a palindrome and False otherwise.\nPlease reason step by step, then write a self-cont... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_palindrome('racecar') == True\", \"assert is_palindrome('level') == True\", \"assert is_palindrome('hello') == False\", \"assert is_palindrome('madam') == True\", \"assert is_palindrome('python') == False\", \"assert is_palindrome('') == True\", \"assert ... | {
"split": "train",
"index": 67560,
"acecode_id": "evol_15138",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes in a list of integers and returns a dictionary where each unique integer from the list is a key, and the corresponding value is the number of times that integer appears in the list.\nPlease reason step by step, then write a self-contained Python solu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert list_to_dict([1, 2, 3, 1, 1, 4, 5, 2]) == {1: 3, 2: 2, 3: 1, 4: 1, 5: 1}\", \"assert list_to_dict([5, 5, 5]) == {5: 3}\", \"assert list_to_dict([1, 2, 3]) == {1: 1, 2: 1, 3: 1}\", \"assert list_to_dict([]) == {}\", \"assert list_to_dict([0, 0, 1, 1, 2]) == {... | {
"split": "train",
"index": 67561,
"acecode_id": "evol_14796",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string of lowercase alphabetical characters, implement a function `max_frequency_pair(text: str) -> Tuple[str, int]` that calculates the frequency of unique character pairs in the string and returns the pair with the highest frequency along with its count. If there are ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_frequency_pair('abracadabra') == ('ab', 2)\", \"assert max_frequency_pair('hello') == ('he', 1)\", \"assert max_frequency_pair('aabbcc') == ('aa', 1)\", \"assert max_frequency_pair('a') == ('', 0)\", \"assert max_frequency_pair('abababab') == ('ab', 4)\"... | {
"split": "train",
"index": 67562,
"acecode_id": "evol_216",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing different district names in a city. Your task is to implement a function `process_districts(districts)` that processes this list by performing the following operations: 1. Remove any leading or trailing whitespace from each district ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_districts([' berlin', 'Pankow', 'Lichtenberg', 'Marzahn-Hellersdorf', 'Treptow-Koepenick', ' neukoelln ']) == ['Berlin', 'Lichtenberg', 'Marzahn-Hellersdorf', 'Neukoelln', 'Pankow', 'Treptow-Koepenick']\", \"assert process_districts([' new yor... | {
"split": "train",
"index": 67563,
"acecode_id": "oss_20097",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given the root of a binary tree, implement a function `mid_order` that returns the values of the nodes in the tree in in-order traversal (left, root, right) as a list. You are provided with the definition of the TreeNode class, which represents a node in the binary tree. The cl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert mid_order(TreeNode(1)) == [1]\", \"assert mid_order(TreeNode(1, TreeNode(2))) == [2, 1]\", \"assert mid_order(TreeNode(1, None, TreeNode(3))) == [1, 3]\", \"assert mid_order(TreeNode(1, TreeNode(2), TreeNode(3))) == [2, 1, 3]\", \"assert mid_order(TreeNode(1... | {
"split": "train",
"index": 67564,
"acecode_id": "oss_5243",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a prefixed table name based on an input table name and a suffix. Write a function called `get_prefixed_table_name` that takes two string parameters: `name` (the input table name) and `suffix` (the suffix to append). The fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_prefixed_table_name('users', 'data') == 'users_data'\", \"assert get_prefixed_table_name('employees', 'archive') == 'employees_archive'\", \"assert get_prefixed_table_name('products', '2023') == 'products_2023'\", \"assert get_prefixed_table_name('orders... | {
"split": "train",
"index": 67565,
"acecode_id": "oss_28588",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that sets the company name based on the provided input. The function should take a string as input and return the company name. If the input string is longer than 128 characters, it should truncate the string to 128 characters before retu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_company_name('Tech Innovations Inc.') == 'Tech Innovations Inc.'\", \"assert set_company_name('') == None\", \"assert set_company_name(None) == None\", \"assert set_company_name('Company with special characters @#$%^&*()!') == 'Company with special chara... | {
"split": "train",
"index": 67566,
"acecode_id": "oss_32674",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of integers and returns a new list containing only the even numbers from the original list. Write a function `filter_even_numbers(numbers: List[int]) -> List[int]` that takes a list of integers as input and performs ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 15, 20, 25]) == [10, 20]\", \"assert filter_even_numbers([1, 3, 5, 7]) == []\", \"assert filter_even_numbers([]) == []\", \"assert filter_even_numbers([2, 4, 6]) == [2, 4, 6]... | {
"split": "train",
"index": 67567,
"acecode_id": "oss_37605",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the process of exporting video items to a specified folder structure. The function, `export_item`, should take in a dictionary representing a video item and a string representing the library home directory. The dictionary w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert export_item({'section': 'Movies', 'destination': 'Action', 'filename': 'Inception', 'videoid': '123', 'title': 'Inception'}, '/home/user/library') == '/home/user/library/Movies/Action/Inception.strm'\", \"assert export_item({'section': 'Music', 'destination'... | {
"split": "train",
"index": 67568,
"acecode_id": "bigcode_python_fns_34063",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to implement a function `find_maximum_sum(arr: List[int]) -> int` that returns the maximum sum of any contiguous subarray within the list. A subarray is defined as a non-empty sequence of elements that are contiguous in the origina... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_maximum_sum([-2, -3, -1]) == -1\", \"assert find_maximum_sum([5, 4, -1, 7, 8]) == 23\", \"assert find_maximum_sum([-1, -2, -3, -4]) == -1\", \"assert find_maximum_sum([2, 3, -2, 4]) == 7\", \"assert find_maximum_sum([1]) == 1\", \"assert find_maximum_su... | {
"split": "train",
"index": 67569,
"acecode_id": "bigcode_python_fns_34652",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that counts the occurrences of places in a list. The function should take a list of strings representing place names and a boolean flag indicating whether to count exact matches or not. If the flag is set to true, each unique p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_places([], False) == {}\", \"assert count_places([], True) == {}\", \"assert count_places(['New York', 'New York City', 'Los Angeles', 'San Francisco', 'New York'], False) == {'New York': 3, 'Los Angeles': 1, 'San Francisco': 1}\", \"assert count_place... | {
"split": "train",
"index": 67570,
"acecode_id": "oss_21334",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers, `T1` and `Vvvov`, where `T1` represents the coefficients for a linear transformation and `Vvvov` represents the interaction values between different variables, write a function `calculate_expression(T1: List[int], Vvvov: List[int]) -> str` that comp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_expression([1, 2, 3], [4, 5]) == 'Error: Lists must be of the same length.'\", \"assert calculate_expression([5, 5], [5]) == 'Error: Lists must be of the same length.'\", \"assert calculate_expression([1], [10, 20]) == 'Error: Lists must be of the ... | {
"split": "train",
"index": 67571,
"acecode_id": "bigcode_python_fns_3864",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a list of tuples, where each tuple contains three integers representing the zoom level (z), and the x and y tile coordinates. Your task is to write a Python function that checks if at least one of the provided coordinates has a zoom level of 12 or less. The functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_tiles_present([(10, 100, 200), (14, 50, 75), (12, 80, 160)]) == True\", \"assert check_tiles_present([(16, 10484, 25329), (14, 1234, 5678), (12, 100, 200)]) == True\", \"assert check_tiles_present([(17, 2048, 4096), (18, 123, 456), (19, 789, 101)]) == ... | {
"split": "train",
"index": 67572,
"acecode_id": "oss_34255",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `read_and_print_file_content(content: str) -> None` that takes a string representing the content of a file and prints each line of the content to the standard output. The function should simulate reading a file without actually accessing any file system. Ea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert read_and_print_file_content('Line 1\\\\nLine 2\\\\nLine 3') == None\", \"assert read_and_print_file_content('Hello World!\\\\nThis is a test.') == None\", \"assert read_and_print_file_content('') == None\", \"assert read_and_print_file_content('Single line')... | {
"split": "train",
"index": 67573,
"acecode_id": "bigcode_python_fns_39415",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `reverse_alphabetical_order(strings: List[str]) -> List[str]` that takes a list of five different strings as input and returns a new list containing those strings rearranged in reverse alphabetical order. The input list will always contain exactly five unique s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_alphabetical_order(['apple', 'banana', 'cherry', 'date', 'elderberry']) == ['elderberry', 'date', 'cherry', 'banana', 'apple']\", \"assert reverse_alphabetical_order(['grape', 'fig', 'kiwi', 'lemon', 'mango']) == ['mango', 'lemon', 'kiwi', 'grape', '... | {
"split": "train",
"index": 67574,
"acecode_id": "evol_34384",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that reads data from a string in either JSON or YAML format and converts it into a Python dictionary. The function should take a single string input, which is the content of the JSON or YAML, and return the corresponding dictionary. If th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert load_data('{\\\"key\\\": \\\"value\\\"}') == {'key': 'value'}\", \"assert load_data('key: value') == {'key': 'value'}\", \"assert load_data('{\\\"name\\\": \\\"Alice\\\", \\\"age\\\": 30}') == {'name': 'Alice', 'age': 30}\", \"assert load_data('name: Alice\\... | {
"split": "train",
"index": 67575,
"acecode_id": "bigcode_python_fns_15332",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function `extract_rpc_creds(chain: str) -> dict` that takes a chain name as input and returns a dictionary containing the RPC credentials based on the given chain. The function should handle the following cases: If the `chain` is 'KMD', the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_rpc_creds('KMD') == {'rpcuser': 'kmd_user', 'rpcpassword': 'kmd_pass'}\", \"assert extract_rpc_creds('BTC') == {'rpcuser': 'BTC_user', 'rpcpassword': 'BTC_pass'}\", \"assert extract_rpc_creds('ETH') == {'rpcuser': 'ETH_user', 'rpcpassword': 'ETH_pass... | {
"split": "train",
"index": 67576,
"acecode_id": "oss_5034",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that generates a list of odd numbers between two integers x and y (inclusive of x and exclusive of y). The function should handle erroneous inputs by returning an appropriate error message. If the inputs are not integers, return 'Error: Inputs must be in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert odd_numbers(3, 10) == [3, 5, 7, 9]\", \"assert odd_numbers(1, 5) == [1, 3]\", \"assert odd_numbers(10, 20) == [11, 13, 15, 17, 19]\", \"assert odd_numbers(0, 5) == [1, 3]\", \"assert odd_numbers(-5, 5) == [-5, -3, -1, 1, 3]\", \"assert odd_numbers(7, 7) == [... | {
"split": "train",
"index": 67577,
"acecode_id": "evol_10426",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `get_penultimate_max_and_prime_status(arr)` that returns the penultimate maximum data point from the list and a statement indicating whether that element is prime or not. The output should be a tuple where the first element is the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_penultimate_max_and_prime_status([1, 2, 3, 4, 5]) == (4, 'Not Prime')\", \"assert get_penultimate_max_and_prime_status([10, 20, 30, 40]) == (30, 'Not Prime')\", \"assert get_penultimate_max_and_prime_status([5, 3, 5, 7]) == (5, 'Prime')\", \"assert get_p... | {
"split": "train",
"index": 67578,
"acecode_id": "evol_25828",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of mixed values that can include integers (0 or 1), boolean values (True or False), and Tensor-like objects (simulated as strings for this problem), write a function `evaluate_predicate` that evaluates each element in the list according to the following rules: 1. I... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate_predicate([0, 1, True, False, 'tensor_1', 'tensor_0']) == [False, True, True, False, True, False]\", \"assert evaluate_predicate([1, 0, 'tensor_0', 'tensor_1', True]) == [True, False, False, True, True]\", \"assert evaluate_predicate(['tensor_1', 1,... | {
"split": "train",
"index": 67579,
"acecode_id": "bigcode_python_fns_11289",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that determines whether all the integers in the list are unique. The function should return True if all integers are unique, and False otherwise. For example, given the input list [1, 2, 3, 4], the output should be True, while for the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_unique([1, 2, 3, 4]) == True\", \"assert is_unique([1, 2, 2, 3]) == False\", \"assert is_unique([]) == True\", \"assert is_unique([0]) == True\", \"assert is_unique([-1, -2, -3]) == True\", \"assert is_unique([-1, -1, 0]) == False\", \"assert is_unique([1... | {
"split": "train",
"index": 67580,
"acecode_id": "bigcode_python_fns_16929",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that extracts user attributes from a registration event. The function should take a dictionary representing the event, which contains user attributes such as email and nickname, and return the extracted attributes as a dictionary. You... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_user_attributes({'request': {'userAttributes': {'email': 'user1@example.com', 'nickname': 'user1'}}}) == {'email': 'user1@example.com', 'nickname': 'user1'}\", \"assert extract_user_attributes({'request': {'userAttributes': {'email': 'user2@example.c... | {
"split": "train",
"index": 67581,
"acecode_id": "oss_4979",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `sum_array_elements` that returns the sum of all the elements in the list. For example, if the input list is [1, 2, 3, 4], the output should be 10.\nPlease reason step by step, then write a self-contained Python solution. Give your fin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_array_elements([1, 2, 3, 4]) == 10\", \"assert sum_array_elements([0, 0, 0]) == 0\", \"assert sum_array_elements([-1, -2, -3]) == -6\", \"assert sum_array_elements([5]) == 5\", \"assert sum_array_elements([]) == 0\", \"assert sum_array_elements([100, 200... | {
"split": "train",
"index": 67582,
"acecode_id": "evol_1087",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to calculate the date of the nth occurrence of a specific weekday within a given month and year. The function should take the year, month, weekday (as an integer, where Monday is 0 and Sunday is 6), and the value of n as input, and re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_nth_weekday_date(2015, 10, 3, 1) == 1\", \"assert calculate_nth_weekday_date(2020, 2, 0, 1) == 3\", \"assert calculate_nth_weekday_date(2021, 1, 6, 2) == 10\", \"assert calculate_nth_weekday_date(2022, 10, 6, 1) == 2\", \"assert calculate_nth_weekd... | {
"split": "train",
"index": 67583,
"acecode_id": "oss_24641",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a list of dictionaries representing threshold breaches for various charts over a specified number of days, implement a function that aggregates these breaches by chart name and returns a list of dictionaries. Each dictionary should contain the chart name, the total number... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert aggregate_threshold_breaches([{'chart_name': 'chart1', 'breaches': [{'measure_time': 1478462400, 'value': 115.58}, {'measure_time': 1478462401, 'value': 120.1}]}]) == [{'chart_name': 'chart1', 'total': 2, 'breaches': [{'measure_time': 1478462400, 'value': 11... | {
"split": "train",
"index": 67584,
"acecode_id": "bigcode_python_fns_25297",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a molecular structure represented as a string consisting of letters and numbers, where each letter represents an atom (e.g., 'C' for Carbon, 'O' for Oxygen) and numbers represent the bonds between them. Implement a function `get_bonds(molecular_structure: str) -> ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_bonds('C-C-C') == ['C-C', 'C-C']\", \"assert get_bonds('H2O') == []\", \"assert get_bonds('Na-Cl') == ['Na-Cl']\", \"assert get_bonds('C-C-C-C-C') == ['C-C', 'C-C', 'C-C', 'C-C']\", \"assert get_bonds('C(N)C') == []\", \"assert get_bonds('C-C') == ['C-C'... | {
"split": "train",
"index": 67585,
"acecode_id": "bigcode_python_fns_30591",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Write a function `generate_random_alphanumeric()` that returns a string of five randomly assorted alphanumeric characters. The generated string must contain at least one unique non-repeating digit and one unique uppercase letter. The other three characters can be any alphanumer... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert len(generate_random_alphanumeric()) == 5\", \"assert any(c.isdigit() for c in generate_random_alphanumeric())\", \"assert any(c.isupper() for c in generate_random_alphanumeric())\", \"assert all(c.isalnum() for c in generate_random_alphanumeric())\", \"asser... | {
"split": "train",
"index": 67586,
"acecode_id": "evol_15346",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representation of an XML document, write a function `parse_xml(xml_string: str) -> List[str]` that identifies and flags all errors in the XML structure, including missing tags, unnecessary closing tags, and invalid characters. The function should return a list of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_xml('<root><item>Test</item></root>') == []\", \"assert parse_xml('<root><item>Test</item>') == ['Missing closing tag for <root>']\", \"assert parse_xml('<root><item>Test</item><item>Test2</item></root>') == []\", \"assert parse_xml('<root><item>Test</... | {
"split": "train",
"index": 67587,
"acecode_id": "evol_16447",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `check_user_permission(user_id: int, allowed_groups: List[int]) -> bool` that checks if a user is part of the allowed groups. The function receives two parameters: an integer `user_id` representing the user's ID and a list of integers `al... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_user_permission(1, [1, 2, 3]) == True\", \"assert check_user_permission(4, [1, 2, 3]) == False\", \"assert check_user_permission(2, [1, 2, 3]) == True\", \"assert check_user_permission(3, [1, 2, 3]) == True\", \"assert check_user_permission(5, [6, 7, 8... | {
"split": "train",
"index": 67588,
"acecode_id": "bigcode_python_fns_12992",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a configuration dictionary and returns the adjusted volume settings based on the configuration. The configuration dictionary contains different settings, where the keys represent various mixer settings and the values... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert adjust_volume_settings({'global': {'mixer': 'Master'}, 'volume': 80}) == {'mixer': 'Master', 'volume': 80}\", \"assert adjust_volume_settings({'global': {'mixer': 'PCM'}, 'volume': 50}) == {'mixer': 'PCM', 'volume': 50}\", \"assert adjust_volume_settings({'g... | {
"split": "train",
"index": 67589,
"acecode_id": "oss_26333",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to verify the validity of a given sequence of bytes representing a UTF-8 encoded string. UTF-8 is a variable-width character encoding capable of encoding all valid code points in Unicode using one to four one-byte (8-bit) code units. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_utf8_encoding([197, 130, 1]) == True\", \"assert validate_utf8_encoding([235, 140, 4]) == False\", \"assert validate_utf8_encoding([240, 162, 138, 147]) == True\", \"assert validate_utf8_encoding([255, 255, 255]) == False\", \"assert validate_utf8_e... | {
"split": "train",
"index": 67590,
"acecode_id": "oss_7626",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries, where each dictionary represents a record with various fields. Your task is to create a function that removes any duplicate records from this list based on a specified key. The function should take two parameters: a list of dictionaries `re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_duplicates([{'id': 1, 'name': 'Alice'}, {'id': 2, 'name': 'Bob'}, {'id': 1, 'name': 'Alice'}], 'id') == [{'id': 1, 'name': 'Alice'}, {'id': 2, 'name': 'Bob'}]\", \"assert remove_duplicates([{'id': 1, 'name': 'Alice'}, {'id': 1, 'name': 'Alice'}], 'id'... | {
"split": "train",
"index": 67591,
"acecode_id": "bigcode_python_fns_23402",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a 2D list of integers, where each inner list represents a series of feature values followed by a resource value, implement a function that extracts the feature values and transforms the resource value based on a specified range. The transformation involves rounding the re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_features_and_resources([[1, 2], [3, 4, 5]], (1, 5)) == ([[1], [3, 4]], [2, 5])\", \"assert transform_features_and_resources([[10, 20, 30, 40, 50]], (10, 50)) == ([[10, 20, 30, 40]], [50])\", \"assert transform_features_and_resources([[5, 6, 7, 8]],... | {
"split": "train",
"index": 67592,
"acecode_id": "bigcode_python_fns_40922",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of image file names and their corresponding confidence levels in captioning. Your task is to write a function `process_images(images: List[str], confidence_levels: List[float]) -> Dict[str, float]` that processes this data. The function should return a dict... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_images(['image1.jpg', 'image2.jpg'], [0.95, 0.89]) == {'image1.jpg': 0.95, 'image2.jpg': 0.89}\", \"assert process_images(['image1.jpg'], [0.98]) == {'image1.jpg': 0.98}\", \"assert process_images([], []) == {}\", \"assert process_images(['image1.jpg... | {
"split": "train",
"index": 67593,
"acecode_id": "bigcode_python_fns_33003",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the Jaccard similarity coefficient between two sets of integers. The Jaccard similarity is defined as the size of the intersection divided by the size of the union of the two sets. Write a function `jaccard_similarity(set1, set2)` that takes... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert jaccard_similarity({1, 2, 3}, {2, 3, 4}) == 0.5\", \"assert jaccard_similarity({1, 2, 3}, {1, 2, 3}) == 1.0\", \"assert jaccard_similarity({1, 2, 3}, {4, 5, 6}) == 0.0\", \"assert jaccard_similarity(set(), {1, 2, 3}) == 0.0\", \"assert jaccard_similarity({1,... | {
"split": "train",
"index": 67594,
"acecode_id": "evol_34544",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a custom bubble sort function in Python that sorts a list of floating point numbers in ascending order. The function should handle positive, negative, and zero values without using any built-in or library sorting functions. The function should take a list of floats as... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bubble_sort([3.5, -0.2, 4.6, 0, -1.3, 7.9]) == [-1.3, -0.2, 0, 3.5, 4.6, 7.9]\", \"assert bubble_sort([0, 0, 0, 0]) == [0, 0, 0, 0]\", \"assert bubble_sort([-1.1, -2.2, -3.3]) == [-3.3, -2.2, -1.1]\", \"assert bubble_sort([1.1, 2.2, 3.3]) == [1.1, 2.2, 3.3]\... | {
"split": "train",
"index": 67595,
"acecode_id": "evol_15496",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the number of occurrences of a certain event over a period of time. Your task is to write a function `normalize_coverage(data: List[int], ignore: List[int]) -> List[float]` that normalizes the occurrences by calculating the coverage... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert normalize_coverage([0, 0, 0], [0]) == [0.0, 0.0, 0.0]\", \"assert normalize_coverage([10, 0, 0], [1, 2]) == [1000000.0, 0.0, 0.0]\", \"assert normalize_coverage([500, 500, 500], [0]) == [0.0, 500000.0, 500000.0]\", \"assert normalize_coverage([200, 0, 100], ... | {
"split": "train",
"index": 67596,
"acecode_id": "bigcode_python_fns_34042",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `filter_and_sum` that takes an integer `threshold` and returns the sum of all integers in the list that are greater than the `threshold`. The function should ignore any integers that are less than or equal to the `threshold`. The input... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_and_sum([1, 2, 3, 4, 5], 3) == 9\", \"assert filter_and_sum([10, 20, 30, 40], 25) == 70\", \"assert filter_and_sum([-1, -2, -3, 0, 1], 0) == 1\", \"assert filter_and_sum([5, 6, 7, 8, 9], 10) == 0\", \"assert filter_and_sum([], 5) == 0\", \"assert filt... | {
"split": "train",
"index": 67597,
"acecode_id": "bigcode_python_fns_48701",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to determine the type of a given file based on its extension. The function `determine_file_type` should take a string representing the file name and return a string indicating the type of the file. The recognized file types are 'csv' ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert determine_file_type('contacts.csv') == 'csv'\", \"assert determine_file_type('data.vcf') == 'vcard'\", \"assert determine_file_type('notes.txt') == 'unknown'\", \"assert determine_file_type('image.jpeg') == 'unknown'\", \"assert determine_file_type('file_wit... | {
"split": "train",
"index": 67598,
"acecode_id": "oss_7817",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes an array of integers as input, adds one to each element, and removes any duplicate values from the resulting array. The function should return a new array containing the unique values after the addition. Implement the function with the following sign... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert addOneAndRemoveDuplicates([1, 3, 3, 5, 7]) == [2, 4, 6, 8]\", \"assert addOneAndRemoveDuplicates([1, 1, 1, 1]) == [2]\", \"assert addOneAndRemoveDuplicates([10, 20, 10, 30]) == [11, 21, 31]\", \"assert addOneAndRemoveDuplicates([]) == []\", \"assert addOneAn... | {
"split": "train",
"index": 67599,
"acecode_id": "evol_19376",
"num_tests": 14
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.