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 implementing a function to determine if a given list of server availability meets a specific threshold. The function `is_distributed_available` should take a list of boolean values representing the availability of each server and an integer representing the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_distributed_available([True, True, True, False, False], 3) == True\", \"assert is_distributed_available([True, True, False, True, True], 4) == True\", \"assert is_distributed_available([False, False, False, False, False], 1) == False\", \"assert is_distri...
{ "split": "train", "index": 6100, "acecode_id": "oss_27410", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a 2D grid representing a map where each cell can contain different biomes: 'land', 'box', 'locked_box', or 'destination'. You are also given a starting position represented as a tuple (x, y) and a direction (one of 'up', 'down', 'left', 'right'). Your task is to i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert collision_check((0, 0), 'down', [['land', 'land'], ['land', 'box']]) == True\", \"assert collision_check((0, 0), 'right', [['land', 'land'], ['box', 'land']]) == True\", \"assert collision_check((1, 0), 'up', [['land', 'land'], ['land', 'box']]) == True\", \...
{ "split": "train", "index": 6101, "acecode_id": "bigcode_python_fns_41243", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that returns the current local time in a specified timezone. The function should take a timezone string as input, which represents the desired timezone, and return the current local time in that timezone as a string in the format 'YYYY-MM...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_local_time('Asia/Shanghai') == datetime.now(pytz.timezone('Asia/Shanghai')).strftime('%Y-%m-%d %H:%M:%S')\", \"assert get_local_time('America/New_York') == datetime.now(pytz.timezone('America/New_York')).strftime('%Y-%m-%d %H:%M:%S')\", \"assert get_loca...
{ "split": "train", "index": 6102, "acecode_id": "bigcode_python_fns_16445", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a pagination function that takes a list of items and returns a paginated result. The function should accept three parameters: a list of items (data_list), the current page number (page, defaulting to 1), and the number of items per page (per_page, d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert paginate_data(['a', 'b', 'c', 'd', 'e'], 1, 2) == {'item_list': ['a', 'b'], 'page': 1, 'total': 5, 'pages': 3, 'has_next': True, 'next_num': 2, 'per_page': 2, 'has_prev': False, 'prev_num': None}\", \"assert paginate_data(['a', 'b', 'c', 'd', 'e'], 2, 2) == ...
{ "split": "train", "index": 6103, "acecode_id": "bigcode_python_fns_21219", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that manages settings related to tensor quantization by storing and retrieving parameters. Your function, `manage_tensor_quantization`, should accept a list of operations and return the results of specific queries. The operations can ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_tensor_quantization([('set', 'qmin', 0), ('set', 'qmax', 255), ('get_qmin_qmax',)]) == [(0, 255)]\", \"assert manage_tensor_quantization([('set', 'qmin', 0), ('set', 'qmax', 100), ('get_qmin_qmax',)]) == [(0, 100)]\", \"assert manage_tensor_quantizati...
{ "split": "train", "index": 6104, "acecode_id": "oss_8348", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a list of integers representing the sides of a polygon, write a function that returns the number of triangles that can be formed using the sides of the polygon. A triangle can be formed if the sum of the lengths of any two sides is greater than the length of the remaining...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_triangles([3, 4, 5]) == 1\", \"assert count_triangles([1, 1, 1]) == 1\", \"assert count_triangles([5, 5, 5]) == 1\", \"assert count_triangles([1, 2, 3]) == 0\", \"assert count_triangles([0, 0, 0]) == 0\", \"assert count_triangles([0, 1, 1]) == 0\", \"a...
{ "split": "train", "index": 6105, "acecode_id": "bigcode_python_fns_36123", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with developing a function to calculate the number of preemptible nodes in a cloud computing cluster based on a given total number of nodes and a specified percentage of preemptible nodes. Implement a function that takes in the total number of nodes and the perce...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_preemptible_nodes(100, 20) == 20\", \"assert calculate_preemptible_nodes(200, 50) == 100\", \"assert calculate_preemptible_nodes(150, 0) == 0\", \"assert calculate_preemptible_nodes(75, 100) == 75\", \"assert calculate_preemptible_nodes(0, 50) == 0...
{ "split": "train", "index": 6106, "acecode_id": "oss_34702", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a positive integer `n`, you are permitted to execute one of the following operations: If `n` is an even number, you can replace `n` with `n / 2`. If `n` is an odd number, you can replace `n` with either `n + 1`, `n - 1`, or `n * 2`. Your goal is to determine the minimum n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert integerReplacement(8) == 3\", \"assert integerReplacement(7) == 4\", \"assert integerReplacement(4) == 2\", \"assert integerReplacement(1) == 0\", \"assert integerReplacement(2) == 1\", \"assert integerReplacement(3) == 2\", \"assert integerReplacement(15) =...
{ "split": "train", "index": 6107, "acecode_id": "evol_29385", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that takes a string as input and returns an empty list if the input string is empty. If the input string is not empty, the function should return a list containing the string itself as the only element. Write a function `parse_input(data: ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_input('') == []\", \"assert parse_input('Hello') == ['Hello']\", \"assert parse_input('Python') == ['Python']\", \"assert parse_input(' ') == [' ']\", \"assert parse_input('Test') == ['Test']\", \"assert parse_input('123') == ['123']\", \"assert parse_...
{ "split": "train", "index": 6108, "acecode_id": "bigcode_python_fns_16549", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a class called 'Animal' that has an initializer that takes a name as a parameter. The class should have a method called 'sound' that returns a string representing a generic animal sound. Then, implement a subclass called 'Dog' that inherits from 'Animal'. The 'Dog' cl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert Animal('GenericAnimal').sound() == 'Generic animal sound'\", \"assert Animal('Lion').sound() == 'Generic animal sound'\", \"assert Animal('Elephant').sound() == 'Generic animal sound'\", \"assert Dog('Buddy').sound() == 'Bark'\", \"assert Dog('Max').sound() ...
{ "split": "train", "index": 6109, "acecode_id": "evol_7058", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of atoms represented as dictionaries, where each atom has properties such as 'mass', 'charge', and 'energy'. Your task is to implement a function that updates the properties of these atoms based on a provided calculator's results. The results are given as a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_atoms_from_calc([{'mass': 1, 'charge': 0}, {'mass': 2, 'charge': 1}], {'mass': 1.5, 'charge': 0.5}, '') == [{'mass': 1.5, 'charge': 0.5}, {'mass': 1.5, 'charge': 0.5}]\", \"assert update_atoms_from_calc([{'mass': 3, 'charge': -1}], {'mass': 4, 'charge...
{ "split": "train", "index": 6110, "acecode_id": "bigcode_python_fns_22528", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given a nested dictionary and a dotted accessor string, implement a function `get_dotted_field(input_dict: dict, accessor_string: str) -> dict` that retrieves the value from the dictionary corresponding to the accessor string. The accessor string consists of keys separated by d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_dotted_field({'a': {'b': {'c': 1}}}, 'a.b.c') == 1\", \"assert get_dotted_field({'a': {'b': {'c': 1}}}, 'a.b') == {'c': 1}\", \"assert get_dotted_field({'a': {'b': {'c': 1}}}, 'a') == {'b': {'c': 1}}\", \"assert get_dotted_field({'a': {'b': {} }}, 'a.b.c...
{ "split": "train", "index": 6111, "acecode_id": "bigcode_python_fns_17848", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `find_sequences_with_a(text: str) -> List[str]` that takes a string as input and returns a list of all contiguous sequences of characters that contain the letter 'a'. Each sequence should include any characters before and after the letter 'a', as long as th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_sequences_with_a('abc def ghi') == ['abc']\", \"assert find_sequences_with_a('xyz') == []\", \"assert find_sequences_with_a('Apple banana apricot') == ['Apple', 'banana', 'apricot']\", \"assert find_sequences_with_a('a') == ['a']\", \"assert find_sequen...
{ "split": "train", "index": 6112, "acecode_id": "evol_21189", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes and validates a dictionary of data for a web scraping project. The function should take a dictionary of raw data as input and process it according to specific rules. The processed data should be validated based on the follo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_data({'leixing': 'example', 'yaoqiu01': 10, 'yaoqiu02': 20, 'guige': 5.5, 'chechang': 3.0, 'chexing': 4.0, 'yunfei': 2.5, 'chufa01': 1.0, 'chufa02': 1.5, 'chufa03': 2.0}) == {'leixing': 'example', 'yaoqiu01': 10, 'yaoqiu02': 20, 'guige': 5.5, 'checha...
{ "split": "train", "index": 6113, "acecode_id": "oss_32502", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates the content of a `setup.py` file for a given Python package. The `setup.py` file is used to describe the package metadata and dependencies. Your task is to implement a function `generate_setup_py` that takes the following p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_setup_py('example', ['python', 'package', 'example'], 'https://example.com', 'MIT') == \\\"from setuptools import setup\\\\n\\\\nsetup(\\\\n name='example',\\\\n keywords=['python', 'package', 'example'],\\\\n url='https://example.com',\\\\...
{ "split": "train", "index": 6114, "acecode_id": "oss_3255", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `message` and an integer `key`, implement a function that encrypts the message using a simple Caesar cipher. Each letter in the message should be shifted by `key` positions in the alphabet. The function should handle both uppercase and lowercase letters, while le...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert encrypt('Hello world', 12) == 'Tqxxa iadxp'\", \"assert encrypt('We are Penn State!!!', 6) == 'Ck gxk Vktt Yzgzk!!!'\", \"assert encrypt('We are Penn State!!!', 5) == 'Bj fwj Ujss Xyfyj!!!'\", \"assert encrypt('Python3.8', 2) == 'Ravjqp3.8'\", \"assert encry...
{ "split": "train", "index": 6115, "acecode_id": "bigcode_python_fns_17263", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of integers, which may include positive, negative numbers, and zero, and returns a dictionary containing only the numbers that appear more than once along with their frequencies. The order of the items in the resulting dictionary must matc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_recurring_nums([1, -2, 0, 3, 2, -2, 3, 0, 5]) == {-2: 2, 0: 2, 3: 2}\", \"assert find_recurring_nums([1, 1, 1, 1, 1]) == {1: 5}\", \"assert find_recurring_nums([-1, -1, 2, 3, -2, -2, -2]) == {-1: 2, -2: 3}\", \"assert find_recurring_nums([0, 0, 0]) == {...
{ "split": "train", "index": 6116, "acecode_id": "evol_21038", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a function that performs basic mathematical operations on two numbers a and b based on the specified operator. The function should handle the operators '+', '-', '*', and '/'. Additionally, the function should have an optional parameter that, when set to True, manages ex...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert math_operator(6, 2, '/') == 3.0\", \"assert math_operator(2, 6, '-', True) == 'Error: Cannot subtract a larger number from a smaller one.'\", \"assert math_operator(4, 2, '+') == 6\", \"assert math_operator(5, 3, '-') == 2\", \"assert math_operator(3, 7, '-'...
{ "split": "train", "index": 6117, "acecode_id": "evol_32926", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a Python function that determines the fulcrum element in a list of integers. The fulcrum is defined as an element where the sum of all elements to its left equals the sum of all elements to its right. If no such fulcrum exists, return -1. The function signature should...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_fulcrum([0, 0, 0, 0, 0]) == 0\", \"assert find_fulcrum([-1, -1, -1, -1]) == -1\", \"assert find_fulcrum([10, 2, 1, 4, 10]) == -1\", \"assert find_fulcrum([1, 2, 3, 3]) == 3\", \"assert find_fulcrum([1, 2, 1]) == 2\", \"assert find_fulcrum([0]) == 0\", \...
{ "split": "train", "index": 6118, "acecode_id": "evol_32081", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that formats application configuration details based on provided inputs. Write a function `generate_app_config_string` that takes in three parameters: a string `name` representing the app's name, a string `verbose_name` representing the h...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_app_config_string('profiles', 'Profiles of Players', True) == 'App Name: profiles, Verbose Name: Profiles of Players, Has Signals: True'\", \"assert generate_app_config_string('blog', 'Blog Application', False) == 'App Name: blog, Verbose Name: Blog...
{ "split": "train", "index": 6119, "acecode_id": "oss_17886", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that takes a dictionary and a file path as inputs and simulates the process of writing the dictionary data into a JSON file. Since you cannot actually create a file, your function should return a string that represents the JSON dat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_write_dict_to_json({'name': 'John', 'age': 30}) == '{\\\"name\\\": \\\"John\\\", \\\"age\\\": 30}'\", \"assert simulate_write_dict_to_json({'a': 1, 'b': 2, 'c': 3}) == '{\\\"a\\\": 1, \\\"b\\\": 2, \\\"c\\\": 3}'\", \"assert simulate_write_dict_to_j...
{ "split": "train", "index": 6120, "acecode_id": "oss_7808", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates a simple joint velocity controller for a robotic system. The function should return a joint parameter that can be used to activate the velocity controller. Write a function `create_joint_velocity_controller` that tak...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_joint_velocity_controller(0, -10, 10, 0) == ['0', '0_VC_0']\", \"assert create_joint_velocity_controller(1, -5, 5, 0) == ['1', '1_VC_0']\", \"assert create_joint_velocity_controller(2, -10, 10, 10) == ['2', '2_VC_10']\", \"assert create_joint_velocity...
{ "split": "train", "index": 6121, "acecode_id": "oss_4686", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes two sentences as input and returns a dictionary containing words that are unique to each sentence. The dictionary should have two keys: 'Unique to sentence1' and 'Unique to sentence2', where each key maps to a list of words that appear exclusivel...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_terms('Hello world!', 'Goodbye world!') == {'Unique to sentence1': ['Hello'], 'Unique to sentence2': ['Goodbye']}\", \"assert unique_terms('Python is awesome', 'Python is great') == {'Unique to sentence1': ['awesome'], 'Unique to sentence2': ['great']...
{ "split": "train", "index": 6122, "acecode_id": "evol_26956", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that converts a subnet mask to its corresponding prefix length. The subnet mask can be provided either as an integer (for example, 24) or as a string in dotted-decimal notation (for example, '255.255.255.0'). Your function should retu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert subnet_to_prefix_length(None) is None\", \"assert subnet_to_prefix_length(24) == 24\", \"assert subnet_to_prefix_length('24') == 24\", \"assert subnet_to_prefix_length('255.255.255.0') == 24\", \"assert subnet_to_prefix_length('255.255.255.128') == 25\", \"a...
{ "split": "train", "index": 6123, "acecode_id": "bigcode_python_fns_27481", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a non-negative integer n, write a function `digits(n)` that returns the product of all odd digits in n. If there are no odd digits, return 0. For example, for n = 235, the odd digits are 3 and 5, and the product is 15. For n = 4, there are no odd digits, so the output sho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert Solution.digits(1) == 1\", \"assert Solution.digits(4) == 0\", \"assert Solution.digits(235) == 15\", \"assert Solution.digits(123456789) == 945\", \"assert Solution.digits(24680) == 0\", \"assert Solution.digits(13579) == 945\", \"assert Solution.digits(0) ...
{ "split": "train", "index": 6124, "acecode_id": "evol_17479", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates setting an envelope recipient for an SMTP (Simple Mail Transfer Protocol) transaction. The function should take an email address as a parameter and return it as the envelope recipient for the SMTP transaction. You need ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_envelope_recipient('recipient@example.com') == 'recipient@example.com'\", \"assert set_envelope_recipient('user@domain.co.uk') == 'user@domain.co.uk'\", \"assert set_envelope_recipient('user@sub.domain.com') == 'user@sub.domain.com'\", \"assert set_envel...
{ "split": "train", "index": 6125, "acecode_id": "oss_15116", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string input consisting of words separated by spaces, write a function that reverses the characters of each word in the string while maintaining the original order of the words. You should not use any built-in string reversal methods. For example, if the input string is...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert string_reverse_python('Hello World') == 'olleH dlroW'\", \"assert string_reverse_python('Python is fun') == 'nohtyP si nuf'\", \"assert string_reverse_python('Reverse this string') == 'esreveR siht gnirts'\", \"assert string_reverse_python('A B C') == 'A B C...
{ "split": "train", "index": 6126, "acecode_id": "evol_886", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of binary file names and a list of license file names, and returns a string summarizing the installation process. The output string should contain a message indicating how many binaries and licenses were 'installed'. Imp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert do_install([], []) == 'Installed 0 binaries and 0 licenses.'\", \"assert do_install(['binary1'], []) == 'Installed 1 binaries and 0 licenses.'\", \"assert do_install([], ['license1']) == 'Installed 0 binaries and 1 licenses.'\", \"assert do_install(['binary1...
{ "split": "train", "index": 6127, "acecode_id": "oss_8551", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of strings, implement a function that filters out any strings that contain any of the specified keywords. The function should return a new list containing only the strings that do not contain any of the keywords. Write a function `filter_strings(string_list: List[s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_strings(['hello', 'world', 'python', 'code'], ['hello']) == ['world', 'python', 'code']\", \"assert filter_strings(['apple', 'banana', 'cherry'], ['banana', 'cherry']) == ['apple']\", \"assert filter_strings(['test', 'example', 'sample'], ['notfound']...
{ "split": "train", "index": 6128, "acecode_id": "bigcode_python_fns_23142", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that compares two version numbers represented as strings and determines which version is greater. The version numbers are in the format 'x.y.z', where x, y, and z are non-negative integers, and may also contain fewer than three seg...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compare_versions('0.18.1', '0.18.2') == -1\", \"assert compare_versions('1.2.3', '1.2.3') == 0\", \"assert compare_versions('2.0', '1.9.9') == 1\", \"assert compare_versions('1.0.0', '1') == 0\", \"assert compare_versions('1.0', '1.0.0') == 0\", \"assert com...
{ "split": "train", "index": 6129, "acecode_id": "oss_21741", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string 'S' that consists of characters 'a' and 'b', along with other non-intersecting characters, write a Python function that counts the number of occurrences of the substring 'ab' in the string 'S', preserving the order of the substring. Your solution should not utili...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_ab('ababa') == 2\", \"assert count_ab('ababab') == 3\", \"assert count_ab('xxabyyab') == 2\", \"assert count_ab('abababab') == 4\", \"assert count_ab('aaa') == 0\", \"assert count_ab('baba') == 1\", \"assert count_ab('bbaaa') == 0\", \"assert count_ab(...
{ "split": "train", "index": 6130, "acecode_id": "evol_2682", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `obscure_keywords(text: str, keywords: List[str]) -> str` that takes a string `text` and a list of strings `keywords`. The function should replace each occurrence of the keywords in the text with asterisks, where the number of asterisks is equal to the length o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert obscure_keywords('The quick brown fox jumped over the lazy dog.', ['fox', 'dog']) == 'The quick brown *** jumped over the lazy ***.'\", \"assert obscure_keywords('Hello World!', ['world']) == 'Hello World!'\", \"assert obscure_keywords('This is a test.', ['t...
{ "split": "train", "index": 6131, "acecode_id": "evol_22904", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a 1D list of integers, split the list into a 3D list based on a fixed dimension. The length of the input list must be divisible by the square of the given dimension. Each 3D sublist should contain elements from the original list in a row-major order. Implement a function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert split_list_to_3d([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], 2) == [[[0, 1], [2, 3]], [[4, 5], [6, 7]], [[8, 9], [10, 11]]]\", \"assert split_list_to_3d([10, 11, 12, 13, 14, 15, 16, 17], 2) == [[[10, 11], [12, 13]], [[14, 15], [16, 17]]]\", \"assert split_list_t...
{ "split": "train", "index": 6132, "acecode_id": "bigcode_python_fns_32958", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are given a string representing a subpath that may contain slashes. Your task is to implement a function that formats this subpath by prefixing it with 'Subpath ' and ensuring that any special characters (like slashes) are safely escaped. The function should return the form...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert show_subpath('home/user/docs') == 'Subpath home/user/docs'\", \"assert show_subpath('projects/2023/overview') == 'Subpath projects/2023/overview'\", \"assert show_subpath('music/classical') == 'Subpath music/classical'\", \"assert show_subpath('videos/movies...
{ "split": "train", "index": 6133, "acecode_id": "bigcode_python_fns_4285", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Implement a function that calculates the nth term in the heptagonal sequence. The function should take an integer n as input and return the nth heptagonal number. The heptagonal number can be calculated using the formula: H(n) = n * (5n - 3) / 2. The function should handle the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert hept(1) == 1\", \"assert hept(2) == 7\", \"assert hept(2001) == -1\", \"assert hept(-1) == -1\", \"assert hept(0) == -1\"]}" }
{ "split": "train", "index": 6134, "acecode_id": "evol_3554", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given a string representing SQL content, write a function `update_sql_content` that takes in two parameters: `sql_contents` (the SQL string) and `old_table_name` (the name of the table to be replaced). The function should return a new string where all occurrences of `old_table_...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_sql_content('SELECT * FROM customer WHERE id = 1;', 'customer', 'client') == 'SELECT * FROM client WHERE id = 1;'\", \"assert update_sql_content('INSERT INTO customer (name) VALUES (\\\"John\\\");', 'customer', 'client') == 'INSERT INTO client (name) ...
{ "split": "train", "index": 6135, "acecode_id": "evol_18171", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of potential numbers (`candidates`) and a specific target integer (`target`), implement a function that identifies all distinct combinations within `candidates` that sum up to `target`. Each number in `candidates` can only be used once in a single combination, an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert combinationSum2([10,1,2,7,6,1,5], 8) == [[1,1,6],[1,2,5],[1,7],[2,6]]\", \"assert combinationSum2([2,5,2,1,2], 5) == [[1,2,2],[5]]\", \"assert combinationSum2([1,2,3,4,5], 5) == [[1,4],[2,3],[5]]\", \"assert combinationSum2([1,1,1,1], 2) == [[1,1]]\", \"asse...
{ "split": "train", "index": 6136, "acecode_id": "evol_9201", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `get_max_difference(arr)` that returns the maximum difference between any two elements in the list. The difference is defined as the absolute value of the difference between two elements. If the list has fewer than two elements, return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_max_difference([3, 10, 6, 1]) == 9\", \"assert get_max_difference([5]) == 0\", \"assert get_max_difference([]) == 0\", \"assert get_max_difference([-1, -5, -3, 0]) == 5\", \"assert get_max_difference([1, 2, 3, 4, 5]) == 4\", \"assert get_max_difference([...
{ "split": "train", "index": 6137, "acecode_id": "bigcode_python_fns_43943", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the loading of images for a player-controlled airplane in a game. The function should accept two image paths as input and return a dictionary containing the loaded images. Since we cannot actually load images in this enviro...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert load_airplane_images('path/to/image1.png', 'path/to/image2.png') == {'image_one': 'Loaded image from path/to/image1.png', 'image_two': 'Loaded image from path/to/image2.png'}\", \"assert load_airplane_images('image1.jpg', 'image2.jpg') == {'image_one': 'Load...
{ "split": "train", "index": 6138, "acecode_id": "oss_35290", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists: `wav_list` and `feat_list`, where each list contains strings representing the names of waveform and feature files respectively. You need to implement a function that shuffles these lists based on a boolean parameter `shuffle`. If `shuffle` is True, the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert shuffle_lists(['file1.wav', 'file2.wav'], ['feat1.h5', 'feat2.h5'], False) == (['file1.wav', 'file2.wav'], ['feat1.h5', 'feat2.h5'])\", \"assert shuffle_lists(['a.wav', 'b.wav', 'c.wav'], ['x.h5', 'y.h5', 'z.h5'], True) != (['a.wav', 'b.wav', 'c.wav'], ['x.h...
{ "split": "train", "index": 6139, "acecode_id": "bigcode_python_fns_11146", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a list of dihedrals in a molecular structure, where each dihedral is represented by four atom types (strings). Your task is to write a function that extracts unique dihedral types from the given list. A dihedral type is uniquely identified by the four atom types, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_unique_dihedral_types([('X', 'Y', 'Z', 'W'), ('W', 'Z', 'Y', 'X')]) == {'X-Y-Z-W'}\", \"assert extract_unique_dihedral_types([]) == set()\", \"assert extract_unique_dihedral_types([('N', 'N', 'N', 'N')]) == {'N-N-N-N'}\", \"assert extract_unique_dihe...
{ "split": "train", "index": 6140, "acecode_id": "bigcode_python_fns_49904", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Given a string s consisting of alphabetic characters, implement a function that reverses the characters in the string and returns the reversed string as the output.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_string('apple') == 'elppa'\", \"assert reverse_string('hello') == 'olleh'\", \"assert reverse_string('Python') == 'nohtyP'\", \"assert reverse_string('') == ''\", \"assert reverse_string('a') == 'a'\", \"assert reverse_string('ab') == 'ba'\", \"asser...
{ "split": "train", "index": 6141, "acecode_id": "evol_33384", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a 3x3 tic-tac-toe board represented as a 2D list, where each cell contains either 'X', 'O', or an empty string representing an unoccupied cell. Your task is to implement a function that checks if a given player ('X' or 'O') has won the game. A player wins if they ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_for_win([['X', 'X', 'X'], ['O', 'O', ''], ['O', 'X', 'O']], 'X') == True\", \"assert check_for_win([['X', 'O', 'X'], ['O', 'X', ''], ['O', 'X', 'X']], 'X') == True\", \"assert check_for_win([['X', 'O', ''], ['O', 'X', 'O'], ['X', 'O', 'X']], 'X') == Tr...
{ "split": "train", "index": 6142, "acecode_id": "bigcode_python_fns_27530", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that removes all duplicate elements from the list and returns a new list containing only the unique elements in the order they first appeared.\nPlease reason step by step, then write a self-contained Python solution. Give your fina...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_duplicates([1, 4, 6, 1, 4, 8]) == [1, 4, 6, 8]\", \"assert remove_duplicates([2, 2, 3, 4, 3, 5]) == [2, 3, 4, 5]\", \"assert remove_duplicates([10, 20, 10, 30, 40, 20]) == [10, 20, 30, 40]\", \"assert remove_duplicates([]) == []\", \"assert remove_dup...
{ "split": "train", "index": 6143, "acecode_id": "evol_20282", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the retrieval of account balances from a financial service. Your function should take a token (string) and a boolean flag indicating whether to retrieve account balances. If the token is None, the function should return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_account_balances(None, True) == 'Token required'\", \"assert get_account_balances('abcd1234', True) == ['Account1: $100', 'Account2: $200']\", \"assert get_account_balances('token5678', False) == 'Balances not requested'\", \"assert get_account_balances(...
{ "split": "train", "index": 6144, "acecode_id": "bigcode_python_fns_783", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, write a function that returns all unique combinations of numbers from the array that sum up to a specified target. Each number in the array may only be used once in the combination. The order of the combination does not matter. For example, given an ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert solve([4, 3, 6, 1], 7) == [[1, 6], [3, 4]]\", \"assert solve([1, 2, 3, 4, 5], 5) == [[2, 3], [1, 4], [5]]\", \"assert solve([1, 2, 3], 6) == [[1, 2, 3]]\", \"assert solve([1, 1, 1, 1], 2) == [[1, 1]]\", \"assert solve([], 0) == [[]]\", \"assert solve([2, 2, ...
{ "split": "train", "index": 6145, "acecode_id": "evol_11585", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a program that processes a list of software licenses represented as comments in source code. Each license is in the SPDX License Identifier format, which is a unique string identifying a specific software license. The format is 'SPDX-License-Ide...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_license_info(['# SPDX-License-Identifier: GPL-3.0']) == {'GPL-3.0': 'GNU General Public License'}\", \"assert extract_license_info(['# SPDX-License-Identifier: MIT']) == {'MIT': 'MIT License'}\", \"assert extract_license_info(['# SPDX-License-Identif...
{ "split": "train", "index": 6146, "acecode_id": "oss_23979", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string with space-separated characters (inclusive of uppercase and lowercase letters, digits, and symbols), implement a function that returns a dictionary of the highest frequency character(s) presented in lowercase format for alphabetic letters, while preserving the or...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert advanced_histogram('A B c 1 @') == {'a': 1, 'b': 1, 'c': 1, '1': 1, '@': 1}\", \"assert advanced_histogram('A b C a B 1 2 2') == {'a': 2, 'b': 2, '2': 2}\", \"assert advanced_histogram('B B B b A ! ! ! !') == {'b': 4, '!': 4}\", \"assert advanced_histogram('...
{ "split": "train", "index": 6147, "acecode_id": "evol_7305", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given a rectangular pizza represented as a `rows x cols` matrix containing the following characters: 'A' (an apple), 'P' (a pineapple), and '.' (empty cell). You also have a positive integer `k`. Your task is to implement a function `ways(pizza: List[str], k: int) -> in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert ways(['A..','A..','...'], 1) == 0\", \"assert ways(['AP','.P','..'], 2) == 0\", \"assert ways(['...','...','...'], 3) == 0\", \"assert ways(['AAA','AAA','AAA'], 2) == 0\", \"assert ways(['A..','...','..P'], 3) == 0\", \"assert ways(['A.P','...','...'], 1) ==...
{ "split": "train", "index": 6148, "acecode_id": "evol_29752", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks if a given username and password combination is valid for login. The function should take two parameters: a string `username`, and a string `password`. The valid username is 'admin' and the valid password is 'admin'. The f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_login_successful('admin', 'admin') == True\", \"assert is_login_successful('admin', 'password') == False\", \"assert is_login_successful('user', 'admin') == False\", \"assert is_login_successful('user', 'password') == False\", \"assert is_login_successful...
{ "split": "train", "index": 6149, "acecode_id": "oss_18866", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the average score for unique molecular fragments represented by their SMILES strings and associated scores. The function should take a list of molecular fragments, where each fragment is represented by a dictionary con...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average_scores([{'smiles': 'C1=CC=CC=C1', 'score': 3.5}, {'smiles': 'CC(=O)O', 'score': 2.0}, {'smiles': 'C1=CC=CC=C1', 'score': 4.5}, {'smiles': 'CC(=O)O', 'score': 3.0}, {'smiles': 'C1=CC=CC=C1', 'score': 2.5}]) == {'C1=CC=CC=C1': 3.5, 'CC(=O)O':...
{ "split": "train", "index": 6150, "acecode_id": "oss_22369", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the total profit or loss generated by a stock trading algorithm based on historical price data and a list of buy and sell signals. The historical price data is provided as a list of dictionaries, where each dictionary contains the date and the cl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_profit_loss([{'Date': '2022-01-01', 'Close': 103.00}, {'Date': '2022-01-02', 'Close': 106.50}], [('2022-01-01', 'buy'), ('2022-01-02', 'sell')]) == 3.5\", \"assert calculate_profit_loss([{'Date': '2022-01-01', 'Close': 100.00}, {'Date': '2022-01-02...
{ "split": "train", "index": 6151, "acecode_id": "oss_32365", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that generates a card ID based on a given range and an offset. The function should take three parameters: `min`, `max`, and `offset`. It will generate a card ID that is randomly selected from the range of values starting from `min + o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_card_id(1, 10, 0) == 1\", \"assert get_card_id(5, 15, 0) == 5\", \"assert get_card_id(0, 0, 0) == 0\", \"assert get_card_id(1, 5, 2) == 3\", \"assert get_card_id(10, 20, 5) == 15\", \"assert get_card_id(-5, 5, 5) == 0\", \"assert get_card_id(0, 10, 10) =...
{ "split": "train", "index": 6152, "acecode_id": "bigcode_python_fns_37701", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `eliminate_redundant_entries(nums: List[int]) -> List[int]` that takes a list of integers and removes all redundant entries while maintaining the order of the first occurrence of each integer. The function should return a new list containing only unique int...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert eliminate_redundant_entries([3, 1, 7, 5, 3, 8, 7, 1, 5, 8, 1]) == [3, 1, 7, 5, 8]\", \"assert eliminate_redundant_entries([1, 2, 3, 2, 1]) == [1, 2, 3]\", \"assert eliminate_redundant_entries([5, 5, 5, 5]) == [5]\", \"assert eliminate_redundant_entries([]) =...
{ "split": "train", "index": 6153, "acecode_id": "evol_18275", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function that sorts a given list of numbers in ascending order using the Bubble Sort algorithm. The list may contain both positive and negative integers, as well as floating point numbers.\nPlease reason step by step, then write a self-contained Python solution. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bubble_sort([3, 2, 1]) == [1, 2, 3]\", \"assert bubble_sort([-1, -3, 2, 0, 5]) == [-3, -1, 0, 2, 5]\", \"assert bubble_sort([4.5, 3.2, 5.1, 2.0]) == [2.0, 3.2, 4.5, 5.1]\", \"assert bubble_sort([1]) == [1]\", \"assert bubble_sort([]) == []\", \"assert bubble...
{ "split": "train", "index": 6154, "acecode_id": "evol_25374", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with developing a resource allocation function for a cloud computing platform. The platform has a limited capacity for CPU, memory, and storage resources. Each incoming request specifies its resource requirements in terms of CPU, memory, and storage. Your task is...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert allocate_resources(5000, 3000, 1000, [(1000, 500, 200), (2000, 1500, 300), (3000, 2000, 500)]) == [True, True, False]\", \"assert allocate_resources(15000, 9000, 5000, [(3000, 1000, 500), (4000, 2000, 1000), (2000, 1000, 500)]) == [True, True, True]\", \"ass...
{ "split": "train", "index": 6155, "acecode_id": "oss_21685", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Implement a function `generate_random_string(length: int) -> str` that takes an integer `length` as input and returns a random string of the same length consisting of lowercase alphabetic characters ('a' to 'z'). The characters in the returned string should be randomly selected...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_random_string(0) == ''\", \"assert len(generate_random_string(5)) == 5\", \"assert len(generate_random_string(10)) == 10\", \"assert len(generate_random_string(1)) == 1\", \"assert len(generate_random_string(3)) == 3\", \"assert generate_random_stri...
{ "split": "train", "index": 6156, "acecode_id": "bigcode_python_fns_13985", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string containing a list of numbers, identify all the prime numbers present in that string. Write a function `find_primes(text: str) -> List[int]` that takes a string as input and returns a list of all prime numbers found in that string, in the order they appear. The nu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_primes('This text contains the numbers 10, 20, 21, 29, 30, 31, and 37.') == [29, 31, 37]\", \"assert find_primes('The numbers are 2, 3, 4, 5, 6, 7, 8, 9, 10.') == [2, 3, 5, 7]\", \"assert find_primes('No prime numbers here: 1, 4, 6, 8, 9.') == []\", \"a...
{ "split": "train", "index": 6157, "acecode_id": "evol_35985", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to update a processed data cache for a job configuration. The job configuration is represented by a JobConfig object, which contains information about the data buckets to be processed. Each JobConfig contains a list of proc_data_bucke...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_processed_data_cache(JobConfig(['bucket1'])) == 'Cache updated for bucket1'\", \"assert update_processed_data_cache(JobConfig(['bucket2'])) == 'Cache updated for bucket2'\", \"assert update_processed_data_cache(JobConfig(['bucket3'])) == 'Cache update...
{ "split": "train", "index": 6158, "acecode_id": "oss_29261", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the total shipping cost for a package based on its weight and a fixed flat rate. The shipping cost can be calculated using the formula: `total_cost = weight * 12.0 + flat`, where `weight` is the weight of the package i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculateShippingCost(0.0, 5.0) == 5.0\", \"assert calculateShippingCost(1.0, 5.0) == 17.0\", \"assert calculateShippingCost(3.0, 0.0) == 36.0\", \"assert calculateShippingCost(5.0, 10.0) == 70.0\", \"assert calculateShippingCost(10.0, 20.0) == 140.0\", \"as...
{ "split": "train", "index": 6159, "acecode_id": "oss_15006", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers representing the ratings of different products, write a function `average_product_rating(ratings: List[int]) -> float` that calculates the average rating of the products. If the input list is empty, return 0.0. The average rating is defined as the sum...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_product_rating([4, 5, 3, 2, 1]) == 3.0\", \"assert average_product_rating([5, 5, 5]) == 5.0\", \"assert average_product_rating([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == 5.5\", \"assert average_product_rating([]) == 0.0\", \"assert average_product_rating([0...
{ "split": "train", "index": 6160, "acecode_id": "bigcode_python_fns_19778", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of tuples `smoves`, where each tuple represents a possible move in a game. Each tuple contains two integers representing the x and y coordinates of the move. Your task is to write a function that takes this list of moves and returns the count of unique y-co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_unique_y_coordinates([(1, 2), (3, 4), (1, 5), (2, 6), (3, 7)]) == 5\", \"assert count_unique_y_coordinates([(0, 0), (0, 0), (0, 0)]) == 1\", \"assert count_unique_y_coordinates([(1, 10), (2, 20), (3, 30)]) == 3\", \"assert count_unique_y_coordinates([(...
{ "split": "train", "index": 6161, "acecode_id": "oss_19263", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of event records, where each event record is represented as a dictionary containing the following fields: 'received_at' (a string representing the timestamp), 'source_type' (a string representing the source of the event), 'owner' (a string representing the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_duplicate_events([{'received_at': '2018-02-19T00:00:11', 'source_type': 'datastoretest', 'owner': 'a', 'data': {}, 'fingerprint': 'f1'}, {'received_at': '2018-02-20T00:00:11', 'source_type': 'datastoretest', 'owner': 'a', 'data': {}, 'fingerprint': 'f...
{ "split": "train", "index": 6162, "acecode_id": "bigcode_python_fns_23945", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a list of strings and two lists: one containing strings to be replaced and another containing the corresponding replacement strings. Implement a function `replace_in_list(lst: List[str], to_replace: List[str], replacements: List[str]) -> None` that replaces all oc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert replace_in_list(['aa', 'bb', 'cc'], ['aa', 'bb'], ['dd', 'ee']) == None # should modify the list to ['dd', 'ee', 'cc']\", \"assert replace_in_list(['apple', 'banana', 'orange'], ['banana'], ['grape']) == None # should modify the list to ['apple', 'grape', 'o...
{ "split": "train", "index": 6163, "acecode_id": "bigcode_python_fns_15790", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with determining if a player can successfully navigate through a mysterious abyss represented as a 2D grid. The grid consists of various characters that denote different locations: 'S' for the starting point, 'E' for the exit point, '.' for regular cells that can...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert explore_abyss([['S', '.', '.', '#', '#'], ['#', '.', '.', '.', '#'], ['#', '#', '#', '.', '#'], ['#', '.', '.', '.', '.'], ['#', '#', '#', 'E', '.']]) == True\", \"assert explore_abyss([['S', '#', '#', '#', '#'], ['#', '#', '#', '#', '#'], ['#', '#', '#', 'E...
{ "split": "train", "index": 6164, "acecode_id": "oss_12712", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of scores for three quizzes and checks if all the scores are valid (i.e., not None). If all scores are valid, return the average score rounded to two decimal places. If any score is None, return None. Implement the funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average_score([85.5, 90.0, 78.0]) == 84.50\", \"assert calculate_average_score([None, 75.0, 80.0]) == None\", \"assert calculate_average_score([60.0, None, 70.0]) == None\", \"assert calculate_average_score([90.0, 92.5, 95.0]) == 92.50\", \"assert ...
{ "split": "train", "index": 6165, "acecode_id": "bigcode_python_fns_37302", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `create_linked_list(data: List[str]) -> List[str]` that takes a list of strings as input and returns a new list representing the values in a linked list. The head node's data should be equal to the tail node's data, and all other nodes should have their dat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_linked_list(['X']) == ['X', 'X']\", \"assert create_linked_list(['Hello', 'World']) == ['Hello', 'World', 'Hello']\", \"assert create_linked_list(['1', '2', '3']) == ['1', '2', '3', '1']\", \"assert create_linked_list(['Python']) == ['Python', 'Python...
{ "split": "train", "index": 6166, "acecode_id": "evol_20814", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given the dimensions of a rectangular box represented by its width (W), height (H), and length (L), along with an integer N. Your task is to write a function that determines the maximum number of smaller cubes with dimensions LxLxL that can fit into the larger box, or r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_cubes(5, 5, 1, 30) == 25\", \"assert max_cubes(1, 1, 1, 1) == 1\", \"assert max_cubes(12, 12, 2, 50) == 36\", \"assert max_cubes(0, 10, 3, 5) == 0\", \"assert max_cubes(10, 0, 3, 5) == 0\", \"assert max_cubes(10, 10, 10, 5) == 1\", \"assert max_cubes(10,...
{ "split": "train", "index": 6167, "acecode_id": "oss_23290", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that prints a delimiter line composed of a specified character repeated a given number of times. Your function should take two parameters: a character `delim` (a single character string) and an integer `count`. The function should print t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert print_delimiter('-', 5) == None # Expected output: '-----'\", \"assert print_delimiter('*', 10) == None # Expected output: '**********'\", \"assert print_delimiter('=', 0) == None # Expected output: '' (no output)\", \"assert print_delimiter('#', -3) == N...
{ "split": "train", "index": 6168, "acecode_id": "bigcode_python_fns_41394", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that counts the number of mapping nodes and sequence nodes in a given nested dictionary structure. A mapping node is defined as a dictionary, while a sequence node is defined as a list. Your function should take a single argument, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_yaml_nodes({'fruits': ['apple', 'banana', 'cherry'], 'vegetables': {'carrot': 'orange', 'lettuce': 'green'}}) == {'mapping_nodes': 2, 'sequence_nodes': 1}\", \"assert count_yaml_nodes({'a': 1, 'b': [2, 3], 'c': {'d': 4}}) == {'mapping_nodes': 2, 'seque...
{ "split": "train", "index": 6169, "acecode_id": "oss_24321", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a list of integers and returns a new list containing only the unique integers from the original list, in the order they first appeared. Your function should ignore any duplicates. For example, given the input list [1, 2, 2,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_integers([1, 2, 2, 3, 4, 3]) == [1, 2, 3, 4]\", \"assert unique_integers([5, 5, 5, 5]) == [5]\", \"assert unique_integers([]) == []\", \"assert unique_integers([10, 20, 10, 30, 20]) == [10, 20, 30]\", \"assert unique_integers([1, 2, 3, 1, 2, 3]) == [1...
{ "split": "train", "index": 6170, "acecode_id": "oss_31129", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the prices of items in a store. Your task is to implement a function that returns the maximum profit you can achieve by buying and selling one item. You can only buy the item before you sell it. If you cannot achieve any profit, ret...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_profit([7, 1, 5, 3, 6, 4]) == 5\", \"assert max_profit([7, 6, 4, 3, 1]) == 0\", \"assert max_profit([1, 2]) == 1\", \"assert max_profit([5]) == 0\", \"assert max_profit([3, 2, 6, 5, 0, 3]) == 4\", \"assert max_profit([2, 1]) == 0\", \"assert max_profit([...
{ "split": "train", "index": 6171, "acecode_id": "bigcode_python_fns_36729", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked to implement a function `get_nodes_by_pathway_name(proteins: List[Dict[str, Union[str, List[str]]]], pathway_name: str) -> List[Dict[str, Union[str, List[str]]]]` that takes a list of protein dictionaries and a pathway name as input. Each protein dictionary has t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_nodes_by_pathway_name([{ 'rid': '1', 'namespace': 'NS1', 'name': 'Protein A', 'bel': 'Bel A', 'reactome_pathways': ['Pathway X', 'Pathway Y'] }, { 'rid': '2', 'namespace': 'NS2', 'name': 'Protein B', 'bel': 'Bel B', 'reactome_pathways': ['Pathway Y'] }],...
{ "split": "train", "index": 6172, "acecode_id": "bigcode_python_fns_30699", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers and a target number, implement a function that returns all unique combinations of integers from the list that sum up to the target number. Each number in the list may be used an unlimited number of times. The combinations should be returned in any order...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert combination_sum([1, 2, 3], 4) == [[1, 1, 1, 1], [1, 1, 2], [1, 3], [2, 2]]\", \"assert combination_sum([2, 3, 5], 8) == [[2, 2, 2, 2], [2, 3, 3], [3, 5]]\", \"assert combination_sum([1], 1) == [[1]]\", \"assert combination_sum([2], 3) == []\", \"assert combi...
{ "split": "train", "index": 6173, "acecode_id": "evol_7780", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are given a dictionary `mapping` where each key is an integer and each value is a string. You also receive a list of integers `excluded_keys`. Your task is to implement a function that returns a string value from the dictionary that is not associated with any of the exclude...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert any_value_except({1: 'apple', 2: 'banana', 3: 'cherry'}, [1, 2]) == 'cherry'\", \"assert any_value_except({1: 'apple', 2: 'banana', 3: 'cherry'}, [2]) == 'apple'\", \"assert any_value_except({1: 'apple', 2: 'banana', 3: 'cherry'}, []) == 'apple'\", \"assert ...
{ "split": "train", "index": 6174, "acecode_id": "bigcode_python_fns_7546", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two integers `n` and `m`, return `true` if `n` is a power of four and `m` is a power of two. Otherwise, return `false`. An integer `n` is a power of four if there exists an integer `x` such that `n == 4^x`. An integer `m` is a power of two if there exists an integer `y` s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert powerOfFourAndTwo(16, 8) == True\", \"assert powerOfFourAndTwo(5, 3) == False\", \"assert powerOfFourAndTwo(1, 2) == True\", \"assert powerOfFourAndTwo(4, 2) == True\", \"assert powerOfFourAndTwo(64, 16) == True\", \"assert powerOfFourAndTwo(0, 1) == False\"...
{ "split": "train", "index": 6175, "acecode_id": "evol_34041", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two parameters, param_a and param_b, initialized with the values 1 and 2 respectively. You also receive a single input named name_a. Your task is to implement a function that returns the result of the expression param_a + param_b - name_a. The function should hand...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_expression(3) == 0\", \"assert calculate_expression(1) == 2\", \"assert calculate_expression(0) == 3\", \"assert calculate_expression(2) == 1\", \"assert calculate_expression(4) == -1\", \"assert calculate_expression(10) == -7\", \"assert calculate...
{ "split": "train", "index": 6176, "acecode_id": "bigcode_python_fns_35070", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Your task is to write a function that removes all occurrences of the number 3 from the list and returns the modified list. If the input list is empty or does not contain the number 3, the function should return the original list. Implement the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_threes([]) == []\", \"assert remove_threes([1, 2, 4]) == [1, 2, 4]\", \"assert remove_threes([3, 3, 3]) == []\", \"assert remove_threes([3]) == []\", \"assert remove_threes([1, 2, 3, 4, 5]) == [1, 2, 4, 5]\", \"assert remove_threes([1, 2, 4, 5]) == [1...
{ "split": "train", "index": 6177, "acecode_id": "oss_30790", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the total number of frames in a cycle based on the frames in one cycle and how many times all the other frames of the cycle repeat. Write a function `calculate_total_frames` that takes in two parameters: `frames_in_cyc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_total_frames(10) == 20\", \"assert calculate_total_frames(10, 1) == 20\", \"assert calculate_total_frames(10, 2) == 30\", \"assert calculate_total_frames(5) == 10\", \"assert calculate_total_frames(5, 3) == 20\", \"assert calculate_total_frames(0) ...
{ "split": "train", "index": 6178, "acecode_id": "oss_7144", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two axis-aligned rectangles, each represented by a list of four integers `[x1, y1, x2, y2]`. Here, `(x1, y1)` represents the coordinates of the bottom-left corner, and `(x2, y2)` represents the coordinates of the top-right corner. Your task is to write a function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert overlap([0,0,2,2], [1,1,3,3]) == True\", \"assert overlap([0,0,1,1], [1,0,2,1]) == False\", \"assert overlap([0,0,1,1], [2,2,3,3]) == False\", \"assert overlap([-1,-1,1,1], [0,0,2,2]) == True\", \"assert overlap([1,1,3,3], [2,2,4,4]) == True\", \"assert over...
{ "split": "train", "index": 6179, "acecode_id": "evol_8111", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string of characters without any spaces, write a function in Python to divide the given string into three equal parts. If the string's length is not a multiple of three or if it has fewer than three characters, return an appropriate error message. The function should on...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert divide_string('abc') == 'Part1: a\\\\nPart2: b\\\\nPart3: c'\", \"assert divide_string('abcdef') == 'Part1: ab\\\\nPart2: cd\\\\nPart3: ef'\", \"assert divide_string('xyzxyzxyz') == 'Part1: xyz\\\\nPart2: xyz\\\\nPart3: xyz'\", \"assert divide_string('123') ...
{ "split": "train", "index": 6180, "acecode_id": "evol_27974", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that validates a given slug for a bookmarking application. The slug must adhere to the following criteria: it should be a string, have a maximum length of 12 characters, and can only contain alphanumeric characters and hyphens. Your task ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_slug('valid-slug') == True\", \"assert is_valid_slug('toolongslug12') == False\", \"assert is_valid_slug('short') == True\", \"assert is_valid_slug('123-456') == True\", \"assert is_valid_slug('slug_with_underscore') == False\", \"assert is_valid_sl...
{ "split": "train", "index": 6181, "acecode_id": "oss_31720", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing a collection of dialects represented by their names in a simple registry. Your goal is to implement a function that allows you to unregister a dialect by its name. You need to implement the function `unregister_dialect(name: str) -> None`, which tak...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unregister_dialect('english') is None\", \"assert unregister_dialect('spanish') is None\", \"assert unregister_dialect('french') is None\", \"assert unregister_dialect('german') is None\", \"assert unregister_dialect('italian') is None\", \"assert unregister...
{ "split": "train", "index": 6182, "acecode_id": "bigcode_python_fns_4892", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates a file saving dialog. Your function should accept a timeout value in milliseconds as an argument and return a filename selected by the user or None if no selection is made within the specified timeout. The function w...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_file_dialog(500) == 'file2.txt'\", \"assert simulate_file_dialog(10) == None\", \"assert simulate_file_dialog(0) == None\", \"assert simulate_file_dialog(1500) == 'file3.txt'\", \"assert simulate_file_dialog(300) == None\", \"assert simulate_file_di...
{ "split": "train", "index": 6183, "acecode_id": "oss_13614", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the creation of a 'Ticket' object. The function should take a dictionary representing ticket details and return a new Ticket object. The ticket details will include the following keys: 'title' (string), 'description' (strin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_ticket({'title': 'Issue #1', 'description': 'First ticket.', 'priority': 'low'}) == {'title': 'Issue #1', 'description': 'First ticket.', 'priority': 'low'}\", \"assert create_ticket({'title': 'Issue #2', 'description': 'Second ticket.', 'priority': '...
{ "split": "train", "index": 6184, "acecode_id": "bigcode_python_fns_3081", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a heading text based on the input parameters representing album data and the state of a window. The function should take the following parameters: \n1. `artist` (string): The name of the artist. \n2. `title` (string): The...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_heading('Artist Name', 'Album Title', 'music', 'tracks', False) == 'Wijzigen gegevens van music Artist Name - Album Title : tracks'\", \"assert generate_heading('Artist Name', '', 'podcast', 'tracks', False) == 'Opvoeren nieuw podcast'\", \"assert g...
{ "split": "train", "index": 6185, "acecode_id": "bigcode_python_fns_30938", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a string representing a torch device in the format 'cpu' or 'cuda:<index>', write a function that converts this string representation to a corresponding chainer device string. For 'cpu', the output should be '@numpy'. For 'cuda:<index>', the output should be '@cupy:<index...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_device('cpu') == '@numpy'\", \"assert convert_device('cuda:0') == '@cupy:0'\", \"assert convert_device('cuda:1') == '@cupy:1'\", \"assert convert_device('cuda:2') == '@cupy:2'\", \"assert convert_device('cuda:3') == '@cupy:3'\", \"assert convert_devi...
{ "split": "train", "index": 6186, "acecode_id": "bigcode_python_fns_44315", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with extracting details from a given Lambda function definition in Python. Write a function `extract_lambda_details(lambda_code: str, timeout: int) -> dict` that takes a string representing the code of a Lambda function and an integer representing the timeout dur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_lambda_details('def another_function(event):\\\\n return True', 150) == {'function_name': 'Singleton', 'handler_code': 'def another_function(event):\\\\n return True', 'timeout_seconds': 150}\", \"assert extract_lambda_details('def my_handler(e...
{ "split": "train", "index": 6187, "acecode_id": "oss_3387", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that converts a given string from snake_case to camelCase. In snake_case, words are separated by underscores, while in camelCase, words are joined without spaces and each word, except the first, starts with a capital letter. Write a f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert snakeToCamel('hello_world') == 'helloWorld'\", \"assert snakeToCamel('snake_case_example') == 'snakeCaseExample'\", \"assert snakeToCamel('this_is_a_test') == 'thisIsATest'\", \"assert snakeToCamel('convert_this_string') == 'convertThisString'\", \"assert sn...
{ "split": "train", "index": 6188, "acecode_id": "oss_18034", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that identifies the common characters between two input strings, treating the characters in a case-insensitive manner. The function should return a dictionary where each key is a character present in both strings and each value is the total count of occurre...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert shared_chars('Mango', 'Watermelon') == {'a': 2, 'm': 2, 'n': 2, 'o': 2}\", \"assert shared_chars('abc', 'def') == {}\", \"assert shared_chars('OpenAI', 'openai') == {'o': 2, 'p': 2, 'e': 2, 'n': 2, 'a': 2, 'i': 2}\", \"assert shared_chars('123abc', 'abc456')...
{ "split": "train", "index": 6189, "acecode_id": "evol_31155", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Implement a function `is_prime(n: int) -> bool` that determines if the given integer n is a prime number. A prime number is defined as a number greater than 1 that has no positive divisors other than 1 and itself. If n is less than or equal to 1, the function should return Fals...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_prime(2) == True\", \"assert is_prime(3) == True\", \"assert is_prime(4) == False\", \"assert is_prime(5) == True\", \"assert is_prime(6) == False\", \"assert is_prime(7) == True\", \"assert is_prime(8) == False\", \"assert is_prime(9) == False\", \"asser...
{ "split": "train", "index": 6190, "acecode_id": "evol_3641", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with validating predictions made by a model endpoint in a machine learning application. The model endpoint takes a list of input data points, processes them, and returns a list of predictions. Your goal is to implement a function that simulates the behavior of th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert mock_model_predictions([0]) == [10]\", \"assert mock_model_predictions([1]) == [20]\", \"assert mock_model_predictions([2]) == [30]\", \"assert mock_model_predictions([3]) == [40]\", \"assert mock_model_predictions([4]) == [50]\", \"assert mock_model_predict...
{ "split": "train", "index": 6191, "acecode_id": "oss_35656", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that analyzes the distribution of words in a given string. Your function should take a string input and output the frequency of each word in the string, sorted in descending order based on their frequency. A word is defined as a sequence ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert word_frequency_analysis('Hello world! Hello everyone.') == [('hello', 2), ('world', 1), ('everyone', 1)]\", \"assert word_frequency_analysis('Python is great, and python is fun.') == [('python', 2), ('great', 1), ('fun', 1)]\", \"assert word_frequency_analys...
{ "split": "train", "index": 6192, "acecode_id": "oss_25148", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Implement a recursive function to perform a binary search on a sorted list of integers, which can include both negative and non-negative values. The function should return True if the target integer is found in the list, and False otherwise. The function signature is: def recur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert recursive_binary_search([-4, -2, 0, 6, 7, 8], 6) == True\", \"assert recursive_binary_search([-4, -2, 0, 6, 7, 8], -4) == True\", \"assert recursive_binary_search([-4, -2, 0, 6, 7, 8], -2) == True\", \"assert recursive_binary_search([-4, -2, 0, 6, 7, 8], 0) ...
{ "split": "train", "index": 6193, "acecode_id": "evol_23653", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `is_valid_hex_color(code: str) -> bool` that determines if a given string is a valid hexadecimal color code. A valid hexadecimal color code starts with a '#' followed by exactly six characters, which can be digits (0-9) or letters (A-F or a-f).\nPlease reas...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_hex_color('#FFFFFF') == True\", \"assert is_valid_hex_color('#000000') == True\", \"assert is_valid_hex_color('#123456') == True\", \"assert is_valid_hex_color('#abcdef') == True\", \"assert is_valid_hex_color('#A1B2C3') == True\", \"assert is_valid...
{ "split": "train", "index": 6194, "acecode_id": "evol_11392", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of strings and returns a sorted list of alphabetic strings that meet the following criteria: The strings must not contain any numerical digits, and they must have a length of exactly 2. The resulting list should be sorted by the length of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert refined_list_summation(['ab', 'bc', 'a1', 'de']) == ['ab', 'bc', 'de']\", \"assert refined_list_summation(['ab', 'bc', 'a1', 'de'], True) == ['de', 'bc', 'ab']\", \"assert refined_list_summation(['xy', 'yz', 'zz']) == ['xy', 'yz', 'zz']\", \"assert refined_l...
{ "split": "train", "index": 6195, "acecode_id": "evol_15134", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simple library system. The library contains books, and users can perform the following operations: add books, remove books, display the list of available books, borrow a book, and return a borrowed book. Your function...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert library_operations([('add', 'Python Programming'), ('add', 'Data Structures and Algorithms'), ('display', '')]) == ['Python Programming', 'Data Structures and Algorithms']\", \"assert library_operations([('add', 'Python Programming'), ('borrow', 'Python Prog...
{ "split": "train", "index": 6196, "acecode_id": "oss_37565", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple memory-mapped I/O (MMIO) device for a SHA (Secure Hash Algorithm) accelerator. The MMIO device will have four registers: 'sha_start', 'sha_state', 'sha_rdaddr', and 'sha_wraddr'. The 'sha_start' and 'sha_state' registers are read-only, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert mmio_operations([('write', 'sha_rdaddr', 4660), ('write', 'sha_wraddr', 43981), ('read', 'sha_rdaddr')]) == [4660]\", \"assert mmio_operations([('write', 'sha_start', 5), ('write', 'sha_state', 10), ('read', 'sha_state')]) == [0]\", \"assert mmio_operations(...
{ "split": "train", "index": 6197, "acecode_id": "oss_3521", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists of numbers, `x` and `y`, which represent the coordinates of points in a 2D space. Your task is to implement a function `create_graph(x: List[float], y: List[float], xerr: Optional[Union[float, List[float]]] = None, yerr: Optional[Union[float, List[float]...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_graph([1.0, 2.0, 3.0], [1.0, 4.0, 9.0]) == 'SimpleGraph'\", \"assert create_graph([1.0, 2.0], [1.0, 4.0], xerr=0.1) == 'GraphWithXErrors'\", \"assert create_graph([1.0, 2.0], [1.0, 4.0], yerr=0.2) == 'GraphWithYErrors'\", \"assert create_graph([1.0, 2...
{ "split": "train", "index": 6198, "acecode_id": "bigcode_python_fns_44762", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given two lists of strings, A and B. Your task is to create a new list that contains all the unique strings from list A that do not appear in list B, followed by all the strings from list B. Implement a function `combine_unique(A: List[str], B: List[str]) -> List[str]` ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert combine_unique(['apple', 'banana', 'cherry'], ['banana', 'date', 'fig']) == ['apple', 'cherry', 'banana', 'date', 'fig']\", \"assert combine_unique(['apple', 'banana', 'apple'], ['banana', 'fig']) == ['apple', 'banana', 'fig']\", \"assert combine_unique(['a'...
{ "split": "train", "index": 6199, "acecode_id": "bigcode_python_fns_30164", "num_tests": 16 }