data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "You are given a string that may contain placeholders in the format `{param_name}` which need to be replaced with corresponding values from a provided dictionary. Implement a function that takes a string and a dictionary of parameters, and returns the modified string after repla... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_placeholders('Hello, {name}!', {'name': 'Alice'}) == 'Hello, Alice!'\", \"assert replace_placeholders('Your balance is {balance}.', {'balance': 100}) == 'Your balance is 100.'\", \"assert replace_placeholders('Welcome, {user}!', {'user': 'Bob'}) == '... | {
"split": "train",
"index": 76700,
"acecode_id": "bigcode_python_fns_6608",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing the names of programming languages used in various projects. Your task is to implement a function `count_languages(languages: List[str]) -> Dict[str, int]` that takes in a list of strings `languages` and returns a dictionary where th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_languages(['Python', 'Java', 'Python', 'C++']) == {'Python': 2, 'Java': 1, 'C++': 1}\", \"assert count_languages(['Java', 'Java', 'C++', 'C++', 'Python']) == {'Java': 2, 'C++': 2, 'Python': 1}\", \"assert count_languages(['Python', 'Python', 'Python'])... | {
"split": "train",
"index": 76701,
"acecode_id": "bigcode_python_fns_7020",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `get_positive_and_sort_dict(d: dict) -> dict` that takes a dictionary where each key maps to a list of integers. The function should return a new dictionary that only contains the positive integers from the input lists, sorted in ascending order. If a key does ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_positive_and_sort_dict({'a': [-1, 2, -4], 'b': [5, 6]}) == {'a': [2], 'b': [5, 6]}\", \"assert get_positive_and_sort_dict({'x': [5, 3, -5, 2, -3, 3, 9, 123, 1, -10], 'y': [-1, 0, -3]}) == {'x': [1, 2, 3, 3, 5, 9, 123], 'y': []}\", \"assert get_positive_a... | {
"split": "train",
"index": 76702,
"acecode_id": "evol_184",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that calculates the total number of devices from the given counts of Docker devices and VMX devices. The function should take two integer parameters, `docker_count` and `vmx_count`, which represent the count of Docker devices and VMX devi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_devices(0, 0) == 0\", \"assert calculate_total_devices(1, 0) == 1\", \"assert calculate_total_devices(0, 1) == 1\", \"assert calculate_total_devices(2, 3) == 5\", \"assert calculate_total_devices(10, 5) == 15\", \"assert calculate_total_devic... | {
"split": "train",
"index": 76703,
"acecode_id": "oss_1496",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to simulate the movement of a circular robot in a 2D space. The robot's position is represented by its x and y coordinates, and it has a fixed radius. Your task is to implement a function `is_in_collision(robot_x, robot_y, robot_radiu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_in_collision(0, 0, 5, 10, 10, 8, 8, 3) == True\", \"assert is_in_collision(0, 0, 5, 10, 10, 20, 20, 3) == False\", \"assert is_in_collision(1, 1, 2, 2, 2, 3, 3, 1) == True\", \"assert is_in_collision(0, 0, 2, 1, 1, 5, 5, 1) == False\", \"assert is_in_coll... | {
"split": "train",
"index": 76704,
"acecode_id": "oss_27213",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a formatted string representing the requirements of a software package based on its dependencies. The function should take two parameters: a list of package names and a boolean indicating whether to enforce strict checking ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_requirements(['package-1', 'package-2'], False) == '# created with python-3.8.5\\\\npackage-1==1.2.3\\\\npackage-2==2.3.4\\\\n'\", \"assert generate_requirements(['package-1', 'package-3'], False) == '# created with python-3.8.5\\\\npackage-1==1.2.3... | {
"split": "train",
"index": 76705,
"acecode_id": "bigcode_python_fns_35180",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a binary tree represented by its root node. Your task is to implement a function that performs postorder traversal on the binary tree. Postorder traversal involves visiting the left subtree, then the right subtree, and finally the root node. The function should re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert postorder_traversal(TreeNode(1, TreeNode(2, TreeNode(4), TreeNode(5)), TreeNode(3))) == [4, 5, 2, 3, 1]\", \"assert postorder_traversal(TreeNode(1)) == [1]\", \"assert postorder_traversal(TreeNode(5, None, TreeNode(6))) == [6, 5]\", \"assert postorder_traver... | {
"split": "train",
"index": 76706,
"acecode_id": "oss_27267",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that transforms a font name provided in a specific format into a more user-friendly displayed font name. The input font name is a string that may contain underscores ('_') which should be replaced by spaces (' '). Additionally, the fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_font_name('times_new_roman') == 'Times New Roman'\", \"assert transform_font_name('arial') == 'Arial'\", \"assert transform_font_name('courier_new') == 'Courier New'\", \"assert transform_font_name('verdana') == 'Verdana'\", \"assert transform_font... | {
"split": "train",
"index": 76707,
"acecode_id": "oss_31436",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, return true only if there are at least two distinct prime numbers in the list. The list may contain negative numbers and zero as well. Implement the function has_two_distinct_primes(lst) that takes a list of integers as input and outputs a boolean valu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_two_distinct_primes([2, 3, 5]) == True\", \"assert has_two_distinct_primes([4, 6, -3, 0]) == False\", \"assert has_two_distinct_primes([11, 13, 17]) == True\", \"assert has_two_distinct_primes([-2, -3, -5, -7]) == False\", \"assert has_two_distinct_prime... | {
"split": "train",
"index": 76708,
"acecode_id": "evol_18237",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that checks if a given string consists of exactly eight characters and is made up solely of alphanumeric characters. The function should return True if the string meets these criteria and False otherwise.\nPlease reason step by step, then write a self-conta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert match_pattern('abcdefgh') == True\", \"assert match_pattern('12345678') == True\", \"assert match_pattern('abcd1234') == True\", \"assert match_pattern('abcd123@') == False\", \"assert match_pattern('abcdefg') == False\", \"assert match_pattern('abcdefghijk'... | {
"split": "train",
"index": 76709,
"acecode_id": "evol_16963",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of commands represented as strings. Each command is a space-separated string of words, where the first word is the command itself and the rest are its arguments. Your task is to implement a function `execute_commands(commands: List[str]) -> str` that simula... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert execute_commands(['echo Hello', 'echo World']) == 'echo World'\", \"assert execute_commands(['echo Test', 'echo Case']) == 'echo Case'\", \"assert execute_commands(['ls', 'grep test', 'wc -l']) == 'wc -l'\", \"assert execute_commands(['mkdir test', 'cd test'... | {
"split": "train",
"index": 76710,
"acecode_id": "bigcode_python_fns_9104",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to calculate the final values of a 2D grid after a specified number of iterations. The grid is defined by its size `m`, where each cell's initial value is determined by a provided function `u_init`, based on its coordinates. The funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_grid_values(4, 0, lambda x, y: x - y) == [[0, -1, -2, -3], [1, 0, -1, -2], [2, 1, 0, -1], [3, 2, 1, 0]]\", \"assert update_grid_values(1, 5, lambda x, y: 1) == [[1]]\", \"assert update_grid_values(3, 0, lambda x, y: x + 2*y) == [[0, 2, 4], [1, 3, 5], ... | {
"split": "train",
"index": 76711,
"acecode_id": "oss_6457",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple function that verifies user credentials. The function should take two parameters: 'username' and 'password'. If the entered credentials match the predefined username 'user123' and password 'pass123', the function should return the strin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert login('user123', 'pass123') == 'Login successful'\", \"assert login('user123', 'wrongpass') == 'Login failed'\", \"assert login('wronguser', 'pass123') == 'Login failed'\", \"assert login('user456', 'pass123') == 'Login failed'\", \"assert login('user123', '... | {
"split": "train",
"index": 76712,
"acecode_id": "oss_35980",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two sentences, write a function that identifies and returns a list of words that are either missing from the first sentence or are extra in the first sentence compared to the second sentence. The function should return a dictionary with two keys: 'missing' for words in th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_extra_missing_words('Hello world!', 'Hello there, world!') == {'missing': ['there,'], 'extra': []}\", \"assert find_extra_missing_words('A B C', 'A B') == {'missing': [], 'extra': ['C']}\", \"assert find_extra_missing_words('OpenAI is amazing', 'OpenAI ... | {
"split": "train",
"index": 76713,
"acecode_id": "evol_2686",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing an API key. Your task is to create a function that takes this API key as input and returns a formatted string that indicates whether the API key is valid or not. An API key is considered valid if it is a non-empty string that starts with 'API... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_api_key('API-12345678') == 'Valid API Key'\", \"assert check_api_key('API-abcdefgh') == 'Valid API Key'\", \"assert check_api_key('API-1234') == 'Invalid API Key'\", \"assert check_api_key('API-123456789') == 'Invalid API Key'\", \"assert check_api_key... | {
"split": "train",
"index": 76714,
"acecode_id": "bigcode_python_fns_44534",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of migration operations and returns a dictionary containing the model names and their corresponding altered fields. You are given a list of tuples, where each tuple contains the operation type and the model na... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_migration_operations([('api', '0022_auto_20190823_1553'), {'model_name': 'loan', 'name': 'loan_period'}, {'model_name': 'loan', 'name': 'interest_rate'}, {'model_name': 'customer', 'name': 'age'}], [('api', '0022_auto_20190823_1553'), ('loan', '0022_... | {
"split": "train",
"index": 76715,
"acecode_id": "oss_47",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two rectangles defined by their top-left and bottom-right corners. Each rectangle is represented by its coordinates (x1, y1) for the top-left corner and (x2, y2) for the bottom-right corner. Your task is to implement a function `cardinal_relation(x: Tuple[int, int... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cardinal_relation((0, 0, 5, 5), (3, 3, 8, 8), 'above', False) == False\", \"assert cardinal_relation((0, 0, 5, 5), (3, 3, 8, 8), 'below', False) == False\", \"assert cardinal_relation((0, 0, 5, 5), (3, 3, 8, 8), 'left_of', False) == False\", \"assert cardina... | {
"split": "train",
"index": 76716,
"acecode_id": "oss_5183",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function that checks if a given string is a palindrome. The function should normalize the input by ignoring case and removing all non-alphabetic characters. Additionally, the function should raise appropriate exceptions for the following cases: if the input is not a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isPalindrome('Malayalam') == True\", \"assert isPalindrome('Able was I, ere I saw Elba') == True\", \"assert isPalindrome('No lemon, no melon') == True\", \"assert isPalindrome('A man, a plan, a canal, Panama') == True\", \"assert isPalindrome('Was it a car ... | {
"split": "train",
"index": 76717,
"acecode_id": "evol_25652",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an HTML string containing a <div> element. Write a function `manipulate_css_class(html: str, css_class: str, action: str) -> str` that modifies the class attribute of the <div> element by either adding or removing a specified CSS class based on the provided action... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manipulate_css_class('<div class=\\\"myClass\\\">Hello world</div>', 'newClass', 'add') == '<div class=\\\"myClass newClass\\\">Hello world</div>'\", \"assert manipulate_css_class('<div>Hello world</div>', 'myClass', 'add') == '<div class=\\\"myClass\\\">Hel... | {
"split": "train",
"index": 76718,
"acecode_id": "evol_24086",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the generation of file paths for a directory structure based on given image configuration and layer information. The function should take a list of layer tarball names, a configuration file name, and a manifest file name as... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_file_paths(['layer1.tar.gz', 'layer2.tar.gz'], 'config.json', 'manifest.json') == {'config': './image_runfiles/config.json', 'layers': ['./image_runfiles/0.tar.gz', './image_runfiles/1.tar.gz'], 'temp_files': ['./image_runfiles/config.json', './imag... | {
"split": "train",
"index": 76719,
"acecode_id": "bigcode_python_fns_21973",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_median_and_check_duplicates(arr)` that accepts an array of whole numbers as input and returns a tuple containing the median of the array and a boolean indicating whether the array contains duplicate numbers. The median must be calculated without using... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_median_and_check_duplicates([1, 3, 2]) == (2, False)\", \"assert find_median_and_check_duplicates([1, 2, 3, 4]) == (2.5, False)\", \"assert find_median_and_check_duplicates([1, 1, 2]) == (1, True)\", \"assert find_median_and_check_duplicates([2, 3, 2, 1... | {
"split": "train",
"index": 76720,
"acecode_id": "evol_25091",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function that takes a list of strings as an argument, removes duplicate strings, and returns a list containing the remaining strings in reverse lexicographical order. Note: Do this without using built-in functions.\nPlease reason step by step, then write a self-contain... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_lexi(['apple', 'banana', 'apple', 'orange']) == ['orange', 'banana', 'apple']\", \"assert reverse_lexi(['dog', 'cat', 'dog', 'bird']) == ['dog', 'cat', 'bird']\", \"assert reverse_lexi(['hello', 'world', 'hello']) == ['world', 'hello']\", \"assert re... | {
"split": "train",
"index": 76721,
"acecode_id": "evol_24193",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a collection of programming languages. You need to implement a function that allows you to perform the following operations on a list of languages represented as dictionaries: retrieving all languages, retrieving a specific language by its name, and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_languages([{'name': 'Python', 'type': 'interpreted'}, {'name': 'Java', 'type': 'compiled'}], [('get_all', None)]) == [{'name': 'Python', 'type': 'interpreted'}, {'name': 'Java', 'type': 'compiled'}]\", \"assert manage_languages([{'name': 'Python', 'ty... | {
"split": "train",
"index": 76722,
"acecode_id": "oss_11015",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of strings and returns a new list containing the unique strings sorted by their length in ascending order. The function should efficiently handle duplicates in the input list. The output list should maintain the order of first occurrence f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_strings_by_length(['a', 'bb', 'c', 'dd', 'a', 'bb']) == ['a', 'c', 'bb', 'dd']\", \"assert sort_strings_by_length(['hello', 'world', 'hi', 'python', 'code', 'hello']) == ['hi', 'code', 'hello', 'world', 'python']\", \"assert sort_strings_by_length(['aaa... | {
"split": "train",
"index": 76723,
"acecode_id": "evol_28851",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of file names and a list of directory names. Your task is to create a function `build_structure(file_list: List[str], directory_list: List[str]) -> Dict[str, List[str]]` that simulates the creation of a directory structure. The function should return a dict... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert build_structure(['bin_file1.txt', 'bin_file2.txt', 'notes.txt'], ['bin', 'docs']) == {'bin': ['bin_file1.txt', 'bin_file2.txt'], 'docs': []}\", \"assert build_structure(['lambda_function.py', 'main.py', 'utils.py'], ['bin', 'src']) == {'bin': [], 'src': []}\... | {
"split": "train",
"index": 76724,
"acecode_id": "bigcode_python_fns_29521",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes in an exploration summary model represented as a dictionary and returns a new exploration summary object in the form of a dictionary. The exploration summary model contains the following keys: 'id', 'title', 'category', 'object... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_exploration_summary({'id': 1, 'title': 'Title A', 'category': 'Category A', 'objective': 'Objective A', 'language_code': 'en', 'tags': ['tag1'], 'ratings': 5, 'scaled_average_rating': 4.5, 'status': 'published', 'community_owned': True, 'owner_ids': [101... | {
"split": "train",
"index": 76725,
"acecode_id": "bigcode_python_fns_19697",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Write a function `get_string()` that takes no parameters and returns a predefined string. The string should be 'Hello, World!'.\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 get_string() == 'Hello, World!'\", \"assert get_string() != 'Goodbye, World!'\", \"assert get_string() == 'Hello, World!'\", \"assert get_string() == 'Hello, World!'\", \"assert get_string() == 'Hello, World!'\", \"assert get_string() == 'Hello, World!'\", \... | {
"split": "train",
"index": 76726,
"acecode_id": "evol_30023",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a given BUILD file content and extracts information about exported files. Write a function `extract_exported_files(build_content: str) -> List[str]` that takes a string `build_content` representing the content of a B... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_exported_files('exports_files([\\\"file1.txt\\\", \\\"file2.txt\\\"])') == [\\\"file1.txt\\\", \\\"file2.txt\\\"]\", \"assert extract_exported_files('exports_files([\\\"single_file.txt\\\"])') == [\\\"single_file.txt\\\"]\", \"assert extract_exported... | {
"split": "train",
"index": 76727,
"acecode_id": "oss_37703",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `string_xor(a: str, b: str) -> str` that takes two binary string inputs `a` and `b`, which are composed of the characters '0' and '1'. The function should compute the binary exclusive OR (XOR) of these two strings and return the result as a binary string. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert string_xor('010', '110') == '100'\", \"assert string_xor('0000', '1111') == '1111'\", \"assert string_xor('101010', '010101') == '111111'\", \"assert string_xor('111', '000') == '111'\", \"assert string_xor('001', '110') == '111'\", \"assert string_xor('1111... | {
"split": "train",
"index": 76728,
"acecode_id": "evol_5666",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of file paths as input and returns a list of file names sorted in ascending order. Each file path is represented as a string, and you need to extract just the file name from each path. Your function should handle cases w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_and_sort_file_names(['/home/user/docs/file3.txt', '/home/user/docs/file1.txt', '/home/user/docs/file2.txt']) == ['file1.txt', 'file2.txt', 'file3.txt']\", \"assert extract_and_sort_file_names(['/tmp/test/file.txt', '/tmp/test/file2.txt', '/tmp/test/f... | {
"split": "train",
"index": 76729,
"acecode_id": "bigcode_python_fns_16575",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a countdown from a specified start number down to zero. The function should return a list of integers representing the countdown sequence. The countdown should include the starting number and end with zero. For example, if ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert countdown(10) == [10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]\", \"assert countdown(0) == [0]\", \"assert countdown(5) == [5, 4, 3, 2, 1, 0]\", \"assert countdown(15) == [15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]\", \"assert countdown(20) == [20, 19, 18, 1... | {
"split": "train",
"index": 76730,
"acecode_id": "oss_2706",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program that checks for unauthorized copying of files by verifying if a specific comment is present within a given string. The comment you need to check for is as follows: '# Unauthorized copying of this file, via any medium is strictly prohibite... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert detect_unauthorized_copying('') == 'No unauthorized copying detected'\", \"assert detect_unauthorized_copying('# Unauthorized copying of this file, via any medium is strictly prohibited') == 'No unauthorized copying detected'\", \"assert detect_unauthorized... | {
"split": "train",
"index": 76731,
"acecode_id": "oss_15431",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a given string is a valid email address. A valid email address must follow these criteria: it must contain exactly one '@' symbol, at least one character before the '@', at least one character after the '@', and the part af... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_email('example@domain.com') == True\", \"assert is_valid_email('user.name@sub.domain.com') == True\", \"assert is_valid_email('user@domain.co.uk') == True\", \"assert is_valid_email('user@domain') == False\", \"assert is_valid_email('@domain.com') =... | {
"split": "train",
"index": 76732,
"acecode_id": "oss_14184",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that checks if a given string is a palindrome. A palindrome is a string that reads the same backward as forward, ignoring spaces, punctuation, and case differences. Your function should return `True` if the input string is a palind... | 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('hello') == False\", \"assert is_palindrome('Was it a car or a cat I saw?') == True\", \"assert is_palindrome('No lemon, no melon')... | {
"split": "train",
"index": 76733,
"acecode_id": "oss_5843",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string, write a function that counts the number of uppercase vowel characters ('A', 'E', 'I', 'O', 'U') present at the even indices of the string. Implement the function `count_upper(s)` where `s` is the input string. The function should return an integer representing t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_upper('aBCdEf') == 1\", \"assert count_upper('abcdefg') == 0\", \"assert count_upper('dBBE') == 0\", \"assert count_upper('AEIOU') == 3\", \"assert count_upper('') == 0\", \"assert count_upper('A') == 1\", \"assert count_upper('ABCDEF') == 2\", \"asser... | {
"split": "train",
"index": 76734,
"acecode_id": "evol_7643",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Develop a Python function that receives an integer representing a day of the week, where 1 corresponds to Monday and 7 corresponds to Sunday. If the input integer is outside the range of 1 to 7, the function should return 'Invalid day number'. Implement this functionality in a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert day_of_week(1) == 'Monday'\", \"assert day_of_week(2) == 'Tuesday'\", \"assert day_of_week(3) == 'Wednesday'\", \"assert day_of_week(4) == 'Thursday'\", \"assert day_of_week(5) == 'Friday'\", \"assert day_of_week(6) == 'Saturday'\", \"assert day_of_week(7) =... | {
"split": "train",
"index": 76735,
"acecode_id": "evol_2286",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string containing a list of integers, where each integer represents a fragment group. Your task is to extract the fragment groups from the string and return them as a space-separated string. The input string will always contain the keyword 'FragmentGroups' follo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert read_fragment_groups('FragmentGroups 1 2 3 4', 4, 1) == '1 2 3 4'\", \"assert read_fragment_groups('FragmentGroups 5 6 7 8 9', 5, 1) == '5 6 7 8 9'\", \"assert read_fragment_groups('FragmentGroups 10 20 30', 3, 1) == '10 20 30'\", \"assert read_fragment_grou... | {
"split": "train",
"index": 76736,
"acecode_id": "bigcode_python_fns_20766",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_median(lst)` that calculates the median of a list of integers without using any sort, comparison, or conditional operators, built-in functions, or libraries related to sorting and comparison. The function should also handle errors by raising a TypeErr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_median([3, 1, 2, 5, 6]) == 3\", \"assert find_median([1, 2, 3]) == 2\", \"assert find_median([7, 8, 9, 10]) == 8.5\", \"assert find_median([1]) == 1\", \"assert find_median([-1, -2, -3, -4]) == -2.5\", \"assert find_median([100, 200, 300]) == 200\", \"a... | {
"split": "train",
"index": 76737,
"acecode_id": "evol_31560",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates age and education labels, splits a string of plotting tools, and collects a list of zip codes. The function should take four parameters: a list of integers for age ranges, a list of integers for education levels, a string c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_labels_and_zip_data([0, 1, 2], [0, 1, 2], 'pan,wheel_zoom', ['98101', '98102']) == {'age_labels': ['0 - 12', '1 - 13', '2 - 14'], 'edu_labels': ['0th Grade', '1th Grade', '2th Grade'], 'tools_used': ['pan', 'wheel_zoom'], 'psrc_zip_data': ['98101', ... | {
"split": "train",
"index": 76738,
"acecode_id": "oss_10210",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of tuples, where each tuple contains three elements: a location (a string), a filename (a string), and an output_directory (a string). Your task is to implement a function `fetch_imagery(tup_list: List[Tuple[str, str, str]]) -> None` that processes each tup... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fetch_imagery([('New York', 'image1.jpg', '/images'), ('Los Angeles', 'image2.png', '/images')]) is None\", \"assert fetch_imagery([('Paris', 'image3.jpg', '/photos'), ('Tokyo', 'image4.png', '/photos')]) is None\", \"assert fetch_imagery([('Berlin', 'image5... | {
"split": "train",
"index": 76739,
"acecode_id": "bigcode_python_fns_48820",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `factorial(num: int) -> int` that computes the factorial of a non-negative integer `num`. The factorial of a non-negative integer n is the product of all positive integers less than or equal to n. The factorial of 0 is defined to be 1. Your function should hand... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert factorial(0) == 1\", \"assert factorial(1) == 1\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", \"assert factorial(5) == 120\", \"assert factorial(6) == 720\", \"assert factorial(7) == 5040\", \"assert factorial(... | {
"split": "train",
"index": 76740,
"acecode_id": "evol_9551",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that finds the maximum sum of non-adjacent elements in the list. Non-adjacent elements are elements that are not next to each other in the list. The function should return the maximum sum that can be obtained from the list. If the list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_non_adjacent_sum([]) == 0\", \"assert max_non_adjacent_sum([1]) == 1\", \"assert max_non_adjacent_sum([1, 2]) == 2\", \"assert max_non_adjacent_sum([1, 2, 3]) == 4\", \"assert max_non_adjacent_sum([1, 2, 3, 4]) == 6\", \"assert max_non_adjacent_sum([5, 1... | {
"split": "train",
"index": 76741,
"acecode_id": "bigcode_python_fns_11087",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an integer score that represents a rating score from a user. Your task is to implement a function that converts this score into a corresponding rating string based on the following criteria: If the score is less than 1, the rating should be 'Terrible'. If the scor... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert score_to_rating_string(0) == 'Terrible'\", \"assert score_to_rating_string(0.5) == 'Terrible'\", \"assert score_to_rating_string(1) == 'Bad'\", \"assert score_to_rating_string(1.5) == 'Bad'\", \"assert score_to_rating_string(2) == 'OK'\", \"assert score_to_r... | {
"split": "train",
"index": 76742,
"acecode_id": "bigcode_python_fns_15032",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of filenames and a search string, write a function `find_matching_files(filenames: List[str], search_str: str) -> List[str]` that returns a list of filenames that contain the search string anywhere in their names. The function should be case-sensitive. If no filena... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_matching_files(['file_1_10_Mpc.txt', 'file_2_20_Mpc.txt', 'data_10_Mpc.log'], '_10_Mpc') == ['file_1_10_Mpc.txt', 'data_10_Mpc.log']\", \"assert find_matching_files(['document.txt', 'report.docx', 'summary.pdf'], 'data') == []\", \"assert find_matching_... | {
"split": "train",
"index": 76743,
"acecode_id": "bigcode_python_fns_16754",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that manages a list of employees in a company. Each employee is represented as a dictionary with the following fields: `id`, `name`, `department`, `designation`, and `email`. Your function should take a list of employee dictionaries and r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_employees_by_department([{'id': 1, 'name': 'Alice', 'department': 'HR', 'designation': 'Manager', 'email': 'alice@example.com'}, {'id': 2, 'name': 'Bob', 'department': 'Engineering', 'designation': 'Developer', 'email': 'bob@example.com'}], 'HR') == [... | {
"split": "train",
"index": 76744,
"acecode_id": "oss_10722",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of URL patterns and extracts the names of the views associated with each URL. Each URL pattern is represented as a string in the format \"path('url_path', view_function, name='view_name')\". Your function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_view_names([\\\"path('api/', include(router.urls))\\\", \\\"path('api/contact/', views.api_create_contact_view, name='contact')\\\", \\\"path('api/newsletter/', views.api_create_subscriber_view, name='newsletter')\\\"]) == {'contact': ['/api/contact/... | {
"split": "train",
"index": 76745,
"acecode_id": "oss_3072",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `explore_artwork(artwork_name: str) -> str` that simulates a visitor exploring a digital artwork in a virtual reality environment. The function takes the name of the artwork as input and returns a description of the artwork along with a message indicating w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert explore_artwork('Mona Lisa') == 'A portrait of a woman by Leonardo da Vinci. You can enter the artwork for an immersive experience.'\", \"assert explore_artwork('Starry Night') == 'A painting by Vincent van Gogh depicting a swirling night sky. You can enter ... | {
"split": "train",
"index": 76746,
"acecode_id": "evol_22338",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the prices of a stock on different days. Your task is to implement a function that calculates the maximum profit you can achieve by buying and selling the stock exactly once. You must choose a day to buy the stock and a day in the f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_profit([7, 1, 5, 3, 6, 4]) == 5\", \"assert max_profit([7, 6, 4, 3, 1]) == 0\", \"assert max_profit([1, 2]) == 1\", \"assert max_profit([3, 2, 6, 5, 0, 3]) == 4\", \"assert max_profit([2, 1]) == 0\", \"assert max_profit([1, 4, 3, 2, 5]) == 4\", \"assert ... | {
"split": "train",
"index": 76747,
"acecode_id": "bigcode_python_fns_48965",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a future date in the format 'YYYY-MM-DD'. Write a function 'days_until' that returns the number of days from the current date until the given future date. The current date is fixed as '2023-10-01'. You can assume the input date will always be... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert days_until('2023-10-02') == 1\", \"assert days_until('2023-10-10') == 9\", \"assert days_until('2023-12-01') == 61\", \"assert days_until('2024-01-01') == 92\", \"assert days_until('2023-10-31') == 30\", \"assert days_until('2023-11-01') == 31\", \"assert da... | {
"split": "train",
"index": 76748,
"acecode_id": "bigcode_python_fns_6553",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are developing a simple scoring system for a game. Your task is to implement a function `show_score(x, y, score_value)` that takes in three parameters: `x` (the x-coordinate), `y` (the y-coordinate), and `score_value` (an integer representing the current score). The functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert show_score(10, 20, 5) == 'Score : 5'\", \"assert show_score(0, 0, 0) == 'Score : 0'\", \"assert show_score(50, 100, 15) == 'Score : 15'\", \"assert show_score(-10, -20, 100) == 'Score : 100'\", \"assert show_score(25, 25, 50) == 'Score : 50'\", \"assert show... | {
"split": "train",
"index": 76749,
"acecode_id": "oss_160",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that takes a list of integers and returns a set of unique integers that are both positive and even. The function should filter out any negative integers and any odd integers from the list. The input list may contain duplicate integers. You... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_positive_evens([1, 2, 2, 3, 4, -1, -2, 4]) == {2, 4}\", \"assert get_unique_positive_evens([-1, -2, -3]) == set()\", \"assert get_unique_positive_evens([0, 1, 2, 3, 4, 5, 6]) == {2, 4, 6}\", \"assert get_unique_positive_evens([10, 10, 10, 10]) == ... | {
"split": "train",
"index": 76750,
"acecode_id": "bigcode_python_fns_47907",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are conducting a medical research project that involves analyzing patient data to identify individuals with cancer. The patient data is provided as a list of dictionaries, where each dictionary represents a patient and contains their information including name, age, gender,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert split_cancer_data([]) == ([], [])\", \"assert split_cancer_data([{'name': 'John', 'age': 45, 'gender': 'male', 'has_cancer': True}]) == ([{'name': 'John', 'age': 45, 'gender': 'male', 'has_cancer': True}], [])\", \"assert split_cancer_data([{'name': 'Alice',... | {
"split": "train",
"index": 76751,
"acecode_id": "oss_4594",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that initializes a simple in-memory database (represented as a dictionary) to store posts from a subreddit. Each post should be represented as a dictionary with the following fields: 'id' (a unique integer for each post), 'title' (a strin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_database([{'id': 1, 'title': 'First Post', 'content': 'This is the first post.'}, {'id': 2, 'title': 'Second Post', 'content': 'This is the second post.'}]) == {1: {'id': 1, 'title': 'First Post', 'content': 'This is the first post.'}, 2: {'id': 2... | {
"split": "train",
"index": 76752,
"acecode_id": "bigcode_python_fns_14365",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given an array of strings, implement a function that finds the longest common substring that appears in alphabetical order across all strings in the array. If there are multiple substrings of the same maximum length, return any one of them. If no such substring exists, return a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longest_common_alphabetical_substring(['xyz', 'abc', 'def']) == ''\", \"assert longest_common_alphabetical_substring(['hello', 'world', 'python']) == 'o'\", \"assert longest_common_alphabetical_substring(['a', 'b', 'c']) == ''\", \"assert longest_common_alph... | {
"split": "train",
"index": 76753,
"acecode_id": "evol_7465",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes the coordinates of two 3D points (x1, y1, z1) and (x2, y2, z2) as input and returns the Euclidean distance between them. If the input points are not of type float or int, raise a TypeError with the message 'Coordinates must be numbers'.\nPlease reaso... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert distance_between_points(1, 2, 3, 4, 5, 6) == 5.196152422706632\", \"assert distance_between_points(0, 0, 0, 0, 0, 0) == 0.0\", \"assert distance_between_points(1.5, 2.5, 3.5, 4.5, 5.5, 6.5) == 5.196152422706632\", \"assert distance_between_points(1, 1, 1, 1,... | {
"split": "train",
"index": 76754,
"acecode_id": "evol_32872",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates error handling in a serial communication module. Your function should take a list of error messages and a boolean flag representing the alive state. The function should process each error message, attempting to 'reconne... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert handle_errors(['Connection lost'], False) == []\", \"assert handle_errors([], True) == []\", \"assert handle_errors(['Invalid data'], True) == ['Error processed: Invalid data']\", \"assert handle_errors(['Connection lost'], True) == ['Error processed: Connec... | {
"split": "train",
"index": 76755,
"acecode_id": "oss_26200",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating the Monty Hall problem, which is a famous probability puzzle. In this simulation, you will play a game where there are three doors: behind one door is a car (the prize), and behind the other two doors are goats. You will choose one door, then a ho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_games(1, True) == 'winning percentage: 100.00%'\", \"assert simulate_games(1, False) == 'winning percentage: 0.00%'\", \"assert simulate_games(10, False) == 'winning percentage: 30.00%'\", \"assert simulate_games(100, True) == 'winning percentage: 6... | {
"split": "train",
"index": 76756,
"acecode_id": "bigcode_python_fns_35125",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers that can represent nodes in a graph. Each integer is a unique identifier for a node. Your task is to replace all occurrences of a specific integer, denoted as 'target', in the list with another integer, denoted as 'replacement'. Implement the fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_integer([1, 2, 3, 4, 5], 3, 6) == [1, 2, 6, 4, 5]\", \"assert replace_integer([1, 2, 3, 4, 5], 6, 7) == [1, 2, 3, 4, 5]\", \"assert replace_integer([1, 1, 1, 1], 1, 0) == [0, 0, 0, 0]\", \"assert replace_integer([], 1, 0) == []\", \"assert replace_in... | {
"split": "train",
"index": 76757,
"acecode_id": "bigcode_python_fns_38979",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes two integer parameters, 'width' and 'height', representing the dimensions of a rectangle. Your function should return a string that describes the rectangle in the format 'Rectangle(width=w, height=h)', where 'w' and 'h' are the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert describe_rectangle(3, 4) == 'Rectangle(width=3, height=4)'\", \"assert describe_rectangle(1, 1) == 'Rectangle(width=1, height=1)'\", \"assert describe_rectangle(5, 2) == 'Rectangle(width=5, height=2)'\", \"assert describe_rectangle(10, 20) == 'Rectangle(widt... | {
"split": "train",
"index": 76758,
"acecode_id": "bigcode_python_fns_48979",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `string_to_binary(s: str) -> str` that takes a string `s` as input and converts each character in the string to its binary representation. The binary representation for each character should be an 8-bit binary number, separated by spaces. For example, the strin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert string_to_binary('Hello, Multiverse') == '01001000 01100101 01101100 01101100 01101111 00101100 00100000 01001101 01110101 01101100 01110100 01101001 01110110 01100101 01110010 01110011 01100101'\", \"assert string_to_binary('A') == '01000001'\", \"assert st... | {
"split": "train",
"index": 76759,
"acecode_id": "evol_1806",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of objects, implement a function `serialize_dates` that takes a list of objects as input and returns a list of their ISO 8601 formatted date strings if they have an `isoformat` method. If any object in the list does not have the `isoformat` method, the function sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert serialize_dates([datetime(2023, 1, 1), datetime(2023, 1, 2)]) == ['2023-01-01T00:00:00', '2023-01-02T00:00:00']\", \"assert serialize_dates([datetime(2023, 5, 15)]) == ['2023-05-15T00:00:00']\", \"assert serialize_dates([]) == []\", \"assert serialize_dates(... | {
"split": "train",
"index": 76760,
"acecode_id": "bigcode_python_fns_2981",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that computes the dot product of two vectors. Given two lists of numbers, `vecte1` and `vecte2`, both representing vectors in n-dimensional space, return a single number that is the dot product of these two vectors. The dot product is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dot_product([1, 2, 3], [4, 5, 6]) == 32\", \"assert dot_product([0, 0, 0], [1, 2, 3]) == 0\", \"assert dot_product([1], [1]) == 1\", \"assert dot_product([1, 2], [3]) == 0\", \"assert dot_product([1, 2, 3], [0, 0, 0]) == 0\", \"assert dot_product([-1, -2], [... | {
"split": "train",
"index": 76761,
"acecode_id": "bigcode_python_fns_14346",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that converts a Python value into a string representation of its type. The function should take a single parameter, which can be of type bool, bytes, int, float, or str. Your function should return a string that indicates the type of the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert value_to_type_string(True) == 'bool'\", \"assert value_to_type_string(b'example') == 'bytes'\", \"assert value_to_type_string(42) == 'int'\", \"assert value_to_type_string(3.14) == 'float'\", \"assert value_to_type_string('hello') == 'str'\", \"assert value_... | {
"split": "train",
"index": 76762,
"acecode_id": "bigcode_python_fns_30620",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that manages a list of hardware components and measurement modules for a scientific instrument control system. Implement a function `manage_instrument_system(hardware_list: List[str], measurement_list: List[str]) -> Dict[str, List[str]]` ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_instrument_system(['ActonSpectrometerHW'], ['AndorCCDReadoutMeasure']) == {'hardware': ['ActonSpectrometerHW'], 'measurements': ['AndorCCDReadoutMeasure']}\", \"assert manage_instrument_system([], ['AndorCCDReadoutMeasure']) == {'hardware': [], 'measu... | {
"split": "train",
"index": 76763,
"acecode_id": "oss_19395",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that calculates the mean squared error (MSE) between two equal-length lists of numbers. The mean squared error is calculated as the average of the squared differences between corresponding elements of the two lists. Implement t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_mse([0, 0, 0], [0, 0, 0]) == 0.0\", \"assert calculate_mse([1, 1, 1], [1, 1, 1]) == 0.0\", \"assert calculate_mse([1, 2, 3], [4, 5, 6]) == 9.0\", \"assert calculate_mse([1, 2], [1, 2, 3]) == -1.0\", \"assert calculate_mse([1, 2, 3, 4], [4, 3, 2, 1]... | {
"split": "train",
"index": 76764,
"acecode_id": "oss_23451",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with retrieving an item from a list based on a specified index. Write a function `get_item_from_view(view: List[int], index: int) -> int` that takes a list of integers `view` and an integer `index`. The function should return the item at the specified `index` in ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_item_from_view([1, 2, 3, 4, 5], 2) == 3\", \"assert get_item_from_view([1, 2, 3, 4, 5], 0) == 1\", \"assert get_item_from_view([1, 2, 3, 4, 5], 4) == 5\", \"assert get_item_from_view([1, 2, 3, 4, 5], -1) == 5\", \"assert get_item_from_view([1, 2, 3, 4, 5... | {
"split": "train",
"index": 76765,
"acecode_id": "bigcode_python_fns_28693",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that calculates a student's average grade based on their scores from four assignments (Ac1, Ac2, Ac3, Ac4) and determines if they have passed the semester. The average grade is calculated as the sum of the four grades divided by 4, and the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert student_pass_status(3, 3, 3, 3) == 'Unfortunately, you have not passed the semester.'\", \"assert student_pass_status(4, 3, 4, 3) == 'Unfortunately, you have not passed the semester.'\", \"assert student_pass_status(0, 0, 0, 0) == 'Unfortunately, you have no... | {
"split": "train",
"index": 76766,
"acecode_id": "oss_34453",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a string based on specific operations provided as parameters. Your function should take a string input and a set of operations, and return a modified string based on these operations. The operations are as follows: 1. If th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_string('Hello World', True, '', False) == 'HELLO WORLD'\", \"assert process_string('Hello World', False, 'World', False) == 'Hello World\\\\nOccurrences of \\\"World\\\": 1'\", \"assert process_string('Hello World', False, 'Hello', False) == 'Hello W... | {
"split": "train",
"index": 76767,
"acecode_id": "oss_2375",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that can handle dependencies and provide warnings for missing dependencies. Your task is to implement a function `import_package_module(package_name, module_name)` that takes the name of a package and the name of a module within th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert import_package_module('math', 'sqrt') is not None\", \"assert import_package_module('os', 'path') is not None\", \"assert import_package_module('random', 'choice') is not None\", \"assert import_package_module('sys', 'version') is not None\", \"assert import... | {
"split": "train",
"index": 76768,
"acecode_id": "oss_19743",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the execution of a series of commands based on a given configuration. The configuration specifies the details of each command, including the command name and its arguments. Your function should take a list of command na... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert execute_commands(['cmd1', 'cmd2'], {'cmd1': ['arg1', 'arg2'], 'cmd2': ['arg3']}) == ['cmd1 arg1 arg2', 'cmd2 arg3']\", \"assert execute_commands(['cmd3'], {'cmd1': ['arg1', 'arg2'], 'cmd2': ['arg3']}) == ['cmd3 not found']\", \"assert execute_commands([], {'... | {
"split": "train",
"index": 76769,
"acecode_id": "oss_17090",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates the extraction of metadata from a given setup.py file content represented as a string. The function should parse this string and return a dictionary containing the extracted metadata. The metadata includes attributes... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_metadata(\\\"from setuptools import setup\\\\nsetup(name='example_package', version='0.1.0', description='An example package.', long_description='This is a long description.', keywords='example test')\\\") == {'name': 'example_package', 'version': '0... | {
"split": "train",
"index": 76770,
"acecode_id": "oss_11809",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple timer. The function should accept two parameters: `start_time` (a float representing the time when the timer starts) and `stop_time` (a float representing the time when the timer is stopped). Your goal is to calcul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_duration(1.0, 5.0) == 4.0\", \"assert calculate_duration(2.0, 2.0) == 0.0\", \"assert calculate_duration(10.0, 20.0) == 10.0\", \"assert calculate_duration(5.0, 4.0) == 0.0\", \"assert calculate_duration(1.5, 1.5) == 0.0\", \"assert calculate_durat... | {
"split": "train",
"index": 76771,
"acecode_id": "oss_28153",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of dictionaries, where each dictionary represents a person's information. The function should perform two transformation stages: First, filter out all individuals who are not of legal age (under 18 years old). Second... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_data([{ 'first_name': 'John', 'last_name': 'Doe', 'age': 20, 'email': 'john@example.com' }, { 'first_name': 'Jane', 'last_name': 'Smith', 'age': 17, 'email': 'jane@example.com' }]) == [{'name': 'John Doe', 'email': 'john@example.com'}]\", \"assert pr... | {
"split": "train",
"index": 76772,
"acecode_id": "evol_7410",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `compute_mean(sequence)` that takes a list of positive integers and returns the arithmetic mean of the numbers in the list. The mean is calculated as the sum of the sequence divided by the number of elements in the sequence. The sequence will always contain... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_mean([3, 7, 11, 15]) == 9.0\", \"assert compute_mean([1, 2, 3, 4, 5]) == 3.0\", \"assert compute_mean([10, 20, 30]) == 20.0\", \"assert compute_mean([5]) == 5.0\", \"assert compute_mean([100, 200, 300, 400]) == 250.0\", \"assert compute_mean([8, 9, 1... | {
"split": "train",
"index": 76773,
"acecode_id": "evol_2185",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves a secret key from a list of strings. The function should take a list of strings as input, where each string represents a potential secret key. Your goal is to return the first non-empty string that represents a valid secret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_secret_key(['', '', '']) == ''\", \"assert get_secret_key(['', 'secret1', 'secret2']) == 'secret1'\", \"assert get_secret_key(['key1', '', 'key2']) == 'key1'\", \"assert get_secret_key(['keyA', 'keyB', 'keyC']) == 'keyA'\", \"assert get_secret_key(['', '... | {
"split": "train",
"index": 76774,
"acecode_id": "bigcode_python_fns_14841",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program to generate a sequence of key representations based on a specified pattern of commands. Each command in the pattern corresponds to a key binding, which maps a command to a specific key. Your goal is to implement a function `generate_key_se... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_key_sequence([['command1', 'command2']], [('command1', 65), ('command2', 66)]) == ['65 66']\", \"assert generate_key_sequence([['cmd1', 'cmd2'], ['cmd3']], [('cmd1', 67), ('cmd2', 68), ('cmd3', 69)]) == ['67 68', '69']\", \"assert generate_key_seque... | {
"split": "train",
"index": 76775,
"acecode_id": "oss_1737",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the total distance of a transportation network represented as a list of link configurations. Each link configuration is a dictionary with the following keys: 'endpoint1' (the name of the first endpoint), 'endpoint2' (the name of the second endpoi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_distance([{'endpoint1': 'A', 'endpoint2': 'B', 'distance': 10.0}, {'endpoint1': 'A', 'endpoint2': 'C1', 'distance': 5.0}]) == 15.0\", \"assert calculate_total_distance([{'endpoint1': 'X', 'endpoint2': 'Y', 'distance': 20.5}, {'endpoint1': 'Y'... | {
"split": "train",
"index": 76776,
"acecode_id": "oss_32926",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that determines if a given list of integers contains any duplicates. The function should return True if there are any duplicates in the list, and False otherwise. Your function should have the following signature: `def contains_duplic... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert contains_duplicates([1, 2, 3, 4, 5]) == False\", \"assert contains_duplicates([1, 2, 3, 4, 5, 1]) == True\", \"assert contains_duplicates([]) == False\", \"assert contains_duplicates([0, 0, 1, 2, 3]) == True\", \"assert contains_duplicates([-1, -2, -3, -4, -... | {
"split": "train",
"index": 76777,
"acecode_id": "oss_13345",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates an event subscription system. Given a list of events and a callback function, your goal is to process each event using the callback function and return a list of results. The function should stop processing when it enco... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_events(['Event 1', 'Event 2', 'UNSUB'], lambda x: x.upper()) == ['EVENT 1', 'EVENT 2']\", \"assert process_events(['Event 1', 'UNSUB', 'Event 3'], lambda x: x.lower()) == ['event 1']\", \"assert process_events(['UNSUB', 'Event 1', 'Event 2'], lambda ... | {
"split": "train",
"index": 76778,
"acecode_id": "oss_24107",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `all_palindromes(sentence: str) -> bool` that takes a sentence as input and returns `True` if every word in the sentence is a palindrome. A palindrome is a word that reads the same backward as forward. The function should ignore case sensitivity when determ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert all_palindromes('') == True\", \"assert all_palindromes('racecar') == True\", \"assert all_palindromes('world') == False\", \"assert all_palindromes('level noon civic') == True\", \"assert all_palindromes('not a palindrome') == False\", \"assert all_palindro... | {
"split": "train",
"index": 76779,
"acecode_id": "evol_4581",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a string URL and a dictionary of optional parameters. The function should simulate the registration of a dictionary metadata from the provided URL. The registration process always succeeds, and the function should return Tr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_dictionary_from_web('https://example.com/dictionary/geo1', params={'lang': 'en'}) == True\", \"assert add_dictionary_from_web('https://example.com/dictionary/geo2', params={'lang': 'fr'}) == True\", \"assert add_dictionary_from_web('https://example.com/d... | {
"split": "train",
"index": 76780,
"acecode_id": "bigcode_python_fns_22540",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that extracts a null-terminated string from a given bytes object, starting from a specified index. The function should read the bytes from the given index until it encounters a null byte (represented by 0). Return the extracted string as ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_null_terminated_string(b'Hello, World!\\\\x00Additional Data', 0) == 'Hello, World!'\", \"assert extract_null_terminated_string(b'\\\\x00Empty String', 0) == ''\", \"assert extract_null_terminated_string(b'This is a test string\\\\x00With some additi... | {
"split": "train",
"index": 76781,
"acecode_id": "oss_8068",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with constructing a function that generates a query string to request details about all rockets in a space exploration program. The function should return a string that follows the GraphQL format for querying rockets. The query should include a field to request t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert query_rockets() == '\\\\n {\\\\n rockets {\\\\n id\\\\n }\\\\n }\\\\n'\", \"assert query_rockets() == '\\\\n {\\\\n rockets {\\\\n id\\\\n }\\\\n }\\\\n'\", \"assert query_rockets() == '\\\\n {\\\\n rockets... | {
"split": "train",
"index": 76782,
"acecode_id": "bigcode_python_fns_22682",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a simplified version of a real-time strategy (RTS) game, where players can train units and track their numbers. Your goal is to implement a function that manages the training and tracking of units in the game. You need to implement a function `tra... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert train_units(['VOIDRAY', 'VOIDRAY', 'MARINE']) == {'VOIDRAY': 2, 'MARINE': 1}\", \"assert train_units(['MARINE', 'MARINE', 'ZERG']) == {'MARINE': 2, 'ZERG': 1}\", \"assert train_units(['VOIDRAY', 'ZELDA', 'VOIDRAY', 'VOIDRAY']) == {'VOIDRAY': 3, 'ZELDA': 1}\"... | {
"split": "train",
"index": 76783,
"acecode_id": "oss_27733",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating a shipping discount based on a voucher and a shopping cart. Implement a function `get_shipping_discount(voucher, cart)` that takes in a voucher object and a cart object. The function should return the discount amount for shipping if the following... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_shipping_discount({'countries': [], 'discount_percentage': 15}, {'shipping_required': True, 'shipping_method': {'total': 30}, 'subtotal': 100}) == 0.0\", \"assert get_shipping_discount({'countries': ['FR'], 'discount_percentage': 30}, {'shipping_required... | {
"split": "train",
"index": 76784,
"acecode_id": "bigcode_python_fns_2483",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a 2D list of floating-point numbers, write a function `getArrayFromCSV(data: List[List[float]]) -> List[List[float]]` that processes the input list and returns a new 2D list excluding the first row and the last two columns. Your function should not modify the original lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert getArrayFromCSV([[1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 8.0], [9.0, 10.0, 11.0, 12.0]]) == [[5.0, 6.0], [9.0, 10.0]]\", \"assert getArrayFromCSV([[0.5, 1.5, 2.5, 3.5], [4.5, 5.5, 6.5, 7.5]]) == [[4.5, 5.5]]\", \"assert getArrayFromCSV([[1.0, 2.0, 3.0, 4.0], [... | {
"split": "train",
"index": 76785,
"acecode_id": "bigcode_python_fns_30148",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a string containing lines of text, each line may contain a key-value pair separated by a colon (':'). Your task is to write a function that processes this input and returns a list of keys and their corresponding values as tuples. If a line does not contain a valid key-val... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_key_value_pairs(['key1:value1', 'key2:value2', 'key3:value3']) == [('key1', 'value1'), ('key2', 'value2'), ('key3', 'value3')]\", \"assert extract_key_value_pairs(['key1:value1', '# this is a comment', 'key2:value2']) == [('key1', 'value1'), ('key2',... | {
"split": "train",
"index": 76786,
"acecode_id": "bigcode_python_fns_33909",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates the behavior of a drag-and-drop file upload system. The function should take a list of file paths (strings) as input and return a list of file names (the last part of each file path) along with their respective paths... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_file_names(['/path/to/file1.txt', '/another/path/to/file2.png']) == ['file1.txt: /path/to/file1.txt', 'file2.png: /another/path/to/file2.png']\", \"assert extract_file_names(['/home/user/docs/report.pdf']) == ['report.pdf: /home/user/docs/report.pdf'... | {
"split": "train",
"index": 76787,
"acecode_id": "oss_28791",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers and your task is to write a function that computes the normalized frequencies of each unique integer in the list. The normalized frequency is defined as the count of each integer divided by the total count of integers in the list. If the list is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert normalized_frequencies([1, 2, 2, 3]) == {1: 0.25, 2: 0.5, 3: 0.25}\", \"assert normalized_frequencies([4, 4, 4, 5, 5]) == {4: 0.6, 5: 0.4}\", \"assert normalized_frequencies([10]) == {10: 1.0}\", \"assert normalized_frequencies([]) == {}\", \"assert normaliz... | {
"split": "train",
"index": 76788,
"acecode_id": "bigcode_python_fns_824",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing an address with various fields such as 'name', 'company_name', 'street_address', 'postal_code', and 'city'. Your task is to implement a function that returns a list of lists representing the expected order of these address fields based on... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_field_order({'country_code': 'PL'}) == [['name'], ['company_name'], ['street_address'], ['postal_code', 'city']]\", \"assert get_field_order({'country_code': 'US'}) == []\", \"assert get_field_order({'country_code': 'FR'}) == []\", \"assert get_field_ord... | {
"split": "train",
"index": 76789,
"acecode_id": "bigcode_python_fns_47470",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that inserts images into a database based on their links and associated attributes. The function should take an array of image details and a category ID as input. Each element in the array will be a tuple where the first element is the im... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_images([('http://example.com/image1.jpg', 'attr1'), ('http://example.com/image2.jpg', 'attr2')], 1) == None\", \"assert create_images([('http://example.com/image3.jpg', 'attr3')], 2) == None\", \"assert create_images([], 3) == None\", \"assert create_... | {
"split": "train",
"index": 76790,
"acecode_id": "bigcode_python_fns_20607",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a recursive function in Python that takes a string and an integer m as input and returns a list containing the string repeated m times. If m is less than or equal to 0, the function should return an empty list.\nPlease reason step by step, then write a self-contained ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert repeat_string(3, 'hello') == ['hello', 'hello', 'hello']\", \"assert repeat_string(0, 'world') == []\", \"assert repeat_string(2, 'test') == ['test', 'test']\", \"assert repeat_string(-1, 'negative') == []\", \"assert repeat_string(1, 'single') == ['single']... | {
"split": "train",
"index": 76791,
"acecode_id": "evol_6267",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the configuration of a TPU estimator for a machine learning model given various parameters. Your function should take the following inputs: a string representing the working directory, a model function (as a string), an int... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_tpu_estimator('model_checkpoints', 'my_model_fn', 100, 10, True, 32) == {'working_dir': 'model_checkpoints', 'model_fn': 'my_model_fn', 'iterations_per_loop': 100, 'keep_checkpoint_max': 10, 'use_tpu': True, 'train_batch_size': 32}\", \"assert create_... | {
"split": "train",
"index": 76792,
"acecode_id": "bigcode_python_fns_3314",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of messages, where each message is represented as a dictionary containing the following keys: 'id' (an integer), 'guild' (a dictionary with keys 'id' and 'name'), 'author' (a dictionary with keys 'name' and 'id'), 'channel' (a dictionary with a key 'id'), '... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_messages([{'id': 1, 'guild': {'id': 1, 'name': 'Guild1'}, 'author': {'name': 'User1', 'id': 1}, 'channel': {'id': 1}, 'content': 'Hello World', 'attachments': []}]) == [{'id': 1, 'author_name': 'User1', 'content': 'Hello World', 'has_image': False}]\... | {
"split": "train",
"index": 76793,
"acecode_id": "bigcode_python_fns_47456",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that performs a Depth-First Search (DFS) traversal on a binary tree. The function should visit each node in the tree and print the value of the nodes in the order they are visited. You need to define the structure of the binary tree using a TreeNode class w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dfs(TreeNode(1)) == [1]\", \"assert dfs(TreeNode(1, TreeNode(2))) == [1, 2]\", \"assert dfs(TreeNode(1, None, TreeNode(3))) == [1, 3]\", \"assert dfs(TreeNode(1, TreeNode(2), TreeNode(3))) == [1, 2, 3]\", \"assert dfs(TreeNode(1, TreeNode(2, TreeNode(4)), Tr... | {
"split": "train",
"index": 76794,
"acecode_id": "evol_10675",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of tokens, write a function `filter_whitespace(tokens: List[str]) -> List[str]` that removes all whitespace tokens from the list. A whitespace token is defined as any string that consists solely of whitespace characters (spaces, tabs, newlines). The function should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_whitespace(['Hello', ' ', 'World']) == ['Hello', 'World']\", \"assert filter_whitespace(['This', '\\\\n', 'is', 'a', ' ', 'test']) == ['This', 'is', 'a', 'test']\", \"assert filter_whitespace(['Keep', 'this', ' ', 'and', 'that']) == ['Keep', 'this', '... | {
"split": "train",
"index": 76795,
"acecode_id": "bigcode_python_fns_19933",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given the `root` of a binary tree, return the value of the smallest subtree that contains all the deepest nodes in the original tree and has the maximum sum of all node values in that subtree. A node is considered deepest if it has the largest depth possible among any node in t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert smallestSubtreeWithDeepestNodesAndMaxSum(TreeNode(3, TreeNode(5, TreeNode(6), TreeNode(2, TreeNode(7), TreeNode(4))), TreeNode(1, TreeNode(0), TreeNode(8)))) == 2\", \"assert smallestSubtreeWithDeepestNodesAndMaxSum(TreeNode(1)) == 1\", \"assert smallestSubt... | {
"split": "train",
"index": 76796,
"acecode_id": "evol_7922",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function that accepts three parameters of any numeric type (integers, floats, etc.) and returns the largest value among the three. If any of the inputs are invalid or non-numeric (like strings or None), the function should return a suitable error message instead of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_of_three(3, 5, 7) == 7\", \"assert max_of_three(1.5, 2.5, 1.0) == 2.5\", \"assert max_of_three(-1, -5, -3) == -1\", \"assert max_of_three(10, 10.0, 10) == 10\", \"assert max_of_three(2.5, 3.5, 3) == 3.5\", \"assert max_of_three(5, 5, 5) == 5\", \"assert ... | {
"split": "train",
"index": 76797,
"acecode_id": "evol_17896",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of strings representing metadata for a software package. The metadata includes information about supported operating systems, topics related to the software, and the required Python version. Your function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_metadata(['Operating System :: Unix', 'python_requires=\\\\'>=3.8.0\\\\'']) == {'operating_systems': ['Unix'], 'topics': [], 'python_requires': '>=3.8.0'}\", \"assert parse_metadata(['Operating System :: Linux', 'Topic :: Web Development', 'python_requ... | {
"split": "train",
"index": 76798,
"acecode_id": "oss_22296",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a list of integers and returns a new list that contains only the first occurrence of each number, preserving the order of their first appearance. The function should eliminate any subsequent occurrences of the same number.\nPlease reason step by step... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert eliminate_successive_duplicates([1, 1, 2, 3, 3, 2, 4]) == [1, 2, 3, 4]\", \"assert eliminate_successive_duplicates([5, 5, 5, 5]) == [5]\", \"assert eliminate_successive_duplicates([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert eliminate_successive_duplicate... | {
"split": "train",
"index": 76799,
"acecode_id": "evol_27042",
"num_tests": 12
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.