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": "Develop a function that takes a string phrase as input and converts the first letter of each word to uppercase. If a word is surrounded by double quotes, convert the second letter of that word instead of the first letter. If a word has less than two characters, it should remain... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert('greetings \\\"earthlings\\\"') == 'Greetings \\\"eArthlings\\\"'\", \"assert convert('a b') == 'A B'\", \"assert convert('\\\"\\\"') == '\\\"\\\"'\", \"assert convert('single') == 'Single'\", \"assert convert('it is a test') == 'It Is A Test'\", \"a... | {
"split": "train",
"index": 76400,
"acecode_id": "evol_32853",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simplified version of a command-line testing environment. The function should take a command string as input and return a simulated exit status based on the command's characteristics. Specifically, if the command string c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert run_command('ls -l') == 0\", \"assert run_command('echo Hello World') == 0\", \"assert run_command('error command') == 1\", \"assert run_command('') == 2\", \"assert run_command('cat file.txt') == 0\", \"assert run_command('error') == 1\", \"assert run_comma... | {
"split": "train",
"index": 76401,
"acecode_id": "oss_890",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the arithmetic sum of all integers in a given range defined by two inclusive integer parameters, `start` and `end`. The function should return the sum of all integers from `start` to `end`. If the input values are not integers, the function ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert arithmetic_sum(2, 6) == 20\", \"assert arithmetic_sum(1, 5) == 15\", \"assert arithmetic_sum(0, 0) == 0\", \"assert arithmetic_sum(-3, 3) == 0\", \"assert arithmetic_sum(-5, -1) == -15\", \"assert arithmetic_sum(3, 3) == 3\", \"assert arithmetic_sum(10, 15) ... | {
"split": "train",
"index": 76402,
"acecode_id": "evol_4372",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of integers and returns a new list containing only the unique integers from the original list, preserving the order of their first occurrence. The function should take a single parameter, a list of integers, and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_integers([1, 2, 3, 1, 2, 3]) == [1, 2, 3]\", \"assert unique_integers([4, 5, 6, 4, 5]) == [4, 5, 6]\", \"assert unique_integers([7, 8, 7, 9, 10, 8]) == [7, 8, 9, 10]\", \"assert unique_integers([]) == []\", \"assert unique_integers([1]) == [1]\", \"as... | {
"split": "train",
"index": 76403,
"acecode_id": "oss_6825",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of file paths and returns a list of paths that point to ZIP files. A ZIP file path is defined as a string that matches the pattern 'download/temp/<number>.zip', where <number> is one or more digits. Implement ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_zip_files(['download/temp/123.zip', 'download/temp/456.txt', 'download/temp/789.zip']) == ['download/temp/123.zip', 'download/temp/789.zip']\", \"assert find_zip_files(['download/temp/1.zip', 'download/temp/2.zip', 'download/temp/3.txt']) == ['download/... | {
"split": "train",
"index": 76404,
"acecode_id": "oss_10778",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a pressure value in pascals (Pa), write a function `pressure_to_cm_h2o(press_in: int) -> int` that converts the pressure from pascals to centimeters of water (cm H2O). The conversion formula is defined as follows: 1 cm H2O is equivalent to 98.0665 pascals. The function sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pressure_to_cm_h2o(0) == 0\", \"assert pressure_to_cm_h2o(49) == 0\", \"assert pressure_to_cm_h2o(98) == 1\", \"assert pressure_to_cm_h2o(980) == 10\", \"assert pressure_to_cm_h2o(980662) == 10000\"]}"
} | {
"split": "train",
"index": 76405,
"acecode_id": "bigcode_python_fns_34833",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that accepts a list of integers and returns a new list containing only the unique integers from the input list, preserving the original order of their first occurrences. Implement a function `unique_integers(nums: List[int]) -> List[int]:... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_integers([4, 5, 4, 3, 2, 1, 5]) == [4, 5, 3, 2, 1]\", \"assert unique_integers([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert unique_integers([5, 5, 5, 5]) == [5]\", \"assert unique_integers([]) == []\", \"assert unique_integers([10, 20, 10, 30, 20, ... | {
"split": "train",
"index": 76406,
"acecode_id": "oss_26219",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that converts a string of hexadecimal numbers into its corresponding binary representation. The function should not use any standard library functions for the conversion and must handle potential errors or exceptions. The input string can contain both uppercase... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hex_to_bin('1A2F') == '0001101000101111'\", \"assert hex_to_bin('e3d3C') == '11100011110100111100'\", \"assert hex_to_bin('123abc') == '000100100011101010111100'\", \"assert hex_to_bin('0') == '0000'\", \"assert hex_to_bin('A') == '1010'\", \"assert hex_to_b... | {
"split": "train",
"index": 76407,
"acecode_id": "evol_21402",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D list `topo`, where each element represents a connection between nodes in a network. Each node has a volume associated with it represented by a 1D list `volumes`. Your task is to implement a function `nodal_distribution_factors(topo: List[List[int]], volumes: ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert nodal_distribution_factors([[0]], [0]) == [[0.0]]\", \"assert nodal_distribution_factors([[0, 0], [0, 0]], [1, 1]) == [[0.0, 0.0], [0.0, 0.0]]\", \"assert nodal_distribution_factors([[0, 1, 1], [1, 0, 0], [1, 0, 0]], [0, 0, 0]) == [[0.0, 0.0, 0.0], [0.0, 0.0... | {
"split": "train",
"index": 76408,
"acecode_id": "bigcode_python_fns_1481",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function `fibfib(n: int) -> int` that computes the nth term of the FibFib sequence, which is defined as follows: fibfib(0) = 0, fibfib(1) = 0, fibfib(2) = 1, and for n >= 3, fibfib(n) = fibfib(n-1) + fibfib(n-2) + fibfib(n-3). The function should handle non-negative... | 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": 76409,
"acecode_id": "evol_35994",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `install_package` that simulates the installation of a package in a Linux environment. The function should take a string parameter `package_name`, which represents the name of the package to be installed. The function should return a string indicating wheth... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert install_package('vim') == 'Installation of vim was successful.'\", \"assert install_package('git') == 'Installation of git was successful.'\", \"assert install_package('python3') == 'Installation of python3 was successful.'\", \"assert install_package('nodej... | {
"split": "train",
"index": 76410,
"acecode_id": "evol_33781",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `dropout_layer(x: List[float], keep_rate: float) -> List[float]` that simulates a dropout layer in a neural network. The function takes a list of floating-point numbers `x` representing the inputs to the layer and a float `keep_rate` which indicates the pro... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dropout_layer([1.0, 2.0, 3.0, 4.0], 0.5) == [2.0, 0.0, 0.0, 0.0] or [0.0, 4.0, 0.0, 8.0]\", \"assert dropout_layer([0.0, 0.0, 0.0], 0.9) == [0.0, 0.0, 0.0]\", \"assert dropout_layer([1.5, 2.5, 3.5], 1.0) == [1.5, 2.5, 3.5]\", \"assert dropout_layer([-1.0, -2... | {
"split": "train",
"index": 76411,
"acecode_id": "bigcode_python_fns_19805",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `calculate_circle_area(radius: float) -> float` that takes the radius of a circle as an input and returns the area of the circle. The area of a circle can be calculated using the formula: area = π * radius^2. You may assume that the radius will be a non-negativ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_circle_area(0) == 0.0\", \"assert calculate_circle_area(1) == 3.141592653589793\", \"assert calculate_circle_area(2) == 12.566370614359172\", \"assert calculate_circle_area(3) == 28.274333882308138\", \"assert calculate_circle_area(4) == 50.2654824... | {
"split": "train",
"index": 76412,
"acecode_id": "evol_9173",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a simple banking system. Implement a function `manage_bank_account(initial_balance: int, transactions: List[Tuple[str, int]]) -> int` that takes an initial account balance and a list of transactions. Each transaction is represented as a tuple, whe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_bank_account(100, [('deposit', 50), ('withdraw', 20)]) == 130\", \"assert manage_bank_account(100, [('withdraw', 50), ('deposit', 100)]) == 150\", \"assert manage_bank_account(100, [('withdraw', 150)]) == 100\", \"assert manage_bank_account(0, [('depo... | {
"split": "train",
"index": 76413,
"acecode_id": "oss_32167",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given the root of a binary tree, return the values of its boundary in a specific order. The boundary is composed of the root, the left boundary (excluding the leaves), the leaves arranged from left to right, and the right boundary (excluding the leaves and in reverse order). Im... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert boundary_of_binary_tree(TreeNode(1, None, TreeNode(2, TreeNode(3), TreeNode(4)))) == [1, 3, 4, 2]\", \"assert boundary_of_binary_tree(TreeNode(1, TreeNode(2, TreeNode(4)), TreeNode(3, None, TreeNode(6)))) == [1, 2, 4, 6, 3]\", \"assert boundary_of_binary_tre... | {
"split": "train",
"index": 76414,
"acecode_id": "evol_14527",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `compress_and_decompress(data: List[Dict[str, Any]], fieldnames: List[str]) -> List[Dict[str, Any]]` that takes a list of dictionaries and a list of field names, compresses the data using a custom format, and then decompresses it back... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compress_and_decompress([{'title': '1984', 'author': 'George Orwell'}, {'title': 'Brave New World', 'author': 'Aldous Huxley'}], ['title', 'author']) == [{'title': '1984', 'author': 'George Orwell'}, {'title': 'Brave New World', 'author': 'Aldous Huxley'}]\"... | {
"split": "train",
"index": 76415,
"acecode_id": "oss_34686",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a list of paths, where each path is represented as a dictionary containing two keys: 'is_final' (a boolean indicating if the path is final) and 'rules_with_temp' (a list of rules that contain temperature expressions). Write a function `validate_rule_paths(paths: L... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_rule_paths([{'is_final': True, 'rules_with_temp': ['temp_rule1']}, {'is_final': False, 'rules_with_temp': []}]) == [{'is_final': True, 'rules_with_temp': ['temp_rule1']}, {'is_final': False, 'rules_with_temp': []}]\", \"assert validate_rule_paths([{... | {
"split": "train",
"index": 76416,
"acecode_id": "bigcode_python_fns_18457",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a class called `OutlierDetector` which has several properties: `threshold`, `n_components`, `std_clip`, `start_clip`, `max_n`, `cat_vars`, `ohe`, `d_abs`, `clip`, `mean`, `C`, and `n`. Your task is to implement a function `state_mahalanobis(od: OutlierDetector) ->... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert state_mahalanobis(OutlierDetector(threshold=0.5, n_components=2, std_clip=1.0, start_clip=0.0, max_n=100, cat_vars=['A', 'B'], ohe=True, d_abs=0.1, clip=True, mean=[0.0, 1.0], C=[[1, 0], [0, 1]], n=50)) == {'threshold': 0.5, 'n_components': 2, 'std_clip': 1.... | {
"split": "train",
"index": 76417,
"acecode_id": "bigcode_python_fns_5798",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing names of medicinal products. Your task is to implement a function that returns a list of unique medicinal product names in the same order they first appeared in the input list. The function should ignore any case differences, meaning... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_medicinal_products(['Aspirin', 'Tylenol', 'aspirin', 'Advil', 'Tylenol']) == ['Aspirin', 'Tylenol', 'Advil']\", \"assert unique_medicinal_products(['Ibuprofen', 'ibuprofen', 'IBUPROFEN', 'naproxen']) == ['Ibuprofen', 'naproxen']\", \"assert unique_med... | {
"split": "train",
"index": 76418,
"acecode_id": "bigcode_python_fns_23892",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer `val`, return `val` if it is non-negative. If `val` is negative, raise a `ValueError` with the message 'val cannot be negative.'.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert function_with_exception(5) == 5\", \"assert function_with_exception(0) == 0\", \"assert function_with_exception(10) == 10\", \"assert function_with_exception(1) == 1\", \"assert function_with_exception(1000) == 1000\", \"assert function_with_exception(3) == ... | {
"split": "train",
"index": 76419,
"acecode_id": "bigcode_python_fns_49893",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a given URL is valid and returns a response indicating whether it was successful. The function should take a string parameter 'url' and return a dictionary with a key 'success' that is True if the URL conforms to a specific... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_url('http://example.com') == {'success': True, 'message': 'URL is valid'}\", \"assert check_url('https://example.com') == {'success': True, 'message': 'URL is valid'}\", \"assert check_url('ftp://example.com') == {'success': False, 'message': 'Invalid ... | {
"split": "train",
"index": 76420,
"acecode_id": "bigcode_python_fns_7441",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple model parameter management system. Your task is to implement a function named `manage_model_params` that accepts a model name and a series of key-value pairs representing parameters. The function should return ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_model_params('LinearRegression', learning_rate=0.01, epochs=100) == {'name': 'LinearRegression', 'params': {'learning_rate': 0.01, 'epochs': 100}}\", \"assert manage_model_params('DecisionTree', max_depth=5) == {'name': 'DecisionTree', 'params': {'max... | {
"split": "train",
"index": 76421,
"acecode_id": "oss_21418",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to implement a function that calculates the average of all the integers in the list. The function should return the average as a float. If the list is empty, the function should return 0.0. Write a function `calculate_average(nums:... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average([1, 2, 3, 4, 5]) == 3.0\", \"assert calculate_average([-1, 0, 1]) == 0.0\", \"assert calculate_average([5, 5, 5]) == 5.0\", \"assert calculate_average([]) == 0.0\", \"assert calculate_average([10, 20, 30]) == 20.0\", \"assert calculate_aver... | {
"split": "train",
"index": 76422,
"acecode_id": "oss_28646",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of tuples, where each tuple contains a category (a string) and a count (an integer). Your task is to find the category that corresponds to the median count value from the list. The median is defined as the value that separates the higher half from the lower... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert findMedianCategory([('A', 1), ('B', 2), ('C', 3)]) == 'B'\", \"assert findMedianCategory([('X', 4), ('Y', 6), ('Z', 2)]) == 'X'\", \"assert findMedianCategory([('A', 10), ('B', 20), ('C', 30), ('D', 10)]) == 'B'\", \"assert findMedianCategory([('Apple', 5), ... | {
"split": "train",
"index": 76423,
"acecode_id": "bigcode_python_fns_2326",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings called `flags`. Your task is to implement a function `add_flags(test: Test, flags: List[str])` that modifies the `args` attribute of the `test` object by appending all the strings in `flags` to it. The `test` object is an instance of a class `Tes... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_flags(Test(args=[]), ['flag1', 'flag2']).args == ['flag1', 'flag2']\", \"assert add_flags(Test(args=[]), []).args == []\", \"assert add_flags(Test(args=['existing']), ['flag1']).args == ['existing', 'flag1']\", \"assert add_flags(Test(args=['a', 'b']), [... | {
"split": "train",
"index": 76424,
"acecode_id": "bigcode_python_fns_31305",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function `prime_divisors(n)` that returns a list of all unique prime divisors of a given positive integer `n`. The function should raise a `ValueError` if the input is not a positive integer. The function must be optimized to handle large integers efficiently.\nP... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert prime_divisors(1) == []\", \"assert prime_divisors(2) == [2]\", \"assert prime_divisors(3) == [3]\", \"assert prime_divisors(4) == [2]\", \"assert prime_divisors(5) == [5]\", \"assert prime_divisors(6) == [2, 3]\", \"assert prime_divisors(7) == [7]\", \"asse... | {
"split": "train",
"index": 76425,
"acecode_id": "evol_15308",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary where each key represents a cluster identifier and its corresponding value represents a group name. Your task is to implement a function called `create_cluster_meta` that takes in this dictionary and returns a new dictionary. The new dictionary should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_cluster_meta({'cluster1': 'groupA', 'cluster2': 'groupB'}) == {'cluster1': {'group': 'groupA'}, 'cluster2': {'group': 'groupB'}}\", \"assert create_cluster_meta({'cluster3': 'groupC'}) == {'cluster3': {'group': 'groupC'}}\", \"assert create_cluster_me... | {
"split": "train",
"index": 76426,
"acecode_id": "bigcode_python_fns_1343",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating the behavior of a device discovery system. You will implement a function `device_discovery` that takes a list of device identifiers (strings) and a target identifier (string). The function should return the string 'Device Found' if the target iden... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert device_discovery(['device1', 'device2', 'device3'], 'device2') == 'Device Found'\", \"assert device_discovery(['deviceA', 'deviceB', 'deviceC'], 'deviceX') == 'Device Not Found'\", \"assert device_discovery(['Device1', 'Device2'], 'device1') == 'Device Not F... | {
"split": "train",
"index": 76427,
"acecode_id": "bigcode_python_fns_40272",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a doubly linked list data structure that supports efficient insertions and deletions at the beginning, middle, and end. Write a function named `doubly_linked_list_operations` that takes a list of operations, where each operation is represented a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert doubly_linked_list_operations([('insert_end', 1), ('insert_end', 2), ('insert_beginning', 0)]) == [0, 1, 2]\", \"assert doubly_linked_list_operations([('delete_beginning',), ('delete_end',)]) == []\", \"assert doubly_linked_list_operations([('insert_beginnin... | {
"split": "train",
"index": 76428,
"acecode_id": "evol_3947",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that sorts a list of job dictionaries based on multiple criteria. Each job is represented as a dictionary containing the following keys: 'submit_time' (an integer timestamp), 'priority' (an integer), 'run_time' (an integer), and 'stat' (a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_jobs([]) == []\", \"assert sort_jobs([{'submit_time': 1, 'priority': 1, 'run_time': 5, 'stat': 'completed'}, {'submit_time': 2, 'priority': 2, 'run_time': 3, 'stat': 'pending'}]) == [{'submit_time': 1, 'priority': 1, 'run_time': 5, 'stat': 'completed'},... | {
"split": "train",
"index": 76429,
"acecode_id": "bigcode_python_fns_2796",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the average of a list of integers. The function should take a list of integers as input and return the average value of those integers. If the list is empty, the function should return 0. Your implementation should han... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average([1, 2, 3, 4, 5]) == 3.0\", \"assert calculate_average([-1, -2, -3, -4, -5]) == -3.0\", \"assert calculate_average([]) == 0\", \"assert calculate_average([10, 20, 30]) == 20.0\", \"assert calculate_average([1]) == 1.0\", \"assert calculate_a... | {
"split": "train",
"index": 76430,
"acecode_id": "oss_10736",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string label representing a complex input label of a morphotactics FST rewrite rule, implement a function that extracts and returns a list of FST symbols that compose the label. The FST symbols must be extracted based on the following rules: if the label is an epsilon s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_symbols('<eps>') == ['<eps>']\", \"assert extract_symbols('90') == ['9', '0']\", \"assert extract_symbols('12345') == ['1', '2', '3', '4', '5']\", \"assert extract_symbols('') == []\", \"assert extract_symbols('!@#') == ['!', '@', '#']\"]}"
} | {
"split": "train",
"index": 76431,
"acecode_id": "bigcode_python_fns_43699",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that decodes a list of labels represented as strings. Each label needs to be transformed by applying a specific decoding rule: prepend the string 'decoded_' to each label. Your function should take a list of labels as input and return... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decode_labels(['label1', 'label2', 'label3']) == ['decoded_label1', 'decoded_label2', 'decoded_label3']\", \"assert decode_labels(['test', 'example', 'sample']) == ['decoded_test', 'decoded_example', 'decoded_sample']\", \"assert decode_labels(['a', 'b', 'c'... | {
"split": "train",
"index": 76432,
"acecode_id": "oss_10283",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `verify_isbn(isbn: str) -> bool` that checks if the provided International Standard Book Number (ISBN) is valid. The function should accept a string `isbn` that can be either 10 or 13 characters long. For a 10-character ISBN, the last character can be a dig... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert verify_isbn('0123456789') == True\", \"assert verify_isbn('9783161484100') == True\", \"assert verify_isbn('123456789X') == True\", \"assert verify_isbn('0306406152') == True\", \"assert verify_isbn('9780136091813') == True\", \"assert verify_isbn('978-0-321... | {
"split": "train",
"index": 76433,
"acecode_id": "evol_23197",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary representing a form with field names as keys and dictionaries of field attributes as values, implement a function `extract_field_attributes(form_data: dict, attributes: list) -> dict` that extracts specified attributes from each field. The function should ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_field_attributes({'name': {'label': 'Name', 'required': True}, 'email': {'label': 'Email', 'required': False}}, ['label']) == {'name': {'label': 'Name'}, 'email': {'label': 'Email'}}\", \"assert extract_field_attributes({'age': {'type': 'Integer', 'm... | {
"split": "train",
"index": 76434,
"acecode_id": "bigcode_python_fns_37667",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two sequences of integers, MT_seq and WT_seq, both of the same length. Write a function `window` that takes these two sequences and a window size (default is 5). The function should return a list of tuples, where each tuple contains the starting index of the windo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert window([1, 2, 3, 4, 5], [10, 20, 30, 40, 50]) == [(0, [1, 2, 3, 4, 5], [10, 20, 30, 40, 50])]\", \"assert window([5, 6, 7, 8, 9, 10], [15, 16, 17, 18, 19, 20]) == [(0, [5, 6, 7, 8, 9], [15, 16, 17, 18, 19]), (1, [6, 7, 8, 9, 10], [16, 17, 18, 19, 20])]\", \"... | {
"split": "train",
"index": 76435,
"acecode_id": "bigcode_python_fns_42774",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing audio signals to compute a Voice Activity Detection (VAD) feature based on given parameters. Implement a function `compute_vad_feature` that takes in the following parameters: \n\n- `duration` (float): The duration of the audio signal in seconds. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_vad_feature(1.5, 2, 0, 25.0, 10.0, 512, 5, 0.5, 0.1, 1.0, 12, 3) == True\", \"assert compute_vad_feature(0.5, 2, 0, 25.0, 10.0, 512, 5, 0.5, 0.1, 1.0, 12, 3) == False\", \"assert compute_vad_feature(2.0, 2, -1, 25.0, 10.0, 512, 5, 0.5, 0.1, 1.0, 12, ... | {
"split": "train",
"index": 76436,
"acecode_id": "bigcode_python_fns_2860",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a non-negative integer 'limit', write a function that calculates the summation of all natural numbers from 0 to 'limit' inclusive. If 'limit' is negative, the function should return 0. Implement this in a single function called 'summation'.\nPlease reason step by step, th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert summation(0) == 0\", \"assert summation(1) == 1\", \"assert summation(2) == 3\", \"assert summation(3) == 6\", \"assert summation(4) == 10\", \"assert summation(5) == 15\", \"assert summation(6) == 21\", \"assert summation(7) == 28\", \"assert summation(8) =... | {
"split": "train",
"index": 76437,
"acecode_id": "bigcode_python_fns_32897",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `reposition_zeros(arr)` that takes a nested array `arr` containing integers, strings, floats, and other data types. The function should reposition all instances of the integer zero to the end of their respective arrays, while preserving the order of all non-zer... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reposition_zeros([0, 1, 2, 0, 3]) == [1, 2, 3, 0, 0]\", \"assert reposition_zeros([1, 2, 3]) == [1, 2, 3]\", \"assert reposition_zeros([0]) == [0]\", \"assert reposition_zeros([0, 0, 0]) == [0, 0, 0]\", \"assert reposition_zeros(['a', 0, 'b', 0]) == ['a', 'b... | {
"split": "train",
"index": 76438,
"acecode_id": "evol_4871",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function `word_analysis(input_string: str) -> Tuple[Dict[int, int], int, float, Set[int]]` that calculates the frequency of each unique word length in a given string. The function should return a dictionary with word lengths as keys and their frequencies as values, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert word_analysis('Hello') == ({5: 1}, 1, 5.0, {5})\", \"assert word_analysis(' ') == ({}, 0, 0.0, set())\", \"assert word_analysis('Multiple spaces') == ({8: 1, 6: 1}, 2, 7.0, {6, 8})\", \"assert word_analysis('') == ({}, 0, 0.0, set())\", \"assert word_an... | {
"split": "train",
"index": 76439,
"acecode_id": "evol_25008",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the parsing of an action. An action has several attributes: `name`, `classes`, `method`, `target`, `title`, `media_type`, and `fields`. Your task is to create a function `parse_action(data: dict) -> dict` that takes a d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_action({'name': 'action1', 'classes': ['classA', 'classB'], 'method': 'PUT', 'target': '/action1', 'title': 'Action 1', 'media_type': 'application/json', 'fields': ['field1', 'field2']}) == {'name': 'action1', 'classes': ['classA', 'classB'], 'method':... | {
"split": "train",
"index": 76440,
"acecode_id": "bigcode_python_fns_24039",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a recursive function that generates the Fibonacci sequence up to a given non-negative integer n. If the input is less than 0, the function should raise a ValueError. The sequence should include all Fibonacci numbers from 0 to the nth Fibonacci number, inclusive. Your ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci_sequence(0) == [0]\", \"assert fibonacci_sequence(1) == [0, 1]\", \"assert fibonacci_sequence(2) == [0, 1, 1]\", \"assert fibonacci_sequence(3) == [0, 1, 1, 2]\", \"assert fibonacci_sequence(4) == [0, 1, 1, 2, 3]\", \"assert fibonacci_sequence(5) =... | {
"split": "train",
"index": 76441,
"acecode_id": "evol_23558",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing a list of report entries, where each entry is a dictionary containing a 'message' and 'file'. Your goal is to extract the resource ID from the message using a specific format. The resource ID is defined as the substring enclosed in square brackets... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_test_cases([{ 'message': '[Resource1] This is a test message', 'file': 'test_file_1' }]) == ['0 - [Resource1] This is a test message - test_file_1#Resource1']\", \"assert generate_test_cases([{ 'message': '[Resource2] Another test case', 'file': 'te... | {
"split": "train",
"index": 76442,
"acecode_id": "bigcode_python_fns_32152",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of keys and a dictionary representing a context, implement a function `has_key_in_context(keys: List[str], context: Dict[str, Any]) -> List[bool]` that checks if each key in the list exists in the context dictionary. The function should return a list of boolean val... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_key_in_context(['a', 'b', 'c'], {'a': 1, 'd': 2}) == [True, False, False]\", \"assert has_key_in_context(['x', 'y', 'z'], {'x': 10, 'y': 20}) == [True, True, False]\", \"assert has_key_in_context(['key1', 'key2'], {'key1': 'value1'}) == [True, False]\", ... | {
"split": "train",
"index": 76443,
"acecode_id": "bigcode_python_fns_34491",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a sequence of XML data. Your task is to parse this XML string and convert it into a corresponding dictionary representation. Implement a function that takes a single argument, `xml_string`, which is the XML data as a string. The function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_xml_to_dict('<root><child>value1</child><child>value2</child></root>') == {'root': [], 'child': ['value1', 'value2']}\", \"assert parse_xml_to_dict('<data><item>1</item><item>2</item><item>3</item></data>') == {'data': [], 'item': ['1', '2', '3']}\", \... | {
"split": "train",
"index": 76444,
"acecode_id": "oss_11163",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of profit and loss (PnL) values for a series of trades. Each value represents the profit or loss from a single trade. Your task is to implement a function that calculates the cumulative return as a percentage of a total capital amount. The cumulative return... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_cumulative_return([0, 0, 0, 0], 1000000) == '0.0%'\", \"assert calculate_cumulative_return([-100000, -200000, -300000], 1000000) == '-60.0%'\", \"assert calculate_cumulative_return([500000, -500000], 1000000) == '0.0%'\", \"assert calculate_cumulat... | {
"split": "train",
"index": 76445,
"acecode_id": "bigcode_python_fns_33256",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a palindrome string and a character, create a function that replaces the character with a space and reverses the order of the words in the string. After reversing the words, ensure that the final output is still a valid palindrome. If it's not possible to create a valid p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_and_reverse('noon', 'o') == 'n n'\", \"assert replace_and_reverse('a_b_a', '_') == 'a b a'\", \"assert replace_and_reverse('a_a_a', '_') == 'a a a'\", \"assert replace_and_reverse('a', 'a') == ''\", \"assert replace_and_reverse('abba', 'b') == 'a a'\... | {
"split": "train",
"index": 76446,
"acecode_id": "evol_33700",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a type of lattice ('FCC', 'SC', or 'SH'), implement a function that returns a list of three lists, each containing three floating-point numbers representing the lattice primitive vectors. The output should be formatted as a list of lists where each i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert assign_lpvs('FCC') == [[0, 0.7071067811865475, 0.7071067811865475], [0.7071067811865475, 0, 0.7071067811865475], [0.7071067811865475, 0.7071067811865475, 0]]\", \"assert assign_lpvs('SC') == [[1, 0, 0], [0, 1, 0], [0, 0, 1]]\", \"assert assign_lpvs('XYZ') ==... | {
"split": "train",
"index": 76447,
"acecode_id": "bigcode_python_fns_25405",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of strings, where each string represents a line of text from a file. Your function should return a new list containing the lines in reverse order. Implement the function `reverse_lines(lines: List[str]) -> List[str]` tha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_lines(['line 1', 'line 2', 'line 3']) == ['line 3', 'line 2', 'line 1']\", \"assert reverse_lines(['first', 'second', 'third', 'fourth']) == ['fourth', 'third', 'second', 'first']\", \"assert reverse_lines(['one']) == ['one']\", \"assert reverse_line... | {
"split": "train",
"index": 76448,
"acecode_id": "bigcode_python_fns_26468",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `validate_password(password: str) -> bool` that checks the validity of a password based on the following conditions: \n1. The length of the password should be between 6 and 16 characters. \n2. The password must contain at least one numeral (0-9). \n3. The p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_password('Passw0rd$') == True\", \"assert validate_password('P@ssword1') == True\", \"assert validate_password('A1b@cd') == True\", \"assert validate_password('Password1$') == True\", \"assert validate_password('pass$1A') == True\"]}"
} | {
"split": "train",
"index": 76449,
"acecode_id": "evol_1287",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `reparameterize_module` that takes a list `nums` and an integer `target`. The function should return a new list where each element in `nums` is replaced by the absolute difference between that element and the `target`. If the absolute ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reparameterize_module([-5, -10, 0, 5], -5) == [0, 5, 5, 10]\", \"assert reparameterize_module([0, 0, 0], 0) == [0, 0, 0]\", \"assert reparameterize_module([10], 5) == [5]\", \"assert reparameterize_module([1, 2, 3, 4, 5], 3) == [2, 1, 0, 1, 2]\", \"assert re... | {
"split": "train",
"index": 76450,
"acecode_id": "bigcode_python_fns_45704",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given an input string 's' and an integer 'k', write a function that returns the character that has the 'k'th highest frequency in the string. If there are fewer than 'k' unique characters in the string, return None. The input string may contain spaces and punctuation, which sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert kth_highest_freq('aabbcc', 1) == 'a'\", \"assert kth_highest_freq('aaa bbb ccc', 2) == 'b'\", \"assert kth_highest_freq('abc', 3) == 'c'\", \"assert kth_highest_freq('abcabc', 2) == 'b'\", \"assert kth_highest_freq('a', 1) == 'a'\", \"assert kth_highest_freq... | {
"split": "train",
"index": 76451,
"acecode_id": "evol_3106",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `calculate_jaro_distance` that calculates the Jaro distance between two strings. The Jaro distance is a measure of similarity between two strings defined as follows: Let `m` be the number of matching characters between the two strings... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_jaro_distance('MARTHA', 'MARHTA') == 0.9444444444444445\", \"assert calculate_jaro_distance('abc', 'abc') == 1.0\", \"assert calculate_jaro_distance('abc', 'def') == 0.0\", \"assert calculate_jaro_distance('', '') == 1.0\", \"assert calculate_jaro_... | {
"split": "train",
"index": 76452,
"acecode_id": "oss_3276",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function `validate_input_sequence(input_sequence: List[str]) -> bool` that checks if the provided input sequence consists solely of strings made up of characters from the Anglo-Saxon alphabet (a-z, A-Z). The function should return True if all strings in the sequence... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_input_sequence(['Hello', 'World']) == True\", \"assert validate_input_sequence(['Hello123', 'World']) == False\", \"assert validate_input_sequence(['Python', 'Code']) == True\", \"assert validate_input_sequence(['123', '456']) == False\", \"assert v... | {
"split": "train",
"index": 76453,
"acecode_id": "evol_13802",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function to flatten a nested list into a single list. The input will be a list of lists, and your function should return a new list containing all the elements of the nested lists in the order they appear.\nPlease reason step by step, then write a self-contained Python ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert flatten([[1, 2], [3, 4], [5, 6]]) == [1, 2, 3, 4, 5, 6]\", \"assert flatten([[10, 20], [30], [40, 50, 60]]) == [10, 20, 30, 40, 50, 60]\", \"assert flatten([[], [], []]) == []\", \"assert flatten([[1], [2], [3], [4]]) == [1, 2, 3, 4]\", \"assert flatten([[1,... | {
"split": "train",
"index": 76454,
"acecode_id": "evol_18180",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `calculate_total` that takes the quantities of two products, ProductA and ProductB, and calculates the total amount of an order for an online store. The function should consider the price and tax rate for each product. The prices are fixed at $5 for ProductA an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total(0, 0) == 0.0\", \"assert calculate_total(1, 0) == 5.5\", \"assert calculate_total(0, 1) == 11.5\", \"assert calculate_total(1, 1) == 17.0\", \"assert calculate_total(2, 0) == 11.0\", \"assert calculate_total(0, 2) == 23.0\", \"assert calculat... | {
"split": "train",
"index": 76455,
"acecode_id": "evol_14114",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a string containing a sequence of words. Your task is to implement a function that counts the frequency of each word in the string and returns a dictionary where the keys are the words and the values are their respective counts. Words are defined as sequences of a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_word_frequencies('Hello world! Hello everyone.', {'everyone'}) == {'hello': 2, 'world': 1}\", \"assert count_word_frequencies('The quick brown fox jumps over the lazy dog.', {'the', 'over'}) == {'quick': 1, 'brown': 1, 'fox': 1, 'jumps': 1, 'lazy': 1, ... | {
"split": "train",
"index": 76456,
"acecode_id": "bigcode_python_fns_25950",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a hexadecimal color string in the format '#RRGGBB', where RR, GG, and BB are two-digit hexadecimal numbers representing the red, green, and blue color components, respectively, implement a function `parse_color(hex_color)` that converts the hexadecimal color string to a d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_color('#FFFFFF') == {'r': 1.0, 'g': 1.0, 'b': 1.0}\", \"assert parse_color('#000000') == {'r': 0.0, 'g': 0.0, 'b': 0.0}\", \"assert parse_color('#FF0000') == {'r': 1.0, 'g': 0.0, 'b': 0.0}\", \"assert parse_color('#00FF00') == {'r': 0.0, 'g': 1.0, 'b':... | {
"split": "train",
"index": 76457,
"acecode_id": "bigcode_python_fns_29185",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates a message object. The function should ensure that the `url` attribute of the message is a valid URL string. A valid URL string must start with 'http://' or 'https://'. If the `url` attribute does not conform to this format,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_url_message('URL #1', 'http://example.com') is None\", \"assert validate_url_message('URL #2', 'https://example.com') is None\", \"assert validate_url_message('URL #3', 'http://example.org') is None\", \"assert validate_url_message('URL #4', 'https:... | {
"split": "train",
"index": 76458,
"acecode_id": "bigcode_python_fns_30558",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that takes a list of integers and returns a new list containing only the even numbers from the input list, maintaining their original order. Your function should be named `filter_even_numbers`. The function signature is as follows:... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 21, 32, 43, 54]) == [10, 32, 54]\", \"assert filter_even_numbers([1, 3, 5]) == []\", \"assert filter_even_numbers([2, 4, 6, 8]) == [2, 4, 6, 8]\", \"assert filter_even_number... | {
"split": "train",
"index": 76459,
"acecode_id": "oss_17344",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to generate a hierarchy of case types for a case management system. The hierarchy is represented as a list of lists of strings, where each inner list contains the case types at a specific level. The function should be named `generate_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_case_hierarchy('incident') == [['incident'], ['incident_parent'], ['incident_parent_parent']]\", \"assert generate_case_hierarchy('complaint') == [['complaint'], ['complaint_parent'], ['complaint_parent_parent']]\", \"assert generate_case_hierarchy(... | {
"split": "train",
"index": 76460,
"acecode_id": "oss_18667",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that outputs each individual word of a given phrase in inverted sequence. The function should handle edge cases including multiple spaces, punctuation, and unexpected user inputs. The function should return a list of words in reversed order. Please imple... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert inverted_word_sequence('The quick brown fox jumps over the lazy dog.') == ['dog', 'lazy', 'the', 'over', 'jumps', 'fox', 'brown', 'quick', 'The']\", \"assert inverted_word_sequence(' Look, he said. ') == ['said', 'he', 'Look']\", \"assert inverted_wor... | {
"split": "train",
"index": 76461,
"acecode_id": "evol_24601",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the effective sample size based on the given configuration parameters for a machine learning model. The effective sample size is defined as the total number of samples divided by the batch size. Your function should ta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_effective_sample_size(32, 1000) == 31.25\", \"assert calculate_effective_sample_size(0, 1000) == 0\", \"assert calculate_effective_sample_size(64, 1280) == 20.0\", \"assert calculate_effective_sample_size(128, 512) == 4.0\", \"assert calculate_effe... | {
"split": "train",
"index": 76462,
"acecode_id": "oss_20937",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two rectangles defined by their top-left coordinates (x, y), width, and height. Your task is to determine if these two rectangles overlap and, if they do, calculate the coordinates and dimensions of the intersection rectangle. The rectangles are defined as follows... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert intersection_rectangle(0, 0, 2, 2, 1, 1, 2, 2) == (1, 1, 1, 1)\", \"assert intersection_rectangle(0, 0, 2, 2, 3, 3, 2, 2) == (0, 0, 0, 0)\", \"assert intersection_rectangle(0, 0, 2, 2, 1, 0, 2, 2) == (1, 0, 1, 2)\", \"assert intersection_rectangle(1, 1, 3, 3... | {
"split": "train",
"index": 76463,
"acecode_id": "bigcode_python_fns_48215",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes in three parameters: an original string, a specific substring to locate within that string, and a text that will replace every occurrence of that substring. The function should return the modified string with all occurrences of the substring repl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_substring('Hello World', 'World', 'Universe') == 'Hello Universe'\", \"assert replace_substring('abababab', 'ab', 'xy') == 'xyxyxyxy'\", \"assert replace_substring('Python programming', 'Python', 'Java') == 'Java programming'\", \"assert replace_subs... | {
"split": "train",
"index": 76464,
"acecode_id": "evol_2387",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of trees in a forest. Your task is to write a function `max_tree_height(trees: List[int]) -> int` that returns the maximum height of the trees in the list. If the list is empty, return 0. The function should only impleme... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_tree_height([3, 1, 4, 1, 5, 9]) == 9\", \"assert max_tree_height([0, -1, -2, -3]) == 0\", \"assert max_tree_height([]) == 0\", \"assert max_tree_height([1, 2, 3, 4, 5]) == 5\", \"assert max_tree_height([-10, -5, -1, -3]) == -1\", \"assert max_tree_height... | {
"split": "train",
"index": 76465,
"acecode_id": "bigcode_python_fns_21668",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function called `validate_preprocessors`. This function should take two parameters: `preprocessors` and `postprocessors`. The `preprocessors` parameter represents a list of preprocessors and the `postprocessors` parameter represents a list of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_preprocessors([], []) == True\", \"assert validate_preprocessors([1, 2, 3], [4, 5]) == True\", \"assert validate_preprocessors([], [1]) == True\", \"assert validate_preprocessors([1], []) == True\", \"assert validate_preprocessors(['a', 'b'], ['c', ... | {
"split": "train",
"index": 76466,
"acecode_id": "bigcode_python_fns_8566",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a string, write a function `generate_anagrams(word: str) -> List[str]` that returns a list of all unique anagrams that can be formed by rearranging the letters of the string. The output list should be sorted in lexicographical order.\nPlease reason step by step, then writ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_anagrams('abc') == ['abc', 'acb', 'bac', 'bca', 'cab', 'cba']\", \"assert generate_anagrams('a') == ['a']\", \"assert generate_anagrams('ab') == ['ab', 'ba']\", \"assert generate_anagrams('aaa') == ['aaa']\", \"assert generate_anagrams('aab') == ['a... | {
"split": "train",
"index": 76467,
"acecode_id": "evol_15663",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a list of 2D coordinates representing points on a grid and an array of corresponding values (heights) at those coordinates, write a function `find_max_value_coordinate(coords: List[Tuple[float, float]], values: List[float]) -> Tuple[float, float]` that returns the coordin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max_value_coordinate([(0, 0), (1, 1)], [1.0, 2.0]) == (1, 1)\", \"assert find_max_value_coordinate([(0, 0), (1, 1)], [2.0, 2.0]) == (0, 0)\", \"assert find_max_value_coordinate([(2, 3), (1, 1), (4, 4)], [0.5, 0.8, 0.8]) == (1, 1)\", \"assert find_max_va... | {
"split": "train",
"index": 76468,
"acecode_id": "bigcode_python_fns_44266",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of numbers, implement a function that processes each element such that if the element is odd, it is multiplied by two, and if it is even, it is divided by two. The function should also count the number of odd and even elements in the original list. The function sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_list([1, 2, 3, 4, 5, 6]) == ([2, 1.0, 6, 2.0, 10, 3.0], 3, 3)\", \"assert process_list([0, -2, -3, 4, 5]) == ([0.0, -1.0, -6, 2.0, 10], 2, 3)\", \"assert process_list([10, 15, 20, 25]) == ([5.0, 30, 10.0, 50], 2, 2)\", \"assert process_list([2, 4, 6]... | {
"split": "train",
"index": 76469,
"acecode_id": "evol_27687",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a custom text formatter function in Python. Your text formatter should be able to format text by replacing specific placeholders with corresponding values. The placeholders will be enclosed in curly braces and will consist of alphanumeric charac... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_text({'name': 'Alice'}, 'Hello, my name is {name}.') == 'Hello, my name is Alice.'\", \"assert format_text({'age': '30'}, 'I am {age} years old.') == 'I am 30 years old.'\", \"assert format_text({'name': 'John', 'age': '25'}, 'My name is {name} and I ... | {
"split": "train",
"index": 76470,
"acecode_id": "oss_2612",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates various statistical features from a list of numerical or categorical data. Your function should return a dictionary containing the mean, median, mode, and range of the input data. If the input data for mean, median, or... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_features([]) == {'mean': 0, 'median': 0, 'mode': None, 'range': 0}\", \"assert calculate_features([1, 2, 2, 3, 4]) == {'mean': 2.4, 'median': 2, 'mode': 2, 'range': 3}\", \"assert calculate_features([5, 5, 5, 5]) == {'mean': 5.0, 'median': 5.0, 'mo... | {
"split": "train",
"index": 76471,
"acecode_id": "oss_18413",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given two sequentially ordered arrays, implement a function `find_intersection(arr1, arr2)` that identifies the common elements present in both arrays. You must not use any built-in Python functions. The function should return a list of the common elements in the order they app... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_intersection([1, 2, 3], [3, 4, 5]) == [3]\", \"assert find_intersection([5, 10, 15], [1, 2, 3]) == []\", \"assert find_intersection([2, 4, 6, 8], [6, 7, 8, 9]) == [6, 8]\", \"assert find_intersection([10, 20, 30], [20, 30, 40]) == [20, 30]\", \"assert f... | {
"split": "train",
"index": 76472,
"acecode_id": "evol_5054",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of image URLs and extracts the image IDs from them. The image URLs are in the format `https://www.example.com/images/{image_id}/{image_name}.jpg`, where `{image_id}` is a unique numerical identifier for the im... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_image_ids(['https://www.example.com/images/123456/image1.jpg']) == [123456]\", \"assert extract_image_ids(['https://www.example.com/images/0/image1.jpg']) == [0]\", \"assert extract_image_ids(['https://www.example.com/images/999999/image2.jpg']) == [... | {
"split": "train",
"index": 76473,
"acecode_id": "oss_28943",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that analyzes a given full name string. The function should perform the following operations: 1. Return the full name in title case. 2. Return the full name in uppercase. 3. Return the full name in lowercase. 4. Calculate and retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_name(' Bob Smith ') == ('Bob Smith', 'BOB SMITH', 'bob smith', 8, ('Bob', 3))\", \"assert analyze_name(' Frank Castle ') == ('Frank Castle', 'FRANK CASTLE', 'frank castle', 11, ('Frank', 5))\", \"assert analyze_name(' L ') == ('L', 'L', ... | {
"split": "train",
"index": 76474,
"acecode_id": "oss_2453",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Write a function `remove_repeated_words(sentence: str) -> str` that takes a sentence as input and returns a new sentence with all repeated words removed, preserving the order of their first occurrence. The input sentence may contain punctuation and should maintain the original ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_repeated_words('This is a test test sentence.') == 'This is a test sentence.'\", \"assert remove_repeated_words('Hello world world!') == 'Hello world!'\", \"assert remove_repeated_words('Python is great great for programming.') == 'Python is great for... | {
"split": "train",
"index": 76475,
"acecode_id": "evol_7126",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing ratings given by users to items. Implement a function `average_rating(ratings: List[int]) -> float` that calculates the average rating. The function should return the average of the ratings rounded to two decimal places. If the list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_rating([5, 4, 3, 2, 1]) == 3.00\", \"assert average_rating([1, 2, 3, 4, 5, 6]) == 3.50\", \"assert average_rating([0, 0, 0]) == 0.00\", \"assert average_rating([1]) == 1.00\", \"assert average_rating([]) == 0.00\", \"assert average_rating([5]) == 5.0... | {
"split": "train",
"index": 76476,
"acecode_id": "bigcode_python_fns_40348",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Convert a binary string to its decimal representation. Given a binary number represented as a string (e.g., '1101'), return its equivalent decimal value as an integer.\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 binary_to_decimal('0') == 0\", \"assert binary_to_decimal('1') == 1\", \"assert binary_to_decimal('10') == 2\", \"assert binary_to_decimal('11') == 3\", \"assert binary_to_decimal('100') == 4\", \"assert binary_to_decimal('101') == 5\", \"assert binary_to_de... | {
"split": "train",
"index": 76477,
"acecode_id": "evol_29165",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of strings representing the contents of multiple files and generates a unique digest for each file's content. The digest should be created by concatenating the ASCII values of each character in the string representation ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_file_digests(['hello', 'world']) == ['104101108108111', '119111114108100']\", \"assert generate_file_digests(['abc', 'def']) == ['979899', '100101102']\", \"assert generate_file_digests(['', 'a']) == ['','97']\", \"assert generate_file_digests(['123... | {
"split": "train",
"index": 76478,
"acecode_id": "oss_35365",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function `write_file(filename: str, content: str) -> None` that writes the given `content` to a file specified by `filename`. Use a try/except/finally block to manage potential exceptions during the file writing process. Ensure that if an exception occurs, it is cau... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert write_file('test1.txt', 'Hello, World!') is None\", \"assert write_file('test2.txt', '') is None\", \"assert write_file('test3.txt', 'Python is great!') is None\", \"assert write_file('invalid_directory/test.txt', 'This will fail') is None\", \"assert write_... | {
"split": "train",
"index": 76479,
"acecode_id": "evol_33016",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes information related to special service areas in a city. The function should take in a list of dictionaries, where each dictionary represents a special service area, and return a new list containing the names of the s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_special_service_areas([{'name': 'area_1', 'agency_name': 'Agency One', 'timezone': 'Timezone_1', 'allowed_domains': ['domain1.com']}], 'Timezone_1', 'domain1') == ['Agency One']\", \"assert filter_special_service_areas([{'name': 'area_2', 'agency_name... | {
"split": "train",
"index": 76480,
"acecode_id": "oss_9923",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `count_exempt_numbers(numbers: List[int]) -> int` that counts how many numbers in the list are marked as exempt. A number is considered exempt if it is greater than 10. The function should return the count of exempt numbers in the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_exempt_numbers([11, 14, 8, 2, 10]) == 2\", \"assert count_exempt_numbers([-1, -2, -3, -4]) == 0\", \"assert count_exempt_numbers([10, 20, 30]) == 2\", \"assert count_exempt_numbers([1, 2, 3, 4, 5]) == 0\", \"assert count_exempt_numbers([100, 200, 300])... | {
"split": "train",
"index": 76481,
"acecode_id": "bigcode_python_fns_48697",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that returns a list of strings representing different transformation actions for a neural architecture search (NAS) process. Write a function `get_nas_transformations()` that returns the following transformations: 'PadActions', 'AsArray',... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_nas_transformations() == ['PadActions', 'AsArray', 'RewardsAsValueTargets', 'TileValueTargets']\", \"assert len(get_nas_transformations()) == 4\", \"assert get_nas_transformations()[0] == 'PadActions'\", \"assert get_nas_transformations()[1] == 'AsArray'... | {
"split": "train",
"index": 76482,
"acecode_id": "bigcode_python_fns_400",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary where each key is a string and each value is a list of strings, write a function that sorts the dictionary based on the specified criteria. You can choose to sort by the keys or the values of the dictionary. The sorting can be case-sensitive or case-insensiti... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_dict({'apple': ['red', 'green'], 'banana': ['yellow']}) == [('apple', ['red', 'green']), ('banana', ['yellow'])]\", \"assert sort_dict({'apple': ['red', 'green'], 'Banana': ['yellow']}, case_sensitive=True) == [('Banana', ['yellow']), ('apple', ['red', ... | {
"split": "train",
"index": 76483,
"acecode_id": "bigcode_python_fns_32388",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple configuration manager for a software application. The configuration manager should be able to manage configuration settings using a dictionary. Your task is to implement a function called `manage_configurations... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_configurations([('set', 'scale', 1.5), ('set', 'use_opencc', True), ('get', 'scale')]) == [1.5]\", \"assert manage_configurations([('set', 'scale', 1.5), ('get', 'use_opencc')]) == [None]\", \"assert manage_configurations([('set', 'use_opencc', False)... | {
"split": "train",
"index": 76484,
"acecode_id": "oss_31718",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a list of pods in a repository. Each pod may be either enabled or started. Your goal is to undeploy a specified number of pods from the repository, but you cannot undeploy pods that are currently enabled or started. Given a list of pods and a parame... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cleanup_pods(['pod1', 'pod2', 'pod3', 'enabled_pod4', 'started_pod5'], 2) == ['enabled_pod4', 'started_pod5']\", \"assert cleanup_pods(['pod1', 'pod2', 'enabled_pod3'], 1) == ['enabled_pod3']\", \"assert cleanup_pods(['pod1', 'pod2', 'pod3', 'pod4'], 4) == [... | {
"split": "train",
"index": 76485,
"acecode_id": "bigcode_python_fns_7689",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple User management system. Implement a function `manage_user` that takes three parameters: `action` (a string, which can be 'create', 'update', 'delete', or 'retrieve'), `username` (a string representing the user's username), and `email` (a st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_user('create', 'jane_doe', 'jane@example.com') == 'User created successfully.'\", \"assert manage_user('update', 'john_doe', 'john_new@example.com') == 'User updated successfully.'\", \"assert manage_user('delete', 'john_doe', 'john_new@example.com') ... | {
"split": "train",
"index": 76486,
"acecode_id": "oss_6609",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simplified version of a map data structure that supports three operations: setting a key-value pair, getting a value by key, and removing a key-value pair. Your task is to write a function `simple_map_operations(operations: List[Tuple[str, Uni... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simple_map_operations([('set', 'apple', 5), ('get', 'apple')]) == [5]\", \"assert simple_map_operations([('set', 'banana', 7), ('get', 'banana')]) == [7]\", \"assert simple_map_operations([('set', 'cherry', 3), ('remove', 'cherry'), ('get', 'cherry')]) == [N... | {
"split": "train",
"index": 76487,
"acecode_id": "oss_3934",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries representing GPU test results. Each dictionary contains the following keys: 'path' (a string indicating the type of test, either ending in '.cl' for OpenCL tests or something else for CUDA tests), 'executed' (a boolean indicating if the test... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert summarise_tests([{'path': 'test1.cl', 'executed': True, 'passed': True, 'return_code': 0}, {'path': 'test2.cl', 'executed': True, 'passed': False, 'return_code': 1}, {'path': 'test3.cu', 'executed': False, 'passed': False, 'return_code': 0}]) == {'OpenCL': 2... | {
"split": "train",
"index": 76488,
"acecode_id": "bigcode_python_fns_49849",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function `multiply_without_operator(x: int, y: int) -> int` that calculates the product of two positive integers X and Y without using the multiplication operator (*). The function should use addition and subtraction to derive the result. X and Y are guaranteed to b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multiply_without_operator(1, 1) == 1\", \"assert multiply_without_operator(2, 3) == 6\", \"assert multiply_without_operator(5, 5) == 25\", \"assert multiply_without_operator(7, 8) == 56\", \"assert multiply_without_operator(10, 15) == 150\", \"assert multipl... | {
"split": "train",
"index": 76489,
"acecode_id": "evol_29801",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple Node class in Python to represent nodes in a tree data structure. The class should have the following properties and methods: Properties: 1. `node_name`: A read-only property that returns the name of the node. 2. `node_id`: A read-only ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_node('1', '0', 'Root').node_id == '1'\", \"assert create_node('1', '0', 'Root').parent_id == '0'\", \"assert create_node('1', '0', 'Root').node_name == 'Root'\", \"assert create_node('2', '1', 'Child').node_id == '2'\", \"assert create_node('2', '1', ... | {
"split": "train",
"index": 76490,
"acecode_id": "oss_22709",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two sequences of equal length, implement a function that calculates the Hamming distance between them. The Hamming distance is defined as the number of positions at which the corresponding elements are different. Both sequences will be provided as lists of integers. You n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hamming_distance([1, 0, 1, 1], [1, 1, 0, 1]) == 2\", \"assert hamming_distance([0, 0, 0, 0], [1, 1, 1, 1]) == 4\", \"assert hamming_distance([1, 2, 3, 4], [1, 2, 3, 5]) == 1\", \"assert hamming_distance([5, 6, 7], [5, 6, 8]) == 1\", \"assert hamming_distance... | {
"split": "train",
"index": 76491,
"acecode_id": "bigcode_python_fns_43319",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that calculates the final balance of a specified bank account after processing a list of transactions. Each transaction is represented as a tuple (account_id, amount), where 'account_id' is a string that identifies the bank account... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_balance([('A123', 100.0), ('B456', -50.0), ('A123', -30.0), ('C789', 20.0)], 'A123') == 70.0\", \"assert calculate_balance([('A123', 100.0), ('B456', -50.0), ('A123', -30.0), ('C789', 20.0)], 'B456') == -50.0\", \"assert calculate_balance([('A123',... | {
"split": "train",
"index": 76492,
"acecode_id": "oss_18812",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing a sequence of values. Write a function that takes this list and an integer target, and returns a new list containing only the elements from the original list that are less than the target. The output list should maintain the origina... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_less_than_target([1, 2, 3, 4, 5], 3) == [1, 2]\", \"assert filter_less_than_target([5, 3, 8, 2, 1], 4) == [3, 2, 1]\", \"assert filter_less_than_target([], 10) == []\", \"assert filter_less_than_target([7, 8, 9], 7) == []\", \"assert filter_less_than_... | {
"split": "train",
"index": 76493,
"acecode_id": "bigcode_python_fns_27487",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function to manage a reward system for a game environment. The function should take a list of rewards and a multiplier as input, and return the total reward after applying the multiplier. The total reward should always be a non-negative float valu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_reward([10.0, 20.0, 30.0], 1.5) == 90.0\", \"assert calculate_total_reward([0.0, 0.0, 0.0], 2.0) == 0.0\", \"assert calculate_total_reward([], 2.0) == 0.0\", \"assert calculate_total_reward([5.0], 2.0) == 10.0\", \"assert calculate_total_rewa... | {
"split": "train",
"index": 76494,
"acecode_id": "oss_37097",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a function that processes JSON data. Your task is to implement a function `extract_valid_json_data(data)` that takes a single argument `data`, which can be of type `dict`, `list`, or any other type. The function should return a list containing valid JSON data. Val... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_valid_json_data({'key': 'value'}) == [{'key': 'value'}]\", \"assert extract_valid_json_data([{'key1': 'value1'}, {'key2': 'value2'}]) == [{'key1': 'value1'}, {'key2': 'value2'}]\", \"assert extract_valid_json_data([{'key': 'value'}, 'invalid']) == []... | {
"split": "train",
"index": 76495,
"acecode_id": "bigcode_python_fns_14761",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of sentence structures represented as dependency triples, where each triple contains a verb and its associated subject information, write a function that extracts all verbs that have a specified subject identifier. Each dependency triple is represented as a tuple o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_verbs([[('run', 'VB'), 'nsubj', ('he', 'pron')], [('jumps', 'VBZ'), 'nsubj', ('she', 'pron')], [('walked', 'VBD'), 'nsubj', ('he', 'pron')]], 'he') == ['run', 'walked']\", \"assert extract_verbs([[('eat', 'VB'), 'nsubj', ('they', 'pron')], [('sleep',... | {
"split": "train",
"index": 76496,
"acecode_id": "bigcode_python_fns_32048",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a single parameter 'param' which is a string. Your task is to create a function called 'test_one_parameter_marked_only' that checks if the given string 'param' contains only alphabetic characters (a-z, A-Z). The function should return True if 'param' contains only... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert test_one_parameter_marked_only('HelloWorld') == True\", \"assert test_one_parameter_marked_only('Hello123') == False\", \"assert test_one_parameter_marked_only('') == False\", \"assert test_one_parameter_marked_only('Python') == True\", \"assert test_one_par... | {
"split": "train",
"index": 76497,
"acecode_id": "bigcode_python_fns_6267",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of employee records and extracts specific information from it. Each record is represented as a dictionary containing details about an employee, including their ID, name, and department. Your task is to write a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_employee_data([]) == {}\", \"assert extract_employee_data([{'employee_id': '1', 'employee_name': 'Alice', 'department': 'HR'}]) == {'1': {'name': 'Alice', 'department': 'HR'}}\", \"assert extract_employee_data([{'employee_id': '2', 'employee_name': '... | {
"split": "train",
"index": 76498,
"acecode_id": "oss_32264",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of 3D points represented as tuples in the format (x, y, z). Write a function that takes this list and returns a new list containing the coordinates of the points that are above a given z threshold. The function should include an optional parameter to specif... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_points_above_threshold([(1, 2, 3), (4, 5, -1), (7, 8, 2)], 0) == [(1, 2, 3), (7, 8, 2)]\", \"assert filter_points_above_threshold([(1, 2, 3), (4, 5, -1), (7, 8, 2)], 5) == []\", \"assert filter_points_above_threshold([(1, 1, 1)], 0) == [(1, 1, 1)]\", ... | {
"split": "train",
"index": 76499,
"acecode_id": "bigcode_python_fns_15359",
"num_tests": 13
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.