data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function called `is_valid_object_id(value: str) -> bool` that checks if a given string is a valid ObjectId. An ObjectId is considered valid if it is a 24-character hexadecimal string. Your function should return True if the input string is a v... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_object_id('5f47ac10d3e2a0d7c3e1c6a7') == True\", \"assert is_valid_object_id('5f47ac10d3e2a0d7c3e1c6a') == False\", \"assert is_valid_object_id('5f47ac10d3e2a0d7c3e1c6a7g') == False\", \"assert is_valid_object_id('Gf47ac10d3e2a0d7c3e1c6a7') == False... | {
"split": "train",
"index": 77300,
"acecode_id": "bigcode_python_fns_46719",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing volumes of different shapes. Your task is to determine if there are exactly two shapes that have the same volume. Write a function `has_same_volume(shapes: List[int]) -> bool` that returns `True` if there are two shapes with the sam... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_same_volume([1, 2, 3, 4, 5]) == False\", \"assert has_same_volume([1, 2, 2, 4, 5]) == True\", \"assert has_same_volume([10, 20, 30, 40, 10]) == True\", \"assert has_same_volume([5, 5, 5, 5, 5]) == True\", \"assert has_same_volume([-1, -2, -3, -1]) == Tru... | {
"split": "train",
"index": 77301,
"acecode_id": "bigcode_python_fns_27821",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string, swap every pair of adjacent characters. If the string has an odd length, leave the last character unchanged. Implement a function that takes this string as input and returns the modified string.\nPlease reason step by step, then write a self-contained Python sol... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert swap_chars('abcdef') == 'badcfe'\", \"assert swap_chars('123456') == '214365'\", \"assert swap_chars('hello') == 'ehllo'\", \"assert swap_chars('a') == 'a'\", \"assert swap_chars('') == ''\", \"assert swap_chars('ab') == 'ba'\", \"assert swap_chars('abcd') =... | {
"split": "train",
"index": 77302,
"acecode_id": "evol_5127",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a string that may contain punctuation marks. Your task is to implement a function that removes all punctuation from the string, replacing each punctuation character with a single space. Spaces within the string should be preserved. The function should return the m... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_punctuation(\\\"Hello, world!\\\") == \\\"Hello world \\\"\", \"assert remove_punctuation(\\\"I'm happy! Are you?\\\") == \\\"I m happy Are you \\\"\", \"assert remove_punctuation(\\\"No punctuation here\\\") == \\\"No punctuation here\\\"\", \"asse... | {
"split": "train",
"index": 77303,
"acecode_id": "bigcode_python_fns_5142",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of messages received from a WebSocket connection. The function should take a list of strings, where each string represents a message. Your function should return a list of strings that contains only the messages that... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_valid_messages(['this is valid', 'this is not', 'valid but too long' * 10]) == ['this is valid']\", \"assert filter_valid_messages(['', 'valid']) == ['valid']\", \"assert filter_valid_messages(['nope', 'nada', 'this is valid']) == ['this is valid']\",... | {
"split": "train",
"index": 77304,
"acecode_id": "bigcode_python_fns_26414",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function called `set_recommended_watch_points`. This function takes a session ID and a dictionary as input, where the dictionary contains a key `set_recommended`. The value associated with this key can either be a list of recommended watch poi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_recommended_watch_points('session1', {'set_recommended': ['point1', 'point2']}) == {'status': 'success', 'watch_points': ['point1', 'point2']}\", \"assert set_recommended_watch_points('session2', {'set_recommended': []}) == {'status': 'success', 'watch_p... | {
"split": "train",
"index": 77305,
"acecode_id": "bigcode_python_fns_42312",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of grant IDs associated with articles. The first list represents the ground truth grant IDs and the second list represents the predicted grant IDs from a system. Your task is to implement a function that calculates the micro recall of the predicted grant... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_micro_recall(['grant1', 'grant2', 'grant3'], ['grant1', 'grant2']) == 0.666667\", \"assert calculate_micro_recall(['grant1', 'grant2', 'grant3'], ['GRANT1', 'grant4']) == 0.333333\", \"assert calculate_micro_recall(['grant1'], ['grant2']) == 0.0000... | {
"split": "train",
"index": 77306,
"acecode_id": "bigcode_python_fns_49764",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of floats, implement a function that normalizes the list by dividing each element by the Euclidean norm of the list. The Euclidean norm of a list is defined as the square root of the sum of the squares of its elements. Your function should return a new list contain... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert normalize_list([3.0, 4.0]) == [0.6, 0.8]\", \"assert normalize_list([1.0, 2.0, 2.0]) == [0.3333333333333333, 0.6666666666666666, 0.6666666666666666]\", \"assert normalize_list([0.0, 0.0]) == [0.0, 0.0]\", \"assert normalize_list([]) == []\", \"assert normali... | {
"split": "train",
"index": 77307,
"acecode_id": "bigcode_python_fns_40983",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a value which can either be a list of integers or a single integer. Your task is to implement a function that converts the input value into a valid 'nodeset'. A 'nodeset' is defined as a list of integers containing at least one integer. If the input value is a sin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert nodeset(5) == [5]\", \"assert nodeset([1, 2, 3]) == [1, 2, 3]\", \"assert nodeset([10]) == [10]\", \"assert nodeset(0) == [0]\", \"assert nodeset([-1]) == [-1]\", \"assert nodeset([100, 200, 300]) == [100, 200, 300]\", \"assert nodeset([-5, 0, 10]) == [-5, 0... | {
"split": "train",
"index": 77308,
"acecode_id": "bigcode_python_fns_30653",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers, write a function `odd_count_elements(list1: list, list2: list) -> list` that returns a list of elements that appear an odd number of times across both lists. The returned list should be sorted in descending order. If no elements appear an odd number... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert odd_count_elements([], [1, 1, 1]) == [1]\", \"assert odd_count_elements([5, 5, 5], [5, 6]) == [6]\", \"assert odd_count_elements([10, 10], [10, 10]) == []\", \"assert odd_count_elements([1, 2, 2, 1], [3, 3, 4]) == [4]\", \"assert odd_count_elements([2, 2, 2]... | {
"split": "train",
"index": 77309,
"acecode_id": "evol_34588",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function `show_param_types` that accepts a variable number of arguments and returns a list of strings indicating the type of each argument. The types to be identified are 'integer', 'float', 'string', and 'list'. If the argument does not match any of these types, re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert show_param_types(1, 2.0, 'Hello', [1, 2, 3]) == ['integer', 'float', 'string', 'list']\", \"assert show_param_types(42, 3.14, 'Test', [1]) == ['integer', 'float', 'string', 'list']\", \"assert show_param_types('Python', [1, 2], 100, 4.5) == ['string', 'list'... | {
"split": "train",
"index": 77310,
"acecode_id": "evol_18114",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates a session template for a session creation process. The function should take a session template represented as a dictionary and verify the following criteria: 1. The template must have a non-empty 'templateName' or 'template... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_session_template({'templateName': 'test_template', 'boot_sets': {'boot_set_1': {'node_roles_groups': ['master']}}}) == 'Session template is valid'\", \"assert validate_session_template({'templateUUID': 'uuid-123', 'boot_sets': {'boot_set_1': {'node_... | {
"split": "train",
"index": 77311,
"acecode_id": "bigcode_python_fns_49377",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that takes an IP address as input and returns a dictionary containing specific geolocation information. The function should return the following fields based on the provided IP address: IP address, Country, Region, City, Postal cod... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_geolocation_info('8.8.8.8') == {'IP address': '8.8.8.8', 'Country': 'United States', 'Region': 'California', 'City': 'Mountain View', 'Postal code': '94043', 'Latitude': 37.386, 'Longitude': -122.0838}\", \"assert get_geolocation_info('1.1.1.1') == {'IP ... | {
"split": "train",
"index": 77312,
"acecode_id": "oss_14507",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating the execution of a job in a job scheduling system. Implement a function `run_job(job_id: int, run_date: str, user_id: int, rerun_flag: str, schedule_id: int, schedule_log_id: int, mark_complete: bool) -> List[Union[int, int, Any, Any]]` that simul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert run_job(1, '2023-10-01', 101, 'Y', 10, 100, False) == [1, 1, 'job_object_1', 'job_run_1']\", \"assert run_job(2, '2023-10-01', 102, 'N', 11, 101, True) == [2, 1, 'job_object_2', None]\", \"assert run_job(5, '2023-10-01', 105, 'Y', 14, 104, False) == [5, 1, '... | {
"split": "train",
"index": 77313,
"acecode_id": "bigcode_python_fns_44500",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given two equal-length lists of integers, `prediction` and `ground_truth`, implement a function that calculates the L1 distance between the two lists. The L1 distance is defined as the sum of the absolute differences of corresponding elements in the lists. If the lists are not ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert l1_distance([1, 2, 3], [4, 5, 6]) == 9\", \"assert l1_distance([10, 20], [30, 40]) == 40\", \"assert l1_distance([0], [0]) == 0\", \"assert l1_distance([1, 2], [1, 2, 3]) == []\", \"assert l1_distance([], []) == 0\", \"assert l1_distance([2, 3], [5, 1]) == 5... | {
"split": "train",
"index": 77314,
"acecode_id": "bigcode_python_fns_25113",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of objects represented by their URLs. Your task is to implement a function that takes a list of URLs and returns a list of unique objects created from those URLs. Each object is created by performing internal operations on the corresponding URL. However, if... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_objects(['http://example.com/1', 'http://example.com/2', 'http://example.com/1']) == ['Object from http://example.com/1', 'Object from http://example.com/2']\", \"assert get_unique_objects(['http://example.com/1', 'http://example.com/2', 'http://e... | {
"split": "train",
"index": 77315,
"acecode_id": "bigcode_python_fns_3546",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a string representation of a file header for a NETCDF3_64BIT_OFFSET data file. The function should take a file path as input and return a string that includes the title 'Example of NETCDF3_64BIT_OFFSET file' and the convent... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_file_header('path/to/file.nc') == 'Title: Example of NETCDF3_64BIT_OFFSET file, Conventions: CF-1.8'\", \"assert generate_file_header('another/path/file.nc') == 'Title: Example of NETCDF3_64BIT_OFFSET file, Conventions: CF-1.8'\", \"assert generate_... | {
"split": "train",
"index": 77316,
"acecode_id": "bigcode_python_fns_39784",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with evaluating the status of a policy based on certain configuration updates. Write a function, `evaluate_policy_status`, that takes a dictionary `config` as input. The dictionary may contain various settings related to policy evaluation, including a key `render... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate_policy_status({'render': False, 'reward_type': 'simple'}) == 'COMPLETED'\", \"assert evaluate_policy_status({'render': True, 'reward_type': 'simple'}) == 'COMPLETED'\", \"assert evaluate_policy_status({'render': False}) == 'COMPLETED'\", \"assert ev... | {
"split": "train",
"index": 77317,
"acecode_id": "bigcode_python_fns_23705",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function `enforce_types` that takes a function as input and returns a new function that enforces type annotations on its parameters. The new function should raise a TypeError if any argument passed to it does not match the expected type specified in the function's anno... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert enforce_types(lambda a: a)(1) == 1\", \"assert enforce_types(lambda a: a)(1.0) == 1.0\", \"assert enforce_types(lambda a: a)(True) == True\", \"assert enforce_types(lambda a: a)(None) == None\", \"assert enforce_types(lambda a: a)(-1) == -1\", \"assert enfor... | {
"split": "train",
"index": 77318,
"acecode_id": "bigcode_python_fns_26728",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function `describe_fox(color: str, speed: str) -> str` that takes in the color and speed of a fox as inputs and returns a string describing the fox in the format 'The {color} fox is {speed}.'\nPlease reason step by step, then write a self-contained Python solution. Giv... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert describe_fox('sepia-toned', 'swift') == 'The sepia-toned fox is swift.'\", \"assert describe_fox('red', 'quick') == 'The red fox is quick.'\", \"assert describe_fox('gray', 'fast') == 'The gray fox is fast.'\", \"assert describe_fox('black', 'slow') == 'The ... | {
"split": "train",
"index": 77319,
"acecode_id": "evol_22829",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of reports and generates a feed based on the data in the reports. Each report is represented as a dictionary with keys 'title', 'author', and 'content'. The feed should be a dictionary with keys 'latest_report' a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_feed([{'title': 'Report 1', 'author': 'Alice', 'content': 'Lorem ipsum'}, {'title': 'Report 2', 'author': 'Bob', 'content': 'Dolor sit amet'}, {'title': 'Report 3', 'author': 'Alice', 'content': 'Consectetur adipiscing elit'}]) == {'latest_report': ... | {
"split": "train",
"index": 77320,
"acecode_id": "oss_26583",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing a sequence of actions taken in a game. Each action can be either positive (indicating a successful move) or negative (indicating an unsuccessful move). Your task is to implement a function `fill_replay_buffer(actions: List[int], des... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fill_replay_buffer([1, -1, 2, 3], 6) == [1, -1, 2, 3, 0, 0]\", \"assert fill_replay_buffer([1, 2, 3], 3) == [1, 2, 3]\", \"assert fill_replay_buffer([-1, -2, -3], 5) == [-1, -2, -3, 0, 0]\", \"assert fill_replay_buffer([1, 2, 3, 4], 2) == [1, 2]\", \"assert ... | {
"split": "train",
"index": 77321,
"acecode_id": "bigcode_python_fns_3651",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_palindrome(sequence: str) -> bool` that checks whether the provided string `sequence` is a palindrome. A string is considered a palindrome if it reads the same forward and backward, ignoring case and non-alphanumeric characters. Return True if it is a p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_palindrome('A man, a plan, a canal, Panama') == True\", \"assert is_palindrome('Was it a car or a cat I saw?') == True\", \"assert is_palindrome('No lemon, no melon') == True\", \"assert is_palindrome('Hello, World!') == False\", \"assert is_palindrome('A... | {
"split": "train",
"index": 77322,
"acecode_id": "evol_36172",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing permissions for different types of content in a web application. Each content type has its own set of permissions, including read, write, and admin permissions. Your function should take a content type as input and return a list of all available per... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_permissions_for_content_type('AbstractNode') == ['READ', 'WRITE', 'ADMIN']\", \"assert get_permissions_for_content_type('Contributor') == ['READ', 'WRITE', 'ADMIN']\", \"assert get_permissions_for_content_type('Preprint') == ['READ', 'WRITE', 'ADMIN']\",... | {
"split": "train",
"index": 77323,
"acecode_id": "oss_14814",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a resource name and its corresponding URL. Your task is to implement a function called `format_resource_to_markdown` that takes two parameters: `name` (a string representing the name of the resource) and `url` (a string representing the URL of the resource). The f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_resource_to_markdown('Example Resource', 'http://www.example.com') == '- [Example Resource](http://www.example.com)'\", \"assert format_resource_to_markdown('Google', 'http://www.google.com') == '- [Google](http://www.google.com)'\", \"assert format_r... | {
"split": "train",
"index": 77324,
"acecode_id": "oss_28730",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer n, write a function `sum_of_n_mod_m(n: int) -> int` that calculates the sum of the first n natural numbers modulo 1000000007. The function should return the result.\nPlease reason step by step, then write a self-contained Python solution. Give your final progra... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_n_mod_m(1) == 1\", \"assert sum_of_n_mod_m(2) == 3\", \"assert sum_of_n_mod_m(3) == 6\", \"assert sum_of_n_mod_m(4) == 10\", \"assert sum_of_n_mod_m(5) == 15\", \"assert sum_of_n_mod_m(10) == 55\", \"assert sum_of_n_mod_m(100) == 5050\", \"assert sum_... | {
"split": "train",
"index": 77325,
"acecode_id": "oss_26559",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given an array of n distinct positive integers, write a function that determines if it is possible to rearrange the array into two subsets with identical products. If n is greater than 18, the function should return 'Can't be parsed'. If a solution is not possible, return 'Not ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_partition_with_same_product([1, 2, 3, 4, 6]) == True\", \"assert can_partition_with_same_product([2, 4, 8, 16]) == True\", \"assert can_partition_with_same_product([1, 2, 4, 8]) == True\", \"assert can_partition_with_same_product([3, 5, 15]) == True\", \... | {
"split": "train",
"index": 77326,
"acecode_id": "evol_8439",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given an integer byte (0 <= byte <= 255), write a function that converts this byte into a tuple of 8 bits, where the first element of the tuple is the most significant bit and the last element is the least significant bit. If the input byte is out of the specified range, the fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert byte_to_bits(0) == (0, 0, 0, 0, 0, 0, 0, 0)\", \"assert byte_to_bits(255) == (1, 1, 1, 1, 1, 1, 1, 1)\", \"assert byte_to_bits(128) == (1, 0, 0, 0, 0, 0, 0, 0)\", \"assert byte_to_bits(64) == (0, 1, 0, 0, 0, 0, 0, 0)\", \"assert byte_to_bits(32) == (0, 0, 1,... | {
"split": "train",
"index": 77327,
"acecode_id": "bigcode_python_fns_31713",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a pagination system for a web application. Write a function `pagination_urls` that generates the URLs for the next and previous pages in the paginated results. The function should take four arguments: `url` (string): The base URL for the paginat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pagination_urls('http://example.com/items', 100, 0, 10) == ('http://example.com/items?offset=10&limit=10', None)\", \"assert pagination_urls('http://example.com/items', 100, 10, 10) == ('http://example.com/items?offset=20&limit=10', 'http://example.com/items... | {
"split": "train",
"index": 77328,
"acecode_id": "oss_36278",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a function that sorts a list of movie titles and their release years in descending order by release year. The function should not only sort the movies but also handle various data inconsistencies. It should convert any release year given as a string to an integer for co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_movies([('Avatar', 2009), ('Titanic', 1997), ('Star Wars: The Force Awakens', 2015)]) == [('Star Wars: The Force Awakens', 2015), ('Avatar', 2009), ('Titanic', 1997)]\", \"assert sort_movies([('Titanic', '1997'), ('Avatar', 2009), ('Avatar', 2009)]) == ... | {
"split": "train",
"index": 77329,
"acecode_id": "evol_5224",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given two arrays representing the h and e components from an observatory. Your task is to implement a function `get_magnetic_components(h: List[float], e: List[float], d0: float = 0) -> Tuple[float, float]` that computes the total magnetic h component and the total magn... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_magnetic_components([1.0, 2.0, 3.0], [4.0, 5.0, 6.0]) == (6.0, 15.0)\", \"assert get_magnetic_components([0.0], [0.0], 0.0) == (0.0, 0.0)\", \"assert get_magnetic_components([10.0, 20.0, 30.0], [5.0, 15.0], 0.5) == (60.0, 20.0 + 0.5)\", \"assert get_magn... | {
"split": "train",
"index": 77330,
"acecode_id": "bigcode_python_fns_931",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that derives a specific BIP44 path for Ethereum addresses based on provided parameters. The BIP44 derivation defines a multi-account hierarchy for deterministic wallets. Your function should take in four parameters: a string represent... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert derive_bip44_path('EthereumMainnet', 0, False, 0) == \\\"m/44'/60'/0'/receive/0\\\"\", \"assert derive_bip44_path('EthereumMainnet', 0, True, 0) == \\\"m/44'/60'/0'/change/0\\\"\", \"assert derive_bip44_path('EthereumMainnet', 1, False, 1) == \\\"m/44'/60'/1... | {
"split": "train",
"index": 77331,
"acecode_id": "oss_10412",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a unique temporary directory path. The function should take an optional string parameter 'suffix' which, if provided, will be appended to the directory name. The function should return a unique path string for a temporary d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert len(temp_path()) > 0\", \"assert temp_path('suffix')[-6:] == 'suffix'\", \"assert temp_path('') != temp_path('')\", \"assert temp_path() != temp_path()\", \"assert 'temp_dir_' in temp_path()\", \"assert temp_path().count('_') == 2\", \"assert isinstance(temp... | {
"split": "train",
"index": 77332,
"acecode_id": "bigcode_python_fns_43408",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to determine if a given string of characters contains balanced brackets. Balanced brackets are defined as a string where each opening bracket has a corresponding closing bracket and the pairs are properly nested. The brackets to be co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert balanced_brackets('()') == True\", \"assert balanced_brackets('({})') == True\", \"assert balanced_brackets('([])') == True\", \"assert balanced_brackets('([)]') == False\", \"assert balanced_brackets('') == True\", \"assert balanced_brackets('a(b)c') == Tru... | {
"split": "train",
"index": 77333,
"acecode_id": "oss_3372",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `compute_average(nums)` that computes and returns the average of the numbers in the list. The average should be calculated as the sum of the numbers divided by the count of numbers. The function should return a float representing the a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_average([1, 2, 3, 4, 5]) == 3.0\", \"assert compute_average([10, 20, 30]) == 20.0\", \"assert compute_average([-1, -2, -3]) == -2.0\", \"assert compute_average([0, 0, 0]) == 0.0\", \"assert compute_average([5]) == 5.0\", \"assert compute_average([]) ... | {
"split": "train",
"index": 77334,
"acecode_id": "bigcode_python_fns_21762",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a job ID. Implement a function `get_job_status(job_id: str) -> str` that returns the status of the job based on the job ID. The status is determined based on the following criteria:\n\n- If the job ID starts with 'RUN-', the status should be ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_job_status('RUN-12345') == 'Running'\", \"assert get_job_status('COMP-98765') == 'Completed'\", \"assert get_job_status('FAIL-54321') == 'Failed'\", \"assert get_job_status('JOB-00000') == 'Unknown'\", \"assert get_job_status('RUN-1') == 'Running'\", \"a... | {
"split": "train",
"index": 77335,
"acecode_id": "bigcode_python_fns_40541",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of date strings in the format 'YYYY-MM-DD' and returns the count of dates falling within each year. The function should take the list of date strings as input and return a dictionary where the keys are the yea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_dates_by_year(['2009-10-03', '2009-10-04', '2010-09-21', '2010-09-22', '2010-09-23', '2011-08-15', '2011-08-16', '2012-07-01']) == {2009: 2, 2010: 3, 2011: 2, 2012: 1}\", \"assert count_dates_by_year(['2020-01-01', '2020-01-02', '2021-01-01']) == {2020... | {
"split": "train",
"index": 77336,
"acecode_id": "oss_26044",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of dictionaries, write a function `get_unique_keys(data: List[Dict[str, Any]]) -> List[str]` that returns a list of all unique keys present in the dictionaries. The order of the keys in the output list should be the same as their first appearance in the input list.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_keys([{ 'a': 1 }, { 'b': 2 }, { 'c': 3 }]) == ['a', 'b', 'c']\", \"assert get_unique_keys([{ 'x': 1, 'y': 2 }, { 'y': 3, 'z': 4 }, { 'x': 5 }]) == ['x', 'y', 'z']\", \"assert get_unique_keys([{ 'key1': 'value1' }, { 'key2': 'value2', 'key1': 'valu... | {
"split": "train",
"index": 77337,
"acecode_id": "bigcode_python_fns_38875",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a given request dictionary based on specific conditions involving PKCE (Proof Key for Code Exchange). The function should take in three parameters: a request dictionary, a client ID (string), and an endpoint context (a dict... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert post_authn_parse({'code_challenge': 'abc123'}, 'client_id_1', {'args': {'pkce': {'essential': True, 'code_challenge_method': ['plain']}}}) == {'code_challenge': 'abc123', 'code_challenge_method': 'plain'}\", \"assert post_authn_parse({'code_challenge': 'xyz7... | {
"split": "train",
"index": 77338,
"acecode_id": "bigcode_python_fns_30243",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a list of warning instances represented by their types. Implement a function `manage_warnings` that accepts a list of warning types and a list of operations. The operations can be 'add' or 'remove', followed by a warning type. The function should re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_warnings(['a', 'b', 'c'], [['remove', 'd'], ['remove', 'b'], ['add', 'e']]) == ['a', 'c', 'e']\", \"assert manage_warnings(['test'], [['remove', 'test'], ['add', 'test']]) == ['test']\", \"assert manage_warnings(['one', 'two', 'three'], [['remove', 'f... | {
"split": "train",
"index": 77339,
"acecode_id": "oss_16331",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that unregisters a domain from a given list. The function should take a domain string as input, and it should return a list of keys that were successfully removed from the reporting system. A domain that is not present in the list sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unregister_domain('example.com') == ['registered_for_reporting', 'resolution_report', 'resolution_report_updated', 'delta_report', 'delta_report_updated', 'delta_report_read']\", \"assert unregister_domain('nonexistent.com') == []\", \"assert unregister_doma... | {
"split": "train",
"index": 77340,
"acecode_id": "bigcode_python_fns_33104",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given a list of groups, where each group is represented as a dictionary containing the name of the group as the key and a list of ages of individuals in that group as the value, write a function that returns the mean age of each group as well as the mean age of all individuals ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_mean_ages([{'Group A': [25, 30, 35]}, {'Group B': [20, 25, 30]}]) == ({'Group A': 30.0, 'Group B': 25.0}, 27.5)\", \"assert get_mean_ages([{'Group A': [15, 20, 25]}, {'Group B': [15, 'invalid', 25]}]) == None\", \"assert get_mean_ages([{'Group A': [10, 2... | {
"split": "train",
"index": 77341,
"acecode_id": "evol_2821",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that generates a SQL CREATE TABLE statement for a 'games' table. The table should include the following columns: an auto-incrementing primary key 'id', two foreign key columns 'player_one_id' and 'player_two_id' that reference a 'u... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_game_table_sql() == \\\"CREATE TABLE IF NOT EXISTS games( id SERIAL PRIMARY KEY, player_one_id INTEGER REFERENCES users (id) ON DELETE set null, player_two_id INTEGER REFERENCES users (id) ON DELETE set null, winner_id INTEGER REFERENCES users (id) ON... | {
"split": "train",
"index": 77342,
"acecode_id": "oss_26386",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function `generate_random_password()` that generates a random 8-character alphanumeric password for new users. The password must consist of uppercase letters, lowercase letters, and digits. Each password should be unique and not contain any special chara... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_random_password().isalnum() == True\", \"assert len(generate_random_password()) == 8\", \"assert all(c.isalnum() for c in generate_random_password())\", \"assert any(c.isdigit() for c in generate_random_password())\", \"assert any(c.islower() for c ... | {
"split": "train",
"index": 77343,
"acecode_id": "oss_15650",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function that takes in two input arrays and returns a new array containing only the unique elements from both arrays, sorted in ascending order. Additionally, the function should return the total count of unique elements. If there are any ties in frequency of the eleme... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_sorted_elements([1, 2, 2, 3, 5], [2, 3, 4, 4, 6]) == ([1, 2, 3, 4, 5, 6], 6)\", \"assert unique_sorted_elements([1, 1, 1], [2, 2, 2]) == ([1, 2], 2)\", \"assert unique_sorted_elements([5, 6, 7], [1, 2, 3]) == ([1, 2, 3, 5, 6, 7], 6)\", \"assert unique... | {
"split": "train",
"index": 77344,
"acecode_id": "evol_5559",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function called `test_str_idx` that takes a list of strings as input. The function should raise a `TypeError` if an attempt is made to access an element using a non-integer index. Implement the function to ensure that it correctly raises th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert (lambda: test_str_idx(['stream1', 'stream2', 'stream3']))() is None\", \"assert (lambda: test_str_idx(['a', 'b', 'c']))() is None\", \"assert (lambda: test_str_idx(['one', 'two', 'three']))() is None\", \"assert (lambda: test_str_idx(['apple', 'banana', 'che... | {
"split": "train",
"index": 77345,
"acecode_id": "oss_22027",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an array of integers where each integer represents the amount of money a masseuse can earn by massaging a client. The masseuse cannot massage two clients who are adjacent to each other. Your task is to implement a function `max_earnings(money: List[int]) -> int` t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_earnings([2, 7, 9, 3, 1]) == 12\", \"assert max_earnings([1, 2, 3, 1]) == 4\", \"assert max_earnings([5, 1, 2, 10]) == 15\", \"assert max_earnings([2, 4, 6, 2, 5]) == 13\", \"assert max_earnings([1, 3, 1, 3, 100]) == 103\", \"assert max_earnings([]) == 0... | {
"split": "train",
"index": 77346,
"acecode_id": "bigcode_python_fns_5919",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked to implement a function `fetch_content(url: str) -> str` that simulates fetching the content from a provided URL. The function should return a string that represents the content fetched from that URL. For this problem, you will simulate the content based on the U... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fetch_content('http://example.com/python') == 'Python content'\", \"assert fetch_content('http://example.com/java') == 'Java content'\", \"assert fetch_content('http://example.com/ruby') == 'Unknown content'\", \"assert fetch_content('http://python.org') == ... | {
"split": "train",
"index": 77347,
"acecode_id": "bigcode_python_fns_33350",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given an angle (an integer from 0 to 359 degrees) and a list of four bytes of data representing a point in a 2D space. Your task is to process this data and determine the position of the point in Cartesian coordinates (x, y) based on the provided angle and data characte... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_point(0, [100, 0, 0, 0]) == (100.0, 0.0)\", \"assert calculate_point(0, [50, 1, 0, 0]) == (None, None)\", \"assert calculate_point(90, [50, 1, 1, 0]) == (None, None)\", \"assert calculate_point(60, [120, 1, 0, 0]) == (None, None)\", \"assert calcul... | {
"split": "train",
"index": 77348,
"acecode_id": "bigcode_python_fns_48026",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers, and your task is to find the maximum sum of a non-empty contiguous subarray. Write a function `max_subarray_sum(arr: List[int]) -> int` that takes a list of integers `arr` as input and returns the maximum sum of any contiguous subarray within t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_subarray_sum([1, 2, 3, 4, 5]) == 15\", \"assert max_subarray_sum([-1, -2, -3, -4]) == -1\", \"assert max_subarray_sum([1, -1, 2, 3, -2, 5]) == 8\", \"assert max_subarray_sum([-2, 1, -3, 4, -1, 2, 1, -5, 4]) == 6\", \"assert max_subarray_sum([0]) == 0\", ... | {
"split": "train",
"index": 77349,
"acecode_id": "bigcode_python_fns_40902",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a tuple of strings as input and returns a dictionary. The dictionary should contain only unique strings from the tuple as keys, and each key should have a value of 1. Additionally, return a second dictionary that summarizes the frequency of each ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert morph_tuple_to_dict(('apple', 'banana', 'apple')) == ({'apple': 1, 'banana': 1}, {'apple': 2, 'banana': 1})\", \"assert morph_tuple_to_dict(('cat', 'dog', 'cat', 'dog', 'elephant')) == ({'cat': 1, 'dog': 1, 'elephant': 1}, {'cat': 2, 'dog': 2, 'elephant': 1}... | {
"split": "train",
"index": 77350,
"acecode_id": "evol_539",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `batch_post(api_key: str, host: Optional[str] = None, gzip: bool = False, timeout: int = 15, **kwargs) -> str` that simulates posting data to a batch API endpoint. The function should take in an API key, an optional host string, a boo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert batch_post('valid_api_key') == 'data uploaded successfully'\", \"assert batch_post('') == 'invalid api key'\", \"assert batch_post('another_valid_key') == 'data uploaded successfully'\", \"assert batch_post(None) == 'invalid api key'\", \"assert batch_post('... | {
"split": "train",
"index": 77351,
"acecode_id": "bigcode_python_fns_3354",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `replace_vowels(string: str, replacement_character: str) -> str` that takes a string input and replaces all vowels (both lowercase and uppercase) with a specified replacement character. The function should return the modified string.\nPlease reason step by step... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_vowels('Hello, world!', '*') == 'H*ll*, w*rld!'\", \"assert replace_vowels('AEIOU', '#') == '#####'\", \"assert replace_vowels('Python Programming', '-') == 'Pyth-n Pr-gr-mm-ng'\", \"assert replace_vowels('12345', '@') == '12345'\", \"assert replace_... | {
"split": "train",
"index": 77352,
"acecode_id": "evol_3805",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with renaming the columns of a data representation in Python. Write a function called `rename_columns` that takes two parameters: a list of dictionaries representing the data, and a dictionary mapping the old column names to new column names. The function should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rename_columns([{'he_vakiy': 100, 'pinta_ala': 50, 'nimi': 'A'}], {'he_vakiy': 'pop2018', 'pinta_ala': 'area', 'nimi': 'name'}) == [{'pop2018': 100, 'area': 50, 'name': 'A'}]\", \"assert rename_columns([{'he_vakiy': 200, 'pinta_ala': 100, 'nimi': 'B'}], {'he... | {
"split": "train",
"index": 77353,
"acecode_id": "oss_6652",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_telluric_model(obj)` that takes an object as input and returns `True` if the object is an instance of the `TelluricModel` class, which is a subclass of `torch.nn.Module`. Otherwise, it should return `False`. You may assume that the `TelluricModel` class... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_telluric_model(TelluricModel()) == True\", \"assert is_telluric_model(torch.nn.Module()) == False\", \"assert is_telluric_model('not a model') == False\", \"assert is_telluric_model(123) == False\", \"assert is_telluric_model([]) == False\", \"assert is_t... | {
"split": "train",
"index": 77354,
"acecode_id": "bigcode_python_fns_22572",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the total quantity of items in a shopping cart represented as a dictionary. Each key in the dictionary corresponds to an item, and the value is the quantity of that item. Your function should take this dictionary as in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert total_quantity({'apple': 2, 'banana': 3, 'orange': 5}) == 10\", \"assert total_quantity({'apple': 0, 'banana': 0}) == 0\", \"assert total_quantity({'milk': 1, 'bread': 2}) == 3\", \"assert total_quantity({'eggs': 12}) == 12\", \"assert total_quantity({'choco... | {
"split": "train",
"index": 77355,
"acecode_id": "oss_19763",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a connected undirected graph represented by a list of edges, implement a function that performs a Depth-First Search (DFS) starting from the first vertex in the edges list. Your function should return a tuple containing two elements: a dictionary that maps each vertex to ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dfs_connected_graph([]) == ({}, {})\", \"assert dfs_connected_graph([(0, 1), (1, 2), (2, 0)]) == ({0: None, 1: (0, 1), 2: (1, 2)}, {0: [0, 1, 2]})\", \"assert dfs_connected_graph([(1, 1)]) == ({1: None}, {1: [1]})\", \"assert dfs_connected_graph([(1, 2), (2,... | {
"split": "train",
"index": 77356,
"acecode_id": "bigcode_python_fns_28650",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a filename, and you need to determine its file type and encoding. The function should return a tuple with two elements: the first element should be a string indicating the file type (e.g. 'text/plain', 'application/unknown') and the second el... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert guess_filetype('document.txt') == ('text/plain', None)\", \"assert guess_filetype('photo.jpg') == ('image/jpeg', None)\", \"assert guess_filetype('archive.zip') == ('application/zip', None)\", \"assert guess_filetype('presentation.pptx') == ('application/vnd... | {
"split": "train",
"index": 77357,
"acecode_id": "bigcode_python_fns_48929",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the number of messages in different queues. Your task is to implement a function `process_queues(queues: List[int]) -> int` that returns the total number of messages across all queues. The function should sum all the integers in the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_queues([1, 2, 3]) == 6\", \"assert process_queues([0, 0, 0]) == 0\", \"assert process_queues([-1, -2, -3]) == -6\", \"assert process_queues([5, -5, 10]) == 10\", \"assert process_queues([100, 200, -50]) == 250\", \"assert process_queues([-10, 10, 20]... | {
"split": "train",
"index": 77358,
"acecode_id": "bigcode_python_fns_41460",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of lists representing multiple preceding lines of Pascal's Triangle, implement a function `generate_next_line(lines)` that generates the next line of Pascal's Triangle based on all provided lines. The function should append the new line to the input list and return... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_next_line([[1], [1, 1], [1, 2, 1]]) == [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1]]\", \"assert generate_next_line([[1], [1, 1]]) == [[1], [1, 1], [1, 2, 1]]\", \"assert generate_next_line([[1]]) == [[1], [1, 1]]\", \"assert generate_next_line([[1], [1, 1... | {
"split": "train",
"index": 77359,
"acecode_id": "evol_27360",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, return a new array containing only the elements that are even. The output array should preserve the order of the original array. Implement a function `filter_even_numbers(arr: List[int]) -> List[int]` where `arr` is the input array of integers. The f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 15, 20, 25, 30]) == [10, 20, 30]\", \"assert filter_even_numbers([0, -1, -2, -3]) == [0, -2]\", \"assert filter_even_numbers([3, 5, 7, 9]) == []\", \"assert filter_even_numbe... | {
"split": "train",
"index": 77360,
"acecode_id": "bigcode_python_fns_6789",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `cleanUp` that simulates the behavior of a `tearDown` method in a unit testing framework. This function should ensure proper cleanup of resources and leave the environment in a consistent state after executing a test case. The functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cleanUp(True, True, {'key': 'value'}) == {'file_closed': True, 'connection_closed': True, 'global_state_reset': {}, 'log_message': 'Cleanup completed successfully.'}\", \"assert cleanUp(False, False, {'a': 1, 'b': 2}) == {'file_closed': False, 'connection_cl... | {
"split": "train",
"index": 77361,
"acecode_id": "oss_10266",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the ages of a group of people. Your task is to implement a function that counts how many people are under the age of 18. The function should take a list of integers as input, where each integer represents the age of an individual. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_underage_people([12, 17, 18, 19, 21]) == 2\", \"assert count_underage_people([5, 10, 15, 20, 25]) == 3\", \"assert count_underage_people([18, 21, 25]) == 0\", \"assert count_underage_people([]) == 0\", \"assert count_underage_people([0, 1, 2, 3]) == 4\... | {
"split": "train",
"index": 77362,
"acecode_id": "bigcode_python_fns_38601",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of fruit names as input and returns a new list containing the fruit names sorted in lexicographical order. The function should not modify the original list.\nPlease reason step by step, then write a self-contained Python solution. Give you... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_fruits_lexicographically(['banana', 'apple', 'orange', 'kiwi']) == ['apple', 'banana', 'kiwi', 'orange']\", \"assert sort_fruits_lexicographically(['grape', 'cherry', 'blueberry', 'avocado']) == ['avocado', 'blueberry', 'cherry', 'grape']\", \"assert so... | {
"split": "train",
"index": 77363,
"acecode_id": "evol_7866",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `custom_print(*values: str, sep: str = ' ', end: str = '\\n') -> str` that takes a variable number of string arguments and returns a single string where the values are concatenated, separated by the specified separator `sep`, and ending with the specified s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert custom_print('Hello', 'World') == 'Hello World\\\\n'\", \"assert custom_print('Hello', 'World', sep=', ') == 'Hello, World\\\\n'\", \"assert custom_print('Python', 'is', 'fun') == 'Python is fun\\\\n'\", \"assert custom_print('Python', 'is', 'fun', end='!') ... | {
"split": "train",
"index": 77364,
"acecode_id": "bigcode_python_fns_46566",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `is_prime_and_fibonacci(n: int) -> bool` that checks whether a given integer n is both a prime number and a Fibonacci number. A prime number is a number greater than 1 that has no divisors other than 1 and itself. A Fibonacci number is a number that is part of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_prime_and_fibonacci(2) == True\", \"assert is_prime_and_fibonacci(3) == True\", \"assert is_prime_and_fibonacci(5) == True\", \"assert is_prime_and_fibonacci(13) == True\", \"assert is_prime_and_fibonacci(21) == False\", \"assert is_prime_and_fibonacci(34... | {
"split": "train",
"index": 77365,
"acecode_id": "evol_5370",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing a tagged text sentence that contains a specific tag `<NEG>` to indicate a scope of negative sentiment. Your goal is to implement a function `process_tagged_text(tagged_sentence: str) -> Tuple[Optional[str], str, str]` that performs the following o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_tagged_text('<NEG>Not going to the park</NEG>.') == ('Not going to the park', 'Not going to the park.', 'REPLACED.')\", \"assert process_tagged_text('<NEG>Negative sentiment</NEG> text') == ('Negative sentiment', 'Negative sentiment text', 'REPLACED ... | {
"split": "train",
"index": 77366,
"acecode_id": "oss_27701",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given the output length of a convolution operation, the size of the filter used, the type of padding, and the stride. Your task is to determine the input length that would yield the given output length based on the convolution operation. Implement a function `conv_input... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert conv_input_length(5, 2, 'valid', 2) == 10\", \"assert conv_input_length(10, 1, 'valid', 1) == 10\", \"assert conv_input_length(3, 5, 'valid', 1) == 7\", \"assert conv_input_length(1, 3, 'valid', 1) == 3\", \"assert conv_input_length(11, 5, 'valid', 1) == 15\... | {
"split": "train",
"index": 77367,
"acecode_id": "bigcode_python_fns_40440",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with extracting financial transaction data from a list of GnuCash transactions represented in a structured format. Each transaction consists of a date, a description, an account name, and an amount. Your goal is to transform this structured transaction data into ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_transactions([]) == []\", \"assert extract_transactions([('2023-01-01', 'Salary', 'Income', 3000.0)]) == [{'date': '2023-01-01', 'description': 'Salary', 'account': 'Income', 'amount': 3000.0}]\", \"assert extract_transactions([('2023-02-01', 'Grocer... | {
"split": "train",
"index": 77368,
"acecode_id": "oss_1220",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes in a dictionary representing crowdin data and converts it into a formatted string. The function should take a dictionary where the keys are strings representing the names of items and the values are integers representing th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_crowdin_data({'apple': 10, 'banana': 5}) == 'apple: 10\\\\nbanana: 5'\", \"assert format_crowdin_data({'orange': 3}) == 'orange: 3'\", \"assert format_crowdin_data({'grapes': 0, 'peaches': 4}) == 'grapes: 0\\\\npeaches: 4'\", \"assert format_crowdin_d... | {
"split": "train",
"index": 77369,
"acecode_id": "bigcode_python_fns_31132",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary that maps integer values to corresponding characters. Your task is to write a function `decode_message` that takes a list of integers and returns the decoded message as a string using the provided dictionary. The dictionary is structured such that eac... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decode_message([1, 2, 3, 4, 5], {1: 'a', 2: 'b', 3: 'c', 4: 'd', 5: 'e'}) == 'abcde'\", \"assert decode_message([1, 3, 5, 7, 9], {1: 'a', 2: 'b', 3: 'c', 4: 'd', 5: 'e', 6: 'f', 7: 'g', 8: 'h', 9: 'i', 10: 'j'}) == 'acegi'\", \"assert decode_message([], {1: ... | {
"split": "train",
"index": 77370,
"acecode_id": "oss_17051",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an array `height` representing the heights of a set of bars, where the width of each bar is 1. Your task is to compute the maximum amount of water that can be trapped after raining between these bars. The `height` array is guaranteed to be non-empty and each eleme... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert trap([1,2,1]) == 0\", \"assert trap([0,1,0]) == 0\", \"assert trap([1,0,2]) == 1\", \"assert trap([4,2,0,3,2,5]) == 9\", \"assert trap([1,1,1,1]) == 0\", \"assert trap([1,2,3,4,5]) == 0\", \"assert trap([5,4,3,2,1]) == 0\", \"assert trap([2,0,2]) == 2\", \"a... | {
"split": "train",
"index": 77371,
"acecode_id": "oss_32029",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates basic operations on a list of match objects. The function should take a list of match objects and perform the following operations: 1. Add a new match object to the end of the list. 2. Remove a match object at a specifi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_matches(['match1'], 'match2', 0, 0) == (['match2'], 'match2')\", \"assert manage_matches(['match1', 'match2'], 'match3', 1, 1) == (['match1', 'match3'], 'match3')\", \"assert manage_matches(['match1', 'match2', 'match3'], 'match4', 2, 0) == (['match1'... | {
"split": "train",
"index": 77372,
"acecode_id": "oss_6367",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given a string 's', determine if the string is 'nice' according to the following criteria: A string is considered 'nice' if it contains at least one pair of two letters that appears at least twice in the string without overlapping (e.g., 'xy' in 'xyxy' or 'a' in 'aba'). Additio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert nicer('qjhvhtzxzqqjkmpb') == True\", \"assert nicer('xxyxx') == True\", \"assert nicer('uurcxstgmygtbstg') == False\", \"assert nicer('ieodomkazucvgmuy') == False\", \"assert nicer('xyxy') == True\", \"assert nicer('a') == False\", \"assert nicer('abab') == ... | {
"split": "train",
"index": 77373,
"acecode_id": "bigcode_python_fns_24280",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function that checks if two input strings are anagrams of each other, considering case insensitivity. Additionally, ensure that both strings contain only valid ASCII alphabetic characters, meaning they should not include any numbers or special characters. Return Tru... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_anagram('listen', 'silent') == True\", \"assert is_anagram('triangle', 'integral') == True\", \"assert is_anagram('apple', 'pale') == False\", \"assert is_anagram('Binary', 'Brainy') == True\", \"assert is_anagram('Hello', 'Olelh') == True\", \"assert is_... | {
"split": "train",
"index": 77374,
"acecode_id": "evol_12366",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates a course name for an educational platform. The course name must meet the following criteria: it should not contain any spaces, and it should not already exist in a given list of existing course names. If the course name is ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_course_name('abc-course', ['course1', 'course2']) == True\", \"assert validate_course_name('my_course', ['my_course', 'course2']) == False\", \"assert validate_course_name('course name', ['course1', 'course2']) == False\", \"assert validate_course_n... | {
"split": "train",
"index": 77375,
"acecode_id": "bigcode_python_fns_24783",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that replaces an element at a specified index in an array with a new value. The index and new value will be provided as additional arguments. If the specified index is out of the array's range, the function should return an error message. The function signa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_element(['swimming', 'boxing', 'gymnastics'], 1, 'football') == ['swimming', 'football', 'gymnastics']\", \"assert replace_element(['swimming', 'boxing', 'gymnastics'], 0, 'diving') == ['diving', 'boxing', 'gymnastics']\", \"assert replace_element(['... | {
"split": "train",
"index": 77376,
"acecode_id": "evol_16543",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a string, implement a function that reverses the string and returns the reversed version. You should implement a single function named `reverse_string` that takes a string as input and outputs the reversed string.\nPlease reason step by step, then write a self-contained P... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_string('hello') == 'olleh'\", \"assert reverse_string('') == ''\", \"assert reverse_string('Python') == 'nohtyP'\", \"assert reverse_string('12345') == '54321'\", \"assert reverse_string('racecar') == 'racecar'\", \"assert reverse_string('A man a pla... | {
"split": "train",
"index": 77377,
"acecode_id": "evol_25999",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string in the format 'PREFIX:ID', where 'PREFIX' is a series of uppercase letters and 'ID' is a series of digits, write a function `get_id_component(curie: str) -> str` that extracts and returns the 'ID' component of the string. The 'ID' component is defined as the subs... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_id_component('CL:0000001') == '0000001'\", \"assert get_id_component('GO:0008150') == '0008150'\", \"assert get_id_component('NCBI:1234567') == '1234567'\", \"assert get_id_component('HGNC:12345') == '12345'\", \"assert get_id_component('MESH:D000123') =... | {
"split": "train",
"index": 77378,
"acecode_id": "bigcode_python_fns_18899",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string of comma-separated values, write a function `validate_comma_separated_list` that splits the string into a list of individual items. Each item in the resulting list should be stripped of leading and trailing whitespace. If the input is already a list, the function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_comma_separated_list('apple, banana, cherry') == ['apple', 'banana', 'cherry']\", \"assert validate_comma_separated_list(' apple , banana , cherry ') == ['apple', 'banana', 'cherry']\", \"assert validate_comma_separated_list([' ', ' apple, ban... | {
"split": "train",
"index": 77379,
"acecode_id": "bigcode_python_fns_39535",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the evaluation of a machine learning model's performance. The function should take the following parameters: a string `model_name` representing the name of the model, an integer `num_images` representing the number of i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_time_per_image('model_file.h5', 10, 20.0) == 2.0\", \"assert calculate_time_per_image('model_file.h5', 5, 15.0) == 3.0\", \"assert calculate_time_per_image('model_file.h5', 1, 5.0) == 5.0\", \"assert calculate_time_per_image('model_file.h5', 10, 0.... | {
"split": "train",
"index": 77380,
"acecode_id": "oss_7233",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two sorted lists of integers, merge them into a single sorted list without using Python's built-in sort function or any third-party library. The resulting list should not contain any duplicate values. Implement the function `merge_sorted_lists(list1: List[int], list2: Lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_sorted_lists([1, 2, 3], [4, 5, 6]) == [1, 2, 3, 4, 5, 6]\", \"assert merge_sorted_lists([1, 3, 5], [2, 4, 6]) == [1, 2, 3, 4, 5, 6]\", \"assert merge_sorted_lists([1, 2, 2, 3], [2, 3, 4]) == [1, 2, 3, 4]\", \"assert merge_sorted_lists([], [1, 2, 3]) ==... | {
"split": "train",
"index": 77381,
"acecode_id": "evol_6195",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a URL string, write a function `extract_domain(url: str) -> str` that extracts and returns the domain name. The domain name is defined as the sequence of characters between the first occurrence of 'www.' (if present) or '//' (if 'www.' is not present) and the top-level do... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_domain('http://www.example.com') == 'example'\", \"assert extract_domain('http://www.test-site.org') == 'test-site'\", \"assert extract_domain('https://www.mywebsite.info') == 'mywebsite'\", \"assert extract_domain('http://otherdomain.com') == 'other... | {
"split": "train",
"index": 77382,
"acecode_id": "oss_9802",
"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 even numbers in that list. Your function should ignore odd numbers and should handle the case where the list is empty by returning 0. Write a function `sum_of_evens(nums: List[i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([2, 4, 6, 8]) == 20\", \"assert sum_of_evens([1, 3, 5, 7]) == 0\", \"assert sum_of_evens([]) == 0\", \"assert sum_of_evens([0]) == 0\", \"assert sum_of_evens([-2, -1, 0, 1, 2]) == 0\", \"assert sum_... | {
"split": "train",
"index": 77383,
"acecode_id": "oss_8156",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function to find the longest common substring between two given strings. The function should support alphanumeric characters and special characters and must be case-sensitive. The input strings may contain up to 10^6 characters. Write a function named 'longest_commo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longest_common_substring('aaa', 'aaaaaaa') == 'aaa'\", \"assert longest_common_substring('abcdefg', 'xyz') == ''\", \"assert longest_common_substring('test@123', '123test@') == 'test@'\", \"assert longest_common_substring('!@#$%', '%@#$!') == '@#$'\", \"asse... | {
"split": "train",
"index": 77384,
"acecode_id": "evol_1004",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with extracting decimal numbers from a given list of tokens, where each token is represented as a string. The tokens can include numeric values and the decimal marker represented as a string. Your goal is to identify and return the decimal number formed by these ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_decimal(['2', 'n\\u00f6qt\\u0259', '5']) == (2.5, ['2', 'n\\u00f6qt\\u0259', '5'])\", \"assert extract_decimal(['4', 'n\\u00f6qt\\u0259', '0']) == (4.0, ['4', 'n\\u00f6qt\\u0259', '0'])\", \"assert extract_decimal(['3', 'n\\u00f6qt\\u0259', '14']) ==... | {
"split": "train",
"index": 77385,
"acecode_id": "bigcode_python_fns_2103",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a nested list of integers, write a function that flattens the list into a single list containing all the integers in the same order. The input can be a list of integers or a list of lists of integers. Your function should handle an arbitrary level of nesting. The function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert flatten_list([1, 2, [3, 4], [5, [6, 7]]]) == [1, 2, 3, 4, 5, 6, 7]\", \"assert flatten_list([[1, 2], [3, 4], 5]) == [1, 2, 3, 4, 5]\", \"assert flatten_list([[[1]], [[2], [3]], 4]) == [1, 2, 3, 4]\", \"assert flatten_list([1, [2, [3, [4, 5]]]]) == [1, 2, 3, ... | {
"split": "train",
"index": 77386,
"acecode_id": "bigcode_python_fns_8329",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer n, implement a function `allPossibleFBT(n: int) -> List[List[Optional[int]]]` that generates all possible full binary trees with n nodes. Each node in the tree should have a value of 0. A full binary tree is defined as a binary tree where every node has either ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert allPossibleFBT(1) == [[0]]\", \"assert allPossibleFBT(3) == [[0,0,0]]\", \"assert len(allPossibleFBT(5)) == 2\", \"assert len(allPossibleFBT(7)) == 5\", \"assert allPossibleFBT(2) == []\", \"assert allPossibleFBT(4) == []\", \"assert len(allPossibleFBT(6)) =... | {
"split": "train",
"index": 77387,
"acecode_id": "evol_4306",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the Signal-to-Noise Ratio (S/N) for a set of fibers based on their spectral data and plugging information. Implement a function `calculate_snr(fluxes: List[float], errors: List[float], plugmap: List[Dict[str, Union[str, float]]]) -> List[Dict[str... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_snr([10.0, 20.0], [1.0, 2.0], [{'fiberId': 0, 'ra': 10.0, 'dec': 20.0, 'objType': 'OBJECT'}, {'fiberId': 1, 'ra': 30.0, 'dec': 40.0, 'objType': 'OBJECT'}]) == [{'fiberId': 0, 'flux': 10.0, 'error': 1.0, 'snr': 10.0}, {'fiberId': 1, 'flux': 20.0, 'e... | {
"split": "train",
"index": 77388,
"acecode_id": "bigcode_python_fns_14027",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function `manage_amazon_sqs(queue_url: str, operation: str, message: Optional[str] = None) -> Union[str, List[Dict]]` that simulates operations on an Amazon SQS (Simple Queue Service) queue. The function should accept the following parameters: `queue_url` (the URL o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_amazon_sqs('http://example.com/myqueue', 'send', 'Hello World') == 'Message sent with ID: <MessageId>'\", \"assert manage_amazon_sqs('http://example.com/myqueue', 'receive') == []\", \"assert manage_amazon_sqs('http://example.com/myqueue', 'delete') =... | {
"split": "train",
"index": 77389,
"acecode_id": "evol_16940",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of numerical values, write a function `format_ticks(current_ticks: List[float], numstring: str) -> List[str]` that formats each value in the list according to the following rules: If the value is an integer, it should be converted to a string without any decimal pl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_ticks([], 'units') == []\", \"assert format_ticks([1.2345, 2.3456, 3.4567], 'm/s') == ['1.2m/s', '2.3m/s', '3.5m/s']\", \"assert format_ticks([0.1, 0.2, 0.3, 0.4], '%') == ['0.1%', '0.2%', '0.3%', '0.4%']\", \"assert format_ticks([1.234, 2.456, 3.678]... | {
"split": "train",
"index": 77390,
"acecode_id": "bigcode_python_fns_10495",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the setup of a shelf with buttons in a 3D modeling software. The function should take a shelf name and return a list of button configurations. Each button configuration should include the label of the button and a command t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert setup_shelf('MosketchForMaya') == [{'label': 'Start', 'command': 'start()'}, {'label': 'Stop', 'command': 'stop()'}, {'label': 'Load Mosko', 'command': 'load_mosko()'}, {'label': 'Load Okto', 'command': 'load_okto()'}, {'label': 'Load Mosko Humanik', 'comman... | {
"split": "train",
"index": 77391,
"acecode_id": "bigcode_python_fns_37044",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that validates a given password based on certain criteria. The function should return True if the password meets all the criteria, and False otherwise. The criteria for a valid password are as follows: 1. The password must be at least... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_password('Password1') == True\", \"assert validate_password('passw1thoutupper') == False\", \"assert validate_password('PASSWORD') == False\", \"assert validate_password('password') == False\", \"assert validate_password('Pass1234') == True\", \"ass... | {
"split": "train",
"index": 77392,
"acecode_id": "oss_1163",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing a signal. Your task is to divide this signal into non-overlapping windows of a specified size. If the length of the signal is not a multiple of the window size, the last window should be filled with zeros. Implement the function `ex... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_windows([1, 2, 3, 4, 5, 6], 3) == [[1, 2, 3], [4, 5, 6]]\", \"assert extract_windows([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5, 0]]\", \"assert extract_windows([7, 8, 9, 10, 11, 12, 13], 4) == [[7, 8, 9, 10], [11, 12, 13, 0]]\", \"assert extract_win... | {
"split": "train",
"index": 77393,
"acecode_id": "bigcode_python_fns_36488",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with designing a function called `substitution_module` that takes a boolean parameter `opt` and a function `fn`. If `opt` is `False`, the function should return an identity mapping, meaning the output should be the same as the input. If `opt` is `True`, the funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert substitution_module(lambda: 'result', False) == 'input'\", \"assert substitution_module(lambda: 'result', True) == 'result'\", \"assert substitution_module(lambda: 'output', False) == 'input'\", \"assert substitution_module(lambda: 'output', True) == 'output... | {
"split": "train",
"index": 77394,
"acecode_id": "bigcode_python_fns_5519",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that manages binary objects within a data exchange system. Each binary object is associated with a file name (a string) and a file type code (an integer). You need to implement a function `binary_object_info(file_name: str, file_type_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binary_object_info('image.png', 1, b'\\\\x89PNG\\\\r\\\\n') == 'File Name: image.png, File Type Code: 1'\", \"assert binary_object_info('document.pdf', 2, b'%PDF-1.4') == 'File Name: document.pdf, File Type Code: 2'\", \"assert binary_object_info('audio.mp3'... | {
"split": "train",
"index": 77395,
"acecode_id": "oss_25549",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_smtp_enabled(backend: str) -> bool` that checks if the provided backend is supported for sending emails. The function should return True if the backend is not among the disabled SMTP backends, and False otherwise. For this problem, consider the followin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_smtp_enabled('default_backend') == True\", \"assert is_smtp_enabled('backend1') == False\", \"assert is_smtp_enabled('backend2') == False\", \"assert is_smtp_enabled('backend3') == False\", \"assert is_smtp_enabled('smtp_backend') == True\", \"assert is_s... | {
"split": "train",
"index": 77396,
"acecode_id": "bigcode_python_fns_17045",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary that represents form errors, where the keys are field names and the values are lists of error messages associated with each field. Write a function `form_errors_json(form_errors: dict) -> dict` that takes this dictionary as input and returns a new dic... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert form_errors_json({'username': ['This field is required.', 'Ensure this value is unique.'], 'password': ['This field is required.']}) == {'username': 'This field is required., Ensure this value is unique.', 'password': 'This field is required.'}\", \"assert f... | {
"split": "train",
"index": 77397,
"acecode_id": "bigcode_python_fns_35483",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a custom exception class for a caching system. Your goal is to create a Python class called `CacheException` that inherits from the built-in `Exception` class. The `CacheException` class should have a constructor that accepts a message as an arg... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert CacheException('Cache miss error').__str__() == 'Cache miss error'\", \"assert CacheException('Invalid cache key').__str__() == 'Invalid cache key'\", \"assert CacheException('Cache overflow').__str__() == 'Cache overflow'\", \"assert CacheException('Cache t... | {
"split": "train",
"index": 77398,
"acecode_id": "oss_16500",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of numbers, you need to write a function called `multiply_lists` that takes two lists as input and returns a new list that contains the element-wise multiplication of the input lists. If the lengths of the input lists do not match, the function should align the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multiply_lists([3, 4, 5], [2, 3, 4, 6]) == [6, 12, 20, 6]\", \"assert multiply_lists([1, 2], [3, 4]) == [3, 8]\", \"assert multiply_lists([], [1, 2]) == [1, 2]\", \"assert multiply_lists([10, 20, 30], [1]) == [10, 20, 30]\", \"assert multiply_lists([1, 2], [... | {
"split": "train",
"index": 77399,
"acecode_id": "oss_23874",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.