data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "Given an integer `num`, implement a function `is_prime(num)` that checks whether the number 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 `num` is a pr... | 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": 69000,
"acecode_id": "oss_10848",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program that calculates the final grade for a student based on their numerical score. The grading system is as follows: A+ : 97 - 100, A : 90 - 96, B+ : 87 - 89, B : 80 - 86, C+ : 70 - 79, C : 60 - 69, D : 50 - 59, F : 0 - 49. Write a function `ge... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_student_grade('John', 85) == 'John B'\", \"assert get_student_grade('Alice', 92) == 'Alice A'\", \"assert get_student_grade('Bob', 97) == 'Bob A+'\", \"assert get_student_grade('Charlie', 76) == 'Charlie C+'\", \"assert get_student_grade('David', 45) == ... | {
"split": "train",
"index": 69001,
"acecode_id": "oss_8137",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that filters out certain lines from a given multiline string based on specified prefixes and regex patterns. The function should take two optional parameters: `filtered_prefixes` and `filtered_patterns`. If `filtered_prefixes` is not ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_output('pid: process started\\\\ninfo: all systems go\\\\nrc: process ended\\\\nerror: something went wrong', ['pid', 'rc'], ['error']) == 'info: all systems go\\\\n'\", \"assert filter_output('debug: this is a debug message\\\\nwarning: potential iss... | {
"split": "train",
"index": 69002,
"acecode_id": "bigcode_python_fns_25146",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `generate_unique_numbers(x)` that takes an integer x (where x > 10) and returns a list of 10 unique random integers from the range 0 to x (inclusive). Your implementation should ensure that the numbers generated are unique and fall within the specified range. I... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_unique_numbers(15) != generate_unique_numbers(15)\", \"assert len(generate_unique_numbers(20)) == 10\", \"assert all(0 <= num <= 20 for num in generate_unique_numbers(20))\", \"assert len(set(generate_unique_numbers(30))) == 10\", \"assert all(0 <= ... | {
"split": "train",
"index": 69003,
"acecode_id": "evol_25192",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating a full URL for accessing a specific resource on a server. The base URL of the server is defined as 'http://localhost:8000'. Your function should take a resource name as input and return the full URL to access that resource on the server. The resou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_resource_url('users') == 'http://localhost:8000/users'\", \"assert get_resource_url('products') == 'http://localhost:8000/products'\", \"assert get_resource_url('orders') == 'http://localhost:8000/orders'\", \"assert get_resource_url('inventory') == 'htt... | {
"split": "train",
"index": 69004,
"acecode_id": "oss_23618",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `calculate_product(my_list)` that returns the product of all the integers in the list. The function should handle the case where the list may be empty by returning 1, as the product of an empty set is defined to be 1.\nPlease reaso... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_product([1, 2, 3]) == 6\", \"assert calculate_product([-1, -2, -3]) == -6\", \"assert calculate_product([0, 1, 2]) == 0\", \"assert calculate_product([]) == 1\", \"assert calculate_product([10]) == 10\", \"assert calculate_product([1, 0, 2, 3]) == ... | {
"split": "train",
"index": 69005,
"acecode_id": "evol_27216",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple JWT (JSON Web Token) validation process. Implement a function `validate_jwt(token: str) -> bool` that takes a JWT token as input and checks if it is valid. For the purpose of this problem, consider the following cr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_jwt('') == False\", \"assert validate_jwt('header.payload') == False\", \"assert validate_jwt('header.payload.signature.extra') == False\", \"assert validate_jwt('header.payload.signature!') == False\", \"assert validate_jwt('header..signature') == ... | {
"split": "train",
"index": 69006,
"acecode_id": "bigcode_python_fns_45312",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function that inserts a specified value into a binary search tree while ensuring that the tree maintains its balance as an AVL tree after the insertion. The function should take the root of the tree and the value to be inserted as parameters, and return the new root... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert insert(Node(5), 10).val == 5\", \"assert insert(Node(5), 4).val == 5\", \"assert insert(Node(5), 6).val == 5\", \"assert insert(Node(5), 2).val == 5\", \"assert insert(Node(5), 1).val == 5\", \"assert insert(Node(5), 3).val == 5\", \"assert insert(Node(5), 7... | {
"split": "train",
"index": 69007,
"acecode_id": "evol_1",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `get_unique_numbers(nums: List[int]) -> List[int]` that returns a list containing the unique integers from the input list in ascending order. The input list may contain duplicates and will have at least one element. The output list sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_numbers([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert get_unique_numbers([5, 5, 5, 5]) == [5]\", \"assert get_unique_numbers([1, 1, 2, 2, 3]) == [1, 2, 3]\", \"assert get_unique_numbers([1, 2, 2, 3, 4, 4]) == [1, 2, 3, 4]\", \"assert get_unique_... | {
"split": "train",
"index": 69008,
"acecode_id": "bigcode_python_fns_4208",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers, and your task is to implement a function `sum_positive_integers` that returns the sum of all positive integers in the list. If there are no positive integers, the function should return 0. The input will be a list of integers, and the output wi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_positive_integers([1, 2, 3, -4, -5]) == 6\", \"assert sum_positive_integers([-1, -2, -3, -4]) == 0\", \"assert sum_positive_integers([]) == 0\", \"assert sum_positive_integers([0, 0, 0]) == 0\", \"assert sum_positive_integers([5, 10, -3, 2]) == 17\", \"a... | {
"split": "train",
"index": 69009,
"acecode_id": "oss_32121",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to simulate the movement of a ship in a 2D grid. The ship's position is represented by a pair of coordinates (x, y), where x and y are integers. You need to implement a function `ship_movement(moves: List[Tuple[int, int]]) -> Tuple[in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert ship_movement([(3, 4)]) == (3, 4, 5.0)\", \"assert ship_movement([(1, 1), (2, 2)]) == (2, 2, 2.8284271247461903)\", \"assert ship_movement([(0, 0)]) == (0, 0, 0.0)\", \"assert ship_movement([(5, 5), (10, 10)]) == (10, 10, 14.142135623730951)\", \"assert ship... | {
"split": "train",
"index": 69010,
"acecode_id": "oss_17663",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of product dictionaries and returns a list of product names that have a price greater than a specified threshold. Each product dictionary contains the following fields: 'id' (integer), 'name' (string), and 'price' (decim... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_expensive_products([{'id': 1, 'name': 'Product A', 'price': 10.0}, {'id': 2, 'name': 'Product B', 'price': 20.0}, {'id': 3, 'name': 'Product C', 'price': 30.0}], 15.0) == ['Product B', 'Product C']\", \"assert filter_expensive_products([{'id': 1, 'nam... | {
"split": "train",
"index": 69011,
"acecode_id": "oss_30697",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_cube_of_prime(b)` that checks whether the input number `b` is the cube of a single prime number. The function should return `True` if `b` is the cube of a prime number, and `False` otherwise. The input variable `b` is guaranteed to be less than 2000.\nP... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_cube_of_prime(1) == False\", \"assert is_cube_of_prime(8) == True\", \"assert is_cube_of_prime(27) == True\", \"assert is_cube_of_prime(64) == False\", \"assert is_cube_of_prime(125) == False\", \"assert is_cube_of_prime(216) == False\", \"assert is_cube_... | {
"split": "train",
"index": 69012,
"acecode_id": "evol_22449",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that checks for the presence of a specific keyword in a list of strings. The function should accept a list of strings and a keyword as input. If the keyword is present in the list, the function should return 'Keyword found'. If the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_keyword_presence(['apple', 'banana', 'cherry'], 'banana') == 'Keyword found'\", \"assert check_keyword_presence(['apple', 'banana', 'cherry'], 'grape') == 'Keyword not found'\", \"assert check_keyword_presence([], 'anyword') == 'Keyword not found'\", \... | {
"split": "train",
"index": 69013,
"acecode_id": "oss_9193",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that finds the longest word in a given string and counts the number of vowels in that word. The input string may contain punctuation and numbers which should not be included in the word length count. Additionally, the string might have consecutive spaces, t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longest_word('Hello, world!') == ('Hello', 2)\", \"assert longest_word('This is a test sentence.') == ('sentence', 3)\", \"assert longest_word('Python 3.8 is great!') == ('Python', 1)\", \"assert longest_word('') == ('', 0)\", \"assert longest_word('pneumono... | {
"split": "train",
"index": 69014,
"acecode_id": "evol_32784",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that extracts the repository name from a given GitHub URL. The function should take a string representing the GitHub URL as input and return the repository name. The repository name is the last part of the URL and should not includ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_repo_name('https://github.com/user/repo-name') == 'repo-name'\", \"assert extract_repo_name('https://github.com/another_user/another_repo') == 'another_repo'\", \"assert extract_repo_name('https://github.com/owner/repository-123') == 'repository-123'... | {
"split": "train",
"index": 69015,
"acecode_id": "oss_34052",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a m x n grid, where each cell contains an integer representing a direction (1 for right, 2 for left, 3 for down, 4 for up) or 0 for an obstacle, write a function `minCost(grid)` that returns the minimum cost to modify the grid so that there exists at least one valid path ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert minCost([[1,1,1,1],[2,2,2,2],[1,1,1,1],[2,2,2,2]]) == 3\", \"assert minCost([[1,2],[4,3]]) == 1\", \"assert minCost([[2,2,2],[2,2,2]]) == 3\", \"assert minCost([[4]]) == 0\", \"assert minCost([[1,1,1],[0,0,1],[1,1,1]]) == 2\", \"assert minCost([[0,0],[0,0]])... | {
"split": "train",
"index": 69016,
"acecode_id": "evol_24801",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `read_int_from_bytes(data: bytes) -> int` that reads an integer from a given bytes object. The integer is represented in little-endian format and occupies 4 bytes. Your function should extract this integer from the first 4 bytes of th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert read_int_from_bytes(b'\\\\x01\\\\x00\\\\x00\\\\x00') == 1\", \"assert read_int_from_bytes(b'\\\\xFF\\\\xFF\\\\xFF\\\\xFF') == -1\", \"assert read_int_from_bytes(b'\\\\x00\\\\x00\\\\x00\\\\x00') == 0\", \"assert read_int_from_bytes(b'\\\\x02\\\\x00\\\\x00\\\\... | {
"split": "train",
"index": 69017,
"acecode_id": "bigcode_python_fns_36634",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that can parse and convert a string representation of numbers into their numerical form. The function should handle various formats of numbers, including integers, floats, and comma-separated numbers. Additionally, the function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_numbers('1,000', '2000.50') == [1000.0, 2000.5]\", \"assert parse_numbers('0', '0.0') == [0.0, 0.0]\", \"assert parse_numbers('100', '200') == [100.0, 200.0]\", \"assert parse_numbers('10.5', '20.75') == [10.5, 20.75]\", \"assert parse_numbers('2.5e3',... | {
"split": "train",
"index": 69018,
"acecode_id": "oss_34338",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are presented with a string denoted by s. Your task is to determine if the string has a 'happy' attribute. A string is considered 'happy' if it meets the following criteria: it must have a length of at least 3, every group of 3 consecutive characters must be non-repetitive ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_happy('abc') == False\", \"assert is_happy('aabbcc') == False\", \"assert is_happy('abcabc') == True\", \"assert is_happy('aaabbb') == False\", \"assert is_happy('abcde') == False\", \"assert is_happy('aabb') == False\", \"assert is_happy('xyzxyz') == Tru... | {
"split": "train",
"index": 69019,
"acecode_id": "evol_24760",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that merges two lists while ensuring that all elements in the second list are added to the first list only if they are not already present. The order of elements from the second list should be preserved in the final output. Write a functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_unique_lists([1, 2, 3], [3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert merge_unique_lists(['a', 'b'], ['b', 'c']) == ['a', 'b', 'c']\", \"assert merge_unique_lists([], [1, 2, 3]) == [1, 2, 3]\", \"assert merge_unique_lists([1, 2, 2], [2, 3, 4]) == [1, 2, 2,... | {
"split": "train",
"index": 69020,
"acecode_id": "bigcode_python_fns_39408",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that takes in a list of integers and returns the sum of all even numbers in the list. If there are no even numbers, the function should return 0. Write a Python function `sum_of_evens` with the following signature: `def sum_of_even... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([2, 4, 6, 8]) == 20\", \"assert sum_of_evens([1, 3, 5]) == 0\", \"assert sum_of_evens([]) == 0\", \"assert sum_of_evens([0]) == 0\", \"assert sum_of_evens([1, 2, -3, 4]) == 6\", \"assert sum_of_even... | {
"split": "train",
"index": 69021,
"acecode_id": "oss_29394",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a workspace path, implement a function that returns a tuple containing the absolute path of the workspace if it is valid, or an error message if the path is not provided or if the constructed path does not start with a specified root directory. The r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_real_path('project1') == ('C:/workspace/project1', None)\", \"assert get_real_path('') == (None, 'No path is given')\", \"assert get_real_path('project2/docs') == ('C:/workspace/project2/docs', None)\", \"assert get_real_path('subfolder/../project3') == ... | {
"split": "train",
"index": 69022,
"acecode_id": "bigcode_python_fns_2152",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers, `delta_y` and `delta_x`, representing the vertical and horizontal changes respectively, implement a function `atand2(delta_y: List[int], delta_x: List[int]) -> List[float]` that returns a list of angles in degrees calculated using the arctangent of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert atand2([0, 0, 0], [0, 0, 0]) == [0.0, 0.0, 0.0]\", \"assert atand2([-1, -1], [1, -1]) == [-45.0, -135.0]\", \"assert atand2([3, -3], [0, 0]) == [90.0, -90.0]\", \"assert atand2([-3, 3], [3, -3]) == [-45.0, 135.0]\", \"assert atand2([0, 10], [10, 0]) == [0.0,... | {
"split": "train",
"index": 69023,
"acecode_id": "bigcode_python_fns_35556",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple cache system that supports key-value pair operations. Your cache should have a maximum capacity and allow the following operations: retrieving a value by its key, inserting or updating a value, and deleting a value by its key. When the cach... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cache_operations([('put', 1, 1), ('put', 2, 2), ('get', 1)], 2) == [1]\", \"assert cache_operations([('put', 1, 1), ('put', 2, 2), ('get', 3)], 2) == [-1]\", \"assert cache_operations([('put', 1, 1), ('put', 2, 2), ('put', 3, 3), ('get', 2)], 2) == [2]\", \"... | {
"split": "train",
"index": 69024,
"acecode_id": "oss_28425",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a recursive function in Python that calculates the nth Fibonacci number. The function should take a single integer parameter n (0-indexed) and return the nth Fibonacci number. Be aware that using a recursive approach may lead to high stack memory utilization for large... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci_recursive(0) == 0\", \"assert fibonacci_recursive(1) == 1\", \"assert fibonacci_recursive(2) == 1\", \"assert fibonacci_recursive(3) == 2\", \"assert fibonacci_recursive(4) == 3\", \"assert fibonacci_recursive(5) == 5\", \"assert fibonacci_recursiv... | {
"split": "train",
"index": 69025,
"acecode_id": "evol_2701",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer `nb_filter`, `nb_row`, and `nb_col`, as well as an optional tuple `stride` (default is (2, 2)) and a string `activation` (default is 'relu'), implement a function `time_dconv_bn_nolinear(nb_filter: int, nb_row: int, nb_col: int, stride: tuple = (2, 2), activati... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert time_dconv_bn_nolinear(32, 3, 3) == \\\"Layer: TimeDistributed(UnPooling2D(size=(2, 2))), TimeDistributed(ReflectionPadding2D(padding=(1, 1))), TimeDistributed(Conv2D(32, (3, 3), padding='valid')), TimeDistributed(BatchNormalization()), TimeDistributed(Activ... | {
"split": "train",
"index": 69026,
"acecode_id": "bigcode_python_fns_33225",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a Python function that generates a list of integers in a decrementing sequence starting from a given integer down to zero. The function should return this list. For example, if the input is 5, the output should be [5, 4, 3, 2, 1, 0].\nPlease reason step by step, then ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decrementing_sequence(10) == [10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]\", \"assert decrementing_sequence(5) == [5, 4, 3, 2, 1, 0]\", \"assert decrementing_sequence(0) == [0]\", \"assert decrementing_sequence(1) == [1, 0]\", \"assert decrementing_sequence(3) == [3, ... | {
"split": "train",
"index": 69027,
"acecode_id": "evol_4384",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a list of hexadecimal strings, write a function that returns the number of unique hexadecimal hashes present in the list. A hexadecimal string is considered unique if it has not appeared previously in the list. The function should ignore case when determining uniqueness. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_hex_hashes(['7e2c3861f556686d7bc3ce4e93fa0011020868dc769838aca66bcc82010a2c60', '7E2C3861F556686D7BC3CE4E93FA0011020868DC769838ACA66BCC82010A2C60']) == 1\", \"assert count_unique_hex_hashes(['7e2c3861f556686d7bc3ce4e93fa0011020868dc769838aca66bc... | {
"split": "train",
"index": 69028,
"acecode_id": "bigcode_python_fns_22503",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `get_datasets` that takes in two parameters: `opt` (a dictionary containing configuration options) and `dataset_type` (a string that can either be 'train' or 'val'). The function should return a specific dataset based on the `dataset_type... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_datasets({'val_interval': 10}, 'train') == 'Training Dataset'\", \"assert get_datasets({'val_interval': 10}, 'val') == 'Validation Dataset'\", \"assert get_datasets({'val_interval': 10}, 'test') == 'Invalid dataset type'\", \"assert get_datasets({}, 'tra... | {
"split": "train",
"index": 69029,
"acecode_id": "bigcode_python_fns_45393",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of partitions, where each partition is a dictionary containing the keys 'lon_min', 'lat_min', 'lon_max', and 'lat_max', return the bounding box that encompasses all the partitions. The bounding box should be represented as a list containing two points, where each p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert _orbit_bbox([{'lon_min': 1, 'lat_min': 2, 'lon_max': 3, 'lat_max': 4}, {'lon_min': -1, 'lat_min': 0, 'lon_max': 2, 'lat_max': 5}]) == [[-1, 0], [3, 5]]\", \"assert _orbit_bbox([{'lon_min': 10, 'lat_min': 20, 'lon_max': 30, 'lat_max': 40}, {'lon_min': 5, 'lat... | {
"split": "train",
"index": 69030,
"acecode_id": "bigcode_python_fns_34275",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists: `location_descriptors` and `gene_descriptors`. Each list contains strings and integers representing specific genomic information. Your task is to implement a function `transcript_segments(location_descriptors: List[Union[str, int]], gene_descriptors: Li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transcript_segments([3, 5, 10, 15], ['NM_152263.3', 'NM_034348.3']) == [{'transcript': 'refseq:NM_152263.3', 'exon_start': 1, 'exon_end': 8, 'gene_descriptor': 'NM_152263.3', 'component_genomic_start': 10, 'component_genomic_end': 15}]\", \"assert transcript... | {
"split": "train",
"index": 69031,
"acecode_id": "bigcode_python_fns_46372",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the factorial of a given non-negative integer and also counts the number of trailing zeroes in the factorial result. The function should return an error message if the input is not a non-negative integer. The function signature is as follows... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert factorial_with_trailing_zeros(0) == 'Factorial is: 1, Number of trailing zeroes is: 0'\", \"assert factorial_with_trailing_zeros(1) == 'Factorial is: 1, Number of trailing zeroes is: 0'\", \"assert factorial_with_trailing_zeros(2) == 'Factorial is: 2, Number... | {
"split": "train",
"index": 69032,
"acecode_id": "evol_32702",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two data types represented as strings, implement a function that promotes them to a compatible type according to the following rules: If both types are the same, return that type. If they are different, return the more general type that can contain both. The types to cons... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert promote('int32', 'int32') == 'int32'\", \"assert promote('int64', 'int64') == 'int64'\", \"assert promote('int32', 'int64') == 'int64'\", \"assert promote('int64', 'int32') == 'int64'\", \"assert promote('Option(int32)', 'int32') == 'Option(int32)'\", \"asse... | {
"split": "train",
"index": 69033,
"acecode_id": "bigcode_python_fns_297",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `generate_auth_ticket_url` that receives a user ID and a session token as input and returns the authentication ticket URL for that user. The URL format is as follows: `https://example.com/auth?user_id={user_id}&session_token={session_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_auth_ticket_url('user123', 'token456') == 'https://example.com/auth?user_id=user123&session_token=token456'\", \"assert generate_auth_ticket_url('user123', '') == 'Invalid parameters'\", \"assert generate_auth_ticket_url('', 'token456') == 'Invalid ... | {
"split": "train",
"index": 69034,
"acecode_id": "oss_22834",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that formats a given log message by replacing specific placeholders with corresponding sequences. The function should accept a string `message` and a boolean `use_color`. If `use_color` is `True`, the function should replace all occurrenc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert formatter_message('Hello $BOLD World!', True) == 'Hello BOLD_SEQ World!'\", \"assert formatter_message('This is a test $RESET message.', True) == 'This is a test RESET_SEQ message.'\", \"assert formatter_message('No formatting here.', True) == 'No formatting... | {
"split": "train",
"index": 69035,
"acecode_id": "bigcode_python_fns_26847",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the process of checking whether a database can be cleared based on specific conditions. The function `can_clear_db` should take in three parameters: `env` (a string representing the current environment), `arg_env` (a st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_clear_db('development', '', False) == True\", \"assert can_clear_db('development', 'development', False) == True\", \"assert can_clear_db('testing', 'testing', True) == True\", \"assert can_clear_db('production', '', False) == False\", \"assert can_clear... | {
"split": "train",
"index": 69036,
"acecode_id": "bigcode_python_fns_9504",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing pixel values in an image. Write a function `filter_high_mean_values(pixel_values: List[int], threshold: int) -> List[int]` that filters the pixel values to keep only those whose average value is greater than a specified threshold. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_high_mean_values([100, 150, 200, 250], 170) == [200, 250]\", \"assert filter_high_mean_values([255, 255, 255], 200) == [255, 255, 255]\", \"assert filter_high_mean_values([100, 200, 300], 150) == [200, 300]\", \"assert filter_high_mean_values([180, 19... | {
"split": "train",
"index": 69037,
"acecode_id": "bigcode_python_fns_9590",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of dictionaries representing information about cloud storage volumes. Each dictionary contains the following keys: 'Attachments', 'AvailabilityZone', 'CreateTime', 'Encrypted', 'Size', 'SnapshotId', 'State', 'Vol... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_volumes([]) == 0\", \"assert process_volumes([{'Attachments': [], 'AvailabilityZone': 'us-west-2', 'CreateTime': '2023-01-01T00:00:00Z', 'Encrypted': False, 'Size': 100, 'SnapshotId': 'snap-123', 'State': 'available', 'VolumeId': 'vol-001', 'Iops': 3... | {
"split": "train",
"index": 69038,
"acecode_id": "bigcode_python_fns_15009",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with validating the arguments for a function that processes CSV files. Specifically, you need to ensure that the flags `replace` and `out_dir` cannot be used simultaneously. Create a function `validate_arguments(replace: bool, out_dir: str) -> None` that raises a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_arguments(False, '') is None\", \"assert validate_arguments(True, '') is None\", \"assert validate_arguments(False, 'output_dir') is None\", \"assert validate_arguments(True, '') is None\", \"assert validate_arguments(False, 'another_output_dir') is... | {
"split": "train",
"index": 69039,
"acecode_id": "bigcode_python_fns_46515",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Write a function `find_urls_in_text(text: str) -> List[str]` that extracts all valid URLs from a given text string. A valid URL starts with 'http://' or 'https://', followed by any combination of letters, digits, and special characters. The function should return a list of uniq... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_urls_in_text('Visit us at http://example.com for more info.') == ['http://example.com']\", \"assert find_urls_in_text('No URLs here!') == []\", \"assert find_urls_in_text('https://valid-url.com is valid while htt://invalid-url.com is not.') == ['https:/... | {
"split": "train",
"index": 69040,
"acecode_id": "evol_34104",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a string and a list of replacement pairs. Each replacement pair consists of a target substring and its replacement substring. Your function should replace all occurrences of the target substrings in the input string with their ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_substrings('hello world', [('hello', 'hi'), ('world', 'there')]) == 'hi there'\", \"assert replace_substrings('abcabc', [('a', 'x'), ('b', 'y')]) == 'xycxyc'\", \"assert replace_substrings('python programming', [('python', 'java')]) == 'java programm... | {
"split": "train",
"index": 69041,
"acecode_id": "bigcode_python_fns_39758",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of frames and a specified image type. Your task is to implement a function that checks if each frame in the list matches the specified image type. The function should return a list of boolean values where each value indicates whether the corresponding frame... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert frame_pass_valid_sample_criteria(['jpg', 'png', 'gif'], 'png') == [False, True, False]\", \"assert frame_pass_valid_sample_criteria(['bmp', 'tiff', 'jpeg'], 'jpeg') == [False, False, True]\", \"assert frame_pass_valid_sample_criteria(['webp', 'png', 'webp'],... | {
"split": "train",
"index": 69042,
"acecode_id": "bigcode_python_fns_37396",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a word as input and returns its length. If the word is empty, the function should return 0. Implement a function named `get_word_length` that follows this specification. The function should handle any string input and return an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_word_length('hello') == 5\", \"assert get_word_length('') == 0\", \"assert get_word_length('a') == 1\", \"assert get_word_length('python') == 6\", \"assert get_word_length('LeetCode') == 8\", \"assert get_word_length(' ') == 2\", \"assert get_word_lengt... | {
"split": "train",
"index": 69043,
"acecode_id": "bigcode_python_fns_25896",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `is_valid_user_profile(name: str, email: str, password: str) -> bool` that checks whether the provided user profile information is valid. The function should return True if the name is non-empty, the email follows a valid format, and the password meets the foll... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_user_profile('Alice', 'alice@example.com', 'StrongP@ss1') == True\", \"assert is_valid_user_profile('Bob', 'bob@example', 'Password123!') == False\", \"assert is_valid_user_profile('', 'charlie@example.com', 'Password123!') == False\", \"assert is_v... | {
"split": "train",
"index": 69044,
"acecode_id": "evol_16614",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that applies a final configuration for a web server. The configuration is represented as a dictionary, which contains various settings. One of the settings is 'template_dir', which can either be a valid directory path (as a string) or... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert apply_configuration({'template_dir': 'False'}) == {'template_dir': 'default/theme/templates'}\", \"assert apply_configuration({'template_dir': '/custom/path'}) == {'template_dir': '/custom/path'}\", \"assert apply_configuration({'template_dir': 'False', 'set... | {
"split": "train",
"index": 69045,
"acecode_id": "oss_23616",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating email content for user verification and password reset for a web application. Implement a function `generate_email_content` that takes in the following parameters: a dictionary `user` containing the user's `full_name` and `email`, a string `verifi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_email_content({'full_name': 'Alice Smith', 'email': 'alice@example.com'}, 'https://example.com/verify?token=12345', 'https://example.com/reset-password') == {'verification_email': {'sender': 'YourApp <noreply@yourapp.com>', 'subject': 'Verify your e... | {
"split": "train",
"index": 69046,
"acecode_id": "oss_2520",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a template string and replaces all occurrences of the substring 'mvp' with a given project name. The function should return the modified string. Implement a function named `replace_template(template: str, name: str) -> str:`. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_template('This is an mvp project', 'MyProject') == 'This is an MyProject project'\", \"assert replace_template('mvp is the key to success', 'Ultimate') == 'Ultimate is the key to success'\", \"assert replace_template('No replacement needed here', 'Na... | {
"split": "train",
"index": 69047,
"acecode_id": "bigcode_python_fns_20805",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of field names and a field name to search for. The function should return a message indicating whether the specified field name exists in the list of field names. If it does not exist, the function should return a me... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_field_existence(['ls_secs', 'is_router', 'fixed_position'], 'ls_secs') == 'Field ls_secs exists.'\", \"assert check_field_existence([], 'any_field') == 'does not have an attribute called any_field. Available fields: '\", \"assert check_field_existence(... | {
"split": "train",
"index": 69048,
"acecode_id": "bigcode_python_fns_48828",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a list of positive integers, implement a function `check_product_coprime(nums)` that returns True if the product of all the numbers in the list is a prime number, and False otherwise. A prime number is defined as a number greater than 1 that is only divisible by 1 and its... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_product_coprime([4, 6]) == False\", \"assert check_product_coprime([7]) == True\", \"assert check_product_coprime([1, 1, 1]) == False\", \"assert check_product_coprime([2, 4]) == False\", \"assert check_product_coprime([2, 2, 2]) == False\", \"assert c... | {
"split": "train",
"index": 69049,
"acecode_id": "evol_21787",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a bitmap representation from a given buffer of RGBA values. The function should take three parameters: an integer width, an integer height, and a list of integers representing the RGBA data. Each pixel in the bitmap is repr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert BitmapFromBufferRGBA(2, 2, [255, 0, 0, 255, 0, 255, 0, 255, 0, 0, 255, 255, 255, 255, 255, 0]) == [[(255, 0, 0, 255), (0, 255, 0, 255)], [(0, 0, 255, 255), (255, 255, 255, 0)]]\", \"assert BitmapFromBufferRGBA(1, 1, [123, 231, 12, 255]) == [[(123, 231, 12, 2... | {
"split": "train",
"index": 69050,
"acecode_id": "bigcode_python_fns_46963",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a string containing a full name in the format 'first middle last', write a function `extract_last_name(full_name)` that takes a string `full_name` as input and returns the last name. The input string will always contain at least a first name and a last name. For example, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_last_name('John William Smith') == 'Smith'\", \"assert extract_last_name('Alice Marie Johnson') == 'Johnson'\", \"assert extract_last_name('Michael Jordan') == 'Jordan'\", \"assert extract_last_name('Elon Musk') == 'Musk'\", \"assert extract_last_nam... | {
"split": "train",
"index": 69051,
"acecode_id": "oss_6268",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `sort_alphanumeric(input_string: str) -> List[str]` that takes a string `input_string` as input and returns a list of unique alphanumeric characters sorted in descending alphabetical order. The function should ignore special characters and numbers should be... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_alphanumeric('abc123!@#') == ['c', 'b', 'a', '3', '2', '1']\", \"assert sort_alphanumeric('!@#$%^&*()') == []\", \"assert sort_alphanumeric('aaa111') == ['a', '1']\", \"assert sort_alphanumeric('abcABC123') == ['c', 'b', 'a', 'C', 'B', 'A', '3', '2', '1... | {
"split": "train",
"index": 69052,
"acecode_id": "evol_20920",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary of books where each book has associated data in the form of a tuple containing eight elements: (rating, review_count, price, publication_year, page_count, stock, author, genre). You need to implement a function `filter_and_sort_books(books, min_values... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_and_sort_books({'Book1': (10.0, 4.5, 200, 2021, 5000, 100, 'Author1', 'Fiction')}, [5.0, 4.0, 100, 2000, 1000, 50, 'Author1', 'Fiction']) == [('Book1', (10.0, 4.5, 200, 2021, 5000, 100, 'Author1', 'Fiction'))]\", \"assert filter_and_sort_books({'Book1... | {
"split": "train",
"index": 69053,
"acecode_id": "evol_26290",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes two square matrices (2D lists) of size n x n, where 1 ≤ n ≤ 1000, and returns their product as another square matrix of size n x n. Each element in the matrices can be any integer from -1000 to 1000. Do not use any built-in functions related to m... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multiply_matrices([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\", \"assert multiply_matrices([[1]], [[2]]) == [[2]]\", \"assert multiply_matrices([[1, 0], [0, 1]], [[1, 2], [3, 4]]) == [[1, 2], [3, 4]]\", \"assert multiply_matrices([[0, 0], [0... | {
"split": "train",
"index": 69054,
"acecode_id": "evol_10323",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that manages addressing information for a supply chain record system. The system uses namespaces for supply chain records. Your task is to implement a function `get_full_namespace(agent_namespace, record_id)` that takes two parameters... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_full_namespace('agent1', 'recordA') == 'supplychain.agent1.recordA'\", \"assert get_full_namespace('agent2', 'recordB') == 'supplychain.agent2.recordB'\", \"assert get_full_namespace('agentXYZ', 'record123') == 'supplychain.agentXYZ.record123'\", \"asser... | {
"split": "train",
"index": 69055,
"acecode_id": "oss_10324",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of floating-point numbers, implement a function `mean_absolute_deviation(input_numbers: List[float]) -> float` that calculates the Mean Absolute Deviation (MAD) of the numbers in the list. The Mean Absolute Deviation is defined as the average of the absolute deviat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert mean_absolute_deviation([1.0, 2.0, 3.0, 4.0]) == 1.0\", \"assert mean_absolute_deviation([1.0, 1.0, 1.0]) == 0.0\", \"assert mean_absolute_deviation([1.0, 2.0, 3.0]) == 0.6666666666666666\", \"assert mean_absolute_deviation([-1.0, 0.0, 1.0]) == 0.66666666666... | {
"split": "train",
"index": 69056,
"acecode_id": "evol_14766",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary where the keys are strings representing column names and the values are strings representing descriptions of the columns, implement a function `highlight_column_descriptions(columns: Dict[str, str]) -> Dict[str, str]` that returns a new dictionary. In the new... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert highlight_column_descriptions({'Name': 'The name of the person', 'Age': 'The age of the person'}) == {'Name': '<highlight>The name of the person</highlight>', 'Age': '<highlight>The age of the person</highlight>'}\", \"assert highlight_column_descriptions({'... | {
"split": "train",
"index": 69057,
"acecode_id": "bigcode_python_fns_38507",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function that takes a given string as input and replaces all occurrences of the letter 'a' (case-sensitive) with the letter 'e'. Implement the function `replace_a_with_e(string: str) -> str`.\nPlease reason step by step, then write a self-contained Python solution. Giv... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_a_with_e('apple') == 'epple'\", \"assert replace_a_with_e('banana') == 'benene'\", \"assert replace_a_with_e('a') == 'e'\", \"assert replace_a_with_e('hello') == 'hello'\", \"assert replace_a_with_e('aaa') == 'eee'\", \"assert replace_a_with_e('xyz')... | {
"split": "train",
"index": 69058,
"acecode_id": "evol_18034",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a database password and an optional image tag (defaulting to 'latest_image'). Write a function `migrate` that takes two parameters: a string `db_pass` representing the database password and an optional string `image` representing the name of the image. The functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert migrate('secure_password') == \\\"docker run --rm --net my_network -e ST_DB_USER=user123 -e ST_DB_PASS=secure_password -e ST_DB_HOST=db_container -e ST_DB_NAME=my_database latest_image python3 -m seventweets migrate\\\"\", \"assert migrate('12345') == \\\"do... | {
"split": "train",
"index": 69059,
"acecode_id": "bigcode_python_fns_32188",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `s` consisting of lowercase and uppercase letters, write a function `replace_letters` that replaces all occurrences of lowercase letters in the string with their corresponding uppercase letters without using the `replace` method. The function should return the mo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_letters('hello') == 'HELLO'\", \"assert replace_letters('') == ''\", \"assert replace_letters('123abcXYZ') == '123ABCXYZ'\", \"assert replace_letters('Python is Fun!') == 'PYTHON IS FUN!'\", \"assert replace_letters('mixedCASE') == 'MIXEDCASE'\", \"a... | {
"split": "train",
"index": 69060,
"acecode_id": "oss_4463",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of strings, each representing a series of movie titles. Your task is to write a function that concatenates these two lists into a single list, maintaining the order of the titles as they appear in the original lists. Implement the function `concat_series... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert concat_series_movies(['Inception', 'Interstellar'], ['Titanic', 'Avatar']) == ['Inception', 'Interstellar', 'Titanic', 'Avatar']\", \"assert concat_series_movies(['The Matrix'], ['The Terminator', 'Blade Runner']) == ['The Matrix', 'The Terminator', 'Blade R... | {
"split": "train",
"index": 69061,
"acecode_id": "bigcode_python_fns_40096",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `parse_json_to_dict(json_str: str) -> dict` that takes a JSON formatted string as input and parses it into a Python dictionary. The function should return the dictionary representation of the JSON data.\nPlease reason step by step, then write a self-contained P... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_json_to_dict('{ \\\"name\\\": \\\"John Doe\\\", \\\"age\\\": 25, \\\"address\\\": { \\\"street\\\": \\\"123 Main Street\\\", \\\"city\\\": \\\"Los Angeles\\\", \\\"state\\\": \\\"California\\\", \\\"zip\\\": 90001}}') == {'name': 'John Doe', 'age': 25,... | {
"split": "train",
"index": 69062,
"acecode_id": "evol_31865",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a two-dimensional list of integers, implement a function that processes each subarray to create a new list containing only the first and last integer of each subarray. If any subarray contains non-integer types, it should be skipped. The function should return a list of s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_list([[10, 20, 30], [40, 50, 60], [70, 80, '90']]) == [40, 100, 0]\", \"assert process_list([[1, 2], [None, 2], [5, 6, 7]]) == [3, 0, 12]\", \"assert process_list([[0, 0, 0], [1, 2, 3], [4, 5, 6]]) == [0, 4, 10]\", \"assert process_list([[3, 4], [5, ... | {
"split": "train",
"index": 69063,
"acecode_id": "evol_26222",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `transform_list(nums: List[int], factor: int) -> List[int]` that transforms each integer in the list by multiplying it with the provided factor. The function should return a new list containing the transformed integers. If the input li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_list([1, 2, 3], 2) == [2, 4, 6]\", \"assert transform_list([5, 10, 15], 3) == [15, 30, 45]\", \"assert transform_list([-1, -2, -3], 4) == [-4, -8, -12]\", \"assert transform_list([0, 1, 2], 5) == [0, 5, 10]\", \"assert transform_list([], 1) == []\"... | {
"split": "train",
"index": 69064,
"acecode_id": "bigcode_python_fns_6445",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of numbers, implement a function that calculates the mean (average) value of the numbers in the list. The mean is the sum of all the numbers divided by the count of numbers. Note that the list will contain at least one number.\nPlease reason step by step, then writ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_mean([1, 2, 3, 4, 5]) == 3.0\", \"assert calculate_mean([10, 20, 30]) == 20.0\", \"assert calculate_mean([-1, 0, 1]) == 0.0\", \"assert calculate_mean([5]) == 5.0\", \"assert calculate_mean([1, 2, 3]) == 2.0\", \"assert calculate_mean([100, 200]) =... | {
"split": "train",
"index": 69065,
"acecode_id": "evol_32879",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that generates a dictionary of command-line arguments for a distributed training script. Your function should be named `generate_ddp_arguments` and should return a dictionary with the following keys and their corresponding default ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_ddp_arguments() == {'ddp_disable': False, 'ddp_rank': 0, 'ddp_world_size': -1}\", \"assert generate_ddp_arguments() == {'ddp_disable': False, 'ddp_rank': 0, 'ddp_world_size': -1}\", \"assert generate_ddp_arguments() == {'ddp_disable': False, 'ddp_ra... | {
"split": "train",
"index": 69066,
"acecode_id": "oss_13698",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function called `get_available_sites` that returns a list of all available sites. The function should return a predefined list of strings, where each string represents the name of a site. Your implementation should ensure that the function returns the sa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_available_sites() == ['SiteA', 'SiteB', 'SiteC', 'SiteD']\", \"assert isinstance(get_available_sites(), list)\", \"assert len(get_available_sites()) == 4\", \"assert 'SiteA' in get_available_sites()\", \"assert 'SiteB' in get_available_sites()\", \"asser... | {
"split": "train",
"index": 69067,
"acecode_id": "oss_10301",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to analyze football (soccer) match results. The function should take a string input representing match data in the format 'TeamA 3-2 TeamB', where TeamA and TeamB are the names of the competing teams, and the numbers represent the goa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_match_data('TeamA 3-2 TeamB') == {'team_a': 'TeamA', 'team_b': 'TeamB', 'goals_a': 3, 'goals_b': 2, 'total_goals': 5}\", \"assert parse_match_data('TeamC 1-3 TeamD') == {'team_a': 'TeamC', 'team_b': 'TeamD', 'goals_a': 1, 'goals_b': 3, 'total_goals': 4... | {
"split": "train",
"index": 69068,
"acecode_id": "oss_10079",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that calculates the angle (in degrees) between two vectors in 2D space. The function should take four parameters representing the x and y components of the two vectors and return the angle in degrees rounded to two decimal plac... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_angle(1, 0, 0, 1) == 90.0\", \"assert calculate_angle(1, 1, -1, 1) == 90.0\", \"assert calculate_angle(1, 0, 1, 0) == 0.0\", \"assert calculate_angle(0, 1, 0, 1) == 0.0\", \"assert calculate_angle(1, 0, 0, -1) == 90.0\", \"assert calculate_angle(0,... | {
"split": "train",
"index": 69069,
"acecode_id": "oss_29372",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a list of remote servers, where each server is represented as a dictionary containing 'name', 'user', and 'location' keys. Your task is to implement a function `list_servers(servers: List[Dict[str, str]]) -> List[str]` that returns a list of strings, each indicati... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert list_servers([]) == []\", \"assert list_servers([{'name': 'server1', 'user': 'user1', 'location': 'location1'}]) == ['user1@server1 (location1)']\", \"assert list_servers([{'name': 'server1', 'user': 'user1', 'location': 'location1'}, {'name': 'server2', 'us... | {
"split": "train",
"index": 69070,
"acecode_id": "bigcode_python_fns_31543",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a given spectral data represented as a dictionary. The dictionary contains wavelengths as keys (integers) and their corresponding spectral values as values (floats). Write a function `process_spectral_data(spectral_d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_spectral_data({300: 0.5, 350: 0.7, 400: 0.6}) == (0.6, 350)\", \"assert process_spectral_data({500: 1.5}) == (1.5, 500)\", \"assert process_spectral_data({450: 2.0, 500: 2.5, 550: 1.5}) == (2.0, 500)\", \"assert process_spectral_data({400: 0.0, 450: ... | {
"split": "train",
"index": 69071,
"acecode_id": "oss_19781",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program to determine whether a loan application should be approved or denied based on certain financial criteria. Write a Python function `loan_approval(v, qa, s)` that takes three input parameters: \n- `v` (float): the total value of the loan req... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert loan_approval(10000.0, 12, 2000.0) == 'Seu empr\\u00e9stimo foi aprovado'\", \"assert loan_approval(8000.0, 6, 2000.0) == 'Seu empr\\u00e9stimo foi aprovado'\", \"assert loan_approval(15000.0, 18, 2500.0) == 'Seu empr\\u00e9stimo foi aprovado'\", \"assert lo... | {
"split": "train",
"index": 69072,
"acecode_id": "oss_17310",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a nested data structure that can include tuples, lists, dictionaries, and sets, write a function `count_none_values(data)` that counts the occurrences of None values in the data structure and returns a list of paths to these None values along with the total count of None ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_none_values([1, 2, 3, 4]) == 'No None values found'\", \"assert count_none_values([]) == 'No None values found'\", \"assert count_none_values({1: (2, 3, None), 4: 5}) == ([ [1, 2] ], 1)\", \"assert count_none_values(((1, 2), [None, 4, 5])) == ([ [1, 0]... | {
"split": "train",
"index": 69073,
"acecode_id": "evol_10236",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a collection of 3D color data represented as lists of RGB values. Each RGB value is given as a tuple of three integers (R, G, B), where R, G, and B are in the range [0, 255]. Your goal is to calculate the average RGB va... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_color([(255, 0, 0), (0, 255, 0), (0, 0, 255)]) == (85, 85, 85)\", \"assert average_color([(0, 0, 0), (0, 0, 0)]) == (0, 0, 0)\", \"assert average_color([(255, 255, 255)]) == (255, 255, 255)\", \"assert average_color([(100, 150, 200), (50, 50, 50)]) =... | {
"split": "train",
"index": 69074,
"acecode_id": "oss_13018",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a layout of a town represented by 100 houses in a row, numbered from 1 to 100. The police want to ensure the safety of the town by monitoring the houses. Each police officer can monitor a range of 'x' houses on either side of their position. Additionally, there ar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert safe_houses(1, [(0, 15, 1, [])]) == [100]\", \"assert safe_houses(1, [(1, 1, 1, [50])]) == [97]\", \"assert safe_houses(1, [(1, 10, 10, [1])]) == [0]\", \"assert safe_houses(1, [(1, 0, 0, [10])]) == [99]\", \"assert safe_houses(1, [(1, 1, 1, [1])]) == [98]\"... | {
"split": "train",
"index": 69075,
"acecode_id": "oss_32341",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are developing a simplified software application for controlling multiple cameras. Each camera can be toggled on or off using a button, and there are also two additional buttons for 'Test' and 'Scan' operations. Your task is to implement a function that simulates the toggli... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert toggle_cameras([True, False, True], True, False) == ['Camera 1 is ON', 'Camera 2 is OFF', 'Camera 3 is ON', 'Test button clicked']\", \"assert toggle_cameras([False, False, False], False, True) == ['Camera 1 is OFF', 'Camera 2 is OFF', 'Camera 3 is OFF', 'Sc... | {
"split": "train",
"index": 69076,
"acecode_id": "oss_35706",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that determines the backend domain for a given configuration in a machine learning framework. The function should take the configuration as input and return the corresponding backend domain based on the configuration settings. The con... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_backend_domain({'backend': 'PPLNN'}) == 'mmcv'\", \"assert get_backend_domain({'backend': 'ONNXRUNTIME'}) == 'onnx'\", \"assert get_backend_domain({'backend': 'PPLNN'}) == 'mmcv'\", \"assert get_backend_domain({'backend': 'ONNXRUNTIME'}) == 'onnx'\", \"a... | {
"split": "train",
"index": 69077,
"acecode_id": "oss_18128",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a circular track with N segments, where each segment has a specific length associated with it. A cyclist starts at segment 0 and moves along the track in a circular manner, adding the length of the current segment to their position at each step. If the cyclist's p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_matches(3, 0, [1, 1, 1]) == 1\", \"assert count_matches(4, 1, [2, 2, 2, 2]) == 0\", \"assert count_matches(6, 5, [1, 1, 1, 1, 1, 1]) == 1\", \"assert count_matches(10, 3, [10, 10, 10, 10, 10, 10, 10, 10, 10, 10]) == 0\", \"assert count_matches(7, 6, [5... | {
"split": "train",
"index": 69078,
"acecode_id": "oss_10124",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a string, implement a function `make_palindrome(string: str) -> str` that takes the input string, removes all non-alphanumeric characters, converts it to lowercase, and then appends the shortest possible palindrome that can be formed by adding characters to the end of the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert make_palindrome('') == ''\", \"assert make_palindrome('cat') == 'catac'\", \"assert make_palindrome('hello') == 'hellolleh'\", \"assert make_palindrome('race') == 'racecar'\", \"assert make_palindrome('123') == '12321'\", \"assert make_palindrome('a') == 'a'... | {
"split": "train",
"index": 69079,
"acecode_id": "evol_12258",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a URL string and a string representing HTTP headers, implement a function that generates a reasonable filename for a file based on the provided inputs. If the headers contain a 'Content-Disposition' header with a filename, use that as the filename. If not, extract the fil... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_filename('http://example.com/file.txt', 'Content-Disposition: attachment; filename=\\\"downloaded_file.txt\\\"') == 'downloaded_file.txt'\", \"assert generate_filename('http://example.com/path/to/myfile.doc', '') == 'myfile.doc'\", \"assert generate... | {
"split": "train",
"index": 69080,
"acecode_id": "bigcode_python_fns_326",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes an incoming HTTP request represented as a dictionary. The dictionary contains the following keys: 'Host' (a string representing the host), 'path' (a string representing the path), and 'isSecure' (a boolean indicating whethe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_http_request({'Host': 'example.com', 'path': b'/home', 'isSecure': True}) == ('example.com', '/home', True)\", \"assert process_http_request({'Host': 'test.org', 'path': b'/about', 'isSecure': False}) == ('test.org', '/about', False)\", \"assert proc... | {
"split": "train",
"index": 69081,
"acecode_id": "oss_7882",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a function `func` that takes an arbitrary number of arguments and a positive integer `n`, implement a function `apply_ntimes(func, n, args)` that invokes `func` exactly `n` times with the provided arguments `args`. The output should be a list containing the results of eac... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert apply_ntimes(lambda x: x + 1, 3, (1,)) == [2, 2, 2]\", \"assert apply_ntimes(lambda x: x * 2, 4, (5,)) == [10, 10, 10, 10]\", \"assert apply_ntimes(lambda x: x ** 2, 2, (3,)) == [9, 9]\", \"assert apply_ntimes(lambda: 'Hello', 5, ()) == ['Hello', 'Hello', 'H... | {
"split": "train",
"index": 69082,
"acecode_id": "bigcode_python_fns_2230",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of stock prices for a particular company over a period of time. Your task is to write a function that calculates the ratio of each stock price to the previous day's stock price and returns the list of ratios. The first ratio in the list should be 1, as ther... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_price_ratios([100, 110, 120, 115, 125]) == [1, 1.1, 1.0909090909090908, 0.9583333333333334, 1.0869565217391304]\", \"assert calculate_price_ratios([200, 250, 300]) == [1, 1.25, 1.2]\", \"assert calculate_price_ratios([50, 100, 150, 200]) == [1, 2.0... | {
"split": "train",
"index": 69083,
"acecode_id": "oss_10626",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `classify_input(user_input)` that takes a single parameter `user_input` and classifies it as either 'Number' if it can be converted to a float, or 'Word' if it cannot. The function should return 'Number' for valid numeric inputs (including integers and floa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert classify_input('123') == 'Number'\", \"assert classify_input('123.45') == 'Number'\", \"assert classify_input('-123') == 'Number'\", \"assert classify_input('0') == 'Number'\", \"assert classify_input('3.14') == 'Number'\", \"assert classify_input('abc') == ... | {
"split": "train",
"index": 69084,
"acecode_id": "evol_7799",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `sorted_unique(nums)` that returns a new list containing the unique integers from the input list, sorted in ascending order. The input list may contain duplicate integers and can be of any length, including zero. The output list should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sorted_unique([3, 1, 2, 2, 3]) == [1, 2, 3]\", \"assert sorted_unique([1, 1, 1, 1]) == [1]\", \"assert sorted_unique([]) == []\", \"assert sorted_unique([5, 3, 3, 2, 5]) == [2, 3, 5]\", \"assert sorted_unique([0, -1, -2, -2, 0]) == [-2, -1, 0]\", \"assert so... | {
"split": "train",
"index": 69085,
"acecode_id": "bigcode_python_fns_28701",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes an integer n as input and returns the smallest prime number that is greater than n. The function should only return a prime number and must handle cases where n is negative or zero appropriately.\nPlease reason step by step, then write a self-con... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_next_prime(0) == 2\", \"assert find_next_prime(1) == 2\", \"assert find_next_prime(2) == 3\", \"assert find_next_prime(3) == 5\", \"assert find_next_prime(4) == 5\", \"assert find_next_prime(5) == 7\", \"assert find_next_prime(6) == 7\", \"assert find_n... | {
"split": "train",
"index": 69086,
"acecode_id": "evol_22333",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a python function that splits a list at the nth element and adds the first part to the end, while also sorting the resulting list in ascending order. The function should handle exceptions for invalid input, such as when the nth element is not a valid index in the list. Th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_and_rotate(['apple', 'banana', 'cherry'], 0) == ['apple', 'banana', 'cherry']\", \"assert sort_and_rotate([[1, 2], [3]], 0) == [[1, 2], [3]]\", \"assert sort_and_rotate([1, 2, 3], -3) == [1, 2, 3]\", \"assert sort_and_rotate([1.5, 2.5, 1.0], 1.7) == [1.... | {
"split": "train",
"index": 69087,
"acecode_id": "evol_7049",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given an integer `memory_bytes` representing a quantity of memory in bytes. Your task is to round this number to the nearest memory unit based on a specified rounding method. If `round_up` is True, you should round up to the nearest power of 2 (e.g., 1, 2, 4, 8, 16, 32,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert round_to_memory_units(0, True) == 1\", \"assert round_to_memory_units(1, True) == 1\", \"assert round_to_memory_units(1, False) == 1\", \"assert round_to_memory_units(2, True) == 2\", \"assert round_to_memory_units(2, False) == 2\", \"assert round_to_memory_... | {
"split": "train",
"index": 69088,
"acecode_id": "bigcode_python_fns_40966",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `count_words(sentence: str) -> int` that takes a string `sentence` as input and returns the number of words in the sentence. A word is defined as a sequence of characters separated by spaces. The input string may contain leading or trailing spaces, and mult... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_words('This is a simple sentence.') == 5\", \"assert count_words(' Hello, world! ') == 2\", \"assert count_words(' ') == 0\", \"assert count_words('OneWord') == 1\", \"assert count_words('') == 0\", \"assert count_words('Word1 Word2 Word3') == 3\",... | {
"split": "train",
"index": 69089,
"acecode_id": "evol_26468",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to implement a function that takes this list as input and returns the sum of all even numbers in the list. If there are no even numbers, the function should return 0. For example, given the input [1, 2, 3, 4, 5], the output should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([0, 1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([1, 3, 5]) == 0\", \"assert sum_of_evens([2, 4, 6]) == 12\", \"assert sum_of_evens([-2, -4, 1, 3]) == -6\", \"assert sum_of_evens([-1, -2, -3, -4]) ... | {
"split": "train",
"index": 69090,
"acecode_id": "oss_32569",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of 2D bounding boxes represented as dictionaries. Each bounding box contains a 'bbox' field with coordinates [x1, y1, x2, y2], a 'score' field, and a 'class' field. Your task is to implement a function `filter_bounding_boxes(boxes: List[Dict[str, Union[List... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_bounding_boxes([{'bbox': [10, 20, 30, 40], 'score': 0.9, 'class': 'car'}, {'bbox': [15, 25, 35, 45], 'score': 0.85, 'class': 'truck'}, {'bbox': [5, 15, 25, 35], 'score': 0.7, 'class': 'bicycle'}], ['car', 'truck']) == [{'bdb_pos': [10, 20, 30, 40], 's... | {
"split": "train",
"index": 69091,
"acecode_id": "bigcode_python_fns_30616",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the undeployment of application versions in a blue-green deployment strategy. The function should take a deployment dictionary as input, which contains the application's name and version, and return a confirmation messa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert undeploy_application({'deployment': {'name': 'App1', 'version': '1.0', 'mode': 'bluegreen'}}) == 'All versions of App1 have been undeployed.'\", \"assert undeploy_application({'deployment': {'name': 'App2', 'version': '2.1', 'mode': 'bluegreen'}}) == 'All ve... | {
"split": "train",
"index": 69092,
"acecode_id": "bigcode_python_fns_18056",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function `count_elements(my_list)` that takes a multidimensional list as input and returns the cumulative count of all non-list elements contained within it. The input list may contain nested lists. You need to flatten the list recursively to count all the individua... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_elements([[1, 2], 3, 4]) == 4\", \"assert count_elements([1, [2, [3, 4]], 5]) == 5\", \"assert count_elements([[[1], 2], [3, 4]]) == 4\", \"assert count_elements([]) == 0\", \"assert count_elements([1, 2, 3]) == 3\", \"assert count_elements([[1, 2], [3... | {
"split": "train",
"index": 69093,
"acecode_id": "evol_20722",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to validate user keys in a messaging system. The function should take a user key as input and return True if the user key is valid, and False otherwise. The validation rules for the user key are as follows: 1. The user key must be a n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_user_key('validKey123') == True\", \"assert validate_user_key('short') == False\", \"assert validate_user_key(' ') == False\", \"assert validate_user_key('keyWithSpace ') == False\", \"assert validate_user_key('noSpacesHere123') == True\", \"asse... | {
"split": "train",
"index": 69094,
"acecode_id": "oss_4065",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates adding an item to a collection and verifies its properties. Implement the function `add_item(name: str, sell_in: int, quality: int) -> Tuple[str, int, int]` that takes three parameters: a string `name`, an integer `sell_in`... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_item('Conjured Mana Cake', 5, 8) == ('Conjured Mana Cake', 5, 8)\", \"assert add_item('Elixir of the Mongoose', 10, 7) == ('Elixir of the Mongoose', 10, 7)\", \"assert add_item('Aged Brie', 2, 0) == ('Aged Brie', 2, 0)\", \"assert add_item('Sulfuras, Han... | {
"split": "train",
"index": 69095,
"acecode_id": "bigcode_python_fns_194",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that converts values between different units for various physical quantities such as area, density, distance, energy, length, mass, power, and speed. The conversion rates between units for each physical quantity are predefined in a di... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_units('DISTANCE', 'm', 'ft', 1) == 3.28084\", \"assert convert_units('AREA', 'm^2', 'ft^2', 1) == 10.7639\", \"assert convert_units('DENSITY', 'kg/m^3', 'lb/ft^3', 1) == 0.06242796\", \"assert convert_units('ENERGY', 'J', 'cal', 1) == 0.239006\", \"a... | {
"split": "train",
"index": 69096,
"acecode_id": "oss_36068",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a configuration dictionary that holds various logging settings for an application. Your task is to implement a function that retrieves the console log level from this configuration dictionary. If the console log level does not exist in the dictionary, your functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_console_log_level({'logconfig': {'console_log_level': 'DEBUG'}}) == 'DEBUG'\", \"assert get_console_log_level({'logconfig': {'console_log_level': 'INFO'}}) == 'INFO'\", \"assert get_console_log_level({'logconfig': {'console_log_level': 'WARNING'}}) == 'W... | {
"split": "train",
"index": 69097,
"acecode_id": "bigcode_python_fns_40418",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of nodes in a graph along with a naming convention defined by a specific rule. Your task is to implement a function `identify_nodes_with_convention` that identifies all nodes that adhere to the specified naming convention. The function should take the follo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert identify_nodes_with_convention(['node1', 'node2', 'parameter1'], lambda x: x.startswith('node')) == ['node1', 'node2']\", \"assert identify_nodes_with_convention(['alpha', 'beta', 'gamma'], lambda x: x == 'beta') == ['beta']\", \"assert identify_nodes_with_c... | {
"split": "train",
"index": 69098,
"acecode_id": "oss_20312",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a configuration registration system for a web application. The `register_config` function needs to be designed to allow the application to register various configuration settings. The function should accept the application object as a parameter ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert register_config(app) == {'default_setting': 'default_value'}\", \"assert register_config(app) == {'default_setting': 'default_value'}\", \"assert register_config(app) == {'default_setting': 'default_value'}\", \"assert register_config(app) == {'default_setti... | {
"split": "train",
"index": 69099,
"acecode_id": "oss_28861",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.