data_source
large_stringclasses
1 value
prompt
listlengths
1
1
ability
large_stringclasses
1 value
reward_model
dict
extra_info
dict
acecode
[ { "role": "user", "content": "You are tasked with normalizing the raw accelerometer data from an Arduino device. The accelerometer provides raw readings for the x, y, and z axes as a string formatted as 'x_raw,y_raw,z_raw'. You are also given calibration data consisting of two lists: 'offset' and 'gain', wh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert normalize_accelerometer_data('1.0,2.0,3.0', [0.0, 0.0, 0.0], [1.0, 1.0, 1.0]) == (1.0, 2.0, 3.0)\", \"assert normalize_accelerometer_data('10.0,20.0,30.0', [5.0, 5.0, 5.0], [5.0, 5.0, 5.0]) == (1.0, 3.0, 5.0)\", \"assert normalize_accelerometer_data('0.0,0.0...
{ "split": "train", "index": 200, "acecode_id": "bigcode_python_fns_42058", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer n, write a function `calculate_fibonacci(n)` that returns the nth Fibonacci number using a recursive approach. The Fibonacci sequence is defined as follows: F(0) = 0, F(1) = 1, and F(n) = F(n-1) + F(n-2) for n > 1. Your function should handle input values of n ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_fibonacci(0) == 0\", \"assert calculate_fibonacci(1) == 1\", \"assert calculate_fibonacci(2) == 1\", \"assert calculate_fibonacci(3) == 2\", \"assert calculate_fibonacci(4) == 3\", \"assert calculate_fibonacci(5) == 5\", \"assert calculate_fibonacc...
{ "split": "train", "index": 201, "acecode_id": "oss_1881", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes an integer as input and returns a string representation of that integer. If the integer is even, the string should be prefixed with 'Even: ', and if the integer is odd, it should be prefixed with 'Odd: '. Your function should i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert integer_to_string(2) == 'Even: 2'\", \"assert integer_to_string(3) == 'Odd: 3'\", \"assert integer_to_string(0) == 'Even: 0'\", \"assert integer_to_string(-4) == 'Even: -4'\", \"assert integer_to_string(-3) == 'Odd: -3'\", \"assert integer_to_string(10) == '...
{ "split": "train", "index": 202, "acecode_id": "bigcode_python_fns_18805", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a variable `name` which is a string. Your task is to create a function that checks if the value of `name` is equal to 'boss'. If it is, the function should return the string 'Welcome boss'. If it is not, the function should return the value of `name`. Implement th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert greet_user('Alice') == 'Alice'\", \"assert greet_user('boss') == 'Welcome boss'\", \"assert greet_user('Charlie') == 'Charlie'\", \"assert greet_user('boss') == 'Welcome boss'\", \"assert greet_user('Eve') == 'Eve'\", \"assert greet_user('boss') == 'Welcome ...
{ "split": "train", "index": 203, "acecode_id": "oss_2187", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a variable `elem_ref` which can potentially be a reference to an element. Your task is to determine if `elem_ref` is a valid element reference based on the following criteria: 1. `elem_ref` must be a non-null value. 2. `elem_ref` must be a tuple of length 3. 3. Th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_elem_ref((ElemRefObj, 'some_value', 123)) == True\", \"assert is_elem_ref((ElemRefArr, 'another_value', 456)) == True\", \"assert is_elem_ref((ElemRefObj, None, 789)) == True\", \"assert is_elem_ref((ElemRefArr, 'test', 'value')) == True\", \"assert is_el...
{ "split": "train", "index": 204, "acecode_id": "bigcode_python_fns_27770", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function called `get_person_info` that takes two parameters: a string `name` and an integer `age`. The function should return a string in the format 'Name: {name}, Age: {age}'.\nPlease reason step by step, then write a self-contained Python solution. Give your final pro...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_person_info('Alice', 30) == 'Name: Alice, Age: 30'\", \"assert get_person_info('Bob', 25) == 'Name: Bob, Age: 25'\", \"assert get_person_info('Charlie', 40) == 'Name: Charlie, Age: 40'\", \"assert get_person_info('David', 18) == 'Name: David, Age: 18'\",...
{ "split": "train", "index": 205, "acecode_id": "evol_20501", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of file changes represented by a list of dictionaries, where each dictionary contains the file's 'path', 'status', 'hash', 'created', and 'last_mod' attributes. The 'status' can be 'new', 'delete', or 'unchanged'. Your task is to identify files that have be...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert detect_moved_files([{'path': 'file1.txt', 'status': 'delete', 'hash': 'hash1', 'created': '2021-01-01', 'last_mod': '2021-01-10'}, {'path': 'file1.txt', 'status': 'new', 'hash': 'hash1', 'created': '2021-01-11', 'last_mod': '2021-01-15'}, {'path': 'file2.txt...
{ "split": "train", "index": 206, "acecode_id": "bigcode_python_fns_23419", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a configuration dictionary for various boards based on a predefined set of rules. The function should take in three parameters: a list of board names, a dictionary containing board templates, and a dictionary of configurati...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_board_configs(['brillo1', 'lakitu1', 'x30evb'], {'brillo': 'brillo_template', 'lakitu': 'lakitu_template', 'x30evb': 'x30evb_template'}, {}) == {'brillo1': 'brillo_template', 'lakitu1': 'lakitu_template', 'x30evb': 'x30evb_template'}\", \"assert gen...
{ "split": "train", "index": 207, "acecode_id": "bigcode_python_fns_24707", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the deletion of a file from a storage bucket. Write a function `delete_file(bucket: str, file: str) -> str` that takes in two parameters: a string `bucket`, representing the name of the bucket, and a string `file`, repr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert delete_file('bucket1', 'file1.txt') == 'File deleted successfully'\", \"assert delete_file('bucket1', 'file2.txt') == 'File deleted successfully'\", \"assert delete_file('bucket1', 'file3.txt') == 'File deleted successfully'\", \"assert delete_file('bucket1'...
{ "split": "train", "index": 208, "acecode_id": "bigcode_python_fns_31839", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists of integers, `x` and `y`, each representing a set of points in a multi-dimensional space. Write a function `pairwise_squared_distances(x: List[List[int]], y: List[List[int]]) -> List[List[float]]` that calculates the pairwise squared L2 distances between...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert pairwise_squared_distances([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[32.0, 72.0], [8.0, 32.0]]\", \"assert pairwise_squared_distances([[0]], [[1]]) == [[1.0]]\", \"assert pairwise_squared_distances([[1, 0], [0, 1]], [[0, 0], [1, 1]]) == [[1.0, 1.0], [1.0, 1.0...
{ "split": "train", "index": 209, "acecode_id": "bigcode_python_fns_32442", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates user registration. The function should take a dictionary input representing a user's registration details and return a string indicating whether the registration was successful or not. The input dictionary will contain ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert user_registration({'username': 'user1', 'password': 'short', 'email': 'user1@example.com'}) == 'Registration failed'\", \"assert user_registration({'username': 'user2', 'password': 'password123', 'email': 'invalidemail'}) == 'Registration failed'\", \"assert...
{ "split": "train", "index": 210, "acecode_id": "bigcode_python_fns_22040", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a function that simulates sampling from a data source a specified number of times. Your task is to implement a function `sample_data(n: int, model: str) -> List[Tuple[float, float]]` that returns a list of tuples, each containing two random float values sampled fr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert len(sample_data(5, 'modelB')) == 5\", \"assert all(0 <= x[0] <= 1 for x in sample_data(10, 'modelC'))\", \"assert all(0 <= x[1] <= 1 for x in sample_data(10, 'modelC'))\", \"assert sample_data(2, 'modelD') != sample_data(2, 'modelD')\", \"assert sample_data(...
{ "split": "train", "index": 211, "acecode_id": "bigcode_python_fns_2721", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that converts a given list of dictionaries into a formatted string representation of a CSV. Each dictionary in the list represents a row in the CSV format, and the keys of the dictionaries represent the column headers. The function...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_csv([]) == ''\", \"assert convert_to_csv([{'A': 1}]) == 'A\\\\n1'\", \"assert convert_to_csv([{'Name': 'Alice', 'Age': 25}]) == 'Name,Age\\\\nAlice,25'\", \"assert convert_to_csv([{'Col1': 'Val1', 'Col2': 'Val2'}, {'Col1': 'Val3', 'Col2': 'Val4'}]...
{ "split": "train", "index": 212, "acecode_id": "oss_2381", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a function that maintains a list of students. Each student has the following attributes: Full Name, Date of Birth, Major, Grade Point Average (GPA), and a list of courses taken (where each course has a course name, course grade, and semester taken). Implement a function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert search_student([], 'John Doe') == []\", \"assert search_student([{'name': 'John Doe', 'dob': '2000-01-01', 'major': 'Computer Science', 'gpa': 3.5, 'courses': []}], 'John Doe') == [{'name': 'John Doe', 'dob': '2000-01-01', 'major': 'Computer Science', 'gpa':...
{ "split": "train", "index": 213, "acecode_id": "evol_13645", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a string label representing a type of aerosol distribution, return a corresponding distribution data from a predefined set of distributions. The valid labels are: 'Urban', 'Marine', 'Rural', 'Remote Continental', 'Free Troposphere', 'Polar', and 'Desert'. If the label is ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert load_distribution('Urban') == [(1, 0.1, 2, 'A'), (2, 0.2, 3, 'B')]\", \"assert load_distribution('Marine') == [(1, 0.05, 1, 'C'), (3, 0.15, 2, 'D')]\", \"assert load_distribution('Rural') == [(2, 0.2, 1, 'E')]\", \"assert load_distribution('Remote Continenta...
{ "split": "train", "index": 214, "acecode_id": "bigcode_python_fns_20082", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the creation of a user interface for a window with adjustable parameters using trackbars. The function should take a list of parameters, where each parameter is represented as a dictionary containing its name, initial posit...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_trackbars([{'name': 'Brightness', 'initial_position': 50, 'max_value': 100}, {'name': 'Contrast', 'initial_position': 30, 'max_value': 100}]) == ['Trackbar: Brightness, Initial Position: 50, Max Value: 100', 'Trackbar: Contrast, Initial Position: 30, ...
{ "split": "train", "index": 215, "acecode_id": "bigcode_python_fns_39084", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a token with specific properties based on the input data and expiration settings. The function should take a dictionary `data`, an optional integer `expires_delta` representing the number of minutes until the token expires,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_token({'user_id': 2}, None, True) == {'user_id': 2, 'exp': datetime.max, 'scope': 'userauth:none'}\", \"assert create_token({'user_id': 4}, 0, True) == {'user_id': 4, 'exp': datetime.max, 'scope': 'userauth:none'}\", \"assert create_token({'user_id': ...
{ "split": "train", "index": 216, "acecode_id": "bigcode_python_fns_25384", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the registration of dummy devices based on their source IDs. The function should take a list of tuples, where each tuple contains information about a dummy streamer in the format (index, name, source_id, status). Your funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert register_dummy_streamers([(0, 'Streamer1', 'src1', 'active'), (1, 'Streamer2', 'src2', 'inactive'), (2, 'Streamer3', 'src1', 'active')]) == {'src1': 0, 'src2': 1}\", \"assert register_dummy_streamers([(0, 'A', 'src1', 'active'), (1, 'B', 'src1', 'active'), (...
{ "split": "train", "index": 217, "acecode_id": "bigcode_python_fns_32039", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates sending a command to a number of workers in a distributed system. The function `send_command_to_workers(num_workers: int)` takes an integer `num_workers` as input, which represents the number of workers. Your job is to retu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert send_command_to_workers(3) == ['Worker 1: Exit', 'Worker 2: Exit', 'Worker 3: Exit']\", \"assert send_command_to_workers(0) == []\", \"assert send_command_to_workers(-5) == []\", \"assert send_command_to_workers(1) == ['Worker 1: Exit']\", \"assert send_comm...
{ "split": "train", "index": 218, "acecode_id": "bigcode_python_fns_43382", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string, implement a function `identify_and_convert(s)` that converts the string into a list of individual characters, with each character represented as a dictionary containing the character itself and its data type. The data types should be categorized as 'number' for ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert identify_and_convert('aB1#') == [{'char': 'a', 'type': 'lowercase alphabet'}, {'char': 'B', 'type': 'uppercase alphabet'}, {'char': '1', 'type': 'number'}, {'char': '#', 'type': 'special character'}]\", \"assert identify_and_convert('12345') == [{'char': '1'...
{ "split": "train", "index": 219, "acecode_id": "evol_26969", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to calculate errors for a machine learning model's datasets based on their accuracies. The function should take in a list of accuracies for three datasets: training, validation, and test. The accuracies are provided as a list of float...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_errors([0.9, 0.8, 0.7]) == [[0.09999999999999998], [0.19999999999999996], [0.30000000000000004]]\", \"assert calculate_errors([1.0, 0.95, 0.85]) == [[0.0], [0.050000000000000044], [0.15000000000000002]]\", \"assert calculate_errors([0.0, 0.0, 0.0])...
{ "split": "train", "index": 220, "acecode_id": "oss_34826", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that converts a given integer into its Roman numeral representation. Roman numerals are represented by seven different symbols: I, V, X, L, C, D, and M, which correspond to the decimal values 1, 5, 10, 50, 100, 500, and 1000 respec...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert int_to_roman(1) == 'I'\", \"assert int_to_roman(4) == 'IV'\", \"assert int_to_roman(5) == 'V'\", \"assert int_to_roman(9) == 'IX'\", \"assert int_to_roman(10) == 'X'\", \"assert int_to_roman(40) == 'XL'\", \"assert int_to_roman(50) == 'L'\", \"assert int_to_...
{ "split": "train", "index": 221, "acecode_id": "oss_6410", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that generates a function to create and save tenant objects. The function should accept a property ID and a list of staff IDs as input, and return a generator that yields a function. This yielded function should accept a tenant's firs...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_tenant_generator(1, [101, 102]) is not None\", \"assert isinstance(next(create_tenant_generator(1, [101, 102])), Callable)\", \"assert isinstance(next(create_tenant_generator(5, [201, 202])), Callable)\", \"assert isinstance(next(create_tenant_generat...
{ "split": "train", "index": 222, "acecode_id": "oss_1993", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Develop a function that takes a list of words and returns a dictionary showcasing the frequency of individual letters appearing in the words. The keys of the dictionary should be the letters, and the values should be the counts of those letters across all words in the list.\nPl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert letter_frequency(['hello', 'world']) == {'h': 1, 'e': 1, 'l': 3, 'o': 2, 'w': 1, 'r': 1, 'd': 1}\", \"assert letter_frequency(['a', 'b', 'c', 'a', 'b', 'a']) == {'a': 3, 'b': 2, 'c': 1}\", \"assert letter_frequency(['']) == {}\", \"assert letter_frequency(['...
{ "split": "train", "index": 223, "acecode_id": "evol_7351", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given a nested JSON object, implement a function that reverses the alphabetical case of the characters in each string, changes odd numbers to even numbers, duplicates special symbols, and returns a dictionary that counts the occurrences of each altered character or number in al...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert flip_case_special_nested({'key1': 'value', 'key2': 3}) == ({'key1': 'VALUE', 'key2': 4}, {'V': 1, 'A': 1, 'L': 1, 'U': 1, 'E': 1, '4': 1})\", \"assert flip_case_special_nested({'empty': ''}) == ({'empty': ''}, {})\", \"assert flip_case_special_nested({'key1'...
{ "split": "train", "index": 224, "acecode_id": "evol_32641", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with simulating the generation of valid chemical compounds from a given initial state. Implement a function `generate_valid_compounds(root: List[str]) -> List[str]` that takes a list of strings representing the initial chemical states and returns a list of valid ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_valid_compounds(['C', 'CC', 'CCC']) == ['C', 'CC', 'CCC']\", \"assert generate_valid_compounds(['O', 'OCC', 'OCCO']) == ['O', 'OCC', 'OCCO']\", \"assert generate_valid_compounds(['N', 'NCC', 'NCCN']) == ['N', 'NCC', 'NCCN']\", \"assert generate_vali...
{ "split": "train", "index": 225, "acecode_id": "bigcode_python_fns_23119", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of patient PCR test results. Each result is represented as a dictionary containing the patient's ID, the result ('Positive' or 'Negative'), and the date of the test. Your task is to implement a function that takes a patient ID and the list of results, and r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_patient_status('patient1', [{'PATIENT_ID': 'patient1', 'TEXT': 'Positive', 'DATE': '2023-10-01T12:00:00Z'}, {'PATIENT_ID': 'patient1', 'TEXT': 'Negative', 'DATE': '2023-10-02T12:00:00Z'}]) == ('P', '2023-10-01T12:00:00Z')\", \"assert check_patient_stat...
{ "split": "train", "index": 226, "acecode_id": "bigcode_python_fns_34649", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes two strings as input and returns the total count of characters that are common between the two strings, taking into account the minimum occurrences of each character in both strings. For example, given the strings 'apple' and 'pineapple', the fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_common_characters('apple', 'pineapple') == 5\", \"assert count_common_characters('abcdef', 'ghijkl') == 0\", \"assert count_common_characters('python', 'java') == 0\", \"assert count_common_characters('aabbcc', 'abc') == 3\", \"assert count_common_char...
{ "split": "train", "index": 227, "acecode_id": "evol_14167", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `clean_directories` that simulates cleaning up directories based on given conditions. The function takes four boolean parameters: `clean_build`, `clean_derived`, `clean_cache`, and `clean_all`. If `clean_all` is `True`, all directorie...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert clean_directories(True, False, False, False) == ['Carthage/Build']\", \"assert clean_directories(False, True, False, False) == ['derived data']\", \"assert clean_directories(False, False, True, False) == ['repo cache', 'run cache']\", \"assert clean_director...
{ "split": "train", "index": 228, "acecode_id": "bigcode_python_fns_41879", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a string cleaning function in Python. The function should remove any occurrences of the string 'NaN' and leading/trailing whitespace from the input string. Additionally, if the input string is None, it should be treated as an empty string. Your ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert clean_string(None) == ''\", \"assert clean_string(' Hello ') == 'Hello'\", \"assert clean_string('NaNNaN') == ''\", \"assert clean_string(' NaN ') == ''\", \"assert clean_string('No NaN here') == 'No here'\", \"assert clean_string(' NaN ') == ''\", ...
{ "split": "train", "index": 229, "acecode_id": "oss_33466", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `create_nxentry` that simulates the creation of a new NXentry group within a hierarchical structure. The function should take two parameters: `parent`, which represents a dictionary that mimics the attributes of a parent group, and `name`...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_nxentry({'NX_class': 'NXentry'}, 'group1') == {'NX_class': 'NXsubentry'}\", \"assert create_nxentry({}, 'group2') == {'NX_class': 'NXentry'}\", \"assert create_nxentry({'NX_class': 'NXsubentry'}, 'group3') == {'NX_class': 'NXentry'}\", \"assert create...
{ "split": "train", "index": 230, "acecode_id": "bigcode_python_fns_25618", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 2D list `matrix` of dimensions `m x n`, implement a function `isToeplitzMatrix(matrix)` that returns `true` if the matrix is a Toeplitz matrix and `false` otherwise. A matrix is considered Toeplitz if every diagonal from the top-left to the bottom-right consists of the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert isToeplitzMatrix([[1,2,3,4],[5,1,2,3],[9,5,1,2]]) == True\", \"assert isToeplitzMatrix([[1,2],[2,2]]) == False\", \"assert isToeplitzMatrix([[1]]) == True\", \"assert isToeplitzMatrix([[0, 1, 2], [3, 0, 1], [4, 3, 0]]) == True\", \"assert isToeplitzMatrix([[...
{ "split": "train", "index": 231, "acecode_id": "evol_5481", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of USB device IDs represented as strings and a list of device IDs to remove. Write a function `remove_devices(device_ids: List[str], ids_to_remove: List[str]) -> List[str]` that removes all occurrences of the specified device IDs from the list and returns t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_devices(['usb1', 'usb2', 'usb3'], ['usb2']) == ['usb1', 'usb3']\", \"assert remove_devices(['usb1', 'usb2', 'usb3'], ['usb1', 'usb3']) == ['usb2']\", \"assert remove_devices(['usb1', 'usb1', 'usb2'], ['usb1']) == ['usb2']\", \"assert remove_devices(['...
{ "split": "train", "index": 232, "acecode_id": "bigcode_python_fns_12968", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing trip data for a travel application. Given a list of staypoints and triplegs, your goal is to assign a unique trip ID to each relevant staypoint and tripleg based on specific activities. You will be provided with the following inputs: \n- `temp_trip...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert assign_trip_ids([{'id': 1, 'type': 'tripleg'}, {'id': 2, 'type': 'staypoint'}], {'id': 1}, {'id': 2}, [{'id': 1, 'next_trip_id': None, 'trip_id': None}, {'id': 2, 'next_trip_id': None, 'trip_id': None}], [{'id': 1, 'trip_id': None}], 100) == None\", \"assert...
{ "split": "train", "index": 233, "acecode_id": "bigcode_python_fns_29466", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings, where each string represents a power setting for a device. Each power setting may have a deprecation warning associated with it, indicated by the presence of the substring 'deprecated' in the string. Your task is to implement a function `filter_...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_deprecated_settings(['normal', 'deprecated_low', 'high']) == ['normal', 'high']\", \"assert filter_deprecated_settings(['deprecated', 'deprecated_mode', 'active']) == ['active']\", \"assert filter_deprecated_settings(['max', 'min', 'deprecated_max', '...
{ "split": "train", "index": 234, "acecode_id": "bigcode_python_fns_21707", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple caching mechanism for a tree-like data structure where each node and leaf is identified by a unique key. The caching system needs to store and retrieve data associated with these nodes and leaves efficiently. Your goal is to implement a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_cache([('store', 'node1', b'Node 1 data'), ('retrieve', 'node1', None), ('evict', 'node1', None), ('retrieve', 'node1', None)]) == [b'Node 1 data', None]\", \"assert manage_cache([('store', 'leaf1', b'Leaf 1 data'), ('retrieve', 'leaf1', None)]) == [b...
{ "split": "train", "index": 235, "acecode_id": "oss_25523", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to determine if the current soil moisture level is below a specified threshold. The moisture level is represented as a percentage between 0 and 100. The function should take two parameters: an integer `moisture_level` representing the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_below_threshold(25, 30) == True\", \"assert is_below_threshold(30, 30) == False\", \"assert is_below_threshold(35, 30) == False\", \"assert is_below_threshold(0, 10) == True\", \"assert is_below_threshold(10, 10) == False\", \"assert is_below_threshold(50...
{ "split": "train", "index": 236, "acecode_id": "oss_10828", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of strings that may contain uppercase English letters, lowercase English letters, Chinese characters, and numbers, implement a function that calculates the total number of each character type across all strings. The function should return a dictionary containing th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_character_types(['Hello', '\\u4e16\\u754c', '123']) == {'Uppercase English': (1, Counter({'H': 1})), 'Lowercase English': (4, Counter({'e': 1, 'l': 2, 'o': 1})), 'Chinese characters': (2, Counter({'\\u4e16': 1, '\\u754c': 1})), 'Numbers': (3, Count...
{ "split": "train", "index": 237, "acecode_id": "evol_14817", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a list of integers and a target integer. Your task is to determine if any two numbers in the list add up to the target integer. Implement a function named 'has_pair_with_sum' that takes in a list of integers 'nums' and an integer 'target' and returns True if there...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert has_pair_with_sum([1, 2, 3, 4, 5], 5) == True\", \"assert has_pair_with_sum([10, 15, 3, 7], 17) == True\", \"assert has_pair_with_sum([1, 2, 3, 4, 5], 10) == False\", \"assert has_pair_with_sum([0, -1, 2, -2, 1], 0) == True\", \"assert has_pair_with_sum([1],...
{ "split": "train", "index": 238, "acecode_id": "oss_12847", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `graceful_shutdown` that simulates a clean shutdown process when a termination signal is received. The function should log a warning message and return a string indicating that the shutdown process has started. The function should take no...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert graceful_shutdown() == 'Shutdown initiated'\", \"assert graceful_shutdown() == 'Shutdown initiated'\", \"assert graceful_shutdown() == 'Shutdown initiated'\", \"assert graceful_shutdown() == 'Shutdown initiated'\", \"assert graceful_shutdown() == 'Shutdown i...
{ "split": "train", "index": 239, "acecode_id": "bigcode_python_fns_39684", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing various URLs. Your task is to implement a function that validates each URL by checking if it starts with 'http://' or 'https://'. The function should return a list of boolean values where each boolean indicates whether the correspond...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_urls(['http://example.com', 'https://secure-site.org', 'ftp://files.com']) == [True, True, False]\", \"assert validate_urls(['http://example.com', 'http://another-site.com']) == [True, True]\", \"assert validate_urls(['https://example.com', 'http://...
{ "split": "train", "index": 240, "acecode_id": "bigcode_python_fns_26742", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given an array 'arr' of N integers, rearrange the elements to ensure that by swapping exactly two elements within the array up to three times, the array can be transformed into a non-decreasingly sorted array. Additionally, the final array must have an odd count of elements tha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rearrange_three_elements([5, 4, 3, 1, 2, 6]) == False\", \"assert rearrange_three_elements([]) == True\", \"assert rearrange_three_elements([10, 9, 8, 7, 6, 5]) == False\", \"assert rearrange_three_elements([1, 1, 1, 1, 1]) == True\", \"assert rearrange_thre...
{ "split": "train", "index": 241, "acecode_id": "evol_11918", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates a simple game of rock-paper-scissors. The function should take two arguments, representing the choices of two players, and return the result of the game based on the standard rules of rock-paper-scissors. The choices...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rock_paper_scissors('rock', 'scissors') == 'Player 1 wins'\", \"assert rock_paper_scissors('scissors', 'rock') == 'Player 2 wins'\", \"assert rock_paper_scissors('paper', 'rock') == 'Player 1 wins'\", \"assert rock_paper_scissors('rock', 'paper') == 'Player ...
{ "split": "train", "index": 242, "acecode_id": "oss_20752", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that creates a link between a file and a datastore or a share. The function should take four parameters: `link_id`, `file_id`, `parent_share_id`, and `parent_datastore_id`. The function should return `True` if the link is successfully...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_file_link(1, 100, 10, 20) == True\", \"assert create_file_link(2, 101, 11, 21) == False\", \"assert create_file_link(3, 102, 12, 22) == True\", \"assert create_file_link(4, 103, 13, 23) == False\", \"assert create_file_link(5, 104, 14, 24) == True\", ...
{ "split": "train", "index": 243, "acecode_id": "bigcode_python_fns_6498", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing gene expression levels. Your task is to implement a function `highly_variable_genes` that normalizes the gene expression levels to log counts per million (logCPM) and selects the top `n_genes` highly variable genes based on their va...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert highly_variable_genes([100, 200, 300, 400], 2) == [400, 300]\", \"assert highly_variable_genes([], 3) == []\", \"assert highly_variable_genes([10, 20, 30, 40, 50], 3) == [50, 40, 30]\", \"assert highly_variable_genes([1, 2, 3, 4, 5], 0) == []\", \"assert hig...
{ "split": "train", "index": 244, "acecode_id": "bigcode_python_fns_49680", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 3D list of binary masks where each mask represents a region in a 2D plane, write a function that converts this list into a dictionary format containing the coordinates of the regions. Each mask is represented as a 2D binary array (list of lists) with dimensions (compone...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert nf_masks_to_neurof_dict([[[1, 0], [0, 1]], [[0, 1], [1, 0]]], 'TestDataset') == {'regions': [{'coordinates': [[0, 0], [1, 1]]}, {'coordinates': [[0, 1], [1, 0]]}], 'dataset': 'TestDataset'}\", \"assert nf_masks_to_neurof_dict([[[0, 0], [0, 0]]], 'EmptyDatase...
{ "split": "train", "index": 245, "acecode_id": "bigcode_python_fns_820", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of dictionaries, each containing 'Name' and 'Description_Visual' keys. Your function should concatenate the values of these keys for each dictionary, separated by a custom separator '[SEP]', and return a list ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_data([{'Name': 'John', 'Description_Visual': 'Doe'}, {'Name': 'Jane', 'Description_Visual': 'Smith'}]) == ['John[SEP]Doe', 'Jane[SEP]Smith']\", \"assert process_data([{'Name': 'Alice', 'Description_Visual': 'Wonderland'}, {'Name': 'Bob', 'Description...
{ "split": "train", "index": 246, "acecode_id": "oss_7866", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of airline names and a list of airport names, create a function that renders a flight addition page. The function should take an error message as an optional parameter. If the error message is not None, it should be included in the output. The function should retur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert render_flight_addition_page(None) == {'airlines': [], 'airports': [], 'error': None}\", \"assert render_flight_addition_page('Invalid flight number') == {'airlines': [], 'airports': [], 'error': 'Invalid flight number'}\", \"assert render_flight_addition_pag...
{ "split": "train", "index": 247, "acecode_id": "bigcode_python_fns_21580", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that unpacks data descriptions from a given data stream. There are two types of descriptions: RigidBodyDescription, which has a fixed unpacking length of 10 bytes, and SkeletonDescription, which has a fixed unpacking length of 8 bytes...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unpack_descriptions([('RigidBody', 'data1'), ('Skeleton', 'data2')]) == 18\", \"assert unpack_descriptions([('RigidBody', 'data1'), ('RigidBody', 'data2')]) == 20\", \"assert unpack_descriptions([('Skeleton', 'data1'), ('Skeleton', 'data2')]) == 16\", \"asse...
{ "split": "train", "index": 248, "acecode_id": "oss_27117", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a list of documents. Each document is represented by a dictionary containing the following fields: 'level', 'api_url', 'trace', and 'file'. Your function should take a list of such documents and return a new list containing...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_documents_by_level([{'level': 1, 'api_url': 'url1', 'trace': 'trace1', 'file': 'file1'}, {'level': 2, 'api_url': 'url2', 'trace': 'trace2', 'file': 'file2'}], 1) == [{'level': 2, 'api_url': 'url2', 'trace': 'trace2', 'file': 'file2'}]\", \"assert filt...
{ "split": "train", "index": 249, "acecode_id": "oss_17883", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a principal amount, an annual interest rate, and a time period in years. Your task is to write a function `calculate_total_amount` that computes the total amount to be paid at the end of the loan period, which includes both the principal and the accrued interest. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_total_amount(1000, 5, 3) == 1157.63\", \"assert calculate_total_amount(2000, 3, 5) == 2318.55\", \"assert calculate_total_amount(500, 10, 2) == 605.00\", \"assert calculate_total_amount(100, 0, 5) == 100.00\", \"assert calculate_total_amount(700, 2...
{ "split": "train", "index": 250, "acecode_id": "oss_14541", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of dictionaries representing organizations, where each dictionary contains a key 'login' with the organization's name as its value. Your function should return a list of organization names extracted from the input list. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_organizations([{'login': 'power_rangers'}, {'login': 'teletubbies'}]) == ['power_rangers', 'teletubbies']\", \"assert get_organizations([{'login': 'batman'}, {'login': 'superman'}, {'login': 'wonder_woman'}]) == ['batman', 'superman', 'wonder_woman']\", ...
{ "split": "train", "index": 251, "acecode_id": "bigcode_python_fns_16344", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that calculates the surface area of a circle given its radius using the formula A = πr². The function should take a single parameter, radius (a float), and return the calculated area as a float.\nPlease reason step by step, then write a self-contained Pytho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert abs(circle_area(0) - 0) < 1e-9\", \"assert abs(circle_area(1) - 3.141592653589793) < 1e-9\", \"assert abs(circle_area(2) - 12.566370614359172) < 1e-9\", \"assert abs(circle_area(3) - 28.274333882308138) < 1e-9\", \"assert abs(circle_area(4) - 50.265482457436...
{ "split": "train", "index": 252, "acecode_id": "evol_23295", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Write a function `is_nonincreasing(arr: List[int]) -> bool` that returns `True` if the list is non-increasing, meaning each element is greater than or equal to the element that follows it. Otherwise, return `False`. The list can be empty or con...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_nonincreasing([]) == True\", \"assert is_nonincreasing([5]) == True\", \"assert is_nonincreasing([5, 5]) == True\", \"assert is_nonincreasing([5, 4, 3, 2, 1]) == True\", \"assert is_nonincreasing([5, 4, 4, 2, 1]) == True\", \"assert is_nonincreasing([5, 6...
{ "split": "train", "index": 253, "acecode_id": "bigcode_python_fns_29561", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks for errors in a given input string. The input string will consist of various error types, and your function should identify and count the occurrences of each error type. The error types to be checked for are: 'syntax', 'lo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert errorChecker('syntax logic runtime semantic logic syntax') == {'syntax': 2, 'logic': 2, 'runtime': 1, 'semantic': 1}\", \"assert errorChecker('') == {'syntax': 0, 'logic': 0, 'runtime': 0, 'semantic': 0}\", \"assert errorChecker('syntax') == {'syntax': 1, 'l...
{ "split": "train", "index": 254, "acecode_id": "oss_6572", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary representing a game board where the keys are tuples representing positions on the board, and the values are the disks located at those positions. Write a function `get_disk_at(board: dict, position: tuple) -> Optional[Any]` that returns the disk at th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_disk_at({(0, 0): 'X', (1, 1): 'O'}, (0, 0)) == 'X'\", \"assert get_disk_at({(0, 0): 'X', (1, 1): 'O'}, (1, 1)) == 'O'\", \"assert get_disk_at({(0, 0): 'X', (1, 1): 'O'}, (2, 2)) == None\", \"assert get_disk_at({(0, 0): 'X', (1, 1): 'O'}, (0, 1)) == None\...
{ "split": "train", "index": 255, "acecode_id": "bigcode_python_fns_47900", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates the retrieval of information about ligands present in a given protein structure. The function should handle a mock retrieval of ligand information and perform validation checks to ensure the correctness of the simula...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert retrieve_ligand_info('1mru') == 'OK'\", \"assert retrieve_ligand_info('2xyz') == 'OK'\", \"assert retrieve_ligand_info('5ghi') == 'Invalid'\", \"assert retrieve_ligand_info('7mno') == 'Invalid'\", \"assert retrieve_ligand_info('9stu') == 'Invalid'\", \"asser...
{ "split": "train", "index": 256, "acecode_id": "oss_5549", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Given an integer array, implement a function that reverses the order of the elements in the array. For example, if the input array is [1, 2, 3, 4], the output should be [4, 3, 2, 1]. Write a single function called `reverse_array(arr)` that takes an array as input and returns th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_array([1, 2, 3, 4]) == [4, 3, 2, 1]\", \"assert reverse_array([5, 6, 7]) == [7, 6, 5]\", \"assert reverse_array([10]) == [10]\", \"assert reverse_array([]) == []\", \"assert reverse_array([1, 2, 3, 4, 5]) == [5, 4, 3, 2, 1]\", \"assert reverse_array(...
{ "split": "train", "index": 257, "acecode_id": "evol_27370", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function named 'get_square_val' that takes an integer n as input and returns the square of that integer. You can use a lambda function within your implementation. The function should handle both positive and negative integers as well as zero.\nPlease reason step by ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_square_val(0) == 0\", \"assert get_square_val(1) == 1\", \"assert get_square_val(-1) == 1\", \"assert get_square_val(2) == 4\", \"assert get_square_val(-2) == 4\", \"assert get_square_val(3) == 9\", \"assert get_square_val(-3) == 9\", \"assert get_square...
{ "split": "train", "index": 258, "acecode_id": "evol_17660", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of strings as input and returns a new list where each string is converted to lowercase. The input list may contain strings of varying cases, and your implementation should ensure that the output list contains the same st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_lowercase(['Hello', 'WORLD', 'Python']) == ['hello', 'world', 'python']\", \"assert convert_to_lowercase(['Django', 'Flask', 'FastAPI']) == ['django', 'flask', 'fastapi']\", \"assert convert_to_lowercase(['LeetCode', 'Code', 'Challenge']) == ['lee...
{ "split": "train", "index": 259, "acecode_id": "oss_2497", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of filenames representing 3D point cloud data, implement a function that processes these filenames to extract the corresponding classification labels based on a predefined mapping. The input is a list of strings, where each string represents a filename that contain...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_filenames(['unknown_file.txt', 'chair.obj', 'sofa.ply']) == [-1, 8, 30]\", \"assert process_filenames(['bed.npz', 'guitar.npy', 'monitor.ply']) == [2, 17, 22]\", \"assert process_filenames(['lamp.ply', 'vase.obj', 'unknown_file.npy']) == [19, 37, -1]...
{ "split": "train", "index": 260, "acecode_id": "bigcode_python_fns_38982", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `below_zero` that analyzes a series of financial operations on a balance. The function should accept a list of operations represented as tuples, where each tuple consists of a string indicating the type of transaction ('Deposit' or 'W...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert below_zero([('Deposit', 100), ('Withdrawal', 100)], case_insensitive=True) == True\", \"assert below_zero([('deposit', 200), ('withdrawal', 200)], case_insensitive=True) == True\", \"assert below_zero([('Deposit', 150), ('Withdrawal', 200)], case_insensitive...
{ "split": "train", "index": 261, "acecode_id": "evol_2927", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with constructing a new alphabet system based on a secret number provided by the user. The secret number will determine the shift for a Caesar cipher that will be applied to the given garbled message. Implement a function `decrypt_message(secret: int, message: st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert decrypt_message(3, 'KHOOR') == 'HELLO'\", \"assert decrypt_message(1, 'IFMMP') == 'HELLO'\", \"assert decrypt_message(2, 'JGNNQ') == 'HELLO'\", \"assert decrypt_message(5, 'MJQQT') == 'HELLO'\", \"assert decrypt_message(0, 'WORLD') == 'WORLD'\", \"assert dec...
{ "split": "train", "index": 262, "acecode_id": "bigcode_python_fns_32057", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a given string and removes a random word from it. Your task is to complete the function `remove_random_word(text)` which takes a string `text` as input. The function should perform the following steps: 1. Split the i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_random_word('The quick brown fox jumps over the lazy dog') != 'The quick brown fox jumps over the lazy dog'\", \"assert remove_random_word('Hello World') in ['Hello', 'World']\", \"assert remove_random_word('A B C D E F') in ['B C D E F', 'A C D E F',...
{ "split": "train", "index": 263, "acecode_id": "oss_15369", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `binary_search(data: List[int], search_num: int) -> bool` that takes a list of integers and a search number as input. The function should first sort the list in ascending order and then perform a binary search to determine if the search number is present in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert binary_search([4, 2, 5, 1, 3], 3) == True\", \"assert binary_search([10, 20, 30, 40, 50], 25) == False\", \"assert binary_search([7, 13, 11, 9, 12], 9) == True\", \"assert binary_search([5, 3, 8, 6, 2], 4) == False\", \"assert binary_search([1, 2, 3, 4, 5], ...
{ "split": "train", "index": 264, "acecode_id": "evol_30971", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary containing key-value pairs where keys are strings and values are integers. Write a function `format_dict_to_json(data_dict: Dict[str, int]) -> str` that converts this dictionary into a JSON string with an indentation of 4 spaces for better readability...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_dict_to_json({'name': 1, 'age': 30, 'height': 175}) == '{\\\\n \\\"name\\\": 1,\\\\n \\\"age\\\": 30,\\\\n \\\"height\\\": 175\\\\n}'\", \"assert format_dict_to_json({'a': 10, 'b': 20}) == '{\\\\n \\\"a\\\": 10,\\\\n \\\"b\\\": 20\\\\n}...
{ "split": "train", "index": 265, "acecode_id": "bigcode_python_fns_13212", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `are_anagrams(string1: str, string2: str) -> bool` that takes two strings as input and determines whether they are anagrams of each other. The function should ignore case, spaces, and punctuation. The strings may contain Unicode characters.\nPlease reason s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert are_anagrams('Astronomer', 'Moon starer') == True\", \"assert are_anagrams('The Morse Code', 'Here come dots') == True\", \"assert are_anagrams('A gentleman', 'Elegant man') == True\", \"assert are_anagrams('School master', 'The classroom') == True\", \"asse...
{ "split": "train", "index": 266, "acecode_id": "evol_13599", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the periodic activation of a set of generators based on their unique identifiers. Each generator is represented by an integer ID. Your function should take an integer ID as input and return a string indicating whether t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert activate_generator(2) == 'Generator Activated'\", \"assert activate_generator(4) == 'Generator Activated'\", \"assert activate_generator(6) == 'Generator Activated'\", \"assert activate_generator(8) == 'Generator Activated'\", \"assert activate_generator(10)...
{ "split": "train", "index": 267, "acecode_id": "bigcode_python_fns_3048", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `anagram_and_character_check(str1: str, str2: str, str3: str) -> bool` that accepts three string inputs. The function should determine whether the first two strings are anagrams of each other, considering case-sensitivity and whitespace. If they are anagram...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert anagram_and_character_check('listen', 'silent', 'en') == True\", \"assert anagram_and_character_check('a gentleman', 'elegant man', 'g') == True\", \"assert anagram_and_character_check('hello', 'world', 'o') == False\", \"assert anagram_and_character_check('...
{ "split": "train", "index": 268, "acecode_id": "evol_35632", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You need to implement a function that checks if a given function raises a specific exception when called with certain arguments. The function should take in a callable and a set of arguments, and it should return True if the callable raises the specified exception, and False ot...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_exception(lambda x: 1/0, (1,)) == False\", \"assert check_exception(lambda x: x * 2, (2,)) == False\", \"assert check_exception(lambda x: x < 0, (1,)) == False\", \"assert check_exception(lambda: 1 / 1, ()) == False\", \"assert check_exception(lambda x...
{ "split": "train", "index": 269, "acecode_id": "bigcode_python_fns_19313", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple tracker application that monitors a specified host and a range of ports. Implement a function `create_tracker(host: str, port: int, port_end: int, silent: bool) -> str` that takes in the following parameters: \n\n- `host` (1 <= len(host) <=...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_tracker('localhost', 8080, 8085, True) == 'Tracker created for localhost on ports 8080 to 8085 in silent mode.'\", \"assert create_tracker('192.168.1.1', 8000, 8005, False) == 'Tracker created for 192.168.1.1 on ports 8000 to 8005 in verbose mode.'\",...
{ "split": "train", "index": 270, "acecode_id": "bigcode_python_fns_9832", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that returns the starting indices of all occurrences of a given substring within a main string. The function should have a parameter to determine whether the search should be case sensitive. The function should return a list of indices. If no occurrences ar...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_substring_indices('Hello world, hello world again', 'WORLD', True) == []\", \"assert find_substring_indices('abcabcabc', 'abc', False) == [0, 3, 6]\", \"assert find_substring_indices('abcabcabc', 'ABC', True) == []\", \"assert find_substring_indices('Ca...
{ "split": "train", "index": 271, "acecode_id": "evol_33739", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that constructs a SQL query to retrieve specific fields from a given table. Write a function `construct_sql_query` that takes in the following parameters:\n- `table`: A string representing the name of the table to retrieve data from.\n- `f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert construct_sql_query('StatEvents', ['type_name_col', 'date_col']) == 'SELECT type_name_col, date_col FROM StatEvents'\", \"assert construct_sql_query('Users', ['username', 'email']) == 'SELECT username, email FROM Users'\", \"assert construct_sql_query('Produ...
{ "split": "train", "index": 272, "acecode_id": "oss_15943", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python decorator that restricts access to certain functions based on the user's role. The decorator should only allow users with administrative privileges to execute the decorated functions. You need to implement a method `is_admin` for a `User` c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert User('admin').is_admin() == True\", \"assert User('user').is_admin() == False\", \"assert User('admin').is_admin() == True\", \"assert User('guest').is_admin() == False\", \"assert User('admin').is_admin() == True\", \"assert User('manager').is_admin() == Fa...
{ "split": "train", "index": 273, "acecode_id": "oss_35057", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks if a given token is valid for a file request. The function should take in a file request, a token, and two boolean parameters: `require_requester` and `verify_requester`. The rules are as follows: 1) If `require_requester`...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_token('request_123', 'token_with_requester_456', True, True) == False\", \"assert is_valid_token('request_123', 'token_without_requester', True, True) == False\", \"assert is_valid_token('request_123', 'token_without_requester', True, False) == Fals...
{ "split": "train", "index": 274, "acecode_id": "bigcode_python_fns_21395", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a Python function that processes a list of dictionaries representing student grades. Each dictionary contains the keys 'name' (a string) and 'grade' (an integer). Your function should calculate the average grade of the students and return it rounded ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average_grade([{'name': 'Alice', 'grade': 90}, {'name': 'Bob', 'grade': 80}, {'name': 'Charlie', 'grade': 70}]) == 80.00\", \"assert calculate_average_grade([{'name': 'David', 'grade': 85}, {'name': 'Eve', 'grade': 95}]) == 90.00\", \"assert calcul...
{ "split": "train", "index": 275, "acecode_id": "oss_1804", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are developing a simple blogging platform where each blog can have multiple reviews. Each blog is associated with a specific user through a user ID. Your task is to implement a function that allows users to save a review for a specific blog and another function that retriev...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert save_review(12345, 'My First Blog', 'Great post!') == True\", \"assert save_review(12345, 'My Second Blog', 'Very informative.') == True\", \"assert save_review(67890, 'Another Blog', 'Interesting read.') == True\", \"assert get_blogs(11111) == []\", \"asser...
{ "split": "train", "index": 276, "acecode_id": "oss_31855", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a list of version strings representing software versions. Each version string consists of three parts: major, minor, and patch, separated by dots (e.g., '1.0.2'). Your task is to implement a function that takes this list of version strings and returns the latest v...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_latest_version(['1.0.0', '1.0.1', '1.0.2']) == '1.0.2'\", \"assert get_latest_version(['2.0.0', '1.0.0', '1.0.1']) == '2.0.0'\", \"assert get_latest_version(['1.0.0', '1.0.0', '1.0.0']) == '1.0.0'\", \"assert get_latest_version(['1.0.10', '1.0.2', '1.0.3...
{ "split": "train", "index": 277, "acecode_id": "bigcode_python_fns_21777", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `insert_word(trie: Trie, word: str) -> None` that inserts a word into a given Trie data structure. The Trie is initialized and passed as an argument. Your function should not return anything. The `Trie` class is already defined with methods for insertion an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert insert_word(trie, 'apple') is None\", \"assert insert_word(trie, 'banana') is None\", \"assert insert_word(trie, 'grape') is None\", \"assert insert_word(trie, 'orange') is None\", \"assert insert_word(trie, 'kiwi') is None\", \"assert insert_word(trie, 'man...
{ "split": "train", "index": 278, "acecode_id": "evol_13012", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that validates user permissions for accessing webhooks. The function should take two inputs: a dictionary representing the webhook configurations and a dictionary representing a user connection along with a message containing a webhoo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_webhook_access({'webhook_1': 'user_1', 'webhook_2': 'user_2'}, {'user': {'id': 'user_1'}, 'id': 1, 'webhook_id': 'webhook_1'}) == 'Access granted'\", \"assert validate_webhook_access({'webhook_1': 'user_1', 'webhook_2': 'user_2'}, {'user': {'id': 'u...
{ "split": "train", "index": 279, "acecode_id": "bigcode_python_fns_38589", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a program that extracts the license information from a given source code string. The license information is typically found at the beginning of the source code and is enclosed within comment symbols (e.g., '#'). Your program should be able to identi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_license_text('# License information here\\\\n# and continues here') == 'License information here\\\\nand continues here'\", \"assert extract_license_text('# This is a sample license text') == 'This is a sample license text'\", \"assert extract_licens...
{ "split": "train", "index": 280, "acecode_id": "oss_14267", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing file paths. Your task is to filter out any file paths that contain the substring '_all' and then concatenate the remaining file paths into a single string separated by commas. Implement a function that takes in a list of strings and ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert concatenate_files(['file1.txt', 'file2_all.txt', 'file3.txt']) == 'file1.txt,file3.txt'\", \"assert concatenate_files(['report.doc', 'summary_all.doc', 'data.xls']) == 'report.doc,data.xls'\", \"assert concatenate_files(['a.txt', 'b_all.txt', 'c.txt', 'd_all...
{ "split": "train", "index": 281, "acecode_id": "bigcode_python_fns_7123", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a Python function that determines the total number of weekdays (Monday to Friday) in a specific month and year. Additionally, the function should allow users to specify a particular weekday (e.g., 'Monday', 'Tuesday') and return the count of that specific weekday in t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_weekdays(2023, 1) == 22\", \"assert count_weekdays(2023, 2) == 20\", \"assert count_weekdays(2023, 3) == 23\", \"assert count_weekdays(2023, 4) == 20\", \"assert count_weekdays(2023, 5) == 23\", \"assert count_weekdays(2023, 6) == 22\", \"assert count_...
{ "split": "train", "index": 282, "acecode_id": "evol_10199", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function `calculate` that performs basic arithmetic operations based on the provided operator. The function takes three parameters: two numbers `a` and `b`, and a string `operator` which can be one of the following: 'add', 'subtract', 'multiply', 'divide'. The funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate(5, 3, 'add') == 8\", \"assert calculate(5, 3, 'subtract') == 2\", \"assert calculate(5, 3, 'multiply') == 15\", \"assert calculate(6, 3, 'divide') == 2.0\", \"assert calculate(5, 0, 'divide') == 'Error: Division by zero is undefined'\", \"assert ca...
{ "split": "train", "index": 283, "acecode_id": "evol_6308", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing a function name and a list of available functions as strings. Write a function called `find_function` that checks if the specified function name exists in the list of available functions. If it exists, return the function name; otherwise, ret...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_function('foo', ['foo', 'bar', 'baz']) == 'foo'\", \"assert find_function('foo', ['bar', 'baz']) == None\", \"assert find_function('test', ['test', 'example', 'sample']) == 'test'\", \"assert find_function('example', ['test', 'example', 'sample']) == 'e...
{ "split": "train", "index": 284, "acecode_id": "bigcode_python_fns_32420", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of configuration settings and merges them into a single configuration object. The configuration settings will be provided as a list of dictionaries, where each dictionary represents a different configuration. The functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_configs([{'a': 1}, {'b': 2}]) == {'a': 1, 'b': 2}\", \"assert merge_configs([{'a': 1}, {'a': 2}]) == {'a': 2}\", \"assert merge_configs([{'a': 1}, {'a': 2}, {'b': 3}]) == {'a': 2, 'b': 3}\", \"assert merge_configs([{'x': 5}, {'y': 10}, {'x': 15}]) == {...
{ "split": "train", "index": 285, "acecode_id": "bigcode_python_fns_40490", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string that represents a cell reference in a spreadsheet format, such as 'A1', 'B2', or 'C3'. Your task is to implement a function that returns the cell reference specified by the input string. The input string will always be in the format of a column letter fol...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert INDIRECT('A1') == 'A1'\", \"assert INDIRECT('B2') == 'B2'\", \"assert INDIRECT('C3') == 'C3'\", \"assert INDIRECT('Z26') == 'Z26'\", \"assert INDIRECT('AA1') == 'AA1'\", \"assert INDIRECT('AB2') == 'AB2'\", \"assert INDIRECT('AC3') == 'AC3'\", \"assert INDIR...
{ "split": "train", "index": 286, "acecode_id": "bigcode_python_fns_23553", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing tasks and their statuses in a simple task management system. Each task has a name and a status, which can be one of the following: 'Incomplete', 'InProgress', or 'Complete'. Write a function called `manage_task` that takes two parameters: a string `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_task('Task 1', 'Incomplete') == 'Incomplete'\", \"assert manage_task('Task 1', 'InProgress') == 'InProgress'\", \"assert manage_task('Task 1', 'Complete') == 'Complete'\", \"assert manage_task('Task 1', 'Incomplete') == 'Incomplete'\", \"assert manage...
{ "split": "train", "index": 287, "acecode_id": "oss_32819", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the creation of a run action. The function, `create_run_action`, should take the following parameters: `action_id` (a string representing the unique identifier for the action), `action_type` (a string that can either be 'ST...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_run_action('action1', 'START', datetime(2021, 1, 1)) == {'id': 'action1', 'actionType': 'START', 'createdAt': datetime(2021, 1, 1)}\", \"assert create_run_action('action2', 'STOP', datetime(2021, 5, 15)) == {'id': 'action2', 'actionType': 'STOP', 'cre...
{ "split": "train", "index": 288, "acecode_id": "bigcode_python_fns_7324", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of integers and returns a dictionary containing the prime numbers from the list as keys and the number of distinct prime factors for each prime number as values. The function should optimize for performance when checking for primality and ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_primes_and_factors([2, 3, 5, 7]) == {2: 1, 3: 1, 5: 1, 7: 1}\", \"assert find_primes_and_factors([10, 11, 12, 13]) == {11: 1, 13: 1}\", \"assert find_primes_and_factors([15, 17, 19, 20]) == {17: 1, 19: 1}\", \"assert find_primes_and_factors([1, 4, 6, 8,...
{ "split": "train", "index": 289, "acecode_id": "evol_1241", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a logging function that logs messages with a specific format. Implement a function `log_message(msg: str) -> str` that takes a string message as input and returns the message formatted as \"INFO: {msg}\". Your function should ensure that the message...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert log_message('Server started') == 'INFO: Server started'\", \"assert log_message('User logged in') == 'INFO: User logged in'\", \"assert log_message('Data saved successfully') == 'INFO: Data saved successfully'\", \"assert log_message('') == 'No message provi...
{ "split": "train", "index": 290, "acecode_id": "bigcode_python_fns_32552", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer 'i', return the position of the square on a 2D grid where the width of the grid is fixed at 5. The position should be represented as a list with two integers: the first integer is the row index (0-based) and the second integer is the column index (0-based). For...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert getPositionPdf(0) == [0, 0]\", \"assert getPositionPdf(1) == [0, 1]\", \"assert getPositionPdf(2) == [0, 2]\", \"assert getPositionPdf(3) == [0, 3]\", \"assert getPositionPdf(4) == [0, 4]\", \"assert getPositionPdf(5) == [1, 0]\", \"assert getPositionPdf(6) ...
{ "split": "train", "index": 291, "acecode_id": "bigcode_python_fns_44954", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a 3D volume represented as a 3D array (or list of lists of lists) where each element is an integer. Your task is to implement a function `apply_function(volume: List[List[List[int]]], function: Callable[[int], float], value: float) -> List[List[List[float]]]` that...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert apply_function([[[1, 2]], [[3, 4]]], lambda x: x / 3, 1) == [[[0.3333333333333333, 0.6666666666666666]], [[1.0, 1.3333333333333333]]]\", \"assert apply_function([[[10]]], lambda x: x * 2, 5) == [[[4.0]]]\", \"assert apply_function([[[0, 0], [0, 0]]], lambda ...
{ "split": "train", "index": 292, "acecode_id": "bigcode_python_fns_19942", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Implement a function `create_car(make: str, model: str) -> dict` that takes in two strings, `make` and `model`, and returns a dictionary representing a car object with keys 'make' and 'model' corresponding to the input parameters. The returned dictionary should have the structu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_car('Toyota', 'Camry') == {'make': 'Toyota', 'model': 'Camry'}\", \"assert create_car('Honda', 'Civic') == {'make': 'Honda', 'model': 'Civic'}\", \"assert create_car('Ford', 'Mustang') == {'make': 'Ford', 'model': 'Mustang'}\", \"assert create_car('Ch...
{ "split": "train", "index": 293, "acecode_id": "evol_8534", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `can_form_palindrome(string: str) -> bool` that determines if the input string can be rearranged to form a palindrome. A palindrome is a word, phrase, number, or other sequence of characters that reads the same forward and backward. Your function should ret...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_form_palindrome('civic') == True\", \"assert can_form_palindrome('ivicc') == True\", \"assert can_form_palindrome('hello') == False\", \"assert can_form_palindrome('aabb') == True\", \"assert can_form_palindrome('abc') == False\", \"assert can_form_palin...
{ "split": "train", "index": 294, "acecode_id": "evol_18689", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `generate_fake_candle(symbol: str, count: int) -> List[Dict[str, Any]]` that generates a list of fake candle data. Each candle should be represented as a dictionary with the following structure: {'k': {'T': timestamp, 'symbol': symbol...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_fake_candle('BTC', 5) == [{'k': {'T': 2000, 'symbol': 'BTC', 'count': 5}}, {'k': {'T': 4000, 'symbol': 'BTC', 'count': 5}}, {'k': {'T': 6000, 'symbol': 'BTC', 'count': 5}}, {'k': {'T': 8000, 'symbol': 'BTC', 'count': 5}}, {'k': {'T': 10000, 'symbol'...
{ "split": "train", "index": 295, "acecode_id": "bigcode_python_fns_37722", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to optimize buffer sizes for a data processing system. The function should take a list of buffer sizes as input and return the optimized buffer size based on certain criteria. You are given a list `buffers` containing buffer sizes. Th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert optimize_buffer_size([128, 256, 1024, 1024 * 1024 * 5]) == 1024 * 1024 * 5\", \"assert optimize_buffer_size([150, 200, 300, 400]) == 400\", \"assert optimize_buffer_size([512, 256, 128]) == 512\", \"assert optimize_buffer_size([]) == 128\", \"assert optimize...
{ "split": "train", "index": 296, "acecode_id": "oss_12853", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the mode change of a scientific calculator's display between degrees (\"DEG\") and radians (\"RAD\"). The function should take the current mode as input and return the new mode after toggling. Additionally, if the curre...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert toggle_mode('DEG') == ('RAD', ['asinh()', 'acosh()', 'atanh()', 'sinh()'])\", \"assert toggle_mode('RAD') == ('DEG', ['asin', 'acos', 'atan', 'sin'])\", \"assert toggle_mode('DEG') == ('RAD', ['asinh()', 'acosh()', 'atanh()', 'sinh()'])\", \"assert toggle_mo...
{ "split": "train", "index": 297, "acecode_id": "oss_15703", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array 'myList' of floating-point numbers and two indexes n and m, implement a function 'findIndexOfMinimum' that takes the array, n, and m as arguments. The function should return the index of the smallest number found between the nth and mth index in the array. If n >...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert findIndexOfMinimum([1.9, 2.9, 3.4, 3.5, 0.9, 1.2], 3, 5) == 4\", \"assert findIndexOfMinimum([0.1, 0.2, 0.3, 0.4], 0, 3) == 0\", \"assert findIndexOfMinimum([-1.0, -2.0, -3.0, -4.0], 1, 3) == 3\", \"assert findIndexOfMinimum([5.5, 3.3, 1.1, 2.2], 0, 2) == 2\...
{ "split": "train", "index": 298, "acecode_id": "evol_9816", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string containing a series of characters, write a function that finds the longest substring of consecutive, non-repeating characters within the given string. If there are multiple substrings with the same length, return the first one found. If there are no non-repeating...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longestNonRepeatingSubstring('abcaabbcbb') == 'abc'\", \"assert longestNonRepeatingSubstring('abcdefg') == 'abcdefg'\", \"assert longestNonRepeatingSubstring('') == ''\", \"assert longestNonRepeatingSubstring('abcde') == 'abcde'\", \"assert longestNonRepeati...
{ "split": "train", "index": 299, "acecode_id": "oss_9925", "num_tests": 16 }