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": "Given a set of tuples representing a dataset, where each tuple consists of three elements (Sample1, Sample2, Label), write a function that takes this dataset as input and returns a list of dictionaries. Each dictionary should have the keys 'Sample1', 'Sample2', and 'Label' corr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_dataset_to_list({('X', 'Y', 1)}) == [{'Sample1': 'X', 'Sample2': 'Y', 'Label': 1}]\", \"assert convert_dataset_to_list({}) == []\", \"assert convert_dataset_to_list({('1', '2', 3), ('4', '5', 6)}) == [{'Sample1': '1', 'Sample2': '2', 'Label': 3}, {'S... | {
"split": "train",
"index": 66400,
"acecode_id": "bigcode_python_fns_24233",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the area and perimeter of a rectangle given its width and height. The function should take two parameters: `width` and `height`, both of which are non-negative integers. The function should return a tuple containing tw... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_rectangle_properties(0, 0) == (0, 0)\", \"assert calculate_rectangle_properties(5, 10) == (50, 30)\", \"assert calculate_rectangle_properties(1, 1) == (1, 4)\", \"assert calculate_rectangle_properties(2, 3) == (6, 10)\", \"assert calculate_rectangl... | {
"split": "train",
"index": 66401,
"acecode_id": "oss_37216",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that manages a simple bank account system. Your function should take a list of operations as input, where each operation is represented by a tuple. The first element of the tuple is the operation type (a string) which can be 'create',... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_accounts([('create', ('Charlie', 'C789', 300)), ('get_balance', ('Charlie',)), ('deposit', ('Charlie', 700)), ('get_balance', ('Charlie',)), ('withdraw', ('Charlie', 500)), ('get_balance', ('Charlie',))]) == [300, 1000, 500]\", \"assert manage_account... | {
"split": "train",
"index": 66402,
"acecode_id": "oss_13170",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `capture_image()` that simulates the process of capturing and processing an image based on given attributes. The function accepts the following parameters: `resolution`, `framerate`, `format`, and `resize`. It should return a string i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert capture_image((480, 320), 30, 'bgr', None) == 'Image captured with resolution (480, 320) and format bgr'\", \"assert capture_image(None, 30, 'bgr', None) == 'Image capture failed'\", \"assert capture_image((1920, 1080), 30, 'png', None) == 'Image captured wi... | {
"split": "train",
"index": 66403,
"acecode_id": "oss_24332",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a list of floating-point numbers representing the B-factors of atoms in a protein structure. Your task is to implement a function that calculates the average B-factor from the given list. If the list is empty, return 0.0. Implement the function with the following ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_b_factor([10.0, 20.0, 30.0]) == 20.0\", \"assert calculate_average_b_factor([0.0, 0.0, 0.0]) == 0.0\", \"assert calculate_average_b_factor([5.0, 15.0, 25.0, 35.0]) == 20.0\", \"assert calculate_average_b_factor([1.0]) == 1.0\", \"assert cal... | {
"split": "train",
"index": 66404,
"acecode_id": "oss_23669",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with developing a function that takes a list of dictionaries representing algorithms and returns a new list containing only the names of algorithms that are publicly accessible. Each algorithm dictionary has the following structure: {'name': str, 'description': s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_public_algorithms([{'name': 'Algo1', 'description': 'Description1', 'file': 'file1.zip', 'permissions': {'public': True, 'authorized_ids': []}}, {'name': 'Algo2', 'description': 'Description2', 'file': 'file2.zip', 'permissions': {'public': False, 'au... | {
"split": "train",
"index": 66405,
"acecode_id": "bigcode_python_fns_6627",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of flowlines represented as tuples, where each tuple contains two integers: the FROMCOMID and the TOCOMID, which represent the connection from one flowline to another. Your task is to implement a function that takes this list of flowlines and returns a list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_reachable_tocomids([(1, 2), (2, 3), (1, 4)], 1) == [2, 3, 4]\", \"assert get_reachable_tocomids([(1, 2), (2, 3)], 2) == [3]\", \"assert get_reachable_tocomids([(1, 2)], 1) == [2]\", \"assert get_reachable_tocomids([(1, 2), (2, 1)], 1) == [1, 2]\", \"asse... | {
"split": "train",
"index": 66406,
"acecode_id": "bigcode_python_fns_27159",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary that represents a track element with various attributes related to a music track. The dictionary may contain keys 'artist', 'album', 'name', 'mbid', and 'date', where 'artist' and 'album' themselves can be nested dictionaries. Your goal is to extract ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_track({'artist': {'name': 'Artist1', 'mbid': '123'}, 'album': {'name': 'Album1', 'mbid': '456'}, 'name': 'Track1', 'mbid': '789', 'date': {'uts': '1610000000'}}) == ['1610000000', 'Track1', 'Artist1', 'Album1', '789', '123', '456']\", \"assert parse_tr... | {
"split": "train",
"index": 66407,
"acecode_id": "bigcode_python_fns_36758",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers, list1 and list2, write a function that returns a new list containing the elements that are present in both lists, without duplication. The result should be sorted in ascending order. If there are no common elements, return an empty list. Your functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert common_elements([1, 2, 3, 4], [3, 4, 5, 6]) == [3, 4]\", \"assert common_elements([1, 1, 2, 2], [2, 2, 3, 3]) == [2]\", \"assert common_elements([5, 6, 7], [8, 9, 10]) == []\", \"assert common_elements([], [1, 2, 3]) == []\", \"assert common_elements([1, 2, ... | {
"split": "train",
"index": 66408,
"acecode_id": "bigcode_python_fns_36183",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two 2D arrays representing two different segmentations of an image. Your task is to write a function that takes in these two segmentations and returns a new 2D array that represents the pixel-wise maximum values between the two input segmentations. The input array... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_segmentation([[1, 2], [3, 4]], [[4, 3], [2, 1]]) == [[4, 3], [3, 4]]\", \"assert max_segmentation([[0, 0], [0, 0]], [[1, 1], [1, 1]]) == [[1, 1], [1, 1]]\", \"assert max_segmentation([[5, 6], [7, 8]], [[1, 2], [3, 4]]) == [[5, 6], [7, 8]]\", \"assert max... | {
"split": "train",
"index": 66409,
"acecode_id": "bigcode_python_fns_4628",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a neural network configuration for an agent based on provided specifications. The function `make_networks(action_spec, policy_layer_sizes, critic_layer_sizes)` takes three parameters: a tuple `action_spec` representing the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert make_networks((2,), (300, 200), (400, 300)) == {'policy': 'LayerNormMLP -> MultivariateNormalDiagHead', 'critic': 'LayerNormMLP -> Output'}\", \"assert make_networks((3,), (100,), (150, 100)) == {'policy': 'LayerNormMLP -> MultivariateNormalDiagHead', 'criti... | {
"split": "train",
"index": 66410,
"acecode_id": "bigcode_python_fns_48152",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of room descriptions, where each room is represented as a tuple containing the room name (a string), sector ID (an integer), and checksum (a string). Your task is to implement a function `find_north_pole(valid_rooms)` that decodes the room names using the s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_north_pole([('abcd', 1, 'abc'), ('defg', 2, 'defg')]) == None\", \"assert find_north_pole([('xyz', 3, 'xyz'), ('uvw', 2, 'uvw')]) == None\", \"assert find_north_pole([('z', 1, 'z'), ('y', 2, 'y')]) == None\", \"assert find_north_pole([('room', 0, 'abc')... | {
"split": "train",
"index": 66411,
"acecode_id": "bigcode_python_fns_16292",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a function `get_pos_tagger(name: str) -> Callable` that returns a function capable of processing text sequences for Part of Speech (PoS) tagging based on the provided identifier. The identifiers can be one of the following: 'spacy', 'stanza', 'flair', 'someweta', ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_pos_tagger('spacy') is not None\", \"assert get_pos_tagger('spacy-de') is not None\", \"assert get_pos_tagger('stanza') is not None\", \"assert get_pos_tagger('stanza-de') is not None\", \"assert get_pos_tagger('flair') is not None\", \"assert get_pos_ta... | {
"split": "train",
"index": 66412,
"acecode_id": "bigcode_python_fns_21458",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a function that executes a round-robin scheduling algorithm with process priority. The function should take a list of processes and a time slice as input. Each process is represented as a tuple (time, priority), where lower priority values indicate higher urgency. The... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert round_robin_scheduling([(8, 1), (4, 2), (6, 3)], 3) == 18\", \"assert round_robin_scheduling([(2, 1), (2, 2)], 1) == 4\", \"assert round_robin_scheduling([(1, 1)], 1) == 1\", \"assert round_robin_scheduling([(5, 1), (5, 2)], 1) == 10\", \"assert round_robin_... | {
"split": "train",
"index": 66413,
"acecode_id": "evol_12404",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates unique identifiers in the form of strings. Each identifier should be a combination of 8 random alphanumeric characters. Your function should be called `generate_unique_id` and it should return a new unique identifier each t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_unique_id() != generate_unique_id()\", \"assert generate_unique_id() != generate_unique_id()\", \"assert generate_unique_id(reset=True) != generate_unique_id()\", \"assert generate_unique_id(reset=True) != generate_unique_id(reset=True)\", \"assert ... | {
"split": "train",
"index": 66414,
"acecode_id": "oss_23013",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `fibonacci_primes(n: int) -> List[int]` that generates the first `n` Fibonacci numbers and returns a list containing only the Fibonacci numbers that are also prime. For the purpose of this function, the Fibonacci sequence starts with 0 and 1. The function s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci_primes(1) == []\", \"assert fibonacci_primes(2) == []\", \"assert fibonacci_primes(4) == [2]\", \"assert fibonacci_primes(5) == [2, 3]\", \"assert fibonacci_primes(7) == [2, 3, 5]\"]}"
} | {
"split": "train",
"index": 66415,
"acecode_id": "evol_14656",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that associates a given QR code with a user's email address. Your function should take in a dictionary containing the email address and the QR code. If the email address exists in the user database (simulated as a list of dictionaries), t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert associate_qr_code({'link_email': 'user1@example.com', 'qr_code': 'QR123'}, [{'email': 'user1@example.com', 'qrcode': []}]) == {'statusCode': 200, 'body': 'success'}\", \"assert associate_qr_code({'link_email': 'user2@example.com', 'qr_code': 'QR456'}, [{'ema... | {
"split": "train",
"index": 66416,
"acecode_id": "bigcode_python_fns_19987",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a list of player names for a sports team. Each player name should be formatted as 'teamX', where X is the player's index in the team. The function should take an integer input `team_size`, which represents the number of pla... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_team_names(0) == []\", \"assert generate_team_names(1) == ['team0']\", \"assert generate_team_names(2) == ['team0', 'team1']\", \"assert generate_team_names(3) == ['team0', 'team1', 'team2']\", \"assert generate_team_names(4) == ['team0', 'team1', '... | {
"split": "train",
"index": 66417,
"acecode_id": "bigcode_python_fns_21709",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representation of a 2D list, where each row is separated by a newline character and each element within a row is separated by a space. Your task is to implement a function that converts this string into an actual 2D list (a list of lists). The function sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_2d_list('1 2 3\\\\n4 5 6') == [[1, 2, 3], [4, 5, 6]]\", \"assert convert_to_2d_list('') == []\", \"assert convert_to_2d_list('1') == [[1]]\", \"assert convert_to_2d_list('1 2\\\\n3 4') == [[1, 2], [3, 4]]\", \"assert convert_to_2d_list('10 20\\\\n... | {
"split": "train",
"index": 66418,
"acecode_id": "bigcode_python_fns_42119",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function that generates messages based on the weather and the time of day. The function should take two parameters: 'weather' (a string) and 'time_of_day' (a string). Based on the following rules, return the corresponding message: 1. If the weather is sunny and it's mo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_message('sunny', 'morning') == \\\"It's a great day to stay outside! Enjoy the morning sun!\\\"\", \"assert generate_message('sunny', 'afternoon') == \\\"It's a great day to stay outside! Don't forget your sunscreen!\\\"\", \"assert generate_message... | {
"split": "train",
"index": 66419,
"acecode_id": "evol_21445",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that takes a list of URLs and returns the count of unique domains present in the URLs. A domain is defined as the part of a URL that comes after 'https://' or 'http://' and before the next '/' or the end of the URL. For example, in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_domains(['https://www.example.com/page1', 'https://subdomain.example.com/page2', 'http://www.anotherexample.com/page3', 'https://www.example.com/page4', 'http://www.anotherexample.com/page5']) == 3\", \"assert count_unique_domains(['http://examp... | {
"split": "train",
"index": 66420,
"acecode_id": "oss_8574",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of citations, where each citation is represented as a dictionary containing 'type' and 'description'. Your task is to implement a function that filters the citations based on a specified type. The function should return a list containing only the citations ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_citations_by_type([{'type': 'A', 'description': 'Citation 1'}, {'type': 'B', 'description': 'Citation 2'}, {'type': 'A', 'description': 'Citation 3'}], 'A') == [{'type': 'A', 'description': 'Citation 1'}, {'type': 'A', 'description': 'Citation 3'}]\",... | {
"split": "train",
"index": 66421,
"acecode_id": "bigcode_python_fns_42727",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates hovering over an element on a web page by returning a message that indicates the element has been hovered over. The function should accept a string that represents the identifier of the element (e.g., 'button', 'link', ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hover_over_element('button') == 'Hovered over element: button'\", \"assert hover_over_element('link') == 'Hovered over element: link'\", \"assert hover_over_element('image') == 'Hovered over element: image'\", \"assert hover_over_element('header') == 'Hovere... | {
"split": "train",
"index": 66422,
"acecode_id": "bigcode_python_fns_21168",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an array of positive integers, `nums`, and a positive integer `k`. Your task is to implement a function that counts the number of contiguous subarrays whose product of elements is strictly less than `k`. Write a function `numSubarrayProductLessThanK(nums: List[int... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert numSubarrayProductLessThanK([10, 5, 2, 6], 100) == 8\", \"assert numSubarrayProductLessThanK([1, 2, 3], 10) == 6\", \"assert numSubarrayProductLessThanK([1, 2, 3, 4], 10) == 7\", \"assert numSubarrayProductLessThanK([2, 5, 3, 10], 30) == 6\", \"assert numSub... | {
"split": "train",
"index": 66423,
"acecode_id": "evol_33401",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of integers and returns a dictionary containing the frequency of each integer in the list. The function should have the following signature: \n\n```python\ndef count_frequencies(numbers: List[int]) -> Dict[int... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_frequencies([]) == {}\", \"assert count_frequencies([1]) == {1: 1}\", \"assert count_frequencies([1, 1, 2]) == {1: 2, 2: 1}\", \"assert count_frequencies([2, 2, 2, 3, 3, 4]) == {2: 3, 3: 2, 4: 1}\", \"assert count_frequencies([5, 5, 5, 5, 5]) == {5: 5}... | {
"split": "train",
"index": 66424,
"acecode_id": "oss_37058",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that filters a list of integers based on specific criteria. The function should take a list of integers as input and return a new list containing only the integers that meet the following criteria: include only positive integers in th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_integers([1, 2, 3, 4, 5]) == [1, 2, 4, 5]\", \"assert filter_integers([-1, -2, -3, -4, -5]) == []\", \"assert filter_integers([3, 6, 9, 12]) == []\", \"assert filter_integers([10, 15, 20, 25]) == [10, 20, 25]\", \"assert filter_integers([0, -1, 2, 3, ... | {
"split": "train",
"index": 66425,
"acecode_id": "oss_22815",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the operations of a simple banking system. Your function should accept a list of transactions, where each transaction is represented as a tuple. Each tuple consists of an operation type ('deposit' or 'withdraw') and an amou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simple_banking_system([]) == (0, 0)\", \"assert simple_banking_system([('deposit', 100), ('withdraw', 100)]) == (0, 2)\", \"assert simple_banking_system([('deposit', 100), ('deposit', 200), ('withdraw', 50)]) == (250, 3)\", \"assert simple_banking_system([('... | {
"split": "train",
"index": 66426,
"acecode_id": "oss_13124",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a file path. Your task is to implement a function that simulates the behavior of removing a directory and then recreating it. The function should take a single input string, `path`, and return a string representing the path after the operatio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_and_create_dir('/home/user/test') == '/home/user/test'\", \"assert remove_and_create_dir('/var/logs/app') == '/var/logs/app'\", \"assert remove_and_create_dir('/tmp') == '/tmp'\", \"assert remove_and_create_dir('/usr/local/bin') == '/usr/local/bin'\",... | {
"split": "train",
"index": 66427,
"acecode_id": "bigcode_python_fns_42188",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `calculate_sphere_area(radius: float) -> float` that calculates the surface area of a sphere given its radius. The surface area can be calculated using the formula 4π(R^2), where R is the radius. The function should raise a ValueError if the provided radius is ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_sphere_area(0) == 0.0\", \"assert abs(calculate_sphere_area(1) - 12.566370614359172) < 1e-9\", \"assert abs(calculate_sphere_area(2) - 50.26548245743669) < 1e-9\", \"assert abs(calculate_sphere_area(3) - 113.09733552923255) < 1e-9\", \"assert abs(c... | {
"split": "train",
"index": 66428,
"acecode_id": "evol_9284",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple game engine for a turn-based strategy game. You need to create a function called `resolve_action` that takes two parameters: `action_type` (a string that can either be 'wait' or 'move') and `originator` (a string representing the entity... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert resolve_action('wait', 'entity1') == [{'type': 'wait'}]\", \"assert resolve_action('move', 'entity1') == [{'type': 'move'}]\", \"assert resolve_action('wait', 'entity2') == [{'type': 'wait'}]\", \"assert resolve_action('move', 'entity2') == [{'type': 'move'}... | {
"split": "train",
"index": 66429,
"acecode_id": "oss_11149",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two integers x and y, compute the absolute difference between them. Additionally, for both x and y, return a list of their prime factors. If either x or y is a prime number, return an empty list for that number's factors instead. Implement a function `solve(x: int, y: int... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert solve(20, 10) == (10, [2, 2, 5], [2, 5])\", \"assert solve(13, 7) == (6, [], [])\", \"assert solve(15, 15) == (0, [3, 5], [3, 5])\", \"assert solve(11, 5) == (6, [], [])\", \"assert solve(28, 14) == (14, [2, 2, 7], [2, 7])\", \"assert solve(19, 3) == (16, []... | {
"split": "train",
"index": 66430,
"acecode_id": "evol_12852",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing distances measured in a series of frames. Each frame corresponds to an index in the list. Your task is to compute the gradient of the distances, which represents the change in distance from one frame to the next. Implement a functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_gradients([0, 1, 2, 3]) == [0.0, 1.0, 1.0, 1.0]\", \"assert calculate_gradients([10, 20, 30]) == [0.0, 10.0, 10.0]\", \"assert calculate_gradients([5]) == [0.0]\", \"assert calculate_gradients([]) == []\", \"assert calculate_gradients([1, 1, 1, 1])... | {
"split": "train",
"index": 66431,
"acecode_id": "bigcode_python_fns_24812",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing HTTP header lines. Write a function `has_form_encoded_header(header_lines: List[str]) -> bool` that checks if any of the header lines specify a 'Content-Type' of 'application/x-www-form-urlencoded'. The function should return True if... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_form_encoded_header(['Content-Type: application/x-www-form-urlencoded']) == True\", \"assert has_form_encoded_header(['Content-Type: application/json']) == False\", \"assert has_form_encoded_header(['content-type: application/x-www-form-urlencoded']) == ... | {
"split": "train",
"index": 66432,
"acecode_id": "bigcode_python_fns_44228",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that filters network packets based on their timestamp. Implement a function `filter_packets(start_time, end_time, input_packets)` where: \n- `start_time` and `end_time` are datetime objects representing the start and end timestamps... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_packets(datetime(2022, 1, 1, 12, 0, 0), datetime(2022, 1, 1, 13, 0, 0), [{'time': datetime(2022, 1, 1, 12, 15, 0), 'data': 'packet1'}, {'time': datetime(2022, 1, 1, 12, 30, 0), 'data': 'packet2'}, {'time': datetime(2022, 1, 1, 13, 15, 0), 'data': 'pac... | {
"split": "train",
"index": 66433,
"acecode_id": "oss_26575",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that returns the English word containing the highest quantity of vowel characters (a, e, i, o, u) from a given list of distinct English words. If there are multiple words with the same highest count of vowels, return the first one encounte... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_vowels(['apple', 'banana', 'cherry']) == 'banana'\", \"assert max_vowels(['hello', 'world', 'python']) == 'hello'\", \"assert max_vowels(['a', 'e', 'i', 'o', 'u']) == 'a'\", \"assert max_vowels(['test', 'best', 'nest']) == 'test'\", \"assert max_vowels([... | {
"split": "train",
"index": 66434,
"acecode_id": "evol_27223",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries where each dictionary represents a record containing information about a property. Each record has the following keys: 'borough', 'block', 'lot', 'numbers', 'spaced_numbers', 'letters', 'BBL', 'x', 'y', and 'E_des'. Your task is to implement... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert property_to_csv([{ 'borough': 'Queens', 'block': '321', 'lot': '654', 'numbers': '7, 8, 9', 'spaced_numbers': '7 8 9', 'letters': 'C', 'BBL': '456789123', 'x': '50', 'y': '60', 'E_des': 'Description 3' }]) == 'Queens,321,654,7, 8, 9,7 8 9,C,456789123,50,60,D... | {
"split": "train",
"index": 66435,
"acecode_id": "bigcode_python_fns_12006",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of nucleotide sequences, each representing the genetic information of different organisms. Each sequence is a string consisting of characters 'A', 'C', 'G', and 'T'. You need to find a score that represents correlated changes in specific positions of the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_correlated_changes(['A', 'A', 'A'], ['A', 'A', 'A'], 0, 0) == 0.0\", \"assert calculate_correlated_changes(['A', 'C'], ['G', 'T'], 0, 0) == 0.0\", \"assert calculate_correlated_changes(['A', 'C', 'G'], ['G', 'C', 'A'], 0, 2) == 0.0\", \"assert calc... | {
"split": "train",
"index": 66436,
"acecode_id": "bigcode_python_fns_14271",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with deploying a web application to a cloud environment. You need to implement a function `deploy(version: str) -> str` that simulates the deployment process. The function will receive a version string as input and will return a string indicating the result of th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert deploy('1.0') == 'Deployment of version 1.0 successful'\", \"assert deploy('2.0') == 'Deployment of version 2.0 successful'\", \"assert deploy('3.0') == 'Deployment of version 3.0 successful'\", \"assert deploy('4.0') == 'Deployment of version 4.0 failed'\",... | {
"split": "train",
"index": 66437,
"acecode_id": "bigcode_python_fns_8783",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers `numbers` and an integer `delimiter`, implement a function `intersperse(numbers: List[int], delimiter: int) -> List[int]` that inserts `delimiter` between successive items of `numbers`. If `delimiter` is negative, use its absolute value to determine how... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert intersperse([], 0) == []\", \"assert intersperse([1, 2, 3], 4) == [1, 4, 2, 4, 3]\", \"assert intersperse([5], 1) == [5]\", \"assert intersperse([10, 20], 0) == [10, 0, 20]\", \"assert intersperse([1, 2, 3, 4], 2) == [1, 2, 2, 2, 3, 2, 4]\", \"assert intersp... | {
"split": "train",
"index": 66438,
"acecode_id": "evol_30823",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function `custom_reverse_string(s)` that takes a string `s` as input and returns a new string that is the reverse of `s`. The function should not use any built-in Python functions for reversing strings, such as `reversed()` or slicing. Additionally, ensure that the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert custom_reverse_string('hello') == 'olleh'\", \"assert custom_reverse_string('') == ''\", \"assert custom_reverse_string('A') == 'A'\", \"assert custom_reverse_string('12345') == '54321'\", \"assert custom_reverse_string('!@#$%') == '%$#@!'\", \"assert custom... | {
"split": "train",
"index": 66439,
"acecode_id": "evol_16667",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string, write a function that finds the n most frequent words, ignoring case differences and punctuation. The function should return a list of tuples, where each tuple contains a word and its frequency. For example, 'Hello' and 'hello' should be treated as the same word... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert most_common_words('Hello, world! Hello world.', 2) == [('hello', 2), ('world', 2)]\", \"assert most_common_words('Python is great. Python, programming, and python!', 3) == [('python', 3), ('is', 1), ('great', 1)]\", \"assert most_common_words('To be, or not ... | {
"split": "train",
"index": 66440,
"acecode_id": "evol_33078",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `complex_prime_sort(l1: list, l2: list) -> list` that takes two lists of integers as input and returns a list of even prime numbers (which are only the number 2) present in both lists. The resulting list should be returned in reverse order. If there are no ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert complex_prime_sort([1, 3, 5, 7], [9, 11, 13]) == []\", \"assert complex_prime_sort([], [2, 4, 6]) == []\", \"assert complex_prime_sort([2], [2]) == [2]\", \"assert complex_prime_sort([7, 8, 10], [3, 5, 7]) == []\", \"assert complex_prime_sort([-2, -4, -6], [... | {
"split": "train",
"index": 66441,
"acecode_id": "evol_5742",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that initializes a documentation dictionary based on given input arguments. The function should accept a dictionary containing three possible keys: 'endpoint_port', 'endpoint_url', and 'module_name'. If a key is missing from the input dic... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert init_doc({'endpoint_port': 3000}) == {'endpoint_port': 3000, 'endpoint_url': 'http://localhost', 'module_name': 'default_module'}\", \"assert init_doc({'endpoint_url': 'http://example.com'}) == {'endpoint_port': 8080, 'endpoint_url': 'http://example.com', 'm... | {
"split": "train",
"index": 66442,
"acecode_id": "bigcode_python_fns_22464",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a directed acyclic graph (DAG) represented as an adjacency list, write a function `auto_layout_nodes(graph: Dict[int, List[int]], selected_nodes: List[int] = None) -> List[int]` that automatically lays out the nodes in an upstream order. If `selected_nodes` is provided, o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert auto_layout_nodes({0: [1, 2], 1: [3], 2: [3], 3: []}) == [0, 1, 2, 3] or [0, 2, 1, 3] or [1, 0, 2, 3] or [2, 0, 1, 3]\", \"assert auto_layout_nodes({0: [], 1: [], 2: []}) == [0, 1, 2] or [1, 0, 2] or [2, 0, 1] or [2, 1, 0] or [1, 2, 0]\", \"assert auto_layou... | {
"split": "train",
"index": 66443,
"acecode_id": "bigcode_python_fns_11071",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that calculates the average quality of art sessions based on a given timestamp. The function should take a list of session objects, each with a timestamp and a quality score. Your goal is to return the average quality score of the session... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_quality([(datetime(2023, 10, 1, 12, 0), 90), (datetime(2023, 10, 1, 12, 0), 80)], datetime(2023, 10, 1, 12, 0)) == 85.0\", \"assert calculate_average_quality([(datetime(2023, 10, 1, 12, 0), 70), (datetime(2023, 10, 1, 12, 1), 90)], datetime... | {
"split": "train",
"index": 66444,
"acecode_id": "oss_6778",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings where each string represents a line from a GFF file containing information for mitochondrial genes. Each line is tab-separated and includes columns for the sequence identifier, source, type, start, end, score, strand, phase, and attributes. Your ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_gff_to_gtf(['comp1_c1_seq1\\tSource\\tgene\\t100\\t200\\t.\\t+\\t.\\tID=gene1;Name=Gene1']) == ['comp1_c1_seq1\\tmitofinder\\tgene\\t100\\t200\\t.\\t+\\t.\\tgene_id \\\"c1_seq1\\\"; transcript_id \\\"comp1_c1_seq1\\\"; gene_name \\\"MT_comp1_c1_seq1_... | {
"split": "train",
"index": 66445,
"acecode_id": "bigcode_python_fns_2436",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two floating-point numbers f1 and f2, and a list of points p, your task is to compute a series of coordinates based on the points provided. Each point in the list p is a 2D coordinate represented as a tuple (x, y). Starting from an index i0, for ncv iterations, you need t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_coordinates(1.0, 2.0, [(1, 2), (3, 4), (5, 6), (7, 8)], 1, 1) == [' 2.00 4.00 2.00 4.00 2.00 4.00 rcurveto']\", \"assert generate_coordinates(0.5, 1.5, [(0, 0), (1, 1), (2, 2)], 1, 2) == [' 0.50 1.50 0.50 1.50 0.50 1.50 rcurveto', ' 0.50 1.50 0.50 1... | {
"split": "train",
"index": 66446,
"acecode_id": "bigcode_python_fns_48777",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a list of transactions where each transaction is represented as a dictionary containing the keys 'type', 'ticker', 'amount', and 'date'. The 'type' is either 'buy' or 'sell'. You need to write a function that checks if the first transaction in the list is a 'sell'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_first_transaction([{'type': 'buy', 'ticker': 'AAPL', 'amount': 10, 'date': '2023-01-01'}]) == True\", \"assert check_first_transaction([{'type': 'buy', 'ticker': 'GOOGL', 'amount': 5, 'date': '2023-01-02'}, {'type': 'sell', 'ticker': 'GOOGL', 'amount':... | {
"split": "train",
"index": 66447,
"acecode_id": "bigcode_python_fns_971",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a simple library management system where you can manage the addition and removal of books. Create a function `manage_library(max_books, operations)` that takes an integer `max_books` representing the maximum number of books allowed in the library,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_library(3, [('add', 'Book1'), ('add', 'Book2'), ('add', 'Book3')]) == ['Book1', 'Book2', 'Book3']\", \"assert manage_library(2, [('add', 'Book1'), ('add', 'Book2'), ('remove', 'Book1')]) == ['Book2']\", \"assert manage_library(1, [('add', 'Book1'), ('... | {
"split": "train",
"index": 66448,
"acecode_id": "oss_16503",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that parses a Well Known Text (WKT) string and returns a simplified representation of the geometry it represents as a string. The WKT format is used to represent geometric objects such as points, lines, and polygons. Your function sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert readWKT('POINT (1 2)') == 'POINT (1 2)'\", \"assert readWKT('LINESTRING (1 2, 3 4)') == 'LINESTRING (1 2, 3 4)'\", \"assert readWKT('POLYGON ((0 0, 0 1, 1 1, 1 0, 0 0))') == 'POLYGON ((0 0, 0 1, 1 1, 1 0, 0 0))'\", \"assert readWKT('POINT (5 10)') == 'POINT ... | {
"split": "train",
"index": 66449,
"acecode_id": "oss_17302",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that takes a list of integers and returns a new list containing only the unique elements from the input list, preserving the original order. Your function should ignore all duplicate values while maintaining the first occurrence of each un... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_elements([1, 2, 3, 2, 1, 4]) == [1, 2, 3, 4]\", \"assert unique_elements([5, 5, 5, 5, 5]) == [5]\", \"assert unique_elements([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert unique_elements([]) == []\", \"assert unique_elements([10]) == [10]\", \"asser... | {
"split": "train",
"index": 66450,
"acecode_id": "bigcode_python_fns_22308",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, write a function that finds the minimum sum of five negative numbers in that array. If the array contains fewer than five negative numbers, the function should raise a ValueError. Implement the function `min_sum_of_five(arr)` where `arr` is the input... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert min_sum_of_five([-5, -4, -3, -2, -1, 0, 1]) == -15\", \"assert min_sum_of_five([1, 2, 3, 4, 5, -1, -2, -3, -4, -5]) == -15\", \"assert min_sum_of_five([-1, -1, -1, -1, -1, -1]) == -5\", \"assert min_sum_of_five([-7, -5, -3, -1, -2]) == -18\", \"assert min_su... | {
"split": "train",
"index": 66451,
"acecode_id": "evol_35329",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, implement a function that removes all elements from the list and returns the empty list. The function should modify the original list in-place and return it.\nPlease reason step by step, then write a self-contained Python solution. Give your final progr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert clear_list(['item1', 'item2', 'item3']) == []\", \"assert clear_list(['apple', 'banana', 'cherry']) == []\", \"assert clear_list(['cat', 'dog']) == []\", \"assert clear_list(['one', 'two', 'three', 'four']) == []\", \"assert clear_list([]) == []\", \"assert ... | {
"split": "train",
"index": 66452,
"acecode_id": "evol_869",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function called `ignore_exceptions` that executes a given function while ignoring specific exceptions. The function should take a list of exception types to ignore and a callable (function) to execute. If the callable raises any of the specifi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert ignore_exceptions([KeyError], lambda: {'a': 1}['b']) is None\", \"assert ignore_exceptions([TypeError], lambda: [1] + '2') is None\", \"assert ignore_exceptions([ImportError], lambda: __import__('non_existent_module')) is None\", \"assert ignore_exceptions([... | {
"split": "train",
"index": 66453,
"acecode_id": "oss_36917",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple authentication system using Python. Your goal is to create a function that takes a password, a salt, and a stored hash as input. The function should hash the provided password using the provided salt and then compare the resulting hash ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert authenticate_user('wrongpassword', 'random_salt', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8') == False\", \"assert authenticate_user('password123', 'wrong_salt', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8') == False\", \"assert authenticate_user('', 'random_s... | {
"split": "train",
"index": 66454,
"acecode_id": "oss_6833",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given an integer array, your task is to find all the different possible increasing subsequences of the given array, where the length of an increasing subsequence should be at least 2. Each subsequence should be returned along with its sum in a tuple format. The output should be... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert findSubsequences([1, 1, 2]) == [([1, 1], 2), ([1, 2], 3), ([1, 1, 2], 4)]\", \"assert findSubsequences([3, 2, 1]) == []\", \"assert findSubsequences([10, 9, 8, 7]) == []\", \"assert findSubsequences([-1, -2, -3, -4]) == []\", \"assert findSubsequences([1, 1,... | {
"split": "train",
"index": 66455,
"acecode_id": "evol_27637",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers, determine if it is possible to swap elements between the two lists such that the first list contains only even numbers while maintaining the same total sum of both lists. Return 'YES' if such a swap exists, otherwise return 'NO'. You can swap any nu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert exchange([1, 3, 5], [2, 4, 6]) == 'NO'\", \"assert exchange([1, 2], [3, 4]) == 'NO'\", \"assert exchange([2, 2, 2], [3, 5, 7]) == 'NO'\", \"assert exchange([3, 7], [2, 4]) == 'NO'\", \"assert exchange([4, 6], [1, 3]) == 'YES'\", \"assert exchange([1, 1, 1], ... | {
"split": "train",
"index": 66456,
"acecode_id": "evol_3963",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing a binary mask where 0 represents a white cell and any positive integer represents a non-white cell, write a function to find the lengths of contiguous segments of non-white cells. The function should return a list of integers representing t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_non_white_lengths([0, 1, 2, 0, 3, 4, 0]) == [2, 2]\", \"assert find_non_white_lengths([0, 0, 0, 0]) == []\", \"assert find_non_white_lengths([1, 2, 0, 0, 3, 4]) == [2, 2]\", \"assert find_non_white_lengths([0, 1, 0]) == [1]\", \"assert find_non_white_le... | {
"split": "train",
"index": 66457,
"acecode_id": "bigcode_python_fns_1054",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the adjusted learning rate based on a stepwise exponential-decay policy. The function should take in four parameters: `base_lr` (a float representing the initial learning rate), `curr_iter` (an integer representing the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert adjust_learning_rate(0.1, 0, [10, 20, 30], 5) == 0.0\", \"assert adjust_learning_rate(0.1, 3, [10, 20, 30], 5) == 0.06\", \"assert adjust_learning_rate(0.1, 5, [10, 20, 30], 5) == 0.1\", \"assert adjust_learning_rate(0.1, 7, [10, 20, 30], 5) == 0.1\", \"asse... | {
"split": "train",
"index": 66458,
"acecode_id": "bigcode_python_fns_18144",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of buildings in a skyline. Your task is to implement a function `max_height(buildings: List[int]) -> int` that returns the maximum height among these buildings. The input list will contain at least one building height an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_height([3, 1, 4, 1, 5, 9]) == 9\", \"assert max_height([1, 2, 3, 4, 5]) == 5\", \"assert max_height([5, 5, 5, 5]) == 5\", \"assert max_height([0]) == 0\", \"assert max_height([10, 20, 30, 40, 50]) == 50\", \"assert max_height([100, 200, 300]) == 300\", \... | {
"split": "train",
"index": 66459,
"acecode_id": "bigcode_python_fns_11522",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of integers, `list1` and `list2`, both of the same length. Your task is to create a function `merge_and_sort(list1: List[int], list2: List[int]) -> List[int]` that merges these two lists into one and returns a sorted list containing all unique integers f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_and_sort([3, 1, 2], [4, 1, 5]) == [1, 2, 3, 4, 5]\", \"assert merge_and_sort([1, 2, 2, 3], [3, 4, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert merge_and_sort([5, 6, 7], [5, 6, 7]) == [5, 6, 7]\", \"assert merge_and_sort([], [1, 2, 3]) == [1, 2, 3]\", \"assert... | {
"split": "train",
"index": 66460,
"acecode_id": "bigcode_python_fns_27126",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves the unique food truck locations in a city on a specified day. The input will be a dictionary containing the coordinates of a given address (with keys 'x' and 'y') and a list of food trucks available in the city today. Each ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_truck_locations({'x': 1, 'y': 2}, [{'attributes': {'Day': 'Monday', 'Name': 'Truck A', 'Location': {'x': 1, 'y': 2}}}, {'attributes': {'Day': 'Monday', 'Name': 'Truck B', 'Location': {'x': 3, 'y': 4}}}, {'attributes': {'Day': 'Tuesday', 'Name': 'T... | {
"split": "train",
"index": 66461,
"acecode_id": "bigcode_python_fns_15608",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a list of ingredients and a list of allergens. Your task is to determine if any of the allergens are present in the list of ingredients. Return a list of allergens that are found in the ingredients. If no allergens are found, return an empty list. The allergens an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_allergens(['milk', 'eggs', 'bread'], ['milk', 'peanuts', 'soy']) == ['milk']\", \"assert find_allergens(['apple', 'banana', 'orange'], ['grapes', 'kiwi', 'mango']) == []\", \"assert find_allergens(['wheat', 'soy', 'fish'], ['fish', 'shellfish', 'peanuts... | {
"split": "train",
"index": 66462,
"acecode_id": "bigcode_python_fns_11636",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that resolves package dependencies while excluding certain packages during installation. You are given two lists: `DEPENDENCIES`, which contains the names of required packages, and `EXCLUDED_PACKAGES`, which contains the names of packages... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert resolve_dependencies(['numpy', 'pandas', 'scikit-learn'], ['tests', 'examples']) == ['numpy', 'pandas', 'scikit-learn']\", \"assert resolve_dependencies(['numpy', 'pandas'], ['numpy']) == ['pandas']\", \"assert resolve_dependencies(['matplotlib', 'seaborn', ... | {
"split": "train",
"index": 66463,
"acecode_id": "oss_15063",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a date in the format 'YYYY-MM-DD', implement a function that returns a string representing the date in the format 'Month Day, Year', where 'Day' is suffixed with the appropriate ordinal indicator (1st, 2nd, 3rd, 4th, etc.). For example, if the input ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_date('2023-01-01') == 'January 1st, 2023'\", \"assert format_date('2023-02-02') == 'February 2nd, 2023'\", \"assert format_date('2023-03-03') == 'March 3rd, 2023'\", \"assert format_date('2023-04-04') == 'April 4th, 2023'\", \"assert format_date('2023... | {
"split": "train",
"index": 66464,
"acecode_id": "bigcode_python_fns_3019",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `requests_generator()` that generates numbers from 0 to n-1, where n is a given integer. The function should use a generator to yield numbers one at a time instead of returning a list. This approach should be efficient in terms of memory usage, especially f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert list(requests_generator(1)) == [0]\", \"assert list(requests_generator(5)) == [0, 1, 2, 3, 4]\", \"assert list(requests_generator(10)) == [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\", \"assert list(requests_generator(0)) == []\", \"assert list(requests_generator(2)) == ... | {
"split": "train",
"index": 66465,
"acecode_id": "evol_35907",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the state of a climate control system for a single zone. The function should accept the following parameters: `hvac` (a string representing the current HVAC mode), `current_temp` (a float representing the current temperatur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert climate_state('auto', 22.5, 24.0, 'home', 'cooling') == {'hvac': 'auto', 'current_temperature': 22.5, 'max_temp': 30.0, 'min_temp': 15.0, 'temperature': 24.0, 'hvac_action': 'cooling', 'preset_mode': 'home', 'hvac_modes': ['off', 'auto', 'fan_only', 'cool']}... | {
"split": "train",
"index": 66466,
"acecode_id": "bigcode_python_fns_14547",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that accepts a list of fruit preferences and returns a dictionary that counts the occurrences of each fruit. The input will be a list of strings where each string represents a fruit. The output should be a dictionary where the keys are th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_fruits(['apple', 'banana', 'apple']) == {'apple': 2, 'banana': 1}\", \"assert count_fruits(['orange', 'banana', 'orange', 'kiwi']) == {'orange': 2, 'banana': 1, 'kiwi': 1}\", \"assert count_fruits(['grape', 'grape', 'grape']) == {'grape': 3}\", \"asser... | {
"split": "train",
"index": 66467,
"acecode_id": "bigcode_python_fns_38876",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing the heights of a series of buildings, write a function `max_water_trapped(heights: List[int]) -> int` that calculates the maximum amount of water that can be trapped between the buildings after a rain. The water trapped on top of a building... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_water_trapped([0,1,0,2,1,0,1,3,2,1,2,1]) == 6\", \"assert max_water_trapped([4,2,0,3,2,5]) == 9\", \"assert max_water_trapped([1,0,2]) == 1\", \"assert max_water_trapped([2,0,2]) == 2\", \"assert max_water_trapped([1,1,1,1]) == 0\", \"assert max_water_tr... | {
"split": "train",
"index": 66468,
"acecode_id": "bigcode_python_fns_37318",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates basic banking operations. Your function should be able to process a series of transactions on a bank account. The function should take an initial balance and a list of transactions as input, and it should return the fin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bank_account_operations(100.0, [('deposit', 50.0), ('withdraw', 30.0)]) == 120.0\", \"assert bank_account_operations(0.0, [('deposit', 100.0), ('withdraw', 50.0)]) == 50.0\", \"assert bank_account_operations(50.0, [('withdraw', 25.0), ('withdraw', 30.0)]) ==... | {
"split": "train",
"index": 66469,
"acecode_id": "oss_6957",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that checks whether a specific value 'k' is present within a nested tuple structure. The function should return True if 'k' is found in any level of the nested tuples, and False otherwise. The function signature is: def find_key_in_tuple(tuple_input: tup... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_key_in_tuple((1, 2, (3, 4), (5, (6, 7))), 4) == True\", \"assert find_key_in_tuple((1, 2, (3, 4), (5, (6, 7))), 8) == False\", \"assert find_key_in_tuple((('a', 'b'), ('c', 'd')), 'c') == True\", \"assert find_key_in_tuple(((1, 2), (3, (4, (5, 6)))), 5)... | {
"split": "train",
"index": 66470,
"acecode_id": "evol_22760",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a pipeline configuration in a specific format. Your task is to parse this string and extract the configuration details and the name of the meta architecture used in the pipeline. The configuration string is structured as a series of key-value... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_pipeline_config('learning_rate:0.01,meta_arch:my_model,steps:1000') == ({'learning_rate': '0.01', 'meta_arch': 'my_model', 'steps': '1000'}, 'my_model')\", \"assert parse_pipeline_config('batch_size:32,steps:5000') == ({'batch_size': '32', 'steps': '50... | {
"split": "train",
"index": 66471,
"acecode_id": "bigcode_python_fns_947",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of mixed data types, where some elements may be integers, floats, strings, or None. Write a function `is_na(data)` that returns a list of boolean values indicating whether each corresponding element in the input list is considered 'NaN' (i.e., None or a str... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_na([1, 2, None, 4.5, '', 'text']) == [False, False, True, False, True, False]\", \"assert is_na([None, None, None]) == [True, True, True]\", \"assert is_na(['', 'a', 'b', '', None]) == [True, False, False, True, True]\", \"assert is_na([1, 0, -1, None]) =... | {
"split": "train",
"index": 66472,
"acecode_id": "bigcode_python_fns_43997",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes in two parameters: a string representing a directory path and a string representing an environment name. The function should return a dictionary with the keys 'datadir' and 'env_name'. The value for 'datadir' should be the inpu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_args('/path/to/data', 'simulation_env') == {'datadir': '/path/to/data', 'env_name': 'simulation_env'}\", \"assert create_args('/another/path', 'test_env') == {'datadir': '/another/path', 'env_name': 'test_env'}\", \"assert create_args('/empty/path', '... | {
"split": "train",
"index": 66473,
"acecode_id": "bigcode_python_fns_4337",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves FOMC statements based on a given date or a list of dates. The function should accept a date in the format 'YYYY-MM-DD', or the strings 'current' or 'previous'. The function should return the statement for the specified date... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fomc_statement('2023-10-25') == 'Statement for 2023-10-25'\", \"assert fomc_statement('2023-09-20') == 'Statement for 2023-09-20'\", \"assert fomc_statement('2023-10-01') == 'Statement not available'\", \"assert fomc_statement('2023-08-01') == 'Statement not... | {
"split": "train",
"index": 66474,
"acecode_id": "bigcode_python_fns_48673",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a data validation function for a data science library. The function should validate that two dataframes, represented by simple dictionaries, match a specific structure. Your function should: 1. Accept two dictionaries, `read_dataframe` and `writ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_dataframe({'id': 1, 'df_type': 'dask'}, {'id': 1, 'df_type': 'dask'}) is None\", \"assert validate_dataframe({'id': 1, 'df_type': 'dask'}, {'id': 1, 'df_type': 'dask'}) is None\", \"assert validate_dataframe({'id': 3, 'df_type': 'dask'}, {'id': 3, '... | {
"split": "train",
"index": 66475,
"acecode_id": "oss_33541",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `find_max_sum(arr)` that returns the maximum sum of any two distinct elements in the list. The function should not use nested loops to iterate through the list. If the list contains fewer than two elements, the function should return 0... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max_sum([1, 2, 3, 4, 5]) == 9\", \"assert find_max_sum([-1, -2, -3, -4]) == -3\", \"assert find_max_sum([10, 20, 30]) == 50\", \"assert find_max_sum([-10, 0, 10]) == 10\", \"assert find_max_sum([5]) == 0\", \"assert find_max_sum([]) == 0\", \"assert fin... | {
"split": "train",
"index": 66476,
"acecode_id": "evol_31129",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes an array of integers and returns a new array containing only the unique values from the input array, preserving the order of their first occurrence. For example, given the input [1, 2, 2, 3, 1, 4], the output should be [1, 2, 3, 4].\nPlease reason st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_elements([1, 2, 2, 3, 1, 4]) == [1, 2, 3, 4]\", \"assert unique_elements([5, 5, 5, 5]) == [5]\", \"assert unique_elements([1, 2, 3]) == [1, 2, 3]\", \"assert unique_elements([]) == []\", \"assert unique_elements([1, 2, 2, 1, 3, 4, 4]) == [1, 2, 3, 4]\... | {
"split": "train",
"index": 66477,
"acecode_id": "evol_34298",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing a sequence of numbers. Your task is to implement a function that extracts four specific values from this list based on their indices: the first value at index 1, the second value at index 2, the third value at index 3, and the fourt... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_values([10, 20, 30, 40, 50]) == (20, 30, 40, 50)\", \"assert extract_values([1, 2, 3, 4, 5]) == (2, 3, 4, 5)\", \"assert extract_values([5]) == (None, None, None, None)\", \"assert extract_values([]) == (None, None, None, None)\", \"assert extract_va... | {
"split": "train",
"index": 66478,
"acecode_id": "bigcode_python_fns_147",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a file name, implement a function that checks if the file name has a '.fastq' suffix. If it does, return True; otherwise, return False. The function should only check the suffix and should not create any files or interact with the file system. Write ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_fastq_file('example.fastq') == True\", \"assert is_fastq_file('example.txt') == False\", \"assert is_fastq_file('data.fastq.gz') == False\", \"assert is_fastq_file('myfile.fastq') == True\", \"assert is_fastq_file('test.fastq') == True\", \"assert is_fast... | {
"split": "train",
"index": 66479,
"acecode_id": "bigcode_python_fns_9696",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string `str` containing only lowercase English letters. Your task is to write a function `duplicateChars` that takes in the string `str` and returns a new string where each character in the original string is duplicated. For example, if the input string is 'abc'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert duplicateChars('hello') == 'hheelllloo'\", \"assert duplicateChars('abc') == 'aabbcc'\", \"assert duplicateChars('') == ''\", \"assert duplicateChars('a') == 'aa'\", \"assert duplicateChars('xyz') == 'xxyyzz'\", \"assert duplicateChars('openai') == 'ooppeenn... | {
"split": "train",
"index": 66480,
"acecode_id": "oss_13845",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, where each string represents a movie title. Your task is to filter the list to return only the titles that contain the word 'movie' (case-insensitive). Implement a function called 'filter_movies' that takes a list of strings as input and returns... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_movies(['The best movie ever', 'A great film', 'movie night', 'Documentary']) == ['The best movie ever', 'movie night']\", \"assert filter_movies(['Just another movie', 'Something else', 'Another one']) == ['Just another movie']\", \"assert filter_mov... | {
"split": "train",
"index": 66481,
"acecode_id": "bigcode_python_fns_2170",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of posts associated with various providers and returns a specific data structure. Write a Python function `generate_provider_data` that takes a list of dictionaries as an argument, where each dictionary repres... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_provider_data([{'provider': 'A', 'script_ex_day': '2023-01-01'}, {'provider': 'B', 'script_ex_day': '2023-01-02'}, {'provider': 'A', 'script_ex_day': '2023-01-03'}]) == [{'count': 2, 'provider': 'A', 'last': '2023-01-03'}, {'count': 1, 'provider': '... | {
"split": "train",
"index": 66482,
"acecode_id": "oss_36238",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of numeric values representing the scores of two different groups of participants in a study. Write a function `calculate_score_difference(scores_a: List[float], scores_b: List[float]) -> Tuple[float, float, int, int]` that calculates the following stati... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_score_difference([1.0, 2.0, 3.0], [1.0, 2.0, 3.0]) == (0.0, 2.0, 2.0, 3, 3)\", \"assert calculate_score_difference([float('nan'), 4.0], [3.0, 5.0]) == (0.0, 4.0, 4.0, 1, 2)\", \"assert calculate_score_difference([5.0, 6.0, 7.0], [float('nan'), 6.0,... | {
"split": "train",
"index": 66483,
"acecode_id": "bigcode_python_fns_25251",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of rectangles represented by their top-left and bottom-right corners. Each rectangle is defined by a list of four integers [x1, y1, x2, y2], where (x1, y1) is the top-left corner and (x2, y2) is the bottom-right corner. Write a function `find_closest_rec... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_closest_rectangles([[0,0,2,2],[1,1,3,3]], [[2,2,4,4],[0,0,1,1]]) == [1, 0]\", \"assert find_closest_rectangles([], [[1,1,2,2]]) == []\", \"assert find_closest_rectangles([[0,0,1,1]], []) == [-1]\", \"assert find_closest_rectangles([[0,0,1,1]], [[1,1,2,2... | {
"split": "train",
"index": 66484,
"acecode_id": "bigcode_python_fns_13133",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing interaction types between a ligand and a protein. Each integer corresponds to a specific type of interaction as follows: 0 for hydrophobic contacts, 1 for aromatic face-to-face interactions, 2 for aromatic edge-to-face interactions,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_interactions([0, 1, 2, 0, 3, 3, 5, 6, 0]) == [3, 1, 1, 2, 0, 1, 1, 0]\", \"assert count_interactions([]) == [0, 0, 0, 0, 0, 0, 0, 0]\", \"assert count_interactions([1, 1, 1, 1]) == [0, 4, 0, 0, 0, 0, 0, 0]\", \"assert count_interactions([4, 4, 4, 4]) =... | {
"split": "train",
"index": 66485,
"acecode_id": "bigcode_python_fns_45431",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `sum_primes(N)` that takes a non-negative integer N as input and returns the sum of all prime numbers from 0 to N. The function should handle erroneous inputs by returning an appropriate error message if the input is not a non-negative integer. Implement the fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_primes(10) == 17\", \"assert sum_primes(0) == 0\", \"assert sum_primes(1) == 0\", \"assert sum_primes(2) == 2\", \"assert sum_primes(3) == 5\", \"assert sum_primes(4) == 5\", \"assert sum_primes(5) == 10\", \"assert sum_primes(11) == 28\", \"assert sum_p... | {
"split": "train",
"index": 66486,
"acecode_id": "evol_29270",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `penultimate_highest(numbers)` that takes a list of integers as input and returns the second largest unique number in the list. If there are fewer than two unique numbers, the function should return None.\nPlease reason step by step, then write a self-contained... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert penultimate_highest([10, 12, 2, 8, 6, 4]) == 10\", \"assert penultimate_highest([1, 3, 3, 2]) == 2\", \"assert penultimate_highest([5]) == None\", \"assert penultimate_highest([1, 1, 1, 1]) == None\", \"assert penultimate_highest([2, 3, 5, 1, 3]) == 3\", \"a... | {
"split": "train",
"index": 66487,
"acecode_id": "evol_26193",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings where each string represents an admin user in the format 'username:password', write a function `get_admin_usernames(admin_password_list: List[str]) -> List[str]` that returns a list of unique usernames extracted from the input list. If a username is prov... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_admin_usernames(['alice:secret', 'bob:1234', 'charlie:pass']) == ['alice', 'bob', 'charlie']\", \"assert get_admin_usernames(['alice:secret', 'bob:1234', 'alice:password']) == ['alice', 'bob']\", \"assert get_admin_usernames(['admin:admin', 'user1', 'use... | {
"split": "train",
"index": 66488,
"acecode_id": "bigcode_python_fns_42222",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a circle defined by its center (xc, yc) and radius r, and a unit pixel whose center is at (x, y), write a function that computes the fraction of the unit pixel that is interior to the circle. The unit pixel has a length of 1 for its sides, meaning its corners are at (x-0.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert abs(pixwt(0, 0, 1, 0, 0) - 1.0) < 1e-9\", \"assert abs(pixwt(0, 0, 1, 0, 1) - 0.785398163) < 1e-9\", \"assert abs(pixwt(0, 0, 1, -1, 0) - 0.785398163) < 1e-9\", \"assert abs(pixwt(0, 0, 1, 0, -1) - 0.785398163) < 1e-9\", \"assert abs(pixwt(1, 1, 1, 1, 1) - 1... | {
"split": "train",
"index": 66489,
"acecode_id": "bigcode_python_fns_40972",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes a list of integers and a target number. The function should find all unique combinations of three numbers in the list that add up to the target number. The combinations must not include any repeating numbers from the list. The function should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert three_sum([0, 0, 0, 0], 0) == [[0, 0, 0]]\", \"assert three_sum([], 0) == []\", \"assert three_sum([1, 1, 1, 1, 1], 3) == [[1, 1, 1]]\", \"assert three_sum([4, 5, 6, 7], 20) == []\", \"assert three_sum([1, 2, 3], 6) == [[1, 2, 3]]\", \"assert three_sum([10, ... | {
"split": "train",
"index": 66490,
"acecode_id": "evol_33916",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function `authenticate_user(identity: str, key: str) -> bool` that verifies if the provided user identity and authentication key match the pre-defined correct credentials. The correct credentials are: identity is 'admin' and key is 'password123'. Return True if both... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert authenticate_user('admin', 'password123') == True\", \"assert authenticate_user('admin', 'wrongpassword') == False\", \"assert authenticate_user('user', 'password123') == False\", \"assert authenticate_user('admin', '') == False\", \"assert authenticate_user... | {
"split": "train",
"index": 66491,
"acecode_id": "evol_25729",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of bounding box detections, where each detection is represented as an array of the format [x, y, w, h, box_confidence, class_id, class_prob]. Your task is to implement a function `keep_bounding_boxes(detections: List[List[float]], nms_threshold: float) -> L... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert keep_bounding_boxes([[0, 0, 10, 10, 0.8, 1, 0.8], [5, 5, 10, 10, 0.9, 1, 0.9]], 0.3) == [1, 0]\", \"assert keep_bounding_boxes([[0, 0, 10, 10, 0.6, 1, 0.6], [0, 0, 10, 10, 0.5, 1, 0.5], [0, 0, 10, 10, 0.4, 1, 0.4]], 0.7) == [0]\", \"assert keep_bounding_boxe... | {
"split": "train",
"index": 66492,
"acecode_id": "bigcode_python_fns_8661",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function `binary_search(lst: List[int], target: int) -> int` that takes a sorted list of integers `lst` and an integer `target`. The function should return the index of `target` in `lst` if it exists, otherwise return -1. You must use the binary search algorithm to ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"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([10, 20, 30, 40, 50], 20) == 1\", \"ass... | {
"split": "train",
"index": 66493,
"acecode_id": "evol_22419",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a dictionary containing information about host groups and event IDs. The function should extract the host group and event ID from the dictionary and return them as a formatted string. Specifically, you need to cr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_host_event({'host_group': 'web_servers', 'eventid': '12345'}) == 'Host Group: web_servers, Event ID: 12345'\", \"assert format_host_event({'host_group': 'database_servers', 'eventid': '54321'}) == 'Host Group: database_servers, Event ID: 54321'\", \"a... | {
"split": "train",
"index": 66494,
"acecode_id": "oss_34934",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, implement a function that returns the maximum sum of any contiguous subarray. A contiguous subarray is defined as a subarray that consists of sequential elements from the original array. You can assume the array will contain at least one element.\nPl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_sum_path([-1, -2, -3, -4]) == -1\", \"assert max_sum_path([1, 2, 3, 4]) == 10\", \"assert max_sum_path([-2, -1, 0, 1]) == 1\", \"assert max_sum_path([0, 0, 0, 0]) == 0\", \"assert max_sum_path([5, -3, 5]) == 7\", \"assert max_sum_path([1]) == 1\", \"asse... | {
"split": "train",
"index": 66495,
"acecode_id": "evol_1254",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function `perfect_square_counter(startnum: int, endnum: int) -> int` that counts the numbers within the range from `startnum` to `endnum` (inclusive) that are both perfect squares and have a digit sum that is also a perfect square. The function should be able to han... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert perfect_square_counter(0, 0) == 1\", \"assert perfect_square_counter(4, 16) == 2\", \"assert perfect_square_counter(25, 36) == 1\", \"assert perfect_square_counter(50, 100) == 2\", \"assert perfect_square_counter(-25, -1) == 0\", \"assert perfect_square_coun... | {
"split": "train",
"index": 66496,
"acecode_id": "evol_9438",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function that computes the square root of a given positive number using Newton's method. The function should take a single argument, `n`, which is the number for which the square root needs to be calculated, and return the square root value. If `n` is less than 0, t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sqrt_newton(0) == 0.0\", \"assert sqrt_newton(4) == 2.0\", \"assert sqrt_newton(9) == 3.0\", \"assert sqrt_newton(25) == 5.0\", \"assert sqrt_newton(36) == 6.0\", \"assert sqrt_newton(49) == 7.0\", \"assert sqrt_newton(100) == 10.0\", \"assert sqrt_newton(3)... | {
"split": "train",
"index": 66497,
"acecode_id": "evol_27938",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function `get_current_directory()` that returns a string representing the current working directory for a hypothetical file system. The function should not take any parameters and should return a predefined path. The function is intended to simulate retrieving the c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_current_directory() == '/user/home/project'\", \"assert get_current_directory() == '/user/home/project'\", \"assert get_current_directory() == '/user/home/project'\", \"assert get_current_directory() == '/user/home/project'\", \"assert get_current_direct... | {
"split": "train",
"index": 66498,
"acecode_id": "bigcode_python_fns_46873",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `get_gmail_addresses(text: str) -> List[str]` that takes a string containing various email addresses and returns a list of email addresses that specifically belong to the domain 'gmail.com'. The email addresses should be extracted using a regular expression... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_gmail_addresses('user1@gmail.com user2@yahoo.com user3@gmail.com') == ['user1@gmail.com', 'user3@gmail.com']\", \"assert get_gmail_addresses('test.email@gmail.com') == ['test.email@gmail.com']\", \"assert get_gmail_addresses('no_gmail_here@outlook.com') ... | {
"split": "train",
"index": 66499,
"acecode_id": "evol_35042",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.