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 an array of words and a string, implement a function that finds the shortest word in the array that is a substring of the string. If multiple words have the same minimum length, return the one that comes first in lexicographical order. If no words are found, return None.\... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shortest_substring(['hello', 'world', 'python'], 'programmingisfun') == None\", \"assert shortest_substring(['cat', 'dog', 'bat'], 'thecatandthehat') == 'cat'\", \"assert shortest_substring(['quick', 'brown', 'fox', 'jumps'], 'aquickbrownfoxjumpsoverthelazyd... | {
"split": "train",
"index": 74300,
"acecode_id": "evol_3542",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given an integer representing the state of a door. The door can either be open or closed. Your task is to implement a function `is_door_open(state: int) -> bool` that returns `True` if the door is open and `False` if it is closed. A door is considered open if its state ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_door_open(1) == True\", \"assert is_door_open(0) == False\", \"assert is_door_open(-1) == False\", \"assert is_door_open(2) == False\", \"assert is_door_open(10) == False\", \"assert is_door_open(-10) == False\", \"assert is_door_open(1) == True\", \"asse... | {
"split": "train",
"index": 74301,
"acecode_id": "bigcode_python_fns_8274",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `subtract_two_numbers(num1, num2)` that takes two numeric inputs, `num1` and `num2`, and returns their difference. If either `num1` or `num2` is not an integer or a float, the function should raise a TypeError with the message 'Both num1 and num2 must be ei... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert subtract_two_numbers(10, 5) == 5\", \"assert subtract_two_numbers(5.5, 2.5) == 3.0\", \"assert subtract_two_numbers(-3, -7) == 4\", \"assert subtract_two_numbers(0, 0) == 0\", \"assert subtract_two_numbers(100, 50) == 50\", \"assert subtract_two_numbers(10.1... | {
"split": "train",
"index": 74302,
"acecode_id": "evol_8895",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer 'a', write a function `inverse(a)` that computes the modular multiplicative inverse of 'a' under modulo 97. The modular multiplicative inverse of 'a' is an integer 'x' such that (a * x) % 97 = 1. If 'a' does not have an inverse under modulo 97, return -1. You c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert inverse(1) == 1\", \"assert inverse(2) == 49\", \"assert inverse(3) == 65\", \"assert inverse(4) == 73\", \"assert inverse(5) == 39\", \"assert inverse(7) == 14\", \"assert inverse(8) == 85\", \"assert inverse(14) == 7\"]}"
} | {
"split": "train",
"index": 74303,
"acecode_id": "bigcode_python_fns_5487",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given two sorted arrays of identical length, write a function that returns the median value of the combined elements from both arrays. The median is defined as the middle value in an ordered list. If the number of combined elements is even, return the average of the two middle ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert getMedian([1, 2], [3, 4]) == 2.5\", \"assert getMedian([1, 1, 1], [1, 1, 1]) == 1.0\", \"assert getMedian([10, 20], [30, 40]) == 25.0\", \"assert getMedian([-5, -3, -1], [-4, -2, 0]) == -3.0\", \"assert getMedian([10, 15, 25], [5, 20, 30]) == 15.0\", \"asser... | {
"split": "train",
"index": 74304,
"acecode_id": "evol_11514",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function `flip` that reverses the order of elements in a 2D list (matrix) along a specified axis. The function should take two parameters: `matrix`, a list of lists representing the 2D input array, and `axis`, which can be 0 or 1. If `axis` is 0, the function should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert flip([[1, 2], [3, 4]], 0) == [[3, 4], [1, 2]]\", \"assert flip([[1, 2], [3, 4]], 1) == [[2, 1], [4, 3]]\", \"assert flip([[1, 2], [3, 4]]) == [[4, 3], [2, 1]]\", \"assert flip([[1, 2, 3], [4, 5, 6]], 0) == [[4, 5, 6], [1, 2, 3]]\", \"assert flip([[1, 2, 3], ... | {
"split": "train",
"index": 74305,
"acecode_id": "bigcode_python_fns_15861",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of buildings in a skyline. Your task is to find the maximum area of a rectangle that can be formed by using consecutive buildings in the skyline. A rectangle's height is determined by the shortest building in the selecte... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert maxRectangleArea([]) == 0\", \"assert maxRectangleArea([1]) == 1\", \"assert maxRectangleArea([1, 2, 3, 4, 5]) == 9\", \"assert maxRectangleArea([5, 4, 3, 2, 1]) == 9\", \"assert maxRectangleArea([2, 1, 5, 6, 2, 3]) == 10\", \"assert maxRectangleArea([2, 4])... | {
"split": "train",
"index": 74306,
"acecode_id": "bigcode_python_fns_4727",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given an object, determine if it is an instance of the class `InputElement` or a subclass of `InputElement`. Implement a function `is_input_element(obj)` that takes a single argument `obj` and returns `True` if `obj` is an instance of `InputElement` or its subclass; otherwise, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_input_element(InputElement()) == True\", \"assert is_input_element(object()) == False\", \"assert is_input_element(123) == False\", \"assert is_input_element('string') == False\", \"assert is_input_element([]) == False\", \"assert is_input_element({}) == ... | {
"split": "train",
"index": 74307,
"acecode_id": "bigcode_python_fns_4420",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that updates a dictionary representing a comment using a given dictionary of updates. The function should take two parameters: a `comment` dictionary, which contains keys and values representing the attributes of the comment, and a `d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_comment({'id': 1, 'text': 'This is a comment.', 'author': 'User1'}, {'text': 'This is an updated comment.'}) == {'id': 1, 'text': 'This is an updated comment.', 'author': 'User1'}\", \"assert update_comment({'id': 2, 'text': 'Another comment.', 'autho... | {
"split": "train",
"index": 74308,
"acecode_id": "bigcode_python_fns_43495",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a command parser for a TURRIS:DONGLE, a device used for sending commands to various gadgets. The TURRIS:DONGLE accepts commands in the format 'ACTION TARGET [VALUE]', where ACTION is the operation to be performed, TARGET is the specific gadget o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert execute_command('GET SLOT:01') == 'SENDING: GET SLOT:01\\\\nREPLY: SLOT:01 [07473725]'\", \"assert execute_command('GET SLOT:02') == 'SENDING: GET SLOT:02\\\\nREPLY: SLOT:02 [07473725]'\", \"assert execute_command('GET DEVICE:03') == 'SENDING: GET DEVICE:03\... | {
"split": "train",
"index": 74309,
"acecode_id": "oss_26074",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `odd_sum_elements` that accepts a list of positive integers. This function should return a list of unique elements, sorted in ascending order, where the sum of their digits is an odd number. The output list must contain only unique elements and shoul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert odd_sum_elements([1, 2, 3, 4, 5]) == [1, 3, 5]\", \"assert odd_sum_elements([111, 222, 333, 444]) == [111, 333]\", \"assert odd_sum_elements([2, 4, 6, 8]) == []\", \"assert odd_sum_elements([21, 22, 23]) == [21, 23]\", \"assert odd_sum_elements([1, 1, 2, 2, ... | {
"split": "train",
"index": 74310,
"acecode_id": "evol_5936",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Write a function `to_camel_case(text: str) -> str` that transforms a given string with underscores into camelCase format. This involves removing all underscores and capitalizing the first letter of each word that follows an underscore, while keeping the first word in lowercase.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert to_camel_case('example_string') == 'exampleString'\", \"assert to_camel_case('singleword') == 'singleword'\", \"assert to_camel_case('first_second') == 'firstSecond'\", \"assert to_camel_case('_leading_underscore') == 'LeadingUnderscore'\", \"assert to_camel... | {
"split": "train",
"index": 74311,
"acecode_id": "evol_7140",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_prime(n: int) -> bool` that checks whether a given integer `n` is a prime number. A prime number is a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. Your function should return `True` if `n` is prime and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_prime(2) == True\", \"assert is_prime(3) == True\", \"assert is_prime(4) == False\", \"assert is_prime(5) == True\", \"assert is_prime(6) == False\", \"assert is_prime(7) == True\", \"assert is_prime(8) == False\", \"assert is_prime(9) == False\", \"asser... | {
"split": "train",
"index": 74312,
"acecode_id": "evol_4445",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are required to implement a function that checks if a given dictionary matches an expected structure. The expected dictionary should contain the following key-value pairs: 'subject' with value '*', 'session' with value '*', 'hemi' with value '*', and 'surf' with value '*'. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_varyings({'subject': '*', 'session': '*', 'hemi': '*', 'surf': '*'}) == True\", \"assert validate_varyings({'subject': '*', 'session': '*', 'hemi': '*', 'surf': 'x'}) == False\", \"assert validate_varyings({'subject': '*', 'session': 'y', 'hemi': '*... | {
"split": "train",
"index": 74313,
"acecode_id": "oss_18284",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing a dataset of news article popularity scores. Your task is to create a function that takes this list and splits it into two separate lists: one for training and one for validation. The training list should contain 80% of the scores, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert split_dataset([1, 2, 3, 4, 5]) == ([1, 2, 3, 4], [5])\", \"assert split_dataset([100]) == ([], [])\", \"assert split_dataset([5, 10, 15]) == ([], [])\", \"assert split_dataset([1, 2, 3]) == ([], [])\", \"assert split_dataset([]) == ([], [])\", \"assert split... | {
"split": "train",
"index": 74314,
"acecode_id": "bigcode_python_fns_49501",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You have an initial investment amount and a list of assets with their corresponding weights and prices. Your task is to calculate how many shares of each asset you can purchase and the total dollar value of those shares based on your initial investment. The weights represent th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calc_portfolio_holdings(1200, [0.5, 0.5], [15, 30]) == ([600.0, 600.0], [40, 20])\", \"assert calc_portfolio_holdings(1000, [1.0], [100]) == ([1000.0], [10])\", \"assert calc_portfolio_holdings(600, [0.1, 0.9], [60, 90]) == ([60.0, 540.0], [1, 6])\", \"asser... | {
"split": "train",
"index": 74315,
"acecode_id": "bigcode_python_fns_44126",
"num_tests": 9
} |
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 takes this list as input and returns a new list that contains only the ages that are considered as 'adults'. An age is considered an 'adult' if it is 18 years ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_adult_ages([15, 22, 17, 25, 30]) == [22, 25, 30]\", \"assert filter_adult_ages([10, 12, 14]) == []\", \"assert filter_adult_ages([18, 19, 20]) == [18, 19, 20]\", \"assert filter_adult_ages([21, 21, 21]) == [21, 21, 21]\", \"assert filter_adult_ages([1... | {
"split": "train",
"index": 74316,
"acecode_id": "oss_12300",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that determines if a given field can be nullable based on its properties. The function should take a dictionary representing a field and an integer indicating the OpenAPI major version. The function should return a dictionary with an entry... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_nullable_attributes({'allow_none': True}, 2) == {'x-nullable': True}\", \"assert get_nullable_attributes({'allow_none': True}, 3) == {'nullable': True}\", \"assert get_nullable_attributes({'allow_none': False}, 2) == {}\", \"assert get_nullable_attribute... | {
"split": "train",
"index": 74317,
"acecode_id": "bigcode_python_fns_40377",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a function decorator `wrap_keepdims(func)` that checks if the output of a function `func` has the same dimensions as its input, based on a boolean parameter `keepdims`. If `keepdims` is True, the output should have an additional dimension. Your task is to implemen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert apply_function_with_dims(sum, [1, 2, 3], False) == 6\", \"assert apply_function_with_dims(sum, [1, 2, 3], True) == [6]\", \"assert apply_function_with_dims(sum, [], True) == [0]\", \"assert apply_function_with_dims(sum, [], False) == 0\", \"assert apply_func... | {
"split": "train",
"index": 74318,
"acecode_id": "bigcode_python_fns_13529",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of video filenames and a configuration dictionary that contains Pinata credentials. The function should validate the credentials and pin each video file to IPFS using the provided credentials. If the credentials are vali... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pin_videos_to_ipfs([], {'pinata': {'pinata_api': 'api_key', 'pinata_secret_api': 'secret_key'}}) == []\", \"assert pin_videos_to_ipfs(['video.mp4'], {'pinata': {'pinata_api': '', 'pinata_secret_api': 'secret_key'}}) == []\", \"assert pin_videos_to_ipfs(['vid... | {
"split": "train",
"index": 74319,
"acecode_id": "bigcode_python_fns_21917",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a function that converts a measurement of pressure from different units (atmospheres, torr, or psi) to its equivalent in pascals. The function should take in two parameters: a float value representing the pressure measurement and a string representing the unit of the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_pascals(1, 'atm') == 101325\", \"assert convert_to_pascals(1, 'torr') == 133.322\", \"assert convert_to_pascals(1, 'psi') == 6894.76\", \"assert convert_to_pascals(0, 'atm') == 0\", \"assert convert_to_pascals(0, 'torr') == 0\", \"assert convert_t... | {
"split": "train",
"index": 74320,
"acecode_id": "evol_15826",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the lengths of chromosomes. You need to implement a function that replaces any integer value in the list that exceeds the corresponding chromosome length with None. The chromosome lengths are provided in a separate list, where the i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_exceeding_values([1, 2, 3, 4], [3, 2, 5, 1]) == [1, 2, 3, None]\", \"assert replace_exceeding_values([5], [5]) == [5]\", \"assert replace_exceeding_values([1, 2, 3, 4, 5], [5, 4, 3, 2, 1]) == [1, 2, 3, None, None]\", \"assert replace_exceeding_values... | {
"split": "train",
"index": 74321,
"acecode_id": "bigcode_python_fns_12793",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing a configuration for a server, which contains an 'ip_address' key. The value of 'ip_address' is a string that may contain the placeholder 'USER'. You are also given a username as a string. Your task is to write a function that replaces the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_user_placeholder({'ip_address': '192.168.1.USER'}, 'alice') == '192.168.1.alice'\", \"assert replace_user_placeholder({'ip_address': '10.0.0.USER'}, 'bob') == '10.0.0.bob'\", \"assert replace_user_placeholder({'ip_address': '172.16.0.USER'}, 'charlie... | {
"split": "train",
"index": 74322,
"acecode_id": "bigcode_python_fns_38567",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary that represents a contestant's information in a sporting event. Your task is to implement a function `get_contestant_info(contestant: dict) -> str` that takes this dictionary as input and returns a string describing the contestant's full name, age cla... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_contestant_info({'first_name': 'Cont', 'last_name': 'E.', 'ageclass': 'G 12 \\u00e5r', 'region': 'Oslo Skikrets'}) == 'Full Name: Cont E., Age Class: G 12 \\u00e5r, Region: Oslo Skikrets'\", \"assert get_contestant_info({'first_name': 'John', 'last_name'... | {
"split": "train",
"index": 74323,
"acecode_id": "bigcode_python_fns_16957",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that takes a list of strings, where each string represents a line from a FASTA index (FAI) file. Each line contains tab-separated values with the first value being the contig name and the second value being its length. Your goa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_fai(['contig1\\\\t1000', 'contig2\\\\t2000']) == {'contig1': 1000, 'contig2': 2000}\", \"assert parse_fai(['contigA\\\\t1500', 'contigB\\\\t3000', 'contigC\\\\t400']) == {'contigA': 1500, 'contigB': 3000, 'contigC': 400}\", \"assert parse_fai(['contigX... | {
"split": "train",
"index": 74324,
"acecode_id": "oss_37613",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `filter_numbers` that returns a new list containing only the integers that are strictly between 5 and 10 (exclusive).\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```pyth... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_numbers([1, 2, 3, 4]) == []\", \"assert filter_numbers([10, 11, 12, 13]) == []\", \"assert filter_numbers([6, 7, 8, 9]) == [6, 7, 8, 9]\", \"assert filter_numbers([5, 5, 5, 5]) == []\", \"assert filter_numbers([9, 10, 11, 12]) == [9]\", \"assert filte... | {
"split": "train",
"index": 74325,
"acecode_id": "evol_11535",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of integers, `segment` and `addition`. Your task is to combine them into one list according to the following rules: 1. If the last element of `segment` is equal to the first element of `addition`, append all elements of `addition` except the first one to... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert combine_segments([1, 2, 3], [3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert combine_segments([1, 2, 3], [5, 4, 3]) == [1, 2, 3, 4, 5]\", \"assert combine_segments([1, 2, 3], [5, 6, 7]) == []\", \"assert combine_segments([10, 20, 30], [30, 40, 50]) == [10, 20, 30, ... | {
"split": "train",
"index": 74326,
"acecode_id": "bigcode_python_fns_24528",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a function that performs a merge sort on a list of numbers. The input list may contain integers, floats, and negative values. Your function should also handle edge cases, such as an empty array or a single-element array. The function signature should be: `def merge_so... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_sort([]) == []\", \"assert merge_sort([1]) == [1]\", \"assert merge_sort([5.7, 2, 4.1, -6, 1, -7.4, 8]) == [-7.4, -6, 1, 2, 4.1, 5.7, 8]\", \"assert merge_sort([3, 1, 2]) == [1, 2, 3]\", \"assert merge_sort([10, -1, 0, 5.5]) == [-1, 0, 5.5, 10]\", \"as... | {
"split": "train",
"index": 74327,
"acecode_id": "evol_29926",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that handles authorization in a custom platform. The function `authorize_custom_platform` should take in two parameters: `authorization_type` (a string) and `secret_key` (also a string). The function should return a dictionary contain... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert authorize_custom_platform('custom', 'my_secret') == {'platform_type': 'custom', 'secret_key': 'my_secret'}\", \"assert authorize_custom_platform('custom', 'another_secret') == {'platform_type': 'custom', 'secret_key': 'another_secret'}\", \"assert authorize_... | {
"split": "train",
"index": 74328,
"acecode_id": "oss_26121",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a custom exception class `MovedIssueNotDefined` that inherits from the base `Exception` class. You also need to implement a method `get_moved_issue_reference` in a class `Issue` which will check if the `moved_to_id` attribute is defined. If `mov... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert Issue('ABC-123').get_moved_issue_reference() == 'ABC-123'\", \"assert Issue('XYZ-789').get_moved_issue_reference() == 'XYZ-789'\", \"assert Issue('DEF-456').get_moved_issue_reference() == 'DEF-456'\", \"assert Issue('GHI-012').get_moved_issue_reference() == ... | {
"split": "train",
"index": 74329,
"acecode_id": "oss_30338",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a string `text`, write a function `eliminate_spaces(text)` that removes all instances of multiple consecutive spaces and replaces them with a single space. The function should handle any number of consecutive spaces and return the cleaned-up string. You can assume that th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert eliminate_spaces('hello world how are you') == 'hello world how are you'\", \"assert eliminate_spaces(' leading spaces') == 'leading spaces'\", \"assert eliminate_spaces('trailing spaces ') == 'trailing spaces'\", \"assert eliminate_spaces(' multip... | {
"split": "train",
"index": 74330,
"acecode_id": "evol_32530",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string `s` consisting of lowercase English letters and an integer `k`. Your task is to write a function that takes the string `s` and the integer `k` as input and returns the final value of `nums` after performing the following operations `k` times:\n\n1. Conver... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert final_value(\\\"abc\\\", 2) == 6\", \"assert final_value(\\\"a\\\", 1) == 1\", \"assert final_value(\\\"abc\\\", 1) == 6\", \"assert final_value(\\\"ab\\\", 1) == 3\", \"assert final_value(\\\"cccc\\\", 1) == 12\", \"assert final_value(\\\"abcdefghij\\\", 2)... | {
"split": "train",
"index": 74331,
"acecode_id": "oss_22918",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the status of devices in a smart home system. A status of 0 means the device is off, and a status of 1 means the device is on. Your task is to implement a function that takes this list of statuses and returns the count of devices th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_on_devices([0, 1, 1, 0, 1]) == 3\", \"assert count_on_devices([1, 1, 1, 1, 1]) == 5\", \"assert count_on_devices([0, 0, 0, 0, 0]) == 0\", \"assert count_on_devices([1, 0, 0, 1, 0]) == 2\", \"assert count_on_devices([1]) == 1\", \"assert count_on_device... | {
"split": "train",
"index": 74332,
"acecode_id": "bigcode_python_fns_33691",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two sorted lists of numbers, write a function in Python to merge them into a single sorted list without any duplicate values. The function should return the merged list as a result.\nPlease reason step by step, then write a self-contained Python solution. Give your final ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_sorted_lists([1, 2, 3], [3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert merge_sorted_lists([], []) == []\", \"assert merge_sorted_lists([1, 3, 5], [2, 4, 6]) == [1, 2, 3, 4, 5, 6]\", \"assert merge_sorted_lists([5, 6, 7], [1, 2, 3]) == [1, 2, 3, 5, 6, 7]\", ... | {
"split": "train",
"index": 74333,
"acecode_id": "evol_14420",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that performs basic operations on a list of integers. Your function should take a list of integers as input and return a dictionary containing the following keys and their corresponding values: 'sum' (the sum of all integers in the list),... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_statistics([]) == {'sum': None, 'average': None, 'max': None, 'min': None}\", \"assert calculate_statistics([1]) == {'sum': 1, 'average': 1.0, 'max': 1, 'min': 1}\", \"assert calculate_statistics([1, 2, 3]) == {'sum': 6, 'average': 2.0, 'max': 3, '... | {
"split": "train",
"index": 74334,
"acecode_id": "oss_24773",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given the base and height of a triangle, implement a function that calculates the area of the triangle using the formula: area = 0.5 * base * height. Ensure that both base and height are greater than 0, and raise a ValueError if they are not. Define the function `triangle_area(... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert triangle_area(3, 4) == 6.0\", \"assert triangle_area(5, 10) == 25.0\", \"assert triangle_area(1, 1) == 0.5\", \"assert triangle_area(2.5, 4) == 5.0\", \"assert triangle_area(10, 20) == 100.0\", \"assert triangle_area(7, 3) == 10.5\", \"assert triangle_area(0... | {
"split": "train",
"index": 74335,
"acecode_id": "evol_3791",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that converts a specified hexadecimal value into its equivalent ASCII character. The function should take a string representing a hexadecimal value and return the corresponding ASCII character. The input will be a valid hexadecimal string that represents a sing... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hex_to_ascii('41') == 'A'\", \"assert hex_to_ascii('61') == 'a'\", \"assert hex_to_ascii('30') == '0'\", \"assert hex_to_ascii('7A') == 'z'\", \"assert hex_to_ascii('2B') == '+'\", \"assert hex_to_ascii('20') == ' '\", \"assert hex_to_ascii('21') == '!'\", \... | {
"split": "train",
"index": 74336,
"acecode_id": "evol_36245",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a function that retrieves metadata from a file based on an index. Your task is to implement a function called `load_array_metadata` that takes a list of tuples, where each tuple contains a filename and an index. The function should return a list of metadata corres... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert load_array_metadata([('file1.txt', 0), ('file2.txt', 1)]) == ['Metadata for file1.txt at index 0', 'Metadata for file2.txt at index 1']\", \"assert load_array_metadata([('file1.txt', 1), ('file2.txt', 0)]) == ['Metadata for file1.txt at index 1', 'Metadata f... | {
"split": "train",
"index": 74337,
"acecode_id": "bigcode_python_fns_10394",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with formatting a dialogue line for display. Write a function named `format_dialog` that takes three parameters: a string `line`, a string `speaker`, and a boolean `show_speaker`. If `show_speaker` is True, the function should return the speaker's name in title c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_dialog('Hello, how are you?', 'john doe', True) == 'John Doe: Hello, how are you?'\", \"assert format_dialog('Goodbye!', 'jane smith', True) == 'Jane Smith: Goodbye!'\", \"assert format_dialog('I am fine, thank you.', 'alice', False) == 'I am fine, th... | {
"split": "train",
"index": 74338,
"acecode_id": "bigcode_python_fns_13341",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a positive integer n, implement a function that returns the power set (all subsets) of its prime divisors, including the empty set. The function should take an integer n as input and return a list of lists representing all possible combinations of the prime divisors.\nPle... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert power_set_of_prime_divisors(50) == [[], [2], [5], [2, 5]]\", \"assert power_set_of_prime_divisors(28) == [[], [2], [7], [2, 7]]\", \"assert power_set_of_prime_divisors(1) == [[]]\", \"assert power_set_of_prime_divisors(30) == [[], [2], [3], [5], [2, 3], [2, ... | {
"split": "train",
"index": 74339,
"acecode_id": "evol_8049",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a list of field names and returns a new list with the field names sorted in ascending order. The input list may contain duplicate field names and empty strings, and the output list should not contain any duplicat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_raw_fields(['data', 'id', '', 'name', 'data', 'age', '']) == ['age', 'data', 'id', 'name']\", \"assert process_raw_fields(['apple', 'banana', 'apple', '']) == ['apple', 'banana']\", \"assert process_raw_fields(['', '', '', '']) == []\", \"assert proc... | {
"split": "train",
"index": 74340,
"acecode_id": "oss_35890",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `generate_random_array(n: int, k: int) -> List[int]` that generates an array of size 'n' containing random integers between 0 and 'k-1'. The function should return the generated array. Note that you do not need to handle any edge cases for negative or zero valu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert len(generate_random_array(5, 10)) == 5\", \"assert all(0 <= x < 10 for x in generate_random_array(5, 10))\", \"assert len(generate_random_array(0, 5)) == 0\", \"assert len(generate_random_array(3, 1)) == 3\", \"assert all(0 <= x < 1 for x in generate_random_... | {
"split": "train",
"index": 74341,
"acecode_id": "evol_1880",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a phone number and an address, implement a function that validates the phone number based on the standard US format '(123) 456-7890' and checks if the address is syntactically correct according to a simplified USPS address format '123 Main St, City, ST 12345'. The functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_info('(123) 456-7890', '123 Main St, City, ST 12345') == True\", \"assert validate_info('(987) 654-3210', '456 Elm St, Townsville, NY 12345') == True\", \"assert validate_info('(555) 123-4567', '789 Oak Ave, Metropolis, CA 90210') == True\", \"asser... | {
"split": "train",
"index": 74342,
"acecode_id": "evol_14486",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a progress bar that can update its progress based on a given maximum value and a current progress value. Your task is to implement a function `update_progress(maximum: int, value: int) -> str` that takes two parameters: the maximum value of the pr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_progress(100, 50) == 'Progress: 50.0% [##########----------]'\", \"assert update_progress(100, 100) == 'Progress: 100.0% [####################]'\", \"assert update_progress(100, 0) == 'Progress: 0.0% [--------------------]'\", \"assert update_progress... | {
"split": "train",
"index": 74343,
"acecode_id": "oss_10786",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the initial state of a variable `var`. Each element in the list represents the value of the variable at a specific index. You need to perform a series of operations on this list. The operations are as follows: Set the value of the v... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert perform_operations([1, 2, 3, 4, 5], [(2, 6), (3, 7), (0, 8)]) == [8, 2, 6, 7, 5]\", \"assert perform_operations([10, 20, 30], [(0, 100), (1, 200)]) == [100, 200, 30]\", \"assert perform_operations([5, 5, 5], [(0, 1), (1, 2), (2, 3)]) == [1, 2, 3]\", \"assert... | {
"split": "train",
"index": 74344,
"acecode_id": "oss_16976",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes three distinct strings as input and returns the shortest string among them that does not contain any vowel characters. If all strings contain vowels, return an empty string.\nPlease reason step by step, then write a self-contained Python solution. Gi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shortest_string_without_vowels('umbrella', 'hat', 'cat') == 'ht'\", \"assert shortest_string_without_vowels('', 'test', 'string') == 'tst'\", \"assert shortest_string_without_vowels('a', 'e', 'i') == ''\", \"assert shortest_string_without_vowels('abcd', 'efg... | {
"split": "train",
"index": 74345,
"acecode_id": "evol_4125",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You need to create a function that generates a standard HTTP response format for a web service. The function should accept two parameters: a string `key` and a `value` which can be of any type that can be serialized into JSON. The function should return a dictionary that repres... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_response('message', 'Hello, World!') == {'statusCode': 200, 'headers': {'Content-Type': 'application/json'}, 'body': '{\\\"message\\\": \\\"Hello, World!\\\"}'}\", \"assert create_response('data', 123) == {'statusCode': 200, 'headers': {'Content-Type'... | {
"split": "train",
"index": 74346,
"acecode_id": "bigcode_python_fns_10462",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a custom message based on input parameters. The function `generate_custom_message` takes a dictionary of parameters where each key is a string representing a type of information (like `name`, `age`, or `action`), and the va... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_custom_message({'name': 'Alice', 'age': 30, 'action': 'joined'}) == 'Alice, age 30, has joined the group.'\", \"assert generate_custom_message({'name': 'Bob', 'age': 25, 'action': 'left'}) == 'Bob, age 25, has left the group.'\", \"assert generate_c... | {
"split": "train",
"index": 74347,
"acecode_id": "oss_2641",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a unary operator ('+', '-', 'not') and a numeric value, implement a function that performs the corresponding unary operation on the numeric value. The function should return the result of the operation. If the operator is '+', return the value itself... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unary_operation('+', 5) == 5\", \"assert unary_operation('-', 5) == -5\", \"assert unary_operation('not', 0) == True\", \"assert unary_operation('not', 1) == False\", \"assert unary_operation('+', -3) == -3\", \"assert unary_operation('-', -3) == 3\", \"asse... | {
"split": "train",
"index": 74348,
"acecode_id": "bigcode_python_fns_24257",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing a sequence of data packets and an integer threshold, implement a function `process_packets(packets: List[int], threshold: int) -> List[int]`. The function should return a new list containing only the packets that exceed the given threshold.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_packets([1, 2, 3, 4, 5], 3) == [4, 5]\", \"assert process_packets([10, 20, 30, 40, 50], 25) == [30, 40, 50]\", \"assert process_packets([-1, -2, -3, -4], -2) == [-1]\", \"assert process_packets([0, 0, 0, 0], 1) == []\", \"assert process_packets([-10,... | {
"split": "train",
"index": 74349,
"acecode_id": "bigcode_python_fns_13471",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `determine_value(name: str, serving_values: dict, kwargs: dict, fallback_func: Callable) -> Any`. This function should determine the value to return based on the following rules: 1. If the `name` exists in the `serving_values` dictionary,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert determine_value('param1', {'param1': 10, 'param2': 20}, {}, lambda n, k: -1) == 10\", \"assert determine_value('param2', {'param1': 10, 'param2': 20}, {}, lambda n, k: -1) == 20\", \"assert determine_value('param3', {}, {'guess': 15}, lambda n, k: -1) == 15\... | {
"split": "train",
"index": 74350,
"acecode_id": "bigcode_python_fns_31876",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries, where each dictionary represents information about a veterinarian. Each dictionary contains three keys: 'name', 'specialization', and 'location'. Your task is to implement a function called `get_vets_info` that takes a list of such dictiona... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_vets_info([]) == []\", \"assert get_vets_info([{'name': 'Dr. Smith', 'specialization': 'Surgery', 'location': 'New York'}]) == [('Dr. Smith', 'Surgery')]\", \"assert get_vets_info([{'name': 'Dr. Jones', 'specialization': 'Dentistry', 'location': 'Los Ang... | {
"split": "train",
"index": 74351,
"acecode_id": "oss_8755",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists: one containing the model's predictions and the other containing the ground truth labels. Your task is to implement a function that calculates two metrics: CategoricalAccuracy and F1 score. The CategoricalAccuracy is defined as the ratio of the number of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate_model([1, 1, 1, 1], [1, 1, 1, 1]) == (1.0, 1.0)\", \"assert evaluate_model([0, 0, 0, 0], [1, 1, 1, 1]) == (0.0, 0.0)\", \"assert evaluate_model([1, 1, 0, 0], [1, 0, 0, 0]) == (0.75, 0.6666666666666666)\", \"assert evaluate_model([1, 0, 1, 0], [0, 1,... | {
"split": "train",
"index": 74352,
"acecode_id": "oss_12349",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a 2D matrix as input and returns a new matrix where each row of the original matrix is reversed. The input matrix will be a list of lists containing integers. For example, given the matrix [[1, 2, 3], [4, 5, 6], [7, 8, 9]], the output should be [[3, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert flip_matrix([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == [[3, 2, 1], [6, 5, 4], [9, 8, 7]]\", \"assert flip_matrix([[1], [2], [3]]) == [[1], [2], [3]]\", \"assert flip_matrix([[1, 2], [3, 4]]) == [[2, 1], [4, 3]]\", \"assert flip_matrix([[]]) == [[]]\", \"assert fl... | {
"split": "train",
"index": 74353,
"acecode_id": "evol_25732",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a total number of books, determine all possible combinations of books that can be packed into three compartments of a packing box. The first compartment can fit 5 books of type A, the second can fit 7 books of type B, and the third can fit 9 books of type C. Implement a f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert book_combinations(0) == [(0, 0, 0)]\", \"assert book_combinations(1) == []\", \"assert book_combinations(5) == [(1, 0, 0)]\", \"assert book_combinations(7) == [(0, 1, 0)]\", \"assert book_combinations(9) == [(0, 0, 1)]\"]}"
} | {
"split": "train",
"index": 74354,
"acecode_id": "evol_10959",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that maps predefined presentation intervals represented as strings to their corresponding numerical values. The valid presentation intervals are: 'D3DPRESENT_INTERVAL_ONE', 'D3DPRESENT_INTERVAL_TWO', 'D3DPRESENT_INTERVAL_THREE', 'D3DPRESE... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_presentation_interval_value('D3DPRESENT_INTERVAL_ONE') == 1\", \"assert get_presentation_interval_value('D3DPRESENT_INTERVAL_TWO') == 2\", \"assert get_presentation_interval_value('D3DPRESENT_INTERVAL_THREE') == 3\", \"assert get_presentation_interval_va... | {
"split": "train",
"index": 74355,
"acecode_id": "oss_32388",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, where each string represents a sentence. Your task is to implement a function that counts the number of words in each sentence and returns a list of integers, where each integer corresponds to the word count of the respective sentence in the inp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_words(['SingleWord', 'Another one']) == [1, 2]\", \"assert count_words(['', ' ', ' ']) == [0, 0, 0]\", \"assert count_words(['A B C D E']) == [5]\", \"assert count_words(['One sentence.', 'Another sentence.', 'Yet another one.']) == [2, 2, 3]\", \"as... | {
"split": "train",
"index": 74356,
"acecode_id": "bigcode_python_fns_17291",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function `char_count(text: str) -> dict` that takes a string `text` as input and returns a dictionary containing the count of each distinct alphabetical character in the string. The keys of the dictionary should be the characters in lowercase, and the values should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert char_count('Hello World') == {'h': 1, 'e': 1, 'l': 3, 'o': 2, 'w': 1, 'r': 1, 'd': 1}\", \"assert char_count('1234!@#$%^&*()') == {}\", \"assert char_count('') == {}\", \"assert char_count('aaaaaa') == {'a': 6}\", \"assert char_count('abcdefg') == {'a': 1, '... | {
"split": "train",
"index": 74357,
"acecode_id": "evol_8857",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given two arrays of integers, one containing 15 random integers in the range of 50 to 100, and the other containing 20 random integers in the range of 200 to 250, implement a function `bubble_sort(arr: List[int]) -> List[int]` that sorts the combined array of these integers in ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bubble_sort([50, 52, 60, 70, 80, 90, 95, 55, 65, 75, 85, 100, 54, 58, 99, 200, 210, 225, 240, 250]) == [50, 52, 54, 55, 58, 60, 65, 70, 75, 80, 85, 90, 95, 99, 100, 200, 210, 225, 240, 250]\", \"assert bubble_sort([90, 85, 80, 75, 70, 65, 60, 55, 54, 53, 52,... | {
"split": "train",
"index": 74358,
"acecode_id": "evol_23965",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of tuples where each tuple contains two strings representing file names. Your task is to combine the file names from each tuple into a single output string for each pair. If a tuple contains only one file name, just use that one. The output string for a pai... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert combine_file_names([('file1.txt',)], 'data') == ['data']\", \"assert combine_file_names([], 'output') == []\", \"assert combine_file_names([('single.txt',)], 'unique') == ['unique']\", \"assert combine_file_names([('input1.txt',)], 'result') == ['result']\",... | {
"split": "train",
"index": 74359,
"acecode_id": "bigcode_python_fns_47514",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a function `binary_to_decimal(binaryNum: str) -> Union[int, str]` that converts a binary numeral represented as a string to its equivalent integer value in base 10. If the input string is not a valid binary number (i.e., it contains characters other than '0' and '1'),... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binary_to_decimal('1101') == 13\", \"assert binary_to_decimal('101010') == 42\", \"assert binary_to_decimal('11111111') == 255\", \"assert binary_to_decimal('0') == 0\", \"assert binary_to_decimal('1') == 1\", \"assert binary_to_decimal('100000') == 32\", \"... | {
"split": "train",
"index": 74360,
"acecode_id": "evol_27653",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of queries and a list of answer IDs, where each query corresponds to a set of relevant answer IDs. Your task is to write a function that processes these queries and returns a dictionary of statistics that includes the total number of queries processed, the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_statistics([], []) == {'total_queries': 0, 'queries_with_at_least_one_correct_answer': 0, 'total_correct_answers': 0, 'queries_where_at_least_one_correct_answer_didnt_appear': 0}\", \"assert generate_statistics(['query4'], [[1, 2, 3]]) == {'total_qu... | {
"split": "train",
"index": 74361,
"acecode_id": "bigcode_python_fns_16258",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of Pokémon attributes represented as dictionaries. Each dictionary contains the following keys: 'hp', 'attack', 'defense', 'sp_attack', 'sp_defense', 'speed', 'type1', and 'type2'. Your task is to implement a function that takes this list of Pokémon attribu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_legendary([{'hp': 250, 'attack': 100, 'defense': 100, 'sp_attack': 100, 'sp_defense': 100, 'speed': 100, 'type1': 'Fire', 'type2': 'Flying'}]) == [True]\", \"assert is_legendary([{'hp': 200, 'attack': 160, 'defense': 100, 'sp_attack': 100, 'sp_defense': 1... | {
"split": "train",
"index": 74362,
"acecode_id": "oss_14721",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `resolve_settings_file` that determines the path to a settings file based on whether a user-defined settings file exists. The function should take two string parameters: `user_settings_file` and `default_settings_file`. If the `user_setti... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert resolve_settings_file('user_config.yml', 'default_config.yml') == 'user_config.yml'\", \"assert resolve_settings_file('', 'default_config.yml') == 'default_config.yml'\", \"assert resolve_settings_file('custom_settings.yml', 'settings.yml') == 'custom_settin... | {
"split": "train",
"index": 74363,
"acecode_id": "bigcode_python_fns_38583",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a directed graph represented as a 2D array of edges, where each edge is a pair [ui, vi] indicating a directed edge from node ui to node vi, determine which edge can be removed to convert the graph back into a rooted tree. If there are multiple edges that can be removed, r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert findRedundantDirectedConnection([[1,2],[1,3],[2,3]]) == [2,3]\", \"assert findRedundantDirectedConnection([[1,2],[2,3],[3,1]]) == [3,1]\", \"assert findRedundantDirectedConnection([[1,2],[1,3],[2,4],[4,2]]) == [4,2]\", \"assert findRedundantDirectedConnectio... | {
"split": "train",
"index": 74364,
"acecode_id": "evol_10114",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of dictionaries, each representing a record with the same set of keys, implement a function that returns a list of strings where each string is a CSV representation of the corresponding dictionary. The first string in the list should contain the header row with the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dict_to_csv([{'name': 'Alice', 'age': 30}, {'name': 'Bob', 'age': 25}]) == ['name,age', 'Alice,30', 'Bob,25']\", \"assert dict_to_csv([{'name': 'Charlie', 'age': 35}, {'name': 'David', 'age': 40}, {'name': 'Eva', 'age': 28}]) == ['name,age', 'Charlie,35', 'D... | {
"split": "train",
"index": 74365,
"acecode_id": "bigcode_python_fns_47668",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `human_info(full_name: str, age: int, profession: str) -> str` that takes in a person's full name, age, and profession and returns a formatted string that includes the person's full name, age, and profession. The output string should be in the following for... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert human_info('Alice Johnson', 30, 'Data Scientist') == '\\\\nFull Name: Alice Johnson\\\\nAge: 30\\\\nProfession: Data Scientist'\", \"assert human_info('Bob Smith', 45, 'Manager') == '\\\\nFull Name: Bob Smith\\\\nAge: 45\\\\nProfession: Manager'\", \"assert ... | {
"split": "train",
"index": 74366,
"acecode_id": "evol_32359",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of words and a specified set of characters, implement a function that returns a new list containing only the words that include all characters from the specified set. The function should be case-sensitive, meaning that 'A' and 'a' are treated as different character... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_words(['elephant', 'tiger', 'lion', 'zebra'], ['e', 'r', 't']) == ['tiger']\", \"assert filter_words(['dog', 'cat', 'mouse'], ['m', 'o']) == ['mouse']\", \"assert filter_words(['hello', 'world'], ['h', 'o']) == ['hello']\", \"assert filter_words(['pyt... | {
"split": "train",
"index": 74367,
"acecode_id": "evol_5046",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given two sets of multi-dimensional numerical arrays denoted as 'A' and 'B', calculate the element-wise difference of each corresponding element pair. If the arrays have differing dimensions, pad the smaller array with zeroes until it matches the size of the larger array. Imple... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_difference([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[-4, -4], [-4, -4]]\", \"assert calculate_difference([[1]], [[2]]) == [[-1]]\", \"assert calculate_difference([[1]], [[1, 2, 3]]) == [[0, -2, -3]]\", \"assert calculate_difference([[1, 2, 3]], [[4,... | {
"split": "train",
"index": 74368,
"acecode_id": "evol_31817",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that filters a list of user stories based on a specified keyword. Each user story is represented as a dictionary with a 'description' key containing a string. Your function should return a list of user stories whose descriptions conta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_user_stories([{'description': 'As a user, I want to login'}], 'login') == [{'description': 'As a user, I want to login'}]\", \"assert filter_user_stories([{'description': 'As a user, I want to logout'}, {'description': 'As a user, I want to login'}], ... | {
"split": "train",
"index": 74369,
"acecode_id": "oss_23409",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings where each string represents a filename. Your task is to implement a function that returns a dictionary. The keys of the dictionary should be the filenames without their extensions, and the values should be the length of each filename string (exc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_filenames(['file1.txt', 'file2.txt', 'document.txt']) == {'file1': 5, 'file2': 5, 'document': 8}\", \"assert extract_filenames(['report.txt', 'summary.txt']) == {'report': 6, 'summary': 7}\", \"assert extract_filenames(['test1.txt', 'test2.txt', 'tes... | {
"split": "train",
"index": 74370,
"acecode_id": "bigcode_python_fns_40341",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Create a function `create_dict` that constructs and returns a Python dictionary with three entries. Each entry should be a key-value pair where the key is a string (e.g., 'Entry1', 'Entry2', 'Entry3') and the value is a list of five elements of different data types. The element... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_dict() == {'Entry1': [1, 2.2, 'str1', [1, 2], {'insideKey':'insideValue'}], 'Entry2': [2, 3.3, 'str2', [2, 3], {'insideKey2':'insideValue2'}], 'Entry3': [3, 4.4, 'str3', [3, 4], {'insideKey3':'insideValue3'}]}\", \"assert create_dict()['Entry1'][0] ==... | {
"split": "train",
"index": 74371,
"acecode_id": "evol_1464",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that sorts an array of integers using the quicksort algorithm with the Lomuto partition scheme. The function should take a list of integers as input and return a new list containing the sorted integers. The implementation should maintain a space complexity ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert quicksort([10, 7, 8, 9, 1, 5]) == [1, 5, 7, 8, 9, 10]\", \"assert quicksort([3, 6, 8, 10, 1, 2, 1]) == [1, 1, 2, 3, 6, 8, 10]\", \"assert quicksort([5]) == [5]\", \"assert quicksort([]) == []\", \"assert quicksort([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"ass... | {
"split": "train",
"index": 74372,
"acecode_id": "evol_16183",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a simple electromagnetic field based on given parameters. Write a function `initialize_simulation` that takes in the following parameters: `name` (a string representing the name of the simulation), `survey` (a dictionary containing survey details)... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_simulation('Test Simulation', {'type': 'ground'}, {'resistivity': 100}, 'both') == {'name': 'Test Simulation', 'survey': {'type': 'ground'}, 'model': {'resistivity': 100}, 'gridding': 'both'}\", \"assert initialize_simulation('Simulation A', {'typ... | {
"split": "train",
"index": 74373,
"acecode_id": "oss_30923",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `filter_stars` that takes a list of integers representing the star ratings of various Python repositories and a filter string. The filter string can contain one of the following formats: '>X', '<X', or 'X..Y', where X and Y are intege... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_stars([1, 2, 3, 10, 20, 30], None) == [1, 2, 3, 10, 20, 30]\", \"assert filter_stars([1, 2, 3, 10, 20, 30], '>10') == [20, 30]\", \"assert filter_stars([1, 2, 3, 10, 20, 30], '<10') == [1, 2, 3]\", \"assert filter_stars([1, 2, 3, 10, 20, 30], '10..20'... | {
"split": "train",
"index": 74374,
"acecode_id": "bigcode_python_fns_19549",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of clusters, where each cluster is a list of tuples representing spans. Each span is defined by a start and end index (inclusive). Your task is to merge any clusters that contain identical spans. Two clusters should be considered identical if they have at l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_clusters([[(1, 2)], [(3, 4)], [(1, 2), (3, 5)]]) == [[(1, 2), (3, 5)], [(3, 4)]]\", \"assert merge_clusters([[(0, 1), (2, 3)], [(4, 5)], [(0, 1)]] ) == [[(0, 1), (2, 3)], [(4, 5)]]\", \"assert merge_clusters([[(1, 1)], [(1, 1)], [(1, 1), (2, 2)]] ) == ... | {
"split": "train",
"index": 74375,
"acecode_id": "bigcode_python_fns_30564",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a list of 2D points represented as tuples in the form (x, y). Your task is to implement a function that sorts these points based on their y-coordinate in ascending order. The function should take the list of 2D points as input and return the sorted list of points.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_points_by_y([(1, 2), (3, 1), (5, 4), (2, 7)]) == [(3, 1), (1, 2), (5, 4), (2, 7)]\", \"assert sort_points_by_y([(0, 0), (1, 1), (2, 2), (3, -1)]) == [(3, -1), (0, 0), (1, 1), (2, 2)]\", \"assert sort_points_by_y([(10, 10), (5, 5), (10, 5)]) == [(5, 5), ... | {
"split": "train",
"index": 74376,
"acecode_id": "oss_9687",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a student's score and assigns a corresponding grade based on the following criteria: If the student's score is between 1.0 and 39.9 (inclusive), the grade is \"F9\" and the student has failed. If the student's score is betw... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_grade(35.0) == ('F9', 'Failed')\", \"assert get_grade(45.0) == ('E8', 'Passed')\", \"assert get_grade(55.0) == ('D7', 'Passed')\", \"assert get_grade(65.0) == ('C6', 'Passed')\", \"assert get_grade(75.0) == ('C5', 'Passed')\", \"assert get_grade(85.0) ==... | {
"split": "train",
"index": 74377,
"acecode_id": "oss_9785",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers and a target integer, write a function that returns the index of the two numbers such that they add up to the target integer. You may assume that each input would have exactly one solution, and you may not use the same element twice. You can return the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert two_sum([2, 7, 11, 15], 9) == [0, 1]\", \"assert two_sum([3, 2, 4], 6) == [1, 2]\", \"assert two_sum([3, 3], 6) == [0, 1]\", \"assert two_sum([0, 4, 3, 0], 0) == [0, 3]\", \"assert two_sum([-1, -2, -3, -4, -5], -8) == [2, 4]\", \"assert two_sum([5, 5, 5, 5],... | {
"split": "train",
"index": 74378,
"acecode_id": "bigcode_python_fns_15431",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple model prediction process given a list of inputs and a model type. The function should take two parameters: a list of integers 'inputs' representing the features for each sample and a string 'model_type' indicat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert model_predictions([1, 2, 3], 'linear') == [5, 7, 9]\", \"assert model_predictions([0, -1, -2], 'linear') == [3, 1, -1]\", \"assert model_predictions([1, 2, 3], 'quadratic') == [1, 4, 9]\", \"assert model_predictions([-1, 0, 1], 'quadratic') == [1, 0, 1]\", \... | {
"split": "train",
"index": 74379,
"acecode_id": "bigcode_python_fns_35940",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of file names to extract and organize series of files based on their naming conventions. The function should identify and group files that belong to the same series and return a dictionary where the keys are t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_series_from_files(['series1_001.txt', 'series1_002.txt', 'series2_001.txt', 'series2_002.txt', 'series2_003.txt', 'series3_001.txt']) == {'series1': ['series1_001.txt', 'series1_002.txt'], 'series2': ['series2_001.txt', 'series2_002.txt', 'series2_003.tx... | {
"split": "train",
"index": 74380,
"acecode_id": "oss_33510",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `expand_tile(value: List[int], size: int) -> List[List[int]]` that expands the list into a new list of lists. The outer list should contain `size` copies of the inner list, which should be the original list. For example, if the inp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert expand_tile([1, 2, 3], 3) == [[1, 2, 3], [1, 2, 3], [1, 2, 3]]\", \"assert expand_tile([0], 5) == [[0], [0], [0], [0], [0]]\", \"assert expand_tile([], 2) == [[], []]\", \"assert expand_tile([10, 20], 1) == [[10, 20]]\", \"assert expand_tile([5, 6, 7], 0) ==... | {
"split": "train",
"index": 74381,
"acecode_id": "bigcode_python_fns_7836",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an input string, write a function that determines whether it is possible to divide the string into two or more segments that are anagrams of one another. An anagram is defined as a rearrangement of the letters of a word or phrase, using all the original letters exactly on... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_anagram_segments('helloworld') == False\", \"assert check_anagram_segments('abcabc') == True\", \"assert check_anagram_segments('abcd') == False\", \"assert check_anagram_segments('xyzxyz') == True\", \"assert check_anagram_segments('abab') == True\", ... | {
"split": "train",
"index": 74382,
"acecode_id": "evol_5848",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of equal length, `x` and `y`, representing two datasets. Your task is to implement a function that performs bootstrap sampling on these datasets. Specifically, you need to create a function `bootstrap_replicates(x: List[float], y: List[float], func: Call... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bootstrap_replicates([0.0, 0.0, 0.0], [1.0, 1.0, 1.0], lambda a, b: sum(a) * sum(b), 1) == [0.0]\", \"assert bootstrap_replicates([], [], lambda a, b: sum(a) + sum(b), 0) == []\", \"assert bootstrap_replicates([1.0], [2.0], lambda a, b: a[0] / b[0], 2) == [0... | {
"split": "train",
"index": 74383,
"acecode_id": "bigcode_python_fns_2875",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given two 1-dimensional arrays `array1` and `array2`, both of the same length `n`, implement a function `crosscorrelation(array1: List[float], array2: List[float]) -> List[float]` that computes the cross-correlation of these two arrays. The cross-correlation is defined as the s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert crosscorrelation([1.0, 2.0, 3.0], [0.0, 1.0, 2.0]) == [8.0, 5.0, 2.0]\", \"assert crosscorrelation([1.0, 1.0], [1.0, 1.0]) == [2.0, 1.0]\", \"assert crosscorrelation([0.0, 0.0, 0.0], [1.0, 2.0, 3.0]) == [0.0, 0.0, 0.0]\", \"assert crosscorrelation([1.0], [1.... | {
"split": "train",
"index": 74384,
"acecode_id": "bigcode_python_fns_13456",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given an integer representing an hour in 24-hour format, and a tuple representing a range of hours, determine if the given hour falls within that range. The range might wrap around midnight. Implement a function `is_hour_in_range(time: int, time_range: tuple) -> bool` where: \n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_hour_in_range(4, (24, 5)) == True\", \"assert is_hour_in_range(10, (8, 12)) == True\", \"assert is_hour_in_range(1, (0, 3)) == True\", \"assert is_hour_in_range(12, (10, 15)) == True\", \"assert is_hour_in_range(15, (14, 18)) == True\", \"assert is_hour_i... | {
"split": "train",
"index": 74385,
"acecode_id": "bigcode_python_fns_43081",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a multi-value dictionary. The function should accept a list of tuples, where each tuple represents an operation to add a key-value pair to the dictionary. If the key already exists in the dictionary, the value should be app... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multi_value_dict([('a', 1), ('b', 2), ('a', 3)]) == {'a': [1, 3], 'b': [2]}\", \"assert multi_value_dict([('x', 10), ('y', 20), ('x', 30), ('x', 40)]) == {'x': [10, 30, 40], 'y': [20]}\", \"assert multi_value_dict([('key1', 5), ('key2', 10), ('key1', 15), ('... | {
"split": "train",
"index": 74386,
"acecode_id": "oss_35177",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simplified version of a 2D surface rebuilding algorithm. The function should return a string indicating which direction (U or V) is being rebuilt first along with the number of spans in that direction. The function si... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rebuild_surface('surface1', 5, 10, True) == 'Rebuilding u first with 5 spans.'\", \"assert rebuild_surface('surface2', 7, 3, False) == 'Rebuilding v first with 3 spans.'\", \"assert rebuild_surface('surface3', 0, 12, True) == 'Rebuilding u first with 0 spans... | {
"split": "train",
"index": 74387,
"acecode_id": "oss_33708",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the daily step counts of a person over a week. Write a function `average_steps(steps: List[int]) -> float` that calculates the average steps taken per day for that week. The average should be a floating-point number rounded to two d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_steps([10000, 12000, 11000, 9000, 13000, 14000, 8000]) == 11000.00\", \"assert average_steps([5000, 6000, 7000, 8000, 9000, 10000, 11000]) == 8000.00\", \"assert average_steps([15000, 16000, 17000, 18000, 19000, 20000, 21000]) == 18000.00\", \"assert... | {
"split": "train",
"index": 74388,
"acecode_id": "bigcode_python_fns_35347",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a nested list of integers and None values, implement a function `flatten_list(preserve_nulls: bool, nested_list: List[Union[int, None]]) -> List[Union[int, None]]`. If `preserve_nulls` is True, the function should flatten the list while preserving the None values in their... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert flatten_list(True, [1, 2, [None, 3, [4]]]) == [1, 2, None, 3, 4]\", \"assert flatten_list(False, [1, 2, [None, 3, [4]]]) == [1, 2, 3, 4]\", \"assert flatten_list(True, [[None, [5, None]], 6]) == [None, 5, None, 6]\", \"assert flatten_list(False, [[None, [5, ... | {
"split": "train",
"index": 74389,
"acecode_id": "bigcode_python_fns_23184",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of unique positive integers called `indexes` and a positive integer `length`, write a function `as_mask(indexes, length)` that converts the `indexes` into a binary mask of size `length`. The binary mask should have `True` for each index present in `indexes` and `Fa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert as_mask([0, 2, 4], 5) == [True, False, True, False, True]\", \"assert as_mask([1, 3], 4) == [False, True, False, True]\", \"assert as_mask([0, 1, 2], 3) == [True, True, True]\", \"assert as_mask([3], 5) == [False, False, False, True, False]\", \"assert as_ma... | {
"split": "train",
"index": 74390,
"acecode_id": "bigcode_python_fns_28319",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two integer arrays, `startTime` and `endTime`, along with an integer `queryTime`. Each student in a class has a specific time interval during which they are doing homework, represented by `startTime[i]` (the time they start) and `endTime[i]` (the time they finish)... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert busyStudent([1,2,3], [3,2,7], 4) == 1\", \"assert busyStudent([4], [4], 4) == 1\", \"assert busyStudent([4], [4], 5) == 0\", \"assert busyStudent([1,1,1,1], [1,3,2,4], 7) == 0\", \"assert busyStudent([9,8,7,6,5,4,3,2,1], [10,10,10,10,10,10,10,10,10], 5) == 5... | {
"split": "train",
"index": 74391,
"acecode_id": "evol_17451",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of coin denominations and a target amount of money. Your task is to write a function to find the maximum amount of money that can be formed using any number of coins from the given denominations without exceeding the target amount. You should assume that an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert maxAmount([1, 2, 5], 11) == 11\", \"assert maxAmount([2, 4, 6], 9) == 8\", \"assert maxAmount([1, 3, 4], 6) == 6\", \"assert maxAmount([3, 5], 7) == 6\", \"assert maxAmount([5, 10], 3) == 0\", \"assert maxAmount([1], 0) == 0\", \"assert maxAmount([2, 3], 8) ... | {
"split": "train",
"index": 74392,
"acecode_id": "oss_3731",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a class TicTacToe that simulates a Tic Tac Toe game with a grid of size n x n. The class should have an initializer that takes an integer n and sets up the game board. Implement a method 'move(row: int, col: int, player: int) -> int' that simulates a player's move. The m... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert TicTacToe(3).move(0, 0, 1) == 0\", \"assert TicTacToe(3).move(0, 0, 2) == 0\", \"assert TicTacToe(3).move(1, 1, 1) == 0\", \"assert TicTacToe(3).move(0, 1, 2) == 0\", \"assert TicTacToe(3).move(0, 2, 2) == 0\", \"assert TicTacToe(3).move(1, 0, 1) == 0\", \"a... | {
"split": "train",
"index": 74393,
"acecode_id": "evol_27417",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers, array1 and array2, write a function that combines the elements of both arrays and sorts them in ascending order. Additionally, the function should find the median of the new array. If the array has an even number of items, the median should be the a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_median_and_sorted_array([1, 9, 3], [4, 5, 6, 2]) == ([1, 2, 3, 4, 5, 6, 9], 4)\", \"assert get_median_and_sorted_array([], [1, 2, 3, 4]) == ([1, 2, 3, 4], 2.5)\", \"assert get_median_and_sorted_array([1, 5], [2, 3, 4]) == ([1, 2, 3, 4, 5], 3)\", \"assert... | {
"split": "train",
"index": 74394,
"acecode_id": "evol_28528",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a JSON string that contains an array of GitHub repository objects. Each repository object has attributes: name (string), lang (string), watchers (integer), and forks (integer). Your task is to implement a function `analyze_github_repos(response_text)` that takes t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_github_repos('[{\\\"name\\\": \\\"repo1\\\", \\\"lang\\\": \\\"Python\\\", \\\"watchers\\\": 100, \\\"forks\\\": 20}, {\\\"name\\\": \\\"repo2\\\", \\\"lang\\\": \\\"JavaScript\\\", \\\"watchers\\\": 80, \\\"forks\\\": 15}, {\\\"name\\\": \\\"repo3\\... | {
"split": "train",
"index": 74395,
"acecode_id": "oss_4295",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You need to create a function `generate_docker_command` that takes a boolean parameter `latest` and returns a string command used to build a Docker container. The command should be formatted as follows: `OCI_CMD build -t {tagname}:{tagtag} {pathtodockerfile}`. The value of `tag... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_docker_command(True) == 'docker build -t my_image:LATEST .latest'\", \"assert generate_docker_command(False) == 'docker build -t my_image:NEXT .next'\", \"assert generate_docker_command(True) == 'docker build -t my_image:LATEST .latest'\", \"assert ... | {
"split": "train",
"index": 74396,
"acecode_id": "bigcode_python_fns_9420",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `word_counter(sentence: str) -> Dict[str, int]` that takes a string `sentence` as input and returns a dictionary containing each unique word in the string and the frequency of its occurrence. The function should be case-insensitive and consider punctuation ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert word_counter('Hello, hello, Hello!') == {'hello': 3}\", \"assert word_counter('One, two, three... One, two.') == {'one': 2, 'two': 2, 'three': 1}\", \"assert word_counter('Python is great. Python is fun!') == {'python': 2, 'is': 2, 'great': 1, 'fun': 1}\", \... | {
"split": "train",
"index": 74397,
"acecode_id": "evol_18846",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a positive integer n, implement a function that generates and returns the Fibonacci series starting from the initial term of 1 and ending with the n-th term. The Fibonacci series is defined as follows: the first two terms are 1 and 1, and each subsequent term is the sum o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(1) == [1]\", \"assert fibonacci(2) == [1, 1]\", \"assert fibonacci(3) == [1, 1, 2]\", \"assert fibonacci(4) == [1, 1, 2, 3]\", \"assert fibonacci(5) == [1, 1, 2, 3, 5]\", \"assert fibonacci(6) == [1, 1, 2, 3, 5, 8]\", \"assert fibonacci(7) == [1, 1... | {
"split": "train",
"index": 74398,
"acecode_id": "evol_20783",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a user's profile information as input and updates it. The profile information consists of the user's first name, last name, and email address. Your function should take a dictionary with the keys 'first_name', 'last_name', and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_user_profile({'first_name': 'John', 'last_name': 'Doe', 'email': 'john.doe@example.com'}) == {'first_name': 'John', 'last_name': 'Doe', 'email': 'john.doe@example.com'}\", \"assert update_user_profile({'first_name': 'Jane', 'last_name': 'Smith', 'emai... | {
"split": "train",
"index": 74399,
"acecode_id": "oss_9068",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.