data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a string representation of an HTML <progress> element. The function should take three parameters: 'value', 'max', and 'label'. The 'value' represents the current progress, the 'max' represents the maximum value of the progr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_progress_element(50, 100, 'Loading...') == '<progress value=\\\"50\\\" max=\\\"100\\\">Loading...</progress>'\", \"assert generate_progress_element(0, 100, 'Start') == '<progress value=\\\"0\\\" max=\\\"100\\\">Start</progress>'\", \"assert generate... | {
"split": "train",
"index": 64100,
"acecode_id": "bigcode_python_fns_44013",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with transforming a given string according to specific formatting rules. Write a function `manipulate_string` that takes a string as input and performs the following operations: Convert the string to lowercase, replace all underscores ('_') with spaces (' '), and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manipulate_string('hello_world') == 'Hello World'\", \"assert manipulate_string('python_is_fun') == 'Python Is Fun'\", \"assert manipulate_string('data_science_101') == 'Data Science 101'\", \"assert manipulate_string('test_case_example') == 'Test Case Examp... | {
"split": "train",
"index": 64101,
"acecode_id": "oss_17337",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with validating the strength of a password based on specific criteria. Write a function `validate_password_strength(password: str) -> bool` that checks the strength of the password according to the following rules: 1. The password must be at least 8 characters lo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_password_strength('Password1!') == True\", \"assert validate_password_strength('short') == False\", \"assert validate_password_strength('12345678') == False\", \"assert validate_password_strength('PASSWORD!!!') == False\", \"assert validate_password... | {
"split": "train",
"index": 64102,
"acecode_id": "oss_7450",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that manages a pixel grid for an image processing application. The function, `manage_pixel_grid`, should take the following parameters: `width` (an integer representing the width of the pixel grid), `height` (an integer representing t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_pixel_grid(3, 3, [('set', 1, 1, 'red'), ('get', 1, 1)]) == ['red']\", \"assert manage_pixel_grid(3, 3, [('set', 0, 0, 'blue'), ('get', 0, 0)]) == ['blue']\", \"assert manage_pixel_grid(3, 3, [('set', 1, 1, 'green'), ('clear', 1, 1), ('get', 1, 1)]) ==... | {
"split": "train",
"index": 64103,
"acecode_id": "oss_31930",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `uncommon_elements` that accepts a non-empty list of positive integers. The function should return a list of unique integers from the input list that appear more frequently than half of their value. If no integers meet this criterion, the function sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert uncommon_elements([1, 2, 3, 1, 1]) == [1]\", \"assert uncommon_elements([1, 1, 1, 2, 3]) == [1]\", \"assert uncommon_elements([5, 5, 5]) == [5]\", \"assert uncommon_elements([3, 3, 3, 4, 4]) == [3]\", \"assert uncommon_elements([4, 4, 4, 8]) == [4]\"]}"
} | {
"split": "train",
"index": 64104,
"acecode_id": "evol_5515",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Write a recursive function in Python that calculates the Fibonacci number at a given positive integer index, n. The Fibonacci sequence is defined as follows: F(1) = 0, F(2) = 1, and F(n) = F(n-1) + F(n-2) for n > 2. Implement the function `fibonacci(n)` that returns the Fibonac... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(1) == 0\", \"assert fibonacci(2) == 1\", \"assert fibonacci(3) == 1\", \"assert fibonacci(4) == 2\", \"assert fibonacci(5) == 3\", \"assert fibonacci(6) == 5\", \"assert fibonacci(7) == 8\", \"assert fibonacci(8) == 13\", \"assert fibonacci(9) == 2... | {
"split": "train",
"index": 64105,
"acecode_id": "evol_10531",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that performs a merge sort on a given list of integers and sorts them in descending order. Do not use built-in Python functions for sorting. The function should take a list of integers as input and return the sorted list. For example, given the input [9, 4,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_sort([9, 4, 6, 2, 12, 15, 11, 5, 7, 10, 8, 13, 1, 3, 14]) == [15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1]\", \"assert merge_sort([1, 2, 3, 4, 5]) == [5, 4, 3, 2, 1]\", \"assert merge_sort([5, 4, 3, 2, 1]) == [5, 4, 3, 2, 1]\", \"assert merge_sor... | {
"split": "train",
"index": 64106,
"acecode_id": "evol_16529",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that checks the configuration settings for a web application. You need to create a function `validate_configuration()` that takes no parameters and returns a dictionary with the following keys and values: - `'preserve_context_o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_configuration() == {'preserve_context_on_exception': True, 'secret_key_valid': True}\", \"assert validate_configuration() == {'preserve_context_on_exception': True, 'secret_key_valid': True}\", \"assert validate_configuration() == {'preserve_context... | {
"split": "train",
"index": 64107,
"acecode_id": "oss_30884",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates command arguments for removing permissions from a custom project role in a cloud IAM system. The function should take in a dictionary containing 'role_name' and 'permissions' as keys. The 'role_name' should be a valid strin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_permission_removal({'role_name': 'projects/test-project/roles/test_role', 'permissions': 'permission1,permission2'}) is None\", \"assert validate_permission_removal({'role_name': 'projects/test-project/roles/test_role', 'permissions': 'permission1'}... | {
"split": "train",
"index": 64108,
"acecode_id": "bigcode_python_fns_24194",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a string containing an even number of words, where each pair of consecutive words represents a key and its corresponding value, implement a function `construct_dictionary(s)` that constructs and returns a dictionary from these key-value pairs. The input string will always... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert construct_dictionary('name seth age 30 occupation manager') == {'name': 'seth', 'age': '30', 'occupation': 'manager'}\", \"assert construct_dictionary('city newyork temperature 75 weather sunny') == {'city': 'newyork', 'temperature': '75', 'weather': 'sunny'... | {
"split": "train",
"index": 64109,
"acecode_id": "evol_879",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a two-dimensional integer array, implement a function that inverts the elements within each sub-array such that the first element transposes positions with the last one, the second element with the second last one, and so on. After inverting the elements of each sub-array... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_and_invert([[3, 2, 1], [4, 5, 6], [9, 8, 7]]) == [[1, 2, 3], [6, 5, 4], [7, 8, 9]]\", \"assert sort_and_invert([[0]]) == [[0]]\", \"assert sort_and_invert([[10, 20], [30, 40, 50], [0, 0, 0]]) == [[0, 0, 0], [20, 10], [50, 40, 30]]\", \"assert sort_and_i... | {
"split": "train",
"index": 64110,
"acecode_id": "evol_20693",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that returns a new list containing only the unique integers from the input list, preserving the original order of their first appearance. The input list may contain both positive and negative integers, and it can include duplicates... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_integers([1, 2, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert unique_integers([1, 1, 1, 1]) == [1]\", \"assert unique_integers([]) == []\", \"assert unique_integers([-1, -2, -2, -3]) == [-1, -2, -3]\", \"assert unique_integers([5, 3, 5, 7, 3, 9]) == [5, 3, 7,... | {
"split": "train",
"index": 64111,
"acecode_id": "bigcode_python_fns_35622",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a binary tree, you need to write a function `calDepth` that calculates the maximum depth of the tree. The depth of a binary tree is defined as the number of nodes along the longest path from the root node down to the farthest leaf node. Implement the function using the fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calDepth(None) == 0\", \"assert calDepth(TreeNode(1)) == 1\", \"assert calDepth(TreeNode(1, TreeNode(2))) == 2\", \"assert calDepth(TreeNode(1, TreeNode(2), TreeNode(3))) == 2\", \"assert calDepth(TreeNode(1, TreeNode(2, TreeNode(4)), TreeNode(3))) == 3\", \... | {
"split": "train",
"index": 64112,
"acecode_id": "oss_8346",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a list of customer IDs in a web application. Your goal is to implement a function called `delete_customer` that takes in a list of customer IDs and a specific customer ID to delete. The function should remove the specified customer ID from the list.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delete_customer([1, 2, 3, 4], 3) == [1, 2, 4]\", \"assert delete_customer([5, 6, 7], 6) == [5, 7]\", \"assert delete_customer([8, 9], 10) == [8, 9]\", \"assert delete_customer([], 1) == []\", \"assert delete_customer([1], 1) == []\", \"assert delete_customer... | {
"split": "train",
"index": 64113,
"acecode_id": "oss_37729",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that checks if two given sentences are composed of the exact same unique words, ignoring the order of the words. The function should return True if the unique words in both sentences are identical, and False otherwise. The sentences may contain multiple occ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compare_unique_words('hello world', 'world hello') == True\", \"assert compare_unique_words('hello world', 'hello') == False\", \"assert compare_unique_words('a b c d', 'd c b a') == True\", \"assert compare_unique_words('test test test', 'test') == True\", ... | {
"split": "train",
"index": 64114,
"acecode_id": "evol_28462",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers 'lst' and an integer 'n', write a function 'multiply_advanced' that calculates the product of all positive odd integers located at even indices of 'lst', and then multiplies this product by 'n'. If there are no such integers, the function should return ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multiply_advanced([0, 1, 2, 3, 4], 3) == 0\", \"assert multiply_advanced([2, 4, 6, 8], 5) == 0\", \"assert multiply_advanced([1, 1, 1, 1, 1], 4) == 4\", \"assert multiply_advanced([], 5) == 0\", \"assert multiply_advanced([0, 0, 0, 0], 10) == 0\", \"assert m... | {
"split": "train",
"index": 64115,
"acecode_id": "evol_21125",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function to determine whether a given set of numbers represents a winning combination in a game. In this game, the winning combination is defined as having a specific set of numbers: {1, 3, 5, 6, 7, 8}. Write a Python function `check_win` that tak... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_win({1, 3, 5, 6, 7, 8}) == True\", \"assert check_win({1, 2, 3, 4, 5, 6}) == False\", \"assert check_win({1, 3, 5, 7, 8, 6}) == True\", \"assert check_win({1, 3, 5, 6, 7}) == False\", \"assert check_win({1, 3, 5, 6, 7, 8, 9}) == False\", \"assert check... | {
"split": "train",
"index": 64116,
"acecode_id": "oss_11668",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string `s` consisting only of the characters '0' and '1'. The string is called alternating if no two adjacent characters are equal. Write a function that returns the maximum length of an alternating substring in `s`. For instance, the substring '010' is alternat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert maxSubStr('0100') == 3\", \"assert maxSubStr('10') == 2\", \"assert maxSubStr('1111') == 1\", \"assert maxSubStr('110011') == 2\", \"assert maxSubStr('1010101') == 7\", \"assert maxSubStr('0000') == 1\", \"assert maxSubStr('101') == 3\", \"assert maxSubStr('... | {
"split": "train",
"index": 64117,
"acecode_id": "evol_32827",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of gene names and their corresponding annotations as input, and returns a dictionary where each gene name is a key and its annotation is the value. The function should ignore any duplicate gene names and only keep the fi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_gene_dict(['GeneA', 'GeneB', 'GeneA', 'GeneC'], ['Annotation1', 'Annotation2', 'Annotation3', 'Annotation4']) == {'GeneA': 'Annotation1', 'GeneB': 'Annotation2', 'GeneC': 'Annotation4'}\", \"assert create_gene_dict(['GeneX', 'GeneY', 'GeneZ'], ['Ann1'... | {
"split": "train",
"index": 64118,
"acecode_id": "bigcode_python_fns_4510",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that registers a host in a publishing system. The function should take a string as input, which represents the name of the host to be registered. The function will return a confirmation message indicating that the host has been successful... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert register_host('storyboardpro') == 'Host storyboardpro has been successfully registered.'\", \"assert register_host('') == 'Error: Host name cannot be empty.'\", \"assert register_host('blender') == 'Host blender has been successfully registered.'\", \"assert... | {
"split": "train",
"index": 64119,
"acecode_id": "bigcode_python_fns_14650",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a year and a month in the format 'YYYY-MM', return the corresponding month number in integer form (1 for January, 2 for February, ..., 12 for December). If the input string is not in the correct format or represents an invalid date, return -1. Implem... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert month_from_string('2023-01') == 1\", \"assert month_from_string('2023-12') == 12\", \"assert month_from_string('2023-05') == 5\", \"assert month_from_string('2023-02') == 2\", \"assert month_from_string('2023-11') == 11\", \"assert month_from_string('2023-07... | {
"split": "train",
"index": 64120,
"acecode_id": "bigcode_python_fns_26696",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a function `is_slow_test_hostile()` that checks whether certain tests should be disabled in a Continuous Integration (CI) environment based on the presence of specific environment variables. Your task is to implement a function `disable_tests(env_vars: List[str]) ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert disable_tests(['TEST_ENV', 'CI']) == True\", \"assert disable_tests(['TEST_ENV', 'SKIP_SLOW_TEST']) == True\", \"assert disable_tests(['TEST_ENV']) == False\", \"assert disable_tests(['SKIP_SLOW_TEST', 'ANOTHER_VAR']) == True\", \"assert disable_tests(['SOME... | {
"split": "train",
"index": 64121,
"acecode_id": "bigcode_python_fns_34650",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, each representing lines of code, write a function that identifies and extracts all comments from the code. Comments are denoted by either '//' for single-line comments or enclosed within '/*' and '*/' for multi-line comments. Your function should return... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_comments(['int x = 5; // initialize x', '/*', 'This is a multi-line comment', '*/', 'int y = 10; // initialize y']) == ['// initialize x', '/*', 'This is a multi-line comment', '*/', '// initialize y']\", \"assert extract_comments(['// single line co... | {
"split": "train",
"index": 64122,
"acecode_id": "oss_6545",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_most_common_element(strings: List[str]) -> List[str]` that takes a list of strings as input and returns a list of the most common elements in that list. If multiple elements share the highest frequency, return all of them in a list. You may not use an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_most_common_element(['apple', 'banana', 'apple', 'orange', 'banana', 'banana']) == ['banana']\", \"assert find_most_common_element(['cat', 'dog', 'cat', 'mouse', 'dog', 'dog']) == ['dog']\", \"assert find_most_common_element(['red', 'blue', 'red', 'gree... | {
"split": "train",
"index": 64123,
"acecode_id": "evol_33359",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to parse a JSON object and extract a specific field based on the provided action. The JSON object represents a command with optional configuration parameters. Your function should handle the 'StartNewScan' action by extracting the 'St... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extractStartURL('{\\\"Data\\\": {\\\"Action\\\": \\\"StartNewScan\\\", \\\"Config\\\": {\\\"StartURL\\\": \\\"http://192.168.1.28\\\"}}}') == 'http://192.168.1.28'\", \"assert extractStartURL('{\\\"Data\\\": {\\\"Action\\\": \\\"StartNewScan\\\", \\\"Config\... | {
"split": "train",
"index": 64124,
"acecode_id": "oss_28978",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a rectangle defined by its properties in a dictionary format with the following keys: 'x' (the x-coordinate of the rectangle's top-left corner), 'y' (the y-coordinate of the rectangle's top-left corner), 'dx' (the width of the rectangle), and 'dy' (the height of t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pad_rect({'x': 0, 'y': 0, 'dx': 5, 'dy': 5}, [2, 3]) == {'x': 2, 'y': 3, 'dx': 3, 'dy': 2}\", \"assert pad_rect({'x': 1, 'y': 1, 'dx': 4, 'dy': 4}, [1, 1]) == {'x': 2, 'y': 2, 'dx': 3, 'dy': 3}\", \"assert pad_rect({'x': 5, 'y': 5, 'dx': 10, 'dy': 10}, [3, 4... | {
"split": "train",
"index": 64125,
"acecode_id": "bigcode_python_fns_18281",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a positive integer n, write a function `product_of_primes(n)` that returns the product of all prime numbers up to and including n. The function should be efficient in both time and space.\nPlease reason step by step, then write a self-contained Python solution. Give your ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert product_of_primes(1) == 1\", \"assert product_of_primes(2) == 2\", \"assert product_of_primes(3) == 6\", \"assert product_of_primes(4) == 6\", \"assert product_of_primes(5) == 30\", \"assert product_of_primes(6) == 30\", \"assert product_of_primes(7) == 210\... | {
"split": "train",
"index": 64126,
"acecode_id": "evol_24818",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `transform_string(s: str) -> str` that takes a string `s` as input and performs a bidirectional transformation between whitespaces and underscores. The function should replace each whitespace with an underscore and each underscore with a whitespace. Additio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_string(' ') == '_'\", \"assert transform_string('Hello World') == 'Hello_World'\", \"assert transform_string('Multiple spaces here') == 'Multiple_spaces_here'\", \"assert transform_string(' Leading and trailing ') == '_Leading_and_traili... | {
"split": "train",
"index": 64127,
"acecode_id": "evol_34376",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of mission commands formatted as strings. Each command is represented as a string with tab-separated values in the following format: 'line_index\tcurrent_wp\tframe\tcommand\tparam1\tparam2\tparam3\tparam4\tparam5\tpa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_commands(['QGC WPL 110', '0\\t1\\t3\\t16\\t0.0\\t0.0\\t0.0\\t0.0\\t0.0\\t0.0\\t0.0\\t1']) == [{'line_index': 0, 'current_wp': 1, 'frame': 3, 'command': 16, 'param1': 0.0, 'param2': 0.0, 'param3': 0.0, 'param4': 0.0, 'param5': 0.0, 'param6': 0.0, 'par... | {
"split": "train",
"index": 64128,
"acecode_id": "bigcode_python_fns_16628",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a 4D tensor represented as a nested list of integers with shape (b, c, hh, hw) and an integer scale, implement a function that performs a pixel unshuffle operation. The pixel unshuffle operation rearranges the pixel values of the input tensor by downsampling it according ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pixel_unshuffle([[1, 2, 3], [4, 5, 6]], 1) == [[1, 2, 3], [4, 5, 6]]\", \"assert pixel_unshuffle([[1, 2, 3, 4], [5, 6, 7, 8]], 1) == [[1, 2, 3, 4], [5, 6, 7, 8]]\", \"assert pixel_unshuffle([[1, 1, 1, 1], [1, 1, 1, 1]], 1) == [[1, 1, 1, 1], [1, 1, 1, 1]]\", ... | {
"split": "train",
"index": 64129,
"acecode_id": "bigcode_python_fns_17295",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a string that represents a set of credentials. Your task is to implement a function that checks the validity of these credentials. If the credentials are valid, the function should return None. If the credentials are invalid, the function should return a string er... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_credentials('validUser123') == None\", \"assert check_credentials('') == 'Invalid credentials: empty string'\", \"assert check_credentials('user@name') == 'Invalid credentials: contains special characters'\", \"assert check_credentials('user name') == ... | {
"split": "train",
"index": 64130,
"acecode_id": "bigcode_python_fns_9821",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `execute_task(task_set, task)` that simulates executing a specified task from a given task set. The function takes in two parameters: a list of available task sets and a task name. If the specified task exists in the task set, return ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert execute_task(['task1', 'task2', 'task3'], 'task1') == 'Executing task: task1'\", \"assert execute_task(['task1', 'task2', 'task3'], 'task4') == 'Task not found: task4'\", \"assert execute_task([], 'task1') == 'No tasks available.'\", \"assert execute_task(['... | {
"split": "train",
"index": 64131,
"acecode_id": "bigcode_python_fns_38866",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function that takes a string as input and returns a new string where every occurrence of the word 'None' is replaced with the string 'null'. The function should be case-sensitive, meaning only the exact word 'None' should be replaced, not variations like... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_none('This is None and that is None') == 'This is null and that is null'\", \"assert replace_none('None') == 'null'\", \"assert replace_none('This should remain None and None') == 'This should remain null and null'\", \"assert replace_none('none') ==... | {
"split": "train",
"index": 64132,
"acecode_id": "bigcode_python_fns_28416",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `dice_coefficient(set1: set, set2: set) -> float` that calculates the Dice's coefficient for two sets. The Dice's coefficient is a statistic used to gauge the similarity of two sets. It is defined as: 2 * |A ∩ B| / (|A| + |B|), where |A| is the size of set A, |... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dice_coefficient({1, 2, 3, 4}, {3, 4, 5, 6}) == 0.5\", \"assert dice_coefficient({1, 2}, {3, 4}) == 0.0\", \"assert dice_coefficient({1, 2, 3}, {1, 2, 3}) == 1.0\", \"assert dice_coefficient({1, 2, 3}, {4, 5, 6}) == 0.0\", \"assert dice_coefficient({1}, {1})... | {
"split": "train",
"index": 64133,
"acecode_id": "evol_5799",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Construct a function that takes a list of items, an index, and a new item to be added. The function should add the new item at the specified index in the list. If the index is invalid (either negative or greater than the length of the list), the function should return None. Ple... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_item(['apple', 'orange', 'cherry'], 1, 'banana') == ['apple', 'banana', 'orange', 'cherry']\", \"assert add_item(['apple', 'orange', 'cherry'], 0, 'grape') == ['grape', 'apple', 'orange', 'cherry']\", \"assert add_item(['apple', 'orange', 'cherry'], 3, '... | {
"split": "train",
"index": 64134,
"acecode_id": "evol_27788",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of a series of bars in a histogram. Your task is to implement a function that calculates the maximum area of a rectangle that can be formed by these bars. The rectangle must be bounded above by the shortest bar in the se... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_histogram_area([2, 1, 5, 6, 2, 3]) == 10\", \"assert max_histogram_area([2, 4]) == 4\", \"assert max_histogram_area([1, 1, 1, 1, 1]) == 5\", \"assert max_histogram_area([2, 1, 2]) == 3\", \"assert max_histogram_area([1, 2, 3, 4, 5]) == 9\", \"assert max_... | {
"split": "train",
"index": 64135,
"acecode_id": "oss_30672",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a function `increment_num` that takes a string `num` representing a non-negative integer as input. Your task is to implement the `increment_num` function that increments the given number by 1 and returns the result as a string. The input string is guaranteed to be... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert increment_num('0') == '1'\", \"assert increment_num('1') == '2'\", \"assert increment_num('9') == '10'\", \"assert increment_num('10') == '11'\", \"assert increment_num('99') == '100'\", \"assert increment_num('100') == '101'\", \"assert increment_num('12345... | {
"split": "train",
"index": 64136,
"acecode_id": "oss_36079",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that calculates the length of the longest consecutive subsequence in a given list of integers. A consecutive subsequence is a sequence where each number is exactly one more than the previous number. The function should take two parameters:... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert length([100, 4, 200, 1, 3, 2], 6) == 4\", \"assert length([1, 2, 0, 1], 4) == 3\", \"assert length([3, 4, 5, 2, 1], 5) == 5\", \"assert length([7, 8, 9, 10, 11], 5) == 5\", \"assert length([1, 3, 5, 7, 9], 5) == 1\", \"assert length([1, 2, 3, 4, 5], 5) == 5\... | {
"split": "train",
"index": 64137,
"acecode_id": "oss_6187",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple drawing application. The function should allow users to set the drawing color and draw a rectangle on a canvas. Your task is to implement the `drawing_app` function which accepts the following parameters: `color` a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert drawing_app((255, 0, 0), (10, 10, 50, 50), (400, 300)) == {'color': (255, 0, 0), 'rectangle': (10, 10, 50, 50)}\", \"assert drawing_app((0, 255, 0), (400, 300, 50, 50), (400, 300)) == {'color': (0, 255, 0), 'rectangle': (400, 300, 0, 0)}\", \"assert drawing_... | {
"split": "train",
"index": 64138,
"acecode_id": "oss_14306",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a collection of cameras. Each camera has a type and a serial number. You need to implement a function `manage_cameras(actions)` that takes a list of actions and returns the state of the camera collection after all actions have been performed. The ac... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_cameras(['add t265 123', 'add d435 456']) == [{'type': 't265', 'serial_number': '123'}, {'type': 'd435', 'serial_number': '456'}]\", \"assert manage_cameras(['add t265 123', 'add d435 456', 'get 123']) == [{'type': 't265', 'serial_number': '123'}, {'t... | {
"split": "train",
"index": 64139,
"acecode_id": "oss_28435",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `pluck(arr, cond_fn, threads=3)` that takes a non-negative integer array `arr`, a condition function `cond_fn`, and an optional integer `threads`. The function should return the smallest value from `arr` that satisfies the condition defined by `cond_fn`, al... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pluck([], lambda x: x % 3 == 0, 3) == []\", \"assert pluck([7, 3, 5], lambda x: x > 10, 3) == []\", \"assert pluck([9, 8, 7, 6], lambda x: x < 5, 3) == []\", \"assert pluck([10, 9, 8, 7], lambda x: x > 10, 2) == []\", \"assert pluck([13, 15, 17], lambda x: x... | {
"split": "train",
"index": 64140,
"acecode_id": "evol_4615",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given a list of stars represented by their right ascension (RA) and declination (DEC) coordinates, write a function that filters the stars based on a specified search radius from a target position. The function should return a list of stars that fall within the given search rad... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_stars([(10.0, 20.0, 15.0, 0.1), (10.1, 20.1, 14.5, 0.2), (10.5, 20.5, 16.0, 0.3)], 10.0, 20.0, 0.2) == [(10.0, 20.0, 15.0, 0.1), (10.1, 20.1, 14.5, 0.2)]\", \"assert filter_stars([(10.0, 20.0, 15.0, 0.1), (11.0, 21.0, 14.5, 0.2), (12.0, 22.0, 16.0, 0.... | {
"split": "train",
"index": 64141,
"acecode_id": "bigcode_python_fns_5030",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to parse callback data in a specific format. The callback data is a string in the format 'field=value', where 'field' is the name of the field and 'value' is its corresponding value. Your task is to write a function `parse_callback_da... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_callback_data('name=John') == {'name': 'John'}\", \"assert parse_callback_data('age=25') == {'age': '25'}\", \"assert parse_callback_data('location=NY') == {'location': 'NY'}\", \"assert parse_callback_data('city=Los Angeles') == {'city': 'Los Angeles'... | {
"split": "train",
"index": 64142,
"acecode_id": "oss_24872",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a nested dictionary structure representing a simple XML-like format. The function should take the following parameters: a string `tag` representing the element name, a dictionary `attrib` containing attribute key-value pair... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_xml_dict('note', {'to': 'Alice', 'from': 'Bob'}, 'Hello') == {'note': {'attrib': {'to': 'Alice', 'from': 'Bob'}, 'text': 'Hello'}}\", \"assert generate_xml_dict('message', {}, 'Hi there') == {'message': {'text': 'Hi there'}}\", \"assert generate_xml... | {
"split": "train",
"index": 64143,
"acecode_id": "bigcode_python_fns_37485",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with controlling the state of a smart light bulb. The light bulb has a brightness level and a hue value. You need to implement a function that retrieves the current hue of the light bulb and updates it to a new specified hue value. The function should take two in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_light_hue(100, 200) == 200\", \"assert update_light_hue(150, 360) == 360\", \"assert update_light_hue(0, 400) == 0\", \"assert update_light_hue(270, -10) == 270\", \"assert update_light_hue(180, 180) == 180\", \"assert update_light_hue(90, 90) == 90\"... | {
"split": "train",
"index": 64144,
"acecode_id": "oss_33882",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `frequency(arr)` that constructs a frequency distribution table representing the count of each integer and character within a given mixed list of integers and strings. The frequency of each character in the strings should be treated individually. The functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert frequency(['a', 1, 1, 'b', 'a', 2]) == {'a': 2, 1: 2, 2: 1, 'b': 1}\", \"assert frequency(['h', 'e', 'l', 'l', 'o', 1, 2, 3, 'h', 'e', 'l', 'l', 'o', 3, 2, 1]) == {'h': 2, 'e': 2, 'l': 4, 'o': 2, 1: 2, 2: 2, 3: 2}\", \"assert frequency(['x', 'y', 'x', 'z', 3... | {
"split": "train",
"index": 64145,
"acecode_id": "evol_14840",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes two numeric inputs and returns a boolean value indicating whether their sum is an even number. Additionally, implement error handling to return a specific error message for non-numeric inputs. The function signature should be: def is_sum_even(num1, n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_sum_even(10, 9) == False\", \"assert is_sum_even(4, 6) == True\", \"assert is_sum_even(3.5, 2.5) == True\", \"assert is_sum_even(0, 0) == True\", \"assert is_sum_even(-2, 2) == True\", \"assert is_sum_even(1, 1) == True\", \"assert is_sum_even(1, 2) == Fa... | {
"split": "train",
"index": 64146,
"acecode_id": "evol_21794",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that formats a message to be sent via a messaging interface. Your function, `format_message`, should take in a message string and a filename string. The function should return a formatted string that includes the message in bold and the h... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_message('Hello, World!', 'document.txt') == '*Hello, World!*\\\\n_localhost:document.txt_'\", \"assert format_message('Test Message', 'file.pdf') == '*Test Message*\\\\n_localhost:file.pdf_'\", \"assert format_message('Sample Message', 'image.png') ==... | {
"split": "train",
"index": 64147,
"acecode_id": "bigcode_python_fns_39628",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of transformation functions and an initial data value. Your task is to implement a function that applies each transformation function in the given list to the initial data value sequentially. Each transformation function takes the current data value as the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert apply_transformations([lambda x: x + 1], 0) == 1\", \"assert apply_transformations([lambda x: x * 2], 5) == 10\", \"assert apply_transformations([lambda x: x - 3], 10) == 7\", \"assert apply_transformations([lambda x: x + 1, lambda x: x * 2], 3) == 8\", \"as... | {
"split": "train",
"index": 64148,
"acecode_id": "bigcode_python_fns_8779",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a collection of image datasets where each dataset has a unique identifier and a corresponding name. Implement a function called `manage_datasets(operations)` that takes a list of operations and returns the resulting state of datasets after performin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_datasets([('add', 'CIFAR100', 'CIFAR-100'), ('list',)]) == {'datasets': ['CIFAR100'], 'name': None}\", \"assert manage_datasets([('add', 'CIFAR100', 'CIFAR-100'), ('get_name', 'CIFAR100')]) == {'datasets': [], 'name': 'CIFAR-100'}\", \"assert manage_d... | {
"split": "train",
"index": 64149,
"acecode_id": "oss_30933",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to determine the compatibility of a TLS cipher with a specified TLS version range. The compatibility is defined based on the minimum and maximum TLS versions supported by the cipher. Write a function `is_compatible_with_tls_version(mi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_compatible_with_tls_version(1.2, 1.3, 1.2, 1.3) == True\", \"assert is_compatible_with_tls_version(1.2, 1.3, 1.2, 1.5) == True\", \"assert is_compatible_with_tls_version(1.2, 1.3, 1.0, 1.5) == True\", \"assert is_compatible_with_tls_version(1.2, 1.3, 1.3,... | {
"split": "train",
"index": 64150,
"acecode_id": "oss_8109",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that pluralizes English words based on specific rules. The function should take a singular English word as input and return its plural form according to the following rules: 1. If the word ends in 's', 'x', 'z', 'ch', or 'sh', ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pluralize_word('cat') == 'cats'\", \"assert pluralize_word('box') == 'boxes'\", \"assert pluralize_word('baby') == 'babies'\", \"assert pluralize_word('city') == 'cities'\", \"assert pluralize_word('bush') == 'bushes'\", \"assert pluralize_word('fox') == 'fo... | {
"split": "train",
"index": 64151,
"acecode_id": "oss_1009",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of complex numbers, implement a function that sorts these complex numbers in descending order based on their real parts. If two or more complex numbers have the same real part, they should be ordered by their imaginary parts in descending order.\nPlease reason step... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_complex_numbers([3+4j, 2+3j, 3+2j, 1+1j, 3+1j]) == [3+4j, 3+2j, 3+1j, 2+3j, 1+1j]\", \"assert sort_complex_numbers([1+1j, 2+2j, 3+3j, 1+2j]) == [3+3j, 2+2j, 1+2j, 1+1j]\", \"assert sort_complex_numbers([1+1j, 1+2j, 1+3j]) == [1+3j, 1+2j, 1+1j]\", \"asse... | {
"split": "train",
"index": 64152,
"acecode_id": "evol_28021",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of timestamps represented as strings in the format 'YYYY-MM-DD HH:MM:SS' and a timezone offset in hours. Your task is to convert each timestamp to the corresponding local time by applying the timezone offset. Return a list of strings representing the local ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_timestamps(['2023-01-01 12:00:00', '2023-01-01 15:30:00'], 2) == ['2023-01-01 14:00:00', '2023-01-01 17:30:00']\", \"assert convert_timestamps(['2023-01-01 12:00:00'], None) == ['2023-01-01 12:00:00']\", \"assert convert_timestamps(['2023-01-01 06:00... | {
"split": "train",
"index": 64153,
"acecode_id": "bigcode_python_fns_18857",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers and returns the sum of all the even numbers in that list. You need to implement the function `sum_of_evens(nums: List[int]) -> int` where `nums` is a list of integers. The function should iterate through ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([10, 15, 20, 25]) == 30\", \"assert sum_of_evens([-2, -1, 0, 1, 2]) == 0\", \"assert sum_of_evens([0]) == 0\", \"assert sum_of_evens([1, 3, 5]) == 0\", \"assert sum_of_evens([2, 4, 6, 8]) == 20\", \... | {
"split": "train",
"index": 64154,
"acecode_id": "oss_32675",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function to calculate the hypotenuse of a right triangle when passed two sides (lengths) of the triangle. Additionally, incorporate error handling to validate that inputs are positive real numbers. If they're not, return an error message. For example, given side1 = 4 an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_hypotenuse(3, 4) == 5.0\", \"assert calculate_hypotenuse(5, 12) == 13.0\", \"assert calculate_hypotenuse(8, 15) == 17.0\", \"assert calculate_hypotenuse(7, 24) == 25.0\", \"assert calculate_hypotenuse(9, 40) == 41.0\", \"assert calculate_hypotenuse... | {
"split": "train",
"index": 64155,
"acecode_id": "evol_13556",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that computes the sum of all even integers in the list and returns the result. If there are no even integers, the function should return 0.\nPlease reason step by step, then write a self-contained Python solution. Give your final progr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_list([1, 2, 3, 4, 5]) == 6\", \"assert sum_list([0, -2, -4, 5]) == -6\", \"assert sum_list([1, 3, 5, 7]) == 0\", \"assert sum_list([]) == 0\", \"assert sum_list([10, 20, 30]) == 60\", \"assert sum_list([-1, -2, -3, -4]) == -6\", \"assert sum_list([1, 2, ... | {
"split": "train",
"index": 64156,
"acecode_id": "evol_2964",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `parse_email_content` that takes a string representing the content of an email in EML format and returns a dictionary containing the 'date', 'sender', and 'subject' of the email. If any of these fields are missing, their values in the dictionary should be `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_email_content('From: test@example.com\\\\nDate: Tue, 01 Jan 2023 12:00:00 +0000\\\\nSubject: Test Email\\\\n\\\\nThis is the body of the email.') == {'date': 'Tue, 01 Jan 2023 12:00:00 +0000', 'sender': 'test@example.com', 'subject': 'Test Email'}\", \... | {
"split": "train",
"index": 64157,
"acecode_id": "evol_18022",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers and an integer n, return a list of lists where each inner list contains at most n consecutive elements from the input list. The last inner list may contain fewer than n elements if there are not enough remaining. If the input list is empty, return an em... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert batch_elements([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\", \"assert batch_elements([1, 2, 3], 1) == [[1], [2], [3]]\", \"assert batch_elements([], 3) == []\", \"assert batch_elements([10, 20, 30, 40], 3) == [[10, 20, 30], [40]]\", \"assert batch_elements... | {
"split": "train",
"index": 64158,
"acecode_id": "bigcode_python_fns_16252",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that performs vector addition for 3D vectors. The function should take two 3D vectors as input and return the resulting vector after adding them together. The vectors are represented as tuples of three elements, where each elem... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_3d_vectors((1, 2, 3), (4, 5, 6)) == (5, 7, 9)\", \"assert add_3d_vectors((0, 0, 0), (0, 0, 0)) == (0, 0, 0)\", \"assert add_3d_vectors((-1, -2, -3), (1, 2, 3)) == (0, 0, 0)\", \"assert add_3d_vectors((1, 1, 1), (1, 1, 1)) == (2, 2, 2)\", \"assert add_3d_... | {
"split": "train",
"index": 64159,
"acecode_id": "oss_16445",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing mathematical operations (e.g., 'ADD', 'SUBTRACT', 'MULTIPLY', 'SELECT', 'NEGATE') and a list of input types (e.g., 'bool', 'uint8_t', 'int8_t', 'uint16_t', 'int16_t', 'uint32_t', 'int32_t'). Your task is to implement a function `gene... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_circuit_files(['ADD'], ['bool']) == ['circuit-ADD-1.sheep', 'circuit-ADD-2.sheep', 'circuit-ADD-3.sheep', 'circuit-ADD-4.sheep', 'circuit-ADD-5.sheep', 'circuit-ADD-6.sheep', 'circuit-ADD-7.sheep', 'circuit-ADD-8.sheep']\", \"assert generate_circuit... | {
"split": "train",
"index": 64160,
"acecode_id": "bigcode_python_fns_39567",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that applies a series of transformations to a given input image using the Python PIL library. The transformations to be applied in sequence are: 1. Resize the image to a specified size (e.g., 256x256 pixels). 2. Convert the image to grays... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert apply_image_transforms(Image.new('RGB', (300, 300), color = 'red'), (256, 256)).size == (256, 256)\", \"assert apply_image_transforms(Image.new('RGB', (400, 400), color = 'blue'), (256, 256)).size == (256, 256)\", \"assert apply_image_transforms(Image.new('R... | {
"split": "train",
"index": 64161,
"acecode_id": "oss_36720",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that returns the top 10 members with the highest study time for a given day. Each member has a name and an associated study time. The function should take a list of tuples as input, where each tuple contains a member's name (a string) and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_top_study_members([('Alice', 5), ('Bob', 10), ('Charlie', 8), ('David', 10), ('Eve', 3)]) == [('Bob', 10), ('David', 10), ('Charlie', 8), ('Alice', 5), ('Eve', 3)]\", \"assert get_top_study_members([('Alice', 10), ('Bob', 10), ('Charlie', 5)]) == [('Alic... | {
"split": "train",
"index": 64162,
"acecode_id": "bigcode_python_fns_31860",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `get_employee_info(full_name: str, years_of_expertise: int, department: str) -> str` that takes an employee's full name, years of expertise, and department as input parameters. The function should return a formatted string that includes the employee's name, yea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_employee_info('Alice Smith', 10, 'HR') == 'Employee Name: Alice Smith, Years of Expertise: 10, Department: HR'\", \"assert get_employee_info('Bob Johnson', 3, 'Marketing') == 'Employee Name: Bob Johnson, Years of Expertise: 3, Department: Marketing'\", \... | {
"split": "train",
"index": 64163,
"acecode_id": "evol_15477",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D list representing a game board where each cell can either be empty (represented by 0) or occupied by a piece (represented by an integer greater than 1). Your task is to implement a function `board_str(board: List[List[int]]) -> str` that returns a string repr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert board_str([[0]]) == '. \\\\n'\", \"assert board_str([[1]]) == '. \\\\n'\", \"assert board_str([[0, 0], [0, 0]]) == '. . \\\\n. . \\\\n'\", \"assert board_str([[0, 0, 0], [0, 0, 0]]) == '. . . \\\\n. . . \\\\n'\", \"assert board_str([[65]]) == 'A \\\\n'\", \"... | {
"split": "train",
"index": 64164,
"acecode_id": "bigcode_python_fns_37566",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that registers a service to update a specific resource identified by a unique ID. The function should take a configuration dictionary as input, which contains a key 'service' that defines the service to be registered and a key 'id' that s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert register_service({'service': 'update', 'id': '12345'}) == 'Service update registered for ID: 12345'\", \"assert register_service({'service': 'delete', 'id': 'abcde'}) == 'Service delete registered for ID: abcde'\", \"assert register_service({'service': 'crea... | {
"split": "train",
"index": 64165,
"acecode_id": "bigcode_python_fns_23434",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that calculates the total area under a bar graph. Each bar in the graph has a uniform width and varying heights defined by their bottom and top positions. Write a Python function `calculate_total_area(width, bottoms, tops)` that ta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_area(1.0, [0, 0, 0], [2, 2, 2]) == 6.0\", \"assert calculate_total_area(1.0, [1, 2, 3], [4, 5, 6]) == 9.0\", \"assert calculate_total_area(0.5, [0, 0], [2, 2]) == 2.0\", \"assert calculate_total_area(2.0, [0, 0, 0], [1, 1, 1]) == 6.0\", \"ass... | {
"split": "train",
"index": 64166,
"acecode_id": "oss_25000",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given two strings, S1 and S2. Your task is to write a function that calculates the frequency of each character in S1 and returns the total frequency of characters found in S2 based on that frequency. The function should be case-sensitive, meaning 'a' and 'A' are differe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_frequency('abc', 'a') == 1\", \"assert calculate_frequency('abc', 'c') == 1\", \"assert calculate_frequency('abc', 'd') == 0\", \"assert calculate_frequency('aabbcc', 'abc') == 6\", \"assert calculate_frequency('aabbcc', 'abcd') == 6\", \"assert ca... | {
"split": "train",
"index": 64167,
"acecode_id": "oss_1034",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Write a function `filter_primes_above_20(nums: List[int]) -> List[int]` that takes a list of integers and returns a new list containing only the prime numbers from the input list that are greater than 20. A prime number is a number greater than 1 that has no positive divisors o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_primes_above_20([22, 29, 31, 40, 50]) == [29, 31]\", \"assert filter_primes_above_20([10, 12, 15, 18]) == []\", \"assert filter_primes_above_20([23, 24, 25, 26, 27, 28, 29]) == [23, 29]\", \"assert filter_primes_above_20([30, 31, 32, 33]) == [31]\", \... | {
"split": "train",
"index": 64168,
"acecode_id": "evol_24184",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a series of shell commands to process a list of jobs in specific directories. Write a function `generate_commands` that takes in two lists: `commands` (a list of strings representing shell commands) and `directories` (a lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_commands(['ls', 'pwd'], ['/home/user', '/var/log']) == 'cd /home/user && ls\\\\ncd /var/log && pwd'\", \"assert generate_commands(['echo hello', 'ls', 'pwd'], ['/home/user', '/var/log']) == 'cd /home/user && echo hello\\\\ncd /var/log && ls'\", \"as... | {
"split": "train",
"index": 64169,
"acecode_id": "bigcode_python_fns_5456",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that performs linear regression on a set of given points and calculates the slope and y-intercept of the best fit line. The function should return the slope and y-intercept as a tuple. If the input dataset represents a vertical line, the function should rai... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert linear_regression([(1, 1), (2, 2), (3, 3)]) == (1.0, 0.0)\", \"assert linear_regression([(0, 0), (1, 1), (2, 2), (3, 3)]) == (1.0, 0.0)\", \"assert linear_regression([(1, 5), (2, 6), (3, 7), (4, 8)]) == (1.0, 4.0)\", \"assert linear_regression([(1, 2), (2, 4... | {
"split": "train",
"index": 64170,
"acecode_id": "evol_11398",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Design and implement a function `create_dictionary` that takes a list of key-value pairs and returns a dictionary constructed from those pairs. Each key in the input list will be unique. The function should have the following signature: `def create_dictionary(pairs: List[Tuple[... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_dictionary([('name', 'John'), ('age', 25), ('profession', 'Engineer')]) == {'name': 'John', 'age': 25, 'profession': 'Engineer'}\", \"assert create_dictionary([('color', 'blue'), ('size', 'M'), ('quantity', 5)]) == {'color': 'blue', 'size': 'M', 'quan... | {
"split": "train",
"index": 64171,
"acecode_id": "evol_34685",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of file attributes and returns a formatted string displaying the file information. The function should take a dictionary as input containing the following keys: `name` (string, required), `time` (datetime object or None,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert display_file_info({'name': 'example.txt', 'time': datetime(2022, 5, 15, 10, 30), 'nlinks': 2, 'size': 1024}) == 'File Information:\\\\nName: example.txt\\\\nSize: 1024 bytes\\\\nNumber of Links: 2\\\\nCreation Time: 2022-05-15 10:30:00'\", \"assert display_f... | {
"split": "train",
"index": 64172,
"acecode_id": "oss_5696",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two numerical values, rs1 and rs2. Your task is to compare these two values and return 1 if they are equal, and 0 otherwise. You should implement a function called compare_values that takes two parameters, rs1 and rs2, and performs this comparison. Ensure that the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compare_values(1.0, 1.0) == 1\", \"assert compare_values(1.0, 2.0) == 0\", \"assert compare_values(-1.0, -1.0) == 1\", \"assert compare_values(-1.0, 1.0) == 0\", \"assert compare_values(0.0, 0.0) == 1\", \"assert compare_values(0.0, 1.0) == 0\", \"assert com... | {
"split": "train",
"index": 64173,
"acecode_id": "oss_24071",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a JSON string as input and attempts to parse it into a Python object. However, your function should include additional validation to ensure that all string values within the parsed JSON object are valid, meaning they should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_and_validate_json('{\\\"key\\\": \\\"value\\\"}') == {'key': 'value'}\", \"assert parse_and_validate_json('{\\\"name\\\": \\\"John\\\", \\\"age\\\": 30}') == {'name': 'John', 'age': 30}\", \"assert parse_and_validate_json('{\\\"list\\\": [1, 2, 3]}') =... | {
"split": "train",
"index": 64174,
"acecode_id": "bigcode_python_fns_46676",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a string and an integer n as inputs, and divides the string into segments of length n. If the string length is not divisible by n, the last segment should contain the remaining characters. The function should return a list of these segments.\nPle... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert slice_string('abcdefg', 3) == ['abc', 'def', 'g']\", \"assert slice_string('Python', 2) == ['Py', 'th', 'on']\", \"assert slice_string('A B C D E F', 2) == ['A ', 'B ', 'C ', 'D ', 'E ', 'F']\", \"assert slice_string('SingleSegment', 15) == ['SingleSegment']... | {
"split": "train",
"index": 64175,
"acecode_id": "evol_25268",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function `factorial(n: int) -> int` that calculates the factorial of a non-negative integer `n` using recursion with memoization. The function should cache previously computed factorial values to optimize performance. The input `n` will be a non-negative integer (0 ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert factorial(0) == 1\", \"assert factorial(1) == 1\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", \"assert factorial(5) == 120\", \"assert factorial(6) == 720\", \"assert factorial(7) == 5040\", \"assert factorial(... | {
"split": "train",
"index": 64176,
"acecode_id": "evol_168",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates a mathematical expression based on two input parameters, `q` and a divisor. The function should return the result of multiplying `q` by 2 and then dividing that result by the divisor. The divisor will always be a non-z... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_expression(5, 3) == 3.3333333333333335\", \"assert calculate_expression(10, 2) == 10.0\", \"assert calculate_expression(0, 1) == 0.0\", \"assert calculate_expression(7, 4) == 3.5\", \"assert calculate_expression(15, 5) == 6.0\", \"assert calculate_... | {
"split": "train",
"index": 64177,
"acecode_id": "oss_12382",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program that processes a given text input and generates a response based on specific keywords within that text. Your task is to implement a function `process_text` that takes a string `text_input` as a parameter and performs the following steps:\n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_text('Do you know where the park is?') == ['do', 'you', 'know', 'where', 'the', 'park', 'is?']\", \"assert process_text('What is your name?') == ['what', 'is', 'your', 'name?']\", \"assert process_text('This is a test.') == 'No keywords found'\", \"a... | {
"split": "train",
"index": 64178,
"acecode_id": "oss_27111",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple heat model using a 2D grid. The heat model grid is initialized to a default temperature value. Your function should take no parameters and perform the following tasks: initialize the grid to a specified size, f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_heat_model(0, 0) == 0.0\", \"assert simulate_heat_model(9, 9) == 0.0\", \"assert simulate_heat_model(5, 5) == 0.0\", \"assert simulate_heat_model(10, 10) == -1\", \"assert simulate_heat_model(-1, 5) == -1\", \"assert simulate_heat_model(0, 10) == -1... | {
"split": "train",
"index": 64179,
"acecode_id": "oss_2469",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_max_of_three(a, b, c)` that takes three integers as input and returns the largest of the three integers. You can assume that all the input integers are distinct.\nPlease reason step by step, then write a self-contained Python solution. Give your final... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max_of_three(1, 2, 3) == 3\", \"assert find_max_of_three(-1, -2, -3) == -1\", \"assert find_max_of_three(10, 5, 8) == 10\", \"assert find_max_of_three(0, 0, 0) == 0\", \"assert find_max_of_three(100, 200, 150) == 200\", \"assert find_max_of_three(-10, -... | {
"split": "train",
"index": 64180,
"acecode_id": "evol_25014",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a basic animation of a bitmap moving in a 2D space. The animation will be represented by an object that has properties for its current position (x, y) and a step size. Your goal is to create a function `next_frame(x: in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert next_frame(0, 0, 10) == (10, 0)\", \"assert next_frame(5, 5, 15) == (20, 5)\", \"assert next_frame(-5, -5, 5) == (0, -5)\", \"assert next_frame(0, 0, -10) == (-10, 0)\", \"assert next_frame(10, 10, -2) == (8, 10)\", \"assert next_frame(100, 100, 0) == (100, ... | {
"split": "train",
"index": 64181,
"acecode_id": "oss_21398",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string of length M, implement a function that returns a list of all anagrammatic substrings present in the string. An anagrammatic substring is defined as two or more substrings that consist of the same characters in a different order. The output should be a list of lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_anagrams('abc') == []\", \"assert find_anagrams('listen') == []\", \"assert find_anagrams('silent') == []\", \"assert find_anagrams('a') == []\", \"assert find_anagrams('aa') == [['a', 'a']]\", \"assert find_anagrams('aaa') == [['a', 'a', 'a'], ['aa', '... | {
"split": "train",
"index": 64182,
"acecode_id": "evol_29463",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a byte string `message` representing a simple message. Implement a function `sign_message(message: bytes) -> bytes` that simulates signing the message and returns a byte string representing the signature of the message. The signature should be a byte string of the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sign_message(b'hello') == b'ifmmp'\", \"assert recover_message(b'hello', sign_message(b'hello')) == ['address5']\", \"assert sign_message(b'') == b''\", \"assert recover_message(b'', sign_message(b'')) == ['address0']\", \"assert sign_message(b'world') == b'... | {
"split": "train",
"index": 64183,
"acecode_id": "bigcode_python_fns_435",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function `binary_search(arr: List[int], target: int) -> int` that performs a binary search on a sorted list of integers `arr` to find the index of a given `target` value. If the target exists in the list, return its index; otherwise, return -1. The list will be sort... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binary_search([], 5) == -1\", \"assert binary_search([1, 2, 3, 4, 5], 3) == 2\", \"assert binary_search([1, 2, 3, 4, 5], 1) == 0\", \"assert binary_search([1, 2, 3, 4, 5], 5) == 4\", \"assert binary_search([1, 2, 3, 4, 5], 6) == -1\", \"assert binary_search(... | {
"split": "train",
"index": 64184,
"acecode_id": "evol_7279",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a logging function that formats a log message based on the provided username and log text. The function should take two parameters: a string `who` representing the username and a string `text` representing the log message. The function should return... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_log('Alice', 'Logged in successfully') == 'Alice: Logged in successfully'\", \"assert format_log('Bob', 'Error occurred') == 'Bob: Error occurred'\", \"assert format_log('Charlie', 'Data saved') == 'Charlie: Data saved'\", \"assert format_log('Dave', ... | {
"split": "train",
"index": 64185,
"acecode_id": "bigcode_python_fns_21970",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two integers, d_model and n_heads. Your task is to determine if d_model can be evenly divided by n_heads and if d_model is an even number. If both conditions are met, return True. Otherwise, return False. Implement a function called 'check_conditions' that takes i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_conditions(8, 2) == True\", \"assert check_conditions(10, 5) == True\", \"assert check_conditions(9, 3) == False\", \"assert check_conditions(12, 4) == True\", \"assert check_conditions(7, 2) == False\", \"assert check_conditions(0, 1) == True\", \"ass... | {
"split": "train",
"index": 64186,
"acecode_id": "bigcode_python_fns_18238",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of configuration dictionaries, each containing a 'name' and a 'value'. Your task is to implement a function that retrieves the first 'n' configurations whose names contain a specific query string. If the number of configurations that match the query is less... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert search_configs([{'name': 'config1', 'value': 'value1'}, {'name': 'config2', 'value': 'value2'}, {'name': 'testConfig', 'value': 'value3'}], 'config', 2) == [{'name': 'config1', 'value': 'value1'}, {'name': 'config2', 'value': 'value2'}]\", \"assert search_co... | {
"split": "train",
"index": 64187,
"acecode_id": "bigcode_python_fns_11706",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `calculate(number1, number2, operation)` that performs the specified arithmetic operation on two numbers. The function should accept two numerical inputs and a string that specifies the operation to be performed. The operation can be 'add', 'subtract', 'mul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate(10, 5, 'add') == 15\", \"assert calculate(10, 5, 'subtract') == 5\", \"assert calculate(10, 5, 'multiply') == 50\", \"assert calculate(10, 5, 'divide') == 2.0\", \"assert calculate(-10, 5, 'add') == -5\", \"assert calculate(-10, -5, 'subtract') == ... | {
"split": "train",
"index": 64188,
"acecode_id": "evol_7093",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list that may contain assorted elements, including strings, integers, and floats. Write a function `count_strings_ending_with_e(data_list)` that identifies all the string elements in the list and returns the count of those that end with the letter 'e'. Elements ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_strings_ending_with_e(['a', 'b', 'c', 1, 2, 3]) == 0\", \"assert count_strings_ending_with_e(['apple', 'grape', 'peach', 'orange', 'banana']) == 3\", \"assert count_strings_ending_with_e([]) == 0\", \"assert count_strings_ending_with_e(['x', 'y', 'z'])... | {
"split": "train",
"index": 64189,
"acecode_id": "evol_4130",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a random ASCII string of a specified length. The function should take an integer `length` as input and return a random string made up of ASCII characters ranging from character code 32 to 126 (inclusive). Your function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert random_ascii_string(1) in string.printable[0:94]\", \"assert len(random_ascii_string(5)) == 5\", \"assert all(32 <= ord(c) <= 126 for c in random_ascii_string(10))\", \"assert random_ascii_string(0) == ''\", \"assert len(random_ascii_string(20)) == 20\", \"a... | {
"split": "train",
"index": 64190,
"acecode_id": "oss_19372",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a recursive function that takes in an array of numbers and returns the largest number in the array without using any pre-defined maximum functions. You may implement this using any algorithm of your choice.\nPlease reason step by step, then write a self-contained Python s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max([1, 2, 3, 4, 5]) == 5\", \"assert find_max([-1, -2, -3, -4, -5]) == -1\", \"assert find_max([100, 200, 300, 400]) == 400\", \"assert find_max([3, 1, 4, 1, 5, 9, 2]) == 9\", \"assert find_max([0]) == 0\", \"assert find_max([7, 8, 9, 10]) == 10\", \"a... | {
"split": "train",
"index": 64191,
"acecode_id": "evol_19004",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of URLs that point to zip files containing USPTO patent applications. Each URL is structured such that the year of the patent is embedded in the URL in the form '/YYYY/'. Write a function that takes a list of URLs and a list of years as input and returns a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_urls_by_years(['http://example.com/patent/2001/file1.zip', 'http://example.com/patent/2002/file2.zip'], [2001, 2002]) == {2001: ['http://example.com/patent/2001/file1.zip'], 2002: ['http://example.com/patent/2002/file2.zip']}\", \"assert filter_urls_b... | {
"split": "train",
"index": 64192,
"acecode_id": "bigcode_python_fns_47704",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that calculates the peak signal-to-noise ratio (PSNR) for a set of images given their original pixel values and their corresponding noisy pixel values. The function should take two lists of pixel values, one for the original im... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_psnr([255, 255, 255], [255, 255, 255]) == float('inf')\", \"assert calculate_psnr([0, 0, 0], [0, 0, 0]) == float('inf')\", \"assert calculate_psnr([0, 0, 0], [255, 255, 255]) == 0.0\", \"assert calculate_psnr([255, 0, 255], [0, 255, 0]) == 0.0\", \... | {
"split": "train",
"index": 64193,
"acecode_id": "oss_22880",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D list (matrix) of integers representing a correlation matrix where each value is between -1 and 1. Write a function `generate_heatmap(matrix: List[List[int]]) -> List[List[int]]` that generates a masked version of a heatmap matrix by replacing the upper triang... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_heatmap([[1, 0.5, 0.2], [0.5, 1, 0.3], [0.2, 0.3, 1]]) == [[1, None, None], [0.5, 1, None], [0.2, 0.3, 1]]\", \"assert generate_heatmap([[0.8, 0.6], [0.6, 0.8]]) == [[0.8, None], [0.6, 0.8]]\", \"assert generate_heatmap([[1]]) == [[1]]\", \"assert g... | {
"split": "train",
"index": 64194,
"acecode_id": "bigcode_python_fns_41848",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of contact dictionaries and returns a list of formatted strings for each contact. Each contact dictionary contains the following keys: 'name', 'email', and 'phone'. Your function should take this list of contacts and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_contacts([{'name': 'Alice', 'email': 'alice@example.com', 'phone': '123-456-7890'}, {'name': 'Bob', 'email': 'bob@example.com', 'phone': '098-765-4321'}]) == ['Name: Alice, Email: alice@example.com, Phone: 123-456-7890', 'Name: Bob, Email: bob@example... | {
"split": "train",
"index": 64195,
"acecode_id": "bigcode_python_fns_36419",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of numerical data points and returns the mean of the data points. The function should handle cases where the list is empty by returning 0.0.\nPlease reason step by step, then write a self-contained Python solution. Give your final program ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert mean([]) == 0.0\", \"assert mean([1]) == 1.0\", \"assert mean([1, 2, 3]) == 2.0\", \"assert mean([10, 20, 30, 40, 50]) == 30.0\", \"assert mean([-1, -2, -3]) == -2.0\", \"assert mean([1.5, 2.5, 3.5]) == 2.5\", \"assert mean([1, 2, 3, 4, 5, 6]) == 3.5\", \"as... | {
"split": "train",
"index": 64196,
"acecode_id": "evol_22458",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with analyzing a set of Tweets to determine the most frequently used hashtags and their counts. Write a function `analyze_hashtags(tweets: List[str]) -> Dict[str, int]` that takes a list of Tweets as input and returns a dictionary where the keys are the hashtags ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_hashtags(['Check out #Python and #coding', 'Learning about #Python is fun!', 'No hashtags here.']) == {'#Python': 2, '#coding': 1}\", \"assert analyze_hashtags(['#HelloWorld', '#HelloWorld', '#Python']) == {'#HelloWorld': 2, '#Python': 1}\", \"assert... | {
"split": "train",
"index": 64197,
"acecode_id": "oss_10658",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Construct a Python function that takes two parameters: a list of floating point numbers and a boolean flag. If the boolean flag is True, round each floating point number down to its nearest lower integer value. If the flag is False, round each floating point number up to its ne... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert adjust_floats([3.5, 4.7, 7.9], True) == [3, 4, 7]\", \"assert adjust_floats([3.5, 4.7, 7.9], False) == [4, 5, 8]\", \"assert adjust_floats([-3.5, -4.7, -7.9], True) == [-4, -5, -8]\", \"assert adjust_floats([-3.5, -4.7, -7.9], False) == [-3, -4, -7]\", \"ass... | {
"split": "train",
"index": 64198,
"acecode_id": "evol_17141",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers and a list of elements, implement a function that counts the occurrences of each element from the second list in the first list. The function should return a dictionary where the keys are the elements from the second list and the values are their corres... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_occurrences([1,2,3,2,1,3,2,1,3,4], [1,2,3]) == {1:3, 2:3, 3:3}\", \"assert count_occurrences([4,5,6,7,8,4,4,5,6], [4,5]) == {4:3, 5:2}\", \"assert count_occurrences([10,10,10,20,20,30], [10,20]) == {10:3, 20:2}\", \"assert count_occurrences([], [1,2]) ... | {
"split": "train",
"index": 64199,
"acecode_id": "evol_3710",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.