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": "Implement a function `advanced_complex_rounding(value: str, low: float, high: float, rounding_type: str) -> Union[int, str]` that takes in a string representation of a number `value`, two floats `low` and `high` defining a range, and a string `rounding_type` which can be either...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert advanced_complex_rounding('15.7', 10, 20, 'towards_zero') == 15\", \"assert advanced_complex_rounding('15.7', 10, 20, 'ceiling') == 16\", \"assert advanced_complex_rounding('15.2', 10, 20, 'floor') == 15\", \"assert advanced_complex_rounding('-5.4', -10, 0, ...
{ "split": "train", "index": 800, "acecode_id": "evol_10891", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `process_data(data: List[str], compounds: List[Compound]) -> None`. The function takes two parameters: an iterable `data` which contains entries with space-separated strings, and a list of `Compound` objects. Each entry in `data` cons...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_data(['0 5.2', '1 6.8'], [Compound(0), Compound(1)]) is None\", \"assert process_data(['0 3.4'], [Compound(0)]) is None\", \"assert process_data(['1 4.5'], [Compound(0), Compound(1)]) is None\", \"assert process_data(['2 7.1'], [Compound(0), Compound...
{ "split": "train", "index": 801, "acecode_id": "oss_12091", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing a bridge identifier. Your task is to normalize this identifier based on the following rules: 1. If the identifier is 17 characters long and contains colons (:) every two characters (like 'aa:bb:cc:dd:ee:ff'), return the identifier without col...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert normalize_bridge_id('aa:bb:cc:dd:ee:ff') == 'aabbccddeeff'\", \"assert normalize_bridge_id('123456fffe789012') == '123456789012'\", \"assert normalize_bridge_id('123456789012') == '123456789012'\", \"assert normalize_bridge_id('abcdef123456') == 'abcdef12345...
{ "split": "train", "index": 802, "acecode_id": "bigcode_python_fns_14892", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a time in seconds and a clock period in seconds. Your task is to write a function that calculates the start time of the next clock period after the given time. The start time of the next clock period is defined as the first multiple of the clock period that is gre...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert start_of_next_clk_period(0.5, 1.0) == 1.0\", \"assert start_of_next_clk_period(1.0, 1.0) == 2.0\", \"assert start_of_next_clk_period(2.5, 1.0) == 3.0\", \"assert start_of_next_clk_period(1.5, 0.5) == 2.0\", \"assert start_of_next_clk_period(3.0, 2.0) == 4.0\...
{ "split": "train", "index": 803, "acecode_id": "bigcode_python_fns_33975", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that finds the shortest subsequence in a given string that contains all unique alphabetic characters present in the string. The function should return this minimal length subsequence. If the input string is empty or does not contain any alphabetic character...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert min_subsequence('a') == 'a'\", \"assert min_subsequence('abc') == 'abc'\", \"assert min_subsequence('aabbcc') == 'abc'\", \"assert min_subsequence('abca') == 'abc'\", \"assert min_subsequence('xyzxyz') == 'xyz'\", \"assert min_subsequence('abcdefgh') == 'abc...
{ "split": "train", "index": 804, "acecode_id": "evol_601", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a list of geographical coordinates, each represented as a tuple (latitude, longitude), write a function `is_coordinate_valid(coordinate: Tuple[float, float]) -> bool` that checks if the given coordinate is valid. A valid coordinate must meet the following criteria: the la...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_coordinate_valid((45.0, 90.0)) == True\", \"assert is_coordinate_valid((-90.0, 180.0)) == True\", \"assert is_coordinate_valid((90.0, 180.0)) == True\", \"assert is_coordinate_valid((45.0, -180.0)) == True\", \"assert is_coordinate_valid((91.0, 0.0)) == F...
{ "split": "train", "index": 805, "acecode_id": "bigcode_python_fns_25995", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a configuration string for a web server. The configuration string contains a directive `ssl_ciphers` followed by a space and then a list of SSL ciphers enclosed in double quotes. Your function needs to extract the SSL c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_ssl_ciphers('ssl_ciphers \\\"ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE\\\";') == [\\\"ECDHE-RSA-AES128-GCM-SHA256\\\", \\\"HIGH\\\", \\\"!aNULL\\\", \\\"!MD5\\\", \\\"!RC4\\\", \\\"!DHE\\\"]\", \"assert extract_ssl_ciphers('ssl_ciphers \...
{ "split": "train", "index": 806, "acecode_id": "oss_542", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer `num_rows`, implement a function `generate_pascals_triangle(num_rows: int) -> List[List[int]]` that generates the first `num_rows` of Pascal's triangle. Each row in Pascal's triangle is constructed by adding the two numbers directly above it from the previous r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_pascals_triangle(0) == []\", \"assert generate_pascals_triangle(1) == [[1]]\", \"assert generate_pascals_triangle(2) == [[1], [1, 1]]\", \"assert generate_pascals_triangle(3) == [[1], [1, 1], [1, 2, 1]]\", \"assert generate_pascals_triangle(4) == [[...
{ "split": "train", "index": 807, "acecode_id": "oss_11484", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two alphabetic sequences represented as strings, develop a function that converts each sequence into two sorted arrays in ascending lexicographical order without using any built-in sort functions. The function should then merge these two sorted arrays into one final sorte...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_sorted_sequences('cbaefd', 'ghjikl') == ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l']\", \"assert merge_sorted_sequences('zyx', 'abc') == ['a', 'b', 'c', 'x', 'y', 'z']\", \"assert merge_sorted_sequences('', '') == []\", \"assert merge_s...
{ "split": "train", "index": 808, "acecode_id": "evol_18906", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list named arr of integers. Your task is to implement a function that determines the minimum number of modifications required to transform this list into a palindromic list, ensuring that any modified elements fall within a specified range of integers provided s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert smallest_change([1, 2, 3, 5, 4, 7, 9, 6], [1, 10]) == 4\", \"assert smallest_change([1, 2, 3, 2, 1], [1, 3]) == 0\", \"assert smallest_change([1, 1, 1, 1], [1, 1]) == 0\", \"assert smallest_change([10, 20, 30, 20, 10], [10, 30]) == 0\", \"assert smallest_cha...
{ "split": "train", "index": 809, "acecode_id": "evol_20548", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Write a function `compute_gcd(a: int, b: int) -> int` that computes the greatest common divisor (GCD) of two distinct integers a and b. You can assume that a and b are both positive integers and that a is not equal to b. For example, if a = 18 and b = 15, the function should re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_gcd(18, 15) == 3\", \"assert compute_gcd(28, 14) == 14\", \"assert compute_gcd(101, 10) == 1\", \"assert compute_gcd(12, 15) == 3\", \"assert compute_gcd(45, 75) == 15\", \"assert compute_gcd(100, 25) == 25\", \"assert compute_gcd(7, 3) == 1\", \"ass...
{ "split": "train", "index": 810, "acecode_id": "evol_13829", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given an array of integers `arr`. Your task is to find the maximum difference between any two elements in the array. If the array contains only one element, return 0. Write a function `max_difference(arr)` that takes in the array `arr` and returns the maximum difference...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_difference([1, 2, 3]) == 2\", \"assert max_difference([4]) == 0\", \"assert max_difference([5, 5, 5, 5]) == 0\", \"assert max_difference([0, 0, 0, 0]) == 0\", \"assert max_difference([100, 200, 300]) == 200\", \"assert max_difference([-10, 0, 10]) == 20\...
{ "split": "train", "index": 811, "acecode_id": "oss_14678", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates build instructions for a software project's build system. The function should take three parameters: a list of input files or data required for the build action, a list of tools or resources needed for the action, and a lis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_build_instructions(['file1.txt'], ['tool1'], ['output1.txt']) == \\\"dotnet.actions.run(\\\\n inputs = ['file1.txt'] + resolve[0].to_list(),\\\\n tools = ['tool1'],\\\\n outputs = ['output1.txt'],\\\\n)\\\"\", \"assert generate_build_instru...
{ "split": "train", "index": 812, "acecode_id": "oss_23708", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers representing the ages of a group of people, write a function `calculate_mean_age(ages)` that returns the arithmetic mean age as a float. The input list will not be empty and will contain only non-negative integers.\nPlease reason step by step, then writ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_mean_age([18, 22, 30]) == 23.333333333333332\", \"assert calculate_mean_age([0, 0, 0, 0]) == 0.0\", \"assert calculate_mean_age([10, 10, 10, 10, 10]) == 10.0\", \"assert calculate_mean_age([5, 15, 25, 35]) == 20.0\", \"assert calculate_mean_age([10...
{ "split": "train", "index": 813, "acecode_id": "evol_19645", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a Python function that shifts a list by a specified number of positions and sorts the remaining elements based on specific rules. The function should be able to handle edge cases such as an empty list, a list with a single element, or a shift number that exceeds the list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert shift_and_sort([], 2) == []\", \"assert shift_and_sort([1], 1) == [1]\", \"assert shift_and_sort([1, 2, 3], 0) == [1, 2, 3]\", \"assert shift_and_sort([1, 2, 3], 3) == [1, 2, 3]\", \"assert shift_and_sort([3, 1, 2], 1) == [1, 2, 3]\", \"assert shift_and_sort...
{ "split": "train", "index": 814, "acecode_id": "evol_17425", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes three strings as input: job_id, equipment, and field_object. The function should return a string representation of the data provider in the format 'equipment / field_object / ' and also return a representation of the data provi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_data_provider_representation('001', 'Excavator', 'Site A') == ('Excavator / Site A / ', 'DataProvider(job_id=001, equipment=Excavator, field_object=Site A)')\", \"assert create_data_provider_representation('002', 'Bulldozer', 'Site B') == ('Bulldozer ...
{ "split": "train", "index": 815, "acecode_id": "oss_20923", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a custom training loop for a machine learning model. Your goal is to implement a function that simulates the execution of a training loop over a specified number of epochs and iterations. The function should take two parameters: `epochs` (an int...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_training_loop(1, 1) == ['Before Train Epoch', 'Before Train Iter', 'After Train Iter', 'After Train Epoch']\", \"assert simulate_training_loop(1, 2) == ['Before Train Epoch', 'Before Train Iter', 'After Train Iter', 'Before Train Iter', 'After Train...
{ "split": "train", "index": 816, "acecode_id": "oss_17781", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the collection of email server information for a given mail domain. The function should take a string representing a mail domain and return a list of MX (Mail Exchange) hostnames associated with that domain. The MX host...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert collect('example.com') == ['mail1.example.com', 'mail2.example.com']\", \"assert collect('test.com') == ['mx1.test.com']\", \"assert collect('no_mx.com') == []\", \"assert collect('example.com') != ['mail1.example.com']\", \"assert collect('example.com') != ...
{ "split": "train", "index": 817, "acecode_id": "bigcode_python_fns_27506", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of people, where each person is represented as a list containing their details. Each person's details include their name and an image filename associated with them. You are also given a dictionary that maps image names (without extensions) to actual image f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fix_image_filenames([['Alice', 'Engineer', 'alice.png'], ['Bob', 'Designer', 'bob.jpg'], ['Charlie', 'Manager', 'charlie.gif']], {'alice': 'alice_fixed.png', 'bob': 'bob_fixed.jpg'}) == ([['Alice', 'Engineer', 'alice_fixed.png'], ['Bob', 'Designer', 'bob_fix...
{ "split": "train", "index": 818, "acecode_id": "bigcode_python_fns_35728", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that accepts two lists of integers. The first list contains a set of integers, and the second list contains a set of divisors. The function should return a dictionary where the keys are the divisors and the values are lists of elements from the first list that ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert divisible_numbers([15, 20, 25, 30, 40, 45, 50], [5, 10]) == {5: [15, 20, 25, 30, 40, 45, 50], 10: [20, 30, 40, 50]}\", \"assert divisible_numbers([1, 2, 3, 4, 5, 6], [1, 2]) == {1: [1, 2, 3, 4, 5, 6], 2: [2, 4, 6]}\", \"assert divisible_numbers([10, 15, 20, ...
{ "split": "train", "index": 819, "acecode_id": "evol_32732", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Write a function that determines the positions of specific characters in a given string. The function should take a string and a list of characters as input, and return a dictionary where each character from the list is a key, and the value is a list of indexes where that chara...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert char_positions('hello world', ['h', 'e', 'l', 'o']) == {'h': [0], 'e': [1], 'l': [2, 3, 9], 'o': [4, 7]}\", \"assert char_positions('abracadabra', ['a', 'b']) == {'a': [0, 3, 5, 7, 10], 'b': [1, 8]}\", \"assert char_positions('', ['x', 'y']) == {'x': [], 'y'...
{ "split": "train", "index": 820, "acecode_id": "evol_35372", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function that categorizes a list of integers into groups based on user-defined rules. Each rule should be a callable function that takes an integer as input and returns a boolean value. The function should return a dictionary where the keys are the names of the rule...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert group_data([4, 2, 9, 5, 1], lambda x: x > 5) == {'<lambda>': [9], 'other': [4, 2, 5, 1]}\", \"assert group_data([4, 2, 9, 5, 1], lambda x: x % 3 == 0) == {'<lambda>': [9], 'other': [4, 2, 5, 1]}\", \"assert group_data([4, 2, 9, 5, 1], lambda x: x % 2 == 0) =...
{ "split": "train", "index": 821, "acecode_id": "evol_27626", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Write a function that checks whether an array contains any duplicate elements. The function should take a list of integers as input and return True if there are any duplicates, and False otherwise.\nPlease reason step by step, then write a self-contained Python solution. Give y...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert has_duplicates([3, 5, 8, 2, 1, 3]) == True\", \"assert has_duplicates([1, 2, 3, 4, 5]) == False\", \"assert has_duplicates([-1, -2, -3, -1]) == True\", \"assert has_duplicates([10, 20, 30, 10]) == True\", \"assert has_duplicates([1, 1, 2, 3]) == True\", \"as...
{ "split": "train", "index": 822, "acecode_id": "evol_23307", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that processes HTTP requests and generates appropriate responses based on the provided input. Write a Python function `process_request` that takes in two parameters: - `request_type` (string): Represents the type of the HTTP re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_request('response', 'https://example.com') == 'https://example.com'\", \"assert process_request('redirect', 'https://newexample.com') == 'Redirecting to: https://newexample.com'\", \"assert process_request('response', 'http://test.com') == 'http://te...
{ "split": "train", "index": 823, "acecode_id": "oss_17428", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function `combine_to_dict(list1, list2)` that takes two lists as input parameters. The function should check if the two lists have equal length and combine their elements into a single dictionary, where the keys come from the first list and the values from the se...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert combine_to_dict(['a', 'b', 'c'], [1, 2, 3]) == {'a': 1, 'b': 2, 'c': 3}\", \"assert combine_to_dict(['name', 'age'], ['Alice', 30]) == {'name': 'Alice', 'age': 30}\", \"assert combine_to_dict(['foo'], ['bar']) == {'foo': 'bar'}\", \"assert combine_to_dict(['...
{ "split": "train", "index": 824, "acecode_id": "evol_24703", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function `power_func(number, power=3)` that takes an input `number` and an optional parameter `power` (default value is 3). The function should check if `number` is a valid numerical value before computing its power. If the input is invalid, the function should retu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert power_func('3.5', 2) == 12.25\", \"assert power_func('2', 4) == 16\", \"assert power_func('5', 3) == 125\", \"assert power_func(-2, 3) == -8\", \"assert power_func(0, 5) == 0\", \"assert power_func('10.0', 1) == 10.0\", \"assert power_func(3.14, 2) == 9.8596...
{ "split": "train", "index": 825, "acecode_id": "evol_20773", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of floating-point numbers and computes the arithmetic mean of those numbers along with the mean of their derivatives, where the derivative of each number is defined as the difference between it and the next number in the sequence. The deri...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert mean_value_derivative([]) == (None, None)\", \"assert mean_value_derivative([1.0]) == (1.0, None)\", \"assert mean_value_derivative([5.0, 5.0, 5.0]) == (5.0, 0.0)\", \"assert mean_value_derivative([1.0]) == (1.0, None)\", \"assert mean_value_derivative([0.0,...
{ "split": "train", "index": 826, "acecode_id": "evol_5702", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a string that represents a line from a command output, which consists of a SHA-1 hash followed by a file path. Your task is to implement a function `parse_line(line_str: str) -> Tuple[str, str, str]` that parses this string and returns a tuple containing the SHA-1...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_line('3af30443352a5760cb0f88e619819cee1b1599e0 foo/bar/baz') == ('3af30443352a5760cb0f88e619819cee1b1599e0', 'foo/bar', 'baz')\", \"assert parse_line('e2c569b9ba775b243a2e5c4c2c4c2c4c2c2c2c2c foo/bar') == ('e2c569b9ba775b243a2e5c4c2c4c2c4c2c2c2c2c', 'f...
{ "split": "train", "index": 827, "acecode_id": "bigcode_python_fns_32435", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Write a function that takes two alphanumeric strings and returns a sorted list of all unique numerical characters present in both strings. The function should only return the numerical characters, with each character appearing only once in the output list.\nPlease reason step b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_unique_numerical('abc123', 'def456') == ['1', '2', '3', '4', '5', '6']\", \"assert extract_unique_numerical('hello', 'world') == []\", \"assert extract_unique_numerical('test123', 'example456') == ['1', '2', '3', '4', '5', '6']\", \"assert extract_un...
{ "split": "train", "index": 828, "acecode_id": "evol_28217", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a configuration string formatted in YAML. The function should take a single string input representing the YAML configuration and return a dictionary with the configuration parameters parsed from the input string. Assume tha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_yaml_config('key1: value1\\\\nkey2: value2') == {'key1': 'value1', 'key2': 'value2'}\", \"assert parse_yaml_config('a: 1\\\\nb: 2\\\\nc: 3') == {'a': 1, 'b': 2, 'c': 3}\", \"assert parse_yaml_config('name: John\\\\nage: 30\\\\ncity: New York') == {'nam...
{ "split": "train", "index": 829, "acecode_id": "bigcode_python_fns_27389", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `matches_pattern(s: str) -> bool` that checks if a given string contains only the letters 'a' and 'b', and follows the pattern where every 'a' must be followed by at least two consecutive 'b' characters. The function should return True if the string matches thi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert matches_pattern('') == True\", \"assert matches_pattern('bb') == True\", \"assert matches_pattern('abbb') == True\", \"assert matches_pattern('aab') == False\", \"assert matches_pattern('ab') == False\", \"assert matches_pattern('aaabbbbc') == False\", \"ass...
{ "split": "train", "index": 830, "acecode_id": "evol_32093", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function that converts a given sentence into camel case format. The camel case format means that the first letter of each word is capitalized, and all spaces and punctuation are removed. The input sentence may contain mixed cases, spaces, punctuation, or special cha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert to_camel_case('hello world') == 'HelloWorld'\", \"assert to_camel_case('this is a test') == 'ThisIsATest'\", \"assert to_camel_case('convert THIS sentence') == 'ConvertThisSentence'\", \"assert to_camel_case('mixed CASE and punctuation!') == 'MixedCaseAndPun...
{ "split": "train", "index": 831, "acecode_id": "evol_948", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to implement a function that takes in the parameters for connecting to a server and returns a message indicating the connection status. The function should accept the following parameters: protocol (string), host (string), port (int), user (string), pwd (string), servi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert connect_to_server('https', 'localhost', 443, 'root', '', 'hostd', '/sdk') == 'Connection successful'\", \"assert connect_to_server('http', 'localhost', 80, 'root', '', 'hostd', '/sdk') == 'Connection successful'\", \"assert connect_to_server('https', 'localh...
{ "split": "train", "index": 832, "acecode_id": "bigcode_python_fns_36128", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `s`, return `True` if the string is a classic taut string, which means that the string reads the same forwards and backwards and that it has an even length. Otherwise, return `False`. A classic taut string should also contain only alphabetic characters. For examp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_classic_taut_string('abba') == True\", \"assert is_classic_taut_string('Noon') == True\", \"assert is_classic_taut_string('abc') == False\", \"assert is_classic_taut_string('AbC') == False\", \"assert is_classic_taut_string('abcd') == False\", \"assert is...
{ "split": "train", "index": 833, "acecode_id": "bigcode_python_fns_11818", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple test framework for a Python application. Your goal is to create a function called `runTestSuite` that simulates the behavior of a test suite. The function should return a list containing the results of the `setUp` method which should al...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert runTestSuite() == ['setup']\", \"assert runTestSuite() != ['teardown']\", \"assert len(runTestSuite()) == 1\", \"assert isinstance(runTestSuite(), list)\", \"assert runTestSuite()[0] == 'setup'\", \"assert 'setup' in runTestSuite()\", \"assert runTestSuite()...
{ "split": "train", "index": 834, "acecode_id": "oss_19083", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a function that renders a front page of a website. Implement a function `generate_front_page(title: str, content: str) -> str` that takes in a title and content as input and returns a string that formats the title and content into a simple HTML structure. The outp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_front_page('Home', 'Welcome to the homepage!') == '<html><head><title>Home</title></head><body><h1>Home</h1><p>Welcome to the homepage!</p></body></html>'\", \"assert generate_front_page('About Us', 'We are a tech company.') == '<html><head><title>A...
{ "split": "train", "index": 835, "acecode_id": "bigcode_python_fns_4349", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer n, your task is to calculate the nth Fibonacci number. The Fibonacci sequence is defined as follows: the first two numbers are 1 and 1, and each subsequent number is the sum of the two preceding numbers. You need to implement a function `fibonacci_number(n: int...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci_number(1) == 1\", \"assert fibonacci_number(2) == 1\", \"assert fibonacci_number(3) == 2\", \"assert fibonacci_number(4) == 3\", \"assert fibonacci_number(5) == 5\", \"assert fibonacci_number(6) == 8\", \"assert fibonacci_number(7) == 13\", \"asser...
{ "split": "train", "index": 836, "acecode_id": "oss_28856", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to implement a function `suppress_file_not_found(filename: str) -> Optional[TextIO]` that acts as a context manager to suppress the `FileNotFoundError` exception when trying to open a specified file. The function should return a context manager that, when used in a `wi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert suppress_file_not_found('existing_file.txt') is not None\", \"assert suppress_file_not_found('another_existing_file.txt') is not None\", \"assert suppress_file_not_found('file_with_content.txt') is not None\", \"assert suppress_file_not_found('empty_file.txt...
{ "split": "train", "index": 837, "acecode_id": "oss_26110", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `get_relaxed_graph(seq: int) -> dict`. This function should simulate a request to a graph service to retrieve a relaxed pose graph based on a given sequence number. The function will receive a sequence number, `seq`, and it should ret...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_relaxed_graph(1) == {'sequence': 1, 'update_graph': False, 'project': True}\", \"assert get_relaxed_graph(5) == {'sequence': 5, 'update_graph': False, 'project': True}\", \"assert get_relaxed_graph(0) == {'sequence': 0, 'update_graph': False, 'project': ...
{ "split": "train", "index": 838, "acecode_id": "bigcode_python_fns_41582", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries, where each dictionary represents an offer containing a 'price' key. Your task is to implement a function `average_price(offers)` that calculates the average price of the offers after ignoring the first offer (considered underpriced) and the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_price([{'price': 10}, {'price': 20}, {'price': 30}, {'price': 40}]) == 25.0\", \"assert average_price([{'price': 10}, {'price': 20}]) == 0.0\", \"assert average_price([{'price': 10}]) == 0.0\", \"assert average_price([]) == 0.0\", \"assert average_pr...
{ "split": "train", "index": 839, "acecode_id": "bigcode_python_fns_36161", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing filenames in a directory. Each filename may contain a first name and a surname, separated by an underscore, followed by a '.zip' extension. Your task is to implement a function `get_students_from_filenames(filenames: List[str]) -> Li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_students_from_filenames(['john_doe.zip', 'jane_smith.zip', 'invalidfile.txt']) == [('john', 'doe'), ('jane', 'smith')]\", \"assert get_students_from_filenames(['alice_wonderland.zip', 'bob_builder.zip']) == [('alice', 'wonderland'), ('bob', 'builder')]\"...
{ "split": "train", "index": 840, "acecode_id": "bigcode_python_fns_9549", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function called `calculate` that takes a list of integers and two additional integers, `operation_type` and `number`. The function should perform the operation specified by `operation_type` on each element of the list using `number`. The `operation_type` can be 1 fo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate([1, 2, 3], 1, 5) == [6, 7, 8]\", \"assert calculate([10, 20, 30], 2, 5) == [5, 15, 25]\", \"assert calculate([0, 0, 0], 1, 10) == [10, 10, 10]\", \"assert calculate([-1, -2, -3], 1, 3) == [2, 1, 0]\", \"assert calculate([1, 2, 3], 2, 1) == [0, 1, 2...
{ "split": "train", "index": 841, "acecode_id": "evol_11290", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to parse tiers of a cloud computing service from given string representations. You have a predefined list of tiers that consists of the following: \n1. 'WebServer:Standard:1.0'\n2. 'Worker:SQS/HTTP:1.0'\n3. 'Worker:SQS/HTTP:1.1'\n4. '...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_tier('webserver:standard:1.0') == ('WebServer', 'Standard', '1.0')\", \"assert parse_tier('worker:sqs/http:1.0') == ('Worker', 'SQS/HTTP', '1.0')\", \"assert parse_tier('worker:sqs/http:1.1') == ('Worker', 'SQS/HTTP', '1.1')\", \"assert parse_tier('wor...
{ "split": "train", "index": 842, "acecode_id": "oss_15786", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the pixel resolutions of images. Your task is to write a function that takes this list as input and returns a new list containing the resolutions in kilopixels (kpx). One kilopixel is equal to 1000 pixels. For example, given the inp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_kpx([125, 160, 200, 250, 320]) == [0.125, 0.16, 0.2, 0.25, 0.32]\", \"assert convert_to_kpx([1000, 2000, 3000]) == [1.0, 2.0, 3.0]\", \"assert convert_to_kpx([500]) == [0.5]\", \"assert convert_to_kpx([0, 1000]) == [0.0, 1.0]\", \"assert convert_t...
{ "split": "train", "index": 843, "acecode_id": "oss_7448", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string representing the name of a Cloud Foundry application, return the application name with a specified number of random characters appended to it. The characters can be any lowercase letters from 'a' to 'z'. The function should accept three parameters: the applicatio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert append_random_characters('my_app', 3, None) != 'my_app'\", \"assert len(append_random_characters('test', 0, None)) == 4\", \"assert append_random_characters('app', 1, None).startswith('app')\", \"assert append_random_characters('service', 5, None).startswith...
{ "split": "train", "index": 844, "acecode_id": "bigcode_python_fns_13886", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with converting a color representation into its corresponding HSV (Hue, Saturation, Value) format. The input can either be a string representing an RGB color in the format 'R,G,B' (where R, G, and B are integers ranging from 0 to 255) or a string of a named color...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert color_to_hsv('255,0,0') == (0.0, 1.0, 1.0)\", \"assert color_to_hsv('0,255,0') == (120.0, 1.0, 1.0)\", \"assert color_to_hsv('0,0,255') == (240.0, 1.0, 1.0)\", \"assert color_to_hsv('255,255,0') == (60.0, 1.0, 1.0)\", \"assert color_to_hsv('0,255,255') == (1...
{ "split": "train", "index": 845, "acecode_id": "bigcode_python_fns_14790", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function to parse weather data from a formatted string. The function should take a string `html_content` containing weather data for a single day and return a dictionary containing the day name, weather description, highest temperature, and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_weather_data('<div class=\\\"wob_d wob_se\\\" data-d=\\\"0\\\"><div class=\\\"QrNVmd Z1VzSb\\\" aria-label=\\\"Monday, July 5\\\">Monday</div><div class=\\\"DxhUm\\\"><img alt=\\\"Partly cloudy\\\" src=\\\"weather_icons/partly_cloudy.png\\\"></div><div...
{ "split": "train", "index": 846, "acecode_id": "oss_28666", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a string `sentence`, write a function `remove_vowels(sentence, exclude_y=True)` that removes all vowels from the sentence while preserving the original casing and punctuation. The function should have an optional parameter `exclude_y` which, when set to True, will exclude...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_vowels('Hello, World!') == 'Hll, Wrld!'\", \"assert remove_vowels('Python programming') == 'Pythn prgrmmng'\", \"assert remove_vowels('A quick brown fox jumps over the lazy dog.') == ' qck brwn fx jmps vr th lzy dg.'\", \"assert remove_vowels('What ab...
{ "split": "train", "index": 847, "acecode_id": "evol_31481", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Given a list of overlapping fragments represented as strings, where each fragment is denoted in the format 'O<id>:<value>@<location>[<type>]'. Your task is to split these overlapping fragments into separate non-overlapping fragments. You should return a list of unique fragments...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_fragments(['O1:0@4[cm]', 'O2:0@5[cm]', 'O4:0@3[cm]', 'O5:0@5[cm]']) == ['O1:0@4[cm]', 'O2:0@5[cm]', 'O4:0@3[cm]', 'O5:0@5[cm]']\", \"assert unique_fragments(['O1:0@1[cm]', 'O1:0@1[cm]', 'O2:0@2[cm]']) == ['O1:0@1[cm]', 'O2:0@2[cm]']\", \"assert unique...
{ "split": "train", "index": 848, "acecode_id": "bigcode_python_fns_49509", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a string template and a dictionary of variables. The function should replace placeholders in the template with corresponding values from the dictionary. Placeholders are denoted by curly braces, e.g., '{variable_name}'. If ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert render_template('Hello, {name}!', {'name': 'Alice'}) == 'Hello, Alice!'\", \"assert render_template('Your score is {score}.', {'score': '95'}) == 'Your score is 95.'\", \"assert render_template('This is {adjective} day.', {'adjective': 'a beautiful'}) == 'Th...
{ "split": "train", "index": 849, "acecode_id": "bigcode_python_fns_44826", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates checking for the existence of a directory and creating a new one if it doesn't exist. The function should take two parameters: a string 'directory' which represents the name of the directory to check, and a boolean 'verbose...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_directory('test_dir', True) == 'test_dir'\", \"assert check_directory('test_dir', False) == 'test_dir'\", \"assert check_directory('test', True) == 'test'\", \"assert check_directory('my_folder', True) == 'my_folder'\", \"assert check_directory('my_fol...
{ "split": "train", "index": 850, "acecode_id": "bigcode_python_fns_47580", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that sorts a 2D array in ascending order, first row-wise and then column-wise. The function should handle negative numbers, floating-point numbers, and null values. Additionally, it should remove any duplicate values before sorting. The input will be a 2D array...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_2d_array([[9, 8, 7], [6, 5, 4], [3, 2, 1]]) == [[1, 2, 3], [4, 5, 6], [7, 8, 9]]\", \"assert sort_2d_array([[None, None], [None, None]]) == [[None, None], [None, None]]\", \"assert sort_2d_array([[None]]) == [[None]]\", \"assert sort_2d_array([[None, No...
{ "split": "train", "index": 851, "acecode_id": "evol_29043", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given an array of integers, rearrange the array such that the highest number is first, followed by the lowest number, then the second highest, then the second lowest, and so on. Implement a function `rearrange_array(input_array)` that takes a list of integers and returns the re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rearrange_array([5, 3, 1, 2, 4]) == [5, 1, 4, 2, 3]\", \"assert rearrange_array([10, 1, 3, 9, 5]) == [10, 1, 9, 3, 5]\", \"assert rearrange_array([1, 2]) == [2, 1]\", \"assert rearrange_array([7]) == [7]\", \"assert rearrange_array([]) == []\", \"assert rear...
{ "split": "train", "index": 852, "acecode_id": "evol_35841", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of exactly four bytes (each byte is an integer between 0 and 255), convert these bytes from little-endian format into a single integer. The first byte in the list represents the least significant byte, while the last byte represents the most significant byte. Imple...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_bytes_to_integer([1, 0, 0, 0]) == 1\", \"assert convert_bytes_to_integer([255, 255, 255, 255]) == 4294967295\", \"assert convert_bytes_to_integer([0, 1, 0, 0]) == 256\", \"assert convert_bytes_to_integer([1, 1, 1, 1]) == 16843009\", \"assert convert_...
{ "split": "train", "index": 853, "acecode_id": "bigcode_python_fns_28585", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string containing a series of characters, write a function that determines whether the string contains a balanced set of block characters. A balanced set of block characters is defined as a set of characters where each opening block character has a corresponding closing...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_balanced_blocks('({})[]') == True\", \"assert is_balanced_blocks('({[()]})') == True\", \"assert is_balanced_blocks('{[()]}') == True\", \"assert is_balanced_blocks('') == True\", \"assert is_balanced_blocks('((()))') == True\", \"assert is_balanced_block...
{ "split": "train", "index": 854, "acecode_id": "oss_22484", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Construct a function in Python that removes a key-value pair from a given dictionary. If the key does not exist in the dictionary, the function should do nothing. Additionally, if a nested dictionary is present, the function should also remove the key-value pair from any nested...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_key({'a': 1, 'b': 2, 'c': 3}, 'b') == {'a': 1, 'c': 3}\", \"assert remove_key({'x': 10, 'y': {'z': 20}}, 'z') == {'x': 10, 'y': {}}\", \"assert remove_key({'a': 1, 'b': 2, 'c': {'d': 4}}, 'c') == {'a': 1, 'b': 2}\", \"assert remove_key({'a': 1, 'b': 2...
{ "split": "train", "index": 855, "acecode_id": "evol_24762", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string, write a function that substitutes every numerical digit present in the string with the symbol designated as a hash (#). The function should return the modified string.\nPlease reason step by step, then write a self-contained Python solution. Give your final prog...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert substitute_numerical_values('Today is 4th of July, 2021!') == 'Today is #th of July, ####!'\", \"assert substitute_numerical_values('123 ABC 456') == '### ABC ###'\", \"assert substitute_numerical_values('No numbers here!') == 'No numbers here!'\", \"assert ...
{ "split": "train", "index": 856, "acecode_id": "evol_25932", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes an identifier (a string) as input and returns a formatted string that represents the object with that identifier. If the provided identifier is None, the function should raise a ValueError. Implement a function named `format_ob...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_object('123') == 'Object with ID: 123'\", \"assert format_object('abc') == 'Object with ID: abc'\", \"assert format_object('xyz') == 'Object with ID: xyz'\", \"assert format_object('test_id') == 'Object with ID: test_id'\", \"assert format_object('') ...
{ "split": "train", "index": 857, "acecode_id": "oss_36383", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates training a machine learning model for a specified number of epochs and batches. The function should take in the total number of epochs and batches per epoch as parameters and return a list of dictionaries. Each dictiona...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_training(1, 1) == [{'loss': 1.0, 'accuracy': 0.0}]\", \"assert simulate_training(1, 2) == [{'loss': 1.0, 'accuracy': 0.0}, {'loss': 0.5, 'accuracy': 50.0}]\", \"assert simulate_training(2, 2) == [{'loss': 1.0, 'accuracy': 0.0}, {'loss': 0.5, 'accura...
{ "split": "train", "index": 858, "acecode_id": "evol_28698", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of assignments and a class identifier, and returns a list of assignments that belong to the specified class. Each assignment is represented as a dictionary with at least two keys: 'id' (a unique identifier for the assign...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_assignments([{'id': 1, 'class_id': 10}, {'id': 2, 'class_id': 20}], 10) == [{'id': 1, 'class_id': 10}]\", \"assert filter_assignments([{'id': 3, 'class_id': 30}, {'id': 4, 'class_id': 30}], 30) == [{'id': 3, 'class_id': 30}, {'id': 4, 'class_id': 30}]...
{ "split": "train", "index": 859, "acecode_id": "bigcode_python_fns_5276", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a logging utility in Python. Create a function `log_messages` that accepts a list of tuples, where each tuple contains a log level (as a string) and a message (as a string). Your function should log each message at the specified level using the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert log_messages([('DEBUG', 'This is a debug message')]) is None\", \"assert log_messages([('INFO', 'This is an info message')]) is None\", \"assert log_messages([('WARNING', 'This is a warning message')]) is None\", \"assert log_messages([('ERROR', 'This is an ...
{ "split": "train", "index": 860, "acecode_id": "oss_29881", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing a list of tasks. Each task is represented as a dictionary with a unique 'task_id'. Your goal is to implement a function called `manage_tasks` that takes two arguments: a list of tasks (dictionaries) and a task to delete. The function should remove t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_tasks([{'task_id': 1}, {'task_id': 2}], {'task_id': 1}) == (1, [{'task_id': 2}])\", \"assert manage_tasks([{'task_id': 1}, {'task_id': 2}], {'task_id': 3}) == (-1, [{'task_id': 1}, {'task_id': 2}])\", \"assert manage_tasks([{'task_id': 1}], {'task_id'...
{ "split": "train", "index": 861, "acecode_id": "oss_14547", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, write a function that returns the sum of the first n unique elements from the array. If there are fewer than n unique elements, return the sum of all unique elements. The input parameters are the array and the integer n.\nPlease reason step by step, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_unique_elements([2, 4, 6, 8, 10, 2, 4, 6], 5) == 30\", \"assert sum_unique_elements([1, 1, 2, 3, 4], 3) == 6\", \"assert sum_unique_elements([5, 5, 5, 5], 2) == 5\", \"assert sum_unique_elements([10, 20, 10, 30, 40], 4) == 100\", \"assert sum_unique_elem...
{ "split": "train", "index": 862, "acecode_id": "evol_25011", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a tuple of row labels and a row number, return a new tuple that contains only the row number as a string. The input tuple may contain any combination of strings, but it should not affect the output. Your function should ignore the original tuple content and focus solely o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rowfuncbynumber(('row1', 'row2', 'row3'), 1) == ('1',)\", \"assert rowfuncbynumber(('rowA', 'rowB'), 5) == ('5',)\", \"assert rowfuncbynumber(('header1', 'header2', 'header3'), 0) == ('0',)\", \"assert rowfuncbynumber(('col1', 'col2', 'col3'), 10) == ('10',)...
{ "split": "train", "index": 863, "acecode_id": "bigcode_python_fns_11158", "num_tests": 16 }
acecode
[ { "role": "user", "content": "What is the maximum possible value that can be stored in a single byte using Two's complement representation? Implement a function that calculates this maximum value using bitwise operations.\nPlease reason step by step, then write a self-contained Python solution. Give your fi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_twos_complement_byte() == 127\", \"assert max_twos_complement_byte() == 127\", \"assert max_twos_complement_byte() == 127\", \"assert max_twos_complement_byte() == 127\", \"assert max_twos_complement_byte() == 127\", \"assert max_twos_complement_byte() =...
{ "split": "train", "index": 864, "acecode_id": "evol_23390", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the configuration of an NLP model training script. The function should accept various parameters to configure the model architecture and training parameters. Implement a function called `configure_model` that takes the foll...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert configure_model(True, False, 'mr', 'glove.6B.300d.txt', 32, 70, 150, 0.3, 1, 0.001) == {'cnn': True, 'lstm': False, 'dataset': 'mr', 'embedding': 'glove.6B.300d.txt', 'batch_size': 32, 'max_epoch': 70, 'd': 150, 'dropout': 0.3, 'depth': 1, 'lr': 0.001}\", \"...
{ "split": "train", "index": 865, "acecode_id": "oss_9663", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, compute the difference between each element and the element that is 'step' indices ahead. Implement a function called `difference_with_step` that takes an array of integers and a step size as input, and returns a new array where each element at index...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert difference_with_step([1, 2, 3, 4, 5], 1) == [1, 1, 1, 1]\", \"assert difference_with_step([5, 6, 7, 8, 9], 1) == [1, 1, 1, 1]\", \"assert difference_with_step([10, 20, 30, 40], 2) == [20, 20]\", \"assert difference_with_step([10, 15, 20], 1) == [5, 5]\", \"a...
{ "split": "train", "index": 866, "acecode_id": "bigcode_python_fns_363", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a multi-dimensional array of integers, implement a function `has_duplicate_pairs(array)` that checks if there are any duplicated adjacent pairs in the sub-arrays. An adjacent pair is defined as two consecutive elements in the same sub-array. The function should return `Tr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert has_duplicate_pairs([[1, 2, 3], [4, 5, 6]]) == False\", \"assert has_duplicate_pairs([[1, 2, 3], [3, 2, 1]]) == False\", \"assert has_duplicate_pairs([[1, 2, 3, 1], [4, 5, 6]]) == False\", \"assert has_duplicate_pairs([[1, 1, 1], [2, 2, 2]]) == True\", \"ass...
{ "split": "train", "index": 867, "acecode_id": "evol_32275", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a starting position of a particle in a two-dimensional space represented by coordinates (x, y), implement a function `simulate_movement(steps: int) -> Tuple[int, int]` that simulates random movements of the particle. The particle can move in four directions: up (increasin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_movement(0) == (0, 0)\", \"assert simulate_movement(1) in [(0, 1), (0, -1), (-1, 0), (1, 0)]\", \"assert simulate_movement(2) != (0, 0)\", \"assert simulate_movement(10) != (0, 0)\", \"assert simulate_movement(20) != (0, 0)\", \"assert simulate_move...
{ "split": "train", "index": 868, "acecode_id": "evol_31573", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Write a function that takes a positive integer `max_num` as input and returns a list of tuples where each tuple contains a palindrome prime number less than or equal to `max_num` and the sum of its digits. If `max_num` is less than or equal to 0, the function should return an e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert palindrome_prime(10) == [(2, 2), (3, 3), (5, 5), (7, 7)]\", \"assert palindrome_prime(0) == []\", \"assert palindrome_prime(-5) == []\", \"assert palindrome_prime(1) == []\", \"assert palindrome_prime(2) == [(2, 2)]\", \"assert palindrome_prime(3) == [(2, 2)...
{ "split": "train", "index": 869, "acecode_id": "evol_16680", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function `get_user_data(user_id: int) -> dict` that takes a user ID as an integer and returns a dictionary containing user data fetched from a simulated API. The API endpoint is `http://api.example.com/user/{user_id}`. For the purpose of this exercise, simulate the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_user_data(1) == {'id': 1, 'name': 'Alice', 'age': 30}\", \"assert get_user_data(2) == {'id': 2, 'name': 'Bob', 'age': 25}\", \"assert get_user_data(0) == {}\", \"assert get_user_data(11) == {}\", \"assert get_user_data(-1) == {}\", \"assert get_user_data...
{ "split": "train", "index": 870, "acecode_id": "evol_16330", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a non-negative integer array (arr), representing tree branches. Your task is to extract and return the smallest value node that satisfies all the conditions specified in a list of conditional functions (cond_fn_list). The output should be formatted as [smallest_va...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert pluck([], [lambda x: x % 3 == 0, lambda x: x > 0]) == []\", \"assert pluck([1, 3, 5, 7, 9], [lambda x: x % 2 == 0]) == []\", \"assert pluck([8, 6, 7], [lambda x: x < 5]) == []\", \"assert pluck([9, 8, 7, 6], [lambda x: x > 10]) == []\", \"assert pluck([10, 1...
{ "split": "train", "index": 871, "acecode_id": "evol_17163", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a collection of strings and a target string. The function should return True if the target string is present in the collection, and False otherwise. The collection can be a list or a set of strings. Implement the function `is_s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_string_in_collection(['apple', 'banana', 'cherry'], 'banana') == True\", \"assert is_string_in_collection(['apple', 'banana', 'cherry'], 'grape') == False\", \"assert is_string_in_collection(['dog', 'cat', 'mouse'], 'cat') == True\", \"assert is_string_in...
{ "split": "train", "index": 872, "acecode_id": "bigcode_python_fns_22148", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function to find the longest common substring between two given strings. The function should take two strings as input and return the longest common substring. If there are multiple longest common substrings, return any one of them. If there is no common substring, retu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longest_common_substring('abc', 'def') == ''\", \"assert longest_common_substring('abcde', 'abfce') == 'ab'\", \"assert longest_common_substring('abc', 'abc') == 'abc'\", \"assert longest_common_substring('a', 'b') == ''\", \"assert longest_common_substring(...
{ "split": "train", "index": 873, "acecode_id": "evol_26401", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given two lists of tuples, `named_params_model` and `named_params_optimizer`, each containing pairs of parameter names and their corresponding values. Your task is to implement a function `copy_optimizer_params_to_model(named_params_model, named_params_optimizer)` that ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert copy_optimizer_params_to_model([('weight', 1.0), ('bias', 0.5)], [('weight', 2.0), ('bias', 0.3)]) == [('weight', 2.0), ('bias', 0.3)]\", \"assert copy_optimizer_params_to_model([('a', 1), ('b', 2)], [('a', 3), ('b', 4)]) == [('a', 3), ('b', 4)]\", \"assert ...
{ "split": "train", "index": 874, "acecode_id": "bigcode_python_fns_24130", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with managing virtual disk operations for a virtual machine in a cloud environment. Write a function `perform_volume_operation(volume_name: str, operation: str) -> str` that accepts two parameters: a string `volume_name` representing the name of the volume and a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert perform_volume_operation('MyVolume', 'ATTACH') == 'Volume MyVolume has been attached.'\", \"assert perform_volume_operation('MyVolume', 'DETACH') == 'Volume MyVolume has been detached.'\", \"assert perform_volume_operation('Volume1', 'ATTACH') == 'Volume Vol...
{ "split": "train", "index": 875, "acecode_id": "bigcode_python_fns_30503", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 3D matrix (a list of 2D matrices), write a function that traverses the 3D matrix in a spiral order and returns a 1D array containing all the elements in that order. The function should handle edge cases, such as empty matrices, matrices with a single row or column, and ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert spiralOrder3D([]) == []\", \"assert spiralOrder3D([[[]]]) == []\", \"assert spiralOrder3D([[[1]]]) == [1]\", \"assert spiralOrder3D([[[]], [[]]]) == []\", \"assert spiralOrder3D([[[1]], [[2]], [[3]]]) == [1, 2, 3]\", \"assert spiralOrder3D([[[1]], [[2]], [[3...
{ "split": "train", "index": 876, "acecode_id": "evol_20367", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given a list of tokenized documents (lists of words), determine the unique words that appear in at least a specified minimum number of documents. Implement a function `unique_words_in_docs(docs: List[List[str]], min_df: int) -> List[str]` that takes in a list of tokenized docum...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_words_in_docs([['apple', 'banana'], ['banana', 'orange'], ['apple', 'kiwi']], 2) == ['apple', 'banana']\", \"assert unique_words_in_docs([['apple', 'banana'], ['banana', 'orange'], ['kiwi']], 2) == ['banana']\", \"assert unique_words_in_docs([['apple'...
{ "split": "train", "index": 877, "acecode_id": "bigcode_python_fns_31058", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement the insertion sort algorithm. Write a function `insertion_sort` that takes a list of integers as input and returns the list sorted in ascending order. The insertion sort algorithm sorts the list by iteratively taking an element from the unsorted part and inserting it ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert insertion_sort([5, 2, 9, 1, 5, 6]) == [1, 2, 5, 5, 6, 9]\", \"assert insertion_sort([3, 5, 1, 2, 4]) == [1, 2, 3, 4, 5]\", \"assert insertion_sort([10, 9, 8, 7, 6]) == [6, 7, 8, 9, 10]\", \"assert insertion_sort([1]) == [1]\", \"assert insertion_sort([]) == ...
{ "split": "train", "index": 878, "acecode_id": "oss_13987", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a sentiment analysis function in Python. The function should take a string input and determine whether the sentiment of the text is positive or negative. Implement the `sentiment_analysis` function which returns 'Positive' if the sentiment of the te...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sentiment_analysis('I love this product!') == 'Positive'\", \"assert sentiment_analysis('This is a great day!') == 'Positive'\", \"assert sentiment_analysis('I feel sad today.') == 'Negative'\", \"assert sentiment_analysis('I hate this.') == 'Negative'\", \"...
{ "split": "train", "index": 879, "acecode_id": "oss_25720", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `get_coordinates(ip: str) -> Tuple[float, float]` that takes an Internet Protocol (IP) address as input and returns a tuple containing the latitude and longitude of the specified IP address. If the IP address is invalid or cannot be geolocated, return (0.0, 0.0...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_coordinates('192.168.1.1') == (0.0, 0.0)\", \"assert get_coordinates('255.255.255.255') == (0.0, 0.0)\", \"assert get_coordinates('0.0.0.0') == (0.0, 0.0)\", \"assert get_coordinates('127.0.0.1') == (0.0, 0.0)\", \"assert get_coordinates('10.0.0.1') == (...
{ "split": "train", "index": 880, "acecode_id": "evol_17470", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given two strings `seq1` and `seq2` of equal length consisting of uppercase letters, determine the number of pairs of indices (i, j) such that `seq1[i]` is equal to `seq2[j]`. Return the total count of such pairs. For example, if `seq1` is 'AAB' and `seq2` is 'ABA', the pairs w...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_pairs('AAB', 'ABA') == 5\", \"assert count_pairs('ZZZ', 'ZZZ') == 9\", \"assert count_pairs('AAAA', 'BBBB') == 0\", \"assert count_pairs('XYZ', 'XYZ') == 3\", \"assert count_pairs('A', 'A') == 1\", \"assert count_pairs('A', 'B') == 0\", \"assert count_...
{ "split": "train", "index": 881, "acecode_id": "bigcode_python_fns_32806", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a string, implement a function `get_substring` that extracts a substring based on the provided starting and ending character offsets, considering that the string is encoded in UTF-16. The function should take into account a byte order mark (BOM) which adds 2 bytes to the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_substring('Hello, World!', 0, 5) == 'Hello'\", \"assert get_substring('Hello, World!', 7, 12) == 'World'\", \"assert get_substring('Hello, World!', None, None) == 'Hello, World!'\", \"assert get_substring('Hello, World!', 13, 13) == ''\", \"assert get_su...
{ "split": "train", "index": 882, "acecode_id": "bigcode_python_fns_19201", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary containing several fields related to an annotation record. Each field may contain a specific type of value: 'bounded' can be either 'true' or 'false', 'invalid' should be a boolean value, 'extended' must be 'true' or 'false', 'change' should also be a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_annotation({'bounded': 'true', 'invalid': True, 'extended': 'false', 'change': False, 'stative': 'true', 'notes': 'valid'}) == []\", \"assert validate_annotation({'bounded': 'false', 'invalid': False, 'extended': 'false', 'change': True, 'stative': ...
{ "split": "train", "index": 883, "acecode_id": "bigcode_python_fns_41422", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that converts a string representing a Django admin operation into a corresponding permission flag integer. The mapping of operation strings to their respective permission flags is defined in a dictionary called DJANGO_OP_TO_FLAG. If t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert django_op_to_flag('add') == 1\", \"assert django_op_to_flag('change') == 2\", \"assert django_op_to_flag('edit') == 0\", \"assert django_op_to_flag('archive') == 0\", \"assert django_op_to_flag('publish') == 0\", \"assert django_op_to_flag('unpublish') == 0\...
{ "split": "train", "index": 884, "acecode_id": "bigcode_python_fns_32328", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the selection process for sound settings in a game. The game has four buttons: 'Sound On', 'Sound Off', 'Music On', 'Music Off', and an 'Exit' button. Each button can be selected based on the direction of navigation (le...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sound_settings('Exit', ['left', 'up']) == 'Music On'\", \"assert sound_settings('Exit', ['up', 'left', 'left']) == 'Sound Off'\", \"assert sound_settings('Music On', ['down', 'down']) == 'Exit'\", \"assert sound_settings('Sound On', ['down', 'down', 'right',...
{ "split": "train", "index": 885, "acecode_id": "bigcode_python_fns_25930", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to clean up HTML content by removing specific tags. Your function should take in a string of HTML content and a list of tags to remove, and return the cleaned HTML content. The tags in the list will contain only the tag names to be re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert clean_html('<div><h1>Header</h1><p>Paragraph</p></div>', ['h1']) == '<div><p>Paragraph</p></div>'\", \"assert clean_html('<ul><li>Item 1</li><li>Item 2</li></ul>', ['li']) == '<ul></ul>'\", \"assert clean_html('<p><a href=\\\"link\\\">Link</a></p>', ['a']) =...
{ "split": "train", "index": 886, "acecode_id": "oss_12725", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of lists representing a multi-dimensional array (tensor). Each inner list represents a row in the tensor. Your task is to write a function `tail(tensor)` that takes this multi-dimensional array as input and returns a list of the last elements from each inne...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert tail([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == [3, 6, 9]\", \"assert tail([[1, 2], [4, 5], [7]]) == [2, 5, 7]\", \"assert tail([[], [4, 5, 6], [7, 8, 9]]) == [6, 9]\", \"assert tail([[10, 20], [30, 40, 50], [60]]) == [20, 50, 60]\", \"assert tail([[1], [], [3, 4...
{ "split": "train", "index": 887, "acecode_id": "oss_14963", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `identify_tone` that takes a string input representing a voice clip transcript and returns the tone of the voice as 'positive', 'negative', or 'neutral'. The function should determine the tone based on specific keywords: if the string contains 'love', 'like', o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert identify_tone('I hate this weather') == 'negative'\", \"assert identify_tone('This is an average experience') == 'neutral'\", \"assert identify_tone('I really like the food here') == 'positive'\", \"assert identify_tone('I dislike the traffic') == 'negative'...
{ "split": "train", "index": 888, "acecode_id": "evol_20825", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a 3x3 convolution transpose operation. The function should take in the number of input channels (in_planes), the number of output channels (out_planes), a stride value (stride), and an output padding value (output_paddi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert conv3x3(1, 1) == {'in_planes': 1, 'out_planes': 1, 'kernel_size': 3, 'stride': 1, 'padding': 1, 'output_padding': 0}\", \"assert conv3x3(3, 2) == {'in_planes': 3, 'out_planes': 2, 'kernel_size': 3, 'stride': 1, 'padding': 1, 'output_padding': 0}\", \"assert ...
{ "split": "train", "index": 889, "acecode_id": "bigcode_python_fns_30898", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that determines the encoding type of audio tracks based on their format and precision. The function should accept four parameters: `format_` (a string representing the audio format), `track` (a dictionary containing a key `precision` with...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_encoding('FLAC', {'precision': 16}, None, None) == ('Lossless', False)\", \"assert parse_encoding('FLAC', {'precision': 24}, None, None) == ('24bit Lossless', False)\", \"assert parse_encoding('FLAC', {'precision': 20}, None, 'MP3') == 'MP3'\", \"asser...
{ "split": "train", "index": 890, "acecode_id": "bigcode_python_fns_28136", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that scales a given list of floating-point numbers to fit within a specified width while preserving the relative differences between the original numbers. Implement the function `scale_numbers(numbers, target_width)` where: - `numbers...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert scale_numbers([0.0, 1.0, 2.0], 10) == [0.0, 5.0, 10.0]\", \"assert scale_numbers([1.0, 3.0, 5.0], 15) == [0.0, 7.5, 15.0]\", \"assert scale_numbers([10.0, 20.0, 30.0], 100) == [0.0, 50.0, 100.0]\", \"assert scale_numbers([4.5, 6.5, 8.5], 30) == [0.0, 15.0, 3...
{ "split": "train", "index": 891, "acecode_id": "oss_11807", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a dictionary representing the context for a message call in a simplified blockchain environment. The function takes a sender's address and optional parameters for gas, value, gas price, and data. If the sender's address is ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert make_call_context('0x1234567890123456789012345678901234567890') == {'from': '0x1234567890123456789012345678901234567890'}\", \"assert make_call_context('0x1234567890123456789012345678901234567890', gas=21000) == {'from': '0x1234567890123456789012345678901234...
{ "split": "train", "index": 892, "acecode_id": "bigcode_python_fns_23917", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a logging utility that supports different log levels. Your goal is to implement a function named `log_message` that takes the following parameters: \n- `level` (string): The log level of the message. It can be one of the following: `DEBUG`, `INFO`, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert log_message('DEBUG', 'This is a debug message', 'INFO') == False\", \"assert log_message('INFO', 'This is an info message', 'INFO') == True\", \"assert log_message('WARNING', 'This is a warning message', 'DEBUG') == True\", \"assert log_message('ERROR', 'Thi...
{ "split": "train", "index": 893, "acecode_id": "oss_22951", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `is_perfect(n: int) -> bool` that determines if a given integer `n` is a perfect number. A perfect number is a positive integer that is equal to the sum of its proper divisors, excluding itself. If `n` is less than 1, the function should return False. Other...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_perfect(6) == True\", \"assert is_perfect(28) == True\", \"assert is_perfect(496) == True\", \"assert is_perfect(8128) == True\", \"assert is_perfect(1) == False\", \"assert is_perfect(2) == False\", \"assert is_perfect(3) == False\", \"assert is_perfect(...
{ "split": "train", "index": 894, "acecode_id": "evol_30678", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing a list of dog breeds and their corresponding sub-breeds. Your goal is to implement a function, `manage_dog_breeds`, that takes a list of operations and returns the final list of sub-breeds for each breed after processing all operations. Each operati...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_dog_breeds([('register', 'Golden Retriever', 'English Cream'), ('register', 'Golden Retriever', 'American'), ('display', 'Golden Retriever')]) == {'Golden Retriever': ['English Cream', 'American']}\", \"assert manage_dog_breeds([('register', 'Labrador...
{ "split": "train", "index": 895, "acecode_id": "oss_1086", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string composed of alphanumeric characters. Your task is to count the number of distinct characters present in the string. Implement a function named count_distinct_characters that takes a single string as input and returns the count of distinct characters in th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_distinct_characters('hello') == 4\", \"assert count_distinct_characters('abcdef') == 6\", \"assert count_distinct_characters('') == 0\", \"assert count_distinct_characters('aA') == 2\", \"assert count_distinct_characters('123321') == 3\", \"assert coun...
{ "split": "train", "index": 896, "acecode_id": "evol_7318", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers where each integer is either 0 or 1, representing a binary number. Write a function `state_array_to_int(s: List[int]) -> int` that translates the binary representation of the list into its corresponding integer value. The list is interpreted fro...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert state_array_to_int([1, 0, 1]) == 5\", \"assert state_array_to_int([0, 0, 0]) == 0\", \"assert state_array_to_int([1, 1, 1]) == 7\", \"assert state_array_to_int([1, 0, 0, 1]) == 9\", \"assert state_array_to_int([0, 1, 0, 1]) == 5\", \"assert state_array_to_in...
{ "split": "train", "index": 897, "acecode_id": "bigcode_python_fns_28323", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the new value of a variable `E` after subtracting a given `ratio` from it. The variable `E` represents a quantity, and `ratio` represents the amount to be subtracted directly from `E`. The function should handle both p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculateNewValue(100, 0.2) == 99.8\", \"assert calculateNewValue(-50, 0.5) == -50.5\", \"assert calculateNewValue(0, 0) == 0\", \"assert calculateNewValue(75.5, 25.5) == 50.0\", \"assert calculateNewValue(-100, -20) == -80\", \"assert calculateNewValue(50, ...
{ "split": "train", "index": 898, "acecode_id": "oss_37109", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that validates a given address string. The function should check if the provided address is empty. If it is empty, the function should raise a `ValueError` with the message 'Address is required.'. If the address is not empty, the func...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_address('123 Main St') == '123 Main St'\", \"assert validate_address('456 Elm St') == '456 Elm St'\", \"assert validate_address('789 Maple Ave') == '789 Maple Ave'\", \"assert validate_address('101 Pine Rd') == '101 Pine Rd'\", \"assert validate_add...
{ "split": "train", "index": 899, "acecode_id": "bigcode_python_fns_18132", "num_tests": 11 }