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 processing a list of database names to generate a corresponding file path for a network kernel. Write a function `get_kernel_file_path(database: List[str], kernel_method: str, filter_network_omic: Optional[List[str]]) -> str` that takes in three parameters: ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_kernel_file_path(['KEGG', 'InvalidDB'], 'some_kernel_method', None) == 'path/to/kernel/for_kegg.pickle'\", \"assert get_kernel_file_path(['invalid_database'], 'some_kernel_method', None) == 'No valid kernel path found'\", \"assert get_kernel_file_path(['... | {
"split": "train",
"index": 1800,
"acecode_id": "bigcode_python_fns_31080",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes morphological features of words represented as a string. The function should take a string input that contains morphological features in the format 'key1=value1|key2=value2|...|keyN=valueN'. The function should then ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_morphological_features('gender=masculine|number=plural', ['gender', 'number']) == 'masculine+plural'\", \"assert extract_morphological_features('gender=masculine|number=plural', ['gender', 'tense']) == 'masculine+-'\", \"assert extract_morphological_... | {
"split": "train",
"index": 1801,
"acecode_id": "oss_6127",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `sort_items_based_on_length(input_list, order='ASC')` that sorts a list of strings based on the length of each string. The function should take two parameters: `input_list`, which is a list of strings, and `order`, which is a string that specifies the sorti... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_items_based_on_length(['kiwi', 'apple', 'banana'], 'DESC') == ['banana', 'apple', 'kiwi']\", \"assert sort_items_based_on_length(['short', 'tiny', 'longer'], 'ASC') == ['tiny', 'short', 'longer']\", \"assert sort_items_based_on_length(['a', 'ab', 'abc']... | {
"split": "train",
"index": 1802,
"acecode_id": "evol_26081",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing monthly passenger counts for a year, implement a function `predict_passenger_count` that predicts the passenger count for the next year using a simple linear regression model. The function should take a list of integers as input and return ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert predict_passenger_count([200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750]) == 800\", \"assert predict_passenger_count([120, 130, 140, 150, 160, 170, 180, 190, 200, 210, 220, 230]) == 240\", \"assert predict_passenger_count([100, 150, 200, 250, 300... | {
"split": "train",
"index": 1803,
"acecode_id": "evol_26336",
"num_tests": 7
} |
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 numbers from the original list, maintaining the original order. Implement the function `filter_even_numbers(numbers: List[int]) -> List[int]` where `numb... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 13, 15, 20, 22]) == [10, 20, 22]\", \"assert filter_even_numbers([1, 3, 5]) == []\", \"assert filter_even_numbers([]) == []\", \"assert filter_even_numbers([2, 4, 6, 8]) == [... | {
"split": "train",
"index": 1804,
"acecode_id": "oss_27480",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes in two lists of integers, `list1` and `list2`, and returns a dictionary containing the following information: 1) 'sum': the sum of all integers in both lists, 2) 'average': the average of all integers in both lists, 3) 'max': t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_info([1, 2, 3], [4, 5, 6]) == {'sum': 21, 'average': 3.5, 'max': 6, 'min': 1}\", \"assert calculate_info([], []) == {'sum': 0, 'average': None, 'max': None, 'min': None}\", \"assert calculate_info([-1, -2, -3], [1, 2, 3]) == {'sum': 0, 'average': 0... | {
"split": "train",
"index": 1805,
"acecode_id": "bigcode_python_fns_28466",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that converts a string representation of a boolean value into a Python boolean type. The function should handle the following cases: If the input string is 'True' (case insensitive), it should return True. If the input string is 'Fals... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert str_to_bool('True') == True\", \"assert str_to_bool('true') == True\", \"assert str_to_bool('False') == False\", \"assert str_to_bool('false') == False\", \"assert str_to_bool(None) == None\", \"assert str_to_bool('TrUe') == True\", \"assert str_to_bool('FAL... | {
"split": "train",
"index": 1806,
"acecode_id": "bigcode_python_fns_36332",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple banking account system. Create a function `manage_accounts(actions: List[Tuple[str, str, float]]) -> List[float]` where `actions` is a list of tuples that represent various transactions on two types of accounts: 'Savings' and 'Checking'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_accounts([('Savings', 'add_interest', 5)]) == [1050.0, 500.0]\", \"assert manage_accounts([('Savings', 'deposit', 200), ('Savings', 'withdraw', 50)]) == [1150.0, 500.0]\", \"assert manage_accounts([('Checking', 'deduct_fees', 20)]) == [1000.0, 480.0]\... | {
"split": "train",
"index": 1807,
"acecode_id": "oss_30577",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the behavior of a command-line application configuration command. The function `get_config()` should return a string that represents the current configuration of the application. Specifically, it should return the strin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_config() == 'Database path: None'\", \"assert get_config() == 'Database path: None'\", \"assert get_config() == 'Database path: None'\", \"assert get_config() == 'Database path: None'\", \"assert get_config() == 'Database path: None'\", \"assert get_conf... | {
"split": "train",
"index": 1808,
"acecode_id": "bigcode_python_fns_48311",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a floating-point number representing the radius of a circle, write a function `calculate_circle_properties(radius: float) -> Tuple[str, str]` that calculates the circumference and area of the circle. The function should return a tuple containing two strings formatted as f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_circle_properties(1.0) == ('Circumference: 6.283185307179586', 'Area: 3.141592653589793')\", \"assert calculate_circle_properties(0.0) == ('Circumference: 0.0', 'Area: 0.0')\", \"assert calculate_circle_properties(3.0) == ('Circumference: 18.849555... | {
"split": "train",
"index": 1809,
"acecode_id": "oss_18951",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given an original tensor name as a string. Your task is to implement a function that maps this original tensor name to a new tensor name based on a predefined mapping. If the original tensor name matches a key in the global tensor map, return the corresponding value. If... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert map_tensor_name('model/wte') == 'word_embedder/w'\", \"assert map_tensor_name('model/wpe') == 'position_embedder/w'\", \"assert map_tensor_name('ln_3/b') == 'ln_3/b'\", \"assert map_tensor_name('other_tensor') == 'other_tensor'\", \"assert map_tensor_name('l... | {
"split": "train",
"index": 1810,
"acecode_id": "bigcode_python_fns_8302",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D grid representing seats in a classroom where '#' indicates an occupied seat and '.' indicates an empty seat. You are also given a list of distractions represented as coordinates (i, j) in the grid. Your task is to implement a function `makeStudents(seats: Lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert makeStudents([['.','.','#'],['.','.','.'],['#','.','#']], [(0, 1)]) == 2\", \"assert makeStudents([['#','#','#'],['#','#','#'],['#','#','#']], []) == 0\", \"assert makeStudents([['#','#','.'],['.','.','#'],['#','#','#']], [(1, 0)]) == 1\", \"assert makeStude... | {
"split": "train",
"index": 1811,
"acecode_id": "evol_14824",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program to calculate the speeding fine for a car that exceeds the permitted speed limit. The speed limit is 80 km/h, and for every km/h over the limit, the fine is R$7. Write a Python function `calculate_fine(speed)` that takes an integer `speed` ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_fine(90) == 'R$70'\", \"assert calculate_fine(100) == 'R$140'\", \"assert calculate_fine(80) == 'No fine'\", \"assert calculate_fine(75) == 'No fine'\", \"assert calculate_fine(85) == 'R$35'\", \"assert calculate_fine(110) == 'R$210'\", \"assert ca... | {
"split": "train",
"index": 1812,
"acecode_id": "oss_27566",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of tasks, where each task is represented as a dictionary containing input data and a log. Each task has an input key and an output key. Your goal is to process each task by performing a simulated inference operation on its input data and recording the time ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_tasks([{'input_data': 1}, {'input_data': 2}], 'input_data', 'output_data') == [{'input_data': 1, 'output_data': 2, 'log': {'timer': {'process_time': 0.5}, 'compute_device': 'CPU'}}, {'input_data': 2, 'output_data': 4, 'log': {'timer': {'process_time'... | {
"split": "train",
"index": 1813,
"acecode_id": "bigcode_python_fns_7219",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that sorts an array of integers using the Bubble Sort algorithm. The function should take a list of integers as input and return the sorted list. The Bubble Sort algorithm repeatedly steps through the list, compares adjacent elements and swaps them if they ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bubble_sort([2, 5, 7, 6, 1, 4]) == [1, 2, 4, 5, 6, 7]\", \"assert bubble_sort([3, 3, 2, 1, 4]) == [1, 2, 3, 3, 4]\", \"assert bubble_sort([5, 4, 3, 2, 1]) == [1, 2, 3, 4, 5]\", \"assert bubble_sort([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert bubble_sort(... | {
"split": "train",
"index": 1814,
"acecode_id": "evol_21047",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `get_aqi_category(aqi_value)` that takes an integer `aqi_value` as input and returns the corresponding Air Quality Index (AQI) description based on the following ranges: 0-50 is 'Good', 51-100 is 'Moderate', 101-150 is 'Unhealthy for Sens... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_aqi_category(0) == 'Good'\", \"assert get_aqi_category(25) == 'Good'\", \"assert get_aqi_category(50) == 'Good'\", \"assert get_aqi_category(51) == 'Moderate'\", \"assert get_aqi_category(75) == 'Moderate'\", \"assert get_aqi_category(100) == 'Moderate'\... | {
"split": "train",
"index": 1815,
"acecode_id": "oss_31344",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple function that simulates a cache mechanism with time-to-live (TTL) functionality. The function should accept three parameters: a list of operations, a key, a value, and a TTL (time-to-live in seconds). The operations can be 'set', 'get', or ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cache_operations([('set', 'a', 1, 'value1'), ('get', 'a'), ('set', 'b', 2, 'value2'), ('get', 'b'), ('delete', 'a'), ('get', 'a')]) == ['value1', 'value2', None]\", \"assert cache_operations([('set', 'a', 1, 'value1'), ('set', 'a', 1, 'value2'), ('get', 'a')... | {
"split": "train",
"index": 1816,
"acecode_id": "oss_19548",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program that simulates a simple security system. The system requires users to input a specific code, which is a 3-digit integer. The system will subtract 543 from the input code to verify its correctness. If the result is 0, the system will return... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_access(108) == 'Access Denied'\", \"assert check_access(543) == 'Access Granted'\", \"assert check_access(500) == 'Access Denied'\", \"assert check_access(100) == 'Access Denied'\", \"assert check_access(600) == 'Access Denied'\", \"assert check_access... | {
"split": "train",
"index": 1817,
"acecode_id": "oss_20240",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string that represents a Base64 encoded value. Your task is to implement a function `decode_base64_string(value: str) -> bytes` that decodes the Base64 encoded string. The input string may not be properly padded with '=' characters, and your function should corr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decode_base64_string('SGVsbG8gV29ybGQ=') == b'Hello World'\", \"assert decode_base64_string('SGVsbG8gV29ybGQ') == b'Hello World'\", \"assert decode_base64_string('U29tZSBzdHJpbmc=') == b'Some string'\", \"assert decode_base64_string('U29tZSBzdHJpbmc') == b'S... | {
"split": "train",
"index": 1818,
"acecode_id": "bigcode_python_fns_8487",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that determines the hinting status of a specified script from a given font. The function should take in two parameters: `font_name` (a string representing the name of the font) and `script` (a string representing the script type). If the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hinting_status('Arial', 'latin') == 'hinted-latin'\", \"assert hinting_status('Arial', 'cyrillic') == 'hinted-cyrillic'\", \"assert hinting_status('Arial', 'greek') == 'hinted-greek'\", \"assert hinting_status('Arial', 'arabic') == 'not-hinted'\", \"assert h... | {
"split": "train",
"index": 1819,
"acecode_id": "bigcode_python_fns_36202",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of unique strings, implement a function that finds the longest common prefix substring shared among all the strings in the array. The prefix substring should only consist of alphabetic characters. If there is no common prefix, return an empty string.\nPlease reas... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longest_common_prefix(['apple', 'apricot', 'ape']) == 'ap'\", \"assert longest_common_prefix(['banana', 'band', 'bang']) == 'ban'\", \"assert longest_common_prefix(['car', 'card', 'carpet']) == 'car'\", \"assert longest_common_prefix(['dog', 'cat', 'fish']) ... | {
"split": "train",
"index": 1820,
"acecode_id": "evol_27851",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function `convert_string_to_integer` that takes a string as input and converts it into an integer. If the string is not a valid representation of an integer, the function should return an error message indicating that the conversion failed.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_string_to_integer('42') == 42\", \"assert convert_string_to_integer('-42') == -42\", \"assert convert_string_to_integer(' 42 ') == 42\", \"assert convert_string_to_integer(' -42 ') == -42\", \"assert convert_string_to_integer('0') == 0\", \"a... | {
"split": "train",
"index": 1821,
"acecode_id": "oss_19796",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a filename for a regridder based on the given input and output grid resolutions and extents. The function should take the following parameters: \n\n- `llres_in` (str): The resolution of the input grid in the format 'latxlon... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_filename('4x5', '4x5') == 'conservative_4x5_4x5.nc'\", \"assert generate_filename('4x5', '4x5', weightsdir='weights') == 'weights/conservative_4x5_4x5.nc'\", \"assert generate_filename('4x5', '4x5', in_extent=[-180, 180, -90, 90], out_extent=[-180, ... | {
"split": "train",
"index": 1822,
"acecode_id": "bigcode_python_fns_41464",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement the function 'count_valid_numbers' that takes an array of integers as input. The function should return the count of elements in the input array that satisfy the following condition: the sum of their individual digits, considering the leading digit as negative if the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_valid_numbers([]) == 0\", \"assert count_valid_numbers([1, 1, 2]) == 0\", \"assert count_valid_numbers([-4, 8, -12]) == 1\", \"assert count_valid_numbers([-2, -6]) == 0\", \"assert count_valid_numbers([4, 8, 12]) == 2\", \"assert count_valid_numbers([1... | {
"split": "train",
"index": 1823,
"acecode_id": "evol_16414",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a given text and counts the occurrences of specific words within it. Your function should take a string of text and a list of words as inputs. It should return a dictionary containing the counts of each word in the t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_word_occurrences('Hello world! Hello Python. Python is great.', ['hello', 'world', 'python']) == {'hello': 2, 'world': 1, 'python': 2}\", \"assert count_word_occurrences('Python is fun. I love python programming.', ['python', 'fun', 'love']) == {'pytho... | {
"split": "train",
"index": 1824,
"acecode_id": "oss_35439",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the behavior of a REST API endpoint that processes POST requests. The function should accept a request dictionary containing a 'path' key, a 'slug' key, and an 'auth_user' key. The function should return a specific HTTP... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_request({'path': '/your-api-endpoint/', 'slug': 'valid-slug', 'auth_user': 'user1'}) == 200\", \"assert process_request({'path': '/your-api-endpoint/', 'slug': '', 'auth_user': 'user1'}) == 400\", \"assert process_request({'path': '/invalid-endpoint/... | {
"split": "train",
"index": 1825,
"acecode_id": "oss_22743",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two positive integers `a` and `b`, and a positive odd integer `mod`. Your task is to compute the result of the operation (a * b) % mod using modular arithmetic. Implement a function `modular_multiplication(a: int, b: int, mod: int) -> int` that returns the result ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert modular_multiplication(3, 4, 5) == 2\", \"assert modular_multiplication(1, 1, 3) == 1\", \"assert modular_multiplication(7, 3, 11) == 10\", \"assert modular_multiplication(9, 2, 13) == 5\", \"assert modular_multiplication(15, 16, 19) == 12\", \"assert modula... | {
"split": "train",
"index": 1826,
"acecode_id": "bigcode_python_fns_48961",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of integers and returns a new list containing only the unique integers from the original list, preserving the order of their first appearance. For example, given the input list [1, 2, 3, 2, 1, 4], the output should be [1... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_integers([1, 2, 3, 2, 1, 4]) == [1, 2, 3, 4]\", \"assert unique_integers([5, 5, 5, 5]) == [5]\", \"assert unique_integers([]) == []\", \"assert unique_integers([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert unique_integers([1, 1, 2, 3, 3, 2, 1]) == [... | {
"split": "train",
"index": 1827,
"acecode_id": "oss_382",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `factorize(n: int) -> dict` that takes an integer n as input and returns a dictionary containing the prime factorization of n. The keys of the dictionary should be the prime factors, and the values should be their respective counts in the factorization. If ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert factorize(28) == {2: 2, 7: 1}\", \"assert factorize(100) == {2: 2, 5: 2}\", \"assert factorize(1) == {}\", \"assert factorize(37) == {37: 1}\", \"assert factorize(44) == {2: 2, 11: 1}\", \"assert factorize(60) == {2: 2, 3: 1, 5: 1}\", \"assert factorize(101)... | {
"split": "train",
"index": 1828,
"acecode_id": "evol_12752",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of computer models, each represented as a dictionary with an 'id' and a 'model' name. Write a function that takes this list and returns a new list of models that contain the substring 'foo' in their model name. The function should ignore the case of the sub... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_computers([{'id': 1, 'model': 'foo'}, {'id': 2, 'model': 'bar'}, {'id': 3, 'model': 'foobar'}]) == [{'id': 1, 'model': 'foo'}, {'id': 3, 'model': 'foobar'}]\", \"assert filter_computers([{'id': 4, 'model': 'FOO'}, {'id': 5, 'model': 'baz'}, {'id': 6, ... | {
"split": "train",
"index": 1829,
"acecode_id": "bigcode_python_fns_5794",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a URL, implement a function `check_url` that returns `True` if the URL is valid and uses secure HTTPS communication. Otherwise, return `False`. A URL is considered valid if it is properly formatted, and it must start with 'https://'. You do not need ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_url('https://www.example.com') == True\", \"assert check_url('http://www.example.com') == False\", \"assert check_url('https://example') == False\", \"assert check_url('ftp://www.example.com') == False\", \"assert check_url('https://example.com/path?qu... | {
"split": "train",
"index": 1830,
"acecode_id": "evol_14579",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `process_matrix(matrix)` that takes a matrix (a list of lists) as input and processes each element using the `process_element` function. The `process_element` function should return 0 if the element is None, return None if the element is not a number (integ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_matrix([[1, 2, 3], [4, 5, 6]]) == [[1, 4, 9], [16, 25, 36]]\", \"assert process_matrix([[None, 2, 3], [4, None, 6]]) == [[0, 4, 9], [16, 0, 36]]\", \"assert process_matrix([[1.5, 2.5], [3.5, 4.5]]) == [[2.25, 6.25], [12.25, 20.25]]\", \"assert proces... | {
"split": "train",
"index": 1831,
"acecode_id": "evol_2176",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing test run IDs, where each ID is a positive integer. Your task is to implement a function `get_test_ids(run_ids: List[int]) -> List[int]` that returns a list of test IDs corresponding to the provided run IDs. For this problem, assume ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_test_ids([1, 2, 3]) == [10, 20, 30]\", \"assert get_test_ids([0]) == [0]\", \"assert get_test_ids([5]) == [50]\", \"assert get_test_ids([10, 20]) == [100, 200]\", \"assert get_test_ids([15, 25, 35]) == [150, 250, 350]\", \"assert get_test_ids([]) == []\"... | {
"split": "train",
"index": 1832,
"acecode_id": "bigcode_python_fns_11752",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a list of exactly 7 integers and returns the smallest even number from the list. If there are no even numbers, return a message stating 'No even number found.'\nPlease reason step by step, then write a self-contained Python solution. Give your final ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert smallest_even_num([81, 22, 39, 4, 58, 71, 33]) == 4\", \"assert smallest_even_num([10, 12, 5, 7, 3, 2, 8]) == 2\", \"assert smallest_even_num([1, 3, 5, 7, 9, 11, 13]) == 'No even number found.'\", \"assert smallest_even_num([6, 1, 3, 5, 9, 8, 2]) == 2\", \"a... | {
"split": "train",
"index": 1833,
"acecode_id": "evol_9651",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that sorts a list using an optimized version of bubble sort. The optimized bubble sort should track whether any swaps were made during the inner loop. If no swaps were made, the algorithm should terminate early, indicating that the list is already sorted. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bubble_sort([5, 2, 9, 1, 5, 6]) == [1, 2, 5, 5, 6, 9]\", \"assert bubble_sort([3, 0, 2, 5, -1, 4, 1]) == [-1, 0, 1, 2, 3, 4, 5]\", \"assert bubble_sort([1]) == [1]\", \"assert bubble_sort([]) == []\", \"assert bubble_sort([4, 3, 2, 1]) == [1, 2, 3, 4]\", \"a... | {
"split": "train",
"index": 1834,
"acecode_id": "evol_7816",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `greet(name: str) -> str` that takes a string `name` as input and returns a greeting message in the format 'Hello, {name}'.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block."
}
... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert greet('John') == 'Hello, John'\", \"assert greet('Alice') == 'Hello, Alice'\", \"assert greet('Bob') == 'Hello, Bob'\", \"assert greet('Charlie') == 'Hello, Charlie'\", \"assert greet('Diana') == 'Hello, Diana'\", \"assert greet('Eve') == 'Hello, Eve'\", \"a... | {
"split": "train",
"index": 1835,
"acecode_id": "evol_14831",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that checks if a given phrase is a pangram. A pangram is a sentence that uses every letter of the English alphabet at least once. The function should return True if the phrase is a pangram and False along with a list of missing letters if it is not. The che... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_pangram('The quick brown fox jumps over the lazy dog') == True\", \"assert is_pangram('Pack my box with five dozen liquor jugs') == True\", \"assert is_pangram('Sphinx of black quartz, judge my vow') == True\", \"assert is_pangram('The five boxing wizards... | {
"split": "train",
"index": 1836,
"acecode_id": "evol_21156",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that executes a specific detection method based on a provided method name. Implement a function called `execute_detection_method` that takes two parameters: 1. `method_name` (string): The name of the detection method to be executed. 2. `in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert execute_detection_method('TechDetectionMethod', 'some input') == 'Technology Detected'\", \"assert execute_detection_method('TechDetectionMethod', 'another input') == 'Technology Detected'\", \"assert execute_detection_method('TieredDetectionMethod', 'input ... | {
"split": "train",
"index": 1837,
"acecode_id": "oss_36482",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of tweet objects, where each tweet has a 'polarity' attribute that is a float. Your task is to implement a function called 'order_tweets_by_polarity' that sorts the list of tweets based on their polarity values. The function should take two parameters: a li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert order_tweets_by_polarity([{'polarity': 0.7}, {'polarity': 0.3}, {'polarity': 0.5}], True) == [{'polarity': 0.7}, {'polarity': 0.5}, {'polarity': 0.3}]\", \"assert order_tweets_by_polarity([{'polarity': 0.7}, {'polarity': 0.3}, {'polarity': 0.5}], False) == [... | {
"split": "train",
"index": 1838,
"acecode_id": "bigcode_python_fns_33100",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two sentences, determine if they contain the same set of distinct words, regardless of the capitalization and any non-alphabetical characters. Implement a function `check_word_identity_and_capitalization(sentence1: str, sentence2: str) -> bool` that returns True if both s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_word_identity_and_capitalization('apPle!', 'apple') == True\", \"assert check_word_identity_and_capitalization('BaNaR& Apple', 'apple banana') == False\", \"assert check_word_identity_and_capitalization('Hello World', 'world hello') == True\", \"assert... | {
"split": "train",
"index": 1839,
"acecode_id": "evol_7116",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of machines, where each machine has the following attributes: 'remark', 'machine_name', and 'reson_str'. You need to implement a function called `update_machine` that takes three parameters: a list of dictionaries representing machines, a string `name` indi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_machine([{'remark': 'Old Remark', 'machine_name': 'Machine A', 'reson_str': 'Reason 1'}], 'remark', 'New Remark') == [{'remark': 'New Remark', 'machine_name': 'Machine A', 'reson_str': 'Reason 1'}]\", \"assert update_machine([{'remark': 'Old Remark', ... | {
"split": "train",
"index": 1840,
"acecode_id": "bigcode_python_fns_13833",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two integers, start and end, return a list of all integers from start to end (inclusive) and the count of how many integers are in that range. Write a function `range_and_count(start: int, end: int) -> Tuple[List[int], int]` that takes two parameters: start and end. The f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert range_and_count(11031103, 11031130) == ([11031103, 11031104, 11031105, 11031106, 11031107, 11031108, 11031109, 11031110, 11031111, 11031112, 11031113, 11031114, 11031115, 11031116, 11031117, 11031118, 11031119, 11031120, 11031121, 11031122, 11031123, 1103112... | {
"split": "train",
"index": 1841,
"acecode_id": "bigcode_python_fns_29733",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a string as input and returns a new string that consists of the original string repeated three times, separated by spaces. If the input string is empty, the function should return an empty string. Write a function called `repea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert repeat_string('hello') == 'hello hello hello'\", \"assert repeat_string('') == ''\", \"assert repeat_string('A') == 'A A A'\", \"assert repeat_string('Python') == 'Python Python Python'\", \"assert repeat_string('LeetCode') == 'LeetCode LeetCode LeetCode'\",... | {
"split": "train",
"index": 1842,
"acecode_id": "oss_3791",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function to determine if a user has permission to access a specific object based on ownership and the type of request being made. The function, `has_object_permission`, should take three parameters: `request`, `view`, and `obj`. The `request` is a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_object_permission({'user': 'user1', 'method': 'GET'}, None, {'owner': 'user2'}) == True\", \"assert has_object_permission({'user': 'user1', 'method': 'HEAD'}, None, {'owner': 'user2'}) == True\", \"assert has_object_permission({'user': 'user1', 'method':... | {
"split": "train",
"index": 1843,
"acecode_id": "oss_2997",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that processes a list of integers. The function should remove all duplicate elements from the list and sort the remaining elements in ascending order. You need to implement the function `process_list(arr)` which takes the following paramet... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_list([3, 1, 2, 3, 1]) == [1, 2, 3]\", \"assert process_list([5, 5, 5, 5]) == [5]\", \"assert process_list([-1, -2, -2, 0, 1]) == [-2, -1, 0, 1]\", \"assert process_list([]) == []\", \"assert process_list([10, 20, 20, 10, 30, 30]) == [10, 20, 30]\", \... | {
"split": "train",
"index": 1844,
"acecode_id": "oss_3685",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates adding a record to a queue. The function should accept a variable number of keyword arguments representing the fields of the queue record, but it must ensure that the 'request' field is present among the provided argume... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_to_queue(request='Task1', priority=1) == {'request': 'Task1', 'priority': 1}\", \"assert add_to_queue(request='Task2', user='Alice') == {'request': 'Task2', 'user': 'Alice'}\", \"assert add_to_queue(request='Task3') == {'request': 'Task3'}\", \"assert ad... | {
"split": "train",
"index": 1845,
"acecode_id": "bigcode_python_fns_30359",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an `m x n` binary matrix `mat` of `1`'s (representing soldiers) and `0`'s (representing civilians). The soldiers are positioned in front of the civilians, meaning that all the `1`'s will appear to the left of all the `0`'s in each row. A row `i` is weaker than a r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert kWeakestRows([[1,1,0,0,0], [1,1,1,1,0], [1,0,0,0,0], [1,1,0,0,0], [1,1,1,1,1]], 3) == [2,0,3]\", \"assert kWeakestRows([[1,0,0,0], [1,1,1,1], [1,0,0,0], [1,0,0,0]], 2) == [0,2]\", \"assert kWeakestRows([[1,1,1], [1,0,0], [0,0,0], [1,1,0]], 1) == [2]\", \"ass... | {
"split": "train",
"index": 1846,
"acecode_id": "evol_34221",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of error messages formatted as `file_path:line_number:column_number - error_message`. Your function should parse these error messages and return a list of dictionaries, where each dictionary contains the keys ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_error_messages(['src/main.py:10:15 - SyntaxError: invalid syntax']) == [{'file_path': 'source', 'line_number': 10, 'column_number': 15, 'error_message': 'SyntaxError: invalid syntax'}]\", \"assert process_error_messages(['src/app.py:1:1 - Indentation... | {
"split": "train",
"index": 1847,
"acecode_id": "oss_36308",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function `manage_diary(entries: List[Tuple[str, str]], operations: List[Tuple[str, str, str]]) -> Dict[str, str]` that simulates a diary management system. The `entries` parameter is a list of initial diary entries where each entry is represented as a tuple containi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_diary([('2023-01-01', 'New Year Celebration')], [('add', '2023-01-01', 'Updated Celebration')]) == {'2023-01-01': 'Updated Celebration'}\", \"assert manage_diary([('2023-01-01', 'New Year Celebration')], [('delete', '2023-01-02', 'No Entry')]) == {'20... | {
"split": "train",
"index": 1848,
"acecode_id": "evol_30620",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given the coordinates and dimensions of a bounding box around a detected object in an image. Your task is to calculate the center coordinates of the bounding box and determine the new width and height of a cropped region based on the maximum dimension of the bounding bo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert perform_image_processing(10, 20, 100, 200) == {'cx': 60.0, 'cy': 120.0, 'cw': 300.0, 'ch': 300.0}\", \"assert perform_image_processing(0, 0, 50, 50) == {'cx': 25.0, 'cy': 25.0, 'cw': 75.0, 'ch': 75.0}\", \"assert perform_image_processing(5, 5, 10, 30) == {'c... | {
"split": "train",
"index": 1849,
"acecode_id": "oss_15577",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that extracts the migration number and filename from a given file path. The migration number is a numeric identifier found within the file path, and the filename is the last part of the path after the last forward slash ('/'). Writ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_migration_info('apps/organization/migrations/0017_merge.py') == ('0017', '0017_merge.py')\", \"assert extract_migration_info('apps/user/migrations/0020_add_column.py') == ('0020', '0020_add_column.py')\", \"assert extract_migration_info('apps/orders/... | {
"split": "train",
"index": 1850,
"acecode_id": "oss_7074",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of strings representing queries and returns a list of results based on a specific output format. The output format is determined by the first string in the input list. If the first string begins with 'list', the func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_queries('list', ['list', 'apple', 'banana', 'cherry']) == ['apple', 'banana', 'cherry']\", \"assert process_queries('uppercase', ['uppercase', 'apple', 'banana', 'cherry']) == ['APPLE', 'BANANA', 'CHERRY']\", \"assert process_queries('list', ['list',... | {
"split": "train",
"index": 1851,
"acecode_id": "bigcode_python_fns_35950",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that initializes K centroids for K-means clustering from a given dataset. Your function should randomly select K examples from the dataset and return them as the centroids. The function should satisfy the following requirements: \n\n1... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert kmeans_init_centroids([[0, 0], [1, 1], [2, 2]], 1) in [[[0, 0]], [[1, 1]], [[2, 2]]]\", \"assert kmeans_init_centroids([[1]], 1) == [[1]]\", \"assert kmeans_init_centroids([[1, 2], [2, 3], [3, 4], [4, 5]], 1) in [[[1, 2]], [[2, 3]], [[3, 4]], [[4, 5]]]\", \"... | {
"split": "train",
"index": 1852,
"acecode_id": "bigcode_python_fns_2399",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given four integers a, b, c, and d, calculate the Kappa statistic using the formula: Kappa = 1 - (1 - po) / (1 - pe). Here, po is the proportion of observed agreement defined as po = (a + d) / (a + b + c + d), and pe is the proportion of expected agreement calculated by pe = (m... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert abs(kappa(0, 0, 0, 0) - 0.0) < 1e-9\", \"assert abs(kappa(1, 1, 1, 1) - 0.0) < 1e-9\", \"assert abs(kappa(1, 0, 0, 1) - 1.0) < 1e-9\", \"assert abs(kappa(10, 0, 0, 10) - 1.0) < 1e-9\", \"assert abs(kappa(5, 5, 5, 5) - 0.0) < 1e-9\", \"assert abs(kappa(50, 50... | {
"split": "train",
"index": 1853,
"acecode_id": "bigcode_python_fns_34486",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a Python function that checks if a given email address is valid based on a predefined format. The function should handle various types of erroneous inputs and return an appropriate error message for each. The validation should include checking for an invalid format an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_email('test@example.com') == 'Valid email'\", \"assert is_valid_email('user@domain.com') == 'Valid email'\", \"assert is_valid_email('user@domain.co.uk') == 'Valid email'\", \"assert is_valid_email('user@domain.corporate') == 'Valid email'\", \"asse... | {
"split": "train",
"index": 1854,
"acecode_id": "evol_2874",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a list of proposed column names for a spreadsheet, implement a function that converts them into valid column headers. The valid column headers must follow these rules: they should be all lowercase, contain no spaces or special characters (except for underscores which shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_column_headers(['Header One', 'header_one', 'header@two']) == ['headerone', 'headerone_1', 'headertwo']\", \"assert convert_to_column_headers(['Column Name', 'column name']) == ['columnname', 'columnname_1']\", \"assert convert_to_column_headers([... | {
"split": "train",
"index": 1855,
"acecode_id": "bigcode_python_fns_23601",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing a list of logged data from a molecular dynamics simulation program. Each entry in the logged data is a dictionary containing the following keys: 'i', 'j', 'dt', 'ist', 'd', 'rbe', 'pbe', 'xsp_e', 'xspl_e', 'ysp_e', and 'yspl_e'. Your job is to imp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_logs([{'i': 1, 'j': 2, 'dt': 0.1, 'ist': 5, 'd': 3, 'rbe': 0.5, 'pbe': 0.3, 'xsp_e': 10, 'xspl_e': 11, 'ysp_e': 12, 'yspl_e': 13}, {'i': 1, 'j': 3, 'dt': 0.2, 'ist': 6, 'd': 4, 'rbe': 0.6, 'pbe': 0.4, 'xsp_e': 20, 'xspl_e': 21, 'ysp_e': 22, 'yspl_e':... | {
"split": "train",
"index": 1856,
"acecode_id": "oss_24392",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks the compatibility of GPUs for a specific task. The function, `check_gpu_compatibility`, takes a list of GPU names as input and returns a list of compatible GPUs. A GPU is considered compatible if its name contains the substrin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_gpu_compatibility(['NVIDIA GeForce RTX 3080', 'AMD Radeon RX 6800', 'NVIDIA Tesla V100']) == ['NVIDIA GeForce RTX 3080', 'NVIDIA Tesla V100']\", \"assert check_gpu_compatibility(['Intel HD Graphics', 'NVIDIA GTX 1060', 'AMD Radeon']) == ['NVIDIA GTX 10... | {
"split": "train",
"index": 1857,
"acecode_id": "bigcode_python_fns_40349",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that searches for a target value in an unordered list of integers. The function should return the index of the target value if it is found in the list; otherwise, it should return -1. The function signature is as follows: `def search_in_unordered_list(arr: ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert search_in_unordered_list([3, 7, 5, 2, 1], 2) == 3\", \"assert search_in_unordered_list([3, 7, 5, 2, 1], 7) == 1\", \"assert search_in_unordered_list([3, 7, 5, 2, 1], 1) == 4\", \"assert search_in_unordered_list([3, 7, 5, 2, 1], 5) == 2\", \"assert search_in_... | {
"split": "train",
"index": 1858,
"acecode_id": "evol_24032",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates a summary of label data for geographical tiles. The tiles are represented by their zoom level and a bounding box defined by coordinates. Given a list of classes, each represented by a dictionary containing a class name ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_label_summary(5, [-10, -10, 10, 10], [{'name': 'water', 'filter': 'filter3'}], {'tile-1': [], 'tile-2': [], 'tile-3': [], 'tile-4': [], 'tile-5': []}) == {'total_tiles': 5, 'positive_examples': 0, 'negative_examples': 5, 'class_summary': [{'class_na... | {
"split": "train",
"index": 1859,
"acecode_id": "bigcode_python_fns_33252",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of Debian package names that need to be removed from a system. Implement a function `remove_packages(debs: List[str]) -> str` that simulates the removal process of these packages. The function should return a message indicating the packages that have been r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_packages(['package1', 'package2']) == 'Removing packages: package1, package2. Cleanup completed.'\", \"assert remove_packages(['packageA']) == 'Removing packages: packageA. Cleanup completed.'\", \"assert remove_packages([]) == 'No packages to remove.... | {
"split": "train",
"index": 1860,
"acecode_id": "bigcode_python_fns_20750",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_database()` that creates an SQLite database in memory. The database should contain two tables: `Students` and `Courses`. The `Students` table should have `id`, `name`, and `course_id` as columns, where `course_id` is a foreign key referencing the `i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_database() is not None\", \"assert isinstance(create_database().cursor(), sqlite3.Cursor)\", \"assert create_database().execute(\\\"SELECT name FROM sqlite_master WHERE type='table' AND name='Students'\\\").fetchone() is not None\", \"assert create_da... | {
"split": "train",
"index": 1861,
"acecode_id": "evol_17125",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of numbers representing the heights of students in a class. Your task is to write a function that returns a new list containing the heights of the students who are taller than the average height of the class. Implement the function `filter_taller_than_avera... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_taller_than_average([150, 150, 150]) == []\", \"assert filter_taller_than_average([50, 50, 50, 51]) == [51]\", \"assert filter_taller_than_average([1, 2, 3, 4, 5]) == [4, 5]\", \"assert filter_taller_than_average([10, 20, 30, 40, 50, 60]) == [40, 50, ... | {
"split": "train",
"index": 1862,
"acecode_id": "bigcode_python_fns_70",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a logging utility for an application that tracks changes made to its configuration settings. Write a function `log_config_change(setting_name: str, value: Any) -> str` that takes a string `setting_name` and a value `value`, and returns a formatted l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_config_change('theme', 'dark') == 'app configuration: theme changed to dark'\", \"assert log_config_change('volume', 75) == 'app configuration: volume changed to 75'\", \"assert log_config_change('notifications', True) == 'app configuration: notification... | {
"split": "train",
"index": 1863,
"acecode_id": "bigcode_python_fns_44248",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `find_missing_number(nums: List[int]) -> int` that returns the first missing positive integer from the list. The function should only consider positive integers and should return 1 if all positive integers from 1 to the length of the l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_missing_number([3, 4, -1, 1]) == 2\", \"assert find_missing_number([1, 2, 0]) == 3\", \"assert find_missing_number([]) == 1\", \"assert find_missing_number([7, 8, 9, 10]) == 1\", \"assert find_missing_number([1, 1, 1, 1]) == 2\", \"assert find_missing_n... | {
"split": "train",
"index": 1864,
"acecode_id": "bigcode_python_fns_49805",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function named 'max_min_diff' that takes a list of integers as input and returns the difference between the largest and smallest integers in that list. If the input is not a list or contains any non-integer values, the function should raise a 'ValueError'.\nPlease r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_min_diff([1, 2, 3, 4, 5]) == 4\", \"assert max_min_diff([-1, -2, -3, -4, -5]) == 4\", \"assert max_min_diff([10, 20, 30, 40]) == 30\", \"assert max_min_diff([5]) == 0\", \"assert max_min_diff([0, 0, 0]) == 0\", \"assert max_min_diff([-10, 0, 10]) == 20\"... | {
"split": "train",
"index": 1865,
"acecode_id": "evol_26730",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a given string represents a valid framework path. A valid framework path must end with the substring '.framework'. If the path does not end with this substring, the function should append it and return the modified path. If... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_framework_path('Python') == 'Python.framework'\", \"assert validate_framework_path('Python.framework') == 'Python.framework'\", \"assert validate_framework_path('Python.Framework') == 'Python.Framework'\", \"assert validate_framework_path('MyFramewo... | {
"split": "train",
"index": 1866,
"acecode_id": "bigcode_python_fns_29878",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, calculate the sum of the elements at even indices and the sum of the elements at odd indices. Return the difference between the two sums. The input array will have at least one element and at most 100 elements. Implement a function `sum_difference(ar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_difference([1]) == 1\", \"assert sum_difference([1, 2]) == -1\", \"assert sum_difference([-1, -2, -3, -4]) == 2\", \"assert sum_difference([0, 0, 0, 0]) == 0\", \"assert sum_difference([1, 1, 1, 1, 1, 1]) == 0\", \"assert sum_difference([1, 1, 1, 1, 2, 2... | {
"split": "train",
"index": 1867,
"acecode_id": "bigcode_python_fns_21251",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a function `analyze_string(s)` that takes a string as input and analyzes its contents. If the string contains a comma (',') or a colon (':'), return a list of words separated by commas. If neither of these exists in the string, return a tuple containing the count of l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_string('Hello, world!') == ['Hello', 'world!']\", \"assert analyze_string('Hello:world!') == ['Hello', 'world!']\", \"assert analyze_string('abc:def') == ['abc', 'def']\", \"assert analyze_string('Another:example') == ['Another', 'example']\", \"asse... | {
"split": "train",
"index": 1868,
"acecode_id": "evol_15065",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of categories, each represented as a dictionary containing a 'title' and a 'slug', and returns a list of formatted strings. Each formatted string should be in the format 'Title: <title>, Slug: <slug>'. Your function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_categories([]) == []\", \"assert format_categories([{'title': 'App', 'slug': 'app'}]) == ['Title: App, Slug: app']\", \"assert format_categories([{'title': 'Blog', 'slug': 'blog'}, {'title': 'News', 'slug': 'news'}]) == ['Title: Blog, Slug: blog', 'Ti... | {
"split": "train",
"index": 1869,
"acecode_id": "oss_26555",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks whether a user is authorized to access a resource based on specific conditions. The function `is_user_authorized(method: str, god: Optional[str], god_id: Optional[str]) -> str` should return 'Access granted' if the `method... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_user_authorized('bearer', 'some_god', None) == 'Access granted'\", \"assert is_user_authorized('bearer', None, 'some_id') == 'Access granted'\", \"assert is_user_authorized('bearer', None, None) == 'Access denied'\", \"assert is_user_authorized('basic', '... | {
"split": "train",
"index": 1870,
"acecode_id": "oss_33158",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string consisting of alphanumeric characters, implement a function that reverses the string and returns the new arrangement of characters. The function should take a single parameter, a string 's', and return the reversed string.\nPlease reason step by step, then write ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_string('hello') == 'olleh'\", \"assert reverse_string('world') == 'dlrow'\", \"assert reverse_string('12345') == '54321'\", \"assert reverse_string('abc123') == '321cba'\", \"assert reverse_string('!@#') == '#@!'\", \"assert reverse_string('') == ''\... | {
"split": "train",
"index": 1871,
"acecode_id": "evol_34561",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a system to manage scientific research papers. Each paper has specific attributes such as title, authors, publication date, and abstract. Your task is to implement a function `create_paper` that takes the following parameters: `title` (string), `aut... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_paper('A Great Paper', 'John Doe', '2023-10-01', 'This is an abstract.') == {'title': 'A Great Paper', 'authors': 'John Doe', 'publication_date': '2023-10-01', 'abstract': 'This is an abstract.'}\", \"assert create_paper('', 'John Doe', '2023-10-01', ... | {
"split": "train",
"index": 1872,
"acecode_id": "oss_35361",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two strings: 'gt_dir' and 'result_dir' which represent two directory paths in a filesystem. Your task is to write a function that evaluates whether the 'result_dir' contains at least 3 more files than the 'gt_dir'. Return True if it does, otherwise return False. A... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate_drivable('dir1', 'dir2') == False\", \"assert evaluate_drivable('dir1', 'dir12345') == True\", \"assert evaluate_drivable('file1', '') == False\", \"assert evaluate_drivable('file', 'files') == False\", \"assert evaluate_drivable('abc', 'abcdefgh') ... | {
"split": "train",
"index": 1873,
"acecode_id": "bigcode_python_fns_25096",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with optimizing a list of 3D model files to reduce their size while preserving their visual quality. Implement a function `optimize_models(model_files: List[Model]) -> List[Report]`, where `Model` is a class that contains information about the model, including it... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert optimize_models([Model(vertices=[1, 2, 3], polygons=[1, 2], size=100)]) == [Report(original_size=100, new_size=90, quality_impact='None')]\", \"assert optimize_models([Model(vertices=[1, 2, 2], polygons=[1, 1], size=200)]) == [Report(original_size=200, new_s... | {
"split": "train",
"index": 1874,
"acecode_id": "evol_11442",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given an integer n, return the first n numbers in the Fibonacci sequence in a list. The Fibonacci sequence is defined as follows: the first two numbers are 0 and 1, and each subsequent number is the sum of the two preceding ones. If n is less than 1, return an empty list.\nPlea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(1) == [0]\", \"assert fibonacci(2) == [0, 1]\", \"assert fibonacci(3) == [0, 1, 1]\", \"assert fibonacci(4) == [0, 1, 1, 2]\", \"assert fibonacci(5) == [0, 1, 1, 2, 3]\", \"assert fibonacci(6) == [0, 1, 1, 2, 3, 5]\", \"assert fibonacci(7) == [0, 1... | {
"split": "train",
"index": 1875,
"acecode_id": "bigcode_python_fns_30559",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a given string to extract and count the occurrences of all the unique words in the string. The function should ignore any punctuation marks and consider words in a case-insensitive manner. Write a Python function cal... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_words('The cat jumped over the cat') == {'the': 2, 'cat': 2, 'jumped': 1, 'over': 1}\", \"assert count_unique_words('Hello, world! Hello.') == {'hello': 2, 'world': 1}\", \"assert count_unique_words('Python is fun. Python is great!') == {'python... | {
"split": "train",
"index": 1876,
"acecode_id": "oss_21273",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries where each dictionary contains information about novels, including their titles, ratings, and authors. Write a function that filters the novels with a rating of 4.5 or higher and groups them by their authors. The output should be a dictionar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert group_highly_rated([{'title': 'To Kill a Mockingbird', 'rating': 4.5, 'author': 'Harper Lee'},{ 'title': '1984', 'rating': 4.3, 'author': 'George Orwell'},{ 'title': 'The Lord of the Rings', 'rating': 4.9, 'author': 'J.R.R. Tolkien'},{ 'title': 'Pride and Pr... | {
"split": "train",
"index": 1877,
"acecode_id": "evol_31893",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string 'text' and an integer 'width', implement a function that wraps the text such that each line has a maximum length of 'width' characters. The function should break lines at whitespace whenever possible, ensuring that no line exceeds the specified width. If a word i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert wrap('Hello world', 5) == 'Hello\\\\nworld'\", \"assert wrap('This is a simple test', 10) == 'This is a\\\\nsimple\\\\ntest'\", \"assert wrap('Python is awesome', 7) == 'Python\\\\nis\\\\nawesome'\", \"assert wrap('Line wrapping', 15) == 'Line wrapping'\", \... | {
"split": "train",
"index": 1878,
"acecode_id": "bigcode_python_fns_8263",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a list of edges in a graph and a specific transport GUID, implement a function that returns a list of edges that match the transport GUID. Each edge is represented as a dictionary containing a 'con_type' key. The function should filter the edges based on whether their 'co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_edges([{'con_type': 'A'}, {'con_type': 'B'}, {'con_type': 'A'}], 'A') == [{'con_type': 'A'}, {'con_type': 'A'}]\", \"assert filter_edges([{'con_type': 'A'}, {'con_type': 'B'}, {'con_type': 'C'}], 'D') == []\", \"assert filter_edges([], 'A') == []\", \... | {
"split": "train",
"index": 1879,
"acecode_id": "bigcode_python_fns_47644",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of configuration settings where each setting is represented as a string in the format 'key=value'. Write a function `parse_configurations(configurations: List[str]) -> Dict[str, str]` that takes a list of these configuration settings and returns a dictionar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_configurations(['host=localhost', 'port=8080', 'host=127.0.0.1']) == {'host': '127.0.0.1', 'port': '8080'}\", \"assert parse_configurations(['user=admin', 'password=secret', 'user=root']) == {'user': 'root', 'password': 'secret'}\", \"assert parse_conf... | {
"split": "train",
"index": 1880,
"acecode_id": "bigcode_python_fns_4803",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that updates a baseline value based on a list of sample log probabilities. The baseline value starts at 0.0. Your goal is to create a function `update_baseline(sample_log_probs: List[float]) -> float` that takes a list of floating-poi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_baseline([1.0, 2.0, 3.0]) == -2.0\", \"assert update_baseline([4.0, 5.0, 6.0]) == -5.0\", \"assert update_baseline([0.0]) == 0.0\", \"assert update_baseline([]) == 0.0\", \"assert update_baseline([10.0, 20.0]) == -15.0\", \"assert update_baseline([1.5... | {
"split": "train",
"index": 1881,
"acecode_id": "oss_25249",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_command(task_uuid: str, request: str, broker_point: str, reply_to: str = None) -> tuple` that generates a command tuple for publishing a request to a customer. The command tuple should consist of a command type string and a dictionary containing the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_command('12345', 'request_data', 'broker1', 'reply1') == ('BROKER_TASK_SEND', {'task_uuid': '12345', 'request': 'request_data', 'broker_point': 'broker1', 'reply_to': 'reply1'})\", \"assert create_command('abcde', 'another_request', 'broker2') == ('BR... | {
"split": "train",
"index": 1882,
"acecode_id": "bigcode_python_fns_686",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `mu(n: int) -> int` that calculates the value of the Moebius function for a given integer n. The Moebius function is defined as follows: \n- If n = 1, return 1. \n- If n has a squared prime factor, return 0. \n- If n is a product of an even number of dis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert mu(1) == 1\", \"assert mu(3) == -1\", \"assert mu(4) == 0\", \"assert mu(5) == -1\", \"assert mu(6) == -1\", \"assert mu(7) == -1\", \"assert mu(8) == 0\", \"assert mu(9) == 0\", \"assert mu(10) == -1\", \"assert mu(11) == -1\", \"assert mu(12) == 0\", \"ass... | {
"split": "train",
"index": 1883,
"acecode_id": "bigcode_python_fns_38306",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates adding an entity to a watchlist. The function should take a watchlist name, an entity type, an entity name, and an optional expiry duration in days (defaulting to 30 if not provided). The function should return a message in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_entity_to_watchlist('Personal', 'User', 'Alice') == 'Added successfully the entity Alice to the watchlist Personal.'\", \"assert add_entity_to_watchlist('Personal', 'User', 'Bob', 15) == 'Added successfully the entity Bob to the watchlist Personal.'\", \... | {
"split": "train",
"index": 1884,
"acecode_id": "bigcode_python_fns_17545",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a coefficient matrix A and a solution array X. Your task is to implement a function that computes the constant array B such that the equation AX = B holds true. The function should return the resulting array B. Both A and X are provided as input parameters. Please... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert matrix_eqn([[1, 2], [3, 4]], [5, 6]) == [17, 39]\", \"assert matrix_eqn([[2, 0], [0, 2]], [1, 1]) == [2, 2]\", \"assert matrix_eqn([[1, 0], [0, 1]], [10, 20]) == [10, 20]\", \"assert matrix_eqn([[0, 1], [1, 0]], [2, 3]) == [3, 2]\", \"assert matrix_eqn([[1, ... | {
"split": "train",
"index": 1885,
"acecode_id": "evol_24255",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that finds the maximum palindromic integer in the list and returns the positions of all instances of this integer. If no palindromic integer exists, return the message 'No palindrome found'. A palindrome is defined as a number that rem... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max_palindrome([345, 787, 1001, 11, 8998, 97, 787, 233, 1001]) == (8998, [4])\", \"assert find_max_palindrome([123, 456, 789]) == ('No palindrome found')\", \"assert find_max_palindrome([121, 131, 141, 151]) == (151, [3])\", \"assert find_max_palindrome... | {
"split": "train",
"index": 1886,
"acecode_id": "evol_30158",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to extract unique sentences from a list of evidence data. The evidence data is represented as a list of lists, where each inner list contains segments of a sentence. Your goal is to write a Python function that takes this evidence dat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_unique_sentences([['Hello', 'world'], ['Goodbye', 'world']]) == {'Hello world', 'Goodbye world'}\", \"assert extract_unique_sentences([['The', 'cat'], ['sat', 'on', 'the', 'mat']]) == {'The cat', 'sat on the mat'}\", \"assert extract_unique_sentences... | {
"split": "train",
"index": 1887,
"acecode_id": "oss_10129",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates an HTML error message when there are no results to show. The function should take no parameters and return a string that contains an HTML paragraph element with a specific class and a message indicating that there are no re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert no_results_to_show() == '<p class=\\\"expenses-empty\\\">No results to show.</p>'\", \"assert no_results_to_show() == '<p class=\\\"expenses-empty\\\">No results to show.</p>'\", \"assert no_results_to_show() == '<p class=\\\"expenses-empty\\\">No results to... | {
"split": "train",
"index": 1888,
"acecode_id": "bigcode_python_fns_48111",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer n, write a function `sum_prime_fibonacci(n)` that computes the sum of all Fibonacci numbers that are prime numbers from the first n Fibonacci numbers. The Fibonacci sequence is defined as: F(0) = 0, F(1) = 1, F(n) = F(n-1) + F(n-2) for n > 1. Your function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_prime_fibonacci(0) == 0\", \"assert sum_prime_fibonacci(1) == 0\", \"assert sum_prime_fibonacci(5) == 5\", \"assert sum_prime_fibonacci(6) == 10\", \"assert sum_prime_fibonacci(7) == 10\", \"assert sum_prime_fibonacci(8) == 23\", \"assert sum_prime_fibon... | {
"split": "train",
"index": 1889,
"acecode_id": "evol_20168",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the pixel values of an image in grayscale format (0-255). Your task is to apply a series of transformations to this image. The transformations are defined as a list of functions that take an integer and return an integer. Your funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_image([100, 150, 200], [lambda x: x + 10, lambda x: x - 20]) == [90, 140, 190]\", \"assert transform_image([0, 0, 0], [lambda x: x + 10]) == [10, 10, 10]\", \"assert transform_image([200, 200, 200], [lambda x: x - 300]) == [0, 0, 0]\", \"assert tra... | {
"split": "train",
"index": 1890,
"acecode_id": "bigcode_python_fns_19443",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function `advanced_base_arithmetic(n: int, z: int, base: int, operation: str, precision: int) -> str` that performs advanced arithmetic operations on a range of integers from n to z (inclusive) and returns the result in a specified base. The function should support ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert advanced_base_arithmetic(1, 5, 10, 'sum', 0) == '0b15'\", \"assert advanced_base_arithmetic(1, 5, 10, 'product', 0) == '0b120'\", \"assert advanced_base_arithmetic(1, 5, 10, 'average', 0) == '0b3'\", \"assert advanced_base_arithmetic(1, 5, 10, 'median', 0) =... | {
"split": "train",
"index": 1891,
"acecode_id": "evol_31499",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing downloads for different applications over a week, write a function `update_weekly_downloads(downloads: List[int]) -> List[int]` that returns a list of integers where each integer represents the total downloads for each application. The inpu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_weekly_downloads([10, 20, 30]) == [10, 20, 30]\", \"assert update_weekly_downloads([0, 0, 0]) == [0, 0, 0]\", \"assert update_weekly_downloads([1, 2, 1, 3, 5]) == [1, 2, 1, 3, 5]\", \"assert update_weekly_downloads([]) == []\", \"assert update_weekly_... | {
"split": "train",
"index": 1892,
"acecode_id": "bigcode_python_fns_31085",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of IP addresses, write a function that returns a list of unique IP addresses in lowercase. The function should take a single parameter, a list of strings, where each string is an IP address. The output should be a list containing only unique IP addresses, all forma... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_ip_addresses(['255.255.255.255', '255.255.255.255']) == ['255.255.255.255']\", \"assert unique_ip_addresses([]) == []\", \"assert unique_ip_addresses(['192.168.1.1', '192.168.1.1', '192.168.1.1']) == ['192.168.1.1']\", \"assert unique_ip_addresses(['1... | {
"split": "train",
"index": 1893,
"acecode_id": "bigcode_python_fns_21060",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `redirect_based_on_environment` that simulates the behavior of a web application redirecting users based on the deployment environment. Your function should take a string `deployment_type` as input, which can be either 'localdev' or 'prod... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert redirect_based_on_environment('localdev') == 'Render localdev registration page'\", \"assert redirect_based_on_environment('production') == 'Redirecting to BCeID registration page'\", \"assert redirect_based_on_environment('localdev') != 'Redirecting to BCeI... | {
"split": "train",
"index": 1894,
"acecode_id": "bigcode_python_fns_48756",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a 2D list of integers representing a tensor, implement a function that computes the symmetric outer product of the tensor. The function should return a new 2D list where each element at position (i, j) is computed as the average of the original element at position (i, j) ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert symmetric_product([[1, 2], [3, 4]]) == [[1.0, 2.5], [2.5, 4.0]]\", \"assert symmetric_product([[5, 10], [15, 20]]) == [[5.0, 12.5], [12.5, 20.0]]\", \"assert symmetric_product([[0, 0], [0, 0]]) == [[0.0, 0.0], [0.0, 0.0]]\", \"assert symmetric_product([[1]])... | {
"split": "train",
"index": 1895,
"acecode_id": "bigcode_python_fns_3600",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes two parameters: a dictionary called 'builder' and a string called 'callerAuthid'. The function should return the 'builder' dictionary with a new key-value pair added, where the key is 'callerAuthid' and the value is the value o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_caller_authid({}, 'auth1') == {'auth1': 'auth1'}\", \"assert add_caller_authid({'auth1': 'value1'}, 'auth1') == {'auth1': 'auth1'}\", \"assert add_caller_authid({'key1': 'value1'}, 'auth2') == {'key1': 'value1', 'auth2': 'auth2'}\", \"assert add_caller_a... | {
"split": "train",
"index": 1896,
"acecode_id": "bigcode_python_fns_33628",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a binary adjacency matrix representing a simple undirected graph, implement a function that converts this matrix into a sorted adjacency list. The adjacency list should be sorted in descending order by the degree (number of connections) of each node. The function should t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert matrix_to_list([[0, 1, 1], [1, 0, 0], [1, 0, 0]]) == [(0, [1, 2]), (1, [0]), (2, [0])]\", \"assert matrix_to_list([[0, 1], [1, 0]]) == [(0, [1]), (1, [0])]\", \"assert matrix_to_list([[0, 0, 0], [0, 0, 0], [0, 0, 0]]) == [(0, []), (1, []), (2, [])]\", \"asse... | {
"split": "train",
"index": 1897,
"acecode_id": "evol_26834",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function that calculates the factorial of a non-negative integer n. The function should correctly return the factorial for values up to 5000. Note that the factorial of 0 is defined as 1. Ensure that your implementation can handle large numbers efficient... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fact(0) == 1\", \"assert fact(1) == 1\", \"assert fact(2) == 2\", \"assert fact(3) == 6\", \"assert fact(4) == 24\", \"assert fact(5) == 120\", \"assert fact(6) == 720\", \"assert fact(7) == 5040\", \"assert fact(8) == 40320\", \"assert fact(9) == 362880\", ... | {
"split": "train",
"index": 1898,
"acecode_id": "evol_33675",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `lexicographical_distance(string1: str, string2: str) -> int` that calculates the lexicographical distance between two strings. The lexicographical distance is determined by counting the number of character changes required to make the two strings identical... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lexicographical_distance('AbCde', 'EdcbAz') == 6\", \"assert lexicographical_distance('hello', 'hello') == 0\", \"assert lexicographical_distance('Hello', 'hello') == 1\", \"assert lexicographical_distance('abcdef', 'abc') == 3\", \"assert lexicographical_di... | {
"split": "train",
"index": 1899,
"acecode_id": "evol_4745",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.