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": "Write a Python function `validate_and_serialize_dict(the_dict)` that accepts a dictionary as an input. The function should validate that each key is a string and that each value is of a type that is serializable into JSON (e.g., string, number, list, another dictionary, etc.). ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_and_serialize_dict({'name': 'John', 'age': 30, 'city': 'New York'}) == '{\\\"name\\\": \\\"John\\\", \\\"age\\\": 30, \\\"city\\\": \\\"New York\\\"}'\", \"assert validate_and_serialize_dict({'items': [1, 2, 3], 'status': 'active'}) == '{\\\"items\\... | {
"split": "train",
"index": 85600,
"acecode_id": "evol_14942",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given two strings, `haystack` and `needle`, implement a function `strStr(haystack, needle)` that returns the starting index of the first occurrence of the substring `needle` within the string `haystack`. If `needle` is not found, the function should return -1. Note that if `nee... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert strStr('hello', 'll') == 2\", \"assert strStr('aaaaa', 'bba') == -1\", \"assert strStr('abcde', 'c') == 2\", \"assert strStr('testing', 'test') == 0\", \"assert strStr('testcase', '') == 0\", \"assert strStr('', 'needle') == -1\", \"assert strStr('', '') == ... | {
"split": "train",
"index": 85601,
"acecode_id": "oss_20038",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that returns the normalized number of unique integers in the list relative to the length of the list. The normalized value should be calculated as the number of unique integers divided by the total number of integers in the list. If th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert normalized_unique_count([1, 2, 3, 1, 2, 3]) == 0.5\", \"assert normalized_unique_count([1, 2, 2, 3, 4]) == 0.8\", \"assert normalized_unique_count([]) == 0.0\", \"assert normalized_unique_count([1, 2, 3, 4, 5, 6]) == 1.0\", \"assert normalized_unique_count([... | {
"split": "train",
"index": 85602,
"acecode_id": "bigcode_python_fns_37633",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `process_data_for_date` that simulates data processing for a specific date. The function should take a single argument, `date_input`, which is a date object. The function should return a string indicating that data processing is being... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_data_for_date(date(2022, 10, 15)) == 'Processing data for date: 2022-10-15'\", \"assert process_data_for_date(date(2023, 1, 1)) == 'Processing data for date: 2023-01-01'\", \"assert process_data_for_date(date(2020, 12, 31)) == 'Processing data for da... | {
"split": "train",
"index": 85603,
"acecode_id": "oss_1991",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, each representing a positive integer. Your task is to write a function that takes this list as input and returns the product of the last digits of each integer in the list. The last digit of an integer can be obtained by looking at the last char... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert product_last_digits([\\\"123\\\", \\\"456\\\", \\\"789\\\"]) == 162\", \"assert product_last_digits([\\\"7\\\", \\\"8\\\", \\\"9\\\"]) == 504\", \"assert product_last_digits([\\\"1\\\", \\\"2\\\", \\\"3\\\", \\\"4\\\"]) == 24\", \"assert product_last_digits(... | {
"split": "train",
"index": 85604,
"acecode_id": "oss_37636",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with building a function that constructs a SQL SELECT query string based on the attributes of a given object. The function should iterate through the object's attributes and create a query that selects all attributes, handling an optional ID parameter to filter t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert build_select_query({'table': 'users', 'name': 'John', 'age': 30}) == 'SELECT name, age from users'\", \"assert build_select_query({'table': 'products', 'id': 1, 'title': 'Widget', 'price': 19.99}, 1) == 'SELECT id, title, price from products where id = 1'\",... | {
"split": "train",
"index": 85605,
"acecode_id": "oss_2077",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `check_word(search_term: str, char_sequence: str) -> bool` that verifies the existence of a term in a provided sequence of characters. The search should be case insensitive. The function should return `True` if the term exists in the sequence, and `False` o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_word('hello', 'Hello world') == True\", \"assert check_word('world', 'Hello world') == True\", \"assert check_word('Python', 'I love python programming') == True\", \"assert check_word('java', 'Java is great') == True\", \"assert check_word('test', 'Th... | {
"split": "train",
"index": 85606,
"acecode_id": "evol_33161",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `find_max_index` that returns the index of the maximum value in the list. If the list is empty, the function should return -1. The input list can contain both positive and negative integers. The function should handle cases where the m... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max_index([]) == -1\", \"assert find_max_index([1]) == 0\", \"assert find_max_index([1, 2, 3, 4, 5]) == 4\", \"assert find_max_index([-1, -2, -3, -4]) == 0\", \"assert find_max_index([3, 1, 2, 3]) == 0\", \"assert find_max_index([5, 5, 5, 5]) == 0\", \"... | {
"split": "train",
"index": 85607,
"acecode_id": "oss_14378",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes two strings as input and returns their concatenation. The function should handle the following edge cases: if no arguments are provided, if only one argument is provided, if either argument is not a string, and if both arguments are empty strings. En... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert concatenate('Hello', 'World') == 'HelloWorld'\", \"assert concatenate('', '') == ''\", \"assert concatenate('Python', '3') == 'Python3'\", \"assert concatenate('Hello ', 'World!') == 'Hello World!'\", \"assert concatenate('123', '456') == '123456'\", \"asser... | {
"split": "train",
"index": 85608,
"acecode_id": "evol_30480",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `word_frequency(sentence: str) -> Dict[str, int]` that takes a string `sentence` as input and returns a dictionary mapping each distinct word to its frequency in the sentence. The function should preprocess the input by converting all characters to lowercase an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert word_frequency('Hello world! Hello again.') == {'hello': 2, 'world': 1, 'again': 1}\", \"assert word_frequency('Python is fun. Python is powerful!') == {'python': 2, 'is': 2, 'fun': 1, 'powerful': 1}\", \"assert word_frequency('Data science is the future. Sc... | {
"split": "train",
"index": 85609,
"acecode_id": "evol_23531",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that determines if a given integer is divisible by the prime number 5. The function should take an integer as input and return a boolean value: True if the integer is divisible by 5, and False otherwise.\nPlease reason step by step, then write a self-contai... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_divisibility_by_5(10) == True\", \"assert check_divisibility_by_5(0) == True\", \"assert check_divisibility_by_5(-5) == True\", \"assert check_divisibility_by_5(4) == False\", \"assert check_divisibility_by_5(15) == True\", \"assert check_divisibility_... | {
"split": "train",
"index": 85610,
"acecode_id": "evol_3771",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that converts specific agent names into their more descriptive forms based on a predefined mapping. The mapping is as follows: 'correct_ts' -> 'Correct TS', 'kl_ucb' -> 'KL UCB', 'misspecified_ts' -> 'Misspecified TS', 'ucb1' -> 'UCB1', '... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert name_cleaner('correct_ts') == 'Correct TS'\", \"assert name_cleaner('kl_ucb') == 'KL UCB'\", \"assert name_cleaner('misspecified_ts') == 'Misspecified TS'\", \"assert name_cleaner('ucb1') == 'UCB1'\", \"assert name_cleaner('ucb-best') == 'UCB-best'\", \"asse... | {
"split": "train",
"index": 85611,
"acecode_id": "bigcode_python_fns_12305",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of sales orders, each represented as a dictionary containing the fields 'configuration_doctype', 'configuration_docname', 'name', and 'customer'. Write a function that filters the sales orders based on a specified configuration doctype and a search text. Th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_sales_orders([], 'ConfigA', 'text') == []\", \"assert filter_sales_orders([{'configuration_doctype': 'ConfigA', 'configuration_docname': 'Doc1', 'name': 'SO1', 'customer': 'Cust1'}], 'ConfigA', 'Doc') == ['SO1']\", \"assert filter_sales_orders([{'conf... | {
"split": "train",
"index": 85612,
"acecode_id": "bigcode_python_fns_5027",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a JSON string representing a note and returns a dictionary with the content of the note. The JSON string will always contain a single key 'content' with a string value. Your function should parse the JSON string and convert... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_note_json('{\\\"content\\\": \\\"test\\\"}') == {'content': 'test'}\", \"assert parse_note_json('{\\\"content\\\": \\\"hello world\\\"}') == {'content': 'hello world'}\", \"assert parse_note_json('{\\\"content\\\": \\\"\\\"}') == {'content': ''}\", \"a... | {
"split": "train",
"index": 85613,
"acecode_id": "bigcode_python_fns_13085",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python decorator that measures the execution time of a function and returns the duration in milliseconds. Your decorator should be able to handle functions with any number of arguments and keyword arguments. The decorator function should be na... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert measure_execution_time(lambda x, y: x + y)(5, 10) == 15\", \"assert measure_execution_time(lambda x, y, z=1: x * y + z)(2, 3) == 7\", \"assert measure_execution_time(lambda: sum(range(1000)))() == 499500\", \"assert measure_execution_time(lambda a, b, c=0: a... | {
"split": "train",
"index": 85614,
"acecode_id": "oss_36614",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that removes non-even elements from a nested heterogeneous tuple. The function should be able to manage tuples embedded within other tuples and expunge non-even elements from these as well. It should handle integers, floating-point numbers, string data type... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_odd_elements((1, 2, 3, 4)) == (2, 4)\", \"assert remove_odd_elements((1, 3, 5, 7)) == ()\", \"assert remove_odd_elements((1, 2, (3, 4), (5, 6))) == (2, (4,), (6,))\", \"assert remove_odd_elements((None, 2, '4', '5')) == (2, '4')\", \"assert remove_odd... | {
"split": "train",
"index": 85615,
"acecode_id": "evol_24288",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Devise a function `checkSubstring` that takes three string arguments, `str_1`, `str_2`, and `str_3`. The function should check if `str_1` is a substring within `str_2` and `str_3` is a substring within `str_2`. If both conditions are satisfied, the function should return True. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert checkSubstring('hello', 'hello world hello. Bye', 'world') == 'str_1 occurs more than once.'\", \"assert checkSubstring('hi', 'hi there, hi again!', 'there') == 'str_1 occurs more than once.'\", \"assert checkSubstring('test', 'this is a test test', 'is') ==... | {
"split": "train",
"index": 85616,
"acecode_id": "evol_25918",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with organizing and analyzing data from a set of software packages. Each package is represented by a dictionary containing its name, version, and size. Write a function `organize_packages` that takes a list of package dictionaries and organizes them into a dictio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert organize_packages([{'name': 'numpy', 'version': '1.18.1', 'size': 150}, {'name': 'mkl', 'version': '2019.0', 'size': 100}, {'name': 'python', 'version': '3.7.4', 'size': 200}]) == {'numpy': ['1.18.1'], 'mkl': ['2019.0'], 'python': ['3.7.4']}\", \"assert orga... | {
"split": "train",
"index": 85617,
"acecode_id": "oss_92",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a JSON string as input and retrieves the value associated with a specific key. If the key does not exist, the function should return None. The function should also be able to update the value of a specified key in the JSON stri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_json_variables('{\\\"name\\\": \\\"Alice\\\", \\\"age\\\": 30}', 'name') == 'Alice'\", \"assert manage_json_variables('{\\\"name\\\": \\\"Alice\\\", \\\"age\\\": 30}', 'age') == 30\", \"assert manage_json_variables('{\\\"name\\\": \\\"Alice\\\", \\\"a... | {
"split": "train",
"index": 85618,
"acecode_id": "oss_42",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a configuration dictionary for a machine learning model training setup. The configuration dictionary contains various settings and options for the training process. Write a function `process_training_config` that... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_training_config({'act_cfg': {'type': 'ReLU'}, 'num_classes': 5, 'lr_config': {}, 'checkpoint_config': {'interval': 5000}, 'custom_hooks': [{'output_dir': 'dir1'}]}) == ('ReLU', 5, True, 5000, ['dir1'])\", \"assert process_training_config({'act_cfg': ... | {
"split": "train",
"index": 85619,
"acecode_id": "oss_11456",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of strings and a string as input and returns a new list containing modified versions of the input strings. The modification involves adding a specific prefix to each string in the input list. Implement a function `ad... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_prefix([\\\"apple\\\", \\\"banana\\\", \\\"cherry\\\"], \\\"fruits_\\\") == [\\\"fruits_apple\\\", \\\"fruits_banana\\\", \\\"fruits_cherry\\\"]\", \"assert add_prefix([\\\"dog\\\", \\\"cat\\\"], \\\"pets_\\\") == [\\\"pets_dog\\\", \\\"pets_cat\\\"]\", ... | {
"split": "train",
"index": 85620,
"acecode_id": "oss_15903",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a custom logging filter in Python. Your goal is to create a function that takes a list of log records, where each log record is represented by a dictionary containing 'levelno' (an integer) and 'message' (a string). Implement a function called `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_log_records([{'levelno': 20, 'message': 'Info message'}, {'levelno': 30, 'message': 'Warning message'}], 25) == [{'levelno': 30, 'message': 'Warning message'}]\", \"assert filter_log_records([{'levelno': 10, 'message': 'Debug message'}, {'levelno': 40... | {
"split": "train",
"index": 85621,
"acecode_id": "oss_25851",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that generates an approximate 'docker run' command based on the configuration of a container provided as a dictionary. The function should take a dictionary containing the configuration details, including the image name, environmen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert recreate_docker_run_command({'Image': 'nginx:latest', 'Env': ['VAR1=value1', 'VAR2=value2'], 'ExposedPorts': ['80:80']}) == 'docker run nginx:latest -e VAR1=value1 -e VAR2=value2 -p 80:80'\", \"assert recreate_docker_run_command({'Image': 'ubuntu:20.04', 'En... | {
"split": "train",
"index": 85622,
"acecode_id": "oss_29210",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that calculates the Greatest Common Divisor (GCD) of two lists of integers. Each integer should be greater than zero and less than or equal to 1000. The first list contains 50 integers and the second list contains 100 integers. The function should return... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert gcd_of_lists([2, 4, 6, 8, 10] , [12, 14, 16, 18]) == 2\", \"assert gcd_of_lists([15, 30, 45] , [60, 75, 90]) == 15\", \"assert gcd_of_lists([5, 10, 15] , [20, 25, 30]) == 5\", \"assert gcd_of_lists([100, 200, 300] , [400, 500, 600]) == 100\", \"assert gcd_of... | {
"split": "train",
"index": 85623,
"acecode_id": "evol_11059",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simplified configuration manager in Python. Your task is to create a function `manage_config(operations)` that takes a list of operations, where each operation is a tuple. The first element of the tuple is a string, which can be either 'set' o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_config([('set', 'source', '/path/to/repo'), ('get', 'source')]) == ['/path/to/repo']\", \"assert manage_config([('set', 'version', '1.0'), ('get', 'version')]) == ['1.0']\", \"assert manage_config([('set', 'timeout', '30'), ('get', 'timeout')]) == ['3... | {
"split": "train",
"index": 85624,
"acecode_id": "oss_30195",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `intersperse(numbers: List[int], delimeter: int) -> List[int]` that receives a list of integers `numbers` and an integer `delimeter`. The goal is to construct a new list where the absolute value of `delimeter` is inserted between every pair of successive el... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert intersperse([], 4) == []\", \"assert intersperse([1, 2, 3], 4) == [1, 4, 2, 4, 3]\", \"assert intersperse([10, 20], 5) == [10, 5, 20]\", \"assert intersperse([1], 3) == [1]\", \"assert intersperse([5, 15, 25], 10) == [5, 10, 15, 10, 25]\", \"assert intersper... | {
"split": "train",
"index": 85625,
"acecode_id": "evol_3742",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `prime_stack_operations(operations: List[Tuple[str, int]]) -> List[Union[int, str]]` that simulates a stack data structure that only allows prime numbers to be pushed onto it. The function takes a list of operations, where each operation is a tuple containi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert prime_stack_operations([('push', 2), ('push', 3), ('push', 4)]) == []\", \"assert prime_stack_operations([('push', 5), ('peek', 0)]) == [5]\", \"assert prime_stack_operations([('pop', 0), ('pop', 0)]) == ['No element in the Stack', 'No element in the Stack']... | {
"split": "train",
"index": 85626,
"acecode_id": "evol_36196",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a module name. Write a function that checks whether the specified module is currently imported in the Python environment. The function should return True if the module is imported, and False otherwise. You can assume that the module names are... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_module_imported('sys') == True\", \"assert is_module_imported('json') == True\", \"assert is_module_imported('os') == True\", \"assert is_module_imported('nonexistentmodule') == False\", \"assert is_module_imported('math') == True\", \"assert is_module_im... | {
"split": "train",
"index": 85627,
"acecode_id": "bigcode_python_fns_20029",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a binary matrix `grid` of dimensions `n x n`, compute the length of the shortest unobstructed path from the top-left cell (0, 0) to the bottom-right cell (n - 1, n - 1). An unobstructed path is defined as a route where all traversed cells are `0`, and neighboring cells ar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shortestPathBinaryMatrix([[0,1],[1,0]]) == 2\", \"assert shortestPathBinaryMatrix([[0,0,0],[1,1,0],[1,1,0]]) == 4\", \"assert shortestPathBinaryMatrix([[1,0,0],[1,1,0],[1,1,0]]) == -1\", \"assert shortestPathBinaryMatrix([[0]]) == 1\", \"assert shortestPathB... | {
"split": "train",
"index": 85628,
"acecode_id": "evol_1493",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a function that converts a date string formatted as 'DD MMM YYYY' (where 'MMM' is the three-letter abbreviation for the month) into the format 'DD-MM-YYYY'. The function should correctly handle various month abbreviations and return the formatted date string. For exam... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decipher_date('01 Jan 2018') == '01-01-2018'\", \"assert decipher_date('15 Feb 2020') == '15-02-2020'\", \"assert decipher_date('28 Mar 1995') == '28-03-1995'\", \"assert decipher_date('30 Apr 2022') == '30-04-2022'\", \"assert decipher_date('12 May 2011') =... | {
"split": "train",
"index": 85629,
"acecode_id": "evol_6269",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function called 'sorting_chars' that takes a list of strings as input. The function should sort all the characters in each string alphabetically, including special characters and numbers, and return a list of the sorted strings. If the input l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sorting_chars([]) == None\", \"assert sorting_chars(['cba']) == ['abc']\", \"assert sorting_chars(['edc', 'bca', 'gfed']) == ['cde', 'abc', 'defg']\", \"assert sorting_chars(['123', '321']) == ['123', '123']\", \"assert sorting_chars(['a1b2c']) == ['12abc']\... | {
"split": "train",
"index": 85630,
"acecode_id": "evol_12118",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Write a function that counts the number of unique elements in a list of integers.\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 count_unique_elements([1, 2, 3, 3, 6, 4, 1]) == 5\", \"assert count_unique_elements([1, 1, 1, 1, 1]) == 1\", \"assert count_unique_elements([]) == 0\", \"assert count_unique_elements([5, 5, 5, 5, 5, 6]) == 2\", \"assert count_unique_elements([10, 20, 30, 40]... | {
"split": "train",
"index": 85631,
"acecode_id": "evol_22502",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that renames a list of file names to have a consistent prefix followed by a sequential number. The function should accept two parameters: a list of file names and a prefix. For example, if the prefix is 'photo' and the list contains ['bea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rename_files(['beach.jpg', 'mountain.jpg', 'forest.jpg'], 'photo') == ['photo_1.jpg', 'photo_2.jpg', 'photo_3.jpg']\", \"assert rename_files(['file1.txt', 'file2.txt'], 'document') == ['document_1.txt', 'document_2.txt']\", \"assert rename_files(['image.png'... | {
"split": "train",
"index": 85632,
"acecode_id": "oss_14702",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a list of mixed elements and replaces all numeric elements (both integers and floats) with their square roots. Ensure that non-numeric elements are ignored and do not cause any errors. The function should return the modified list. For example, given ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert square_root_replacer([1, 2, 3.5, 'A', 4, 5]) == [1.0, 1.4142135623730951, 1.8708286933869707, 'A', 2.0, 2.23606797749979]\", \"assert square_root_replacer(['Hello', 9, 'World', 16]) == ['Hello', 3.0, 'World', 4.0]\", \"assert square_root_replacer([4, 25, 'Te... | {
"split": "train",
"index": 85633,
"acecode_id": "evol_17274",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a multiline string and converts it into a single line by replacing every newline character ('\\n') with a space (' '). The function should be implemented recursively.\nPlease reason step by step, then write a self-contained Python solution. Give ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_newlines('Hello\\\\nWorld!\\\\nI am\\\\nmaking\\\\nArtificial Intelligence') == 'Hello World! I am making Artificial Intelligence'\", \"assert remove_newlines('Line 1\\\\nLine 2') == 'Line 1 Line 2'\", \"assert remove_newlines('One\\\\ntwo\\\\nthree\\... | {
"split": "train",
"index": 85634,
"acecode_id": "evol_17968",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D list of floating-point numbers. Your task is to implement a function that checks if two given 2D lists are almost equal up to a specified number of decimal places. The function should return True if they are almost equal, and False otherwise. Two 2D lists are... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_almost_equal([[1.1234, 2.5678], [3.9101, 4.2345]], [[1.1234, 2.5678], [3.9101, 4.2345]], 4) == True\", \"assert is_almost_equal([[1.1234, 2.5678], [3.9101, 4.2345]], [[1.1234, 2.5679], [3.9101, 4.2345]], 4) == False\", \"assert is_almost_equal([[1.12345, ... | {
"split": "train",
"index": 85635,
"acecode_id": "bigcode_python_fns_19161",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a job scheduling system that can handle a maximum number of jobs running simultaneously. Implement a function `can_launch_job(launch_info: str, running_jobs: int) -> bool` that checks if a new job can be launched based on the current number of runni... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_launch_job('Job1', 5) == True\", \"assert can_launch_job('Job2', 10) == False\", \"assert can_launch_job('Job3', 0) == True\", \"assert can_launch_job('Job4', 9) == True\", \"assert can_launch_job('Job5', 15) == False\", \"assert can_launch_job('Job6', 8... | {
"split": "train",
"index": 85636,
"acecode_id": "oss_35305",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves the API URL and menu group pattern name based on a given model and request. Your function should take two parameters: a string `model` and a string `request`. The function should return a tuple where the first element is th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_api_and_pattern('User', 'GetInfo') == ('https://api.example.com/user/info', 'UserInfoPattern')\", \"assert get_api_and_pattern('Product', 'GetDetails') == ('https://api.example.com/product/details', 'ProductDetailsPattern')\", \"assert get_api_and_patter... | {
"split": "train",
"index": 85637,
"acecode_id": "oss_4430",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that checks whether a given integer is odd. The function should return True if the integer is odd and False otherwise.\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 is_odd(1) == True\", \"assert is_odd(2) == False\", \"assert is_odd(3) == True\", \"assert is_odd(4) == False\", \"assert is_odd(5) == True\", \"assert is_odd(6) == False\", \"assert is_odd(7) == True\", \"assert is_odd(8) == False\", \"assert is_odd(9) == T... | {
"split": "train",
"index": 85638,
"acecode_id": "evol_3755",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes an array of integers and an integer k as inputs. The function should sort the array in ascending order using the bubble sort algorithm and then return the kth smallest element from the sorted array. The function should not use any built-in sort f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_kth_smallest([34, 16, 12, 9, 5], 3) == 12\", \"assert find_kth_smallest([5, 3, 8, 1, 2], 2) == 2\", \"assert find_kth_smallest([10, 9, 8, 7, 6], 1) == 6\", \"assert find_kth_smallest([1, 2, 3, 4, 5], 5) == 5\", \"assert find_kth_smallest([3, 1, 4, 1, 5,... | {
"split": "train",
"index": 85639,
"acecode_id": "evol_3795",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a python function to find the sum of the bitwise XOR of all unique pairs of numbers in the given list. Each pair should only be considered once, and each element should not be paired with itself. Implement a single function to perform this task.\nPlease reason step by ste... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_xor([0, 0, 0]) == 0\", \"assert sum_xor([1, 1, 1]) == 0\", \"assert sum_xor([1, 2, 3, 4]) == 24\", \"assert sum_xor([5, 6]) == 3\", \"assert sum_xor([10, 10, 10, 10]) == 0\", \"assert sum_xor([12, 15]) == 3\", \"assert sum_xor([1]) == 0\", \"assert sum_x... | {
"split": "train",
"index": 85640,
"acecode_id": "evol_35705",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a list of positive decimal numbers, implement a function that returns a dictionary mapping each decimal to its corresponding reciprocal. The reciprocal of a number x is defined as 1/x.\nPlease reason step by step, then write a self-contained Python solution. Give your fin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reciprocal_mapping([1.1, 2.2, 3.3]) == {1.1: 0.9090909090909091, 2.2: 0.45454545454545453, 3.3: 0.30303030303030304}\", \"assert reciprocal_mapping([4.0, 5.5]) == {4.0: 0.25, 5.5: 0.18181818181818182}\", \"assert reciprocal_mapping([10.0]) == {10.0: 0.1}\", ... | {
"split": "train",
"index": 85641,
"acecode_id": "evol_23027",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a geometric progression defined by its first term, a common ratio, and the number of terms. Your task is to implement a function that computes the sequence of values based on these inputs. The function should take three parameters: `N` (the number of terms), `Delt... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert geom_progression(5, 2.0, 2.0) == [2.0, 4.0, 8.0, 16.0, 32.0]\", \"assert geom_progression(3, 1.0, 0.5) == [1.0, 0.5, 0.25]\", \"assert geom_progression(4, 3.0, 1.0) == [3.0, 3.0, 3.0, 3.0]\", \"assert geom_progression(1, 10.0, 3.0) == [10.0]\", \"assert geom... | {
"split": "train",
"index": 85642,
"acecode_id": "bigcode_python_fns_29701",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to implement a function that returns the count of unique integers in the list. A unique integer is defined as an integer that appears exactly once in the list. Write a function `count_unique_integers(arr: List[int]) -> int` that ta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_integers([1, 2, 2, 3, 4, 4, 5]) == 3\", \"assert count_unique_integers([1, 1, 1, 1, 1]) == 0\", \"assert count_unique_integers([7, 8, 9, 10]) == 4\", \"assert count_unique_integers([]) == 0\", \"assert count_unique_integers([1, 2, 3, 4, 5]) == 5... | {
"split": "train",
"index": 85643,
"acecode_id": "bigcode_python_fns_23611",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a family tree data structure in Python. The family tree consists of nodes representing individuals, with each node containing information about the person's name, gender, parent, and children. Your goal is to create a method that adds a spouse t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_spouse_to_family_tree([('Alice', 'FEMALE', None, []), ('Bob', 'MALE', None, []), ('Charlie', 'MALE', 'Alice', []), ('Diana', 'FEMALE', 'Bob', [])], 'Alice', 'Eve') == 'SPOUSE_ADDED_SUCCESSFULLY'\", \"assert add_spouse_to_family_tree([('Alice', 'FEMALE', ... | {
"split": "train",
"index": 85644,
"acecode_id": "oss_34066",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that extracts shield image URLs from a given string representing the content of a reStructuredText file. The shield image URLs are denoted by the `.. image::` directive followed by the URL. Write a function `parse_shield_urls(file_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_shield_urls('.. image:: https://example.com/image1.svg') == ['https://example.com/image1.svg']\", \"assert parse_shield_urls('.. image:: https://example.com/image2.png') == ['https://example.com/image2.png']\", \"assert parse_shield_urls('.. image:: ht... | {
"split": "train",
"index": 85645,
"acecode_id": "oss_21182",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes server hostnames based on predefined regular expressions and groups. The function should take a server object as input and apply the appropriate regular expressions to the server's hostname. If a match is found, it s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_server_hostname({'id': 4, 'hostname': 'prod-abc'}) == []\", \"assert process_server_hostname({'id': 5, 'hostname': 'test-xyz'}) == []\", \"assert process_server_hostname({'id': 7, 'hostname': 'production-001'}) == []\", \"assert process_server_hostna... | {
"split": "train",
"index": 85646,
"acecode_id": "oss_29944",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the area of a polygon represented by a series of vertices in a 2D plane. The polygon is defined by a list of points, where each point is represented by its (x, y) coordinates. You need to implement a function that calculates the area of this poly... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_polygon_area([(1, 1), (1, 2), (2, 2), (2, 1)]) == 1.0\", \"assert calculate_polygon_area([(0, 0), (0, 1), (1, 1), (1, 0)]) == 1.0\", \"assert calculate_polygon_area([(0, 0), (5, 0), (5, 5), (0, 5)]) == 25.0\", \"assert calculate_polygon_area([(0, 0... | {
"split": "train",
"index": 85647,
"acecode_id": "oss_1338",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of n distinct integers, implement a function `insertion_sort(arr)` that sorts the list in ascending order using the insertion sort algorithm. The function should return the sorted list.\nPlease reason step by step, then write a self-contained Python solution. Give ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert insertion_sort([12, 11, 13, 5, 6]) == [5, 6, 11, 12, 13]\", \"assert insertion_sort([3, 1, 2]) == [1, 2, 3]\", \"assert insertion_sort([7, 8, 5, 6, 4]) == [4, 5, 6, 7, 8]\", \"assert insertion_sort([10]) == [10]\", \"assert insertion_sort([9, 8, 7, 6, 5]) ==... | {
"split": "train",
"index": 85648,
"acecode_id": "evol_27885",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `generate_efficientnet_b6_model(pretrained: bool, num_classes: int, in_chans: int) -> str` that simulates the creation of an EfficientNet-B6 model configuration. The function should take three parameters: `pretrained`, a boolean indicatin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_efficientnet_b6_model(True, 1000, 3) == 'EfficientNet-B6 Model: Pretrained: True, Num Classes: 1000, In Channels: 3'\", \"assert generate_efficientnet_b6_model(False, 10, 1) == 'EfficientNet-B6 Model: Pretrained: False, Num Classes: 10, In Channels:... | {
"split": "train",
"index": 85649,
"acecode_id": "bigcode_python_fns_14847",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that retrieves a subcategory by its unique identifier (primary key). You are given a list of subcategories, where each subcategory is represented as a dictionary with the following keys: 'id', 'name', and 'description'. Your function ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_subcategory_by_id([{'id': 1, 'name': 'Books', 'description': 'All kinds of books'}, {'id': 2, 'name': 'Electronics', 'description': 'Gadgets and devices'}], 1) == {'id': 1, 'name': 'Books', 'description': 'All kinds of books'}\", \"assert get_subcategory... | {
"split": "train",
"index": 85650,
"acecode_id": "oss_32431",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simplified version of a card game called 'Higher or Lower' without user input. In this version, the function takes a predefined list of card values and a list of corresponding guesses, and returns the number of correc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert higher_or_lower_game([2, 3, 4, 5], ['higher', 'higher', 'higher']) == 3\", \"assert higher_or_lower_game([10, 'J', 'Q', 'K', 'A'], ['higher', 'higher', 'higher', 'higher']) == 4\", \"assert higher_or_lower_game([3, 3, 3, 3], ['higher', 'lower', 'higher']) ==... | {
"split": "train",
"index": 85651,
"acecode_id": "oss_18727",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function `calculate_activation(dim: int, act: str, alpha: Optional[float], gain: Optional[float], clamp: Optional[float], x: List[float], b: Optional[List[float]]) -> List[float]` that simulates a simplified version of a bias activation function. The function should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_activation(1, 'linear', None, None, None, [1.0, 2.0, 3.0], None) == [1.0, 2.0, 3.0]\", \"assert calculate_activation(1, 'relu', None, None, None, [-1.0, 0.0, 1.0], None) == [0.0, 0.0, 1.0]\", \"assert calculate_activation(1, 'sigmoid', None, None, ... | {
"split": "train",
"index": 85652,
"acecode_id": "bigcode_python_fns_16483",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a set of strings, your task is to write a Python program to determine the longest common suffix among them. Additionally, the function should handle edge cases such as an empty set of strings. Provide an error handling mechanism for such cases in your code.\nPlease reason... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longestCommonSuffix(['flower', 'tower', 'power']) == 'ower'\", \"assert longestCommonSuffix(['abc', 'bc', 'c']) == 'c'\", \"assert longestCommonSuffix(['dog', 'racecar', 'car']) == ''\", \"assert longestCommonSuffix(['hello', 'yello', 'mello']) == 'ello'\", ... | {
"split": "train",
"index": 85653,
"acecode_id": "evol_15604",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with evaluating the Content Security Policy (CSP) for a website based on certain directives and their associated weights. Implement a function that takes in a website's ID and a dictionary of test weights for various CSP directives. The function should return a d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate_csp(1, {'default-src': 1.0, 'child-src': 0.5, 'connect-src': 0.2, 'font-src': 0.3, 'frame-src': 0.4, 'img-src': 0.6, 'manifest-src': 0.7, 'media-src': 0.8, 'object-src': 0.9, 'script-src': 0.5, 'style-src': 0.3, 'worker-src': 0.4, 'base-uri': 0.9, '... | {
"split": "train",
"index": 85654,
"acecode_id": "bigcode_python_fns_44430",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that removes all even digits from each integer, sorts the remaining odd digits in descending order, and returns a list of the transformed integers. If an integer contains only even digits, represent its transformation as 'None'. Ad... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_and_count([2468, 1357, 8642]) == (['None', 7531, 'None'], {'7531': 1})\", \"assert transform_and_count([111, 222, 333]) == ([111, 'None', 333], {'111': 1, '333': 1})\", \"assert transform_and_count([0, 2, 4, 6]) == (['None', 'None', 'None', 'None']... | {
"split": "train",
"index": 85655,
"acecode_id": "evol_6246",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the creation of a blog post. The function should take in the following parameters: a blog ID (integer), a username (string), a password (string), a dictionary representing the post (which includes title, description, an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_blog_post(3, 'user3', 'pass3', {'title': '', 'description': 'This post has no title.'}, True) == 'Invalid post data'\", \"assert create_blog_post(4, 'user4', 'pass4', {'title': 'Title Only', 'description': ''}, True) == 'Invalid post data'\", \"assert... | {
"split": "train",
"index": 85656,
"acecode_id": "bigcode_python_fns_33219",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a string as input and returns a list of unique words found in that string, maintaining the original order of their first appearance. Words are defined as sequences of characters separated by whitespace. The function should ignore case when determ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_word_list('I am learning to code') == ['I', 'am', 'learning', 'to', 'code']\", \"assert unique_word_list('Hello world hello') == ['Hello', 'world']\", \"assert unique_word_list('Python is great and python is fun') == ['Python', 'is', 'great', 'and', '... | {
"split": "train",
"index": 85657,
"acecode_id": "evol_22788",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a simple role and color assignment system for users in a chat application. Implement a function that takes in a user's role and returns the corresponding color associated with that role. The function should handle the following roles: 'Admin' (Gold)... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_role_color('Admin') == 'Gold'\", \"assert get_role_color('Moderator') == 'Silver'\", \"assert get_role_color('User') == 'Blue'\", \"assert get_role_color('Guest') == 'Gray'\", \"assert get_role_color('UnknownRole') == 'Default Color'\", \"assert get_role... | {
"split": "train",
"index": 85658,
"acecode_id": "oss_10501",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Implement a function `filter_even_numbers(arr: List[int]) -> List[int]` that takes a list of integers and returns a new list containing only the even integers from the original list, maintaining the original order. If there are no even integers... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([1, 3, 5]) == []\", \"assert filter_even_numbers([2, 4, 6, 8]) == [2, 4, 6, 8]\", \"assert filter_even_numbers([0, 1, 2, 3]) == [0, 2]\", \"assert filter_even_numbers([]) == []\",... | {
"split": "train",
"index": 85659,
"acecode_id": "bigcode_python_fns_36606",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that finds all perfect squares between two given non-negative integers, `start` and `end`. The function should return a list of perfect squares in descending order. If the input values are negative, return the string 'Error: Input should not be negative'. If `s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_perfect_squares(1, 25) == [25, 16, 9, 4, 1]\", \"assert find_perfect_squares(0, 0) == [0]\", \"assert find_perfect_squares(0, 100) == [100, 81, 64, 49, 36, 25, 16, 9, 4, 1, 0]\", \"assert find_perfect_squares(25, 1) == 'Error: End value should be greate... | {
"split": "train",
"index": 85660,
"acecode_id": "evol_5687",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Write a function `detect_prime_numbers(upper_limit: int) -> List[int]` that takes an integer `upper_limit` and returns a list of all prime numbers from 2 up to `upper_limit` (inclusive). A prime number is a natural number greater than 1 that cannot be formed by multiplying two ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert detect_prime_numbers(10) == [2, 3, 5, 7]\", \"assert detect_prime_numbers(20) == [2, 3, 5, 7, 11, 13, 17, 19]\", \"assert detect_prime_numbers(1) == []\", \"assert detect_prime_numbers(0) == []\", \"assert detect_prime_numbers(2) == [2]\", \"assert detect_pr... | {
"split": "train",
"index": 85661,
"acecode_id": "evol_6219",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that accepts a list of strings and returns a new list containing only the strings that have at least one vowel and do not contain any special characters. The returned list should be sorted by the length of the strings in ascending order. In case of equal le... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert custom_string_list(['hello', 'world', 'sky', 'a', 'b']) == ['a', 'hello', 'world']\", \"assert custom_string_list(['a', 'b', 'c']) == ['a']\", \"assert custom_string_list(['apple', 'banana', 'grape']) == ['apple', 'grape', 'banana']\", \"assert custom_string... | {
"split": "train",
"index": 85662,
"acecode_id": "evol_24047",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function `get_animal_info(species: str, habitat: str, diet: str) -> str` that takes three parameters: the species of the animal, its habitat, and its diet. The function should return a string in the format: 'The {species} is a creature that lives in the {habitat}, a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_animal_info('Lion', 'Savannah', 'Carnivore') == 'The Lion is a creature that lives in the Savannah, and its main diet consists of Carnivore.'\", \"assert get_animal_info('Penguin', 'Antarctica', 'Carnivore') == 'The Penguin is a creature that lives in th... | {
"split": "train",
"index": 85663,
"acecode_id": "evol_27931",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a sentence as a string, implement a function that returns a dictionary containing the frequency of each word in the sentence. The function should ignore case and consider the words as case-insensitive. The output should only include words that appear at least once in the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert word_frequency('This is a test sentence and this test works') == {'this': 2, 'is': 1, 'a': 1, 'test': 2, 'sentence': 1, 'and': 1, 'works': 1}\", \"assert word_frequency('Hello world hello') == {'hello': 2, 'world': 1}\", \"assert word_frequency('Python is fu... | {
"split": "train",
"index": 85664,
"acecode_id": "evol_6181",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a unique client identifier from a given client ID and client secret. Write a function `generate_client_identifier(CLIENT_ID: str, CLIENT_SECRET: str) -> str` that takes in a client ID and a client secret as input and return... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_client_identifier('client123', 'secret456') == 'client123-secret456'\", \"assert generate_client_identifier('user789', 'pass012') == 'user789-pass012'\", \"assert generate_client_identifier('abc', 'xyz') == 'abc-xyz'\", \"assert generate_client_iden... | {
"split": "train",
"index": 85665,
"acecode_id": "bigcode_python_fns_38697",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the IDs of orders. Write a function that takes this list and returns a new list containing only the even order IDs. The function should remove any duplicates and sort the even order IDs in ascending order before returning them. If t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert even_order_ids([1, 2, 3, 4, 5, 6]) == [2, 4, 6]\", \"assert even_order_ids([2, 2, 4, 4, 6, 6]) == [2, 4, 6]\", \"assert even_order_ids([1, 3, 5, 7]) == []\", \"assert even_order_ids([8, 8, 10, 10, 12]) == [8, 10, 12]\", \"assert even_order_ids([]) == []\", \... | {
"split": "train",
"index": 85666,
"acecode_id": "bigcode_python_fns_5784",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the product of all prime numbers in a given list, elevating each prime to a power corresponding to their position in the list (starting from index 1). If the list contains no prime numbers, return 1.\nPlease reason step by step, then write a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert product_of_primes([4, 6, 8, 10]) == 1\", \"assert product_of_primes([]) == 1\", \"assert product_of_primes([1, 1, 1, 1]) == 1\", \"assert product_of_primes([4, 4, 4, 4]) == 1\", \"assert product_of_primes([6, 10, 15]) == 1\"]}"
} | {
"split": "train",
"index": 85667,
"acecode_id": "evol_14048",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a simple HTML template for a dashboard page. The function should take a string parameter `title`, which represents the title of the dashboard, and return a string that is the complete HTML representation of the dashboard pa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_dashboard('My Dashboard') == '<!DOCTYPE html>\\\\n<html>\\\\n<head>\\\\n<title>My Dashboard</title>\\\\n</head>\\\\n<body>\\\\n<h1>My Dashboard</h1>\\\\n</body>\\\\n</html>'\", \"assert generate_dashboard('User Statistics') == '<!DOCTYPE html>\\\\n<... | {
"split": "train",
"index": 85668,
"acecode_id": "bigcode_python_fns_21768",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function called `remove_numeric_chars` that takes a single string `input_string` as an argument and returns a new string with all numeric characters (0-9) removed. The input string will only contain ASCII characters. For example, given the input 'I have 2 apples and 3 b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_numeric_chars(\\\"I'm 28 years old!\\\") == \\\"I'm years old!\\\"\", \"assert remove_numeric_chars(\\\"Hello 123 World!\\\") == \\\"Hello World!\\\"\", \"assert remove_numeric_chars(\\\"No numbers here!\\\") == \\\"No numbers here!\\\"\", \"assert ... | {
"split": "train",
"index": 85669,
"acecode_id": "evol_6291",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You have a string that contains a version number formatted as 'X.Y.Z', where X, Y, and Z are non-negative integers. Your task is to implement a function that extracts and returns the version number as a tuple of integers (X, Y, Z) from the given string. If the version number is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_version('Current version is 1.2.3') == (1, 2, 3)\", \"assert extract_version('Version: 3.0.1 is now available') == (3, 0, 1)\", \"assert extract_version('No version here') == None\", \"assert extract_version('The latest version is 0.0.9') == (0, 0, 9... | {
"split": "train",
"index": 85670,
"acecode_id": "bigcode_python_fns_38235",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function called `convert_to_dict` that accepts a JSON string as input. This function should parse the input JSON string and convert it into a nested Python dictionary. If the input string is not a valid JSON, the function should return the string 'Invalid JSON St... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_dict('{\\\"key\\\": \\\"value\\\"}') == {'key': 'value'}\", \"assert convert_to_dict('{\\\"user\\\": {\\\"name\\\": \\\"john\\\", \\\"age\\\": 32}}') == {'user': {'name': 'john', 'age': 32}}\", \"assert convert_to_dict('{\\\"array\\\": [1, 2, 3]}'... | {
"split": "train",
"index": 85671,
"acecode_id": "evol_10162",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that generates all prime numbers within a given exclusive upper boundary. The function should take an integer n as input and return a list of all prime numbers less than n. The function should be implemented using recursion.\nPlease reason step by step, the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_primes(10) == [2, 3, 5, 7]\", \"assert generate_primes(20) == [2, 3, 5, 7, 11, 13, 17, 19]\", \"assert generate_primes(30) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29]\", \"assert generate_primes(2) == []\", \"assert generate_primes(3) == [2]\", \"assert... | {
"split": "train",
"index": 85672,
"acecode_id": "evol_17564",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_palindrome(s: str) -> bool` that checks if the given string `s`, which consists of ASCII alphanumeric characters, is a palindrome. A palindrome is a string that reads the same backward as forward. Ignore non-alphanumeric characters and treat uppercase a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_palindrome('A man, a plan, a canal: Panama') == True\", \"assert is_palindrome('racecar') == True\", \"assert is_palindrome('No lemon, no melon') == True\", \"assert is_palindrome('Was it a car or a cat I saw?') == True\", \"assert is_palindrome('12321') ... | {
"split": "train",
"index": 85673,
"acecode_id": "evol_28198",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that assembles a URL from its components, which include a protocol, subdomain, primary domain, resource path, and optional HTTP query parameters. The function should validate the primary domain and raise an error if it is invalid. The val... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert assemble_url('https', 'mypage', 'google.com', 'search') == 'https://mypage.google.com/search'\", \"assert assemble_url('https', 'mypage', 'example.org', 'home') == 'https://mypage.example.org/home'\", \"assert assemble_url('https', 'blog', 'my-site.co', 'ind... | {
"split": "train",
"index": 85674,
"acecode_id": "evol_17021",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_postcodes(text: str) -> List[str]` that takes a string `text` as input and returns a list of all valid UK postal codes found within the text. A valid UK postal code follows the pattern: one or two uppercase letters, followed by one digit (or 'R'), opt... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_postcodes('My address is EC1A 1BB') == ['EC1A 1BB']\", \"assert find_postcodes('Please send it to W1A 0AX or w1a 0ax') == ['W1A 0AX', 'w1a 0ax']\", \"assert find_postcodes('Invalid postal code: 1234 AB') == []\", \"assert find_postcodes('Check these cod... | {
"split": "train",
"index": 85675,
"acecode_id": "evol_33808",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that extracts configuration settings for a reinforcement learning environment from a given dictionary. The dictionary contains various settings, and your function should return a dictionary containing only the relevant configur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_environment_config({'environment': {'name': 'CartPole-v1', 'num_agents': 1, 'observation_space': 4, 'action_space': 2, 'reward_scale': 1.0, 'gamma': 0.99, 'max_episode_steps': 500, 'seed': 123}}) == {'name': 'CartPole-v1', 'num_agents': 1, 'observati... | {
"split": "train",
"index": 85676,
"acecode_id": "oss_10952",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a custom `ExplicitNull` class in Python. The `ExplicitNull` class should act as a sentinel value that represents an explicitly null value. Your task is to implement the `ExplicitNull` class with the following requirements: - The class should hav... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert EXPLICIT_NULL is EXPLICIT_NULL\", \"assert not (EXPLICIT_NULL is None)\", \"assert EXPLICIT_NULL == EXPLICIT_NULL\", \"assert not (EXPLICIT_NULL == None)\", \"assert id(EXPLICIT_NULL) == id(EXPLICIT_NULL)\", \"assert hash(EXPLICIT_NULL) == hash(EXPLICIT_NULL... | {
"split": "train",
"index": 85677,
"acecode_id": "oss_15550",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the largest disparity between the values contained in two numerical arrays, and identifies the indices at which these disparities occur. The function should return a tuple containing the maximum disparity value and the indices (i, j) of the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max_discrepancy([5], [10]) == (5, (0, 0))\", \"assert find_max_discrepancy([0, 0], [0, 0]) == (0, (0, 0))\", \"assert find_max_discrepancy([1], [100]) == (99, (0, 0))\", \"assert find_max_discrepancy([0], [0]) == (0, (0, 0))\", \"assert find_max_discrep... | {
"split": "train",
"index": 85678,
"acecode_id": "evol_35210",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple bank account operation. The function should perform a series of transactions on a bank account given an initial balance, a list of deposits, and a list of withdrawals. The function should return the final balan... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bank_account_operations(1000, [500, 300], [200]) == (1600, 3)\", \"assert bank_account_operations(500, [200, 300], [100]) == (900, 3)\", \"assert bank_account_operations(100, [0], [150]) == (100, 1)\", \"assert bank_account_operations(200, [100], [50, 30]) =... | {
"split": "train",
"index": 85679,
"acecode_id": "oss_5321",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a string `s`, return a new string that is surrounded by parentheses. If the input is a list of characters, return a new list of characters that is surrounded by parentheses. If the input is neither a string nor a list, return the input type unchanged but wrapped in parent... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parenthesize('abc') == '(abc)'\", \"assert parenthesize(['a', 'b', 'c']) == ['(', 'a', 'b', 'c', ')']\", \"assert parenthesize('') == '()'\", \"assert parenthesize(['x', 'y']) == ['(', 'x', 'y', ')']\", \"assert parenthesize('hello') == '(hello)'\", \"assert... | {
"split": "train",
"index": 85680,
"acecode_id": "bigcode_python_fns_31776",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing a set of filters based on user request parameters and static items. Implement a function `set_filters(request: Dict[str, Any], query: Dict[str, Any], result: Dict[str, Any], static_items: Optional[List[Tuple[str, str]]] = None) -> Dict[str, List[s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_filters({'params': {'a': '1', 'b': '2'}}, {'filter': {'and': {'filters': []}}}, {'filters': []}) == {'a': ['1'], 'b': ['2']}\", \"assert set_filters({'params': {'size': 'large', 'color': 'blue'}}, {'filter': {'and': {'filters': []}}}, {'filters': []}) ==... | {
"split": "train",
"index": 85681,
"acecode_id": "bigcode_python_fns_36016",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing a dataset consisting of training and evaluation samples for a machine learning model. Given two lists of integers, `training_data` and `evaluation_data`, write a function `calculate_metrics(training_data: List[int], evaluation_data: List[int]) -> ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_metrics([10, 20, 30], []) == {'train_avg': 20.0, 'eval_avg': 0.0, 'avg_difference': 20.0, 'train_count': 3, 'eval_count': 0}\", \"assert calculate_metrics([5], [5]) == {'train_avg': 5.0, 'eval_avg': 5.0, 'avg_difference': 0.0, 'train_count': 1, 'ev... | {
"split": "train",
"index": 85682,
"acecode_id": "bigcode_python_fns_6941",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a list of annotations, where each annotation is represented by a dictionary containing 'image' (the image ID) and 'category' (the category ID). Your task is to process these annotations and return a JSON object that contains two keys: 'annotations' and 'categories... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_annotations([]) == {'annotations': [], 'categories': []}\", \"assert process_annotations([{'image': 1, 'category': 2}]) == {'annotations': [{'id': 1, 'image_id': 1}], 'categories': [2]}\", \"assert process_annotations([{'image': 1, 'category': 2}, {'... | {
"split": "train",
"index": 85683,
"acecode_id": "oss_7246",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given two integer arrays `heights` and `widths` of size `n` that represent the heights and widths of buildings in a line. The ocean is to the right of the buildings. A building has an ocean view if all the buildings to its right have a smaller height. Additionally, a bu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert oceanViewAndSunlightExposure([5, 4, 3, 2, 1], [1, 1, 1, 1, 1]) == [0]\", \"assert oceanViewAndSunlightExposure([2, 1, 2, 3, 4], [1, 1, 2, 2, 3]) == [4]\", \"assert oceanViewAndSunlightExposure([1, 1, 1, 2, 1], [1, 1, 1, 2, 1]) == [3]\", \"assert oceanViewAnd... | {
"split": "train",
"index": 85684,
"acecode_id": "evol_5379",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a spell-casting function for a fantasy-themed game. Write a function `cast_spell()` that returns the incantation of a spell. The function should simply return the string 'Abrakadabra'.\nPlease reason step by step, then write a self-contained Pyt... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cast_spell() == 'Abrakadabra'\", \"assert cast_spell() == 'Abrakadabra'\", \"assert cast_spell() == 'Abrakadabra'\", \"assert cast_spell() == 'Abrakadabra'\", \"assert cast_spell() == 'Abrakadabra'\", \"assert cast_spell() == 'Abrakadabra'\", \"assert cast_s... | {
"split": "train",
"index": 85685,
"acecode_id": "oss_30611",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of transactions, where each transaction is represented as a dictionary containing 'program', 'transfersCount', and 'address', write a function `scan_program_transfers(transactions, program)` that returns a sorted list of transactions for the specified program, orde... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert scan_program_transfers([{'program': 'A', 'transfersCount': 5, 'address': 'addr1'}, {'program': 'B', 'transfersCount': 3, 'address': 'addr2'}, {'program': 'A', 'transfersCount': 10, 'address': 'addr3'}], 'A') == [{'program': 'A', 'transfersCount': 10, 'addres... | {
"split": "train",
"index": 85686,
"acecode_id": "bigcode_python_fns_30675",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an array of unique integers `arr` sorted in ascending order. Your task is to find and return the smallest index `i` such that `arr[i]` is equal to `i`. If no such index exists, return `-1`. Write a function `fixedPoint(arr: List[int]) -> int` to solve this problem... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fixedPoint([-10,-5,0,3,7]) == 3\", \"assert fixedPoint([0,2,5,8,17]) == 0\", \"assert fixedPoint([-10,-5,3,4,7,9]) == -1\", \"assert fixedPoint([-3,-2,1,5,6]) == -1\", \"assert fixedPoint([1,2,3,4,5]) == -1\", \"assert fixedPoint([-5,-4,-3,-2,-1]) == -1\", \... | {
"split": "train",
"index": 85687,
"acecode_id": "evol_2815",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a list of binary strings, each representing a binary number, implement a function that converts these binary strings to their respective decimal integer values. The function should ignore any binary strings that do not represent a valid binary number (i.e., they contain c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_binary_to_decimal(['101', '110', 'abc', '111']) == [5, 6, 7]\", \"assert convert_binary_to_decimal(['0', '1', '10', '11']) == [0, 1, 2, 3]\", \"assert convert_binary_to_decimal(['10', '2', '101010']) == [2, 42]\", \"assert convert_binary_to_decimal([... | {
"split": "train",
"index": 85688,
"acecode_id": "bigcode_python_fns_6669",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a class called `MyClass` that has a single instance attribute. This attribute should be initialized through the constructor and must be readonly from outside the class, meaning it should not be directly modifiable from outside the class. Instead, yo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert MyClass(10).get_attribute_value() == 10\", \"assert MyClass('hello').get_attribute_value() == 'hello'\", \"assert MyClass(3.14).get_attribute_value() == 3.14\", \"assert MyClass([1, 2, 3]).get_attribute_value() == [1, 2, 3]\", \"assert MyClass({'key': 'value... | {
"split": "train",
"index": 85689,
"acecode_id": "evol_16085",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of strings representing search items. The function should allow users to specify whether to include headers in the search results. The first item in the list can be considered a header. If the user chooses to inc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_search_list(['Header', 'Item1', 'Item2'], True) == ['Header', 'Item1', 'Item2']\", \"assert process_search_list(['Header', 'Item1', 'Item2'], False) == ['Item1', 'Item2']\", \"assert process_search_list(['A', 'B', 'C', 'D'], True) == ['A', 'B', 'C', ... | {
"split": "train",
"index": 85690,
"acecode_id": "oss_30767",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of relationships where each relationship is represented as a dictionary with two keys: 'type' and 'target'. The 'type' is a string representing the type of relationship, and 'target' is a dictionary containing a key 'runtime_properties' which itself is a di... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_external_resource_ids('typeA', [{'type': 'typeA', 'target': {'runtime_properties': {'EXTERNAL_RESOURCE_ID': 'id1'}}}, {'type': 'typeB', 'target': {'runtime_properties': {'EXTERNAL_RESOURCE_ID': 'id2'}}}]) == ['id1']\", \"assert get_external_resource_ids(... | {
"split": "train",
"index": 85691,
"acecode_id": "bigcode_python_fns_6223",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists, `id_to_send` and `msg_to_send`. Your task is to implement a function that simulates sending messages to users identified by their IDs. Each user ID corresponds to a message in the `msg_to_send` list. If a user ID is invalid (not an integer) or if the me... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert send_messages([1, 2, 3], ['Hi', 'There', 'Goodbye']) == []\", \"assert send_messages(['100', '200', '300'], ['Message1', 'Message2', 'Message3']) == ['User 100 is deleted', 'User 200 is deleted', 'User 300 is deleted']\", \"assert send_messages([], ['No mess... | {
"split": "train",
"index": 85692,
"acecode_id": "bigcode_python_fns_39358",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `are_not_equal(a: Any, b: Any) -> bool` that takes two arguments, `a` and `b`, and returns `True` if `a` and `b` are not equal, and `False` if they are equal. The comparison should handle all standard data types including integers, floats, strings, lists, a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert are_not_equal(1, 2) == True\", \"assert are_not_equal(1, 1) == False\", \"assert are_not_equal(3.5, 3.5) == False\", \"assert are_not_equal(3.5, 2.5) == True\", \"assert are_not_equal('hello', 'world') == True\", \"assert are_not_equal('hello', 'hello') == F... | {
"split": "train",
"index": 85693,
"acecode_id": "bigcode_python_fns_46464",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of filenames that represent trajectories in a specific format. Each filename contains the prefix 'trajectoriesDat_region_' followed by a number and the suffix '.csv'. Your task is to extract the group names from these filenames based on the following rules:... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_group_names(['trajectoriesDat_region_1.csv', 'trajectoriesDat_region_2.csv']) == (['EMS-1', 'EMS-2'], 'EMS', [1, 2])\", \"assert get_group_names(['trajectoriesDat_region_5.csv', 'trajectoriesDat_region_1.csv', 'trajectoriesDat_region_4.csv']) == (['EMS-1... | {
"split": "train",
"index": 85694,
"acecode_id": "bigcode_python_fns_20637",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function `priority_queue_operations(operations: List[Tuple[str, Union[str, int]]]) -> List[Union[str, None]]` that simulates a priority queue based on the provided operations. The operations are defined as follows: `enqueue(data: str, priority: int)` to add an eleme... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert priority_queue_operations([('enqueue', 'task1', 1), ('enqueue', 'task2', 3), ('peek',)]) == ['task2']\", \"assert priority_queue_operations([('enqueue', 'task1', 1), ('enqueue', 'task2', 3), ('dequeue',)]) == ['task2']\", \"assert priority_queue_operations([... | {
"split": "train",
"index": 85695,
"acecode_id": "evol_21144",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary `data` that contains labeled data, where each key represents a feature and the corresponding value is a list of values associated with that feature. The dictionary also contains a key called `inst_label`, which holds the labels for each data point. Yo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_data({'inst_label': ['label1', 'desired_label', 'label2'], 'feature1': [1, 2, 3]}, 'inst_label', 'desired_label') == ({'inst_label': ['desired_label'], 'feature1': [2]}, 2)\", \"assert filter_data({'inst_label': ['desired_label', 'desired_label', 'lab... | {
"split": "train",
"index": 85696,
"acecode_id": "oss_28757",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a string that represents a line from a GFF3 file. Each line contains several fields separated by tabs. Your task is to parse this line and return a dictionary where each key corresponds to a specific column name and its value corresponds to the data from that colu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_line('chr1\\tgene\\tprotein_coding\\t1000\\t5000\\t.\\t+\\t0\\tID=gene1;Name=Gene1') == {'seqid': 'chr1', 'source': 'gene', 'type': 'protein_coding', 'start': 1000, 'stop': 5000, 'score': '.', 'strand': '+', 'phase': '0', 'attributes': {'ID': 'gene1', ... | {
"split": "train",
"index": 85697,
"acecode_id": "bigcode_python_fns_33473",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of sequences, where each sequence is represented as a list of integers. Your task is to implement a function that takes this list of sequences and returns a new list containing only the sequences that have an even number of elements. Define a function `filt... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_sequences([[1, 2, 3], [4, 5], [6]]) == [[4, 5]]\", \"assert filter_even_sequences([[], [1, 2], [3], [4, 5, 6, 7]]) == [[], [1, 2], [4, 5, 6, 7]]\", \"assert filter_even_sequences([[1, 2, 3, 4], [5, 6], [7, 8, 9]]) == [[1, 2, 3, 4], [5, 6]]\", \"a... | {
"split": "train",
"index": 85698,
"acecode_id": "bigcode_python_fns_36138",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that generates a mapping of filenames to their respective parent directory. Write a function called `populate_file_dict` that takes two parameters: 1. `filenames` (list of strings): A list of filenames. 2. `parent_dir` (string): Th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert populate_file_dict([], '/path/to/parent') == {}\", \"assert populate_file_dict(['file1.txt'], '/path/to/parent') == {'file1.txt': '/path/to/parent'}\", \"assert populate_file_dict(['file1.txt', 'file2.txt'], '/parent/dir') == {'file1.txt': '/parent/dir', 'fi... | {
"split": "train",
"index": 85699,
"acecode_id": "oss_34352",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.