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 tasked with implementing a function that simulates the deletion of a specified number of framebuffers in a graphics application. The function should take two parameters: an integer `n` representing the number of framebuffers to delete, and an optional list of integers `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delete_framebuffers(3) == [0, 1, 2]\", \"assert delete_framebuffers(5, [10, 11, 12, 13, 14]) == [10, 11, 12, 13, 14]\", \"assert delete_framebuffers(0) == []\", \"assert delete_framebuffers(1) == [0]\", \"assert delete_framebuffers(2) == [0, 1]\", \"assert d... | {
"split": "train",
"index": 4100,
"acecode_id": "bigcode_python_fns_33724",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are required to extract specific configuration information from a code snippet that contains package settings. Write a function `extract_package_info(code_snippet)` that takes a string formatted as a code snippet and returns a dictionary with the following keys and their co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_package_info(\\\"author='John Doe',\\\\nauthor_email='john@example.com',\\\\nurl='https://example.com',\\\\nlicense='Apache 2.0',\\\") == {'author': 'John Doe', 'author_email': 'john@example.com', 'url': 'https://example.com', 'license': 'Apache 2.0'... | {
"split": "train",
"index": 4101,
"acecode_id": "oss_24424",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, write a function `find_three_elements(arr, target_sum)` that returns the indices of three distinct elements in the array that sum up to a specified target sum. If no such indices exist, return an empty list. The input array may contain duplicate valu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_three_elements([-1, 0, 1, 2, -1, -4], 0) == [0, 1, 2]\", \"assert find_three_elements([1, 2, 3, 4, 5], 15) == []\", \"assert find_three_elements([10, 20, 30, 40], 100) == []\", \"assert find_three_elements([1, 1, 1, 1, 1, 1], 3) == [0, 1, 2]\", \"assert... | {
"split": "train",
"index": 4102,
"acecode_id": "evol_13936",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a list of devices represented as strings. Your task is to implement a function that checks if each device in the list is valid. A valid device is defined as any non-empty string. Your function should return a list of boolean values where each boolean corresponds t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_devices(['device1', 'device2', '']) == [True, True, False]\", \"assert validate_devices(['', '']) == [False, False]\", \"assert validate_devices(['device3', 'device4']) == [True, True]\", \"assert validate_devices(['', 'device5']) == [False, True]\"... | {
"split": "train",
"index": 4103,
"acecode_id": "bigcode_python_fns_46324",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `check_number_type` that takes an input `n`. The function should check the type of the number and return a string based on the following conditions: 1. If `n` is a prime number, return 'Prime'. 2. If `n` is greater than 0 but not a prime number, retu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_number_type(2) == 'Prime'\", \"assert check_number_type(3) == 'Prime'\", \"assert check_number_type(4) == 'Positive'\", \"assert check_number_type(5) == 'Prime'\", \"assert check_number_type(10) == 'Positive'\", \"assert check_number_type(0) == 'Zero'\... | {
"split": "train",
"index": 4104,
"acecode_id": "evol_22307",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that determines whether a 'Confirm' button should be enabled based on specific input conditions. Implement a function `should_enable_confirm_button(input1: int, input2: int, input3: str) -> bool` that returns `True` if both of the followi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert should_enable_confirm_button(5, 6, 'example') == True\", \"assert should_enable_confirm_button(5, 5, 'test') == False\", \"assert should_enable_confirm_button(3, 8, 'hello') == True\", \"assert should_enable_confirm_button(10, 1, 'test') == False\", \"assert... | {
"split": "train",
"index": 4105,
"acecode_id": "oss_16887",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of package information strings and returns a dictionary containing the package names and their associated dependencies. Each string in the input list contains a package name, long description, installation req... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_package_info(['packages=find_packages(),', 'long_description=\\\"Sample package\\\",', 'install_requires=[\\\"numpy\\\", \\\"pandas\\\"],', 'tests_require=[\\\"pytest\\\", \\\"mock\\\"]']) == {'find_packages()': [['numpy', 'pandas'], ['pytest', 'mock']... | {
"split": "train",
"index": 4106,
"acecode_id": "oss_21206",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves an object from a list of objects based on specified attributes. Implement a function `get_object_by_attributes(objects: List[Dict[str, Any]], **attributes: Any) -> Dict[str, Any]` that takes a list of dictionaries `objects`... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_object_by_attributes([], name='Alice') is None\", \"assert get_object_by_attributes([{'name': 'Alice'}], name='Alice') == {'name': 'Alice'}\", \"assert get_object_by_attributes([{'name': 'Alice'}, {'name': 'Bob'}], name='Bob') == {'name': 'Bob'}\", \"ass... | {
"split": "train",
"index": 4107,
"acecode_id": "bigcode_python_fns_15709",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing the names of different fruits. Write a Python function called `change_fruit_names` that takes in the following parameters: \n- `fruits_list`: a list of strings representing fruit names. \n- `new_name`: a string representing the new n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert change_fruit_names(['apple', 'banana', 'cherry'], 'fruit') == ['fruit', 'fruit', 'fruit']\", \"assert change_fruit_names(['grape', 'orange'], 'citrus') == ['citrus', 'citrus']\", \"assert change_fruit_names(['kiwi'], 'tropical') == ['tropical']\", \"assert c... | {
"split": "train",
"index": 4108,
"acecode_id": "oss_21615",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a logging function that records error messages when an event fails. Your function should take two parameters: 'status', an integer representing the status code of the event, and 'summary', a string describing the event. If the status code is 500... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_event(500, 'Internal Server Error') == '500 Internal Server Error'\", \"assert log_event(501, 'Not Implemented') == '501 Not Implemented'\", \"assert log_event(404, 'Not Found') == ''\", \"assert log_event(200, 'OK') == ''\", \"assert log_event(503, 'Ser... | {
"split": "train",
"index": 4109,
"acecode_id": "bigcode_python_fns_13916",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with organizing a list of filenames based on their file extensions. Write a function `organize_files_by_extension(filenames: List[str]) -> Dict[str, List[str]]` that takes a list of filenames (with extensions) and returns a dictionary where the keys are the uniqu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert organize_files_by_extension(['file1.txt', 'file2.jpg', 'file3.txt']) == {'txt': ['file1.txt', 'file3.txt'], 'jpg': ['file2.jpg']}\", \"assert organize_files_by_extension(['document.pdf', 'image.png', 'archive.zip']) == {'pdf': ['document.pdf'], 'png': ['imag... | {
"split": "train",
"index": 4110,
"acecode_id": "oss_20694",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of lists where each inner list contains tuples of (gradient, variable). Your task is to calculate the average gradient for each unique variable across all the inner lists. The average gradient should be capped at -200 and 200. If any gradient is None, it sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_gradients([[(1, 'x'), (2, 'y')], [(3, 'x'), (4, 'y')]]) == [(2.0, 'x'), (3.0, 'y')]\", \"assert average_gradients([[(-1, 'a'), (None, 'b')], [(3, 'a'), (5, 'b')]]) == [(1.0, 'a'), (5.0, 'b')]\", \"assert average_gradients([[(-150, 'e'), (None, 'f')],... | {
"split": "train",
"index": 4111,
"acecode_id": "bigcode_python_fns_7178",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given two lists: `flnc_files` and `chunked_nfl_files`, representing the full-length non-chimeric files and chunked non-chimeric files respectively. Write a function `create_partial_chunk_tasks(flnc_files: List[str], chunked_nfl_files: List[str]) -> List[Dict[str, Any]]`... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_partial_chunk_tasks(['file1.flnc', 'file2.flnc'], ['chunk1.nfl', 'chunk2.nfl']) == [{'cluster_bin_index': 0, 'flnc_file': 'file1.flnc', 'cluster_out_dir': 'out_dir_for_file1.flnc', 'nfl_file': 'chunk1.nfl', 'nfl_index': 0}, {'cluster_bin_index': 0, 'f... | {
"split": "train",
"index": 4112,
"acecode_id": "bigcode_python_fns_1579",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing a list of transcription factor data, where each transcription factor has associated conformation information. Write a function `extract_conformations(data: List[Dict[str, Any]], version: str) -> List[Dict[str, Any]]` that takes in a list of dictio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_conformations([{'transcription_factor_id': 'TF1', 'conformation_id': 'C1', 'final_state': 'active', 'interaction_type': 'binding'}, {'transcription_factor_id': 'TF2', 'conformation_id': 'C2', 'final_state': 'inactive', 'interaction_type': 'release'},... | {
"split": "train",
"index": 4113,
"acecode_id": "bigcode_python_fns_11124",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that manages the translation of user interface elements based on the specified language settings. The function should take in a dictionary of translations for different languages, a string representing the current language code, and a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert retranslate_ui({'en': {'title': 'Title', 'button': 'Submit'}, 'fr': {'title': 'Titre', 'button': 'Soumettre'}}, 'fr', {'title': '', 'button': ''}) == {'title': 'Titre', 'button': 'Soumettre'}\", \"assert retranslate_ui({'en': {'title': 'Title', 'button': 'Su... | {
"split": "train",
"index": 4114,
"acecode_id": "oss_10057",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string `text` that may contain encoding problems, represented by special characters or sequences that need to be cleaned up. Your task is to implement a function `fix(text: str) -> str` that repairs these encoding problems by removing any non-alphanumeric charac... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fix('Hello, World! 123') == 'Hello World 123'\", \"assert fix('Python@3.8') == 'Python38'\", \"assert fix('Data#Science$') == 'DataScience'\", \"assert fix('LeetCode is fun!') == 'LeetCode is fun'\", \"assert fix('Clean this text!') == 'Clean this text'\", \... | {
"split": "train",
"index": 4115,
"acecode_id": "bigcode_python_fns_27728",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a line of code in Python. Your task is to create a function `prepend_pass_statement(line: str) -> str` that prepends a 'pass' statement at the same indentation level as the given line and comments out the original line. The indentation is def... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert prepend_pass_statement(' print(\\\"Hello World\\\")') == ' pass # print(\\\"Hello World\\\")'\", \"assert prepend_pass_statement('x = 10') == 'pass # x = 10'\", \"assert prepend_pass_statement(' return x') == ' pass # return x'\", \"assert pre... | {
"split": "train",
"index": 4116,
"acecode_id": "bigcode_python_fns_13665",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_tree()` that constructs a binary tree using a left-child right-sibling representation with 8 nodes. The base node should be 'A', and its direct sub-nodes should be 'B', 'C', 'D', 'E', 'F', 'G', and 'H'. The function should return the root node of th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_tree().value == 'A'\", \"assert create_tree().left_child.value == 'B'\", \"assert create_tree().left_child.right_sibling.value == 'C'\", \"assert create_tree().left_child.right_sibling.right_sibling.value == 'D'\", \"assert create_tree().left_child.ri... | {
"split": "train",
"index": 4117,
"acecode_id": "evol_1303",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a variable number of authenticator class names as string arguments and returns a list of these class names in uppercase. The function should ensure that each class name appears only once in the final list, regardless of how man... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_authenticators('SingleAuth') == ['SINGLEAUTH']\", \"assert unique_authenticators() == []\", \"assert unique_authenticators('A') == ['A']\", \"assert unique_authenticators('Test', 'Test', 'Test') == ['TEST']\", \"assert unique_authenticators('First', '... | {
"split": "train",
"index": 4118,
"acecode_id": "bigcode_python_fns_21647",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a custom data serializer for a product management system. Your serializer should handle the serialization and deserialization of data for a specific model called `Product`, which has the following fields: `id` (auto-generated primary key), `name` (s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert serialize_product(1, 'Product A', 19.99, 'This is a test product.') == {'id': 1, 'name': 'Product A', 'price': 19.99, 'description': 'This is a test product.'}\", \"assert serialize_product(2, 'Test', 15.50, '') == {'id': 2, 'name': 'Test', 'price': 15.50, '... | {
"split": "train",
"index": 4119,
"acecode_id": "oss_15079",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that manages user sessions for a chat application. Each user is identified by a unique user ID, and you need to ensure that each user has their own session object. The function `get_user_session(user_id)` should return a session object fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_user_session(1) == {'user_id': 1}\", \"assert get_user_session(2) == {'user_id': 2}\", \"assert get_user_session(1) == {'user_id': 1}\", \"assert get_user_session(3) == {'user_id': 3}\", \"assert get_user_session(4) == {'user_id': 4}\", \"assert get_user... | {
"split": "train",
"index": 4120,
"acecode_id": "evol_18574",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating specific statistical values based on given conditions. You need to implement a function that computes the 'YSI' and 'YSI_err' values from provided inputs. The function should take the following parameters: \n- exp_mean: A float representing the e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_YSI_values(3.5, 0.8, [4.2, 3.9, 4.1], [0.5, 0.3, 0.6]) == {'YSI': 3.5, 'YSI_err': 0.8}\", \"assert calculate_YSI_values(0, 0.8, [4.2, 3.9, 4.1], [0.5, 0.3, 0.6]) == {'YSI': 4.2, 'YSI_err': 0.8}\", \"assert calculate_YSI_values(3.5, None, [4.2, 3.9,... | {
"split": "train",
"index": 4121,
"acecode_id": "oss_5467",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function that outputs all prime numbers between 1 and N (inclusive) with N being an input parameter. The function should return a list of prime numbers. Include error handling for cases where N is less than 1 or a non-integer.\nPlease reason step by step, then write a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_primes(1) == []\", \"assert find_primes(2) == [2]\", \"assert find_primes(3) == [2, 3]\", \"assert find_primes(4) == [2, 3]\", \"assert find_primes(5) == [2, 3, 5]\", \"assert find_primes(10) == [2, 3, 5, 7]\", \"assert find_primes(11) == [2, 3, 5, 7, 1... | {
"split": "train",
"index": 4122,
"acecode_id": "evol_9375",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a string as input and returns the string unchanged if a specific condition is met. The condition is that a global variable `USE_SLUGIFY` is set to false. If `USE_SLUGIFY` is true, the function should return the original string ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_string('Hello, World!') == 'Hello, World!'\", \"assert process_string('Za\\u017c\\u00f3\\u0142\\u0107 g\\u0119\\u015bl\\u0105 ja\\u017a\\u0144!-123.456') == 'Za\\u017c\\u00f3\\u0142\\u0107 g\\u0119\\u015bl\\u0105 ja\\u017a\\u0144!-123.456'\", \"asser... | {
"split": "train",
"index": 4123,
"acecode_id": "bigcode_python_fns_39327",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a robotic shark vacuum cleaner with certain properties that dictate its behavior. The shark has the following properties: `is_docked`, a boolean indicating whether the shark is currently docked, and `recharging_to_resume`, a boolean indicating whether the shark is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_shark_state(Shark(True, True)) == (False, 2)\", \"assert update_shark_state(Shark(True, True)) == (False, 2)\", \"assert update_shark_state(Shark(True, True)) == (False, 2)\", \"assert update_shark_state(Shark(True, True)) == (False, 2)\", \"assert up... | {
"split": "train",
"index": 4124,
"acecode_id": "oss_34401",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks if a given variable name exists in a predefined set of variable names and returns information about it. The function should return a tuple containing the number of characters in the variable name, the type of the variable ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_variable('var1') == (4, 'C', True)\", \"assert check_variable('var2') == (4, 'N', True)\", \"assert check_variable('var3') == (4, 'X', True)\", \"assert check_variable('var4') == (4, 'C', True)\", \"assert check_variable('var5') == (0, 'N', False)\", \... | {
"split": "train",
"index": 4125,
"acecode_id": "bigcode_python_fns_12222",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that constructs a valid HTTPS URL from the provided subdomain, domain, and path fragment. The function should take three string parameters: 'subdomain', 'domain', and 'path_fragment', and return a string that represents the complete URL in the format 'https://{... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert weave_url('mypage', 'google', 'search') == 'https://mypage.google.com/search'\", \"assert weave_url('blog', 'example', 'posts') == 'https://blog.example.com/posts'\", \"assert weave_url('shop', 'amazon', 'products') == 'https://shop.amazon.com/products'\", \... | {
"split": "train",
"index": 4126,
"acecode_id": "evol_22990",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `do_lock` that simulates the process of resolving dependencies for a software project. The function will take the following parameters: a project (represented as a dictionary), a string representing the strategy ('all' or 'specific'),... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert do_lock({'a': {'version': '1.0', 'dependencies': ['b']}, 'b': {'version': '1.0', 'dependencies': []}}, 'all', None, None) == {'a': '1.0', 'b': '1.0'}\", \"assert do_lock({'a': {'version': '2.0', 'dependencies': ['b']}, 'b': {'version': '1.0', 'dependencies':... | {
"split": "train",
"index": 4127,
"acecode_id": "bigcode_python_fns_48357",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple user interface for a bot that allows users to browse through different categories of pictograms. Write a function called `display_menu` that accepts two parameters: `chat_id` (an integer representing the user's chat ID) and `categories` (a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert display_menu(123456, ['Animals', 'Nature', 'Technology']) == {'chat_id': 123456, 'message': 'Available categories: Animals, Nature, Technology.'}\", \"assert display_menu(789012, ['Food']) == {'chat_id': 789012, 'message': 'Available categories: Food.'}\", \... | {
"split": "train",
"index": 4128,
"acecode_id": "bigcode_python_fns_33224",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that processes a list of integers and returns a new list sorted from smallest to largest, containing only unique elements. The function must not use Python's built-in sort function or set data structure. The function signature should be: `def unique(l: list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique([5, 3, 5, 2, 3, 3, 9, 0, 123]) == [0, 2, 3, 5, 9, 123]\", \"assert unique([]) == []\", \"assert unique([1, 1, 1]) == [1]\", \"assert unique([7, 5, 3, 3, 5, 7, 9]) == [3, 5, 7, 9]\", \"assert unique([4, 2, 2, 3, 1, 1, 5]) == [1, 2, 3, 4, 5]\", \"assert... | {
"split": "train",
"index": 4129,
"acecode_id": "evol_23045",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `intercalate_strings` that takes two strings as input and intercalates their characters. The function should reverse the strings every alternate time it is called. If the lengths of the two strings are unequal, append the remaining characters from the longe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert intercalate_strings('abc', '123') == 'a1b2c3'\", \"assert intercalate_strings('abcdef', '12345') == 'a1b2c3d4e5f'\", \"assert intercalate_strings('A', '1') == 'A1'\", \"assert intercalate_strings('!', '@') == '!@'\", \"assert intercalate_strings('abcdefgh', ... | {
"split": "train",
"index": 4130,
"acecode_id": "evol_15218",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a string `sha` which represents a commit identifier in a version control system, and a list of strings `commits` that represent commit identifiers in chronological order (oldest to newest). Your task is to write a function `get_commit_shas_since(sha: str, commits:... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_commit_shas_since('abc123', ['abc123', 'def456', 'ghi789']) == ['abc123', 'def456', 'ghi789']\", \"assert get_commit_shas_since('def456', ['abc123', 'def456', 'ghi789']) == ['def456', 'ghi789']\", \"assert get_commit_shas_since('ghi789', ['abc123', 'def4... | {
"split": "train",
"index": 4131,
"acecode_id": "bigcode_python_fns_49469",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `find_most_frequent(lst)` that returns the element or elements that appear most frequently in the list. If there are multiple elements with the same highest frequency, return them as a list. If the input list is empty, return an em... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_most_frequent([1, 2, 2, 3, 3, 3, 4]) == [3]\", \"assert find_most_frequent([1, 1, 2, 2]) == [1, 2]\", \"assert find_most_frequent([5]) == [5]\", \"assert find_most_frequent([0, 0, 0, 1, 1]) == [0]\", \"assert find_most_frequent([]) == []\", \"assert fin... | {
"split": "train",
"index": 4132,
"acecode_id": "evol_10011",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, write a function that rearranges the elements such that all prime numbers appear at the beginning of the array, followed by all non-prime numbers. The relative order of the prime numbers and non-prime numbers should be preserved. Implement the functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reconfigure_array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == [2, 3, 5, 7, 1, 4, 6, 8, 9, 10]\", \"assert reconfigure_array([11, 4, 6, 13, 15, 17, 18]) == [11, 13, 17, 4, 6, 15, 18]\", \"assert reconfigure_array([0, -1, 2, 3, 4, 5]) == [2, 3, 5, 0, -1, 4]\", \"asser... | {
"split": "train",
"index": 4133,
"acecode_id": "evol_26433",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `median_of_sorted_arrays(arr: List[List[int]]) -> List[float]` that takes a 2D list of integers, where each inner list represents an array of integers. The function should sort each inner array in ascending order without using any built-in sorting functions... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert median_of_sorted_arrays([[3, 5, 4, 1, 7], [1, 5, 8, 9, 3]]) == [4.0, 5.0]\", \"assert median_of_sorted_arrays([[1, 2, 3], [10, 20, 30, 40]]) == [2.0, 25.0]\", \"assert median_of_sorted_arrays([[5, 2], [3, 1]]) == [3.5, 2.0]\", \"assert median_of_sorted_array... | {
"split": "train",
"index": 4134,
"acecode_id": "evol_8543",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two strings, `actual` and `expected`. Your task is to determine if `actual` matches portions of `expected` while ignoring certain parts. The `expected` string contains two special patterns: `***` and `+++`. The `***` pattern indicates that any characters in betwee... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert eq_portions('', '+++aaaaaa***ccccc+++eeeeeee+++') == ()\", \"assert eq_portions('_1__aaaaaa__2__ccccc_3__eeeeeee_4_', '+++aaaaaa***ccccc+++eeeeeee+++') == ('_1__', '__2__', '_3__', '_4_')\", \"assert eq_portions('_1__aaaaaaccccc_3__eeeeeee_4_', '+++aaaaaa***... | {
"split": "train",
"index": 4135,
"acecode_id": "bigcode_python_fns_27655",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Write a function `convert_minutes(minutes: int) -> str` that takes an integer `minutes` representing a number of minutes and converts it into a more readable format by expressing it in terms of hours and minutes. The function should return a string in the format 'X hour(s) and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_minutes(0) == '0 hour(s) and 0 minute(s)'\", \"assert convert_minutes(59) == '0 hour(s) and 59 minute(s)'\", \"assert convert_minutes(60) == '1 hour(s) and 0 minute(s)'\", \"assert convert_minutes(61) == '1 hour(s) and 1 minute(s)'\", \"assert conver... | {
"split": "train",
"index": 4136,
"acecode_id": "evol_12661",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are constructing a bridge and want it to have the longest length. The bridge will have two concrete supports, one on each side. Each concrete support must be of equal length. You are given a collection of `beams` that can be joined together. Return the longest possible leng... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longestBridge([10, 20, 30, 40]) == 0\", \"assert longestBridge([2, 2, 2, 2]) == 4\", \"assert longestBridge([2, 4, 6, 8]) == 0\", \"assert longestBridge([10, 15, 25, 35]) == 0\", \"assert longestBridge([5, 10, 15, 20]) == 0\"]}"
} | {
"split": "train",
"index": 4137,
"acecode_id": "evol_20007",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that parses a given log line to extract the amount of healing and the target recipient. Each log line is formatted as follows: 'Healing X for Y', where X is a positive integer representing the amount of healing, and Y is a string represen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_healing_and_target('Healing 50 for the knight') == [50, 'knight']\", \"assert parse_healing_and_target('Healing 20 for the wizard') == [20, 'wizard']\", \"assert parse_healing_and_target('Healing 75 for the rogue') == [75, 'rogue']\", \"assert parse_he... | {
"split": "train",
"index": 4138,
"acecode_id": "bigcode_python_fns_28305",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a custom argument parser function in Python that mimics the behavior of a standard argument parser. The function, `custom_arg_parser`, should accept a list of command-line arguments and a boolean parameter `exit`. If the function encounters an e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert custom_arg_parser(['--help'], False) == {'--help': True}\", \"assert custom_arg_parser(['--foo', 'bar'], False) == {'--foo': 'bar'}\", \"assert custom_arg_parser(['--foo', 'bar', '--baz', 'qux'], False) == {'--foo': 'bar', '--baz': 'qux'}\", \"assert custom_... | {
"split": "train",
"index": 4139,
"acecode_id": "oss_17517",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a high-level quantum physics problem represented as a string, write a function `formulate_expression(physics_problem: str) -> str` that converts this problem into an algorithmic expression. The algorithmic expression should be a simplified representation where specific ke... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert formulate_expression('mass plus energy equals mc squared') == 'mass + energy equals mc squared'\", \"assert formulate_expression('force equals mass times acceleration') == 'force equals mass * acceleration'\", \"assert formulate_expression('velocity equals d... | {
"split": "train",
"index": 4140,
"acecode_id": "evol_6070",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a three-dimensional array, implement a function that calculates the product of the two main diagonals. The first diagonal runs from the top-left-front corner to the bottom-right-back corner, and the second diagonal runs from the top-left-back corner to the bottom-right-fr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert threeD_array_product([[[0,1,2], [3,4,5], [6,7,8]], [[9,8,7],[6,5,4],[3,2,1]]]) == (0, 6)\", \"assert threeD_array_product([[[1,1,1], [1,1,1], [1,1,1]], [[1,1,1],[1,1,1],[1,1,1]]]) == (1, 1)\", \"assert threeD_array_product([[[1,-1,1], [-1,1,-1], [1,-1,1]], [... | {
"split": "train",
"index": 4141,
"acecode_id": "evol_20196",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given an integer value `v` and an index `index`, implement a function `set_bit(v: int, index: int, x: bool) -> int` that sets the `index`-th bit of `v` to 1 if `x` is true, and to 0 if `x` is false. The function should return the new integer value after the bit has been modifie... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_bit(5, 0, False) == 4\", \"assert set_bit(0, 0, True) == 1\", \"assert set_bit(0, 0, False) == 0\", \"assert set_bit(7, 2, True) == 7\", \"assert set_bit(7, 2, False) == 3\", \"assert set_bit(1, 0, True) == 1\", \"assert set_bit(1, 1, True) == 3\", \"ass... | {
"split": "train",
"index": 4142,
"acecode_id": "bigcode_python_fns_19171",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a caching mechanism for instances of a class in Python. The goal is to optimize the creation of instances by reusing previously created instances based on certain criteria. You need to implement a method called `get_instance` within a class `Cac... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert CachingClass().get_instance('node1', 'key1', MyClass) == ('node1', MyClass.to_variable('node1'))\", \"assert CachingClass().get_instance('node2', 'key1', MyClass) == ('node2', MyClass.to_variable('node2'))\", \"assert CachingClass().get_instance('node1', 'ke... | {
"split": "train",
"index": 4143,
"acecode_id": "oss_503",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a string that consists of words separated by underscores, determine if the string can be parsed into a specific parameter type based on a provided mapping of parameter types to lists of words. The mapping includes several parameter types, each associated with a list of wo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_parameter('time_daily', { 'TimeResolution': [['time', 'daily'], ['daily', 'time']], 'PeriodType': [['time', 'weekly'], ['weekly', 'time']] }) == 'TimeResolution'\", \"assert parse_parameter('period_monthly', { 'TimeResolution': [['time', 'daily'], ['da... | {
"split": "train",
"index": 4144,
"acecode_id": "bigcode_python_fns_4995",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a unique identifier for a network switch port. The identifier should be formatted as 'port+<switch_name>:<port_name>', where <switch_name> and <port_name> are provided as input parameters. Your function should take two stri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dp_port_id('Switch1', 'PortA') == 'port+Switch1:PortA'\", \"assert dp_port_id('Switch2', 'PortB') == 'port+Switch2:PortB'\", \"assert dp_port_id('MainSwitch', 'Gig1') == 'port+MainSwitch:Gig1'\", \"assert dp_port_id('CoreSwitch', 'Fa0/1') == 'port+CoreSwitch... | {
"split": "train",
"index": 4145,
"acecode_id": "bigcode_python_fns_19848",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer representing a font encoding value, implement a function that returns a string description of the encoding. The function should map specific encoding integers to their corresponding descriptions based on the following mappings: \n\n- 0: 'Undefined'\n- 1: 'ANSI'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_encoding_description(0) == 'Undefined'\", \"assert get_encoding_description(1) == 'ANSI'\", \"assert get_encoding_description(2) == 'Unicode'\", \"assert get_encoding_description(3) == 'Symbol'\", \"assert get_encoding_description(4) == 'OEM'\", \"assert... | {
"split": "train",
"index": 4146,
"acecode_id": "bigcode_python_fns_20093",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `print_greeting` that prints the message 'Hello, World!' and returns 0. Your function should ensure that the message is printed correctly with appropriate syntax. You may not use any classes or inheritance in your implementation.\nPlease reason step ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert print_greeting() == 0\", \"assert print_greeting() == 0\", \"assert print_greeting() == 0\", \"assert print_greeting() == 0\", \"assert print_greeting() == 0\", \"assert print_greeting() == 0\", \"assert print_greeting() == 0\", \"assert print_greeting() == ... | {
"split": "train",
"index": 4147,
"acecode_id": "evol_1851",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of numerical values, implement a function `normalize_values(values: List[float], mn: Optional[float], mx: Optional[float]) -> List[float]` that normalizes the values in the list based on a specified minimum and maximum range. The normalization should map the values... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert normalize_values([10, 20, 30], None, None) == [0.0, 0.5, 1.0]\", \"assert normalize_values([0, 100], None, None) == [0.0, 1.0]\", \"assert normalize_values([-10, 0, 10], None, None) == [0.0, 0.5, 1.0]\", \"assert normalize_values([5, 15, 25, 35], None, None)... | {
"split": "train",
"index": 4148,
"acecode_id": "bigcode_python_fns_2575",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given an array that may contain integers and strings, implement a function `aggregate(arr)` that returns a tuple containing the sum of all integers and the concatenated string of all string elements. The function should ignore any elements that are not integers or strings. For ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert aggregate([1, 2, 3, 'a', 'b', 4]) == (10, 'ab')\", \"assert aggregate(['hello', 10, 20, 30]) == (60, 'hello')\", \"assert aggregate(['a', 'b', 'c']) == (0, 'abc')\", \"assert aggregate([1, 2, 3]) == (6, '')\", \"assert aggregate(['x', 4, 'y', 5]) == (9, 'xy'... | {
"split": "train",
"index": 4149,
"acecode_id": "evol_11459",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_point_within_circle(radius: float, point: Tuple[int, int]) -> bool` that determines if a point is within a circle. The circle is centered at the origin (0, 0) and has the given radius. The function should take two parameters: a float `radius` representi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_point_within_circle(7, (4, 5)) == True\", \"assert is_point_within_circle(7, (7, 8)) == False\", \"assert is_point_within_circle(5, (0, 5)) == True\", \"assert is_point_within_circle(5, (5, 0)) == True\", \"assert is_point_within_circle(5, (3, 4)) == True... | {
"split": "train",
"index": 4150,
"acecode_id": "evol_23528",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of strings `A` consisting of only lowercase alphabets, write a function `commonChars` to determine the list of all characters that appear in every string of the array, including their frequency. Each character should be included in the output as many times as it ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert commonChars(['bella', 'label', 'roller']) == ['e', 'l', 'l']\", \"assert commonChars(['cool', 'lock', 'cook']) == ['c', 'o']\", \"assert commonChars(['xyz', 'xzy', 'zyx']) == ['x', 'y', 'z']\", \"assert commonChars(['a', 'a', 'a']) == ['a']\", \"assert commo... | {
"split": "train",
"index": 4151,
"acecode_id": "evol_26775",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of integers, `grad_sum` and `grad`, which represent two gradients. Your task is to implement a function `cumulative_gradient(grad_sum: List[int], grad: List[int]) -> List[int]` that returns a new list where each element is the sum of the corresponding el... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cumulative_gradient([1, 2, 3], [4, 5]) == [5, 7, 3]\", \"assert cumulative_gradient([0], [0]) == [0]\", \"assert cumulative_gradient([], [1, 2, 3]) == [1, 2, 3]\", \"assert cumulative_gradient([1, 2], []) == [1, 2]\", \"assert cumulative_gradient([1, 2, 3], ... | {
"split": "train",
"index": 4152,
"acecode_id": "bigcode_python_fns_26582",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of binary parameters, implement a function that generates a file prefix based on the following rules: Start the prefix with 'bin_'. For each element in the list, if the index of the element is odd (1-based index), append the element followed by a dash '-'. If the i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_file_prefix([1, 2, 3]) == 'bin_1-2_3-'\", \"assert generate_file_prefix([10, 20, 30, 40]) == 'bin_10-20_30-40_'\", \"assert generate_file_prefix([5]) == 'bin_5-'\", \"assert generate_file_prefix([7, 8]) == 'bin_7-8_'\", \"assert generate_file_prefix... | {
"split": "train",
"index": 4153,
"acecode_id": "bigcode_python_fns_9520",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D list of bounding boxes, where each bounding box is represented as a list containing six values: [x, y, z, length_x, length_y, length_z]. Your task is to calculate the total volume of all the bounding boxes combined. The volume of a single bounding box can be ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_volume([[0, 0, 0, 1, 1, 1]]) == 1.0\", \"assert calculate_total_volume([[0, 0, 0, 1, 2, 3], [1, 1, 1, 4, 5, 6]]) == 1*2*3 + 4*5*6\", \"assert calculate_total_volume([[0, 0, 0, 0, 0, 0]]) == 0.0\", \"assert calculate_total_volume([[0, 0, 0, 2,... | {
"split": "train",
"index": 4154,
"acecode_id": "bigcode_python_fns_24866",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function called `combineName` that takes in two strings, `firstName` and `lastName`. The function should combine them into a single full name by inserting a space between them. The inputs must adhere to the following rules: both strings must not be empty and must start... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert combineName('Alice', 'Johnson') == 'Alice Johnson'\", \"assert combineName('Bob', 'Smith') == 'Bob Smith'\", \"assert combineName('Charlie', 'Brown') == 'Charlie Brown'\", \"assert combineName('David', 'Williams') == 'David Williams'\", \"assert combineName(... | {
"split": "train",
"index": 4155,
"acecode_id": "evol_18360",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, where each string represents a route in a web application. Your task is to implement a function that counts the number of unique routes in the list. A route is considered unique if it is not identical to any other route in the list, ignoring cas... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_routes(['Home', 'home', 'About', 'about', 'Contact']) == 3\", \"assert count_unique_routes(['Route1', 'Route1', 'route1']) == 1\", \"assert count_unique_routes(['a', 'A', 'b', 'B', 'c']) == 3\", \"assert count_unique_routes(['test', 'test', 'TES... | {
"split": "train",
"index": 4156,
"acecode_id": "bigcode_python_fns_32303",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `patch_request(url: str, headers: Optional[Dict[str, str]], cookies: Optional[Dict[str, str]], timeout: int, data: Optional[Union[Dict, str]] = None) -> Response` that sends a PATCH request to the specified URL. The function should support custom headers an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert patch_request('http://example.com/api', None, None, 30) is not None\", \"assert patch_request('http://example.com/api', {'Authorization': 'Bearer token'}, None, 60, 'raw data') is not None\", \"assert patch_request('http://example.com/api', {'Accept': 'appli... | {
"split": "train",
"index": 4157,
"acecode_id": "evol_7940",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, return a new list containing only the unique elements from the original list. The order of elements in the new list should be the same as the first occurrence of each unique element in the original list. Write a function `unique_elements(arr: List[int]... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_elements([1, 2, 2, 3, 4, 4]) == [1, 2, 3, 4]\", \"assert unique_elements([4, 5, 4, 5, 6, 7, 6]) == [4, 5, 6, 7]\", \"assert unique_elements([1, 1, 1]) == [1]\", \"assert unique_elements([]) == []\", \"assert unique_elements([10, 20, 30, 10, 20]) == [1... | {
"split": "train",
"index": 4158,
"acecode_id": "bigcode_python_fns_10432",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `reverse_list` that takes a list of integers as input and returns a new list containing the elements in reverse order. Do not use any built-in reverse functions. The input list may be empty.\nPlease reason step by step, then write a self-contained Python so... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_list([]) == []\", \"assert reverse_list([1]) == [1]\", \"assert reverse_list([1, 2, 3]) == [3, 2, 1]\", \"assert reverse_list([5, 10, 15, 20]) == [20, 15, 10, 5]\", \"assert reverse_list([100, 200]) == [200, 100]\", \"assert reverse_list([1, 2, 3, 4,... | {
"split": "train",
"index": 4159,
"acecode_id": "evol_865",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `are_anagrams(str1: str, str2: str) -> bool` that determines if two given strings are anagrams of each other. The function should consider case sensitivity and whitespace, meaning that 'Listen' and 'Silent' are not considered anagrams. Optimize the solution for... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert are_anagrams('listen', 'silent') == True\", \"assert are_anagrams('Listen', 'Silent') == False\", \"assert are_anagrams('triangle', 'integral') == True\", \"assert are_anagrams('apple', 'papel') == True\", \"assert are_anagrams('abc', 'cba') == True\", \"ass... | {
"split": "train",
"index": 4160,
"acecode_id": "evol_24928",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to retrieve a list of available streams from a streaming service. Each stream is represented by a dictionary containing the stream's name, type, and availability status. Implement a function `list_streams(streams: List[Dict[str, Union... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert list_streams([{'name': 'The Matrix', 'type': 'movie', 'available': True}, {'name': 'Stranger Things', 'type': 'tv show', 'available': False}, {'name': 'Live Concert', 'type': 'live event', 'available': True}, {'name': 'Inception', 'type': 'movie', 'available... | {
"split": "train",
"index": 4161,
"acecode_id": "oss_32830",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that takes an identifier string for a human and a title string as inputs. In this context, the title can either include the term 'Beschluss' or not. If the title contains 'Beschluss', the function should return the identifier string unchan... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert align_decision('12345', 'This is a Beschluss title') == '12345'\", \"assert align_decision('Test Beschluss', 'This is a Beschluss title') == 'Test Beschluss'\", \"assert align_decision('ID123', 'Beschluss is important') == 'ID123'\", \"assert align_decision(... | {
"split": "train",
"index": 4162,
"acecode_id": "bigcode_python_fns_35745",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Write a function `fibonacci_sequence(n: int) -> List[int]` that generates a list containing the Fibonacci sequence up to the nth term using a recursive method. 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 s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci_sequence(0) == []\", \"assert fibonacci_sequence(1) == [0]\", \"assert fibonacci_sequence(2) == [0, 1]\", \"assert fibonacci_sequence(3) == [0, 1, 1]\", \"assert fibonacci_sequence(4) == [0, 1, 1, 2]\", \"assert fibonacci_sequence(5) == [0, 1, 1, 2... | {
"split": "train",
"index": 4163,
"acecode_id": "evol_24373",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a version comparison function for software packages. Your program should take a package version number as input and determine if this version is the latest available version according to a predefined list of versions for that package. The latest ver... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_latest_version('1.0.0') == True\", \"assert is_latest_version('0.3.5') == False\", \"assert is_latest_version('0.5.0') == False\", \"assert is_latest_version('0.3.0') == False\", \"assert is_latest_version('0.2.0') == False\", \"assert is_latest_version('... | {
"split": "train",
"index": 4164,
"acecode_id": "oss_26685",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the average grade of students based on their grades in different subjects. The input will be a list of dictionaries, where each dictionary represents a student and contains their 'Student_ID', 'Math_Grade', 'Science_Gr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_grade([{'Student_ID': 1, 'Math_Grade': 85.0, 'Science_Grade': 90.0, 'English_Grade': 88.0}]) == [{'Student_ID': 1, 'Math_Grade': 85.0, 'Science_Grade': 90.0, 'English_Grade': 88.0, 'Average_Grade': 87.67}]\", \"assert calculate_average_grad... | {
"split": "train",
"index": 4165,
"acecode_id": "oss_35283",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of market data entries, where each entry is a list of strings representing various attributes of market conditions. Each entry contains at least 15 elements. Your task is to filter out entries based on risk factors and their corresponding stress shifts. You... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_market_conditions([['ID', 'Date', 'Value', 'Risk', 'Type', 'Interest Rate', 'Other', 'Data', 'More', 'Columns', 'To', 'Fill', 'Here', 'Shift', '1', 'Extra'], ['1', '2023-01-01', '100', 'Risk1', 'TypeA', 'Interest Rate', 'Other', 'Data', 'More', 'Columns'... | {
"split": "train",
"index": 4166,
"acecode_id": "bigcode_python_fns_42334",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a string that represents the output of a command showing the status of various router interfaces. Each line contains an interface name followed by its status (e.g., 'eth0 up', 'eth1 down'). Your task is to implement a function that extracts the names of all interf... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_up_interfaces('eth0 up\\\\neth1 down\\\\neth2 up') == ['eth0', 'eth2']\", \"assert extract_up_interfaces('eth0 down\\\\neth1 down\\\\neth2 down') == []\", \"assert extract_up_interfaces('eth0 up\\\\neth1 up\\\\neth2 up') == ['eth0', 'eth1', 'eth2']\"... | {
"split": "train",
"index": 4167,
"acecode_id": "bigcode_python_fns_16950",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a Python function that validates a list of MAC (Media Access Control) addresses utilizing regex patterns. This function should return a list of valid MAC addresses while filtering out the invalid ones. A typical MAC address consists of six groups of two hexadecimal di... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_mac_addresses(['00:1A:2B:3C:4D:5E', '00-1A-2B-3C-4D-5E', '00:1A:2B:3C:4D:5G']) == ['00:1A:2B:3C:4D:5E', '00-1A-2B-3C-4D-5E']\", \"assert validate_mac_addresses(['01:23:45:67:89:AB', '01-23-45-67-89-AB', '01:23:45:67:89:Z0']) == ['01:23:45:67:89:AB',... | {
"split": "train",
"index": 4168,
"acecode_id": "evol_8368",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of lists, where each inner list contains strings. Your task is to concatenate each inner list's strings using a tab character ('\\t') as a separator and return a new list containing these concatenated strings. Implement a function `concatenate_tabbed_lines(... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert concatenate_tabbed_lines([['Hello', 'World'], ['Python', 'is', 'fun']]) == ['Hello\\\\tWorld', 'Python\\\\tis\\\\tfun']\", \"assert concatenate_tabbed_lines([['a', 'b', 'c'], ['1', '2', '3']]) == ['a\\\\tb\\\\tc', '1\\\\t2\\\\t3']\", \"assert concatenate_tab... | {
"split": "train",
"index": 4169,
"acecode_id": "bigcode_python_fns_35416",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that determines whether a polygon should be culled based on its orientation in 3D space. The culling behavior can be controlled by two parameters: whether culling is enabled and the culling mode (either 'back' or 'front'). The functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert should_cull_polygon(False, 'back', [0, 0, 1]) == False\", \"assert should_cull_polygon(True, 'back', [0, 0, -1]) == True\", \"assert should_cull_polygon(True, 'back', [0, 0, 0]) == False\", \"assert should_cull_polygon(True, 'back', [0, 0, 1]) == False\", \"... | {
"split": "train",
"index": 4170,
"acecode_id": "oss_23560",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates the behavior of downloading a file from a given URL and returning a status message. Your function should accept three parameters: 'name' (a string representing the name of the resource), 'url' (a string representing ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert http_archive('test1', 'http://example.com/test1.tar.gz') == 'test1 downloaded successfully'\", \"assert http_archive('test2', 'http://example.com/test2.tar.gz', 'abc123') == 'test2 downloaded successfully'\", \"assert http_archive('test4', 'http://example.co... | {
"split": "train",
"index": 4171,
"acecode_id": "oss_15028",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a nested list that can contain integers, strings, floats, and other nested lists, implement a function that extracts and returns a list of all the integers present in the nested structure. The integers should be collected in the order they appear in the nested list. You c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert print_integers([1, [2.3, 4, 'a', 'b', [5, 6.7, [8, 'c', 9.0, ['d', 10]]]]]) == [1, 4, 5, 8, 10]\", \"assert print_integers([[1, 'test', 3.5], [2, [3, 4], 'hello']]) == [1, 2, 3, 4]\", \"assert print_integers([[], [[], []], 5, 6]) == [5, 6]\", \"assert print_... | {
"split": "train",
"index": 4172,
"acecode_id": "evol_8828",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `modify_list` that returns a new list containing the squares of all the even numbers from the input list. The even numbers should be included in the new list in the same order they appear in the original list. If the input list is empt... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert modify_list([1, 2, 3, 4, 5, 6]) == [4, 16, 36]\", \"assert modify_list([2, 4, 6]) == [4, 16, 36]\", \"assert modify_list([1, 3, 5]) == []\", \"assert modify_list([]) == []\", \"assert modify_list([0, 2, 4]) == [0, 4, 16]\", \"assert modify_list([-2, -4, 3]) ... | {
"split": "train",
"index": 4173,
"acecode_id": "oss_5813",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a two-dimensional list (matrix) of integers, write a function `calculate_distinct_total(matrix)` that computes the sum of all distinct integers present in the matrix. The function should return the total sum of these distinct integers.\nPlease reason step by step, then wr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_distinct_total([[1, 2], [3, 4], [5, 6]]) == 21\", \"assert calculate_distinct_total([[1, 1], [1, 1], [1, 1]]) == 1\", \"assert calculate_distinct_total([[1, 2], [2, 3], [3, 4]]) == 10\", \"assert calculate_distinct_total([[5, -1], [0, 5], [-1, 0]])... | {
"split": "train",
"index": 4174,
"acecode_id": "evol_17799",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `median(l: list, cmp_func: callable) -> float` that returns the median of elements in the list `l` without sorting it or using built-in functions. Your implementation should handle tuples and lists with both even and odd numbers of elements, as well as dupl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert median([3, [1, 2], 4, 5], lambda a, b: a - b) == 3\", \"assert median([1, 2, [2, 4], 5], lambda a, b: a - b) == 2\", \"assert median([10, [20, 30], 40, [50]], lambda a, b: a - b) == 30.0\", \"assert median([1, 1, 1, 1], lambda a, b: a - b) == 1\", \"assert m... | {
"split": "train",
"index": 4175,
"acecode_id": "evol_29443",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `get_positive_and_sort(l: list)` that returns a new list containing only the positive integers from the input list, sorted in ascending order. You should not modify the input list. The function should handle cases where there are n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_positive_and_sort([-1, 2, -4, 5, 6]) == [2, 5, 6]\", \"assert get_positive_and_sort([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]) == [1, 2, 3, 3, 5, 9, 123]\", \"assert get_positive_and_sort([-1, -2, -3]) == []\", \"assert get_positive_and_sort([]) == []\", \... | {
"split": "train",
"index": 4176,
"acecode_id": "evol_7531",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are required to create a function that generates a user profile dictionary based on provided user information. The function should take in a string representing the user's IAM ARN, the user's name, the user's SSH username, and the user's SSH public key. It should return a d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_user_profile('arn:aws:iam::123456789012:user/JohnDoe', 'JohnDoe', 'johndoe', 'ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAr...') == {'UserProfile': {'IamUserArn': 'arn:aws:iam::123456789012:user/JohnDoe', 'Name': 'JohnDoe', 'SshUsername': 'johndoe', 'SshPub... | {
"split": "train",
"index": 4177,
"acecode_id": "bigcode_python_fns_6460",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a configuration object representing settings for a training process. The configuration object has the following properties: `summary_histograms`, `summary_img_images`, `summary_bev_images`, and `use_pretrained_model` (a boo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_trainable_variables({'summary_histograms': True, 'summary_img_images': True, 'summary_bev_images': True, 'use_pretrained_model': True}) == ['var68', 'var69', 'var70', 'var71']\", \"assert get_trainable_variables({'summary_histograms': False, 'summary_img... | {
"split": "train",
"index": 4178,
"acecode_id": "oss_24342",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of bounding boxes, where each bounding box is represented as a dictionary with the following keys: 'x', 'y', 'w', 'h', and 'classes'. The 'classes' key contains a list of probabilities for different classes. Your task is to implement a function that extract... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert boxes_to_array([{'x': 1.0, 'y': 2.0, 'w': 3.0, 'h': 4.0, 'classes': [0.1, 0.5, 0.4]}]) == [(1, [1.0, 2.0, 3.0, 4.0], 0.5)]\", \"assert boxes_to_array([{'x': 0.0, 'y': 0.0, 'w': 0.0, 'h': 0.0, 'classes': [0.2, 0.3, 0.5]}]) == [(2, [0.0, 0.0, 0.0, 0.0], 0.5)]\... | {
"split": "train",
"index": 4179,
"acecode_id": "bigcode_python_fns_40422",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string, find the shortest palindrome that begins with the supplied string. Consider spaces between words and ignore case and non-alphanumeric characters. Implement a function `make_palindrome(string: str) -> str` to achieve this.\nPlease reason step by step, then write ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert make_palindrome('') == ''\", \"assert make_palindrome('a') == 'a'\", \"assert make_palindrome('race') == 'racecar'\", \"assert make_palindrome('hello') == 'hellolleh'\", \"assert make_palindrome('A man, a plan, a canal, Panama') == 'A man, a plan, a canal, P... | {
"split": "train",
"index": 4180,
"acecode_id": "evol_24808",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves the value of a configuration variable from a given dictionary. If the key does not exist in the dictionary, the function should return a specified default value. Implement a function `get_config_value(config: Dict[str, Any]... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_config_value({'host': 'localhost', 'port': 8080}, 'host', 'default') == 'localhost'\", \"assert get_config_value({'host': 'localhost', 'port': 8080}, 'port', 80) == 8080\", \"assert get_config_value({'host': 'localhost', 'port': 8080}, 'username', 'guest... | {
"split": "train",
"index": 4181,
"acecode_id": "bigcode_python_fns_20900",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a non-negative integer n, define a function B5 that computes a value based on the following formula: B5(n) = max(0, c4(n) - 3 * sqrt(1 - c4(n)^2)), where c4(n) is defined as the cosine of n (in radians). Implement the function B5 to return the computed value for the given... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert B5(1) == 0.0\", \"assert B5(2) == 0.0\", \"assert B5(3) == 0.0\", \"assert B5(4) == 0.0\", \"assert B5(5) == 0.0\", \"assert B5(7) == 0.0\", \"assert B5(8) == 0.0\", \"assert B5(9) == 0.0\", \"assert B5(math.pi/2) == 0.0\", \"assert B5(math.pi) == 0.0\", \"a... | {
"split": "train",
"index": 4182,
"acecode_id": "bigcode_python_fns_24378",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing a variable with a key 'scale', which can have the value 'categorical' or 'numerical'. You are also given a list of values representing the data corresponding to that variable. Your task is to implement a function that returns a dictionary... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_value_counts({'scale': 'categorical'}, ['apple', 'banana', 'apple']) == {'apple': 2, 'banana': 1}\", \"assert get_value_counts({'scale': 'categorical'}, ['cat', 'dog', 'cat', 'cat', 'mouse']) == {'cat': 3, 'dog': 1, 'mouse': 1}\", \"assert get_value_coun... | {
"split": "train",
"index": 4183,
"acecode_id": "bigcode_python_fns_24447",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `process_numbers(nums: List[int]) -> List[int]` that processes the input list of numbers by performing the following operations: 1. Multiply each even number by 2. 2. Subtract 1 from each odd number. The function should return a new li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_numbers([1, 2, 3, 4]) == [0, 4, 2, 8]\", \"assert process_numbers([5, 10, 15, 20]) == [4, 20, 14, 40]\", \"assert process_numbers([0, -2, -3, -4]) == [0, -4, -4, -8]\", \"assert process_numbers([-1, -2, -3, -4, -5]) == [-2, -4, -4, -8, -6]\", \"asser... | {
"split": "train",
"index": 4184,
"acecode_id": "bigcode_python_fns_6691",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given the algebraic equation in the form of a string '5x - 12 = 8', write a function that computes the explicit numeric value of the variable 'x' by applying suitable mathematical operations. The input will always be a valid equation in this format, and your function should ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert solve_equation('5x - 12 = 8') == 4.0\", \"assert solve_equation('2x + 4 = 10') == 3.0\", \"assert solve_equation('3x - 9 = 0') == 3.0\", \"assert solve_equation('10x + 5 = 25') == 2.0\", \"assert solve_equation('6x - 18 = 0') == 3.0\", \"assert solve_equatio... | {
"split": "train",
"index": 4185,
"acecode_id": "evol_9476",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates a discount based on a social bonus in a billing system. The function takes three parameters: a fixed total amount (`termino_fijo_total`), a variable total amount (`termino_variable_total`), and a boolean (`con_bono_soc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_discount(100, 200, True) == -75\", \"assert calculate_discount(100, 200, False) == 0\", \"assert calculate_discount(0, 0, True) == 0\", \"assert calculate_discount(50, 50, True) == -25\", \"assert calculate_discount(10, 10, True) == -5\", \"assert ... | {
"split": "train",
"index": 4186,
"acecode_id": "oss_12133",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple chatbot system that processes user intents and generates appropriate responses. The chatbot system is designed to handle various intents and provide corresponding messages. Your task is to implement the function `process_intent(last_int... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_intent('OtherIntent') == ''\", \"assert process_intent('') == ''\", \"assert process_intent('SomeRandomIntent') == ''\", \"assert process_intent('AnotherIntent') == ''\", \"assert process_intent('IntentThatDoesNotMatter') == ''\", \"assert process_in... | {
"split": "train",
"index": 4187,
"acecode_id": "oss_13217",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of dictionaries representing rows in a table and a condition function. The function should return a new list of dictionaries that only includes rows that satisfy the condition function. The condition function takes a single row (dictionary... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_rows([], lambda row: row['age'] > 30) == []\", \"assert filter_rows([{'name': 'Alice', 'age': 25}, {'name': 'Bob', 'age': 30}], lambda row: row['age'] > 30) == []\", \"assert filter_rows([{'name': 'Alice', 'age': 25}, {'name': 'Bob', 'age': 32}], lamb... | {
"split": "train",
"index": 4188,
"acecode_id": "evol_18501",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing a serialized protocol buffer message of type 'Image'. This message contains encoded fields for width, height, pixel_format, step, and data. Your task is to implement a function `parse_image_message(serialized_message)` that takes a serialized mess... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_image_message(b'\\\\x01\\\\x00\\\\x00\\\\x00\\\\x02\\\\x00\\\\x00\\\\x00\\\\x03\\\\x00\\\\x00\\\\x00\\\\x04\\\\x00\\\\x00\\\\x00data') == {'width': 1, 'height': 2, 'pixel_format': 3, 'step': 4, 'data': b'data'}\", \"assert parse_image_message(b'\\\\x05... | {
"split": "train",
"index": 4189,
"acecode_id": "oss_22269",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the loading of a machine learning model based on specific parameters: `targets`, `model_name`, and `device`. The function should take in a list of targets (strings), a model name (string), and a device (string). The fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert load_model(['target1', 'target2'], 'umxhq', 'cpu') == 'Model loaded successfully'\", \"assert load_model(['target1', 'target2'], 'umxhq', 'gpu') == 'Model loaded successfully'\", \"assert load_model(['target1'], 'model_xyz', 'cpu') == 'Model not found'\", \"... | {
"split": "train",
"index": 4190,
"acecode_id": "bigcode_python_fns_14443",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a positive integer representing a population, implement a function `round_to_ten_thousand(num)` that rounds the population to the nearest ten thousand. For example, if the population is 836,527, the function should return 840,000.\nPlease reason step by step, then write a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert round_to_ten_thousand(836527) == 840000\", \"assert round_to_ten_thousand(123456) == 120000\", \"assert round_to_ten_thousand(49999) == 50000\", \"assert round_to_ten_thousand(50000) == 50000\", \"assert round_to_ten_thousand(60001) == 60000\", \"assert roun... | {
"split": "train",
"index": 4191,
"acecode_id": "evol_108",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `calculate(a: Union[int, float], b: Union[int, float], operation: str) -> Union[int, float]` that simulates basic calculator operations. The function should take two numbers `a` and `b`, and a string `operation` which can be one of the following: 'add', 'su... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate(1, 2, 'add') == 3\", \"assert calculate(5, 3, 'subtract') == 2\", \"assert calculate(2, 3, 'multiply') == 6\", \"assert calculate(6, 2, 'divide') == 3.0\", \"assert calculate(9, 0, 'square_root') == 3.0\", \"assert calculate(16, 0, 'square_root') =... | {
"split": "train",
"index": 4192,
"acecode_id": "evol_35481",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of unit names and their associated identifiers. Your task is to filter out unit names that are similar to each other based on the Levenshtein distance. Two unit names are considered similar if their Levenshtein distance is less than a specified maximum dist... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_unit_names([('UnitA', 1), ('UnitA', 2), ('UnitA', 3)]) == ['UnitA']\", \"assert filter_unit_names([('TestUnit', 1), ('TestUnit1', 2), ('TestUnit2', 3)]) == ['TestUnit']\", \"assert filter_unit_names([('Foo', 1), ('Fool', 2), ('Fools', 3), ('Fooled', 4... | {
"split": "train",
"index": 4193,
"acecode_id": "bigcode_python_fns_15181",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with analyzing geographical data represented as a list of points in a 2D plane. Your goal is to implement a function that takes a list of points and a distance threshold as input, and returns a list of pairs of points that are within the specified distance of eac... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_points_within_distance([(1, 2), (3, 4), (1, 3)], 2) == [((1, 2), (1, 3))]\", \"assert find_points_within_distance([(0, 0), (1, 1), (2, 2)], 1.5) == [((0, 0), (1, 1)), ((1, 1), (2, 2))]\", \"assert find_points_within_distance([(5, 5), (5, 5), (7, 8)], 3)... | {
"split": "train",
"index": 4194,
"acecode_id": "oss_4898",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that initializes a simple model configuration based on provided parameters. The function will receive the following parameters: \n- `model_name` (str): Name of the model to be used (e.g., 'SimpleCNN'). \n- `network_config` (dict): A dicti... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert init_model_config('SimpleCNN', {'layers': 3}, ['cat', 'dog'], {'token1': 0, 'token2': 1}) == {'model_name': 'SimpleCNN', 'network_config': {'layers': 3}, 'classes': ['cat', 'dog'], 'word_dict': {'token1': 0, 'token2': 1}, 'learning_rate': 0.0001, 'optimizer'... | {
"split": "train",
"index": 4195,
"acecode_id": "bigcode_python_fns_43701",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a recursive function that converts every alphabetical character in a given string to its uppercase representation while maintaining the position of any special characters and punctuation. The function should take a single string as input and return a new string with t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert uppercase_recursive('Hello, World and Python learners!') == 'HELLO, WORLD AND PYTHON LEARNERS!'\", \"assert uppercase_recursive('1234! test.') == '1234! TEST.'\", \"assert uppercase_recursive('abc!xyz') == 'ABC!XYZ'\", \"assert uppercase_recursive('') == ''\... | {
"split": "train",
"index": 4196,
"acecode_id": "evol_11148",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary representing user keys, implement a function `user_keys_to_json(user_keys: Dict[str, Any]) -> Dict[str, Any]` that transforms it into a standardized JSON format. The input dictionary will have the following keys: 'id', 'user_id', 'comment', 'authorized_key', ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert user_keys_to_json({'id': 1, 'user_id': 10, 'comment': 'Test key', 'authorized_key': 'ssh-rsa AAAAB...xyz', 'created_at': None, 'updated_at': None, 'deleted_at': None}) == {'id': 1, 'user_id': 10, 'comment': 'Test key', 'authorized_key': 'ssh-rsa AAAAB...xyz'... | {
"split": "train",
"index": 4197,
"acecode_id": "bigcode_python_fns_11626",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You have an initial power of `P`, an initial score of `0`, and a bag of `tokens` where `tokens[i]` is the value of the `ith` token (0-indexed). Your goal is to maximize your total score by potentially playing each token in one of two ways: If your current power is at least `tok... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bagOfTokensScore([100], 50) == 0\", \"assert bagOfTokensScore([100, 200], 150) == 1\", \"assert bagOfTokensScore([], 10) == 0\", \"assert bagOfTokensScore([50, 150, 200], 100) == 1\", \"assert bagOfTokensScore([100, 300, 200], 50) == 0\", \"assert bagOfToken... | {
"split": "train",
"index": 4198,
"acecode_id": "evol_33764",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes two integers as input and returns their sum. The function should handle both positive and negative integers. The function signature is as follows: `def sum_two_numbers(a: int, b: int) -> int:`. The input parameters are two ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_two_numbers(1, 2) == 3\", \"assert sum_two_numbers(-1, 1) == 0\", \"assert sum_two_numbers(-5, -10) == -15\", \"assert sum_two_numbers(100, 200) == 300\", \"assert sum_two_numbers(0, 0) == 0\", \"assert sum_two_numbers(-100, 100) == 0\", \"assert sum_two... | {
"split": "train",
"index": 4199,
"acecode_id": "bigcode_python_fns_3440",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.