data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "Given an integer `num`, write a function `is_armstrong_number(num)` that determines whether `num` is an Armstrong number. An Armstrong number is defined as a number that is equal to the sum of its digits each raised to the power of the total number of digits in the number. For ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_armstrong_number(0) == True\", \"assert is_armstrong_number(1) == True\", \"assert is_armstrong_number(2) == True\", \"assert is_armstrong_number(3) == True\", \"assert is_armstrong_number(4) == True\", \"assert is_armstrong_number(5) == True\", \"assert ... | {
"split": "train",
"index": 82400,
"acecode_id": "oss_35163",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that exports data from a Python dictionary to a specified file format. The function should take in the dictionary and the desired file format as input and return the exported data in the specified format. The supported file formats ar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert export_data({'name': 'Bob', 'age': 22, 'city': 'Los Angeles'}, 'json') == '{\\\"name\\\": \\\"Bob\\\", \\\"age\\\": 22, \\\"city\\\": \\\"Los Angeles\\\"}'\", \"assert export_data({'id': 1, 'status': 'active'}, 'json') == '{\\\"id\\\": 1, \\\"status\\\": \\\... | {
"split": "train",
"index": 82401,
"acecode_id": "oss_18388",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Write a function `second_largest_even(l: list) -> int` that identifies the second largest even integer from the given list of integers. The function should handle both positive and negative integers. If there is no second largest even integer, the function should return `None`.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert second_largest_even([1, 2, 4, 3]) == 2\", \"assert second_largest_even([1, 3, 5]) == None\", \"assert second_largest_even([-2, -4, -6, -8]) == -4\", \"assert second_largest_even([0, 0, 0]) == None\", \"assert second_largest_even([7, 5, 3, 1]) == None\", \"as... | {
"split": "train",
"index": 82402,
"acecode_id": "evol_12343",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes two lists of paths: `image_coords_paths` and `world_coords_paths`. Each path is represented as a string. Your goal is to create a new list `people_paths` by concatenating the corresponding paths from both lists, formatt... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_people_paths(['image_path1', 'image_path2'], ['world_path1', 'world_path2']) == ['Processed_image_path1_world_path1', 'Processed_image_path2_world_path2']\", \"assert process_people_paths(['img1'], ['world1']) == ['Processed_img1_world1']\", \"assert... | {
"split": "train",
"index": 82403,
"acecode_id": "oss_37570",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates a list of values based on their expected types and whether they are required or optional. The function should take a list of tuples, where each tuple contains a value, a boolean indicating if the value is required, and a ty... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_values([(None, True, str), ('hello', True, str), (3, False, int), (4.5, False, float)]) == [False, True, True, True]\", \"assert validate_values([(5, True, int), (None, True, int), (None, False, str)]) == [True, False, True]\", \"assert validate_val... | {
"split": "train",
"index": 82404,
"acecode_id": "bigcode_python_fns_4629",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries, where each dictionary represents an atom in a molecular structure. Each atom has attributes such as 'resname' (residue name), 'resid' (residue ID), 'atomname' (atom name), and an optional 'position' attribute. Your task is to implement a fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_atoms([{'resname': 'ALA', 'resid': 1, 'atomname': 'CA'}, {'resname': 'GLY', 'resid': 2, 'atomname': 'N', 'position': [0.0, 1.0, 2.0]}, {'resname': 'SER', 'resid': 3, 'atomname': 'C', 'position': [1.0, 2.0, 3.0]}]) == [{'resname': 'GLY', 'resid': 2, 'a... | {
"split": "train",
"index": 82405,
"acecode_id": "oss_37033",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of dates in the format 'YYYY-MM-DD' and a list of month numbers (1-12), write a function that filters the dates to only include those that fall within the specified months. The function should return a list of the filtered dates in the same format. The input list o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_dates_by_months(['2020-01-15', '2020-02-15', '2021-03-10'], [1, 2]) == ['2020-01-15', '2020-02-15']\", \"assert filter_dates_by_months(['2020-01-15', '2020-02-15', '2021-03-10'], [3]) == ['2021-03-10']\", \"assert filter_dates_by_months(['2020-01-15',... | {
"split": "train",
"index": 82406,
"acecode_id": "bigcode_python_fns_6354",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves a unique identifier for a given rack label from a predefined set of rack labels and their corresponding IDs. Write a function `get_rack_id_by_label(rack_label: str) -> Optional[int]` that takes a string `rack_label` as inpu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_rack_id_by_label('Rack-A') == 1\", \"assert get_rack_id_by_label('Rack-B') == 2\", \"assert get_rack_id_by_label('Rack-C') == 3\", \"assert get_rack_id_by_label('Rack-D') == 4\", \"assert get_rack_id_by_label('Rack-E') == 5\", \"assert get_rack_id_by_lab... | {
"split": "train",
"index": 82407,
"acecode_id": "bigcode_python_fns_4324",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that returns the smallest odd integer from the list, ignoring any occurrences of zero. If there are no odd integers in the list, the function should return None. You are not allowed to use any built-in functions to solve this problem. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert smallest_odd_number([1, 2, 4, 3]) == 1\", \"assert smallest_odd_number([0, 0, 0]) == None\", \"assert smallest_odd_number([2, 4, 6, 8]) == None\", \"assert smallest_odd_number([-1, -3, -5]) == -5\", \"assert smallest_odd_number([10, 20, 30, 40]) == None\", \... | {
"split": "train",
"index": 82408,
"acecode_id": "evol_12191",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a time in London Time (GMT) in the format 'HH:MM', write a function that will convert this time to New Zealand Standard Time (NZST). The function should take into account whether Daylight Saving Time (DST) is in effect in New Zealand. If DST is in effect, add an additiona... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_time('00:00', False) == '12:00'\", \"assert convert_time('00:00', True) == '13:00'\", \"assert convert_time('12:00', False) == '00:00'\", \"assert convert_time('12:00', True) == '01:00'\", \"assert convert_time('18:30', False) == '06:30'\", \"assert ... | {
"split": "train",
"index": 82409,
"acecode_id": "evol_14494",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the behavior of a software package. The function should accept a list of initial settings, a description, a URL, and a license. The function will return a dictionary representing the software package, which includes the pro... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_software_package(['os', 'compiler', 'build_type', 'arch'], 'Package for Test', 'None', 'None') == {'settings': ['os', 'compiler', 'build_type', 'arch'], 'description': 'Package for Test', 'url': 'None', 'license': 'None'}\", \"assert create_software_p... | {
"split": "train",
"index": 82410,
"acecode_id": "oss_22172",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the response of a simple bot. The bot should respond to a specific command by returning a customized message. Your task is to implement the response logic for the bot. \n\nThe function `bot_response(command: str) -> str` sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bot_response('!hello') == 'Hello, I am a Discord bot!'\", \"assert bot_response('!hi') == 'Unknown command!'\", \"assert bot_response('!help') == 'Unknown command!'\", \"assert bot_response('!hello world') == 'Unknown command!'\", \"assert bot_response('') =... | {
"split": "train",
"index": 82411,
"acecode_id": "oss_8287",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing the directory structure of a Python project. To help with this, you need to create a function that generates an updated list of directories by appending a specified component directory to the current directory path. Write a function called `add_comp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_component_to_path('/home/user/project', 'core') == ['/home/user/project', '/home/user/project/core']\", \"assert add_component_to_path('/usr/local/bin', 'scripts') == ['/usr/local/bin', '/usr/local/bin/scripts']\", \"assert add_component_to_path('/var/ww... | {
"split": "train",
"index": 82412,
"acecode_id": "oss_31645",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a custom EnumField class that extends the functionality of a basic field type in a data model. The EnumField should allow the user to define a set of choices for a field and ensure that the value assigned to the field is one of the defined choic... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_enum_field(['active', 'inactive', 'pending'], 'active') == 'active'\", \"assert create_enum_field(['red', 'green', 'blue'], 'green') == 'green'\", \"assert create_enum_field(['small', 'medium', 'large'], 'medium') == 'medium'\", \"assert create_enum_f... | {
"split": "train",
"index": 82413,
"acecode_id": "oss_13601",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two pairs of numbers, each represented by a tuple containing a magnitude and an exponent. Your task is to implement a function that takes four parameters: the first magnitude (m0), the first exponent (exp0), the second magnitude (m1), and the second exponent (exp1... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert adjust_magnitudes(0.0, 2, 3.0, 3) == (0.0, 3.0, 3)\", \"assert adjust_magnitudes(1.0, 2, 1.0, 2) == (1.0, 1.0, 2)\", \"assert adjust_magnitudes(0.0, 1, 0.0, 1) == (0.0, 0.0, 1)\", \"assert adjust_magnitudes(3.0, 2, 5.0, 2) == (3.0, 5.0, 2)\", \"assert adjust... | {
"split": "train",
"index": 82414,
"acecode_id": "bigcode_python_fns_24284",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function that finds all possible anagrams of a given word and checks if any of these anagrams is an anagram of its reversed form. The function should be case-sensitive, meaning 'A' and 'a' are treated as different characters. You should not use any anagram-solving l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_anagrams_and_check('abc') == []\", \"assert find_anagrams_and_check('a') == ['a']\", \"assert find_anagrams_and_check('aa') == ['aa']\", \"assert find_anagrams_and_check('ab') == []\", \"assert find_anagrams_and_check('aba') == ['aba']\", \"assert find_... | {
"split": "train",
"index": 82415,
"acecode_id": "evol_33556",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that selects a single data example from an infinitely repeating, pre-shuffled input queue. Each element of the queue consists of a training example and its corresponding label, represented as a tuple. Your function should take an iter... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert select_data(iter([(1, 'a'), (2, 'b'), (3, 'c')])) == (1, 'a')\", \"assert select_data(iter([(5, 'x'), (10, 'y')])) == (5, 'x')\", \"assert select_data(iter([])) == None\", \"assert select_data(iter([(0, None), (1, 'test'), (2, 'data')])) == (0, None)\", \"as... | {
"split": "train",
"index": 82416,
"acecode_id": "bigcode_python_fns_39322",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `validate_string(s: str) -> bool` that checks whether the provided string `s` meets the following criteria: it must start with a distinct non-alphanumeric character, followed by exactly three lowercase alphabetic characters, and must end with a numeric sequ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_string('@abc12') == True\", \"assert validate_string('#xyz345') == True\", \"assert validate_string('!pqr1234') == True\", \"assert validate_string('$def1') == False\", \"assert validate_string('%ghi56789') == False\", \"assert validate_string('^jkl... | {
"split": "train",
"index": 82417,
"acecode_id": "evol_7634",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that takes a first name and a last name as inputs and returns a full name that combines both names with a space in between. The function should ensure that there is exactly one space between the first name and the last name. If either the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert combine_names('John', 'Doe') == 'John Doe'\", \"assert combine_names('Alice', 'Smith') == 'Alice Smith'\", \"assert combine_names('Bob', '') == 'Bob'\", \"assert combine_names('', 'Johnson') == 'Johnson'\", \"assert combine_names('', '') == ''\", \"assert co... | {
"split": "train",
"index": 82418,
"acecode_id": "oss_10456",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two strings of varying lengths, write a Python function that checks if one string is a permutation of the other, considering case sensitivity. If either or both of the strings include numbers, neglect these digits and only compare the alphabetical characters in the string... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert permutation_check('abc123', 'CBA') == True\", \"assert permutation_check('abcd', 'dcba') == True\", \"assert permutation_check('aabbcc', 'abcabc') == True\", \"assert permutation_check('1234', '4321') == True\", \"assert permutation_check('abc', 'def') == Fa... | {
"split": "train",
"index": 82419,
"acecode_id": "evol_10156",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the Greatest Common Divisor (GCD) of two non-negative integers. Additionally, the function should check if these integers are within a specified range. If either integer is outside the range, the function should return an error message. The ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_gcd(9, 6, 1, 20) == 3\", \"assert calculate_gcd(12, 15, 1, 20) == 3\", \"assert calculate_gcd(18, 24, 1, 30) == 6\", \"assert calculate_gcd(17, 31, 1, 40) == 1\", \"assert calculate_gcd(25, 10, 1, 30) == 5\", \"assert calculate_gcd(50, 20, 1, 60) =... | {
"split": "train",
"index": 82420,
"acecode_id": "evol_7735",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that determines the color scheme for the analytical evolute of curves based on a given background color. The function should take in two parameters: a string representing the current background color and a dictionary that maps backgro... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_evolute_color_scheme('default', {'default': ['blue', 'green', 'red'], 'dark': ['white', 'gray', 'black']}) == ['blue', 'green', 'red']\", \"assert get_evolute_color_scheme('dark', {'default': ['blue', 'green', 'red'], 'dark': ['white', 'gray', 'black']})... | {
"split": "train",
"index": 82421,
"acecode_id": "oss_999",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of sysctl variable names and their corresponding values, and returns a dictionary where each sysctl variable name is a key and its value is the corresponding value from the input list. The input will be a list of tup... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_sysctl_variables([('net.ipv4.ip_forward', '1'), ('net.ipv4.conf.all.rp_filter', '0')]) == {'net.ipv4.ip_forward': '1', 'net.ipv4.conf.all.rp_filter': '0'}\", \"assert manage_sysctl_variables([('kernel.hostname', 'localhost'), ('kernel.hostname', 'myho... | {
"split": "train",
"index": 82422,
"acecode_id": "oss_8404",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D list of integers, where each sublist represents a set of prediction scores for different items. Your task is to implement a function `getTopKPredictions(scores: List[List[int]], k: int) -> List[List[int]]` that returns a 2D list containing the top k predictio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert getTopKPredictions([[1, 2, 3], [4, 5, 6]], 1) == [[3], [6]]\", \"assert getTopKPredictions([[1]], 2) == [[1]]\", \"assert getTopKPredictions([[7, 1, 3, 2], [9, 8]], 3) == [[7, 3, 2], [9, 8]]\", \"assert getTopKPredictions([[0, -1, -2], [-3, -4, -5]], 2) == [... | {
"split": "train",
"index": 82423,
"acecode_id": "bigcode_python_fns_28600",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `find_max_difference` that returns the maximum difference between any two elements in the list such that the larger element appears after the smaller element. If no such difference exists, return 0. For example, given the input list `[... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max_difference([7, 1, 5, 3, 6, 4]) == 5\", \"assert find_max_difference([9, 8, 7, 6, 5]) == 0\", \"assert find_max_difference([1, 2, 3, 4, 5]) == 4\", \"assert find_max_difference([5, 3, 1]) == 0\", \"assert find_max_difference([3, 5, 1, 8]) == 7\", \"a... | {
"split": "train",
"index": 82424,
"acecode_id": "bigcode_python_fns_21665",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Construct a function called `triple_square_sum` that takes a list of numeric entities as input and returns the cumulative sum of the cubes of each even, non-negative integer in the list that is not divisible by 5. If there are no valid numbers in the list, such as an empty list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert triple_square_sum([2, 4, 5, 0]) == 72\", \"assert triple_square_sum([-1, -2, 0]) == 0\", \"assert triple_square_sum([8, -3]) == 512\", \"assert triple_square_sum([0]) == 0\", \"assert triple_square_sum([]) == 0\", \"assert triple_square_sum([-6, -2, 0, 4]) =... | {
"split": "train",
"index": 82425,
"acecode_id": "evol_29542",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple debugging utility in Python. The utility should provide error messages for two specific scenarios: when the `IF NOT` function is not defined and when the `ELSE` function is not defined. Your task is to implement two functions within a c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert Debug.if_not_func(True) == False\", \"assert Debug.if_not_func(False) == True\", \"assert Debug.gen_else_func('a', ' + ', 'b') == 'a + b'\", \"assert Debug.gen_else_func('Hello', ' ', 'World') == 'Hello World'\", \"assert Debug.gen_else_func('', '', '') == '... | {
"split": "train",
"index": 82426,
"acecode_id": "oss_24063",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `isolated_element_array(array)` that takes an array as input and checks for the following conditions: 1) The array must contain exactly one element; 2) The array must not be empty; 3) The array must not contain any null (None) values; 4) The array must not ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isolated_element_array([5]) == 5\", \"assert isolated_element_array(['a']) == 'a'\", \"assert isolated_element_array([3.14]) == 3.14\", \"assert isolated_element_array([True]) == True\", \"assert isolated_element_array([-1]) == -1\", \"assert isolated_elemen... | {
"split": "train",
"index": 82427,
"acecode_id": "evol_24651",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing class labels, implement a function that converts this list into a one-hot encoded format. The function should return a 2D list where each row corresponds to a class label from the input list, and each column represents a unique class. A val... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert one_hot_encode([0, 1, 2]) == [[1, 0, 0], [0, 1, 0], [0, 0, 1]]\", \"assert one_hot_encode([1, 0, 2]) == [[0, 1, 0], [1, 0, 0], [0, 0, 1]]\", \"assert one_hot_encode([2, 2, 1, 0]) == [[0, 0, 1], [0, 0, 1], [0, 1, 0], [1, 0, 0]]\", \"assert one_hot_encode([0])... | {
"split": "train",
"index": 82428,
"acecode_id": "bigcode_python_fns_10417",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with building a function that returns a dictionary representation of exported resources along with their types. The function should accept no parameters and return a predefined dictionary that maps resource names (as strings) to their respective types (as strings... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_exported_resources() == {'CPU': 'Hardware', 'RAM': 'Hardware', 'Database': 'Software', 'WebServer': 'Software'}\", \"assert 'CPU' in get_exported_resources()\", \"assert 'RAM' in get_exported_resources()\", \"assert 'Database' in get_exported_resources()... | {
"split": "train",
"index": 82429,
"acecode_id": "bigcode_python_fns_11541",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of genomic intervals, where each interval is represented as a tuple (chromosome, start, end, strand). Your task is to implement a function that, for each interval in the first list (primary), returns the closest interval from the second list (features) b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert closest_genomic_features([('chr1', 100, 200, '+')], [], 'Downstream') == [(('chr1', 100, 200, '+'), None)]\", \"assert closest_genomic_features([('chr1', 100, 200, '-')], [], 'Upstream') == [(('chr1', 100, 200, '-'), None)]\", \"assert closest_genomic_featur... | {
"split": "train",
"index": 82430,
"acecode_id": "bigcode_python_fns_24539",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a tuple representing an RGB color value, implement a function that converts this RGB value into its corresponding hexadecimal color code. The RGB tuple consists of three integers, each ranging from 0 to 255, inclusive. If any of the RGB values are invalid (i.e., less than... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_rgb_to_hex((255, 0, 0)) == '#ff0000'\", \"assert convert_rgb_to_hex((0, 255, 0)) == '#00ff00'\", \"assert convert_rgb_to_hex((0, 0, 255)) == '#0000ff'\", \"assert convert_rgb_to_hex((255, 255, 255)) == '#ffffff'\", \"assert convert_rgb_to_hex((0, 0, ... | {
"split": "train",
"index": 82431,
"acecode_id": "bigcode_python_fns_46496",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a contact information dictionary. The function should take no parameters and return a dictionary containing the following key-value pairs: 'title', which should be the string '联系我们'; 'message', which should be the string '你... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_contact_info()['title'] == '\\u8054\\u7cfb\\u6211\\u4eec'\", \"assert generate_contact_info()['message'] == '\\u4f60\\u53ef\\u4ee5\\u901a\\u8fc7\\u4ee5\\u4e0b\\u65b9\\u5f0f\\u548c\\u6211\\u4eec\\u53d6\\u5f97\\u8054\\u7cfb'\", \"assert isinstance(gen... | {
"split": "train",
"index": 82432,
"acecode_id": "bigcode_python_fns_47476",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given an XML string that contains weather data. Your task is to parse this XML and return a dictionary containing the following keys: 'success', 'message', and 'data'. The 'success' key should be a boolean indicating whether the parsing was successful. The 'message' key... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_weather_data('<data><weather><forecast>Sunny</forecast></weather></data>') == {'success': True, 'message': None, 'data': {'forecast': 'Sunny'}}\", \"assert parse_weather_data('<data><weather><forecast>Rainy</forecast></weather></data>') == {'success': ... | {
"split": "train",
"index": 82433,
"acecode_id": "bigcode_python_fns_45689",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, implement a function `prime_sequence(arr: List[int]) -> List[int]` that constructs a sequence using the elements of the given array such that the sum of any two adjacent elements is a prime number. If such a sequence cannot be formed, return an empty... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert prime_sequence([1, 2, 3]) == [2, 1, 3] or [3, 2, 1]\", \"assert prime_sequence([4, 6, 8]) == []\", \"assert prime_sequence([2, 5, 8]) == [2, 5, 8] or [8, 5, 2]\", \"assert prime_sequence([1, 1, 1]) == [1, 1, 1]\", \"assert prime_sequence([0, 1, 2]) == [1, 0,... | {
"split": "train",
"index": 82434,
"acecode_id": "evol_33349",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a file path, implement a function `expand_path(path: str) -> str` that returns the input path unchanged if it is an absolute path (i.e., starts with a '/' character). If the path is a relative path (i.e., does not start with a '/' character), return ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert expand_path('/tmp/foo') == '/tmp/foo'\", \"assert expand_path('/home/user/docs') == '/home/user/docs'\", \"assert expand_path('/var/log') == '/var/log'\", \"assert expand_path('foo/bar') == ''\", \"assert expand_path('..') == ''\", \"assert expand_path('fold... | {
"split": "train",
"index": 82435,
"acecode_id": "bigcode_python_fns_43839",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to implement a function `sum_of_squares(numbers)` that returns the sum of the squares of all the integers in the list. The function should take a list of integers `numbers` as input and return a single integer representing the sum ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_squares([1, 2, 3]) == 14\", \"assert sum_of_squares([-1, -2, -3]) == 14\", \"assert sum_of_squares([0, 0, 0]) == 0\", \"assert sum_of_squares([]) == 0\", \"assert sum_of_squares([1]) == 1\", \"assert sum_of_squares([-1]) == 1\", \"assert sum_of_square... | {
"split": "train",
"index": 82436,
"acecode_id": "oss_27076",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to manage project teams and their progress. The function `updateProjectDays` takes in a list of `projects`. Each project is represented as a dictionary with two keys: `working` (a boolean indicating whether the project is currently be... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert updateProjectDays([{'working': True, 'days': 5}, {'working': False, 'days': 3}]) == [{'working': True, 'days': 4}, {'working': False, 'days': 3}]\", \"assert updateProjectDays([{'working': False, 'days': 2}, {'working': False, 'days': 4}]) == [{'working': Fa... | {
"split": "train",
"index": 82437,
"acecode_id": "oss_11659",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that performs a binary search on a sorted array to find the index of a given target value. If the target value is not found in the array, return -1. The function should have the following signature: `def binary_search(arr: List[int], target: int) -> int:`. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binary_search([1, 2, 3, 4, 5], 3) == 2\", \"assert binary_search([10, 20, 30, 40, 50], 30) == 2\", \"assert binary_search([1, 3, 5, 7, 9], 1) == 0\", \"assert binary_search([2, 4, 6, 8, 10], 10) == 4\", \"assert binary_search([5, 15, 25, 35, 45], 1) == -1\",... | {
"split": "train",
"index": 82438,
"acecode_id": "evol_24881",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a bi-dimensional array (a list of lists) filled with integer constituents, implement a function `decompress_list(nested_list)` that returns a one-dimensional list containing all the elements from the bi-dimensional array in the order they appear. For example, if the input... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decompress_list([[1, 2], [3, 4]]) == [1, 2, 3, 4]\", \"assert decompress_list([[5, 6], [7]]) == [5, 6, 7]\", \"assert decompress_list([[1], [2], [3], [4], [5]]) == [1, 2, 3, 4, 5]\", \"assert decompress_list([[], [1, 2, 3]]) == [1, 2, 3]\", \"assert decompre... | {
"split": "train",
"index": 82439,
"acecode_id": "evol_17267",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a user ID and a series of optional parameters to update user account information. The function should accept the following parameters: 'uid' (a string representing the user ID), 'display_name' (a string for the user's display n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_user_account('user123', display_name='John Doe', email='john@example.com') == {'uid': 'user123', 'display_name': 'John Doe', 'email': 'john@example.com'}\", \"assert update_user_account('user456', email_verified=True, phone_number='123-456-7890') == {... | {
"split": "train",
"index": 82440,
"acecode_id": "bigcode_python_fns_42152",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given an array of binary digits (0s and 1s), write a function that finds the length of the longest contiguous sequence of 1s in the array. The function should take a list of integers as input and return an integer representing the length of the longest sequence of 1s. The input... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longest_sequence_of_ones([1, 1, 0, 1, 1, 1]) == 3\", \"assert longest_sequence_of_ones([0, 0, 0, 0]) == 0\", \"assert longest_sequence_of_ones([1, 1, 1, 1, 1]) == 5\", \"assert longest_sequence_of_ones([1, 0, 1, 0, 1, 0]) == 1\", \"assert longest_sequence_of... | {
"split": "train",
"index": 82441,
"acecode_id": "evol_33770",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates a simple robot movement controller. The function should take a list of available locations and an index as input, and return the name of the location at that index if it is valid. If the index is out of bounds or if ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert move_to_location(['Home', 'Kitchen', 'Bedroom', 'Bathroom'], '0') == 'Home'\", \"assert move_to_location(['Home', 'Kitchen', 'Bedroom', 'Bathroom'], '1') == 'Kitchen'\", \"assert move_to_location(['Home', 'Kitchen', 'Bedroom', 'Bathroom'], '2') == 'Bedroom'\... | {
"split": "train",
"index": 82442,
"acecode_id": "oss_25543",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a user registration process on a web application. The function should take a user's first name as input, and perform the following actions: 1. Set the first name to the provided input. 2. Simulate a click on a registrat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert register_user('Alice') == 'Registration successful for Alice.'\", \"assert register_user('Bob') == 'Registration successful for Bob.'\", \"assert register_user('Charlie') == 'Registration successful for Charlie.'\", \"assert register_user('Diana') == 'Regist... | {
"split": "train",
"index": 82443,
"acecode_id": "oss_19972",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with validating a list of JavaScript code snippets for linting errors based on a predefined configuration. Your goal is to implement a function `validate_js_snippets(snippets)` that takes a list of JavaScript code snippets and evaluates them against a set of lint... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_js_snippets(['let y = 5;']) == ['']\", \"assert validate_js_snippets(['function test() { return 1 }']) == ['']\", \"assert validate_js_snippets(['const sum = (a, b) => { return a + b; };']) == ['']\", \"assert validate_js_snippets(['let foo = functi... | {
"split": "train",
"index": 82444,
"acecode_id": "oss_12889",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates a URL pattern for a geographic location list in a web application. The function should take a base URL string and return a complete URL pattern as a string that maps to a view called 'GeographicLocationList'. The URL pa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_geographic_location_url('/api') == '/api/geographic-locations/'\", \"assert generate_geographic_location_url('/locations') == '/locations/geographic-locations/'\", \"assert generate_geographic_location_url('/v1') == '/v1/geographic-locations/'\", \"... | {
"split": "train",
"index": 82445,
"acecode_id": "oss_3144",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `highest_palindrome(data)` that checks for the highest palindrome within a given input, which can either be a range of integers or a list of strings. The function should return the highest palindrome found. If no palindrome is found, the function should ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert highest_palindrome(range(10, 20)) == 11\", \"assert highest_palindrome(range(1, 100)) == 99\", \"assert highest_palindrome(range(100, 200)) == 191\", \"assert highest_palindrome(range(0, 10)) == 9\", \"assert highest_palindrome(range(20, 30)) == 22\", \"asse... | {
"split": "train",
"index": 82446,
"acecode_id": "evol_26609",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function `validate_extract_data(data: str) -> Tuple[str, str, str]` that extracts and validates a person's full name, date of birth, and residential address from a provided text string. The input string is formatted as 'Name; Date of Birth; Address'. The name mus... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_extract_data('John Smith; 10/03/1994; 9 Hall Street, Anytown') == ('John Smith', '10/03/1994', '9 Hall Street, Anytown')\", \"assert validate_extract_data('Alice Johnson; 25/12/2000; 123 Main St, Springfield') == ('Alice Johnson', '25/12/2000', '123... | {
"split": "train",
"index": 82447,
"acecode_id": "evol_33204",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a room booking system for a hotel. The system should allow customers to book rooms and store their information. You need to implement a function `update_booking_data` that takes in the following parameters: 'customer' and 'booking'. The 'custome... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_booking_data({'country': 'USA', 'email': 'john@example.com', 'first_name': 'John', 'last_name': 'Doe'}, {'booked_rooms': [{'room_type_id': 1}, {'room_type_id': 2}]} ) == ({'Booking': {'Customers': [{'CustomerCountry': 'USA', 'CustomerEmail': 'john@exa... | {
"split": "train",
"index": 82448,
"acecode_id": "oss_35911",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to insert phenotype data into a list representing a database. The function should take a list called `database` and a dictionary called `phenotype_data` as parameters. Your task is to implement the function `insert_phenotype` that wil... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert insert_phenotype([], {'name': 'Tall', 'color': 'Green'}) == 0\", \"assert insert_phenotype([{'name': 'Short', 'color': 'Yellow'}], {'name': 'Tall', 'color': 'Green'}) == 1\", \"assert insert_phenotype([{'name': 'Tall', 'color': 'Green'}], {'name': 'Medium', ... | {
"split": "train",
"index": 82449,
"acecode_id": "oss_37272",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Develop a function that extracts values between various types of brackets (round, square, curly, and angle) from a given string. The function should handle nested brackets and return a dictionary where the keys represent the types of brackets ('round', 'square', 'curly', 'angle... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_brackets('Hello (world)') == {'round': ['world'], 'square': [], 'curly': [], 'angle': []}\", \"assert extract_brackets('[Sample <text> with {multiple} brackets]') == {'round': [], 'square': ['Sample <text> with {multiple} brackets'], 'curly': ['multi... | {
"split": "train",
"index": 82450,
"acecode_id": "evol_26214",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a string that represents a YAML formatted data, implement a function that converts this string into its corresponding JSON formatted string. You need to write a function named `yaml_to_json_string` that takes a single argument, `yaml_string`, which is a valid YAML formatt... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert yaml_to_json_string('key: value\\\\nlist:\\\\n - item1\\\\n - item2') == '{\\\"key\\\": \\\"value\\\", \\\"list\\\": [\\\"item1\\\", \\\"item2\\\"]}'\", \"assert yaml_to_json_string('person:\\\\n name: John\\\\n age: 30') == '{\\\"person\\\": {\\\"name\\... | {
"split": "train",
"index": 82451,
"acecode_id": "bigcode_python_fns_26092",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, rearrange the elements into an alternate order of even and odd numbers. If there are more even numbers than odd numbers, the output should start with an even number. If there are more odd numbers, it should start with an odd number. If both counts ar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rearrange_array([2, 4, 6, 8, 1, 3]) == [2, 1, 4, 3, 6, 8]\", \"assert rearrange_array([1, 3, 5, 7]) == [1, 3, 5, 7]\", \"assert rearrange_array([2, 4, 6, 8]) == [2, 4, 6, 8]\", \"assert rearrange_array([1, 2, 3, 4, 5, 6]) == [2, 1, 4, 3, 6, 5]\", \"assert re... | {
"split": "train",
"index": 82452,
"acecode_id": "evol_15422",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a directory structure using a custom data structure. The directory structure should support the following operations: creating directories, changing directories, and listing the contents of a directory. Specifically, you need to implement a func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert list_directory_contents(['create docs', 'create images', 'change docs', 'create tutorials', 'list'], '/') == ['tutorials']\", \"assert list_directory_contents(['create folder1', 'create folder2', 'list'], '/') == ['folder1', 'folder2']\", \"assert list_direc... | {
"split": "train",
"index": 82453,
"acecode_id": "oss_1628",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the retrieval of changed files between two revisions in a version control system. The function should take a string input representing a revision identifier and return a list of file names that have been modified between th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_changed_files('rev1') == ['fileA.txt', 'fileB.txt']\", \"assert get_changed_files('rev2') == ['fileC.txt']\", \"assert get_changed_files('rev3') == ['fileA.txt', 'fileD.txt', 'fileE.txt']\", \"assert get_changed_files('rev4') == []\", \"assert get_change... | {
"split": "train",
"index": 82454,
"acecode_id": "oss_23830",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of URL patterns and returns a dictionary containing the count of views associated with each unique URL pattern. Each URL pattern is represented as a string. Write a function `count_views_per_url` that takes a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_views_per_url(['admin/', 'home/', 'profile/', 'dashboard/', 'dashboard/', 'settings/']) == {'admin/': 1, 'home/': 1, 'profile/': 1, 'dashboard/': 2, 'settings/': 1}\", \"assert count_views_per_url(['about/', 'about/', 'contact/', 'home/', 'contact/']) ... | {
"split": "train",
"index": 82455,
"acecode_id": "oss_35450",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with analyzing a photo of a landscape represented as a 2D grid of pixels. Each pixel is defined by a tuple of three integers (r, g, b) representing the red, green, and blue color values. Your goal is to determine the number of distinct objects visible in the land... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_distinct_objects([[(255, 255, 255), (255, 255, 255)], [(255, 255, 255), (255, 0, 0)]]) == 2\", \"assert count_distinct_objects([[(0, 0, 0), (0, 0, 0)], [(0, 0, 0), (0, 0, 0)]]) == 1\", \"assert count_distinct_objects([[(255, 0, 0), (255, 0, 0)], [(0, 2... | {
"split": "train",
"index": 82456,
"acecode_id": "oss_4663",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates reading data from a network socket. The function should take an integer `n` as input, which represents the number of bytes to read from the socket. The function should return the data read as bytes. If the end of the st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert read_from_socket(5) == b'Hello'\", \"assert read_from_socket(10) == b'HelloWorld'\", \"assert read_from_socket(0) == b''\", \"assert read_from_socket(5) == b'Hello'\", \"assert read_from_socket(3) == b'Hel'\", \"assert read_from_socket(1) == b'H'\", \"assert... | {
"split": "train",
"index": 82457,
"acecode_id": "oss_371",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, determine if any integer appears more than once in the list. Your task is to implement the function `has_duplicates(nums: List[int]) -> bool` that takes a list of integers as input and returns True if any value appears at least twice in the list, and F... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_duplicates([1, 2, 3, 4, 5]) == False\", \"assert has_duplicates([1, 2, 3, 4, 5, 1]) == True\", \"assert has_duplicates([-1, -2, -3, -1]) == True\", \"assert has_duplicates([0, 0, 1, 2]) == True\", \"assert has_duplicates([3, 4, 5]) == False\", \"assert h... | {
"split": "train",
"index": 82458,
"acecode_id": "bigcode_python_fns_11348",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with filtering a list of product SKUs (Stock Keeping Units) based on a specific keyword. Write a function `filter_skus_by_keyword(skus, keyword)` that takes two parameters: a list of SKU names (`skus`) and a string (`keyword`). The function should return a list o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_skus_by_keyword(['Laptop SKU', 'Mouse SKU', 'Keyboard SKU'], 'sku') == ['Laptop SKU', 'Mouse SKU', 'Keyboard SKU']\", \"assert filter_skus_by_keyword(['Laptop SKU', 'Mouse', 'Keyboard'], 'mouse') == ['Mouse']\", \"assert filter_skus_by_keyword(['Print... | {
"split": "train",
"index": 82459,
"acecode_id": "oss_2476",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `build_project` that simulates the production build process of a Vite project given certain parameters. The function takes the following inputs: a list of source files represented as strings, a string representing the output directory, an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert build_project(['file1.js', 'file2.js'], 'dist', {}) == 'Build completed. Output located at dist'\", \"assert build_project(['index.html'], 'build', {'minify': True}) == 'Build completed. Output located at build'\", \"assert build_project([], 'output', {'sour... | {
"split": "train",
"index": 82460,
"acecode_id": "bigcode_python_fns_22928",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers `nums` and an integer `target`, implement a function `findQuadruplets(nums: List[int], target: int) -> List[List[int]]` that finds all unique quadruplets in the array which sum up to the given `target`. A quadruplet is defined as a set of four integer... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert findQuadruplets([2, 2, 2, 2, 2], 8) == [[2, 2, 2, 2]]\", \"assert findQuadruplets([], 0) == []\", \"assert findQuadruplets([1, 2, 3, 4, 5], 10) == [[1, 2, 3, 4]]\", \"assert findQuadruplets([0, 0, 0, 0], 0) == [[0, 0, 0, 0]]\", \"assert findQuadruplets([1, 1... | {
"split": "train",
"index": 82461,
"acecode_id": "oss_2353",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Design a binary expression tree for a given arithmetic equation represented as a nested list. Write a recursive function to calculate and return the final result of the expression represented by the binary tree. The function should be able to handle and properly prioritize the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_tree(['+', 2, 3]) == 5\", \"assert calculate_tree(['-', 10, 2]) == 8\", \"assert calculate_tree(['*', 3, 4]) == 12\", \"assert calculate_tree(['/', 8, 2]) == 4\", \"assert calculate_tree(['+', ['*', 2, 3], 4]) == 10\", \"assert calculate_tree(['-',... | {
"split": "train",
"index": 82462,
"acecode_id": "evol_28621",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes user location data and returns the user's latitude. The function should accept a list of user information in the form of dictionaries, each containing a 'lat' key that stores the latitude value. Your function should return ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_user_latitudes([{'lat': 34.0522}, {'lat': None}, {'lat': 40.7128}]) == [34.0522, 40.7128]\", \"assert get_user_latitudes([{'lat': None}, {'lat': None}, {'lat': None}]) == []\", \"assert get_user_latitudes([{'lat': -23.5505}, {'lat': None}, {'lat': 51.507... | {
"split": "train",
"index": 82463,
"acecode_id": "oss_36888",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a program that uses a recursive function to calculate the n-th number in the Fibonacci sequence, where n is a positive integer. The Fibonacci sequence is defined as follows: F(1) = 0, F(2) = 1, and F(n) = F(n-1) + F(n-2) for n > 2. Your function should return the n-th Fib... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(1) == 0\", \"assert fibonacci(2) == 1\", \"assert fibonacci(3) == 1\", \"assert fibonacci(4) == 2\", \"assert fibonacci(5) == 3\", \"assert fibonacci(6) == 5\", \"assert fibonacci(7) == 8\", \"assert fibonacci(8) == 13\", \"assert fibonacci(9) == 2... | {
"split": "train",
"index": 82464,
"acecode_id": "evol_3806",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that takes a list of integers and returns a new list containing only the even integers from the input list, preserving their original order. If there are no even integers in the list, the function should return an empty list. Imple... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([2, 4, 6, 8]) == [2, 4, 6, 8]\", \"assert filter_even_numbers([1, 3, 5]) == []\", \"assert filter_even_numbers([-1, -2, -3, -4]) == [-2, -4]\", \"assert filter_even_numbers([0, 1,... | {
"split": "train",
"index": 82465,
"acecode_id": "oss_11628",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that accepts two lists of integers and an integer 'n'. The function should return the sum of all integers in both lists if the sum is a multiple of 'n'. If the sum is not a multiple of 'n', return the remainder when the sum is divided by 'n'. Both lists wil... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_and_divide([10, 20], [30, 40], 5) == 100\", \"assert sum_and_divide([1, 1, 1], [1, 1, 1], 3) == 6\", \"assert sum_and_divide([-1, -2, -3], [-4, -5, -6], 3) == -21\", \"assert sum_and_divide([0, 0, 0], [0, 0, 0], 1) == 0\", \"assert sum_and_divide([1, -1]... | {
"split": "train",
"index": 82466,
"acecode_id": "evol_26041",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of compounds represented as strings and a corresponding list of integers representing the number of each compound to be placed in a region defined by a 3D box. Your task is to create a function that returns a list of strings representing the filled region w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fill_region(['H2O', 'NaCl', 'C6H12O6'], [3, 2, 1]) == ['H2O', 'H2O', 'H2O', 'NaCl', 'NaCl', 'C6H12O6']\", \"assert fill_region(['H2O', 'NaCl'], [0, 2]) == ['NaCl', 'NaCl']\", \"assert fill_region(['H2O', 'NaCl'], [-1, 2]) == ['NaCl', 'NaCl']\", \"assert fill... | {
"split": "train",
"index": 82467,
"acecode_id": "bigcode_python_fns_15107",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function named `replace_identifiers` that takes a string `text` as input and replaces all occurrences of email addresses, URLs, and IP addresses (both IPv4 and IPv6) with the respective literals 'EMAIL', 'URL', and 'IP_ADDRESS'. The function should not use any ex... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_identifiers('Contact us at support@example.com.') == 'Contact us at EMAIL.'\", \"assert replace_identifiers('Visit https://www.example.com for more info.') == 'Visit URL for more info.'\", \"assert replace_identifiers('Reach me at john.doe@example.co... | {
"split": "train",
"index": 82468,
"acecode_id": "evol_28329",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to compute a simple histogram of pixel intensities for a grayscale image represented as a 2D list (matrix), where each element is an integer between 0 and 255. Your goal is to create a Python function that takes this input image and r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_histogram([[127, 127], [128, 128]]) == [0]*127 + [2] + [2] + [0]*127\", \"assert compute_histogram([[0, 1, 2], [2, 3, 3]]) == [1, 1, 2, 2] + [0]*252\", \"assert compute_histogram([[1, 1, 1], [1, 1, 1]]) == [0]*1 + [6] + [0]*254\", \"assert compute_hi... | {
"split": "train",
"index": 82469,
"acecode_id": "oss_32600",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the behavior of a heartbeat timer in a network interface. The function will receive two parameters: a timeout value in seconds and a flag indicating whether to start the heartbeat timer. If the flag is true, the functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert heartbeat_timer(10, True) == 'Heartbeat timer started.'\", \"assert heartbeat_timer(10, False) == 'Heartbeat timer stopped.'\", \"assert heartbeat_timer(0, True) == 'Error: Timeout value must be greater than zero.'\", \"assert heartbeat_timer(-1, True) == 'E... | {
"split": "train",
"index": 82470,
"acecode_id": "bigcode_python_fns_12130",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Write a function `merge_sort` that sorts the list in non-decreasing order using the merge sort algorithm. The function should take a single parameter, `items`, which is the list of integers to be sorted. The function should not return anything;... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_sort([3, 2, 1]) == None and [1, 2, 3] == [1, 2, 3]\", \"assert merge_sort([5, 4, 3, 2, 1]) == None and [1, 2, 3, 4, 5] == [1, 2, 3, 4, 5]\", \"assert merge_sort([1, 2, 3]) == None and [1, 2, 3] == [1, 2, 3]\", \"assert merge_sort([]) == None and [] == ... | {
"split": "train",
"index": 82471,
"acecode_id": "bigcode_python_fns_14375",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with building a simple lexer for a programming language that can tokenize input code into distinct tokens. Your lexer should be able to tokenize identifiers, numbers, and basic arithmetic operators (+, -, *, /). It must also be able to skip any character not defi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simple_lexer('x + 3') == [('IDENTIFIER', 'x'), ('PLUS', '+'), ('NUMBER', 3)]\", \"assert simple_lexer(' a * 5 ') == [('IDENTIFIER', 'a'), ('TIMES', '*'), ('NUMBER', 5)]\", \"assert simple_lexer('1 + 2 - 3') == [('NUMBER', 1), ('PLUS', '+'), ('NUMBER', 2)... | {
"split": "train",
"index": 82472,
"acecode_id": "oss_16658",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that takes a list of tuples as input, where each tuple represents a pair of strings. Your function should return a dictionary where the first element of each tuple is the key and the second element is the value. In the case of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert tuple_list_to_dict([('todos', '0001_initial'), ('todos', '0002_update'), ('users', '0001_initial')]) == {'todos': '0001_initial,0002_update', 'users': '0001_initial'}\", \"assert tuple_list_to_dict([('a', '1'), ('b', '2'), ('a', '3')]) == {'a': '1,3', 'b': '... | {
"split": "train",
"index": 82473,
"acecode_id": "oss_23699",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing hard labels, where each integer is in the range of 0 to k-1, inclusive. Your task is to convert this list of hard labels into a 2D array of soft labels. The soft labels should have the same number of rows as the number of hard label... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_soft_labels([0, 1, 2], 3) == [[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]]\", \"assert convert_to_soft_labels([1, 1, 1], 3) == [[0.0, 1.0, 0.0], [0.0, 1.0, 0.0], [0.0, 1.0, 0.0]]\", \"assert convert_to_soft_labels([2, 0, 1], 3) == [[0.0, 0.0... | {
"split": "train",
"index": 82474,
"acecode_id": "bigcode_python_fns_13377",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of tuples, where each tuple contains a key-value pair, implement a function that converts this list into a dictionary. The first element of each tuple should be used as the key, and the remaining elements should be stored as a list in the corresponding value of the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_list_to_dict([(1, 2), (3, 4)]) == {1: [2], 3: [4]}\", \"assert convert_list_to_dict([(1, 'a'), (2, 'b'), (3, 'c')]) == {1: ['a'], 2: ['b'], 3: ['c']}\", \"assert convert_list_to_dict([('key1', 'value1'), ('key2', 'value2')]) == {'key1': ['value1'], '... | {
"split": "train",
"index": 82475,
"acecode_id": "evol_22723",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that determines the URL pattern for a health check endpoint based on whether a data sniffer service is enabled. Your function should take a boolean input `data_sniffer_enabled`. If the data sniffer service is enabled (`True`), the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert health_check_url_pattern(True) == '/health-check/'\", \"assert health_check_url_pattern(False) == ''\", \"assert health_check_url_pattern(True) == '/health-check/'\", \"assert health_check_url_pattern(False) == ''\", \"assert health_check_url_pattern(True) =... | {
"split": "train",
"index": 82476,
"acecode_id": "oss_22059",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function that constructs a connection URL using the given parameters. The function should handle both HTTP and HTTPS connections and format the URL with the provided path component. The URL should follow the format `http://<host>/<path>` for HTTP connect... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert construct_url(True, 'api/data') == 'https://<host>/api/data'\", \"assert construct_url(False, 'user/profile') == 'http://<host>/user/profile'\", \"assert construct_url(True, 'search?query=test') == 'https://<host>/search%3Fquery%3Dtest'\", \"assert construct... | {
"split": "train",
"index": 82477,
"acecode_id": "oss_3120",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Construct a Python function that identifies the longest recurring substring within a given textual string. If there are multiple substrings of the same maximum length, return all of them in the order they first appear in the string. The function should handle strings with vario... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_longest_recurring_substrings('hellohello') == [('hello', 0, 4)]\", \"assert find_longest_recurring_substrings('') == []\", \"assert find_longest_recurring_substrings('a') == []\", \"assert find_longest_recurring_substrings('abcd') == []\", \"assert find... | {
"split": "train",
"index": 82478,
"acecode_id": "evol_9885",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a list of hashtags, determine if each hashtag is valid based on the following criteria: a valid hashtag must start with '#' and must not contain any spaces. Write a function `are_hashtags_valid(hashtags: List[str]) -> List[bool]` that takes a list of hashtags and returns ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert are_hashtags_valid(['#python', '#coding', '#validTag']) == [True, True, True]\", \"assert are_hashtags_valid(['#hello world', '#valid', '#test']) == [False, True, True]\", \"assert are_hashtags_valid(['#123', '#valid_tag', '#anotherValid']) == [True, True, T... | {
"split": "train",
"index": 82479,
"acecode_id": "bigcode_python_fns_37734",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an octal number represented as a string, write a function that converts it to its decimal representation and returns the result as a string. For example, the octal number '10' should return '8' in decimal. Implement the function as follows:\n\n```python\ndef octal_to_deci... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert octal_to_decimal('0') == '0'\", \"assert octal_to_decimal('1') == '1'\", \"assert octal_to_decimal('2') == '2'\", \"assert octal_to_decimal('7') == '7'\", \"assert octal_to_decimal('10') == '8'\", \"assert octal_to_decimal('11') == '9'\", \"assert octal_to_d... | {
"split": "train",
"index": 82480,
"acecode_id": "evol_30370",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of integers as input and returns a new list containing the unique integers sorted in ascending order. The function should ensure that any duplicate integers in the input list are removed in the process. Your solution should be optimized fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_sort([8, 2, 8, 3, 10, 16, 2, 10]) == [2, 3, 8, 10, 16]\", \"assert unique_sort([5, 5, 5, 5]) == [5]\", \"assert unique_sort([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert unique_sort([]) == []\", \"assert unique_sort([9, 7, 5, 3, 1]) == [1, 3, 5, 7, ... | {
"split": "train",
"index": 82481,
"acecode_id": "evol_15224",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `get_teacher_details` that takes four parameters: `name` (string), `qualification` (string), `subject` (string), and `years_of_experience` (integer). The function should return a dictionary containing the teacher's details with keys 'name', 'qualific... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_teacher_details('Alice Smith', 'MSc in Physics', 'Physics', 5) == {'name': 'Alice Smith', 'qualification': 'MSc in Physics', 'subject': 'Physics', 'years_of_experience': 5}\", \"assert get_teacher_details('Bob Johnson', 'BEd in English', 'English', 3) ==... | {
"split": "train",
"index": 82482,
"acecode_id": "evol_11129",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a binary search tree (BST) in Python. Your goal is to create a function that performs the following operations on the BST: Insert a new node with a given key, delete a specified node, and return a list of keys in the BST in in-order traversal or... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bst_operations([('insert', 5), ('insert', 3), ('insert', 7), ('traverse', None)]) == [3, 5, 7]\", \"assert bst_operations([('insert', 10), ('insert', 5), ('insert', 15), ('delete', 5), ('traverse', None)]) == [10, 15]\", \"assert bst_operations([('insert', 1... | {
"split": "train",
"index": 82483,
"acecode_id": "oss_7476",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the ages of a group of people. Write a function that determines if there is at least one person in the group who is older than a specified age. The function should take two parameters: a list of integers `ages` and an integer `age_l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_older_than_limit([25, 30, 18, 22], 24) == True\", \"assert is_older_than_limit([15, 16, 17, 18], 18) == False\", \"assert is_older_than_limit([40, 35, 30, 25], 39) == True\", \"assert is_older_than_limit([5, 10, 15, 20], 20) == False\", \"assert is_older_... | {
"split": "train",
"index": 82484,
"acecode_id": "bigcode_python_fns_14935",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that retrieves the substring that comes after a specified special character in a given string. If the special character is not found, the function should return an appropriate error message. The function signature is: def retrieve_string_after_special(strin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert retrieve_string_after_special('Hello,World!', ',') == 'World!'\", \"assert retrieve_string_after_special('Python#Programming', '#') == 'Programming'\", \"assert retrieve_string_after_special('Data-Science', '-') == 'Science'\", \"assert retrieve_string_after... | {
"split": "train",
"index": 82485,
"acecode_id": "evol_25568",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple speech translation recognizer. The function should take a dictionary that maps language codes to their respective translations of a given speech input, as well as a language code representing the desired output lan... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert translate_speech({'en': 'Hello', 'fr': 'Bonjour'}, 'en') == 'Hello'\", \"assert translate_speech({'en': 'Hello', 'fr': 'Bonjour'}, 'fr') == 'Bonjour'\", \"assert translate_speech({'en': 'Hello', 'fr': 'Bonjour'}, 'es') == 'Translation not available.'\", \"as... | {
"split": "train",
"index": 82486,
"acecode_id": "oss_1484",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function called 'vital_summation_calculation' that takes a string as input and calculates the total sum of all digits present in the string. The function should ignore any non-numeric characters, including punctuation and special characters. The output should be a s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert vital_summation_calculation('ab1cde2') == 3\", \"assert vital_summation_calculation('ACED^Y5') == 5\", \"assert vital_summation_calculation('\\u00e9xampl\\u00eb7') == 7\", \"assert vital_summation_calculation('123^abc') == 6\", \"assert vital_summation_calcu... | {
"split": "train",
"index": 82487,
"acecode_id": "evol_22239",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `server_response(tr)` that simulates the behavior of a server's response based on an input string `tr`. The function should perform the following actions: 1. If the value of `tr` can be converted to an integer, the function should ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert server_response('5') is None\", \"assert server_response('10') is None\", \"assert server_response('1') is None\", \"assert server_response('-2') is None\", \"assert server_response('0') is None\", \"assert server_response('100') is None\", \"assert server_r... | {
"split": "train",
"index": 82488,
"acecode_id": "oss_37103",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with analyzing the status of a database stage called 'MemtableFlushWriter'. This stage can be in a blocked or unblocked state based on the number of active flush writers. Implement a function `analyze_memtable_flush_writer(blocked: int) -> Tuple[str, str]` that t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_memtable_flush_writer(1) == ('memtable flush writers blocked greater than zero', 'lower memtable_cleanup_threshold in cassandra.yaml')\", \"assert analyze_memtable_flush_writer(2) == ('memtable flush writers blocked greater than zero', 'lower memtabl... | {
"split": "train",
"index": 82489,
"acecode_id": "bigcode_python_fns_20172",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that accepts a list of vegetable names as strings and returns a modified list containing each vegetable name reversed. The input list will only contain lowercase strings.\nPlease reason step by step, then write a self-contained Python solution. Give your final ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert vegetables_reversed(['potato', 'tomato', 'cucumber']) == ['otatop', 'otamot', 'rebmucuc']\", \"assert vegetables_reversed(['asparagus', 'artichoke', 'turnip']) == ['sugarapsa', 'ekohcitra', 'pinrut']\", \"assert vegetables_reversed(['radish', 'cabbage', 'kal... | {
"split": "train",
"index": 82490,
"acecode_id": "evol_3667",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that updates the status of a list of items. Each item is represented as a dictionary with two keys: 'id' (an integer representing the unique identifier of the item) and 'status' (a string representing the current status of the item). Your... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_item_status([{'id': 1, 'status': 'active'}, {'id': 2, 'status': 'inactive'}], 'pending') == [{'id': 1, 'status': 'pending'}, {'id': 2, 'status': 'pending'}]\", \"assert update_item_status([{'id': 3, 'status': 'available'}, {'id': 4, 'status': 'sold'}]... | {
"split": "train",
"index": 82491,
"acecode_id": "bigcode_python_fns_1840",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `concatenate_strings(string_1: str, string_2: str) -> str` that takes two strings as input and returns their concatenation. For example, if `string_1` is 'hello' and `string_2` is 'world', the function should return 'helloworld'.\nPlease reason step by step... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert concatenate_strings('hello', 'world') == 'helloworld'\", \"assert concatenate_strings('Python', 'Rocks') == 'PythonRocks'\", \"assert concatenate_strings('', 'empty') == 'empty'\", \"assert concatenate_strings('concatenate', '') == 'concatenate'\", \"assert ... | {
"split": "train",
"index": 82492,
"acecode_id": "evol_28980",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of news articles and generates a formatted summary string of the articles. The function should take in a list of news article dictionaries, each with attributes `FileName`, `Title`, and `Content`. The summary ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_summary([{'FileName': 'article1.txt', 'Title': 'Breaking News', 'Content': 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.'}]) == '-----------\\\\nFile: article1.txt\\\\nBreaking News\\\\nLorem ipsum dolor sit amet, consectetur adipiscing ... | {
"split": "train",
"index": 82493,
"acecode_id": "oss_28393",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a string as input and determines if the string is a palindrome, ignoring spaces, punctuation, and case sensitivity. The function should return True if the cleaned string is a palindrome and False otherwise.\nPlease reason step by step, then write... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_palindrome('Able, was I saw Elba.') == True\", \"assert is_palindrome('A man, a plan, a canal, Panama!') == True\", \"assert is_palindrome('No lemon, no melon.') == True\", \"assert is_palindrome('Was it a car or a cat I saw?') == True\", \"assert is_pali... | {
"split": "train",
"index": 82494,
"acecode_id": "evol_7105",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that computes the factorial of a non-negative integer. If the input is a list, the function should calculate the factorial for each non-negative integer in the list, skipping any non-integer elements. Return the results as a dictionary where keys are the in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert factorial_and_list_factorial(5) == {5: 120}\", \"assert factorial_and_list_factorial(0) == {0: 1}\", \"assert factorial_and_list_factorial(1) == {1: 1}\", \"assert factorial_and_list_factorial([3]) == {3: 6}\", \"assert factorial_and_list_factorial([4, 2]) =... | {
"split": "train",
"index": 82495,
"acecode_id": "evol_15737",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two strings, determine if they are anagrams of each other. An anagram is a rearrangement of the letters of one word to form another word. Write a function called `are_anagrams(word1, word2)` that returns True if the two input strings are anagrams, and False otherwise.\nPl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert are_anagrams('earth', 'heart') == True\", \"assert are_anagrams('listen', 'silent') == True\", \"assert are_anagrams('triangle', 'integral') == True\", \"assert are_anagrams('apple', 'pale') == False\", \"assert are_anagrams('dog', 'god') == True\", \"assert... | {
"split": "train",
"index": 82496,
"acecode_id": "evol_19813",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with designing a function that retrieves details of a game based on its unique identifier from a predefined list of games. Each game is represented as a dictionary containing its title, genre, release date, and other relevant information. Your function should tak... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_game_details(0) == {'title': 'Halo Infinite', 'genre': 'FPS', 'release_date': '2021-12-08'}\", \"assert get_game_details(1) == {'title': 'The Legend of Zelda: Breath of the Wild', 'genre': 'Action-Adventure', 'release_date': '2017-03-03'}\", \"assert get... | {
"split": "train",
"index": 82497,
"acecode_id": "oss_13983",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the creation of a simple environment for a continuous control task. The function should take two parameters: `action_dim` (an integer representing the number of actions) and `observation_dim` (an integer representing the nu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert make_environment(1, 2) == 'ContinuousEnvironment(action_dim=1, observation_dim=2, episode_length=10)'\", \"assert make_environment(2, 3) == 'ContinuousEnvironment(action_dim=2, observation_dim=3, episode_length=10)'\", \"assert make_environment(3, 4) == 'Con... | {
"split": "train",
"index": 82498,
"acecode_id": "bigcode_python_fns_39746",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the total cost of sending envelopes based on given parameters. The function should take in a dictionary containing the 'base_cost' of sending a single envelope, 'number_of_envelopes', and a 'discount_rate' (in percenta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_cost({'base_cost': 10.0, 'number_of_envelopes': 5, 'discount_rate': 20.0}) == 50.0\", \"assert calculate_total_cost({'base_cost': 10.0, 'number_of_envelopes': 10, 'discount_rate': 20.0}) == 100.0\", \"assert calculate_total_cost({'base_cost':... | {
"split": "train",
"index": 82499,
"acecode_id": "bigcode_python_fns_40392",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.