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 function `greet(name: str) -> str` that takes a string input `name` and returns a greeting message. The function should return 'Invalid name. Please enter a valid name.' if the input contains any numbers or special characters. Otherwise, it should return 'Hello, {name}!...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert greet('Alice') == 'Hello, Alice!'\", \"assert greet('Bob123') == 'Invalid name. Please enter a valid name.'\", \"assert greet('Charlie!') == 'Invalid name. Please enter a valid name.'\", \"assert greet('') == 'Invalid name. Please enter a valid name.'\", \"a...
{ "split": "train", "index": 74100, "acecode_id": "evol_1995", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a sorted array of integers and an integer value. Your task is to implement a function that finds the index of the first occurrence of the given integer in the array. If the integer is not found, the function should return -1. The function should take two parameter...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_first_occurrence([1, 2, 2, 3, 4], 2) == 1\", \"assert find_first_occurrence([1, 2, 2, 3, 4], 1) == 0\", \"assert find_first_occurrence([1, 2, 2, 3, 4], 5) == -1\", \"assert find_first_occurrence([], 1) == -1\", \"assert find_first_occurrence([1], 1) == ...
{ "split": "train", "index": 74101, "acecode_id": "oss_24715", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function called 'merge_alternating' that takes in three lists of integers, `list1`, `list2`, and `list3`. The function should return a new list where elements from `list1`, `list2`, and `list3` alternate in order. If one list is longer than the others, the remaining...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_alternating([], [], [1, 2, 3]) == [1, 2, 3]\", \"assert merge_alternating([1], [2], [3]) == [1, 2, 3]\", \"assert merge_alternating([1, 2], [3, 4], [5, 6]) == [1, 3, 5, 2, 4, 6]\", \"assert merge_alternating([1, 3, 5], [], [7, 8]) == [1, 7, 3, 8, 5]\",...
{ "split": "train", "index": 74102, "acecode_id": "evol_8207", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a sequence of two bytes represented as a tuple of integers, where each integer is in the range of 0 to 255 (inclusive). Your task is to convert this little-endian byte sequence into its corresponding integer value. In little-endian notation, the least significant ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert little_endian_bytes_to_int((0x00, 0x00)) == 0\", \"assert little_endian_bytes_to_int((0x01, 0x00)) == 1\", \"assert little_endian_bytes_to_int((0x02, 0x00)) == 2\", \"assert little_endian_bytes_to_int((0xff, 0x00)) == 255\", \"assert little_endian_bytes_to_i...
{ "split": "train", "index": 74103, "acecode_id": "bigcode_python_fns_6766", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a list of points in a 2D space, represented as tuples (x, y), and a centric point also represented as a tuple (x, y). Your task is to implement a function that calculates the accumulated costs of all points from the centric point. The cost for each point is define...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_costs([(0, 0), (0, 0)], (0, 0)) == 0\", \"assert calculate_costs([(5, 5)], (3, 3)) == 8\", \"assert calculate_costs([(1, 0), (0, 1)], (1, 1)) == 2\", \"assert calculate_costs([(1, 2), (2, 1)], (0, 0)) == 10\", \"assert calculate_costs([(0, 0)], (1,...
{ "split": "train", "index": 74104, "acecode_id": "bigcode_python_fns_37420", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks if a given HTML string contains a specific header tag with a specified text. The function should take two parameters: the HTML string and the header text. It should return True if the specified header exists in the HTML string...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert contains_header('<h2>For Organisers</h2>', 'For Organisers') == True\", \"assert contains_header('<h2>Hello World</h2>', 'For Organisers') == False\", \"assert contains_header('<div><h2>Test Header</h2></div>', 'Test Header') == True\", \"assert contains_hea...
{ "split": "train", "index": 74105, "acecode_id": "bigcode_python_fns_48913", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that compares two sentences and returns a dictionary containing characters that are the same and appear in identical positions in both sentences, along with their respective counts. The comparison should be case-insensitive and should consider all characters in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compare_sentences('Hello, world!', 'Hello, World!') == {'h': 1, 'e': 1, 'l': 3, 'o': 2, ',': 1, ' ': 1, 'w': 1, 'r': 1, 'd': 1, '!': 1}\", \"assert compare_sentences('abc', 'abc') == {'a': 1, 'b': 1, 'c': 1}\", \"assert compare_sentences('abc', 'ABC') == {'a...
{ "split": "train", "index": 74106, "acecode_id": "evol_26133", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a list of business groups along with their associated business type IDs, implement a function that takes a business type ID as input and returns a list of business groups associated with that type, sorted by their names. If there are no business groups associated with the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_business_groups([{'business_type_id': '1', 'name': 'Alpha'}, {'business_type_id': '1', 'name': 'Bravo'}, {'business_type_id': '2', 'name': 'Charlie'}], '1') == ['Alpha', 'Bravo']\", \"assert get_business_groups([{'business_type_id': '1', 'name': 'Delta'}...
{ "split": "train", "index": 74107, "acecode_id": "bigcode_python_fns_21407", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that formats and returns video metrics for a video streaming service. The function should accept three parameters: the number of views (an integer), total watch time (a float in minutes), and engagement rate (a float representing a pe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_video_metrics(1000, 500.0, 75.5) == 'Video Metrics:\\\\nViews: 1000\\\\nWatch Time: 500.0 minutes\\\\nEngagement Rate: 75.5%'\", \"assert format_video_metrics(2500, 1200.75, 60.0) == 'Video Metrics:\\\\nViews: 2500\\\\nWatch Time: 1200.75 minutes\\\\n...
{ "split": "train", "index": 74108, "acecode_id": "oss_10272", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple progress tracker that simulates the tracking of a job's completion status. Your function should take three parameters: `total` (an integer representing the total number of jobs to complete), `completed` (an integer representing the number o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert progress_tracker(10, 5) == '5/10 completed (50.0%) - '\", \"assert progress_tracker(0, 0) == '0/0 completed (0.0%) - '\", \"assert progress_tracker(20, 20) == '20/20 completed (100.0%) - '\", \"assert progress_tracker(15, 0) == '0/15 completed (0.0%) - '\", ...
{ "split": "train", "index": 74109, "acecode_id": "bigcode_python_fns_10378", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with evaluating a student's attendance record to determine their eligibility for an award. The attendance record is represented by a string of length n, where each character represents a day's attendance. The characters can be: 'A' for Absent, 'L' for Late, and '...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_record('PPALLP') == True\", \"assert check_record('PPALLL') == False\", \"assert check_record('PPL') == True\", \"assert check_record('A') == True\", \"assert check_record('AA') == False\", \"assert check_record('PPLLLL') == False\", \"assert check_rec...
{ "split": "train", "index": 74110, "acecode_id": "oss_15077", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Write a Python function that returns a list of the first n integers in the Fibonacci sequence. The Fibonacci sequence is defined as follows: F(0) = 0, F(1) = 1, and F(n) = F(n-1) + F(n-2) for n > 1. The function should return an error message if n is less than 1. Implement the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert Fibonacci(1) == [0]\", \"assert Fibonacci(2) == [0, 1]\", \"assert Fibonacci(3) == [0, 1, 1]\", \"assert Fibonacci(4) == [0, 1, 1, 2]\", \"assert Fibonacci(5) == [0, 1, 1, 2, 3]\", \"assert Fibonacci(6) == [0, 1, 1, 2, 3, 5]\", \"assert Fibonacci(7) == [0, 1...
{ "split": "train", "index": 74111, "acecode_id": "evol_8304", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of tuples, where each tuple contains a key-value pair, and returns a dictionary constructed from these pairs. Each key in the dictionary should map to its corresponding value from the tuples. If the same key appears mult...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_dictionary([('a', 1), ('b', 2), ('c', 3)]) == {'a': 1, 'b': 2, 'c': 3}\", \"assert create_dictionary([('a', 1), ('a', 2), ('b', 3)]) == {'a': 2, 'b': 3}\", \"assert create_dictionary([]) == {}\", \"assert create_dictionary([('key1', 'value1'), ('key2'...
{ "split": "train", "index": 74112, "acecode_id": "oss_25259", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with validating JSON-like data against a JSON Schema-like specification. The schema uses a custom syntax to define the expected structure and types of the JSON data. Implement a function `validate_json(schema: str, json_data: str) -> bool` that checks if the give...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_json('{name: string, age: int}', '{name: \\\"Alice\\\", age: 25}') == True\", \"assert validate_json('{name: string, age: int}', '{name: \\\"Bob\\\"}') == False\", \"assert validate_json('{height: number}', '{height: 175.5}') == True\", \"assert val...
{ "split": "train", "index": 74113, "acecode_id": "oss_4291", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function `reverse_text(text: str) -> str` that takes a string `text` as input and returns the string reversed. The function should handle empty strings and single character strings correctly. Additionally, ensure that the function can efficiently handle very large s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_text('abc') == 'cba'\", \"assert reverse_text('1234') == '4321'\", \"assert reverse_text('') == ''\", \"assert reverse_text('a') == 'a'\", \"assert reverse_text('hello') == 'olleh'\", \"assert reverse_text('OpenAI') == 'IAnepO'\", \"assert reverse_te...
{ "split": "train", "index": 74114, "acecode_id": "evol_451", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `manage_family` that takes a list of tuples, where each tuple contains the name of a relative, their relationship to you, and their year of birth. The function should return a sorted list of strings in the format 'Name (Relationship, Year of Birth)'. The li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_family([('George', 'Father', 1950), ('Sarah', 'Sister', 1980), ('Lisa', 'Mother', 1955), ('Mike', 'Brother', 1982)]) == ['George (Father, 1950)', 'Lisa (Mother, 1955)', 'Sarah (Sister, 1980)', 'Mike (Brother, 1982)']\", \"assert manage_family([]) == [...
{ "split": "train", "index": 74115, "acecode_id": "evol_31970", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of dependencies and their corresponding stream values, implement a function that overrides specific dependencies based on user-provided override values. The function should take two arguments: a list of tuples representing the dependencies and their streams, and a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert override_dependencies([('dep1', 'stream1'), ('dep2', 'stream2')], {'dep1': ['new_stream1']}) == [('dep1', 'new_stream1'), ('dep2', 'stream2')]\", \"assert override_dependencies([('dep1', 'stream1'), ('dep2', 'stream2')], {'dep2': ['new_stream2']}) == [('dep1...
{ "split": "train", "index": 74116, "acecode_id": "bigcode_python_fns_26165", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that converts a given function into a processor that executes an additional function before handling a request. Your function, named `load_hook_processor`, should take two parameters: a function `handler` and a function `hook`. The `hook`...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert load_hook_processor(lambda: 'Request handled', lambda: 'Hook executed')() == 'Request handled'\", \"assert load_hook_processor(lambda: 42, lambda: 'Before request')() == 42\", \"assert load_hook_processor(lambda: 'Done', lambda: print('Hook'))() == 'Done'\",...
{ "split": "train", "index": 74117, "acecode_id": "bigcode_python_fns_2933", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a report in a specific format. The function `create_report` takes the following parameters: a string `name`, a string `description`, a string `published` representing the date in 'YYYY-MM-DD' format, a string `author`, a li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_report('Monthly Report', 'This is a monthly report.', '2023-10-01', 'John Doe', ['obj1', 'obj2'], [{'url': 'http://example.com'}], 1, 'summary', 5, ['finance'], [{'filename': 'report.pdf', 'filetype': 'application/pdf'}]) == {'created_by_ref': 'John D...
{ "split": "train", "index": 74118, "acecode_id": "bigcode_python_fns_15347", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a list of integers and returns the sum of all positive integers in that list. If the list is empty, the function should return 0. Handle any potential errors by returning -1. Your implementation should follow these requ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_positive_integers([1, 2, 3, -1, -2]) == 6\", \"assert sum_positive_integers([-1, -2, -3]) == 0\", \"assert sum_positive_integers([]) == 0\", \"assert sum_positive_integers([0, 0, 0]) == 0\", \"assert sum_positive_integers([1, 2, 3, 4, 5]) == 15\", \"asse...
{ "split": "train", "index": 74119, "acecode_id": "oss_1033", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that converts a given source capability into its corresponding markdown format for documentation. Each source capability is represented as a string, and you need to return a markdown hyperlink to a documentation page if it exists. If ther...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_markdown_link('Deletion Detection') == '[Deletion Detection](https://example.com/docs/deletion_detection)'\", \"assert get_markdown_link('Domains') == '[Domains](https://example.com/docs/domains)'\", \"assert get_markdown_link('Platform Instance') == '[P...
{ "split": "train", "index": 74120, "acecode_id": "bigcode_python_fns_40728", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a case-insensitive dictionary. Your function should take a list of key-value pairs (tuples) and allow for case-insensitive lookups. The function should return a value associated with a given key, regardless of its case. If the key does not exist...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert case_insensitive_lookup([('Key1', 'Value1'), ('key2', 'Value2')], 'KEY1') == 'Value1'\", \"assert case_insensitive_lookup([('Key1', 'Value1'), ('key2', 'Value2')], 'key2') == 'Value2'\", \"assert case_insensitive_lookup([('a', 1), ('B', 2)], 'A') == 1\", \"a...
{ "split": "train", "index": 74121, "acecode_id": "bigcode_python_fns_12910", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that modifies a given script by appending a specific function call to its end. The function, `append_function_call`, takes a string `script` as input and appends the function call `checkReady(keg, props, resultBuilder, log)` to the en...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert append_function_call('function main() {\\\\n // main function body\\\\n}') == 'function main() {\\\\n // main function body\\\\n}\\\\ncheckReady(keg, props, resultBuilder, log)'\", \"assert append_function_call('') == '\\\\ncheckReady(keg, props, resultBui...
{ "split": "train", "index": 74122, "acecode_id": "oss_26424", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a list of integers and a comparison function, implement a function that calculates the median of the list using the comparison function for ordering. The comparison function should return a negative number if the first argument is less than the second, zero if they are eq...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert median([1, 2, 2, 4, 5], lambda a, b: a - b) == 2\", \"assert median([1, 3, 3, 6, 7, 8, 9], lambda a, b: a - b) == 6\", \"assert median([1, 2, 3, 4], lambda a, b: a - b) == 2\", \"assert median([5, 3, 8, 1, 2], lambda a, b: a - b) == 3\", \"assert median([1, ...
{ "split": "train", "index": 74123, "acecode_id": "evol_25013", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `calculate_statistics(numbers)` that takes a list of integers `numbers` as input and returns a tuple containing the maximum value, minimum value, and average (as a float) of the given numbers. The average should be calculated as the total sum of the numbers div...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_statistics([1, 2, 3, 4, 5]) == (5, 1, 3.0)\", \"assert calculate_statistics([-1, -2, -3, -4, -5]) == (-1, -5, -3.0)\", \"assert calculate_statistics([10, 20, 30]) == (30, 10, 20.0)\", \"assert calculate_statistics([0, 0, 0]) == (0, 0, 0.0)\", \"ass...
{ "split": "train", "index": 74124, "acecode_id": "evol_17403", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `convert_miles(miles: float)` that takes a distance in miles as input and returns a dictionary with the corresponding values in kilometers, feet, and meters. The function should handle exceptions for invalid inputs, returning None in case of an error.\nPlease r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_miles(10) == {'kilometers': 16.0934, 'feet': 52800, 'meters': 16093.4}\", \"assert convert_miles(0) == {'kilometers': 0.0, 'feet': 0, 'meters': 0.0}\", \"assert convert_miles('abc') == None\", \"assert convert_miles(1.0) == {'kilometers': 1.60934, 'f...
{ "split": "train", "index": 74125, "acecode_id": "evol_35222", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given a list of integers, and your task is to find the first integer in the list that is greater than a given threshold value. If no such integer exists, return -1. Write a function `find_first_greater_than_threshold(nums: List[int], threshold: int) -> int` that takes i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_first_greater_than_threshold([1, 3, 5, 7, 9], 4) == 5\", \"assert find_first_greater_than_threshold([1, 2, 3], 5) == -1\", \"assert find_first_greater_than_threshold([10, 20, 30], 15) == 20\", \"assert find_first_greater_than_threshold([-5, -3, -1, 0], ...
{ "split": "train", "index": 74126, "acecode_id": "bigcode_python_fns_18927", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that calculates the average of a list of numbers, excluding any negative numbers from the calculation. If the input list is empty or contains only negative numbers, the function should return 0. Write a function called `calcula...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average([3, -2, 5, 7, -8, 10]) == 6.25\", \"assert calculate_average([-1, -2, -3]) == 0\", \"assert calculate_average([]) == 0\", \"assert calculate_average([1, 2, 3]) == 2.0\", \"assert calculate_average([-10, -5, 0]) == 0\", \"assert calculate_av...
{ "split": "train", "index": 74127, "acecode_id": "oss_33610", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries representing employees in a building. Each dictionary contains three keys: 'id' (an integer), 'first_name' (a string), and 'second_name' (a string), and 'floor' (an integer). Your task is to implement a function that transforms the list of e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transform_employees([{'id': 1, 'first_name': 'John', 'second_name': 'Doe', 'floor': 2}], 10) == [{'id': 1, 'name': 'John Doe', 'steps_to_desk': 20}]\", \"assert transform_employees([{'id': 2, 'first_name': 'Jane', 'second_name': 'Smith', 'floor': 1}], 5) == ...
{ "split": "train", "index": 74128, "acecode_id": "bigcode_python_fns_31928", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with counting the occurrences of each unique word in a given string. A word is defined as a sequence of alphanumeric characters, excluding any punctuation or whitespace. The counting should be case-insensitive, meaning that 'Hello' and 'hello' should be treated a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_word_occurrences('Hello world hello') == {'hello': 2, 'world': 1}\", \"assert count_word_occurrences('The quick brown fox jumps over the lazy dog') == {'quick': 1, 'brown': 1, 'fox': 1, 'jumps': 1, 'over': 1, 'lazy': 1, 'dog': 1}\", \"assert count_word...
{ "split": "train", "index": 74129, "acecode_id": "oss_22415", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that disables SSL configuration for a given list of units in a messaging system. Your function should accept a list of units and return a boolean indicating whether the SSL configuration has been successfully disabled for all units. I...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert disable_ssl(['unit1', 'unit2', 'unit3']) == True\", \"assert disable_ssl(['unit4', 'unit5']) == True\", \"assert disable_ssl(['unit6']) == True\", \"assert disable_ssl(['unit7', 'unit8', 'unit9']) == True\", \"assert disable_ssl(['unit10', 'unit11']) == True...
{ "split": "train", "index": 74130, "acecode_id": "bigcode_python_fns_20376", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of file names, and your task is to filter this list based on specific inclusion criteria. Implement a function that processes the list and returns a new list containing only the file names that meet the following conditions: 1. If a file name contains the w...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_files(['temp_file.txt', 'data_file.txt']) == ['data_file.txt']\", \"assert process_files(['file1.txt', 'file2.txt']) == ['file1.txt', 'file2.txt']\", \"assert process_files(['temp.txt', 'data_records.txt']) == ['data_records.txt']\", \"assert process...
{ "split": "train", "index": 74131, "acecode_id": "oss_8018", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a class called LUT that contains a list of integers called Phi_wind and an integer called phase_dir. Your task is to implement a function get_phase_dir(lut) that returns the rotating direction of the phases based on the phase_dir attribute. If phase_dir is not -1 ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_phase_dir(LUT([0, 0, 0], 1)) == 1\", \"assert get_phase_dir(LUT([0, 0, 0], -1)) == -1\", \"assert get_phase_dir(LUT([10, 20, 30], 0)) == get_phase_dir_DataTime(10)\", \"assert get_phase_dir(LUT([5], 1)) == 1\", \"assert get_phase_dir(LUT([5], -1)) == -1\...
{ "split": "train", "index": 74132, "acecode_id": "bigcode_python_fns_27458", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `check_equal(value: int, x: int) -> bool` that checks whether the given integer `x` is equal to the specified integer `value`. The function should return `True` if `x` is equal to `value`, and `False` otherwise. Both `value` and `x` are guaranteed to be int...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_equal(5, 5) == True\", \"assert check_equal(0, 0) == True\", \"assert check_equal(-1, -1) == True\", \"assert check_equal(100, 100) == True\", \"assert check_equal(10, 20) == False\", \"assert check_equal(7, 8) == False\", \"assert check_equal(-5, 5) =...
{ "split": "train", "index": 74133, "acecode_id": "bigcode_python_fns_21561", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `sum_nested(lst)` that calculates the cumulative total of all numeric elements (integers and floats) within a list, including any nested lists. The function should ignore any non-numeric values, such as strings or None. The input list may contain integers, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_nested([14, 37, [54, 20], 'abc', 11.2]) == 136.2\", \"assert sum_nested([1, 2, [3, 4], None, 'test']) == 10.0\", \"assert sum_nested([1.5, [2.5, [3.5]], 4]) == 11.5\", \"assert sum_nested([10, 'string', [5.5, None], 2]) == 17.5\", \"assert sum_nested([])...
{ "split": "train", "index": 74134, "acecode_id": "evol_14700", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists: a list of initial positions `positions` and a list of 3D vectors `inpath`, which represent movements to be applied to these positions. The `positions` list contains N tuples, each representing a point in 3D space (x, y, z). The `inpath` list contains M ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert move_positions([(1, 1, 1)], [(0.1, 0.1, 0.1), (0.2, 0.2, 0.2)], 0) == [(1.1, 1.1, 1.1)]\", \"assert move_positions([(1, 1, 1)], [], 0) == [(1, 1, 1)]\", \"assert move_positions([], [(0.1, 0.1, 0.1)], 0) == []\", \"assert move_positions([(1, 1, 1)], [(0.1, 0....
{ "split": "train", "index": 74135, "acecode_id": "bigcode_python_fns_33425", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a program to decrypt a message that has been encrypted using a simple substitution cipher. In this cipher, each letter in the plaintext is shifted a certain number of positions down the alphabet to produce the ciphertext. Your program should take th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert decrypt_message('WKH TXLFN EURZQ IRA MXPSV RYHU WKH ODCB GRJ', 3) == 'THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG'\", \"assert decrypt_message('ZEBRA', 1) == 'YDAQZ'\", \"assert decrypt_message('WXYZ', 3) == 'TUVW'\", \"assert decrypt_message('ABCDEFGHIJKLMN...
{ "split": "train", "index": 74136, "acecode_id": "oss_37621", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given a list of 2D points represented as tuples (x, y) and a transformation matrix represented as a list of lists. Your task is to apply an affine transformation to each point in the list using the given transformation matrix. The transformation matrix is a 3x3 matrix t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert apply_affine_transformation([[1, 0, 0], [0, 1, 0], [0, 0, 1]], [(1, 2), (3, 4)]) == [(1.0, 2.0), (3.0, 4.0)]\", \"assert apply_affine_transformation([[2, 0, 0], [0, 2, 0], [0, 0, 1]], [(1, 1), (2, 2)]) == [(2.0, 2.0), (4.0, 4.0)]\", \"assert apply_affine_tra...
{ "split": "train", "index": 74137, "acecode_id": "bigcode_python_fns_36655", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Write a Python function that takes a 2D list of integers and returns a list containing the first negative number from each sublist. If a sublist does not contain any negative numbers, append None to the result list. You should implement this function using a 'do-while' loop emu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_first_negative([[1, 2, -3, 4], [5, -6, 7, 8], [9, 10, 11, 12]]) == [-3, -6, None]\", \"assert find_first_negative([[0, 0, 0], [1, 2, 3], [4, 5, 6]]) == [None, None, None]\", \"assert find_first_negative([[-1, 2, 3], [4, -5, 6], [7, 8, 9]]) == [-1, -5, N...
{ "split": "train", "index": 74138, "acecode_id": "evol_33995", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function to delete a bookmark from a user's collection of bookmarks. The function should take two parameters: a list of bookmarks (strings) and a bookmark to be deleted (string). If the bookmark exists in the list, it should be removed. The functi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert delete_bookmark(['google.com', 'stackoverflow.com', 'github.com'], 'stackoverflow.com') == ['google.com', 'github.com']\", \"assert delete_bookmark(['google.com', 'stackoverflow.com', 'github.com'], 'notarealbookmark.com') == ['google.com', 'stackoverflow.co...
{ "split": "train", "index": 74139, "acecode_id": "oss_2871", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that generates a command line string for a game based on the specified game type, file path, and additional options. The function `generate_game_command` takes three parameters: \n- `game_type` (string): The type of the game (e.g.,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_game_command('Minecraft', '/usr/games/minecraft', {'mode': 'creative'}) == ['game', 'type Minecraft', '--path /usr/games/minecraft', '--mode creative']\", \"assert generate_game_command('Fortnite', '/usr/games/fortnite', {'season': '10', 'battle_pas...
{ "split": "train", "index": 74140, "acecode_id": "oss_18171", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a model string representing a device. Your task is to determine the best-matching device from a predefined list of supported devices based on the first four characters of the model string. If a matching device is found, return the device name; otherwise, return a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert detect_device('FY2300') == 'FY2300'\", \"assert detect_device('FY2300X') == 'FY2300'\", \"assert detect_device('FY2400A') == 'FY2400'\", \"assert detect_device('FY250') == 'FY2500'\", \"assert detect_device('FY260') == 'FY2600'\", \"assert detect_device('FY2...
{ "split": "train", "index": 74141, "acecode_id": "bigcode_python_fns_6357", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `validate_configurations(conf: List[Dict[str, Union[str, List[str]]]]) -> bool` that takes in a list of configuration dictionaries. Each configuration has the following keys: 'branch_commit', 'ocaml_version', 'run_path_tag', 'codespee...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_configurations([{'branch_commit': 'commit1', 'ocaml_version': '4.14.1', 'run_path_tag': 'tag1', 'codespeed_name': 'name1', 'run_path_tags': []}]) == True\", \"assert validate_configurations([{'branch_commit': 'commit1', 'ocaml_version': '4.14.1', 'r...
{ "split": "train", "index": 74142, "acecode_id": "bigcode_python_fns_28338", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with processing feedback data for various projects. The feedback is stored in a list of dictionaries, where each dictionary represents a row of feedback data. Each row includes a project name, an email address, and several questions with corresponding responses. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_feedback([{'Project Name': 'Project A', 'Email Address': 'user1@example.com', 'Question 1': 'Answer 1'}]) == {'Project A': {'name': 'Project A', 'questions': {'Question 1': {'user1@example.com': 'Answer 1'}}}}\", \"assert process_feedback([{'Project ...
{ "split": "train", "index": 74143, "acecode_id": "oss_29236", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks whether a given issue can be reopened based on its current state. The function should take in the current state of the issue as a string and the issue number as an integer. If the state is 'closed', return a message indica...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_reopen_issue('closed', 101) == 'Issue 101 can be reopened.'\", \"assert can_reopen_issue('open', 102) == 'Issue 102 is not closed.'\", \"assert can_reopen_issue('pending', 103) == 'Issue 103 is not closed.'\", \"assert can_reopen_issue('closed', 104) == ...
{ "split": "train", "index": 74144, "acecode_id": "bigcode_python_fns_26464", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `closest_elements(arr: List[int], target: int, k: int) -> List[int]` that finds the `k` closest integers to the given `target` integer. The function should return a list of the `k` closest integers in ascending order. If there are ties...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert closest_elements([1, 2, 3, 4, 5], 5, 2) == [4, 5]\", \"assert closest_elements([1, 1, 1, 1], 1, 2) == [1, 1]\", \"assert closest_elements([1, 6, 3, 7, 8], 5, 2) == [3, 6]\", \"assert closest_elements([10, 15, 20, 25], 22, 1) == [20]\", \"assert closest_eleme...
{ "split": "train", "index": 74145, "acecode_id": "bigcode_python_fns_39508", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given an iterable dataset represented as a list of items and a function that simulates a DataLoader. Implement a function `prepare_ddp_loader(items: List[int], num_processes: int, process_index: int) -> List[List[int]]` that prepares the dataset for distributed processi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert prepare_ddp_loader([1, 2, 3, 4, 5], 2, 0) == [[1, 2, 3]]\", \"assert prepare_ddp_loader([1, 2, 3, 4, 5], 2, 1) == [[4, 5]]\", \"assert prepare_ddp_loader([1, 2, 3, 4, 5], 3, 0) == [[1, 2]]\", \"assert prepare_ddp_loader([], 2, 0) == []\", \"assert prepare_dd...
{ "split": "train", "index": 74146, "acecode_id": "bigcode_python_fns_36335", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of tuples, where each tuple contains a floating-point number representing the pXC50 value and an integer representing the activity label (0 for inactive, 1 for active). Write a function that separates the pXC50 values into two lists based on their activity ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert mean_pXC50([(1.0, 0), (1.5, 0), (2.0, 1)]) == (1.25, 2.0)\", \"assert mean_pXC50([(3.5, 1), (4.0, 1)]) == (None, 3.75)\", \"assert mean_pXC50([(2.0, 0), (3.0, 0)]) == (2.5, None)\", \"assert mean_pXC50([(1.0, 0), (5.0, 1), (2.0, 1), (3.0, 0)]) == (2.0, 3.5)\...
{ "split": "train", "index": 74147, "acecode_id": "bigcode_python_fns_28348", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string input that represents a numeric value, implement a function that converts the input string into a float. If the input string contains a percentage sign ('%'), remove it before converting. If the conversion to float is successful, return the float value. If the in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_float('100') == 100.0\", \"assert convert_to_float('45.67') == 45.67\", \"assert convert_to_float('99%') == 99.0\", \"assert convert_to_float('0.1234') == 0.1234\", \"assert convert_to_float('5.5%') == 5.5\", \"assert convert_to_float('abc') == 'a...
{ "split": "train", "index": 74148, "acecode_id": "bigcode_python_fns_4680", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string array `features` where `features[i]` is a single word representing the name of a feature. You also have a string array `responses`, where each `responses[i]` is a string containing space-separated words. Implement a function `sort_features(features, respo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_features(['cooler','lock','touch'], ['i like cooler cooler','lock touch cool','locker like touch touch']) == ['touch','cooler','lock']\", \"assert sort_features(['a','aa','b','c'], ['a','a aa','a a a a a','b a']) == ['a','aa','b','c']\", \"assert sort_f...
{ "split": "train", "index": 74149, "acecode_id": "evol_21001", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function to determine the availability of washing and drying machines in a laundromat. The function should take three parameters: 'numWashers' (the total number of washing machines), 'numDryers' (the total number of drying machines), and 'nameList...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_laundromat_availability(5, 3, ['Alice', 'Bob', 'Charlie']) == (2, 0)\", \"assert check_laundromat_availability(10, 10, []) == (10, 10)\", \"assert check_laundromat_availability(0, 0, ['Alice']) == (0, 0)\", \"assert check_laundromat_availability(2, 2, ...
{ "split": "train", "index": 74150, "acecode_id": "oss_2467", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string, write a function that determines if all characters in the string are unique, ignoring spaces. The function should return True if all characters are unique and False otherwise. The function should have a linear time complexity O(n).\nPlease reason step by step, t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert are_characters_unique('abcdefg') == True\", \"assert are_characters_unique('Hello world') == False\", \"assert are_characters_unique('Python') == True\", \"assert are_characters_unique('abc abc') == False\", \"assert are_characters_unique('') == True\", \"as...
{ "split": "train", "index": 74151, "acecode_id": "evol_16099", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers representing the indices of a partition vector and an integer n representing the length of a dimension, write a function that returns an array containing all the indices that are not present in the partition vector. The function signature should be: `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert flippv([0, 3, 5], 8) == [1, 2, 4, 6, 7]\", \"assert flippv([], 5) == [0, 1, 2, 3, 4]\", \"assert flippv([1, 2], 3) == [0]\", \"assert flippv([0, 1, 2], 5) == [3, 4]\", \"assert flippv([2, 4], 6) == [0, 1, 3, 5]\", \"assert flippv([3, 3, 2], 4) == [0, 1]\", \...
{ "split": "train", "index": 74152, "acecode_id": "bigcode_python_fns_34505", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function called `server_status(ip: str, last_validation: float) -> Tuple[bool, str]`. This function will determine if a server is alive and retrieve its location based on the provided IP address and the last validation time. The server is cons...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert server_status('192.168.1.1', time.time() - 5) == (True, 'New York')\", \"assert server_status('192.168.1.2', time.time() - 5) == (True, 'London')\", \"assert server_status('192.168.1.3', time.time() - 5) == (True, 'Tokyo')\", \"assert server_status('192.168....
{ "split": "train", "index": 74153, "acecode_id": "oss_24425", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings where each string represents a bitmask containing '0's and '1's. Your task is to write a function that takes this list of bitmask strings and returns a list of integers. Each integer should represent the decimal value of the corresponding bitmask...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_bitmasks(['101', '0', '111']) == [5, 0, 7]\", \"assert convert_bitmasks(['0', '0', '0']) == [0, 0, 0]\", \"assert convert_bitmasks(['1', '10', '11']) == [1, 2, 3]\", \"assert convert_bitmasks(['1101', '1001', '0011']) == [13, 9, 3]\", \"assert conver...
{ "split": "train", "index": 74154, "acecode_id": "bigcode_python_fns_29174", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given the definition of a ListNode class used to create a linked list. Your task is to implement a function that reverses a linked list in place. The function should take the head of a linked list as input and return the new head of the reversed linked list. You should ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_linked_list(ListNode(1, ListNode(2, ListNode(3)))) == ListNode(3, ListNode(2, ListNode(1)))\", \"assert reverse_linked_list(ListNode(1)) == ListNode(1)\", \"assert reverse_linked_list(ListNode(1, ListNode(2))) == ListNode(2, ListNode(1))\", \"assert ...
{ "split": "train", "index": 74155, "acecode_id": "oss_22788", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing URLs. Your task is to implement a function `extract_domain(urls: List[str]) -> List[str]` that returns a list of unique domain names extracted from the URLs. Each domain name should be returned in lowercase and should not include the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_domain(['https://www.example.com/page', 'http://example.com/about', 'https://example.org']) == ['example.com', 'example.org']\", \"assert extract_domain(['http://www.test.com', 'https://test.com/test', 'http://www.test.com']) == ['test.com']\", \"ass...
{ "split": "train", "index": 74156, "acecode_id": "bigcode_python_fns_23211", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that determines the best time to do laundry based on a provided input message. The function should analyze the message for keywords related to time and return a recommendation for when to do laundry. The function should take a sing...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert recommend_laundry_time('What time should I do laundry in the morning?') == 'It is recommended to do the laundry in the morning to ensure it dries completely during the day.'\", \"assert recommend_laundry_time('Is it okay to do laundry in the evening?') == 'D...
{ "split": "train", "index": 74157, "acecode_id": "oss_24968", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that determines the number of elements in the list that are greater than a specified threshold. The function should take two arguments: an integer list 'nums' and an integer 'threshold'. Return the count of elements that are strictly g...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_greater_than_threshold([1, 2, 3, 4, 5], 3) == 2\", \"assert count_greater_than_threshold([10, 20, 30, 40], 25) == 2\", \"assert count_greater_than_threshold([5, 5, 5, 5], 5) == 0\", \"assert count_greater_than_threshold([1, 1, 1, 1], 0) == 4\", \"asser...
{ "split": "train", "index": 74158, "acecode_id": "bigcode_python_fns_22049", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `convert_angle(val, in_type, out_type)` that converts an angle from one unit to another. The valid types are 'radians', 'degrees', 'gradians', and 'turns'. If `val` is a list, the function should return a list of converted values. If the input or output type is...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_angle(180, 'degrees', 'radians') == 3.141592653589793\", \"assert convert_angle(1, 'turns', 'degrees') == 360\", \"assert convert_angle(200, 'gradians', 'degrees') == 180\", \"assert convert_angle(0, 'radians', 'turns') == 0\", \"assert convert_angle...
{ "split": "train", "index": 74159, "acecode_id": "evol_22989", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that manages the configuration settings for a device. The function, named `manage_device_config`, should perform the following tasks: Initialize the configuration settings with default values, update specific configuration settings, a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_device_config([('init')]) == {'name': 'default_name', 'PINNR': 1234, 'enabled': True}\", \"assert manage_device_config([('init'), ('update', 'name', 'new_name')]) == {'name': 'new_name', 'PINNR': 1234, 'enabled': True}\", \"assert manage_device_config...
{ "split": "train", "index": 74160, "acecode_id": "oss_10780", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a program to analyze a list of security-related strings and categorize them based on their structure. Each string follows a specific format consisting of three parts separated by colons (:). The first part represents the category of the security pol...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert categorize_security_strings(['A:B:C', 'A:D:E', 'B:F:G']) == {'A': 2, 'B': 1}\", \"assert categorize_security_strings(['X:Y:Z', 'X:Y:W', 'Y:Z:X', 'Z:X:Y']) == {'X': 2, 'Y': 1, 'Z': 1}\", \"assert categorize_security_strings(['Category1:Subcat1:Attr1', 'Catego...
{ "split": "train", "index": 74161, "acecode_id": "oss_20728", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of migration operations and generates the corresponding SQL statements. Each migration operation is represented as a tuple containing the app name, migration name, and a list of migration operations. Each migr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_sql([RenameField('issue', 'target_issue', 'target_user')]) == ['ALTER TABLE issue RENAME COLUMN target_issue TO target_user;']\", \"assert generate_sql([AddField('issue', 'priority', 'integer')]) == ['ALTER TABLE issue ADD COLUMN priority integer;']...
{ "split": "train", "index": 74162, "acecode_id": "oss_32408", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing different commands for a session manager. Each command can either be a session initiation, session setting, or session teardown command. Your task is to implement a function `validate_commands(commands: List[str]) -> List[str]` that ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_commands(['SESSION_INITIATE session1']) == ['OK']\", \"assert validate_commands(['SESSION_INITIATE session1', 'SESSION_SET session1 foo=bar', 'SESSION_TEARDOWN session1']) == ['OK', 'OK', 'OK']\", \"assert validate_commands(['SESSION_INITIATE sessio...
{ "split": "train", "index": 74163, "acecode_id": "bigcode_python_fns_26800", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function `compute_euler(num_terms: int) -> float` that computes the approximate value of Euler's number (e) using the first `num_terms` terms of its infinite series representation. The infinite series for Euler's number is defined as: e = 1 + 1/1! + 1/2! + 1/3! + 1/...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert abs(compute_euler(1) - 1.0) < 1e-9\", \"assert abs(compute_euler(2) - 2.0) < 1e-9\", \"assert abs(compute_euler(3) - 2.5) < 1e-9\", \"assert abs(compute_euler(4) - 2.6666666666666665) < 1e-9\", \"assert abs(compute_euler(5) - 2.708333333333333) < 1e-9\", \"a...
{ "split": "train", "index": 74164, "acecode_id": "evol_2197", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function that checks whether a given target subsequence can be found within a prominent string. The function should return True if the target subsequence exists in the prominent string, otherwise return False. You may assume that both the prominent string and the ta...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_subsequence('Hello', 'el') == True\", \"assert check_subsequence('abcdef', 'ace') == True\", \"assert check_subsequence('python', 'py') == True\", \"assert check_subsequence('python', 'on') == True\", \"assert check_subsequence('hello world', 'hlo') ==...
{ "split": "train", "index": 74165, "acecode_id": "evol_26109", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that processes a list of strings representing CSV content. The function should concatenate the content into a single output string. The input will include a list of CSV strings, an encoding type, and a delimiter. Your task is t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_csv_strings(['a,b,c', 'd,e,f'], 'utf-8', ',') == 'a,b,c,d,e,f'\", \"assert process_csv_strings(['name,age', 'Alice,30'], 'utf-8', ';') == 'name,age;Alice,30'\", \"assert process_csv_strings(['1,2,3', '4,5,6'], 'utf-8', '-') == '1,2,3-4,5,6'\", \"asse...
{ "split": "train", "index": 74166, "acecode_id": "oss_36028", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing a simple trading system where users can place buy and sell orders for a cryptocurrency. Each order has a type ('B' for buy and 'S' for sell), a quantity, and a price per unit. When a new order is created, it needs to freeze the required amount of fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_order('B', 10, 5.0) == 'Order Frozen'\", \"assert manage_order('S', 10, 5.0) == 'Order Frozen'\", \"assert manage_order('S', 10, 5.0) == 'Order Frozen'\", \"assert manage_order('B', 10, 6.0) == 'Order Frozen'\", \"assert manage_order('B', 15, 5.0) == ...
{ "split": "train", "index": 74167, "acecode_id": "bigcode_python_fns_10166", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Implement a function that processes a string of characters to extract meaningful data. The function should take a string as input and output a dictionary where the keys are unique words if the string contains commas or colons, and their corresponding values are the counts of th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_advanced_data('hello,world,of,AI,world,AI') == {'hello': 1, 'world': 2, 'of': 1, 'AI': 2}\", \"assert extract_advanced_data('AI:is:the:future:AI') == {'AI': 2, 'is': 1, 'the': 1, 'future': 1}\", \"assert extract_advanced_data('apple:banana:apple:oran...
{ "split": "train", "index": 74168, "acecode_id": "evol_24745", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a string `s`, write a function `reverseVowels` that reverses only the vowels of the string. The vowels are defined as 'a', 'e', 'i', 'o', and 'u', and they can appear in both uppercase and lowercase. Your goal is to return the modified string after the vowels have been re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverseVowels('hello') == 'holle'\", \"assert reverseVowels('leetcode') == 'leotcede'\", \"assert reverseVowels('aA') == 'Aa'\", \"assert reverseVowels('') == ''\", \"assert reverseVowels('') == ''\", \"assert reverseVowels('what') == 'what'\", \"assert reve...
{ "split": "train", "index": 74169, "acecode_id": "oss_30200", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that takes a list of integers and returns a new list containing only the even numbers from the original list. Your function should preserve the order of the even numbers as they appear in the input list. If there are no even number...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 15, 20, 25]) == [10, 20]\", \"assert filter_even_numbers([0, -2, -4, 3]) == [0, -2, -4]\", \"assert filter_even_numbers([1, 3, 5]) == []\", \"assert filter_even_numbers([]) =...
{ "split": "train", "index": 74170, "acecode_id": "oss_19150", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with processing a dictionary that contains information about an input/output argument. Your function should take a dictionary as input and return a modified version of that dictionary if it meets certain criteria. The dictionary will contain the following keys: '...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_single_io_arg({'valid': True, 'name': 'test', 'range': [[1, 2], [3, -1]]}) == {'range': [[1, 2], [3, None]]}\", \"assert get_single_io_arg({'valid': False, 'name': 'test'}) == None\", \"assert get_single_io_arg({'valid': True, 'name': 'test'}) == {}\", \...
{ "split": "train", "index": 74171, "acecode_id": "bigcode_python_fns_36692", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `fibonacci(n: int, m: int) -> Union[int, str]` that takes two integer parameters `n` and `m`. The function should return the `m`th term of the Fibonacci sequence up to the `n`th term. If `m` is greater than `n`, or if either `n` or `m` are negative numbers,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci(5, 5) == 3\", \"assert fibonacci(2, 1) == 0\", \"assert fibonacci(2, 2) == 1\", \"assert fibonacci(6, 2) == 1\", \"assert fibonacci(10, 10) == 34\", \"assert fibonacci(3, 3) == 1\", \"assert fibonacci(8, 2) == 1\"]}" }
{ "split": "train", "index": 74172, "acecode_id": "evol_16850", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given a list of numerical values, implement a function `calculate_mean(numbers)` that computes and returns the arithmetic mean of the values in the list. The function should handle cases where the list is empty by returning 0.\nPlease reason step by step, then write a self-cont...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_mean([2, 4, 6, 8]) == 5.0\", \"assert calculate_mean([1, 2, 3]) == 2.0\", \"assert calculate_mean([-1, 0, 1]) == 0.0\", \"assert calculate_mean([10, 20, 30, 40]) == 25.0\", \"assert calculate_mean([5]) == 5.0\", \"assert calculate_mean([]) == 0\", ...
{ "split": "train", "index": 74173, "acecode_id": "evol_19637", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are to implement a function called `extract_version_string(version: str) -> str` that takes a version string as input and returns the version without the leading 'v' character, if present. The input version string can be in the format 'v1.2.3-abc', 'v0.1.0', or '2.3.4', amo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_version_string('v1.2.3-abc') == '1.2.3-abc'\", \"assert extract_version_string('v0.1.0') == '0.1.0'\", \"assert extract_version_string('2.3.4') == '2.3.4'\", \"assert extract_version_string('v0.0.1') == '0.0.1'\", \"assert extract_version_string('v12...
{ "split": "train", "index": 74174, "acecode_id": "bigcode_python_fns_42107", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string that contains a fuzzer name and a benchmark name separated by a space. Your task is to implement a function that takes this string as input and returns a tuple containing the fuzzer name and benchmark name as separate elements. For example, given the inpu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert key_to_fuzzer_and_benchmark('afl libpng-1.2.56') == ('afl', 'libpng-1.2.56')\", \"assert key_to_fuzzer_and_benchmark('libfuzzer llvm-9.0') == ('libfuzzer', 'llvm-9.0')\", \"assert key_to_fuzzer_and_benchmark('ossfuzz sqlite-3.34.0') == ('ossfuzz', 'sqlite-3....
{ "split": "train", "index": 74175, "acecode_id": "bigcode_python_fns_36893", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing a collection of articles. Each article has a title and a category. Your goal is to implement a function that takes a list of articles and a category string as inputs and returns a list of titles of the articles that belong to the specified category....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_article_titles_by_category([{'title': 'Python Basics', 'category': 'Programming'}, {'title': 'Data Structures', 'category': 'Programming'}, {'title': 'Artificial Intelligence', 'category': 'Technology'}], 'Programming') == ['Python Basics', 'Data Structu...
{ "split": "train", "index": 74176, "acecode_id": "oss_22291", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing the contents of a file that uses a specific numeric format. Your task is to convert this string to a new format by replacing all instances of 'Numeric' with 'NumPy'. Additionally, if the conversion occurs, return the new string along with a b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_numeric_to_numpy('Numeric is a library.') == ('NumPy is a library.', True)\", \"assert convert_numeric_to_numpy('This string does not contain the keyword.') == ('This string does not contain the keyword.', False)\", \"assert convert_numeric_to_numpy(...
{ "split": "train", "index": 74177, "acecode_id": "bigcode_python_fns_7691", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates reading data from different zones in a multizone environment. The function will take two parameters: `read_mode` (a string) and `return_type` (also a string). The `read_mode` can be either 'roundrobin' or 'localcopy', w...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_multizone_read_mode('roundrobin') == {'mode': 'roundrobin'}\", \"assert set_multizone_read_mode('localcopy') == {'mode': 'localcopy'}\", \"assert set_multizone_read_mode('roundrobin', 'json') == '{\\\"mode\\\": \\\"roundrobin\\\"}'\", \"assert set_multiz...
{ "split": "train", "index": 74178, "acecode_id": "bigcode_python_fns_23173", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that converts an object into a dictionary format suitable for a specific API. The function `to_api_dict` should take an object as input and create a dictionary from its attributes. Specifically, the function should check if the input ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert to_api_dict({'status': None}) == {}\", \"assert to_api_dict({'status': 'not a dict'}) == {}\", \"assert to_api_dict({}) == {}\", \"assert to_api_dict({'status': {'not_to_api_dict': lambda: {}}}) == {}\", \"assert to_api_dict({'random_attr': 123}) == {}\", \"...
{ "split": "train", "index": 74179, "acecode_id": "oss_1083", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that calculates the number of days between two given dates. The function should take two date strings in the format 'YYYY-MM-DD' as input and return the number of days between the two dates, inclusive of both the start date and end...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_days_between_dates('2022-01-01', '2022-01-10') == 10\", \"assert calculate_days_between_dates('2022-01-10', '2022-01-01') == 0\", \"assert calculate_days_between_dates('2022-02-01', '2022-02-01') == 1\", \"assert calculate_days_between_dates('2022-...
{ "split": "train", "index": 74180, "acecode_id": "oss_667", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that parses a list of strings representing metadata for Python packages and returns a dictionary containing the key-value pairs extracted from the metadata. You are given a list of strings, where each string represents a key-value ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_metadata(['Name :: requests', 'Version :: 2.25.1']) == {'Name': 'requests', 'Version': '2.25.1'}\", \"assert parse_metadata(['Name :: requests', 'Name :: urllib3']) == {'Name': ['requests', 'urllib3']}\", \"assert parse_metadata(['Author :: Kenneth Rei...
{ "split": "train", "index": 74181, "acecode_id": "oss_10422", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the movement of an agent in a grid-based environment. The agent can take one of four actions: 'up', 'down', 'left', or 'right'. The agent's current position is represented by a tuple (x, y) on a 2D grid, and the goal ce...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert move_agent((0, 0), 'up', (1, 1)) == (0, 0, 0)\", \"assert move_agent((0, 0), 'down', (1, 1)) == (0, 1, 0)\", \"assert move_agent((0, 0), 'right', (1, 1)) == (1, 0, 0)\", \"assert move_agent((0, 0), 'left', (1, 1)) == (0, 0, 0)\", \"assert move_agent((1, 1), ...
{ "split": "train", "index": 74182, "acecode_id": "oss_36169", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a message in the form of a string that contains key-value pairs separated by '&', and a prefix string. Your task is to determine if the message starts with the given prefix and if the key-value pairs in the message match the given list of claims exactly. The key-v...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert verify_outcome('prefix&key1=value1&key2=value2', 'prefix', ['key1=value1', 'key2=value2']) == True\", \"assert verify_outcome('prefix&key1=value1&key2=value2', 'prefix', ['key2=value2', 'key1=value1']) == True\", \"assert verify_outcome('prefix&key1=value1',...
{ "split": "train", "index": 74183, "acecode_id": "bigcode_python_fns_19532", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a custom hash function for a `Table` class in Python. The `Table` class represents a database table and has two attributes: `schema` (a string) and `table_name` (a string). Your task is to complete the implementation of the `Table` class by prov...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert Table('public', 'users').__hash__() == Table('public', 'users').__hash__()\", \"assert Table('public', 'users') == Table('public', 'users')\", \"assert Table('public', 'orders').__hash__() != Table('public', 'users').__hash__()\", \"assert Table('public', 'o...
{ "split": "train", "index": 74184, "acecode_id": "oss_112", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a date in ISO 8601 format (YYYY-MM-DD) and returns the corresponding day of the week as a string. The days should be returned as 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', or 'Sunday'.\nPlease reason step by step, then wr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_day('2021-01-01') == 'Friday'\", \"assert find_day('2020-12-30') == 'Wednesday'\", \"assert find_day('2022-02-22') == 'Tuesday'\", \"assert find_day('2023-03-15') == 'Wednesday'\", \"assert find_day('2024-07-04') == 'Thursday'\", \"assert find_day('2025...
{ "split": "train", "index": 74185, "acecode_id": "evol_6182", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string that represents a URL. Write a function `extract_hostname(url: str) -> str` that extracts and returns the hostname from the given URL. The hostname is the part of the URL that comes after the protocol (e.g., 'http://', 'https://') and before the first '/'...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_hostname('https://example.com/path/to/resource') == 'example.com'\", \"assert extract_hostname('http://www.test.com') == 'www.test.com'\", \"assert extract_hostname('https://subdomain.test.co.uk/index.html') == 'subdomain.test.co.uk'\", \"assert extr...
{ "split": "train", "index": 74186, "acecode_id": "bigcode_python_fns_38416", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `search_users` that simulates a user search based on a given username substring and an optional company ID. The function accepts two parameters: a string `username` (the substring to search for in usernames) and an integer `company_id...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert search_users('j', 2) == ['jane_doe', 'john_smith']\", \"assert search_users('xyz', 1) == []\", \"assert search_users('john', None) == ['john_doe', 'john_smith']\", \"assert search_users('jane', 2) == ['jane_doe']\", \"assert search_users('xyz', None) == []\"...
{ "split": "train", "index": 74187, "acecode_id": "bigcode_python_fns_12048", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Implement a function `ternary_search(arr: List[int], x: int) -> int` that performs a ternary search on a given sorted list of integers `arr` to find the index of the element `x`. If `x` is present in `arr`, return its index; otherwise, return -1. The function should handle case...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert ternary_search([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], 8) == 7\", \"assert ternary_search([1, 2, 3, 4, 5, 6, 7], 4) == 3\", \"assert ternary_search([1, 2, 3, 4, 5, 6, 7], 1) == 0\", \"assert ternary_search([1, 2, 3, 4, 5, 6, 7], 7) == 6\", \"assert ternary_...
{ "split": "train", "index": 74188, "acecode_id": "evol_25553", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of file metadata dictionaries, where each dictionary contains details about a file including its logical name, UUID, checksum, file size, and modification date. Your task is to implement a function `get_file_info(files: List[Dict[str, Any]]) -> List[Dict[st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_file_info([{'logical_name': 'file1.txt', 'uuid': '1', 'checksum': 'abc', 'file_size': 150000000, 'meta_modify_date': '2021-01-01'}, {'logical_name': 'file2.txt', 'uuid': '2', 'checksum': 'def', 'file_size': 90000000, 'meta_modify_date': '2021-01-02'}]) =...
{ "split": "train", "index": 74189, "acecode_id": "bigcode_python_fns_45130", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Write a Python function `count_weekdays(year: int, month: int) -> int` that takes a year and a month as input and returns the total number of weekdays (Monday to Friday) in that specific month. A weekday is defined as any day from Monday (0) to Friday (4) inclusive. The functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_weekdays(2023, 1) == 22\", \"assert count_weekdays(2023, 2) == 20\", \"assert count_weekdays(2023, 3) == 23\", \"assert count_weekdays(2023, 4) == 20\", \"assert count_weekdays(2023, 5) == 23\", \"assert count_weekdays(2023, 6) == 22\", \"assert count_...
{ "split": "train", "index": 74190, "acecode_id": "evol_23989", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the maximum allowable winding angle for the second layer of an electrical coil based on the number of windings and the number of turns. The maximum winding angle can be calculated using the formula: max_winding_angle = π / nb_wind / turns2. Imple...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_max_winding_angle(1.0, 3.14159, 2, 3) == 0.5235983333333333\", \"assert calculate_max_winding_angle(0.5, 3.14159, 1, 1) == 3.14159\", \"assert calculate_max_winding_angle(2.0, 3.14159, 3, 4) == 0.26179916666666665\", \"assert calculate_max_winding_...
{ "split": "train", "index": 74191, "acecode_id": "oss_21886", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that generates a unique request ID for HTTP requests. The function should allow customization of the header used to transmit the request ID and simulate adding the request ID to an HttpRequest object. Your function should have the fol...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_request_id_to_http_request('X-Request-ID', HttpRequest()) is not None\", \"assert add_request_id_to_http_request('Custom-Header', HttpRequest()) is not None\", \"assert add_request_id_to_http_request('Request-ID', HttpRequest()) is not None\", \"assert a...
{ "split": "train", "index": 74192, "acecode_id": "oss_36185", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the installation of a web application in a specific virtual environment. The function `install_webapp()` should accept two parameters: `app_directory` (a string representing the path to the web application code) and `env_na...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert install_webapp('/home/genomics.www/status', 'web') == 'Installation successful: Web application installed in web from /home/genomics.www/status.'\", \"assert install_webapp('/home/genomics.www/status', '') == 'Installation failed: Invalid parameters.'\", \"a...
{ "split": "train", "index": 74193, "acecode_id": "bigcode_python_fns_8767", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the ages of a group of people. Write a function `group_ages(ages: List[int]) -> List[Tuple[int, int]]` that returns a list of tuples where each tuple contains two ages that are the same. If there are no two people with the same age,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert group_ages([20, 25, 30, 20, 25]) == [(20, 20), (25, 25)]\", \"assert group_ages([18, 18, 22, 30, 22, 30]) == [(18, 18), (22, 22), (30, 30)]\", \"assert group_ages([1, 2, 3, 4, 5]) == []\", \"assert group_ages([15]) == []\", \"assert group_ages([0, 0, 1, 1, 2...
{ "split": "train", "index": 74194, "acecode_id": "bigcode_python_fns_9994", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a list of daily temperatures `T`, return a list of tuples where each tuple consists of two values: the first value represents how many days you would have to wait until a warmer temperature, and the second value represents how many days you would have to wait until the te...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert dailyTemperatures([75, 74, 73, 72]) == [(0,0), (0,0), (0,0), (0,0)]\", \"assert dailyTemperatures([70, 70, 70, 70]) == [(0,0), (0,0), (0,0), (0,0)]\", \"assert dailyTemperatures([100, 99, 98, 97, 96]) == [(0,0), (0,0), (0,0), (0,0), (0,0)]\", \"assert dailyT...
{ "split": "train", "index": 74195, "acecode_id": "evol_26536", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Given an input variable, determine whether it is a singleton. A singleton is defined as either a unit set (a set containing exactly one element) or a scalar (a single non-iterable value). Implement a function 'is_singleton(var)' that returns True if the input is a singleton and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_singleton(5) == True\", \"assert is_singleton(3.14) == True\", \"assert is_singleton(None) == True\", \"assert is_singleton({42}) == True\", \"assert is_singleton([1]) == False\", \"assert is_singleton([1, 2]) == False\", \"assert is_singleton({1, 2}) == ...
{ "split": "train", "index": 74196, "acecode_id": "bigcode_python_fns_24609", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a string D, write a function that returns the last occurring position and frequency of a distinct sequence s in D. The function should take two parameters: the string D and the sequence s, both of which are non-empty. The last occurring position should be the index of the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sequence_info('Hello, World!', 'o') == (8, 2)\", \"assert sequence_info('abcabcabc', 'abc') == (6, 3)\", \"assert sequence_info('Test case', 'z') == (-1, 0)\", \"assert sequence_info('a quick brown fox', 'quick') == (2, 1)\", \"assert sequence_info('abcdefg'...
{ "split": "train", "index": 74197, "acecode_id": "evol_29380", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a video manifest represented as a dictionary. Each manifest contains a key 'videoTracks', which is a list of dictionaries. Each video track dictionary contains a key 'downloadables', which is a list of dictionaries representing different video profiles. Each profi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert has_1080p({'videoTracks': [{'downloadables': [{'width': 1920}, {'width': 1280}]}]}) == True\", \"assert has_1080p({'videoTracks': [{'downloadables': [{'width': 1280}, {'width': 720}]}]}) == False\", \"assert has_1080p({'videoTracks': [{'downloadables': [{'wi...
{ "split": "train", "index": 74198, "acecode_id": "bigcode_python_fns_19469", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that translocates all occurrences of the integer zero, as well as its string and float equivalents ('0', '0.0'), to the end of a given list. The function should also account for nested lists, maintaining the sequential order of non-zero elements and treatin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert translocate_zeros([0, 1, 2, 3]) == [1, 2, 3, 0]\", \"assert translocate_zeros([0, '0', 1, 2, '3', 0.0]) == [1, 2, '3', 0, '0', 0.0]\", \"assert translocate_zeros([1, 2, 3, 0, [0, 4, 5]]) == [1, 2, 3, 4, 5, 0, 0]\", \"assert translocate_zeros([0, [0, 0], 0, 1...
{ "split": "train", "index": 74199, "acecode_id": "evol_19495", "num_tests": 14 }