data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a metadata dictionary for a virtual machine volume. The function should take three parameters: a string `vm_name` representing the name of the virtual machine, a string `vmdk_path` representing the path to the virtual disk,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_volume_metadata('VM1', '/path/to/disk.vmdk', {'option1': 'value1'}) == {'status': 'detached', 'volume_options': {'option1': 'value1'}, 'created': time.asctime(time.gmtime()), 'created_by': 'VM1'}\", \"assert create_volume_metadata('VM2', '/path/to/dis... | {
"split": "train",
"index": 81900,
"acecode_id": "bigcode_python_fns_8287",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `generate_sequence(maximum: int) -> List[int]` that generates a list of numbers starting from 0, incrementing by 5, and ending at the largest number less than or equal to the given maximum integer value. The list should include the starting number and the endin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_sequence(15) == [0, 5, 10, 15]\", \"assert generate_sequence(16) == [0, 5, 10, 15]\", \"assert generate_sequence(0) == [0]\", \"assert generate_sequence(-1) == []\", \"assert generate_sequence(5) == [0, 5]\", \"assert generate_sequence(10) == [0, 5,... | {
"split": "train",
"index": 81901,
"acecode_id": "evol_17309",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a Python function that takes a list of integers and returns a new list containing only the prime numbers from the input list. The returned list should be sorted in descending order. Do not use any pre-built library functions to determine if a number is prime. Example inp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_prime([2, 3, 4, 5, 6, 7, 8, 9, 10]) == [7, 5, 3, 2]\", \"assert extract_prime([11, 12, 13, 14, 15]) == [13, 11]\", \"assert extract_prime([1, 4, 6, 8, 10]) == []\", \"assert extract_prime([17, 19, 23, 29, 31]) == [31, 29, 23, 19, 17]\", \"assert extr... | {
"split": "train",
"index": 81902,
"acecode_id": "evol_6222",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that checks whether a list is a sublist of another list. The function should be able to handle nested lists and determine if a nested list is considered a sublist of the main list. The function should also be able to manage lists containing different dat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_sublist([1, 2, 3, 4], [2, 3]) == True\", \"assert is_sublist([1, 2, 3, 4], [5, 6]) == False\", \"assert is_sublist([1, 2, [3, 4]], [3, 4]) == False\", \"assert is_sublist([1, 2, [3, 4]], [[3, 4]]) == True\", \"assert is_sublist([[1, 2], 3], [1, 2]) == Fal... | {
"split": "train",
"index": 81903,
"acecode_id": "evol_35002",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a list of elements and computes the cubical values of the individual numeric elements present within the list. The function should handle negative numbers and ignore non-numeric values. Finally, return the list of cubical values sorted in descending ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_cubed_aggregate([1, 2, 3, 4, 5, -1, -2, 'abc', []]) == [125, 64, 27, 8, 1, -1, -8]\", \"assert sort_cubed_aggregate([]) == []\", \"assert sort_cubed_aggregate(['a', 'b', 'c']) == []\", \"assert sort_cubed_aggregate([0]) == [0]\", \"assert sort_cubed_agg... | {
"split": "train",
"index": 81904,
"acecode_id": "evol_31984",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of integers, `x` and `y`, each representing the scores of two players in multiple rounds of a game. Your task is to implement a function that determines the outcome of the game based on the scores. The function should return a tuple with three values: (w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert game_outcome([3, 2, 5], [2, 3, 4]) == (2, 0, 1)\", \"assert game_outcome([5, 5, 5], [5, 5, 5]) == (0, 3, 0)\", \"assert game_outcome([0, 0, 0], [0, 0, 0]) == (0, 3, 0)\", \"assert game_outcome([7, 8], [3, 5]) == (2, 0, 0)\", \"assert game_outcome([4, 4], [4,... | {
"split": "train",
"index": 81905,
"acecode_id": "bigcode_python_fns_14944",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a basic statistics reporting mechanism. The function should take three parameters: a string 'name' representing the name of the metric, an integer 'count' representing the number of occurrences of the metric, and a floa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert statsd_metric('metric_a', 5, 1.5) == {'name': 'metric_a', 'count': 5, 'elapsed_ms': 1500}\", \"assert statsd_metric('metric_b', 10, 0.25) == {'name': 'metric_b', 'count': 10, 'elapsed_ms': 250}\", \"assert statsd_metric('metric_c', 0, 3.2) == {'name': 'metri... | {
"split": "train",
"index": 81906,
"acecode_id": "bigcode_python_fns_43876",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Define a function `remove_evens(lst)` that takes a list of integers as input and removes all even numbers from it, including both positive and negative numbers. The function should return the modified list containing only the odd numbers.\nPlease reason step by step, then write... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_evens([1, 2, 3, 4, 5, 6, 7, 8, -2, -4]) == [1, 3, 5, 7]\", \"assert remove_evens([10, 15, 20, -3, -8, 7]) == [15, -3, 7]\", \"assert remove_evens([0, -1, -2, -3, -4]) == [-1, -3]\", \"assert remove_evens([2, 4, 6, 8]) == []\", \"assert remove_evens([1... | {
"split": "train",
"index": 81907,
"acecode_id": "evol_16324",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that returns a new list containing all the elements that do not have a corresponding element in the list which is its inverse (i.e., for an element 'x', its inverse is '-x').\nPlease reason step by step, then write a self-contained Pyt... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_unique_elements([-2, -1, 0, 1, 3]) == [-2, 3]\", \"assert find_unique_elements([1, 2, 3, -1, -2, -3]) == []\", \"assert find_unique_elements([4, -4, 5, -5, 6]) == [6]\", \"assert find_unique_elements([7, 8, 9]) == [7, 8, 9]\", \"assert find_unique_eleme... | {
"split": "train",
"index": 81908,
"acecode_id": "evol_36242",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function that finds the common elements in two given sorted arrays. The function should take two lists of integers as input and return a list of integers containing the common elements. The output should be sorted and contain no duplicates. For example, given arr1 =... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_common_elements([1, 3, 4, 6, 7, 9], [1, 2, 4, 5, 9, 10]) == [1, 4, 9]\", \"assert find_common_elements([1, 2, 3], [4, 5, 6]) == []\", \"assert find_common_elements([], [1, 2, 3]) == []\", \"assert find_common_elements([1, 1, 2, 2], [2, 2, 3, 3]) == [2]\... | {
"split": "train",
"index": 81909,
"acecode_id": "evol_8132",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that extracts a specific value from a dictionary. Your function should take a dictionary and a key as inputs and return the value associated with that key. If the key does not exist in the dictionary, return 'Key not found'. Implement the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_value_from_dict({'a': 'apple', 'b': 'banana'}, 'a') == 'apple'\", \"assert get_value_from_dict({'x': 'x-ray', 'y': 'yellow'}, 'y') == 'yellow'\", \"assert get_value_from_dict({'name': 'Alice', 'age': '30'}, 'age') == '30'\", \"assert get_value_from_dict(... | {
"split": "train",
"index": 81910,
"acecode_id": "bigcode_python_fns_47121",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `dissect_and_sort(arr)` that takes a list of integers as input and returns a new list containing the integers sorted in ascending order. The input list may contain duplicate integers, and the output list should remove any duplicate values. If the input list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dissect_and_sort([4, 2, 9, 5, 1]) == [1, 2, 4, 5, 9]\", \"assert dissect_and_sort([1, 2, 2, 3, 4, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert dissect_and_sort([10, 9, 8, 7, 6]) == [6, 7, 8, 9, 10]\", \"assert dissect_and_sort([]) == []\", \"assert dissect_and_sort... | {
"split": "train",
"index": 81911,
"acecode_id": "evol_19284",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the execution of a command on a remote server. The function should take in two parameters: a string `server` representing the server's address and a string `cmd` representing the command to be executed. Additionally, th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert execute_command('192.168.1.1', 'ls', True) == 'Command executed successfully: ls'\", \"assert execute_command('192.168.1.1', 'ls', False) == 'Command executed without validation: ls'\", \"assert execute_command('10.0.0.1', 'pwd', True) == 'Command executed s... | {
"split": "train",
"index": 81912,
"acecode_id": "bigcode_python_fns_15077",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a list of migration operations for a database schema. Each migration operation is represented as a tuple containing the migration type and the corresponding Python function to be executed. The migration types can... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_migration_types([('RunPython', 'func1'), ('RunSQL', 'ALTER TABLE employees ADD COLUMN salary INTEGER'), ('RunPython', 'func2')]) == {'RunPython': 2, 'RunSQL': 1}\", \"assert count_migration_types([]) == {}\", \"assert count_migration_types([('RunSQL', ... | {
"split": "train",
"index": 81913,
"acecode_id": "oss_24150",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a string 'word' and a character 'character', implement a function `char_exists(word, character)` that determines whether the specified character exists within the given word. The function should return True if the character is found in the word, and False otherwise.\nPlea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert char_exists('supercalifragilisticexpialidocious', 'x') == True\", \"assert char_exists('hello', 'e') == True\", \"assert char_exists('world', 'a') == False\", \"assert char_exists('example', 'e') == True\", \"assert char_exists('python', 'y') == True\", \"as... | {
"split": "train",
"index": 81914,
"acecode_id": "evol_22353",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a chat application. Implement a function `blacklist_chat(chat_id: int, reason: str) -> None` that simulates the blacklisting of a chat. When this function is called with a `chat_id` and a `reason`, it should log that the chat has been blacklisted wi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert blacklist_chat(1, 'spam') == None\", \"assert blacklist_chat(2, 'harassment') == None\", \"assert blacklist_chat(3, 'inappropriate content') == None\", \"assert blacklist_chat(4, 'fake news') == None\", \"assert blacklist_chat(5, 'scam') == None\", \"assert ... | {
"split": "train",
"index": 81915,
"acecode_id": "bigcode_python_fns_48760",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You have a queue of integers and a sliding window size. Your task is to implement a function that returns the first unique integer in the queue within the specified sliding window. If there is no unique integer in the window, the function should return -1. Implement the functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert first_unique_in_window([2,3,5,5,2,3], 3) == 2\", \"assert first_unique_in_window([1,2,3,4,5], 5) == 1\", \"assert first_unique_in_window([4,4,4,4,4], 3) == -1\", \"assert first_unique_in_window([5,5,6,7,7,8], 4) == 6\", \"assert first_unique_in_window([8,7,6... | {
"split": "train",
"index": 81916,
"acecode_id": "evol_9797",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that adjusts the quantity of a specific item in a shopping cart. The function should take in two parameters: a dictionary representing the current state of the cart and a tuple containing an item identifier and the desired quantity. The c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert adjust_cart({'item1': 2, 'item2': 3}, ('item1', 5)) == {'item1': 5, 'item2': 3}\", \"assert adjust_cart({'item1': 2, 'item2': 3}, ('item2', 0)) == {'item1': 2}\", \"assert adjust_cart({}, ('item1', 3)) == {'item1': 3}\", \"assert adjust_cart({'item1': 2}, ('... | {
"split": "train",
"index": 81917,
"acecode_id": "bigcode_python_fns_27763",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `check_prime(num)` that determines whether a given positive integer `num` is a prime number. A prime number is defined as a number greater than 1 that cannot be formed by multiplying two smaller natural numbers. Your function should return `True` if `num` i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_prime(2) == True\", \"assert check_prime(3) == True\", \"assert check_prime(4) == False\", \"assert check_prime(5) == True\", \"assert check_prime(6) == False\", \"assert check_prime(7) == True\", \"assert check_prime(8) == False\", \"assert check_prim... | {
"split": "train",
"index": 81918,
"acecode_id": "evol_22007",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a string containing HTML content and returns a list of all hyperlinks (the values of the href attributes) found within the anchor tags. Your function should ignore any anchor tags that do not have an href attribute. The input HTML string may cont... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert scrape_links('<a href=\\\"http://example.com\\\">Link</a>') == ['http://example.com']\", \"assert scrape_links('<a href=\\\"http://example.com\\\">Link</a><a>No Link</a>') == ['http://example.com']\", \"assert scrape_links('<a href=\\\"https://www.google.com... | {
"split": "train",
"index": 81919,
"acecode_id": "evol_20979",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with updating a list of human phenotype ontology terms based on a given set of rules. You have a list of terms represented as strings. Your function should take this list and return a new list where each term is prefixed with 'HP_' and converted to uppercase. Imp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_hpo_terms(['term1', 'term2', 'term3']) == ['HP_TERM1', 'HP_TERM2', 'HP_TERM3']\", \"assert update_hpo_terms(['phenotype', 'trait']) == ['HP_PHENOTYPE', 'HP_TRAIT']\", \"assert update_hpo_terms([]) == []\", \"assert update_hpo_terms(['normal', 'abnorma... | {
"split": "train",
"index": 81920,
"acecode_id": "bigcode_python_fns_26719",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the signing up of a user in a system. The function `signup_user(request)` will take a dictionary `request` as input, which contains the following keys: 'method', 'POST', and 'session'. The 'method' key indicates whether... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert signup_user({'method': 'POST', 'POST': {'email': 'user@example.com', 'password': 'securepass123'}, 'session': {}}) == 'signup_success'\", \"assert signup_user({'method': 'POST', 'POST': {'email': 'user@example.com'}, 'session': {}}) == 'signup_failed'\", \"a... | {
"split": "train",
"index": 81921,
"acecode_id": "bigcode_python_fns_9924",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two input strings of equal length representing binary numbers, implement a function that performs a bitwise OR operation on these strings and returns the result. The bitwise OR operation compares each corresponding bit of the binary strings and returns '1' if at least one... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bitwise_or('1100', '1010') == '1110'\", \"assert bitwise_or('0000', '0000') == '0000'\", \"assert bitwise_or('1111', '1111') == '1111'\", \"assert bitwise_or('1010', '0101') == '1111'\", \"assert bitwise_or('1110', '0001') == '1111'\", \"assert bitwise_or('1... | {
"split": "train",
"index": 81922,
"acecode_id": "evol_20729",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `name`, write a function `simplify_name(name: str) -> str` that converts the `name` to lower-case ASCII characters for fuzzy comparisons. The function should normalize the string using the 'NFKD' normalization form, convert all characters to lower-case, and remov... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simplify_name('Alice') == b'alice'\", \"assert simplify_name('\\u00c9milie') == b'emilie'\", \"assert simplify_name('Fran\\u00e7ois') == b'francois'\", \"assert simplify_name('Andr\\u00e9') == b'andre'\", \"assert simplify_name('Zo\\u00eb') == b'zoe'\", \"as... | {
"split": "train",
"index": 81923,
"acecode_id": "bigcode_python_fns_1932",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing the number of boss wins for each player, write a function that returns the rank of a player based on their boss wins. The rank is determined by ordering the players in descending order of their boss wins. If two players have the same number... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rank_of_player([5, 3, 5, 2], 0) == 1\", \"assert rank_of_player([1, 2, 3, 4, 5], 4) == 1\", \"assert rank_of_player([3, 3, 3], 1) == 1\", \"assert rank_of_player([0, 0, 0, 0], 0) == 1\", \"assert rank_of_player([7, 2, 5, 5, 3], 4) == 3\", \"assert rank_of_pl... | {
"split": "train",
"index": 81924,
"acecode_id": "bigcode_python_fns_37347",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function `differentiate(numbers)` that takes a list of integers and returns two lists: one containing all the prime numbers and the other containing all the composite numbers. A prime number is defined as a natural number greater than 1 that cannot be formed by mult... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert differentiate([10, 11, 12, 13, 14, 15]) == ([11, 13], [10, 12, 14, 15])\", \"assert differentiate([1, 2, 3, 4, 5]) == ([2, 3, 5], [4])\", \"assert differentiate([0, 1, 2, 3, 4, 5]) == ([2, 3, 5], [4])\", \"assert differentiate([]) == ([], [])\", \"assert dif... | {
"split": "train",
"index": 81925,
"acecode_id": "evol_742",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of coordinates and returns the coordinates that are located in the first quadrant (where both x and y coordinates are positive). Each coordinate is represented as a tuple of integers (x, y). Your function should take... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_coordinates([(1, 2), (2, 3), (1, 2), (3, 1)]) == [(1, 2), (2, 3), (3, 1)]\", \"assert filter_coordinates([(0, 1), (1, 0), (1, 2), (2, 2), (3, 3)]) == [(1, 2), (2, 2), (3, 3)]\", \"assert filter_coordinates([(5, 5), (4, 4), (3, 3), (2, 2), (1, 1)]) == ... | {
"split": "train",
"index": 81926,
"acecode_id": "oss_16121",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to create a parameter representation for different statistical distributions. The function should accept a name for the parameter, a distribution type (either 'paretovariate', 'weibullvariate', or 'choice'), and the relevant parameter... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_param('param1', 'paretovariate', 1.5) == {'name': 'param1', 'distribution_type': 'paretovariate', 'parameters': (1.5,), 'kwargs': {}}\", \"assert create_param('param2', 'weibullvariate', 2.0, 5.0) == {'name': 'param2', 'distribution_type': 'weibullvar... | {
"split": "train",
"index": 81927,
"acecode_id": "oss_5593",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string, implement a function `most_frequent_substring(string: str, k: int) -> str` that finds the most frequent substring of the given string that has a length greater than or equal to k. If there are multiple substrings with the same highest frequency, return the one t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert most_frequent_substring('ababcabc', 3) == 'abc'\", \"assert most_frequent_substring('aaaaa', 1) == 'a'\", \"assert most_frequent_substring('hellohello', 4) == 'hell'\", \"assert most_frequent_substring('abcdef', 3) == 'abc'\", \"assert most_frequent_substrin... | {
"split": "train",
"index": 81928,
"acecode_id": "evol_20786",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function `generate_cipher_text()` that produces a cipher text based on the following conditions: the text must be exactly 15 characters in length, must include at least one punctuation character, at least one uppercase alphabetic character, at least one lowercase al... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_cipher_text() is not None\", \"assert len(generate_cipher_text()) == 15\", \"assert any(c.isupper() for c in generate_cipher_text())\", \"assert any(c.islower() for c in generate_cipher_text())\", \"assert any(c in string.punctuation for c in genera... | {
"split": "train",
"index": 81929,
"acecode_id": "evol_23575",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a custom exception handler in Python. Implement a class `CustomExceptionHandler` that has a method `set_exception_message` which takes a string parameter `message` and formats it into a specific exception message format: 'Error: {message} occurred!'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert CustomExceptionHandler('test').set_exception_message('foo') == 'Error: foo occurred!'\", \"assert CustomExceptionHandler('test').set_exception_message('bar') == 'Error: bar occurred!'\", \"assert CustomExceptionHandler('test').set_exception_message('baz') ==... | {
"split": "train",
"index": 81930,
"acecode_id": "oss_32586",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing the syslog configuration of a network edge device. The dictionary contains the following keys: 'enabled', 'protocol', and 'serverAddresses'. The 'enabled' key is a boolean that indicates if syslog is enabled. The 'protocol' key is a strin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_syslog_info({'enabled': False}) == 'Disabled'\", \"assert get_syslog_info({'enabled': True, 'protocol': 'UDP'}) == 'UDP'\", \"assert get_syslog_info({'enabled': True, 'protocol': 'TCP', 'serverAddresses': {'ipAddress': ['192.168.1.1', '192.168.1.2']}}) =... | {
"split": "train",
"index": 81931,
"acecode_id": "bigcode_python_fns_19675",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given two line segments defined by their endpoints in a 2D plane, determine if the two segments intersect. The segments are defined by the coordinates of their endpoints, where the first segment is represented by the points (x0, y0) and (x1, y1), and the second segment is repre... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert do_segments_intersect(((0, 0), (1, 1)), ((1, 0), (0, 1))) == True\", \"assert do_segments_intersect(((1, 1), (2, 2)), ((0, 0), (3, 3))) == True\", \"assert do_segments_intersect(((0, 0), (3, 3)), ((1, 1), (2, 2))) == True\", \"assert do_segments_intersect(((... | {
"split": "train",
"index": 81932,
"acecode_id": "bigcode_python_fns_8950",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Develop a function that replaces every occurrence of specific characters in a given string with a colon character. The function should accept a list of characters to replace and handle edge cases, such as null or empty strings. The function should also be able to manage input f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_characters('Hello, World!', [',', ' '], ':') == 'Hello::World!'\", \"assert replace_characters('', [' ', ',', '!'], ':') == ''\", \"assert replace_characters('\\u3053\\u3093\\u306b\\u3061\\u306f\\u3001\\u4e16\\u754c\\uff01', ['\\u3001', '\\uff01'], '... | {
"split": "train",
"index": 81933,
"acecode_id": "evol_24380",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple user authentication system that manages email validation tokens. The system should allow you to store and retrieve email validation tokens associated with specific actions and emails. You need to implement a function `manage_email_valid... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_email_validation_tokens('register', 'token123', 'user@example.com') is None\", \"assert manage_email_validation_tokens('register', 'token456', 'user2@example.com') is None\", \"assert manage_email_validation_tokens('login', 'token789', 'user3@example.... | {
"split": "train",
"index": 81934,
"acecode_id": "oss_11246",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the signed speed and principal direction of water currents based on given eastward and northward velocity components. You need to implement the function `sign_speed(east_vel, north_vel, spd, dir_vel, flooddir)` that ca... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sign_speed(0, 0, 0, 0, 0) == (0.0, 0.0)\", \"assert sign_speed(0, 5, 5, 90, 90) == (5.0, 90.0)\", \"assert sign_speed(0, -10, 10, 270, 90) == (-10.0, -90.0)\", \"assert sign_speed(1, 0, 1, 0, 0) == (1.0, 0.0)\", \"assert sign_speed(20, 0, 20, 0, 0) == (20.0,... | {
"split": "train",
"index": 81935,
"acecode_id": "oss_2499",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple bidding system for an auction. The function should accept a list of bids and return the highest bid along with the user who placed that bid. Each bid is represented as a tuple containing (user, bid_amount, bid_time... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_highest_bid([]) == None\", \"assert get_highest_bid([('User1', 100, datetime(2023, 10, 1, 10, 0)), ('User2', 150, datetime(2023, 10, 1, 10, 1))]) == ('User2', 150)\", \"assert get_highest_bid([('User1', 100, datetime(2023, 10, 1, 10, 0)), ('User2', 100, ... | {
"split": "train",
"index": 81936,
"acecode_id": "oss_33295",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function `generate_fibonacci(n)` that generates the Fibonacci sequence up to the `n`-th term. The function should take a single parameter `n`, which is a positive integer indicating the number of terms to generate. If `n` is less than or equal to 0, the function sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_fibonacci(1) == [0]\", \"assert generate_fibonacci(2) == [0, 1]\", \"assert generate_fibonacci(3) == [0, 1, 1]\", \"assert generate_fibonacci(4) == [0, 1, 1, 2]\", \"assert generate_fibonacci(5) == [0, 1, 1, 2, 3]\", \"assert generate_fibonacci(6) =... | {
"split": "train",
"index": 81937,
"acecode_id": "evol_15918",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of image tags represented as a list of dictionaries, where each dictionary contains the keys 'image_id' and 'tag_value'. Write a function `update_image_tag(tags: List[Dict[str, str]], image_id: str, tag_value: str) -> List[Dict[str, str]]` that updates the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_image_tag([{'image_id': 'img1', 'tag_value': 'nature'}, {'image_id': 'img2', 'tag_value': 'city'}], 'img1', 'landscape') == [{'image_id': 'img1', 'tag_value': 'landscape'}, {'image_id': 'img2', 'tag_value': 'city'}]\", \"assert update_image_tag([{'ima... | {
"split": "train",
"index": 81938,
"acecode_id": "bigcode_python_fns_4986",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a list of strings representing command-line arguments and returns a dictionary containing the parsed arguments. Each argument is in the form of '--key=value' or '--key' (for boolean flags). If an argument does no... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_arguments(['--name=John', '--age=25', '--verbose', 'invalid', 'value', '--age=30']) == {'name': 'John', 'age': '30', 'verbose': True}\", \"assert parse_arguments(['--single', '--multiple=value1', '--multiple=value2']) == {'single': True, 'multiple': 'v... | {
"split": "train",
"index": 81939,
"acecode_id": "oss_12311",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of report metadata dictionaries, each containing 'handle', 'title', and 'git_repo' fields, implement a function `register_reports(report_metadata_list)` that simulates the registration of these reports. The function should return a list of strings, where each strin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert register_reports([{'handle': 'report1', 'title': 'First Report', 'git_repo': 'repo1'}, {'handle': 'report2', 'title': 'Second Report', 'git_repo': 'repo2'}]) == ['Registered report titled: First Report', 'Registered report titled: Second Report']\", \"assert... | {
"split": "train",
"index": 81940,
"acecode_id": "bigcode_python_fns_9447",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a list of tokens and an integer n, write a function that returns a list of n-sized shingles (consecutive tuples) from the input list. A shingle is defined as a sequence of n consecutive elements from the list. If the input list has fewer than n elements, return an empty l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert list(shingles([1, 2, 3, 4], 2)) == [(1, 2), (2, 3), (3, 4)]\", \"assert list(shingles([1, 2, 3, 4], 3)) == [(1, 2, 3), (2, 3, 4)]\", \"assert list(shingles([1, 2, 3, 4], 1)) == [(1,), (2,), (3,), (4,)]\", \"assert list(shingles([1, 2, 3], 4)) == []\", \"asse... | {
"split": "train",
"index": 81941,
"acecode_id": "bigcode_python_fns_16112",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `median(l: list, cmp_func: callable)` that returns the median of elements in the list `l` without sorting it or using built-in functions. The function should handle duplicates, tuples with unequal counts of even and odd elements, and use `cmp_func` for comp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert median([3, 1, 2, 4, 5], lambda a, b: a - b) == 3\", \"assert median([1, 2, 2, 4, 5], lambda a, b: a - b) == 2\", \"assert median([2, 3, 1, 6, 5], lambda a, b: a - b) == 3\", \"assert median([5, 3, 3, 3, 6], lambda a, b: a - b) == 3\", \"assert median([1, 1, ... | {
"split": "train",
"index": 81942,
"acecode_id": "evol_25881",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that filters a list of keys based on their availability status. Each key is represented as a dictionary containing a 'key_token' field. The function should return a list of keys that have a 'key_token' value of 'FULL'. Implement a functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_full_keys([{'key_token': 'FULL'}, {'key_token': 'PARTIAL'}, {'key_token': 'FULL'}]) == [{'key_token': 'FULL'}, {'key_token': 'FULL'}]\", \"assert get_full_keys([{'key_token': 'NONE'}, {'key_token': 'PARTIAL'}, {'key_token': 'NONE'}]) == []\", \"assert ge... | {
"split": "train",
"index": 81943,
"acecode_id": "bigcode_python_fns_8577",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `validate_student` that takes a dictionary representing a student's data and validates the entries. The dictionary will have the following keys: 'ID', 'name', 'age', and 'courses'. The function should return a list of error messages for invalid entries. The 'ID... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_student({'ID': 123, 'name': 'Alice', 'age': 20, 'courses': ['Math', 'Science']}) == []\", \"assert validate_student({'ID': '123', 'name': 'Alice', 'age': 20, 'courses': ['Math', 'Science']}) == ['ID must be an integer']\", \"assert validate_student(... | {
"split": "train",
"index": 81944,
"acecode_id": "evol_34216",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks if a given message is a forwarded message containing a .gif file. The function should take a dictionary representing a message with keys for 'content_type', 'is_forwarded', and 'mime_type'. The function should return True ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check({'content_type': 'gif', 'is_forwarded': True, 'mime_type': 'image/gif'}) == True\", \"assert check({'content_type': 'gif', 'is_forwarded': False, 'mime_type': 'image/gif'}) == False\", \"assert check({'content_type': 'video', 'is_forwarded': True, 'mim... | {
"split": "train",
"index": 81945,
"acecode_id": "evol_22693",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a custom parser for a simplified markup language. The parser processes input tokens representing tags and attributes. Your task is to implement a function `parse_tokens(tokens: List[Tuple[str, str]]) -> List[Tuple[str, str, int]]` that takes a l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_tokens([('tag', 'cache'), ('attribute', 'size'), ('tag', 'data')]) == [('tag', 'cache', 1), ('attribute', 'size', 2), ('tag', 'data', 3)]\", \"assert parse_tokens([('attribute', 'color'), ('tag', 'header'), ('tag', 'footer')]) == [('attribute', 'color'... | {
"split": "train",
"index": 81946,
"acecode_id": "oss_6605",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a configuration for Cross-Origin Resource Sharing (CORS) for a web application. The function should take in the following parameters: a list of allowed origins (domains), a boolean indicating whether credentials should be i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_cors_configuration(['https://example.com'], True, ['GET'], ['Authorization']) == {'allow_origins': ['https://example.com'], 'allow_credentials': True, 'allow_methods': ['GET'], 'allow_headers': ['Authorization']}\", \"assert generate_cors_configurat... | {
"split": "train",
"index": 81947,
"acecode_id": "oss_35479",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates setting the speed of a motor on a vest controlled by an Arduino board. The function should take two parameters: the motor identifier (a string) and the speed (an integer). Your goal is to return a string that indicates ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_motor_speed('g', 10) == 'Motor g set to 10'\", \"assert set_motor_speed('a', 5) == 'Motor a set to 5'\", \"assert set_motor_speed('b', 0) == 'Motor b set to 0'\", \"assert set_motor_speed('c', -5) == 'Motor c set to -5'\", \"assert set_motor_speed('d', 1... | {
"split": "train",
"index": 81948,
"acecode_id": "oss_36785",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing memory sizes in megabytes, write a function that calculates the total memory size available across all devices. The function should take a list of integers as input and return a single integer representing the total memory. If the input lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert total_memory([256, 512, 1024]) == 1792\", \"assert total_memory([]) == 0\", \"assert total_memory([128, 256, 64]) == 448\", \"assert total_memory([2048]) == 2048\", \"assert total_memory([512, 512]) == 1024\", \"assert total_memory([100, 200, 300, 400]) == 1... | {
"split": "train",
"index": 81949,
"acecode_id": "bigcode_python_fns_34717",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program that simulates a simple game of rock-paper-scissors. The program should take two inputs, each representing a player's choice of either 'rock,' 'paper,' or 'scissors.' Your task is to write a Python function `rock_paper_scissors(player1, pl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rock_paper_scissors('rock', 'scissors') == 'Player 1 wins.'\", \"assert rock_paper_scissors('paper', 'rock') == 'Player 1 wins.'\", \"assert rock_paper_scissors('scissors', 'paper') == 'Player 1 wins.'\", \"assert rock_paper_scissors('rock', 'paper') == 'Pla... | {
"split": "train",
"index": 81950,
"acecode_id": "oss_4892",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function `calculate_modulus(arr)` that takes a list of numbers (which can include real numbers, complex numbers, and strings) and returns a list of their modulus. If an element in the list is a string or non-numeric character, that element should be ignored, and no ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_modulus([3, 4, 5]) == [3, 4, 5]\", \"assert calculate_modulus([3 + 4j, 1 + 1j]) == [5.0, 1.4142135623730951]\", \"assert calculate_modulus(['a', 'b', 3 + 4j]) == [5.0]\", \"assert calculate_modulus([]) == []\", \"assert calculate_modulus([1, 2, 'he... | {
"split": "train",
"index": 81951,
"acecode_id": "evol_10359",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks whether a given string is a valid palindrome. A palindrome is a string that reads the same forward and backward, ignoring spaces, punctuation, and capitalization. Your function should take a single string as input and retu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_palindrome('A man, a plan, a canal: Panama') == True\", \"assert is_palindrome('race a car') == False\", \"assert is_palindrome('') == True\", \"assert is_palindrome(' ') == True\", \"assert is_palindrome('No lemon, no melon') == True\", \"assert is_palin... | {
"split": "train",
"index": 81952,
"acecode_id": "oss_8001",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that takes a list of boolean values as input and returns a frozen set containing the unique boolean values from the input list. Your function should correctly handle cases with duplicate values, as well as empty lists. Write a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_boolean_frozenset([]) == frozenset()\", \"assert parse_boolean_frozenset([True]) == frozenset({True})\", \"assert parse_boolean_frozenset([False]) == frozenset({False})\", \"assert parse_boolean_frozenset([True, True, True]) == frozenset({True})\", \"a... | {
"split": "train",
"index": 81953,
"acecode_id": "oss_7039",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `s`, implement a function `increment_string(s)` that increments each character in the string by one in the ASCII table. The function should return the new string after all characters have been incremented. For example, if the input is 'abc', the output should be ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert increment_string('abc') == 'bcd'\", \"assert increment_string('Hello') == 'Ifmmp'\", \"assert increment_string('!') == '\\\"'\", \"assert increment_string(' ') == '!'\", \"assert increment_string('123') == '234'\", \"assert increment_string('aA') == 'bB'\", ... | {
"split": "train",
"index": 81954,
"acecode_id": "evol_31810",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `reflect(s: str) -> str` that takes an alphanumeric string `s` and generates the reflection or mirror inversion of the string. Additionally, reverse the order of words in the string while keeping the individual characters in each word in their original orde... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reflect('Hello World') == 'World Hello'\", \"assert reflect('Python is fun') == 'fun is Python'\", \"assert reflect('123 456') == '456 123'\", \"assert reflect('a b c d') == 'd c b a'\", \"assert reflect('OpenAI GPT') == 'GPT OpenAI'\", \"assert reflect('Mir... | {
"split": "train",
"index": 81955,
"acecode_id": "evol_24133",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes in a list of numbers and returns the greatest number along with its indices in the list. If the greatest number occurs more than once, include all of its indices. For example, if the input list is [8, 2, 14, 25, 25], the function should return (25, [... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max_val_indices([8, 2, 14, 25, 25]) == (25, [3, 4])\", \"assert find_max_val_indices([1, 2, 3, 4, 5]) == (5, [4])\", \"assert find_max_val_indices([-1, -2, -3, -4, -5]) == (-1, [0])\", \"assert find_max_val_indices([10, 20, 30, 40, 30, 20, 10]) == (40, ... | {
"split": "train",
"index": 81956,
"acecode_id": "evol_16946",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D list of integers, representing a dataset `S`. Your task is to write a function `calculate_T_and_N(S)` that takes this dataset as input and returns a tuple `(T, N)`. Here, `T` is the total number of rows in the dataset `S`, and `N` is a list containing the sum... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_T_and_N([[1, 2], [3, 4]]) == (2, [4, 6])\", \"assert calculate_T_and_N([[1], [2], [3]]) == (3, [6])\", \"assert calculate_T_and_N([[10, 20], [30, 40]]) == (2, [40, 60])\", \"assert calculate_T_and_N([[0, 0], [0, 0]]) == (2, [0, 0])\", \"assert calc... | {
"split": "train",
"index": 81957,
"acecode_id": "oss_15689",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a function that controls a pulse generator. The function should turn off the burst mode of the pulse generator for a specified channel. The function takes three parameters: a pulse generator identifier represented as a string, a channel number (1 or 2), and a bool... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_burst_mode_off('PulseGenerator1', 1, False) is None\", \"assert set_burst_mode_off('PulseGenerator1', 2, False) is None\", \"assert set_burst_mode_off('PulseGenerator1', 1, True) is None\", \"assert set_burst_mode_off('PulseGenerator1', 2, True) is None\... | {
"split": "train",
"index": 81958,
"acecode_id": "bigcode_python_fns_49535",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple communication test framework in Python. You need to implement a function called `send_test_data` that simulates sending test data. The function should print 'Sending test data...' when called. Your task is to ensure that the function works ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert send_test_data() == 'Sending test data...'\", \"assert send_test_data() == 'Sending test data...'\", \"assert send_test_data() == 'Sending test data...'\", \"assert send_test_data() == 'Sending test data...'\", \"assert send_test_data() == 'Sending test data... | {
"split": "train",
"index": 81959,
"acecode_id": "oss_16589",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings that represent entries in the format 'key:value', write a function that processes these entries to create a dictionary containing a maximum of ten unique key-value pairs. If there are duplicate keys, only the first occurrence should be retained. The func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_dictionary(['key1:value1', 'key2:value2', 'key3:value3', 'key4:value4', 'key5:value5', 'key6:value6', 'key7:value7', 'key8:value8', 'key9:value9', 'key10:value10']) == {'key1': 'value1', 'key2': 'value2', 'key3': 'value3', 'key4': 'value4', 'key5': 'v... | {
"split": "train",
"index": 81960,
"acecode_id": "evol_6997",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `sort_and_sum_primes(num_array)` that takes a list of integers `num_array` and sorts it in descending order while preserving the order of occurrence for duplicate integers. After sorting, the function should return the sum of all prime numbers in the sorted lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_and_sum_primes([4, 7, 2, 9, 6, 7, 9]) == 16\", \"assert sort_and_sum_primes([1, 4, 6, 8, 10]) == 0\", \"assert sort_and_sum_primes([2, 3, 5, 7, 11]) == 28\", \"assert sort_and_sum_primes([5, 5, 5, 5]) == 20\", \"assert sort_and_sum_primes([23, 29, 31, 3... | {
"split": "train",
"index": 81961,
"acecode_id": "evol_30700",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of atoms represented by their symbols and a corresponding list of their coordinates in 3D space. Implement a function `resonance_averaged_bond_order(atom1_index: int, atom2_index: int) -> float` that calculates the resonance-averaged bond order between two ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert resonance_averaged_bond_order(0, 1) == 1.0\", \"assert resonance_averaged_bond_order(0, 2) == 1.0\", \"assert resonance_averaged_bond_order(1, 2) == 0.0\", \"assert resonance_averaged_bond_order(0, 0) == 1.0\", \"assert resonance_averaged_bond_order(1, 1) ==... | {
"split": "train",
"index": 81962,
"acecode_id": "bigcode_python_fns_45089",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a decorator for a method in a Twitter client. The function `patch_twitter_get_following_users(value)` should take a single parameter `value`, which represents a list of user IDs. The function should return a new function th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert patch_twitter_get_following_users([1, 2, 3])() == [1, 2, 3]\", \"assert patch_twitter_get_following_users([])() == []\", \"assert patch_twitter_get_following_users([100, 200, 300])() == [100, 200, 300]\", \"assert patch_twitter_get_following_users(['user1', ... | {
"split": "train",
"index": 81963,
"acecode_id": "bigcode_python_fns_31007",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of buildings in a city. Your task is to implement a function that returns a new list of integers where each element at index 'i' represents the number of buildings that are taller than the building at index 'i' to its ri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_taller_buildings([5, 4, 3, 2, 1]) == [0, 0, 0, 0, 0]\", \"assert count_taller_buildings([1, 1, 1, 1]) == [0, 0, 0, 0]\", \"assert count_taller_buildings([0, 0, 0, 0]) == [0, 0, 0, 0]\", \"assert count_taller_buildings([5]) == [0]\", \"assert count_tall... | {
"split": "train",
"index": 81964,
"acecode_id": "bigcode_python_fns_36399",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers and two indices i and j, implement a function that swaps the elements at these indices in the array. The function should return the modified array after the swap. The input array will have at least two elements and the indices will always be valid.\nP... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert swap_elements([3, 5, 7, 4, 9, 2], 1, 4) == [3, 9, 7, 4, 5, 2]\", \"assert swap_elements([1, 2, 3, 4, 5], 0, 2) == [3, 2, 1, 4, 5]\", \"assert swap_elements([10, 20, 30, 40, 50], 2, 3) == [10, 20, 40, 30, 50]\", \"assert swap_elements([5, 10, 15], 0, 1) == [1... | {
"split": "train",
"index": 81965,
"acecode_id": "evol_17372",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `compute_statistics(numbers: List[float]) -> Dict[str, float]` that accepts a list of floating-point numbers and returns a dictionary containing the average, minimum, maximum, and standard deviation of the numbers. If the input list is empty, raise a ValueError... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_statistics([0.0, 0.0, 0.0]) == {'average': 0.0, 'minimum': 0.0, 'maximum': 0.0, 'standard_deviation': 0.0}\", \"assert compute_statistics([5.5]) == {'average': 5.5, 'minimum': 5.5, 'maximum': 5.5, 'standard_deviation': 0.0}\", \"assert compute_statis... | {
"split": "train",
"index": 81966,
"acecode_id": "evol_21965",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of towers. Your task is to implement a function that determines the maximum height of a tower that can be built using consecutive towers of the same height. The function should take a list of integers as input and return... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_consecutive_tower_height([1, 1, 2, 2, 2, 3]) == 6\", \"assert max_consecutive_tower_height([3, 3, 3, 1, 1, 1]) == 9\", \"assert max_consecutive_tower_height([1, 2, 3, 4, 5]) == 0\", \"assert max_consecutive_tower_height([2, 2, 2, 2, 2]) == 10\", \"assert... | {
"split": "train",
"index": 81967,
"acecode_id": "bigcode_python_fns_15595",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a player's points based on their actions in a game. The player starts with a certain number of points and has a designated threshold to reach. The function should take a list of actions as input, where each action can eithe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_points(['lose', 'lose', 'lose'], 50, 100) == -10\", \"assert calculate_points(['win', 'win', 'win', 'win', 'win', 'win'], 50, 100) == 110\", \"assert calculate_points([], 50, 100) == 50\", \"assert calculate_points(['lose', 'lose', 'lose', 'lose', ... | {
"split": "train",
"index": 81968,
"acecode_id": "evol_20375",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a list of entries, where each entry is a string representing a user's activity. Your task is to implement a function that takes this list of entries and returns a dictionary containing the most frequent entries along with their counts. The function should accept t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert most_frequent_entries(['a', 'b', 'a', 'c', 'b', 'a', 'd', 'c'], 3) == {'a': 3, 'b': 2, 'c': 2}\", \"assert most_frequent_entries(['x', 'y', 'z', 'x', 'y', 'x', 'w'], 2) == {'x': 3, 'y': 2}\", \"assert most_frequent_entries(['apple', 'banana', 'apple', 'orang... | {
"split": "train",
"index": 81969,
"acecode_id": "bigcode_python_fns_6887",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing text written in Markdown format. Your task is to implement a function that converts this Markdown text into its corresponding HTML representation. The Markdown format includes headers, bold text, italic text, and unordered lists. Implement th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_markdown_to_html('# Header 1') == '<h1>Header 1</h1>'\", \"assert convert_markdown_to_html('**bold**') == '<strong>bold</strong>'\", \"assert convert_markdown_to_html('*italic*') == '<em>italic</em>'\", \"assert convert_markdown_to_html('**bold** and... | {
"split": "train",
"index": 81970,
"acecode_id": "bigcode_python_fns_45238",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes in a list of vehicle locations represented as tuples containing latitude and longitude. Your function should return the most recent latitude and longitude of a vehicle from the list. If the list is empty, return (False, False).... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_most_recent_location([]) == (False, False)\", \"assert get_most_recent_location([(34.0522, -118.2437)]) == (34.0522, -118.2437)\", \"assert get_most_recent_location([(39.7392, -104.9903)]) == (39.7392, -104.9903)\", \"assert get_most_recent_location([(55... | {
"split": "train",
"index": 81971,
"acecode_id": "bigcode_python_fns_17640",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a deployment configuration dictionary for a containerized application. Implement a function `generate_deployment_config` that takes in the following parameters: \n- `framework` (string): The framework used by the application (can be `None`). \n- `ap... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_deployment_config(None, 'my_app') == {'template_path': 'framework_template_path', 'path': 'dockerfile_path', 'vars': ['VAR1', 'VAR2'], 'container_list': ['my_app']}\", \"assert generate_deployment_config('Flask', 'web_app') == {'template_path': 'fra... | {
"split": "train",
"index": 81972,
"acecode_id": "oss_18723",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `greet_or_farewell(bool_value: bool, str_value: str) -> str` that takes a boolean value and a string as parameters. If the boolean value is True, the function should return 'Hello' followed by the string. If the boolean value is False, the function should r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert greet_or_farewell(True, 'World') == 'Hello World'\", \"assert greet_or_farewell(False, 'World') == 'Bye World'\", \"assert greet_or_farewell(True, '') == 'Hello '\", \"assert greet_or_farewell(False, '') == 'Bye '\", \"assert greet_or_farewell(True, 'Special... | {
"split": "train",
"index": 81973,
"acecode_id": "evol_5022",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that returns the sum of all the even numbers in the list. The function should take a single parameter, a list of integers, and return an integer representing the sum of the even integers. If there are no even numbers, the function ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([10, 21, 32, 43, 54]) == 96\", \"assert sum_of_evens([0, 2, 4, 6, 8]) == 20\", \"assert sum_of_evens([-2, -4, -6]) == -12\", \"assert sum_of_evens([-1, -3, -5]) == 0\", \"assert sum_of_evens([]) == ... | {
"split": "train",
"index": 81974,
"acecode_id": "bigcode_python_fns_47561",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a Unicode code point as an integer, determine whether it is part of the 'Mathematical Alphanumeric Symbols' block in the Unicode standard. This block includes characters that are typically used in mathematical notation, such as bold and italic letters and numbers. The ran... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_mathematical_alphanumeric_symbol(0x1D400) == True\", \"assert is_mathematical_alphanumeric_symbol(0x1D7FF) == True\", \"assert is_mathematical_alphanumeric_symbol(0x1D401) == True\", \"assert is_mathematical_alphanumeric_symbol(0x1D7EE) == True\", \"asser... | {
"split": "train",
"index": 81975,
"acecode_id": "bigcode_python_fns_40718",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of lists, where each inner list represents a row of numbers. Your task is to implement a function that removes rows from the list where the proportion of zeros is equal to or higher than a specified threshold. The function should take three parameters: a li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_zeros([[0, 0, 0], [1, 2, 3], [4, 0, 0]], 0.666, 0) == [[1, 2, 3]]\", \"assert remove_zeros([[1, 1, 1], [1, 0, 0], [0, 0, 0]], 0.5, 0) == [[1, 1, 1]]\", \"assert remove_zeros([[1, 0, 0], [2, 2, 2], [0, 0, 0]], 0.5, 0) == [[2, 2, 2]]\", \"assert remove_... | {
"split": "train",
"index": 81976,
"acecode_id": "bigcode_python_fns_44906",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Create a function `get_grocery_inventory()` that returns a dictionary representing a grocery outlet's inventory. The inventory should include the following items and their respective quantities: Apple: 10, Orange: 20, Banana: 5, Grapes: 15. The function should not take any para... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_grocery_inventory() == {'Apple': 10, 'Orange': 20, 'Banana': 5, 'Grapes': 15}\", \"assert type(get_grocery_inventory()) == dict\", \"assert 'Apple' in get_grocery_inventory()\", \"assert get_grocery_inventory()['Apple'] == 10\", \"assert 'Orange' in get_... | {
"split": "train",
"index": 81977,
"acecode_id": "evol_35877",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with validating and processing user data for a web service. Write a function `store_user_data(client_id, content)` that takes in two parameters: `client_id` and `content`. The function should perform the following checks: \n1. Validate that `client_id` is a non-e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert store_user_data('user123', 'User data content') == 'User data stored successfully.'\", \"assert store_user_data('valid_id_123', 'Some content here') == 'User data stored successfully.'\", \"assert store_user_data('valid_id', 'This is valid content') == 'User... | {
"split": "train",
"index": 81978,
"acecode_id": "oss_9290",
"num_tests": 4
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers, `latitudes` and `longitudes`, representing the geographical coordinates of various points, and an integer `elevation_angle` representing the elevation angle in degrees, write a function `rain_probability(latitudes: List[int], longitudes: List[int], ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rain_probability([0, 0], [0, 0], 45) == [0.0, 0.0]\", \"assert rain_probability([45], [-45], 15) == [0.0]\", \"assert rain_probability([100], [-100], 90) == [0.0]\", \"assert rain_probability([0], [180], 50) == [90.0]\", \"assert rain_probability([-90], [90]... | {
"split": "train",
"index": 81979,
"acecode_id": "bigcode_python_fns_11863",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that initializes a configuration object for a model based on the PASCAL VOC dataset. The function should return a dictionary containing various hyperparameters for the model, such as image dimensions, batch size, learning rate, and loss c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert init_model_config() == {'DEBUG_MODE': False, 'DATA_AUG_TYPE': 'YOLO', 'IMAGE_WIDTH': 416, 'IMAGE_HEIGHT': 416, 'BATCH_SIZE': 32, 'WEIGHT_DECAY': 0.0001, 'LEARNING_RATE': 0.001, 'DECAY_STEPS': 20000.0, 'MAX_GRAD_NORM': 1.0, 'MOMENTUM': 0.9, 'LR_DECAY_FACTOR':... | {
"split": "train",
"index": 81980,
"acecode_id": "bigcode_python_fns_38574",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that localizes a given datetime object to GMT-3 and then applies a buffer of -30 minutes. Write a function `localize_and_buffer_datetime` that takes a `datetime` object `dt_object` as input and returns a new `datetime` object that has... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert localize_and_buffer_datetime(datetime(2023, 2, 28, 23, 59)) == datetime(2023, 2, 28, 20, 29, tzinfo=timezone(timedelta(hours=-3)))\", \"assert localize_and_buffer_datetime(datetime(2023, 12, 31, 23, 59)) == datetime(2023, 12, 31, 20, 29, tzinfo=timezone(time... | {
"split": "train",
"index": 81981,
"acecode_id": "oss_2623",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_and_modify_matrix(rows: int, cols: int, initial_value: int, modifications: List[Tuple[int, int, int]]) -> List[List[int]]` that creates a multi-dimensional array (matrix) with the specified number of rows and columns, each initialized to `initial_va... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_and_modify_matrix(3, 3, 0, [(1, 1, 5)]) == [[0, 0, 0], [0, 5, 0], [0, 0, 0]]\", \"assert create_and_modify_matrix(2, 2, 1, [(0, 0, 3), (1, 1, 4)]) == [[3, 1], [1, 4]]\", \"assert create_and_modify_matrix(1, 1, 10, [(0, 0, 20)]) == [[20]]\", \"assert c... | {
"split": "train",
"index": 81982,
"acecode_id": "evol_17091",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that changes the user's preferred currency based on a given input. The function should take a currency code as input and return a message confirming the change along with the corresponding currency symbol. Given a dictionary of curren... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert change_currency('USD', {'USD': {'symbol': '$'}, 'EUR': {'symbol': '\\u20ac'}}) == 'Currency has been changed to USD ($)'\", \"assert change_currency('EUR', {'USD': {'symbol': '$'}, 'EUR': {'symbol': '\\u20ac'}}) == 'Currency has been changed to EUR (\\u20ac)... | {
"split": "train",
"index": 81983,
"acecode_id": "bigcode_python_fns_12953",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of file paths and returns a list of paths that correspond to .DS_Store files. A .DS_Store file is identified by its file name, which must end with '.DS_Store'. Your function should ignore case sensitivity when checking t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_ds_store_files(['path/to/file.txt', 'path/to/.DS_Store', 'path/to/anotherFile.DS_Store']) == ['path/to/.DS_Store', 'path/to/anotherFile.DS_Store']\", \"assert find_ds_store_files([]) == []\", \"assert find_ds_store_files(['temp/.DS_Store', 'temp/.DS_STO... | {
"split": "train",
"index": 81984,
"acecode_id": "bigcode_python_fns_39238",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given two sequences of binary labels, `y_true` and `y_pred`, which are lists of integers (0s and 1s). Your task is to calculate the Hamming distance between these two sequences. The Hamming distance is defined as the proportion of positions at which the corresponding el... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hamming_distance([0, 1, 0, 1], [1, 0, 1, 0]) == 1.0\", \"assert hamming_distance([0, 0, 0, 0], [0, 0, 0, 0]) == 0.0\", \"assert hamming_distance([1, 1, 1, 1], [0, 0, 0, 0]) == 1.0\", \"assert hamming_distance([1, 0, 1, 0], [1, 0, 1, 0]) == 0.0\", \"assert ha... | {
"split": "train",
"index": 81985,
"acecode_id": "bigcode_python_fns_12428",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the temperatures in degrees Celsius for a week (7 days). Your task is to implement a function that returns a list of integers where each element at index `i` represents the number of days until a warmer temperature. If there is no f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert days_until_warmer([73, 74, 75, 71, 69, 72, 76, 73]) == [1, 1, 4, 2, 1, 1, 0, 0]\", \"assert days_until_warmer([80, 70, 60, 50, 40, 30, 20]) == [0, 0, 0, 0, 0, 0, 0]\", \"assert days_until_warmer([50, 50, 50, 50, 50, 50, 50]) == [0, 0, 0, 0, 0, 0, 0]\", \"ass... | {
"split": "train",
"index": 81986,
"acecode_id": "bigcode_python_fns_48272",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that updates an attribute of a real estate property given its ID. The function should accept the property ID, the attribute to modify, and the new value for that attribute. The attributes that can be modified are the owner's ID, address, p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_property(1, 'i', 5) == {'id': 1, 'cliente_id': 5, 'indirizzo': '', 'prezzo': 0, 'classe_energ': ''}\", \"assert update_property(2, 'd', '123 Main St') == {'id': 2, 'cliente_id': 0, 'indirizzo': '123 Main St', 'prezzo': 0, 'classe_energ': ''}\", \"asse... | {
"split": "train",
"index": 81987,
"acecode_id": "bigcode_python_fns_14866",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a new multi-dimensional array from the given multi-dimensional array by replacing all the prime numbers with 0. The dimension and depth of the input array can be variable. You should do this without using any built-in function to check for primes. Implement the function ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_primes_with_zero([1, 4, 6]) == [1, 4, 6]\", \"assert replace_primes_with_zero([[2, 3, 4], [5, 6, 7]]) == [[0, 0, 4], [0, 6, 0]]\", \"assert replace_primes_with_zero([[10, 12], [15, [17, 18]]]) == [[10, 12], [15, [0, 18]]]\", \"assert replace_primes_w... | {
"split": "train",
"index": 81988,
"acecode_id": "evol_35027",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with analyzing the results of an experiment that measures free energy. Given the expected free energy (DeltaF, dDeltaF) and the obtained free energy (DeltaF, dDeltaF) from the experiment, your goal is to compute the Z-score, which is used to determine if the expe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_experiment('Experiment 1', (1.0, 0.1), (1.05, 0.1)) == 'Experiment: Experiment 1 - OK\\\\n\\\\tExpected: 1.0 +- 0.1 kcal/mol\\\\n\\\\tObtained: 1.05 +- 0.1 kcal/mol\\\\n\\\\tZ-score: 0.500'\", \"assert analyze_experiment('Experiment 2', (2.0, 0.2), (... | {
"split": "train",
"index": 81989,
"acecode_id": "bigcode_python_fns_45354",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a string that may contain uppercase and lowercase letters. Your task is to implement a function that transforms the string into a new string where all uppercase letters are converted to lowercase, and all lowercase letters are converted to uppercase. Write a funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_case('HelloWorld') == 'hELLOwORLD'\", \"assert transform_case('LeetCode') == 'lEETcODE'\", \"assert transform_case('PythonIsFun') == 'pYTHONiSfUN'\", \"assert transform_case('OpenAI') == 'oPENai'\", \"assert transform_case('1234') == '1234'\", \"as... | {
"split": "train",
"index": 81990,
"acecode_id": "bigcode_python_fns_39633",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with developing a function that takes a list of integers and returns a new list containing only the unique integers from the input list, preserving their original order. Your function should not use any external libraries. Implement the function `remove_duplicate... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_duplicates([1, 2, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert remove_duplicates([5, 5, 5, 5]) == [5]\", \"assert remove_duplicates([]) == []\", \"assert remove_duplicates([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert remove_duplicates([1, 2, 3, 2, 1]) == ... | {
"split": "train",
"index": 81991,
"acecode_id": "oss_29884",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with analyzing a list of database schema modification commands written in Alembic. Write a function that takes a list of Alembic commands and returns a summary of the schema modifications. The summary should include the tables affected, the types of modifications... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_alembic_commands([\\\"op.drop_column('users', 'age')\\\", \\\"op.add_column('users', sa.Column('email', sa.String(length=255), nullable=True))\\\", \\\"op.drop_constraint(None, 'users', type_='foreignkey')\\\"]) == {'users': {'drop_column': ['age'], ... | {
"split": "train",
"index": 81992,
"acecode_id": "oss_33083",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates starting a web application. The function should take an optional parameter 'host' which specifies the IP address to bind the application to. If 'host' is not provided, it should default to '127.0.0.1'. The function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert start_app() == '127.0.0.1'\", \"assert start_app('192.168.1.1') == '192.168.1.1'\", \"assert start_app('0.0.0.0') == '0.0.0.0'\", \"assert start_app('10.0.0.5') == '10.0.0.5'\", \"assert start_app('255.255.255.255') == '255.255.255.255'\", \"assert start_app... | {
"split": "train",
"index": 81993,
"acecode_id": "bigcode_python_fns_1804",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a weighted directed graph represented as an adjacency list and a corresponding weight list. Your task is to implement a function `bellman_ford(graph, source)` that determines the minimum distance from a given source vertex to all other vertices in the graph using ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bellman_ford({'A': [('B', 1), ('C', 4)], 'B': [('C', 2), ('D', 5)], 'C': [('D', 1)], 'D': []}, 'A') == {'A': 0, 'B': 1, 'C': 3, 'D': 4}\", \"assert bellman_ford({'A': [('B', 2)], 'B': [('C', 3)], 'C': [], 'D': [('A', 1)]}, 'A') == {'A': 0, 'B': 2, 'C': 5, 'D... | {
"split": "train",
"index": 81994,
"acecode_id": "bigcode_python_fns_33420",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a URL. Your task is to extract the base URL and the endpoint from the given string. The base URL is defined as the part of the URL up to the last '/' character, while the endpoint is the part after the last '/' character. Write a function `ex... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_base_and_endpoint('https://example.com/api/v1/resource/123') == ('https://example.com/api/v1/resource', '123')\", \"assert extract_base_and_endpoint('http://localhost:8080/test/path/to/resource') == ('http://localhost:8080/test/path/to', 'resource')\... | {
"split": "train",
"index": 81995,
"acecode_id": "bigcode_python_fns_41821",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a three-dimensional array, implement a function to find the product of all non-zero elements in the array. If the input array is empty or null, return 1. The function should handle nested lists representing the three-dimensional structure.\nPlease reason step by step, the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_product([]) == 1\", \"assert find_product(None) == 1\", \"assert find_product([[[1, 2], [3]], [[4, 0], [5, 6]]]) == 720\", \"assert find_product([[[0, 0], [0]], [[0, 0], [0]]]) == 1\", \"assert find_product([[[1, 2, 3]], [[4, 5, 6]]]) == 720\", \"assert... | {
"split": "train",
"index": 81996,
"acecode_id": "evol_17333",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, write a function that returns a list of the longest strings from the input list. If there are multiple strings of the maximum length, return all of them in the order they appeared in the input list.\nPlease reason step by step, then write a self-contain... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longest_strings(['A', 'B', 'C', 'D', 'E']) == ['A', 'B', 'C', 'D', 'E']\", \"assert longest_strings(['one', 'two', 'three', 'four']) == ['three']\", \"assert longest_strings(['short', 'longer', 'longest', 'tiny']) == ['longest']\", \"assert longest_strings([... | {
"split": "train",
"index": 81997,
"acecode_id": "evol_3074",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function to find the closest pair of points in a given list of points, considering the minimum Manhattan distance between the points. The function should return the coordinates of the closest pair of points as a tuple. If there are multiple pairs with the same minimum d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert min_distance_pair([(0, 0), (1, 1), (2, 2)]) == ((0, 0), (1, 1))\", \"assert min_distance_pair([(1, 2), (2, 3), (4, 5)]) == ((1, 2), (2, 3))\", \"assert min_distance_pair([(3, 4), (1, 2), (1, 3)]) == ((1, 2), (1, 3))\", \"assert min_distance_pair([(0, 0), (0,... | {
"split": "train",
"index": 81998,
"acecode_id": "evol_31961",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple post storage system in Python. Your goal is to create a `PostStore` class that allows adding posts to a store and retrieving all posts. The `PostStore` class should have two methods: `add(post)`, which adds a post to the store, and `get... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_posts() == ['Welcome to my blog!', 'Python is awesome!', 'LeetCode is a great platform to practice coding!']\", \"assert manage_posts() != []\", \"assert len(manage_posts()) == 3\", \"assert 'Welcome to my blog!' in manage_posts()\", \"assert 'Python ... | {
"split": "train",
"index": 81999,
"acecode_id": "oss_21421",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.