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 given a list of integers representing the heights of buildings in a city skyline. Your task is to write a function that calculates the maximum area of a rectangle that can be formed using the heights of these buildings. The rectangle can extend from one building to anot... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_rectangle_area([2,1,5,6,2,3]) == 10\", \"assert max_rectangle_area([1,1,1,1]) == 4\", \"assert max_rectangle_area([5,4,1,2,5,6]) == 10\", \"assert max_rectangle_area([]) == 0\", \"assert max_rectangle_area([1]) == 1\", \"assert max_rectangle_area([1,3,2,... | {
"split": "train",
"index": 82000,
"acecode_id": "oss_28720",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that converts a given number of seconds into a human-readable format. The function should take an integer value representing the number of seconds and return a string with the humanized value. The humanized value should be in the form... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert describe_seconds(0) == '0 seconds'\", \"assert describe_seconds(59) == '59 seconds'\", \"assert describe_seconds(60) == '1 minute'\", \"assert describe_seconds(3600) == '1 hour'\", \"assert describe_seconds(86400) == '1 day'\", \"assert describe_seconds(1728... | {
"split": "train",
"index": 82001,
"acecode_id": "oss_17074",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `get_settings_value(settings_dict, key)` that retrieves the value of a given key from a dictionary representing configuration settings. If the key does not exist, the function should return `None`. The input to the function is a dicti... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_settings_value({'theme': 'dark', 'language': 'en'}, 'theme') == 'dark'\", \"assert get_settings_value({'theme': 'dark', 'language': 'en'}, 'language') == 'en'\", \"assert get_settings_value({'theme': 'dark', 'language': 'en'}, 'font_size') == None\", \"a... | {
"split": "train",
"index": 82002,
"acecode_id": "oss_16084",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `test_equal(lists)` that takes a list of lists and checks whether all elements within each sublist are equal. If all elements in a sublist are equal, return the common element of that sublist. If a sublist is empty, or if the elements within a sublist are n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert test_equal([[1.0, 1.0, 1.0], [2.0, 2.0], []]) == [1.0, 2.0, None]\", \"assert test_equal([['a', 'a', 'a'], ['b', 'b'], ['c', 'd']]) == ['a', 'b', None]\", \"assert test_equal([[1, 1, 1], [1, 2, 1]]) == [1, None]\", \"assert test_equal([[3.5, 3.5, 3.5], [3.5,... | {
"split": "train",
"index": 82003,
"acecode_id": "evol_9470",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `count_substrings` that calculates the number of times a specific substring occurs in a source string, including overlapping instances. The function should take two parameters: a string `string` and a string `substring`. It should return an integer represen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_substrings('', 'a') == 0\", \"assert count_substrings('aaa', 'a') == 3\", \"assert count_substrings('aaaa', 'aa') == 3\", \"assert count_substrings('abcabc', 'abc') == 2\", \"assert count_substrings('ababab', 'aba') == 2\", \"assert count_substrings('a... | {
"split": "train",
"index": 82004,
"acecode_id": "evol_7959",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of tuples representing detected faces in a frame, where each tuple contains the coordinates of the face (x, y, w, h) and a user ID, write a function that processes this list and returns a new list. Each entry in the new list should contain the user ID and the statu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_faces([(10, 20, 30, 40, 1), (50, 60, 70, 80, 2)], {1, 2}) == [(1, 'registered'), (2, 'registered')]\", \"assert process_faces([(10, 20, 30, 40, 1), (50, 60, 70, 80, 3)], {1, 2}) == [(1, 'registered'), (3, 'unknown')]\", \"assert process_faces([(10, 2... | {
"split": "train",
"index": 82005,
"acecode_id": "bigcode_python_fns_14306",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, implement a function that groups the strings by their lengths and returns a dictionary where the keys are the lengths of the strings and the values are lists of strings that have that length. If there are no strings of a certain length, that length shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert group_strings_by_length(['apple', 'orange', 'pear', 'banana', 'fish', 'pork', 'milk']) == {5: ['apple'], 6: ['orange', 'banana'], 4: ['pear', 'fish', 'pork', 'milk']}\", \"assert group_strings_by_length(['cat', 'dog', 'bat']) == {3: ['cat', 'dog', 'bat']}\",... | {
"split": "train",
"index": 82006,
"acecode_id": "bigcode_python_fns_27066",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given two sentences `sentence1` and `sentence2`, return `true` if the two sentences are similar, meaning that it is possible to swap an arbitrary segment (possibly empty) from one of the sentences to make them equal. Otherwise, return `false`. A sentence is a list of words sepa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert areSentencesSimilar('of', 'A lot of words') == False\", \"assert areSentencesSimilar('Luky', 'Lucccky') == False\", \"assert areSentencesSimilar('One two three', 'One four three') == False\", \"assert areSentencesSimilar('Goodbye', 'Goodbye') == True\", \"as... | {
"split": "train",
"index": 82007,
"acecode_id": "evol_33887",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a list of rules, where each rule is a tuple containing two integers that represent a range (inclusive). You are also given an integer 'field'. Your task is to implement a function `is_field_valid(rules: List[Tuple[int, int]], field: int) -> bool` that checks if th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_field_valid([(1, 5), (10, 15), (20, 25)], 12) == True\", \"assert is_field_valid([(1, 5), (10, 15), (20, 25)], 5) == True\", \"assert is_field_valid([(1, 5), (10, 15), (20, 25)], 1) == True\", \"assert is_field_valid([(1, 5), (10, 15), (20, 25)], 25) == T... | {
"split": "train",
"index": 82008,
"acecode_id": "bigcode_python_fns_31742",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a database path (dbpath) represented as a string and a cutoff radius (cutoff) represented as a float. Your task is to create a function `get_data_info(dbpath: str, cutoff: float) -> str` that returns a string containing the database path and the cutoff radius form... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_data_info('path/to/db', 1.5) == 'Database Path: path/to/db, Cutoff Radius: 1.5'\", \"assert get_data_info('data/db', 0.75) == 'Database Path: data/db, Cutoff Radius: 0.75'\", \"assert get_data_info('local/database', 2.0) == 'Database Path: local/database... | {
"split": "train",
"index": 82009,
"acecode_id": "bigcode_python_fns_36769",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that approximates the square root of a given integer `n` using the Chakravala method for non-perfect squares. The function should take two arguments: `n` (an integer representing the number for which the square root is to be approximated) and `eps` (an inte... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sqrt_app(1, 4) == (1.0, '')\", \"assert sqrt_app(4, 4) == (2.0, '')\", \"assert sqrt_app(9, 4) == (3.0, '')\", \"assert sqrt_app(16, 4) == (4.0, '')\", \"assert sqrt_app(25, 4) == (5.0, '')\"]}"
} | {
"split": "train",
"index": 82010,
"acecode_id": "oss_9438",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to calculate the largest value that an unsigned bitfield can hold. A bitfield is a data structure that consists of a fixed number of bits. The function takes the length of the bitfield in bits as input and returns the largest value th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_largest_value(1) == 1\", \"assert calculate_largest_value(2) == 3\", \"assert calculate_largest_value(3) == 7\", \"assert calculate_largest_value(4) == 15\", \"assert calculate_largest_value(5) == 31\", \"assert calculate_largest_value(6) == 63\", ... | {
"split": "train",
"index": 82011,
"acecode_id": "oss_8622",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given the latitude and longitude of a point on the Earth's surface. Implement a function that calculates the distance in arc seconds between this point and a list of restaurants, each defined by their latitude and longitude. The function should return a list of tuples, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_distances(35.6895, 139.6917, [(35.6895, 139.6917, 'Restaurant A')]) == [(0, 0, 'Restaurant A')]\", \"assert calculate_distances(40.7128, -74.0060, [(40.7128, -74.0060, 'Restaurant B')]) == [(0, 0, 'Restaurant B')]\", \"assert calculate_distances(34... | {
"split": "train",
"index": 82012,
"acecode_id": "bigcode_python_fns_7435",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, implement a function that returns a new array containing only the prime numbers from the original array. A prime number is defined as a number greater than 1 that has no positive divisors other than 1 and itself.\nPlease reason step by step, then wri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert scan_array([11, 14, 23, 26, 29, 31, 35]) == [11, 23, 29, 31]\", \"assert scan_array([1, 2, 3, 4, 5]) == [2, 3, 5]\", \"assert scan_array([10, 15, 20, 25]) == []\", \"assert scan_array([19, 20, 21, 22]) == [19]\", \"assert scan_array([0, 1, 2, 3, 4]) == [2, 3... | {
"split": "train",
"index": 82013,
"acecode_id": "evol_6765",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `extract_domain_and_validate_tld(email: str) -> bool` that takes an email address as input, extracts the domain name and its corresponding top-level domain (TLD), then verifies if the TLD is valid according to a predefined list of valid TLDs. The valid TLDs are... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_domain_and_validate_tld('john.doe@example.com') == True\", \"assert extract_domain_and_validate_tld('alice.smith@school.edu') == True\", \"assert extract_domain_and_validate_tld('bob.brown@company.org') == True\", \"assert extract_domain_and_validate... | {
"split": "train",
"index": 82014,
"acecode_id": "evol_26676",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary containing key-value pairs representing malware information, implement a function `create_strings_from_dict(dict_name)` that transforms each entry into a string formatted as 'key: value'. The resulting list of strings should be sorted first by the length of t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_strings_from_dict({'malwareName': 'Trojan', 'malwareFamily': 'xyz', 'type': 'file', 'maliciousURL': 'http://example.com'}) == ['maliciousURL: http://example.com', 'malwareName: Trojan', 'malwareFamily: xyz', 'type: file']\", \"assert create_strings_fr... | {
"split": "train",
"index": 82015,
"acecode_id": "evol_1867",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes two lists of integers, `local_data` and `remote_data`, and returns a list of integers that are present in `local_data` but not in `remote_data`. This function should help synchronize the data by identifying the unique entries in the local databas... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert synchronize_data([1, 2, 3], [2, 3, 4]) == [1]\", \"assert synchronize_data([5, 6, 7, 8], [5, 6]) == [7, 8]\", \"assert synchronize_data([], [1, 2, 3]) == []\", \"assert synchronize_data([10, 20, 30], [30, 40, 50]) == [10, 20]\", \"assert synchronize_data([1,... | {
"split": "train",
"index": 82016,
"acecode_id": "evol_24642",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a user's interaction with a website for user authentication. The function should accept the user's email and password, and it should return 'Login Successful' if the credentials are valid, or raise a custom exception called... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert login('user@example.com', 'securepassword') == 'Login Successful'\", \"assert login('user@example.com', 'securepassword') == 'Login Successful'\", \"assert login('user@example.com', 'securepassword') == 'Login Successful'\", \"assert login('user@example.com'... | {
"split": "train",
"index": 82017,
"acecode_id": "oss_24209",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Write a function in Python that accepts a float as an input parameter and returns the rightmost digit before the decimal point from the supplied floating-point number.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rightmost_digit(56.7891) == 6\", \"assert rightmost_digit(123.456) == 3\", \"assert rightmost_digit(0.001) == 0\", \"assert rightmost_digit(10.0) == 0\", \"assert rightmost_digit(7.89) == 7\", \"assert rightmost_digit(45.6789) == 5\", \"assert rightmost_digi... | {
"split": "train",
"index": 82018,
"acecode_id": "evol_25670",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to manage a simple software repository system. The function should be able to add, delete, and retrieve information about repositories. You need to implement the function `manage_repo` which takes two parameters: `action` (a string) a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_repo('add', 'repo1') == \\\"Repository 'repo1' added successfully.\\\"\", \"assert manage_repo('add', 'repo2') == \\\"Repository 'repo2' added successfully.\\\"\", \"assert manage_repo('add', 'repo3') == \\\"Repository 'repo3' added successfully.\\\"\... | {
"split": "train",
"index": 82019,
"acecode_id": "oss_4976",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given two matrices, A and B. Matrix A has dimensions n x k and matrix B has dimensions m x k. Your task is to create a new matrix C that is formed by taking the Kronecker product of A and B. The resulting matrix C should have dimensions (n * m) x k. Specifically, for ea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert kron_product([[0]], [[1, 2]]) == [[0, 0]]\", \"assert kron_product([[1]], [[2], [3]]) == [[2], [3]]\", \"assert kron_product([[1, 1]], [[3, 4]]) == [[3, 4, 3, 4]]\", \"assert kron_product([[1, 2]], [[2], [3]]) == [[2, 4], [3, 6]]\", \"assert kron_product([[1... | {
"split": "train",
"index": 82020,
"acecode_id": "bigcode_python_fns_8370",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings. Your task is to write a function that checks if all the strings in the list are unique, meaning no string appears more than once in the list. Return True if all strings are unique, and False otherwise. The input list may contain both uppercase a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert are_strings_unique(['apple', 'banana', 'orange']) == True\", \"assert are_strings_unique(['apple', 'banana', 'Apple']) == True\", \"assert are_strings_unique(['apple', 'banana', 'banana']) == False\", \"assert are_strings_unique(['apple', 'Apple', 'APPLE']) ... | {
"split": "train",
"index": 82021,
"acecode_id": "bigcode_python_fns_41691",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a list of formatted strings representing data points for a scatter plot. Write a function `format_data_points(data, color)` that takes in the following parameters: \n- `data`: a list of tuples, where each tuple represents ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_data_points([(1, 2), (3, 4)], 'red') == ['Point (1, 2) is colored red', 'Point (3, 4) is colored red']\", \"assert format_data_points([(0, 0), (5, 5)], 'blue') == ['Point (0, 0) is colored blue', 'Point (5, 5) is colored blue']\", \"assert format_data... | {
"split": "train",
"index": 82022,
"acecode_id": "oss_19953",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a timestamp in ISO 8601 format, write a function `to_datetime(timestamp: str) -> datetime.datetime` that converts this timestamp into a `datetime` object. The input string may contain milliseconds or not, and it can be in the following formats: 'YYYY... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert to_datetime('2023-10-01T12:30:45') == datetime.datetime(2023, 10, 1, 12, 30, 45)\", \"assert to_datetime('2023-10-01T12:30:45.123') == datetime.datetime(2023, 10, 1, 12, 30, 45, 123000)\", \"assert to_datetime('2023-01-01T00:00:00') == datetime.datetime(2023... | {
"split": "train",
"index": 82023,
"acecode_id": "bigcode_python_fns_27925",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a function that identifies the smallest number in a given list and returns all index positions where this smallest number occurs. Your implementation should not use built-in functions such as min() or index(). The function should take a single parameter, a list of integ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_min([25, 67, 12, 8, 8, 8]) == (8, [3, 4, 5])\", \"assert find_min([8, 67, 12, 8, 25, 8]) == (8, [0, 3, 5])\", \"assert find_min([5, 1, 3, 1, 4]) == (1, [1, 3])\", \"assert find_min([10]) == (10, [0])\", \"assert find_min([0, -1, -1, 0]) == (-1, [1, 2])\... | {
"split": "train",
"index": 82024,
"acecode_id": "evol_18581",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer representing a timestamp in seconds relative to the epoch (January 1, 1970), write a function `convert_timestamp_to_utc(seconds: int) -> str` that returns the corresponding UTC datetime as a string in the format 'YYYY-MM-DD HH:MM:SS'. The function should handle... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_timestamp_to_utc(0) == '1970-01-01 00:00:00'\", \"assert convert_timestamp_to_utc(1609459200) == '2021-01-01 00:00:00'\", \"assert convert_timestamp_to_utc(86400) == '1970-01-02 00:00:00'\", \"assert convert_timestamp_to_utc(946684800) == '2000-01-01... | {
"split": "train",
"index": 82025,
"acecode_id": "bigcode_python_fns_40084",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, implement a function that sorts the array in increasing order and returns the median value. The array will contain at least three integers, and the integers will be in the range of -1000 to 1000. You need to implement the function `find_median(arr: L... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_median([8, 5, 4, 7, 2, 1]) == 4.5\", \"assert find_median([1, 2, 3]) == 2.0\", \"assert find_median([10, 30, 20]) == 20.0\", \"assert find_median([5, 5, 5]) == 5.0\", \"assert find_median([3, 1, 2, 4]) == 2.5\", \"assert find_median([-10, -20, -30, -40,... | {
"split": "train",
"index": 82026,
"acecode_id": "evol_4543",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `linear_search(arr: List[int], x: int) -> Union[int, str]` that performs a linear search on an unsorted list of integers `arr` to find the index of the integer `x`. If `x` is found in the list, return its index. If `x` is not found, return the string 'Eleme... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert linear_search([10, 20, 80, 30], 80) == 2\", \"assert linear_search([10, 20, 80, 30], 10) == 0\", \"assert linear_search([10, 20, 80, 30], 30) == 3\", \"assert linear_search([10, 20, 80, 30], 50) == 'Element not found'\", \"assert linear_search([], 5) == 'Ele... | {
"split": "train",
"index": 82027,
"acecode_id": "evol_14234",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `find_max_and_min(nums: List[int]) -> Tuple[int, int]` that returns a tuple containing the maximum and minimum numbers in the list. If the list is empty, return (None, None). The input list can contain both positive and negative intege... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max_and_min([1, 2, 3, 4, 5]) == (5, 1)\", \"assert find_max_and_min([-1, -2, -3, -4, -5]) == (-1, -5)\", \"assert find_max_and_min([0, 0, 0]) == (0, 0)\", \"assert find_max_and_min([5]) == (5, 5)\", \"assert find_max_and_min([3, 1, 4, 1, 5, 9]) == (9, 1... | {
"split": "train",
"index": 82028,
"acecode_id": "bigcode_python_fns_46263",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that calculates the maximum value (apex), minimum value (nadir), and the mean of the integers in the list. The function should return these three values as a tuple. You can assume the list will contain at least one integer.\nPlease... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate([0, 0, 0, 0]) == (0, 0, 0.0)\", \"assert calculate([100]) == (100, 100, 100.0)\", \"assert calculate([1, 2, 3, 4, 5]) == (5, 1, 3.0)\", \"assert calculate([5, 4, 3, 2, 1]) == (5, 1, 3.0)\", \"assert calculate([10, 20, 30, 40, 50]) == (50, 10, 30.0)... | {
"split": "train",
"index": 82029,
"acecode_id": "evol_13387",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of museum objects, where each object is represented as a dictionary containing its 'id' and a list of associated images. Each image is represented as a dictionary with a 'public' boolean attribute. Your task is to implement a function `get_museum_objects_wi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_museum_objects_with_image_counts([{'id': 1, 'images': [{'public': True}, {'public': False}]}, {'id': 2, 'images': [{'public': True}, {'public': True}]}]) == [{'id': 2, 'public_images_count': 2}, {'id': 1, 'public_images_count': 1}]\", \"assert get_museum... | {
"split": "train",
"index": 82030,
"acecode_id": "oss_1279",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer array, denoted as `nums`, and a positive integer `k`, implement a function that returns the most competitive subsequence of `nums` that is of size `k`. A subsequence is considered more competitive if it is lexicographically smaller than another subsequence of t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert mostCompetitive([3,5,2,6], 2) == [2,6]\", \"assert mostCompetitive([2,4,3,3,5,4,9,6], 4) == [2,3,3,4]\", \"assert mostCompetitive([1,2,3,4,5], 3) == [1,2,3]\", \"assert mostCompetitive([2,1,3,5,4], 3) == [1,3,4]\", \"assert mostCompetitive([1,3,2,4,5], 3) ==... | {
"split": "train",
"index": 82031,
"acecode_id": "evol_23993",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple task management system for a notification service. The system should allow adding and finding tasks based on their unique message IDs. Each task is represented by a class called `NotifyTask` which has an attribute `message_id` that uniq... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_tasks([('add', NotifyTask(1)), ('add', NotifyTask(2)), ('find', 1)]) == [None, None, NotifyTask(1)]\", \"assert manage_tasks([('add', NotifyTask(3)), ('find', 2)]) == [None, None]\", \"assert manage_tasks([('add', NotifyTask(4)), ('find', 4)]) == [Non... | {
"split": "train",
"index": 82032,
"acecode_id": "oss_1645",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a random number generator that generates a sequence of integers. Your task is to implement a function that simulates the behavior of this random generator and returns a configuration object. The configuration object should include a random learning optimizer name ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isinstance(generate_config(), dict)\", \"assert 'lopt' in generate_config()\", \"assert 'num_steps' in generate_config()\", \"assert 'outer_batch_size' in generate_config()\", \"assert generate_config()['num_steps'] >= 1 and generate_config()['num_steps'] <=... | {
"split": "train",
"index": 82033,
"acecode_id": "bigcode_python_fns_8786",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function `get_cache_key(account: str, container: Optional[str], obj: Optional[str]) -> str` that generates a cache key string based on the provided account, container, and object names. The cache key should be constructed as follows: \n\n- If both `container` and `o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_cache_key('user123', 'containerA', 'object1') == 'object/user123/containerA/object1'\", \"assert get_cache_key('user123', 'containerA', None) == 'container/user123/containerA'\", \"assert get_cache_key('user123', None, None) == 'account/user123'\", \"ass... | {
"split": "train",
"index": 82034,
"acecode_id": "bigcode_python_fns_10409",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries, where each dictionary represents an indicator with the following keys: 'pattern', 'labels', and 'description'. The 'pattern' is a string that needs to be processed to extract its type and value. Your task is to implement a function that gen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert gen_iocs([{'pattern': '192.168.1.1', 'labels': 'malicious', 'description': 'Local IP'}, {'pattern': 'http://example.com', 'labels': 'phishing', 'description': 'Example URL'}, {'pattern': None, 'labels': 'safe', 'description': 'Valid IP'}]) == [{'value': '192... | {
"split": "train",
"index": 82035,
"acecode_id": "bigcode_python_fns_44499",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a list of game events, where each event is represented as a dictionary containing the keys 'player', 'action', and 'score'. Your task is to implement a function `generate_game_summary(game_events)` that takes this list of game events as input and returns a summary... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_game_summary([]) == ''\", \"assert generate_game_summary([{'player': 'Alice', 'action': 'goal', 'score': 100}]) == 'Player Alice performed goal and scored 100 points.'\", \"assert generate_game_summary([{'player': 'Bob', 'action': 'assist', 'score':... | {
"split": "train",
"index": 82036,
"acecode_id": "oss_21202",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers that can contain both positive and negative numbers as well as zero, write a function that counts the occurrences of a specific integer in that list. The list may contain duplicates, and you need to implement this solution without using any built-in fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_occurrences([1, 2, 3, 4, 1, 2, 1], 1) == 3\", \"assert count_occurrences([-1, -1, 0, 1, 1, -2], -1) == 2\", \"assert count_occurrences([0, 0, 0, 0], 0) == 4\", \"assert count_occurrences([-3, -3, -3, 3, 3, 3], 3) == 3\", \"assert count_occurrences([5, ... | {
"split": "train",
"index": 82037,
"acecode_id": "evol_342",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `bank_account_operations(operations: List[Tuple[str, int]], initial_balance: int) -> Tuple[int, int]` that simulates a series of bank account operations. The function should take an initial balance and a list of operations, where each... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bank_account_operations([('deposit', 50), ('withdraw', 20)], 100) == (130, 2)\", \"assert bank_account_operations([('withdraw', 50), ('deposit', 100)], 100) == (150, 2)\", \"assert bank_account_operations([('withdraw', 200)], 100) == (100, 0)\", \"assert ban... | {
"split": "train",
"index": 82038,
"acecode_id": "oss_1430",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a list of event messages, each represented as a dictionary containing an 'event' key with a 'subjects' list, implement a function `extract_robot_barcode` that extracts the 'friendly_name' of the first subject whose 'role_type' is 'robot'. If no such subject exists, return... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_robot_barcode([{ 'event': { 'subjects': [{ 'role_type': 'robot', 'friendly_name': 'Robo1' }] } }]) == ['Robo1']\", \"assert extract_robot_barcode([{ 'event': { 'subjects': [{ 'role_type': 'human', 'friendly_name': 'Human1' }] } }]) == ['No robot foun... | {
"split": "train",
"index": 82039,
"acecode_id": "bigcode_python_fns_5696",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `sum_even_numbers` that returns the sum of all the even numbers in the list. An even number is defined as an integer that is divisible by 2. If there are no even numbers in the list, the function should return 0. The function signature... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_even_numbers([1, 2, 3, 4, 5]) == 6\", \"assert sum_even_numbers([10, 11, 12, 13, 14]) == 36\", \"assert sum_even_numbers([2, 4, 6, 8, 10]) == 30\", \"assert sum_even_numbers([1, 3, 5, 7, 9]) == 0\", \"assert sum_even_numbers([-2, -4, -6, -8]) == -20\", \... | {
"split": "train",
"index": 82040,
"acecode_id": "oss_22216",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing the names of various animals. Your task is to write a function that takes this list as input and returns a new list containing only those animal names that start with the letter 't'. For example, given the input list: ['tiger', 'lion... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_animals_starting_with_t(['tiger', 'lion', 'elephant', 'cheetah', 'tundra', 'giraffe', 'rhinoceros']) == ['tiger', 'tundra']\", \"assert find_animals_starting_with_t(['cat', 'dog', 'mouse', 'turtle', 'tarantula']) == ['turtle', 'tarantula']\", \"assert f... | {
"split": "train",
"index": 82041,
"acecode_id": "oss_8615",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple URL dispatcher for a web application. Your task is to define URL patterns for the following views: 1. A view to display the home page at the root URL (\"/\"). 2. A view to display a list of products at the URL \"/products/\". 3. A view to d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_view_name('/') == 'home'\", \"assert get_view_name('/products/') == 'product_list'\", \"assert get_view_name('/nonexistent/') == '404 Not Found'\", \"assert get_view_name('/products/') == 'product_list'\", \"assert get_view_name('/products/123/other/') =... | {
"split": "train",
"index": 82042,
"acecode_id": "oss_11514",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Write a function `is_prime(n: int) -> bool` that determines whether a given integer n is a prime number. A prime number is a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. Your function should return True if n is prime and False ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_prime(1) == False\", \"assert is_prime(2) == True\", \"assert is_prime(3) == True\", \"assert is_prime(4) == False\", \"assert is_prime(5) == True\", \"assert is_prime(6) == False\", \"assert is_prime(7) == True\", \"assert is_prime(8) == False\", \"asser... | {
"split": "train",
"index": 82043,
"acecode_id": "evol_36159",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the total energy consumption over a specified time period given a list of energy readings. Each reading is represented as a dictionary containing a timestamp and energy consumed at that timestamp. Write a function `calculate_energy_consumption(re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_energy_consumption([{'timestamp': '2023-01-01 00:00:00', 'energy': 10.5}, {'timestamp': '2023-01-01 01:00:00', 'energy': 5.0}], '2023-01-01 00:00:00', '2023-01-01 01:00:00') == 15.5\", \"assert calculate_energy_consumption([{'timestamp': '2023-01-0... | {
"split": "train",
"index": 82044,
"acecode_id": "oss_16152",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of packages that are installed in a project and a list of extra packages that need to be added. Your task is to create a function `install_packages` that takes two lists as input: `current_packages` (a list of strings representing currently installed packag... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert install_packages(['numpy', 'pandas'], ['matplotlib']) == ['matplotlib', 'numpy', 'pandas']\", \"assert install_packages(['requests', 'flask'], ['requests', 'django']) == ['django', 'flask', 'requests']\", \"assert install_packages(['scikit-learn'], ['scikit-... | {
"split": "train",
"index": 82045,
"acecode_id": "bigcode_python_fns_18022",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a caching mechanism for a function that retrieves user profiles. The function `get_user_profile(user_id)` is responsible for fetching a user's profile. You need to cache the profile to avoid repeated queries for the same user. The function first... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_user_profile(1) == {'user_id': 1, 'info': 'default'}\", \"assert get_user_profile(1) == {'user_id': 1, 'info': 'default'}\", \"assert get_user_profile(2) == {'user_id': 2, 'info': 'default'}\", \"assert get_user_profile(3) == {'user_id': 3, 'info': 'defa... | {
"split": "train",
"index": 82046,
"acecode_id": "oss_18875",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple command interpreter that can process a list of text commands and produce corresponding actions. Each command is represented as a string, and there are predefined actions associated with specific commands. Your task is to implement a functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert interpret_commands(['turn on the light']) == ['Light turned on']\", \"assert interpret_commands(['turn off the light']) == ['Light turned off']\", \"assert interpret_commands(['increase the volume']) == ['Volume increased']\", \"assert interpret_commands(['d... | {
"split": "train",
"index": 82047,
"acecode_id": "oss_7063",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates user role assignment in a user management system. The function should accept a list of user names and a corresponding list of roles, and then assign those roles to the users. Your function should return a dictionary ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert assign_user_roles(['alice', 'bob'], ['admin', 'editor']) == {'alice': 'admin', 'bob': 'editor'}\", \"assert assign_user_roles(['charlie', 'dave'], ['admin']) == {'charlie': 'admin', 'dave': 'guest'}\", \"assert assign_user_roles(['eve'], ['manager', 'viewer'... | {
"split": "train",
"index": 82048,
"acecode_id": "oss_5751",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes in a list of integers and returns the least common multiple (LCM) of the list elements.\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 lcm([4, 5, 6]) == 60\", \"assert lcm([1, 2, 3]) == 6\", \"assert lcm([10, 15, 20]) == 60\", \"assert lcm([7, 14]) == 14\", \"assert lcm([9, 12]) == 36\", \"assert lcm([3, 5, 7]) == 105\", \"assert lcm([8, 12, 16]) == 48\", \"assert lcm([1, 1, 1]) == 1\", \"a... | {
"split": "train",
"index": 82049,
"acecode_id": "evol_24826",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the number of frames processed in a video stream for consecutive seconds. Your task is to implement a function `calculate_average_fps(frames_per_second: List[int]) -> float` that calculates the average frames per second (FPS) over t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_fps([30, 60, 90]) == 60.0\", \"assert calculate_average_fps([0, 0, 0]) == 0.0\", \"assert calculate_average_fps([15]) == 15.0\", \"assert calculate_average_fps([10, 20, 30, 40]) == 25.0\", \"assert calculate_average_fps([]) == 0.0\", \"asse... | {
"split": "train",
"index": 82050,
"acecode_id": "oss_9700",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a list of dictionaries, where each dictionary represents a 'part' containing a 'namespace' and its associated keys. The function should take a list of namespaces and a dictionary representing a repository. Each namespace in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_parts(['namespace1', 'namespace2'], {'namespace1': ['key1', 'key2'], 'namespace2': ['key3']}) == [{'namespace': 'namespace1', 'data': ['key1', 'key2']}, {'namespace': 'namespace2', 'data': ['key3']}]\", \"assert generate_parts(['namespace3'], {'name... | {
"split": "train",
"index": 82051,
"acecode_id": "bigcode_python_fns_15621",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an `m x n` grid of characters `board` and a string `word`, return `true` if `word` exists in the grid. The word can be constructed from letters of sequentially adjacent cells, where adjacent cells are horizontally, vertically, or diagonally neighboring. The same letter ce... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert exist([['A', 'B', 'C', 'E'], ['S', 'F', 'C', 'S'], ['A', 'D', 'E', 'E']], 'ABCB') == False\", \"assert exist([['A', 'B', 'C', 'D'], ['E', 'F', 'G', 'H'], ['I', 'J', 'K', 'L']], 'AFK') == True\", \"assert exist([['M', 'N', 'O'], ['P', 'Q', 'R'], ['S', 'T', 'U... | {
"split": "train",
"index": 82052,
"acecode_id": "evol_17080",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates signing an image. Given the name of an image as a string, your function should return a dictionary containing the signed image name, a fake signature, and a verification data structure that includes the original image c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sign_image('my_image:latest') == {'signed_image_name': 'my_image_signed:latest', 'signature_value': 'FAKE SIGNATURE', 'verify_image_data': {'image_config': 'my_image:latest'}}\", \"assert sign_image('test_image:v1') == {'signed_image_name': 'test_image_signe... | {
"split": "train",
"index": 82053,
"acecode_id": "bigcode_python_fns_19340",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a target point T and a list of sorted rings represented by their paths. Each ring path is a list of points. Your goal is to find a transect that ends at point T, returning a list of tuples containing the point of intersection, the index of the ring, the index of t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_transect(5.0, [[(1, 1), (2, 2)], [(3, 3), (4, 4)], [(5, 5), (6, 6)]]) == [((5, 5), 2, 0, 0)]\", \"assert find_transect(0.0, [[(1, 1), (2, 2)], [(3, 3), (4, 4)], [(5, 5), (6, 6)]]) == []\", \"assert find_transect(1.5, [[(1, 1), (2, 2)], [(3, 3), (4, 4)],... | {
"split": "train",
"index": 82054,
"acecode_id": "bigcode_python_fns_47386",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function called `intersperse` that accepts a list of integers, `numbers`, and an integer `delimiter`. Your function should return a new list where the `delimiter` is inserted between each consecutive pair of integers in `numbers`. For example,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert intersperse([], 0) == []\", \"assert intersperse([1], 0) == [1]\", \"assert intersperse([1, 2], 0) == [1, 0, 2]\", \"assert intersperse([1, 2, 3], 0) == [1, 0, 2, 0, 3]\", \"assert intersperse([1, 2, 3], 1) == [1, 1, 2, 1, 3]\", \"assert intersperse([5, 10, ... | {
"split": "train",
"index": 82055,
"acecode_id": "evol_33974",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers Z and two lists: type_restrict and restrict. The list type_restrict contains integers that indicate the type of restriction (1 for 'greater than or equal to', 0 for 'less than or equal to') for each corresponding value in restrict. Your task is ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert apply_restrictions([1, 2, 3], [1, 1, 0], [1, 2, 2]) == [True, True, False]\", \"assert apply_restrictions([0, 0, 0], [1, 1, 1], [0, 0, 0]) == [True, True, True]\", \"assert apply_restrictions([-1, -2, -3], [1, 0, 1], [-1, -2, -4]) == [True, True, True]\", \"... | {
"split": "train",
"index": 82056,
"acecode_id": "bigcode_python_fns_19737",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing a list of bounding boxes representing detected human poses and managing a timer functionality. Implement a function `process_frame` that takes in a list of bounding boxes `current_poses`, a boolean `timer_started`, a boolean `sleeping`, and an int... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_frame([(10, 10, 50, 50)], True, False, 0) == [(10, 10, 50, 50)]\", \"assert process_frame([(10, 10, 50, 50)], False, False, 0) == [(10, 10, 50, 50)]\", \"assert process_frame([(10, 10, 50, 50)], True, True, 0) == [(10, 10, 50, 50)]\", \"assert proces... | {
"split": "train",
"index": 82057,
"acecode_id": "oss_13445",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of products where each product is represented by a dictionary containing its name, price, and quantity. Write a function that takes in this list of products and performs the following operations: \n\n1. Calculate the total cost for each product (price * qua... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_product_costs([{'name': 'grape', 'price': 2.0, 'quantity': 5}, {'name': 'pear', 'price': 1.5, 'quantity': 8}]) == {'total_costs': {'grape': 10.0, 'pear': 12.0}, 'max_product': 'pear', 'overall_total_cost': 22.0}\", \"assert calculate_product_costs(... | {
"split": "train",
"index": 82058,
"acecode_id": "oss_11085",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of audio sample data as bytes and a sample rate. Your task is to create a function that processes this audio data and returns the length of the audio in seconds. You can assume that the audio data is mono (1 channel), has a sample width of 2 bytes, and the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert audio_length(b'\\\\x00\\\\x01\\\\x00\\\\x02', 16000) == 0.000125\", \"assert audio_length(b'\\\\x00' * 64000, 32000) == 1.0\", \"assert audio_length(b'\\\\x00' * 32000, 16000) == 1.0\", \"assert audio_length(b'', 16000) == 0.0\", \"assert audio_length(b'\\\\... | {
"split": "train",
"index": 82059,
"acecode_id": "bigcode_python_fns_7474",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Write a function to find the longest common subsequence (LCS) for three given string sequences. The function should handle special characters and numbers within the strings. You need to implement the function with the following signature: `def lcs_of_three_strings(X: str, Y: st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lcs_of_three_strings('abc', 'abc', 'abc') == 3\", \"assert lcs_of_three_strings('abc', 'def', 'ghi') == 0\", \"assert lcs_of_three_strings('a1b2c3', 'ab12c3', '12abc') == 3\", \"assert lcs_of_three_strings('xyz', 'xzy', 'zyx') == 1\", \"assert lcs_of_three_s... | {
"split": "train",
"index": 82060,
"acecode_id": "evol_7695",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with filtering a list of academic publications based on a specific author and retrieving the recent publications authored by that author. Implement a function `get_recent_publications_by_author(publications: List[Dict[str, Union[str, datetime]]], author: str) -> ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_recent_publications_by_author([{'author': 'Alice', 'publication_date': '2023-10-01'}, {'author': 'Bob', 'publication_date': '2023-09-15'}, {'author': 'Alice', 'publication_date': '2023-09-20'}], 'Alice') == [{'author': 'Alice', 'publication_date': '2023-... | {
"split": "train",
"index": 82061,
"acecode_id": "oss_19978",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with checking if a device is ready for operation based on a configuration status. Implement a function `is_device_ready()` that returns a boolean value: `True` if the device is ready (indicated by a configuration status of 'OK'), and `False` otherwise. The functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_device_ready('OK') == True\", \"assert is_device_ready('NOT_OK') == False\", \"assert is_device_ready('UNKNOWN') == False\", \"assert is_device_ready('OK') == True\", \"assert is_device_ready('NOT_OK') == False\", \"assert is_device_ready('UNKNOWN') == Fa... | {
"split": "train",
"index": 82062,
"acecode_id": "bigcode_python_fns_47185",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes two integers, 'height' and 'width', representing the minimum required dimensions for a display. The function should simulate checking the current dimensions of a screen, which are given as (h, w). If the current dimensions are ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_screen_size(10, 20) == 'Success: Screen size is adequate.'\", \"assert check_screen_size(100, 200) == 'Warning: Required height: 100, Required width: 200, Current height: 50, Current width: 100.'\", \"assert check_screen_size(5, 5) == 'Success: Screen ... | {
"split": "train",
"index": 82063,
"acecode_id": "bigcode_python_fns_23268",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `delete_framebuffers` that simulates the deletion of OpenGL framebuffers. The function should take an integer `n` representing the number of framebuffers to delete, and an optional list of integers `framebuffers` which represents the iden... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delete_framebuffers(3) == [0, 1, 2]\", \"assert delete_framebuffers(5, [1, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert delete_framebuffers(0) == []\", \"assert delete_framebuffers(1) == [0]\", \"assert delete_framebuffers(2, [5, 6]) == [5, 6]\", \"assert delete_fr... | {
"split": "train",
"index": 82064,
"acecode_id": "bigcode_python_fns_5161",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks whether a given number exists in a list of integers. Implement a function `number_exists(numbers: List[int], target: int) -> bool` that takes a list of integers and a target integer as input and returns True if the target numb... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert number_exists([], 5) == False\", \"assert number_exists([1, 2, 3, 4, 5], 3) == True\", \"assert number_exists([1, 1, 2, 2, 3], 2) == True\", \"assert number_exists([-1, -2, -3, -4], -2) == True\", \"assert number_exists([-1, -2, -3, -4], 0) == False\", \"ass... | {
"split": "train",
"index": 82065,
"acecode_id": "bigcode_python_fns_1911",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with analyzing a list of integers to determine the count of unique elements in the list. Write a function `count_unique_elements(nums: List[int]) -> int` that takes a list of integers `nums` as input and returns the number of unique integers present in the list. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_elements([1, 2, 3, 4, 5]) == 5\", \"assert count_unique_elements([1, 1, 1, 1, 1]) == 1\", \"assert count_unique_elements([1, 2, 2, 3, 4, 4, 4]) == 4\", \"assert count_unique_elements([-1, -1, 0, 1, 1]) == 3\", \"assert count_unique_elements([]) ... | {
"split": "train",
"index": 82066,
"acecode_id": "oss_36174",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a trace matrix `T`, a Dirichlet boundary condition matrix `D`, and a complementary matrix `C`, write a function that checks if the hybrid pairing condition is satisfied. The hybrid pairing condition is defined as follows: the sum of the elements in matrix `T` must be equa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_hybrid_pairing([[1, 2], [3, 4]], [[0, 0], [0, 0]], [[1, 2], [3, 4]]) == True\", \"assert check_hybrid_pairing([[1, 1], [1, 1]], [[1, 0], [0, 0]], [[0, 0], [0, 0]]) == False\", \"assert check_hybrid_pairing([[0]], [[0]], [[0]]) == True\", \"assert check... | {
"split": "train",
"index": 82067,
"acecode_id": "bigcode_python_fns_40822",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function `create_redirect_response(url: str) -> dict` that simulates the behavior of creating a redirection response. The function should take a URL as input and return a dictionary representing a response object with two keys: 'headers' and 'code'. The ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_redirect_response('http://example.com') == {'headers': {'Location': 'http://example.com'}, 'code': 302}\", \"assert create_redirect_response('https://leetcode.com') == {'headers': {'Location': 'https://leetcode.com'}, 'code': 302}\", \"assert create_r... | {
"split": "train",
"index": 82068,
"acecode_id": "bigcode_python_fns_557",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that concatenates a list of strings into a single string. If the list is empty, the function should raise a ValueError with the message 'No objects to concatenate'. Write a function `concat(strings: List[str]) -> str` that takes a lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert concat(['Hello', ' ', 'World']) == 'Hello World'\", \"assert concat(['Python', ' ', 'is', ' ', 'fun']) == 'Python is fun'\", \"assert concat(['Leet', 'Code']) == 'LeetCode'\", \"assert concat(['', 'test']) == 'test'\", \"assert concat(['test', '']) == 'test'... | {
"split": "train",
"index": 82069,
"acecode_id": "bigcode_python_fns_42187",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `intersperse(numbers: List[int], delimeter: int) -> List[int]` that takes a list of integers `numbers` and a single integer `delimeter`. The function should insert the `delimeter` between every two elements of `numbers`. If `delimeter` is negative, its absolute... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert intersperse([], 4) == []\", \"assert intersperse([1, 2, 3], 4) == [1, 4, 2, 4, 3]\", \"assert intersperse([5], 0) == [5]\", \"assert intersperse([7, 8, 9], 1) == [7, 1, 8, 1, 9]\", \"assert intersperse([-1, -2, -3], 2) == [-1, 2, -2, 2, -3]\", \"assert inter... | {
"split": "train",
"index": 82070,
"acecode_id": "evol_13872",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function `msg_warn(message: str) -> None` that takes a string message as input and logs a warning message to the console. The warning message should be formatted as `(!) <message>` where `<message>` is the input string. Your function should not return an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert msg_warn('This is a warning!') == None\", \"assert msg_warn('Disk space low!') == None\", \"assert msg_warn('User not found!') == None\", \"assert msg_warn('Operation failed!') == None\", \"assert msg_warn('Invalid input detected!') == None\", \"assert msg_w... | {
"split": "train",
"index": 82071,
"acecode_id": "bigcode_python_fns_18231",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `intersperse(numbers: List[int], delimeter: int) -> List[Union[int, str]]` that takes a list of integers `numbers` and an integer `delimeter`, and returns a new list where the `delimeter` is inserted between every two consecutive elements of `numbers`. You ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert intersperse([], 0) == []\", \"assert intersperse([1], 2) == [1]\", \"assert intersperse([1, 2], 3) == [1, 3, 2]\", \"assert intersperse([1, 2, 3], 4) == [1, 4, 2, 4, 3]\", \"assert intersperse([5, 6, 7, 8], 9) == [5, 9, 6, 9, 7, 9, 8]\", \"assert intersperse... | {
"split": "train",
"index": 82072,
"acecode_id": "evol_13537",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple messaging system. The system allows users to set a channel and send messages to that channel. Your task is to implement a function that simulates this messaging system with the following specifications: \n\n1. The function should allow ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert messaging_system('general', 'Hello World!', 'general') == 'Hello World!'\", \"assert messaging_system('sports', 'Game on!', 'sports') == 'Game on!'\", \"assert messaging_system('news', 'Breaking news!', 'news') == 'Breaking news!'\", \"assert messaging_syste... | {
"split": "train",
"index": 82073,
"acecode_id": "oss_16813",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function `skip_until_new_line(data: str) -> str` that takes a string input `data`, which can contain multiple lines separated by newline characters (`\\n`). The function should skip all characters in `data` until the first newline character is encountere... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert skip_until_new_line('Hello\\\\nWorld') == 'World'\", \"assert skip_until_new_line('Line1\\\\nLine2\\\\nLine3') == 'Line2\\\\nLine3'\", \"assert skip_until_new_line('NoNewLineHere') == ''\", \"assert skip_until_new_line('\\\\nStartsWithNewLine') == 'StartsWit... | {
"split": "train",
"index": 82074,
"acecode_id": "bigcode_python_fns_22769",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple text-based menu system for a command-line application. The menu should allow users to select options and perform actions based on their choices. Your task is to implement a function that simulates the menu system by returning the approp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert menu_response('1') == 'You selected Option 1'\", \"assert menu_response('2') == 'You selected Option 2'\", \"assert menu_response('4') == 'Invalid choice. Please try again.'\", \"assert menu_response('') == 'Invalid choice. Please try again.'\", \"assert men... | {
"split": "train",
"index": 82075,
"acecode_id": "oss_29667",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing the IDs of foreign keys (FKs) in a database, write a function `get_deleted_fk_ids` that identifies and returns a list of foreign key IDs that have been deleted based on the provided version. The function should take three parameters: a list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_deleted_fk_ids([1, 2, 3, 4, 5], 3, {}) == [1, 2, 4, 5]\", \"assert get_deleted_fk_ids([10, 20, 30, 40], 20, {}) == [10, 30, 40]\", \"assert get_deleted_fk_ids([1000, 2000, 3000], 3000, {}) == [1000, 2000]\", \"assert get_deleted_fk_ids([], 0, {}) == []\"... | {
"split": "train",
"index": 82076,
"acecode_id": "bigcode_python_fns_35425",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, including negative numbers and duplicates, implement a function that sorts the list in increasing order without using any built-in sorting functions. Your function should take a list of integers as input and return a new sorted list.\nPlease reason ste... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bubbleSort([2, 3, 1, -1, 4, 5, 3]) == [-1, 1, 2, 3, 3, 4, 5]\", \"assert bubbleSort([0, -5, 10, 5]) == [-5, 0, 5, 10]\", \"assert bubbleSort([5, 5, 5, 5]) == [5, 5, 5, 5]\", \"assert bubbleSort([8, 3, 7, 2, 1]) == [1, 2, 3, 7, 8]\", \"assert bubbleSort([]) =... | {
"split": "train",
"index": 82077,
"acecode_id": "evol_16539",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers and an integer k, representing a sliding window size. Your task is to implement a function `first_unique_in_window(nums: List[int], k: int) -> List[int]` that returns a list of the first unique integer in the sliding window for each position, or... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert first_unique_in_window([1,2,3,4,5,6], 6) == [1]\", \"assert first_unique_in_window([1,3,5,7,9], 5) == [1]\", \"assert first_unique_in_window([10,20,30,40,50,60], 2) == [10, 20, 30, 40, 50]\", \"assert first_unique_in_window([], 1) == []\", \"assert first_uni... | {
"split": "train",
"index": 82078,
"acecode_id": "evol_16287",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, implement a function that checks if any sub-array of length 3 or more sums to zero. If such a sub-array exists, return the indices of the elements in the sub-array; otherwise, return an empty list. The function should be defined as follows: def sum_t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_to_zero([1, 2, -2, -1, 0]) == [0, 1, 2, 3]\", \"assert sum_to_zero([1, 2, 3, 4]) == []\", \"assert sum_to_zero([-2, -1, 1, 2]) == [0, 1, 2, 3]\", \"assert sum_to_zero([4, 5, 6, 7, 8]) == []\", \"assert sum_to_zero([3, 3, -6]) == [0, 1, 2]\", \"assert sum... | {
"split": "train",
"index": 82079,
"acecode_id": "evol_27361",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function `double_all(numbers)` that receives a list of integers and returns a new list with all the integers doubled. The function should not modify the original list. The input list will contain at least one integer and can contain both positive and negative number... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert double_all([1, 2, 3]) == [2, 4, 6]\", \"assert double_all([-1, -2, -3]) == [-2, -4, -6]\", \"assert double_all([0, 0, 0]) == [0, 0, 0]\", \"assert double_all([5]) == [10]\", \"assert double_all([10, -10, 5]) == [20, -20, 10]\", \"assert double_all([1, -1, 2,... | {
"split": "train",
"index": 82080,
"acecode_id": "evol_29504",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the sum of squares of all even numbers up to a given upper limit n. The function should take an integer n as input and return the sum of the squares of all even integers from 1 to n, inclusive.\nPlease reason step by step, then write a self-... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_squares(10) == 220\", \"assert sum_of_squares(0) == 0\", \"assert sum_of_squares(1) == 0\", \"assert sum_of_squares(2) == 4\", \"assert sum_of_squares(3) == 4\", \"assert sum_of_squares(4) == 20\", \"assert sum_of_squares(5) == 20\", \"assert sum_of_s... | {
"split": "train",
"index": 82081,
"acecode_id": "evol_8430",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing a configuration for a software application. Your task is to implement a function `update_config(config, config_from_cli, config_from_file)` that modifies the `config` dictionary based on the values from `config_from_cli` and `config_from_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_config({}, {'stata_keep_log': True}, {'stata': 'stata_command', 'stata_check_log_lines': 15, 'stata_source_key': 'custom_source'}) == {'markers': {'stata': 'Tasks which are executed with Stata.'}, 'platform': 'linux', 'stata': 'stata_command', 'stata_... | {
"split": "train",
"index": 82082,
"acecode_id": "bigcode_python_fns_7465",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates sending an alert message with a default message body, recipient's phone number, and sender's phone number. Implement a function `send_alert` that takes in the following parameters: `account_sid` (string), `auth_token... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert send_alert('sid123', 'token123') == {'body': 'Default: Found a Deer in backyard', 'to': '+16174125569', 'from_': '+15853265918'}\", \"assert send_alert('sid123', 'token123', 'Urgent: Fire in the building!') == {'body': 'Urgent: Fire in the building!', 'to': ... | {
"split": "train",
"index": 82083,
"acecode_id": "oss_158",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of strings, where each string may contain two values separated by whitespace. Your function should extract these values, process them using a predefined function `canon(var)`, and return a list of results. If a s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_data(['hello world', 'foo bar']) == ['HELLO', 'WORLD', 'FOO', 'BAR']\", \"assert process_data(['hello', 'foo bar', 'baz qux']) == ['FOO', 'BAR', 'BAZ', 'QUX']\", \"assert process_data(['singlevalue', 'valid pair']) == ['VALID', 'PAIR']\", \"assert pr... | {
"split": "train",
"index": 82084,
"acecode_id": "oss_4727",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing digits (0-9) and a list of corresponding sizes (float values) for each digit, write a function `plot_digits(digits: List[int], sizes: List[float]) -> List[str]` that returns a list of strings where each string represents the formatted label... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert plot_digits([1, 2, 3, 4, 5], [0.04, 0.05, 0.02, 0.03, 0.01]) == ['1', '2', '', '4', '']\", \"assert plot_digits([0, 9, 8, 7, 6], [0.03, 0.01, 0.04, 0.06, 0.02]) == ['0', '', '8', '7', '']\", \"assert plot_digits([5], [0.1]) == ['5']\", \"assert plot_digits([... | {
"split": "train",
"index": 82085,
"acecode_id": "bigcode_python_fns_40092",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `profile_completeness(name: str, age: Optional[int], address: Optional[str]) -> float` that takes a user's name, age, and address as input and returns the percentage of the user profile that has been filled out. A complete user profile consists of a name, a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert profile_completeness('John Doe', 30, '123 Main St') == 100.0\", \"assert profile_completeness('Jane Smith', None, '456 Elm St') == 66.66666666666666\", \"assert profile_completeness('Alice', 25, None) == 66.66666666666666\", \"assert profile_completeness(Non... | {
"split": "train",
"index": 82086,
"acecode_id": "evol_18693",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers and an integer K, write a function that finds the Kth smallest integer in the array and replaces its first occurrence with zero. The function should return the modified array. If K is greater than the number of unique elements in the array, return the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_kth_smallest([2, 9, 8, 11, 5], 3) == [2, 9, 0, 11, 5]\", \"assert replace_kth_smallest([5, 5, 5, 5, 5], 1) == [0, 5, 5, 5, 5]\", \"assert replace_kth_smallest([10, 20, 30, 20], 2) == [10, 0, 30, 20]\", \"assert replace_kth_smallest([1, 2, 3], 1) == [... | {
"split": "train",
"index": 82087,
"acecode_id": "evol_30466",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a word. Your task is to determine whether the usage of capital letters in the word is correct according to the following rules: 1. All letters in the word are capitalized, like 'USA'. 2. All letters in the word are not capitalized, like 'leet... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert detectCapitalUse('USA') == True\", \"assert detectCapitalUse('leetcode') == True\", \"assert detectCapitalUse('Google') == True\", \"assert detectCapitalUse('FlaG') == False\", \"assert detectCapitalUse('HELLO') == True\", \"assert detectCapitalUse('world') ... | {
"split": "train",
"index": 82088,
"acecode_id": "oss_31863",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a function that counts the occurrences of characters in a given string, specifically those characters that are surrounded by vowels on both sides. The function should return a dictionary where the keys are the characters and the values are their corresponding counts.\nP... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert quantify_chars('aebicod') == {'b': 1, 'c': 1}\", \"assert quantify_chars('xyz') == {}\", \"assert quantify_chars('xyzzyx') == {}\", \"assert quantify_chars('aabbccdd') == {}\", \"assert quantify_chars('oXo') == {'X': 1}\", \"assert quantify_chars('abcde') ==... | {
"split": "train",
"index": 82089,
"acecode_id": "evol_24854",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries, where each dictionary contains information about a file including a 'filename' and a 'fileid'. Your task is to implement a function that checks which files in the input list have already been processed based on a provided list of previously... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_unprocessed_files([{ 'filename': 'file1.txt', 'fileid': '1234' }, { 'filename': 'file2.txt', 'fileid': '5678' }, { 'filename': None, 'fileid': 'file3.txt' }], ['file1.txt', 'file3.txt']) == [{'filename': 'file2.txt', 'fileid': '5678'}]\", \"assert find_... | {
"split": "train",
"index": 82090,
"acecode_id": "bigcode_python_fns_35869",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates adding a new ingredient to a recipe database. The function should take two inputs: a string representing the name of the ingredient and a dictionary containing the ingredient's details including its alcohol level, volume, a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_new_ingredient('Rum', {'alcohollevel': 37.5, 'volume': 700, 'hand_add': True}) == 'Ingredient with the name: <Rum> added'\", \"assert add_new_ingredient('Tequila', {'alcohollevel': 38, 'volume': 500, 'hand_add': False}) == 'Ingredient with the name: <Teq... | {
"split": "train",
"index": 82091,
"acecode_id": "bigcode_python_fns_40",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary that maps model names to their corresponding classes, and three URLs that provide access to different types of data: products, web users, and SMS users. Your task is to implement a function `get_all_objects` that retrieves data from these URLs and tra... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_all_objects('http://example.com/products', 'http://example.com/webusers', 'http://example.com/smsusers', {'product': ProductModel, 'webuser': WebUserModel, 'smsuser': SMSUserModel}) != []\", \"assert len(get_all_objects('http://example.com/products', 'ht... | {
"split": "train",
"index": 82092,
"acecode_id": "oss_6201",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a string, write a function that returns a list of all substrings that are separated by the semi-colon ';' character. If the input is not a string, the function should return an error message indicating that the input must be a string.\nPlease reason step by step, then wri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_separated_by_semi_colon('Hello;World:I;am;a;programmer') == ['Hello', 'World:I', 'am', 'a', 'programmer']\", \"assert find_separated_by_semi_colon('apple;orange;banana') == ['apple', 'orange', 'banana']\", \"assert find_separated_by_semi_colon(';start;m... | {
"split": "train",
"index": 82093,
"acecode_id": "evol_30122",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `get_mean` that calculates the mean of the integers in the list and returns it rounded to two decimal places. The function should take a single parameter, a list of integers, and return a float. If the list is empty, return 0.0.\nPleas... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_mean([1, 2, 3, 4, 5]) == 3.0\", \"assert get_mean([10, 20, 30]) == 20.0\", \"assert get_mean([-1, -2, -3]) == -2.0\", \"assert get_mean([0, 0, 0]) == 0.0\", \"assert get_mean([]) == 0.0\", \"assert get_mean([5]) == 5.0\", \"assert get_mean([1, 1, 1, 1]) ... | {
"split": "train",
"index": 82094,
"acecode_id": "bigcode_python_fns_17490",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the process of a superuser modifying the details of a regular user in a user management system. The function should accept the following parameters: the email and password of the superuser, the email and password of the reg... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_user_details('admin@example.com', 'securepassword', 'user@example.com', 'userpassword', 'Updated User') == 'Updated User'\", \"assert update_user_details('admin@example.com', 'wrongpassword', 'user@example.com', 'userpassword', 'Updated User') == 'Err... | {
"split": "train",
"index": 82095,
"acecode_id": "oss_28461",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a data structure representing experimental information. The input is a dictionary that contains keys 'Note' and 'Data', where 'Note' is a string describing the experiment, and 'Data' is a list of numerical values representi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_experimental_data({'Note': 'Experiment 1', 'Data': [1, 2, 3, 4, 5]}) == {'Note': 'Experiment 1', 'Sum': 15, 'Average': 3.0}\", \"assert process_experimental_data({'Note': 'Experiment 2', 'Data': [10, 20, 30]}) == {'Note': 'Experiment 2', 'Sum': 60, '... | {
"split": "train",
"index": 82096,
"acecode_id": "bigcode_python_fns_35774",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with counting the number of contigs in a given set of DNA sequences. A contig is a contiguous sequence of DNA or RNA. You will implement a function `count_contigs(contig_set)` that takes in a single parameter `contig_set`, which is a list of strings representing ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_contigs(['ATCG', 'GCTA', 'TTAG']) == 3\", \"assert count_contigs(['A', 'C', 'G', 'T']) == 4\", \"assert count_contigs([]) == 0\", \"assert count_contigs(['AA', 'AA', 'AA']) == 3\", \"assert count_contigs(['ATCG', 'GCGC', 'ATAT', 'CGCG']) == 4\", \"asse... | {
"split": "train",
"index": 82097,
"acecode_id": "oss_36456",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `detect_sequences(string: str) -> bool` that checks if a given string starts with the uppercase letter 'M' and ends with the lowercase letter 'x'. The function should return `True` if the string meets these criteria, and `False` otherwise.\nPlease reason step b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert detect_sequences('Mhello worldx') == True\", \"assert detect_sequences('M123x') == True\", \"assert detect_sequences('M!@#x') == True\", \"assert detect_sequences('Mabcx') == True\", \"assert detect_sequences('Mxyz') == False\", \"assert detect_sequences('He... | {
"split": "train",
"index": 82098,
"acecode_id": "evol_10932",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `arm_system()` that simulates the arming of a security system. The function should be called without any parameters and will return a boolean value indicating whether the system was successfully armed or not. For this simulation, the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert arm_system() is True\", \"assert arm_system() is True\", \"assert arm_system() is True\", \"assert arm_system() is True\", \"assert arm_system() is True\", \"assert arm_system() is True\", \"assert arm_system() is True\", \"assert arm_system() is True\", \"a... | {
"split": "train",
"index": 82099,
"acecode_id": "bigcode_python_fns_30123",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.