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 run ID string for a training session based on a given configuration dictionary. The configuration dictionary contains a key '--timestamp' which, if set to True, indicates that the run ID should include the current timesta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_run_id({'--timestamp': False}) == 'run-id-3DBall'\", \"assert generate_run_id({'--other-key': True}) == 'run-id-3DBall'\", \"assert generate_run_id({}) == 'run-id-3DBall'\", \"assert generate_run_id({'--timestamp': False, '--run-id': 'example'}) == ... | {
"split": "train",
"index": 81300,
"acecode_id": "bigcode_python_fns_44180",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that takes a dictionary representing configurations for an application and returns the admin configuration settings. Your task is to implement the function `get_admin_config(config)` which accepts the `config` dictionary as an argu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_admin_config({'admin': {'username': 'admin_user', 'password': 'admin_pass'}}) == {'username': 'admin_user', 'password': 'admin_pass'}\", \"assert get_admin_config({'admin': {}}) == {}\", \"assert get_admin_config({'user': {'username': 'user1'}}) == {}\",... | {
"split": "train",
"index": 81301,
"acecode_id": "oss_16063",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with analyzing the performance metrics of a software project by calculating the Project Management Index (PMI). The PMI is defined as the ratio of the number of open defects to the total number of defects in the project. You are given a list of defects where each... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_pmi([True, False, True, False]) == 0.5\", \"assert calculate_pmi([True, True, True]) == 1.0\", \"assert calculate_pmi([False, False, False]) == 0.0\", \"assert calculate_pmi([]) == 0.0\", \"assert calculate_pmi([True]) == 1.0\", \"assert calculate_... | {
"split": "train",
"index": 81302,
"acecode_id": "bigcode_python_fns_39055",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an alphanumeric string, implement a function `create_reflection(input_string)` that returns the mirror inversion of the string. The mirror inversion is defined as the string reversed. For example, if the input string is 'abc123', the output should be '321cba'.\nPlease rea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_reflection('abc123') == '321cba'\", \"assert create_reflection('hello') == 'olleh'\", \"assert create_reflection('Python3.8') == '8.3nohtyP'\", \"assert create_reflection('1234567890') == '0987654321'\", \"assert create_reflection('!@#$$%^&*()') == ')... | {
"split": "train",
"index": 81303,
"acecode_id": "evol_9527",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of test outcomes. Each outcome is represented as a dictionary containing the following keys: 'test_case' (a string representing the name of the test case), 'result' (a boolean indicating whether the test passed o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_test_outcomes([{'test_case': 'test_one', 'result': True, 'error_message': ''}, {'test_case': 'test_two', 'result': False, 'error_message': 'AssertionError'}]) == ['test_one: Passed', 'test_two: Failed - AssertionError']\", \"assert process_test_outco... | {
"split": "train",
"index": 81304,
"acecode_id": "bigcode_python_fns_47966",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that limits the length of a title and a description for a movie. The title should not exceed a maximum length of 30 characters, and the description should be trimmed to the first 100 characters. If the title exceeds the maximum length, it... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert limit_movie_fields('Short Title', 'This is a short description.') == ('Short Title', 'This is a short description.')\", \"assert limit_movie_fields('Exact Thirty Char Title', 'Short description.') == ('Exact Thirty Char Title', 'Short description.')\", \"ass... | {
"split": "train",
"index": 81305,
"acecode_id": "bigcode_python_fns_34167",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Create a function that accepts two sets of numerical inputs, each set containing two integers or floating-point numbers, as arguments. The function should perform the operation of subtracting the second number from the first in each set and then multiply the results of both set... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert my_function((17, 10), (8, 2)) == 42\", \"assert my_function((5, 3), (10, 2)) == 16\", \"assert my_function((0, 0), (1, 1)) == 0\", \"assert my_function((10, 10), (5, 1)) == 0\", \"assert my_function((1, 1), (1, 1)) == 0\", \"assert my_function((0, 10), (10, ... | {
"split": "train",
"index": 81306,
"acecode_id": "evol_3663",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to implement a function that modifies this list based on the following rules: 1. Remove all even numbers from the list. 2. Double the value of each remaining odd number in the list. 3. Calculate the sum of all the numbers in the mo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_list([23, 11, 67, 889, 4, 6]) == ([46, 22, 134, 1778], 1980)\", \"assert process_list([1, 2, 3, 4, 5]) == ([2, 6, 10], 18)\", \"assert process_list([8, 10, 12]) == ([], 0)\", \"assert process_list([5, 7, 9]) == ([10, 14, 18], 42)\", \"assert process_... | {
"split": "train",
"index": 81307,
"acecode_id": "oss_2404",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to write a function that returns the maximum sum of any contiguous subarray of the given list. A subarray is a contiguous part of an array. You need to implement a function `max_subarray_sum(arr: List[int]) -> int` where `arr` is t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_subarray_sum([-2,1,-3,4,-1,2,1,-5,4]) == 6\", \"assert max_subarray_sum([5,4,-1,7,8]) == 23\", \"assert max_subarray_sum([1]) == 1\", \"assert max_subarray_sum([]) == 0\", \"assert max_subarray_sum([-1, -2, -3, 0, -4, -5]) == 0\", \"assert max_subarray_s... | {
"split": "train",
"index": 81308,
"acecode_id": "bigcode_python_fns_9797",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a string containing only digits '0'-'9', write a function to determine if it's an additive number. An additive number is a string whose digits can form an additive sequence, which must contain at least three numbers. Each subsequent number in the sequence must be the sum ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isAdditiveNumber('10203') == (False, [])\", \"assert isAdditiveNumber('123456') == (False, [])\", \"assert isAdditiveNumber('1203') == (False, [])\", \"assert isAdditiveNumber('199') == (False, [])\", \"assert isAdditiveNumber('123456789') == (False, [])\", ... | {
"split": "train",
"index": 81309,
"acecode_id": "evol_24572",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a string representing a base URL and ensures that it ends with a forward slash ('/'). If the provided base URL does not end with a '/', your function should return the base URL appended with a '/'. Otherwise, return the base UR... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert ensure_trailing_slash('http://example.com') == 'http://example.com/'\", \"assert ensure_trailing_slash('http://example.com/') == 'http://example.com/'\", \"assert ensure_trailing_slash('http://example.com/some/path') == 'http://example.com/some/path/'\", \"a... | {
"split": "train",
"index": 81310,
"acecode_id": "bigcode_python_fns_19913",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that calculates the total dropout rate applied to a model's encoder. The total dropout rate is defined as the sum of the following five dropout parameters: encoder_projection_dropout, encoder_attention_dropout, encoder_ff_interm_dropout, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_dropout(0.0, 0.0, 0.0, 0.0, 0.0) == 0.0\", \"assert calculate_total_dropout(0.1, 0.2, 0.3, 0.4, 0.5) == 1.5\", \"assert calculate_total_dropout(0.5, 0.5, 0.5, 0.5, 0.5) == 2.5\", \"assert calculate_total_dropout(0.25, 0.25, 0.25, 0.25, 0.25) ... | {
"split": "train",
"index": 81311,
"acecode_id": "bigcode_python_fns_27634",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple server response based on a client's request and the encryption setting. The function should take two parameters: `use_encryption` (a boolean indicating whether encryption should be used) and `request` (a string... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert handle_request(False, 'GET /') == 'Server response to: GET / without encryption'\", \"assert handle_request(True, 'GET /') == 'Server response to: GET / with encryption'\", \"assert handle_request(False, 'POST /data') == 'Server response to: POST /data witho... | {
"split": "train",
"index": 81312,
"acecode_id": "oss_16455",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `is_running_in_terminal()` that returns `True` if the Python interpreter is running in a standard terminal environment (not in an IPython or Jupyter environment), and `False` otherwise. Your function should not take any parameters and should solely determine th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_running_in_terminal() == False\", \"assert is_running_in_terminal() == False\", \"assert is_running_in_terminal() == False\", \"assert is_running_in_terminal() == False\", \"assert is_running_in_terminal() == False\", \"assert is_running_in_terminal() == ... | {
"split": "train",
"index": 81313,
"acecode_id": "bigcode_python_fns_5793",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that converts a given binary numeral (as a string) into its decimal representation. The function should handle invalid binary inputs by raising a ValueError. For instance, the binary numeral '1101' should return 13, and the binary numeral '1010' should r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binary_to_decimal('1101') == 13\", \"assert binary_to_decimal('1010') == 10\", \"assert binary_to_decimal('11111') == 31\", \"assert binary_to_decimal('100100') == 36\", \"assert binary_to_decimal('0') == 0\", \"assert binary_to_decimal('1') == 1\", \"assert... | {
"split": "train",
"index": 81314,
"acecode_id": "evol_726",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an iterable of integers, write a function `filter_unique_numbers` that returns a list of unique integers from the iterable, preserving the order of their first occurrence. The function should take one parameter, `iterable`, which is a list of integers. The function should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_unique_numbers([1, 2, 2, 3, 1, 4]) == [1, 2, 3, 4]\", \"assert filter_unique_numbers([5, 5, 5, 5]) == [5]\", \"assert filter_unique_numbers([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert filter_unique_numbers([]) == []\", \"assert filter_unique_numbe... | {
"split": "train",
"index": 81315,
"acecode_id": "bigcode_python_fns_40596",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `analyze_sentiment(reviews: List[str]) -> List[str]` that takes a list of product reviews and returns a list of sentiments for each review. The function should classify reviews as 'positive' if they contain the words 'good', 'excellent', or 'amazing', and '... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_sentiment(['This product is good', 'This is a terrible item', 'I feel neutral about this', 'Amazing quality!', 'Horrible experience']) == ['positive', 'negative', 'neutral', 'positive', 'negative']\", \"assert analyze_sentiment(['Excellent service', ... | {
"split": "train",
"index": 81316,
"acecode_id": "evol_9723",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `cli_test()` that simulates running unit tests for a given set of test cases. The function should accept a list of test case names as input. For each test case name, your function should return a dictionary where each key is the test ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cli_test(['test1']) == [{'test1': 'passed'}]\", \"assert cli_test(['test1', 'test2']) == [{'test1': 'passed'}, {'test2': 'passed'}]\", \"assert cli_test(['test3', 'test4', 'test5']) == [{'test3': 'passed'}, {'test4': 'passed'}, {'test5': 'passed'}]\", \"asse... | {
"split": "train",
"index": 81317,
"acecode_id": "bigcode_python_fns_44066",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary where the keys are variable names (strings) and the values are their corresponding values. Write a function `unpack_variables(variables: Dict[str, Any]) -> None` that dynamically creates global variables in the current namespace based on the keys and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert (globals().get('a') is None)\", \"assert (globals().get('b') is None)\", \"assert (globals().get('h') is None)\"]}"
} | {
"split": "train",
"index": 81318,
"acecode_id": "bigcode_python_fns_46884",
"num_tests": 3
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a file path or a URL, write a function that validates the input. If the input is a valid URL, return the string 'Valid URL'. If the input is a valid file path, return the string 'Valid File Path'. If the input is invalid, return the string 'Invalid I... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_input('http://example.com') == 'Valid URL'\", \"assert validate_input('https://example.com/image.png') == 'Valid URL'\", \"assert validate_input('ftp://example.com/file') == 'Invalid Input'\", \"assert validate_input('file://path/to/resource') == 'I... | {
"split": "train",
"index": 81319,
"acecode_id": "bigcode_python_fns_33486",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a Python function that takes a dictionary as input and reorders it based on the numerical values contained within. If a value is non-numerical or missing, treat it as zero. The function should return the sorted dictionary and a separate list of keys sorted based on th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_dict_by_values({'A': 5, 'B': 1, 'C': 3}) == ({'B': 1, 'C': 3, 'A': 5}, ['B', 'C', 'A'])\", \"assert sort_dict_by_values({'X': None, 'Y': 7}) == ({'X': 0, 'Y': 7}, ['X', 'Y'])\", \"assert sort_dict_by_values({'K': 2, 'L': 2, 'M': 2}) == ({'K': 2, 'L': 2,... | {
"split": "train",
"index": 81320,
"acecode_id": "evol_16345",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a sequence of cluster data represented as a list of dictionaries, where each dictionary contains information about a cluster (with keys 'id', 'size', and 'members'), write a function `process_clusters(clusters: List[Dict[str, Union[int, List[str]]]]) -> List[str]` that re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_clusters([{'id': 1, 'size': 3, 'members': ['A', 'B', 'C']}, {'id': 2, 'size': 6, 'members': ['D', 'E', 'F', 'G', 'H', 'I']}, {'id': 3, 'size': 4, 'members': ['J', 'K', 'L', 'M']}]) == ['2']\", \"assert process_clusters([{'id': 1, 'size': 10, 'members... | {
"split": "train",
"index": 81321,
"acecode_id": "bigcode_python_fns_32883",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function that determines if a given integer n is a prime number. The function should return 'true' for prime numbers and 'false' for non-prime numbers. Ensure your implementation uses an efficient method for checking primality.\nPlease reason step by step, then writ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_prime(6) == False\", \"assert check_prime(101) == True\", \"assert check_prime(11) == True\", \"assert check_prime(13441) == True\", \"assert check_prime(61) == True\", \"assert check_prime(4) == False\", \"assert check_prime(1) == False\", \"assert ch... | {
"split": "train",
"index": 81322,
"acecode_id": "evol_34758",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers and returns a new list containing the square of each integer, while preserving the original order. Your function should also handle edge cases such as empty lists and negative integers. Implement the func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert square_integers([]) == []\", \"assert square_integers([1]) == [1]\", \"assert square_integers([-1]) == [1]\", \"assert square_integers([0]) == [0]\", \"assert square_integers([1, 2, 3]) == [1, 4, 9]\", \"assert square_integers([-2, -1, 0, 1, 2]) == [4, 1, 0,... | {
"split": "train",
"index": 81323,
"acecode_id": "oss_22271",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `is_palindrome(s: str) -> bool` that checks if the given string `s` is a palindrome. The function should ignore special characters (e.g., punctuation) and whitespace while checking for palindrome. It should also be case-insensitive, so characters like 'A' and '... | 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('No lemon, no melon') == True\", \"assert is_palindrome('Was it a car or a cat I saw?') == True\", \"assert is_palindrome('') =... | {
"split": "train",
"index": 81324,
"acecode_id": "evol_35069",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of webpages represented by their URLs. Your task is to write a function that transforms this list into a CSV format string. Each URL should be on a new line in the CSV string. Implement the function `pages_to_csv_string(pages: List[str]) -> str` which takes... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pages_to_csv_string(['http://example.com', 'http://test.com']) == 'http://example.com\\\\nhttp://test.com'\", \"assert pages_to_csv_string(['http://google.com']) == 'http://google.com'\", \"assert pages_to_csv_string([]) == ''\", \"assert pages_to_csv_string... | {
"split": "train",
"index": 81325,
"acecode_id": "bigcode_python_fns_4128",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string that represents a specification of the form 'package.module.object', write a function `import_object(spec: str) -> str` that returns the object name extracted from the specification. The function should handle cases where the specification does not follow the exp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert import_object('a.b.c.x') == 'x'\", \"assert import_object('my.package.module.function') == 'function'\", \"assert import_object('com.example.ClassName') == 'ClassName'\", \"assert import_object('org.apache.commons.Math') == 'Math'\", \"assert import_object('... | {
"split": "train",
"index": 81326,
"acecode_id": "bigcode_python_fns_18394",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `quicksort(arr)` that takes a list of integers and sorts it using the quicksort algorithm. The input list will contain between 0 and 1000 integers, each ranging from 0 to 10,000. The function should return a new list that contains the same integers in sorte... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert quicksort([735, 422, 662, 310, 536, 721, 705, 129, 156, 799]) == [129, 156, 310, 422, 536, 662, 705, 721, 735, 799]\", \"assert quicksort([]) == []\", \"assert quicksort([1]) == [1]\", \"assert quicksort([5, 4, 3, 2, 1]) == [1, 2, 3, 4, 5]\", \"assert quicks... | {
"split": "train",
"index": 81327,
"acecode_id": "evol_31298",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of words, write a function `find_character(words, target)` that returns the first non-repeating alphabetical character in the `target` word. If the `target` word is not present in the list, the list is empty, or if all characters in the `target` word repeat, the fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_character(['apple', 'banana', 'cherry', 'date', 'fig'], 'cherry') == 'c'\", \"assert find_character(['a', 'b', 'c'], 'a') == 'a'\", \"assert find_character(['apple', 'banana', 'cherry'], 'banana') == 'b'\", \"assert find_character(['hello', 'world', 'py... | {
"split": "train",
"index": 81328,
"acecode_id": "evol_2355",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes an integer n and returns a list of strings representing numbers from n to 1 in reverse order. For multiples of 4, return 'Fizz' instead of the number, for multiples of 6 return 'Buzz', and for multiples of both 4 and 6 return 'FizzBuzz'.\nPlease ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_fizz_buzz(1) == ['1']\", \"assert reverse_fizz_buzz(2) == ['2', '1']\", \"assert reverse_fizz_buzz(3) == ['3', '2', '1']\", \"assert reverse_fizz_buzz(4) == ['Fizz', '3', '2', '1']\", \"assert reverse_fizz_buzz(5) == ['5', 'Fizz', '3', '2', '1']\", \... | {
"split": "train",
"index": 81329,
"acecode_id": "evol_11475",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given a list of advertisement entries, each represented as a string, write a function that generates a finalized advertisement data string. The finalized data string should be constructed by prepending each advertisement entry with its length (as a single character), and then c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert advertisement_data_complete_builder(['AD1', 'AD2']) == '3AD13AD2'\", \"assert advertisement_data_complete_builder(['Hello', 'World']) == '5Hello5World'\", \"assert advertisement_data_complete_builder(['A', 'B', 'C']) == '1A1B1C'\", \"assert advertisement_dat... | {
"split": "train",
"index": 81330,
"acecode_id": "bigcode_python_fns_25546",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that performs a custom slicing operation on a given list of integers. The function should take in three parameters: the list of integers `arr`, a start index `start`, and an end index `end`. The slicing operation should include the el... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert custom_slice([1, 2, 3, 4, 5, 6, 7, 8, 9], 2, 6) == [3, 4, 5, 6]\", \"assert custom_slice([1, 2, 3, 4, 5, 6, 7, 8, 9], 5, 3) == []\", \"assert custom_slice([1, 2, 3, 4, 5, 6, 7, 8, 9], 2, 20) == [3, 4, 5, 6, 7, 8, 9]\", \"assert custom_slice([10, 20, 30, 40, ... | {
"split": "train",
"index": 81331,
"acecode_id": "oss_33548",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes two optional parameters: `neutral` and `sequence_length`, which specify default values of 'NEUTRAL' and 100, respectively. The function should return a tuple containing the values of these parameters. If the user does not provi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_parameters() == ('NEUTRAL', 100)\", \"assert get_parameters('POSITIVE') == ('POSITIVE', 100)\", \"assert get_parameters(sequence_length=50) == ('NEUTRAL', 50)\", \"assert get_parameters('NEGATIVE', 150) == ('NEGATIVE', 150)\", \"assert get_parameters(neu... | {
"split": "train",
"index": 81332,
"acecode_id": "oss_19238",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple database query operation by extracting specific fields from a list of records. Each record is represented as a dictionary containing various fields. Your function should take a list of records and a field name ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_field([{ 'id': 1, 'name': 'Alice' }, { 'id': 2, 'name': 'Bob' }], 'name') == ['Alice', 'Bob']\", \"assert extract_field([{ 'id': 1, 'name': 'Alice' }, { 'id': 2 }], 'name') == ['Alice', None]\", \"assert extract_field([], 'name') == []\", \"assert ex... | {
"split": "train",
"index": 81333,
"acecode_id": "bigcode_python_fns_580",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a sorted list of non-negative integers representing errors, compute the gradient of the Lovasz extension with respect to these sorted errors. Implement a function `lovasz_grad(gt_sorted: List[int]) -> List[float]` that returns a list of floats representing the computed gr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lovasz_grad([0]) == [0.0]\", \"assert lovasz_grad([1]) == [0.0]\", \"assert lovasz_grad([0, 0, 0]) == [0.0, 0.0, 0.0]\", \"assert lovasz_grad([1, 1, 1]) == [0.0, 0.0, 0.0]\", \"assert lovasz_grad([5, 5, 5, 5]) == [0.0, 0.0, 0.0, 0.0]\"]}"
} | {
"split": "train",
"index": 81334,
"acecode_id": "bigcode_python_fns_36377",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_ip_addresses(string: str) -> List[str]` that takes a string as input and returns a list of valid IP addresses found within the string. An IP address is considered valid if it consists of four decimal numbers separated by periods, where each number is ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_ip_addresses('Reach out to us at 192.168.1.1 and 10.0.0.2') == ['192.168.1.1', '10.0.0.2']\", \"assert find_ip_addresses('Invalid IPs like 256.256.256.256 and 192.168.1.300') == []\", \"assert find_ip_addresses('My IPs are 172.16.0.1 and 10.10.10.10') =... | {
"split": "train",
"index": 81335,
"acecode_id": "evol_26794",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of intervals, where each interval is represented as a list of two integers indicating the start and end points. Your task is to write a function that merges overlapping intervals and returns a new list of non-overlapping intervals. The input intervals are n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_intervals([[1, 3], [2, 6], [8, 10], [15, 18]]) == [[1, 6], [8, 10], [15, 18]]\", \"assert merge_intervals([[1, 4], [4, 5]]) == [[1, 5]]\", \"assert merge_intervals([[1, 2], [3, 4], [5, 6]]) == [[1, 2], [3, 4], [5, 6]]\", \"assert merge_intervals([[1, 4... | {
"split": "train",
"index": 81336,
"acecode_id": "oss_20871",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `get_positive_and_sort(l: list)` that returns a new list containing only the positive numbers from the input list, sorted in ascending order. For example, calling `get_positive_and_sort([-1, 2, -4, 5, 6])` should return `[2, 5, 6]`... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_positive_and_sort([-1, 2, -4, 5, 6]) == [2, 5, 6]\", \"assert get_positive_and_sort([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]) == [1, 2, 3, 3, 5, 9, 123]\", \"assert get_positive_and_sort([]) == []\", \"assert get_positive_and_sort([-10, -5, -1]) == []\", ... | {
"split": "train",
"index": 81337,
"acecode_id": "evol_28468",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D grid representing a terrain map. Each cell in the grid contains a non-negative integer representing the height of the terrain at that location. Write a function `calculateTrappedWater(grid)` that takes in a 2D grid of non-negative integers and returns the tot... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculateTrappedWater([[0, 1, 0], [1, 0, 1], [0, 1, 0]]) == 1\", \"assert calculateTrappedWater([[1, 1, 1], [1, 1, 1], [1, 1, 1]]) == 0\", \"assert calculateTrappedWater([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == 0\", \"assert calculateTrappedWater([[1, 2, 3, 4, ... | {
"split": "train",
"index": 81338,
"acecode_id": "oss_31621",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that extracts metadata from a given dictionary representing a Python package's setup configuration. The dictionary contains the following keys: 'long_description', 'classifiers', and 'install_requires', which represent the long des... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_metadata({'long_description': 'Short desc.', 'classifiers': ['A', 'B', 'C'], 'install_requires': ['pkg1']}) == {'long_description': 'Short desc.', 'classifiers': ['A', 'B', 'C'], 'install_requires': ['pkg1 (required)']}\", \"assert extract_metadata({... | {
"split": "train",
"index": 81339,
"acecode_id": "oss_15872",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function that identifies and returns all narcissistic numbers that are less than or equal to a given non-negative integer input. The function should return an error message if the input is negative or not an integer. A narcissistic number is a number that is equal t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_narcissistic_numbers(0) == [0]\", \"assert find_narcissistic_numbers(1) == [0, 1]\", \"assert find_narcissistic_numbers(2) == [0, 1, 2]\", \"assert find_narcissistic_numbers(3) == [0, 1, 2, 3]\", \"assert find_narcissistic_numbers(4) == [0, 1, 2, 3, 4]\... | {
"split": "train",
"index": 81340,
"acecode_id": "evol_12306",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, implement a function that removes any duplicate values from the array and sorts the remaining values in ascending order without using any built-in sort functions. If the input array is empty, return an empty array. If the array is already sorted in a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_duplicates_and_sort([3, 2, 1, 4, 7, 5]) == [1, 2, 3, 4, 5, 7]\", \"assert remove_duplicates_and_sort([3, 2, 2, 1, 4, 7, 5, 5]) == [1, 2, 3, 4, 5, 7]\", \"assert remove_duplicates_and_sort([]) == []\", \"assert remove_duplicates_and_sort([1, 2, 3, 4, 5... | {
"split": "train",
"index": 81341,
"acecode_id": "evol_32213",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of file URLs and a destination directory as input. Your function should simulate the action of downloading each file from the provided URLs to the specified destination. For the purpose of this problem, you do not ne... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_downloads(['http://example.com/file1.txt', 'http://example.com/file2.txt'], '/downloads') == 2\", \"assert count_downloads(['http://example.com/file1.txt'], '/downloads') == 1\", \"assert count_downloads([], '/downloads') == 0\", \"assert count_downloa... | {
"split": "train",
"index": 81342,
"acecode_id": "bigcode_python_fns_33815",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a nested list that can contain integers and other nested lists, implement a function `get_sum_of_elements(array)` that returns the sum of all the integers present in the nested structure. The function should handle both individual integers and lists of integers at any dep... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_sum_of_elements([[1,2], 3, 4]) == 10\", \"assert get_sum_of_elements([[1, [2, 3]], 4]) == 10\", \"assert get_sum_of_elements([1, 2, [3, 4], 5]) == 15\", \"assert get_sum_of_elements([]) == 0\", \"assert get_sum_of_elements([[[1], [2]], 3]) == 6\", \"asse... | {
"split": "train",
"index": 81343,
"acecode_id": "evol_5889",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of votes represented as strings, where each vote can either be 'Yes', 'No', or 'Absent', implement a function `get_vote_summary(votes: List[str], member_name: str) -> Dict[str, Union[str, str]]` that returns a dictionary summarizing the voting status of a member wi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_vote_summary(['Yes', 'No', 'Yes'], 'Jane') == {'stand': 'Absent', 'class': 'absent', 'name': 'Jane'}\", \"assert get_vote_summary(['Yes', 'Yes', 'Absent'], 'Doe') == {'stand': 'Absent', 'class': 'absent', 'name': 'Doe'}\", \"assert get_vote_summary(['Abs... | {
"split": "train",
"index": 81344,
"acecode_id": "bigcode_python_fns_34054",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a validation function for a user-provided country code. Implement the function `validate_country` that takes a string `value` as input and raises a `ValueError` if the input does not meet the specified criteria. The criteria for a valid country code... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_country('US') is None\", \"assert validate_country('CA') is None\", \"assert validate_country('GB') is None\", \"assert validate_country('FR') is None\", \"assert validate_country('XX') is None\", \"assert validate_country('XY') is None\", \"assert ... | {
"split": "train",
"index": 81345,
"acecode_id": "oss_1549",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates basic banking operations on a bank account. The function should take the account holder's name, an initial balance, and a list of operations to perform on the account. Each operation can either be a deposit or a withdra... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bank_account_operations('Alice', 100, [('deposit', 50), ('withdraw', 30)]) == 120.0\", \"assert bank_account_operations('Bob', 200, [('withdraw', 50), ('withdraw', 100)]) == 50.0\", \"assert bank_account_operations('Charlie', 0, [('deposit', 100), ('withdraw... | {
"split": "train",
"index": 81346,
"acecode_id": "oss_8470",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates a custom job name for a housekeeping system in a virtualization environment. The function should take two parameters: a boolean `global_readonly` and an integer `readonly_jobs`. Based on these inputs, if `global_readonl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_job_name(True, 0) == 'GlobalReadOnlyJob'\", \"assert generate_job_name(True, 5) == 'GlobalReadOnlyJob'\", \"assert generate_job_name(False, 0) == 'RegularJob0'\", \"assert generate_job_name(False, 1) == 'RegularJob1'\", \"assert generate_job_name(Fa... | {
"split": "train",
"index": 81347,
"acecode_id": "oss_8626",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a nested dictionary data structure. The function should support setting and getting values at multiple levels of nesting. Your function should take a list of operations to perform on this nested dictionary. Each operati... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert nested_dict_operations([('set', ['a', 'b', 'c'], 5), ('get', ['a', 'b', 'c'], None)]) == [5]\", \"assert nested_dict_operations([('set', ['x', 'y'], 10), ('get', ['x', 'y'], None), ('get', ['x', 'z'], 'default')]) == [10, 'default']\", \"assert nested_dict_o... | {
"split": "train",
"index": 81348,
"acecode_id": "oss_27327",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that simulates attribute access on nested dictionaries. The function should take a dictionary and a string representing a chain of keys separated by dots. It should then return the value of the final key in the chain, or None i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert nested_key_access({'a': {'b': {'c': 5}}}, 'a.b.c') == 5\", \"assert nested_key_access({'a': {'b': {'c': 5}}}, 'a.b.d') == None\", \"assert nested_key_access({'x': {'y': {'z': 10}}}, 'x.y.z') == 10\", \"assert nested_key_access({'x': {'y': {'z': 10}}}, 'x.y.w... | {
"split": "train",
"index": 81349,
"acecode_id": "oss_1433",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `correct_rand()` that uses a flawed random number generator, which always returns a number in the range [0, 1]. Your task is to correct this flawed number generator to properly create a random double precision floating point number within the range of 0 to ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert correct_rand() >= 0 and correct_rand() <= 1000\", \"assert 0 <= correct_rand() <= 1000\", \"assert 0 <= correct_rand() <= 1000\", \"assert 0 <= correct_rand() <= 1000\", \"assert 0 <= correct_rand() <= 1000\", \"assert 0 <= correct_rand() <= 1000\", \"assert... | {
"split": "train",
"index": 81350,
"acecode_id": "evol_16831",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `get_positive_and_sort(l: list) -> list` that returns a new list containing only the positive integers from the input list `l`, sorted in ascending order. The sorting should be done using a custom sorting algorithm, not using any built-in sorting methods. Y... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_positive_and_sort([-1, 2, -4, 5, 6]) == [2, 5, 6]\", \"assert get_positive_and_sort([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]) == [1, 2, 3, 3, 5, 9, 123]\", \"assert get_positive_and_sort([-1, -2, -3]) == []\", \"assert get_positive_and_sort([]) == []\", \... | {
"split": "train",
"index": 81351,
"acecode_id": "evol_910",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a window represented by its top-left and bottom-right coordinates in a 2D grid, and an affine transformation that maps grid coordinates to real-world coordinates, implement a function that returns the bounds of the window in the format (west, south, east, north). The func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert window_bounds(((0, 0), (2, 2)), (1.0, 0.0, 0.0, 1.0, 0.0, 0.0), 'corner') == (0.0, 0.0, 2.0, 2.0)\", \"assert window_bounds(((3, 3), (4, 4)), (1.0, 0.0, 0.0, 1.0, 0.0, 0.0), 'corner') == (3.0, 3.0, 4.0, 4.0)\", \"assert window_bounds(((2, 2), (4, 3)), (1.0, ... | {
"split": "train",
"index": 81352,
"acecode_id": "bigcode_python_fns_46445",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a given date and generates a modified JSON response. Your function should take the following parameters: a `scan_date` (in the format 'YYYY-MM-DD'), a `jsonData` dictionary that contains a 'code' and 'source', an `autoThras... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert read_fromDB('2023-10-01', {'code': 'A1', 'source': 'test'}, False, ['tag1', 'tag2', 'tag3'], 'dbRef1') == '{\\\"code\\\": \\\"A1\\\", \\\"source\\\": \\\"test\\\", \\\"end_date\\\": \\\"11-10-2023\\\"}'\", \"assert read_fromDB('2023-10-01', {'code': 'B2', 's... | {
"split": "train",
"index": 81353,
"acecode_id": "oss_25552",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a player object with properties for current health and maximum health, and an item entity that has a healing value. Write a function `use_item(entity, player)` that increases the player's health by the healing value of the item, ensuring that the player's health d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert use_item({'name': 'Healing Potion', 'item': {'healing': 20}}, {'fighter': {'hp': 80, 'max_hp': 100}}) == ('Healing Potion utilis\\u00e9e, le joueur regagne de la sant\\u00e9 !!!', 100)\", \"assert use_item({'name': 'Health Elixir', 'item': {'healing': 50}}, ... | {
"split": "train",
"index": 81354,
"acecode_id": "bigcode_python_fns_41736",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `pluck(arr, cond_fn, thresh)` that extracts and returns the node with the smallest value from an array of non-negative integers that satisfies a given condition function (cond_fn) and is greater than or equal to a specified threshold (thresh). The output sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pluck([4,2,3], lambda x: x % 2 == 0, 3) == [4, 0]\", \"assert pluck([1,2,3], lambda x: x % 2 == 1, 2) == [3, 2]\", \"assert pluck([], lambda x: x % 3 == 0, 2) == []\", \"assert pluck([5, 0, 3, 0, 4, 2], lambda x: x % 2 == 0, 1) == [2, 5]\", \"assert pluck([1... | {
"split": "train",
"index": 81355,
"acecode_id": "evol_16853",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the age-dependent organ-specific absorbed dose rate per unit kerma rate normalized against the corresponding value for an adult. Implement a function `kSEQK(age)` that takes a single integer or a list of integers representing ages and returns the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert kSEQK(20) == 1.0\", \"assert kSEQK(0) == 1.2098\", \"assert kSEQK([20]) == [1.0]\", \"assert kSEQK([30]) == [1.0]\", \"assert kSEQK(25) == 1.0\", \"assert kSEQK(22) == 1.0\"]}"
} | {
"split": "train",
"index": 81356,
"acecode_id": "bigcode_python_fns_12774",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a custom writer discrimination module. The module should be designed as a class that initializes with a parameter representing the number of writers to be discriminated. Your task is to implement a function `create_discriminator(num_writers)` th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_discriminator(5) == {'model': 'ResNet-18', 'head_replaced': True, 'layers_frozen': True}\", \"assert create_discriminator(10) == {'model': 'ResNet-18', 'head_replaced': True, 'layers_frozen': True}\", \"assert create_discriminator(0) == {'model': 'Res... | {
"split": "train",
"index": 81357,
"acecode_id": "oss_18215",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a simple animation representation from an image. The function should take an image (as a string representing the file path), an optional name for the animation (a string), and an optional ID for the animation (an integer). ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_animation('image1.png', 'walk', 1) == {'name': 'walk', 'frames': ['image1.png'], 'time': 0, 'id_': 1, 'reset_on_end': False}\", \"assert create_animation('image2.png') == {'name': None, 'frames': ['image2.png'], 'time': 0, 'id_': None, 'reset_on_end':... | {
"split": "train",
"index": 81358,
"acecode_id": "bigcode_python_fns_2159",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that returns a new list containing only the integers that are greater than a specified threshold. The function should maintain the order of the original list for the integers that meet the condition. You need to implement the funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_greater_than_threshold([1, 2, 3, 4, 5], 3) == [4, 5]\", \"assert filter_greater_than_threshold([10, 20, 30], 25) == [30]\", \"assert filter_greater_than_threshold([5, 4, 3, 2, 1], 5) == []\", \"assert filter_greater_than_threshold([], 0) == []\", \"as... | {
"split": "train",
"index": 81359,
"acecode_id": "bigcode_python_fns_1819",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a logging configuration function that allows you to set the logging format, enable or disable color logging, and specify a log file location, implement a function `configure_logging` that takes three parameters: `fmt` (a string that represents the logging format), `enable... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert configure_logging('[%(asctime)s] [%(process)5s] %(levelname)s %(module)s %(name)s %(message)s', False, None) == True\", \"assert configure_logging('[%(asctime)s] [%(process)5s] %(levelname)s %(module)s %(name)s %(message)s', True, None) == True\", \"assert c... | {
"split": "train",
"index": 81360,
"acecode_id": "bigcode_python_fns_15854",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Develop a function that sorts a given list of alphanumeric strings based on the numerical value extracted from each string. The function should return a new list containing the elements sorted in ascending order of their numerical values. For example, given the input ['21a', '1... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_alphanumeric(['21a', '10b', '3c', '100d', '2e']) == ['2e', '3c', '10b', '21a', '100d']\", \"assert sort_alphanumeric(['a1', 'b2', 'c3']) == ['a1', 'b2', 'c3']\", \"assert sort_alphanumeric(['10', '2', '30']) == ['2', '10', '30']\", \"assert sort_alphanu... | {
"split": "train",
"index": 81361,
"acecode_id": "evol_8539",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of MSIDs, each associated with a set of values and timestamps. Your task is to implement a function that filters out invalid values from each MSID's data and returns the count of valid values remaining for each MSID. Each MSID's data is represented by a dic... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_valid_values({'MSID1': {'vals': [1.0, 2.0, -1.0], 'times': [1, 2, 3]}}) == {'MSID1': 2}\", \"assert count_valid_values({'MSID2': {'vals': [0.0, -2.0, -3.0], 'times': [1, 2, 3]}}) == {'MSID2': 0}\", \"assert count_valid_values({'MSID3': {'vals': [4.0, 5... | {
"split": "train",
"index": 81362,
"acecode_id": "bigcode_python_fns_14019",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple mesh node structure for a 3D graphics application. Write a function `create_mesh_node(world: str, node: str, mesh_ids: List[int], parent: Optional[str] = None) -> Dict[str, Any]` that simulates the creation of a 3D mesh node. The function s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_mesh_node('Earth', 'Node1', [1, 2, 3]) == {'name': 'Node1', 'mesh_ids': [1, 2, 3], 'parent': 'root'}\", \"assert create_mesh_node('Mars', 'Node2', [4, 5]) == {'name': 'Node2', 'mesh_ids': [4, 5], 'parent': 'root'}\", \"assert create_mesh_node('Venus',... | {
"split": "train",
"index": 81363,
"acecode_id": "bigcode_python_fns_16098",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a datetime object and a string that specifies a duration to increment the datetime by, return the new datetime after applying the specified increments. The increment string may include comma-separated values that specify a number followed by a unit of time, where the unit... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert increment_datetime_by_string(datetime(2001, 11, 1, 0, 0, 0), '1 months') == datetime(2001, 12, 1, 0, 0)\", \"assert increment_datetime_by_string(datetime(2001, 1, 1, 0, 0, 0), '5 minutes') == datetime(2001, 1, 1, 0, 5)\", \"assert increment_datetime_by_strin... | {
"split": "train",
"index": 81364,
"acecode_id": "bigcode_python_fns_31285",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that configures a simple logging system. The function should set up the logging system to log messages to the console with a specified logging level and format. Implement a function called `configure_logging` that accepts two parameters: ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert configure_logging(logging.DEBUG, '%(levelname)s: %(message)s') is None\", \"assert configure_logging(logging.INFO, '%(asctime)s - %(levelname)s: %(message)s') is None\", \"assert configure_logging(logging.WARNING, '%(message)s') is None\", \"assert configure... | {
"split": "train",
"index": 81365,
"acecode_id": "oss_35197",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that combines multiple strings into a single string, separated by a specified delimiter. Implement the function `combine_strings(strings: List[str], delimiter: str) -> str` that takes in a list of strings and a delimiter string. The funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert combine_strings(['Hello', 'world'], ' ') == 'Hello world'\", \"assert combine_strings(['Hello', 'world', 'from', 'AI'], ' ') == 'Hello world from AI'\", \"assert combine_strings(['a', 'b', 'c'], ', ') == 'a, b, c'\", \"assert combine_strings(['Python', 'is',... | {
"split": "train",
"index": 81366,
"acecode_id": "bigcode_python_fns_39499",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to list all the keys stored in a secret manager. The secret manager contains a collection of keys, where each key has a name associated with it. Your goal is to implement the `list_keys` function that returns a list of all the key nam... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert list_keys([{'name': 'key1'}, {'name': 'key2'}, {'name': 'key3'}]) == ['key1', 'key2', 'key3']\", \"assert list_keys([{'name': 'keyA'}, {'name': 'keyB'}]) == ['keyA', 'keyB']\", \"assert list_keys([{'name': 'key1'}, {'name': 'key2'}, {'name': 'key3'}, {'name'... | {
"split": "train",
"index": 81367,
"acecode_id": "oss_9989",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that calculates the product of all elements in the list that are congruent to 1 when taken modulo 3. If there are no such elements, return 1.\nPlease reason step by step, then write a self-contained Python solution. Give your final... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert solve_problem([3, 6, 9]) == 1\", \"assert solve_problem([0, 3, 6, 9]) == 1\", \"assert solve_problem([1, 1, 1]) == 1\", \"assert solve_problem([]) == 1\", \"assert solve_problem([23, 24, 25]) == 25\", \"assert solve_problem([24, 25, 26]) == 25\", \"assert so... | {
"split": "train",
"index": 81368,
"acecode_id": "evol_33845",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that creates a new betting record for a sports player. The function `create_bet` should take the following parameters: an integer `player` representing the player's ID, an integer `better` representing the better's ID, an integer `bet... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_bet(1, 101, 50, True, 1622547800) == {'player': 1, 'better': 101, 'bet': 50, 'prediction': True, 'created': 1622547800}\", \"assert create_bet(2, 102, 100, False, 1622547801) == {'player': 2, 'better': 102, 'bet': 100, 'prediction': False, 'created': ... | {
"split": "train",
"index": 81369,
"acecode_id": "bigcode_python_fns_45193",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a row of data and constructs an instance of a Sector class based on the information in the row. The row contains the following fields: 'id', 'segment', 'sector_cluster_id', and 'parent_id'. The 'id' and 'segment' fields are... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_row({'id': '1', 'segment': 'Finance'}) == Sector(pk='1', segment='Finance', sector_cluster=None, parent=None)\", \"assert process_row({'id': '2', 'segment': 'Health', 'sector_cluster_id': '10'}) == Sector(pk='2', segment='Health', sector_cluster='10'... | {
"split": "train",
"index": 81370,
"acecode_id": "oss_28665",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function called `get_structure_type` that determines whether a given structure from the OPTIMADE format is a bulk three-dimensional structure or a molecular structure based on its periodicity. The function will take a dictionary representing t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_structure_type({'attributes': {'dimension_types': [1, 1, 1]}}) == 'Structure'\", \"assert get_structure_type({'attributes': {'dimension_types': [0, 0, 0]}}) == 'Molecule'\", \"assert get_structure_type({'attributes': {'dimension_types': [1, 0, 1]}}) == '... | {
"split": "train",
"index": 81371,
"acecode_id": "bigcode_python_fns_3425",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that validates postal codes based on specific criteria. A valid postal code must adhere to the following rules: 1. The postal code must be exactly 6 characters long. 2. The first three characters must be digits. 3. The last three c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_postal_code('123ABC') == True\", \"assert validate_postal_code('456DEF') == True\", \"assert validate_postal_code('789XYZ') == True\", \"assert validate_postal_code('001AAA') == True\", \"assert validate_postal_code('234BCD') == True\", \"assert val... | {
"split": "train",
"index": 81372,
"acecode_id": "oss_35655",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with building a function that takes a subject, a message, and an optional recipient email address. The function should format these inputs into a structured email message. Your function should return a dictionary containing the email details, including 'subject',... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_email('Test Subject', 'This is a test message.') == {'subject': 'Test Subject', 'message': 'This is a test message.', 'to': 'herbemalveillante@gmail.com'}\", \"assert format_email('Hello', 'Hello World!', 'example@example.com') == {'subject': 'Hello',... | {
"split": "train",
"index": 81373,
"acecode_id": "bigcode_python_fns_40483",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple dictionary. The function should accept a list of operations, each represented as a tuple. The operations can be one of the following: 'add' to add a key-value pair, 'get' to retrieve a value by key, 'update' to... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simple_dictionary([('add', 'a', 1), ('get', 'a')]) == [1]\", \"assert simple_dictionary([('add', 'b', 2), ('get', 'b')]) == [2]\", \"assert simple_dictionary([('add', 'c', 3), ('update', 'c', 4), ('get', 'c')]) == [4]\", \"assert simple_dictionary([('add', '... | {
"split": "train",
"index": 81374,
"acecode_id": "oss_31441",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers `nums` and an integer `k`, write a function `numIdenticalPairs(nums: List[int], k: int) -> int` that returns the number of good pairs. A pair `(i,j)` is called good if `nums[i]` == `nums[j]`, `i < j`, and `j-i <= k`.\nPlease reason step by step, then ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert numIdenticalPairs([1, 1, 1, 1], 1) == 3\", \"assert numIdenticalPairs([1, 2, 3], 1) == 0\", \"assert numIdenticalPairs([1, 2, 2, 1, 2], 3) == 4\", \"assert numIdenticalPairs([5, 5, 5, 5, 5], 4) == 10\", \"assert numIdenticalPairs([1, 2, 3, 4, 5], 2) == 0\", ... | {
"split": "train",
"index": 81375,
"acecode_id": "evol_10589",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks if a user has the permission to view or delete a metadata object based on their role and the state of the metadata object. You need to implement a function called `check_permissions` that takes in a user object and a metad... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_permissions({'role': 'admin'}, {'public': False, 'owner': 'user1'}) == (True, True)\", \"assert check_permissions({'role': 'viewer'}, {'public': True, 'owner': 'user3'}) == (True, False)\", \"assert check_permissions({'role': 'viewer'}, {'public': Fals... | {
"split": "train",
"index": 81376,
"acecode_id": "oss_4652",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `fix_python_dict(d)` that takes a dictionary `d` as input and processes it to ensure all keys are strings and all values are integers or strings. If a key is not a string, convert it to a string. If a value is not an integer, attempt to convert it to an int... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fix_python_dict({1: '10', 2: 20, '2': '30'}) == {'1': 10, '2': 30}\", \"assert fix_python_dict({'key1': 1, 'key1': 2}) == {'key1': 2}\", \"assert fix_python_dict({None: '5', 'None': 10}) == {'None': 10}\", \"assert fix_python_dict({3.14: 42, '3.14': 'answer'... | {
"split": "train",
"index": 81377,
"acecode_id": "evol_14683",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given an array of unique integers `preorder`, write a function that returns `true` if it is a correct preorder traversal sequence of a binary search tree. If the sequence is incorrect, return a sorted list of the missing elements that would make it a correct sequence. The funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert verifyPreorder([5,2,1,3,6]) == True\", \"assert verifyPreorder([5,2,6,1,3]) == [4]\", \"assert verifyPreorder([10,5,1,7,15]) == True\", \"assert verifyPreorder([10,5,3,1,7,15,12]) == True\", \"assert verifyPreorder([20,15,10,30,25]) == True\", \"assert verif... | {
"split": "train",
"index": 81378,
"acecode_id": "evol_33153",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Write a function that returns the count of all prime numbers from 1 to n (inclusive). The function should return 0 if n is less than 2. You must implement this using the Sieve of Eratosthenes algorithm.\nPlease reason step by step, then write a self-contained Python solution. G... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_primes(0) == 0\", \"assert count_primes(1) == 0\", \"assert count_primes(2) == 1\", \"assert count_primes(3) == 2\", \"assert count_primes(4) == 2\", \"assert count_primes(5) == 3\", \"assert count_primes(10) == 4\", \"assert count_primes(20) == 8\", \... | {
"split": "train",
"index": 81379,
"acecode_id": "evol_1527",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `fibonacci(n)` that takes an integer `n` as input and returns a list containing the Fibonacci sequence up to `n`. The list should include all Fibonacci numbers that are less than or equal to `n`. If `n` is less than 0, return an empty list.\nPlease reason step ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(0) == [0]\", \"assert fibonacci(4) == [0, 1, 1, 2, 3]\", \"assert fibonacci(5) == [0, 1, 1, 2, 3, 5]\", \"assert fibonacci(6) == [0, 1, 1, 2, 3, 5]\", \"assert fibonacci(7) == [0, 1, 1, 2, 3, 5]\", \"assert fibonacci(8) == [0, 1, 1, 2, 3, 5, 8]\", ... | {
"split": "train",
"index": 81380,
"acecode_id": "evol_17752",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a datetime object. Your task is to implement a function `make_aware(dt)` that converts the given datetime object into an aware datetime object by appending UTC timezone information if it does not already have any timezone information (tzinfo). If the datetime obje... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert make_aware(datetime.fromisoformat('2023-10-10T12:00:00')) == '2023-10-10T12:00:00+00:00'\", \"assert make_aware(datetime.fromisoformat('2023-10-10T12:00:00+00:00')) == '2023-10-10T12:00:00+00:00'\", \"assert make_aware(datetime.fromisoformat('2023-10-10T18:3... | {
"split": "train",
"index": 81381,
"acecode_id": "bigcode_python_fns_3362",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary that represents a subject from the ATLAS survey. The dictionary contains metadata about the subject, including a key 'source' that holds a string identifier. You need to implement a function `generate_fits_filename(subject: dict, field: str, wavelengt... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_fits_filename({'metadata': {'source': '12345'}}, 'elais-s1', 'ir') == '12345_ir.fits'\", \"assert generate_fits_filename({'metadata': {'source': 'abcde'}}, 'cdfs', 'radio') == 'abcde_radio.fits'\", \"assert generate_fits_filename({'metadata': {'sour... | {
"split": "train",
"index": 81382,
"acecode_id": "bigcode_python_fns_33847",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function to calculate the average price of a cryptocurrency over a specified time period. Write a function `calculate_average_price` that takes the following parameters: \n- `ticker_symbol` (string): The ticker symbol of the cryptocurrency ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_price('btc_usd', [(datetime(2023, 10, 1, 12, 0), 10000.0), (datetime(2023, 10, 1, 12, 1), 10100.0), (datetime(2023, 10, 1, 12, 2), 10200.0)]) == 10100.0\", \"assert calculate_average_price('eth_usd', [(datetime(2023, 10, 1, 12, 0), 2000.0),... | {
"split": "train",
"index": 81383,
"acecode_id": "oss_21861",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a positive integer n, determine the number of distinct ways to fill a 3x3xn cuboid with 2x1x1 rectangular prisms. The prisms can be oriented in any manner, but different orientations, reflections, or rotations of the entire structure are considered unique. Implement a fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_ways(1) == 0\", \"assert count_ways(3) == 0\", \"assert count_ways(5) == 0\", \"assert count_ways(6) == 0\", \"assert count_ways(7) == 0\", \"assert count_ways(8) == 0\", \"assert count_ways(9) == 0\", \"assert count_ways(10) == 0\", \"assert count_way... | {
"split": "train",
"index": 81384,
"acecode_id": "evol_21522",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a collection of model packagings in a Python application. Implement a function `packaging_delete_id(pack_id: str) -> bool` that simulates the deletion of a model packaging with the given ID. The function should return `True` if the model packaging w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert packaging_delete_id('pack1') == True\", \"assert packaging_delete_id('pack2') == True\", \"assert packaging_delete_id('pack3') == True\", \"assert packaging_delete_id('pack4') == False\", \"assert packaging_delete_id('pack1') == True\", \"assert packaging_de... | {
"split": "train",
"index": 81385,
"acecode_id": "oss_11567",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a list of file paths, implement a function `remove_files_or_dirs(paths: List[str]) -> List[str]` that takes in a list of strings representing file and directory paths. The function should remove the files or directories if they exist and return a list of paths that could ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_files_or_dirs(['file1.txt', 'file2.txt', 'dir1']) == ['file1.txt', 'file2.txt', 'dir1']\", \"assert remove_files_or_dirs(['nonexistent.txt', 'dir2']) == ['nonexistent.txt', 'dir2']\", \"assert remove_files_or_dirs(['file3.txt', 'nonexistent_dir']) == ... | {
"split": "train",
"index": 81386,
"acecode_id": "bigcode_python_fns_38779",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that converts a list of integers representing note timings in an Osu! map into a list of strings representing the corresponding note timings in a Qua map. Each note timing in the Osu! map is given in milliseconds, and the conversion r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_osu_to_qua([100, 200, 300]) == ['Timing: 100 ms', 'Timing: 200 ms', 'Timing: 300 ms']\", \"assert convert_osu_to_qua([0, 1500, 2500]) == ['Timing: 0 ms', 'Timing: 1500 ms', 'Timing: 2500 ms']\", \"assert convert_osu_to_qua([500]) == ['Timing: 500 ms'... | {
"split": "train",
"index": 81387,
"acecode_id": "oss_413",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function in Python to generate a random string of a specified length, containing both uppercase and lowercase letters, as well as digits. The function should take an integer parameter 'length' and return a string of that length. If 'length' is less than or equal to 0, r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_random_string(10) != ''\", \"assert len(generate_random_string(0)) == 0\", \"assert len(generate_random_string(1)) == 1\", \"assert len(generate_random_string(5)) == 5\", \"assert len(generate_random_string(15)) == 15\", \"assert len(generate_random... | {
"split": "train",
"index": 81388,
"acecode_id": "evol_10499",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given the root of a Binary Search Tree (BST), implement a function `find_second_maximum` that returns the second maximum element in the BST. If there is no second maximum element (e.g., the tree is empty or has only one node), return None.\nPlease reason step by step, then writ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_second_maximum(None) == None\", \"assert find_second_maximum(TreeNode(1)) == None\", \"assert find_second_maximum(TreeNode(2, TreeNode(1), None)) == 1\", \"assert find_second_maximum(TreeNode(3, TreeNode(2), TreeNode(4))) == 3\", \"assert find_second_ma... | {
"split": "train",
"index": 81389,
"acecode_id": "evol_6383",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `get_app(*args, **kwargs)` that simulates the behavior of fetching data from an application based on provided arguments. The function should accept a variable number of positional arguments (`args`) which represent different parameter... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_app() == 'No arguments provided'\", \"assert get_app(1) == 'Args: [1], Kwargs: {}'\", \"assert get_app(1, 2, 3) == 'Args: [1, 2, 3], Kwargs: {}'\", \"assert get_app(10, 20, 30, 40, 50) == 'Args: [10, 20, 30, 40, 50], Kwargs: {}'\", \"assert get_app() == ... | {
"split": "train",
"index": 81390,
"acecode_id": "bigcode_python_fns_16122",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Write a function that computes the cubes of all integers within a specified range given as a list of tuples. Each tuple should contain two integers representing the start and end of the range. The function should return a list of lists, where each inner list contains the cubes ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_cubes([(1, 3)]) == [[1, 8, 27]]\", \"assert compute_cubes([(0, 2), (3, 5)]) == [[0, 1, 8], [27, 64, 125]]\", \"assert compute_cubes([(-2, 1)]) == [[-8, -1, 0, 1]]\", \"assert compute_cubes([(10, 10)]) == [[1000]]\", \"assert compute_cubes([(1, 1), (2... | {
"split": "train",
"index": 81391,
"acecode_id": "evol_2215",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `maximum(lst)` that returns a tuple containing the maximum number in the list and a boolean indicating whether the maximum number is a prime number. If the list is empty, the function should return (None, False).\nPlease reason ste... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert maximum([8, 1, 22, 3, 17, 5, 6, 7]) == (22, False)\", \"assert maximum([2, 4, 6, 8, 10]) == (10, False)\", \"assert maximum([5, 3, 1]) == (5, True)\", \"assert maximum([-1, -3, -5]) == (-1, False)\", \"assert maximum([13, 17, 19, 23]) == (23, True)\", \"asse... | {
"split": "train",
"index": 81392,
"acecode_id": "evol_27277",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings where each string represents a chemical element, write a function `count_hydrogens(elements: List[str]) -> Dict[str, int]` that returns a dictionary mapping each unique element to the number of times it appears in the list. The keys of the dictionary sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_hydrogens(['H', 'O', 'H', 'C', 'H']) == {'H': 3, 'O': 1, 'C': 1}\", \"assert count_hydrogens(['He', 'Li', 'Be', 'He', 'Li']) == {'He': 2, 'Li': 2, 'Be': 1}\", \"assert count_hydrogens(['N', 'N', 'O', 'O', 'O']) == {'N': 2, 'O': 3}\", \"assert count_hyd... | {
"split": "train",
"index": 81393,
"acecode_id": "bigcode_python_fns_5188",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of integers as input and returns a new list containing only the even numbers from the input list. The order of the even numbers in the output list should be the same as their order in the input list. If there are no even... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 15, 20, 25]) == [10, 20]\", \"assert filter_even_numbers([1, 3, 5]) == []\", \"assert filter_even_numbers([]) == []\", \"assert filter_even_numbers([6, 8, 10]) == [6, 8, 10]\... | {
"split": "train",
"index": 81394,
"acecode_id": "oss_33867",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program that converts temperatures from Celsius to Fahrenheit. The formula for converting Celsius to Fahrenheit is given by the equation: \n\nF = (9/5)C + 32\n\nYour program should take a temperature in Celsius as input and return a formatted stri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert celsius_to_fahrenheit(0) == 'A temperatura de 0 Grau Celsius em fahrenheit equivale a 32.0F'\", \"assert celsius_to_fahrenheit(100) == 'A temperatura de 100 Grau Celsius em fahrenheit equivale a 212.0F'\", \"assert celsius_to_fahrenheit(-40) == 'A temperatur... | {
"split": "train",
"index": 81395,
"acecode_id": "oss_21014",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to simulate a single round of the game 'Rock, Paper, Scissors'. Your function should take two string inputs: the user's choice and the computer's choice. The choices can be 'rock', 'paper', or 'scissors'. The function should determine... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert determine_winner('rock', 'scissors') == 'user'\", \"assert determine_winner('scissors', 'paper') == 'user'\", \"assert determine_winner('paper', 'rock') == 'user'\", \"assert determine_winner('rock', 'paper') == 'computer'\", \"assert determine_winner('paper... | {
"split": "train",
"index": 81396,
"acecode_id": "oss_32522",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that merges two sorted arrays into a single sorted array. The function should take two input arrays, each containing integers in ascending order, and return a new array containing all the elements from the input arrays in ascen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_sorted_arrays([1, 3, 5], [2, 4, 6]) == [1, 2, 3, 4, 5, 6]\", \"assert merge_sorted_arrays([], [2, 4, 6]) == [2, 4, 6]\", \"assert merge_sorted_arrays([1, 2, 3], []) == [1, 2, 3]\", \"assert merge_sorted_arrays([], []) == []\", \"assert merge_sorted_arr... | {
"split": "train",
"index": 81397,
"acecode_id": "oss_7695",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of unsigned 32-bit integers, where the maximum value (2^32 - 1) represents a delimiter that separates segments of integers. Your task is to implement a function that takes this list as input and returns a list of segments, where each segment is a list of in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert segments_decode([1, 2, 4294967295, 3, 4]) == [[1, 2], [3, 4]]\", \"assert segments_decode([7, 8, 9, 4294967295, 10, 11]) == [[7, 8, 9], [10, 11]]\", \"assert segments_decode([10, 20, 30, 40]) == [[10, 20, 30, 40]]\", \"assert segments_decode([1, 4294967295, ... | {
"split": "train",
"index": 81398,
"acecode_id": "bigcode_python_fns_16086",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a number (which can be a positive integer, negative integer, or a floating-point number), write a function that converts it from decimal representation to its hexadecimal form. The function should return the hexadecimal representation as a string. For negative numbers, th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert clean_dec_to_hex(255) == 'ff'\", \"assert clean_dec_to_hex(-255) == '-ff'\", \"assert clean_dec_to_hex(0) == '0'\", \"assert clean_dec_to_hex(-0) == '0'\", \"assert clean_dec_to_hex(10.5) == 'a.8'\", \"assert clean_dec_to_hex(-10.5) == '-a.8'\", \"assert cle... | {
"split": "train",
"index": 81399,
"acecode_id": "evol_26279",
"num_tests": 13
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.