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 list of tuples, where each tuple contains a package name (a string) and an environment object (which contains 'python_version' and 'operating_system' attributes). Your task is to group the environments by package name and return a list of tuples representing the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert build_missing_wheels([('pkg2', {'python_version': '3.8', 'operating_system': 'windows'})]) == ([('pkg2', {'python_version': '3.8', 'operating_system': 'windows'})], [])\", \"assert build_missing_wheels([('pkg3', {'python_version': '3.7', 'operating_system': ... | {
"split": "train",
"index": 74600,
"acecode_id": "bigcode_python_fns_35927",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given two strings s and t, implement a function that returns the longest palindromic substring found in the concatenated string of s and t. The function should handle case sensitivity and non-alphabetic characters. The concatenated string is formed by simply appending string t ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longest_palindrome('race', 'car') == 'racecar'\", \"assert longest_palindrome('a', 'b') == 'a'\", \"assert longest_palindrome('Noon', 'racecar') == 'racecar'\", \"assert longest_palindrome('aabb', 'ccdd') == 'aa'\", \"assert longest_palindrome('level', 'noon... | {
"split": "train",
"index": 74601,
"acecode_id": "evol_8401",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Create a function `get_location_details(ip_address: str) -> Union[Tuple[float, float, str, str, str], str]` that takes an IP address as input and returns a tuple containing the geographical coordinates (latitude and longitude), the region name, city name, and country name assoc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_location_details('192.168.1.1') == 'Unable to trace IP. It might be invalid or non-traceable.'\", \"assert get_location_details('invalid_ip') == 'Unable to trace IP. It might be invalid or non-traceable.'\", \"assert get_location_details('192.0.2.255') =... | {
"split": "train",
"index": 74602,
"acecode_id": "evol_27246",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a virtual data center (VDC) represented as a dictionary. The dictionary contains information about various virtual machines (vmachines) hosted in that data center. Your task is to implement a function that extracts and returns a list of vmachines from the given di... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert list_vmachines({'vmachines': [{'id': 1, 'name': 'VM1'}, {'id': 2, 'name': 'VM2'}]}) == [{'id': 1, 'name': 'VM1'}, {'id': 2, 'name': 'VM2'}]\", \"assert list_vmachines({'vmachines': []}) == []\", \"assert list_vmachines({'vmachines': [{'id': 3, 'name': 'VM3'}... | {
"split": "train",
"index": 74603,
"acecode_id": "bigcode_python_fns_39612",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `run_test_suite(main)` that takes a function `main` as a parameter and simulates the execution of a test suite. The `main` function contains a series of test cases. Your implementation should check for a variable named `err` within th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert run_test_suite(lambda: exec('err = None')) == 'Test suite completed without errors.'\", \"assert run_test_suite(lambda: exec('pass')) == 'Test suite completed without errors.'\", \"assert run_test_suite(lambda: exec('err = None')) == 'Test suite completed wi... | {
"split": "train",
"index": 74604,
"acecode_id": "oss_27886",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a counter that starts at 0. Implement a function `update_counter(events: List[Tuple[str, Optional[str]]]) -> int` that processes a list of events to update the counter's value based on specific rules. The events can be of two types: 'inc' (increment) and 'dec' (de... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_counter([('inc', None), ('inc', None), ('dec', None)]) == 1\", \"assert update_counter([('dec', None)]) == 0\", \"assert update_counter([('inc', None), ('dec', None), ('dec', None)]) == 0\", \"assert update_counter([('inc', None), ('ERR', None), ('dec... | {
"split": "train",
"index": 74605,
"acecode_id": "bigcode_python_fns_27710",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a URL mapping from a list of URL patterns for a web application. Each URL pattern consists of a name and an associated view class. Your task is to implement a function `generate_url_mapping(urlpatterns)` that takes a list of URL patterns as input an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_url_mapping([{'name': 'list', 'view_class': 'ProductCategoryUOMListView'}, {'name': 'add', 'view_class': 'ProductCategoryUOMCreateView'}, {'name': 'detail', 'view_class': None}]) == {'list': 'ProductCategoryUOMListView', 'add': 'ProductCategoryUOMCr... | {
"split": "train",
"index": 74606,
"acecode_id": "oss_33435",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple asynchronous task management system. The system will manage a set of tasks, each with its own priority level, and execute them based on their priority. The tasks are represented as strings that describe the task, a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert execute_tasks([('task1', 2), ('task2', 1), ('task3', 3)]) == ['task3', 'task1', 'task2']\", \"assert execute_tasks([('taskA', 1), ('taskB', 2), ('taskC', 2), ('taskD', 3)]) == ['taskD', 'taskB', 'taskC', 'taskA']\", \"assert execute_tasks([('task1', 0)]) == ... | {
"split": "train",
"index": 74607,
"acecode_id": "oss_25919",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the total entropy of a given text message based on a predefined language model. The entropy is a measure of uncertainty or randomness in a message, defined as the sum of the negative logarithm (base 2) of the probabili... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_entropy('hello world', {'hello': 0.5, 'world': 0.5}) == 2.0\", \"assert calculate_entropy('hello', {'hello': 0.5}) == 1.0\", \"assert calculate_entropy('test message', {'test': 0.1, 'message': 0.1}) == 6.643856189774724\", \"assert calculate_entrop... | {
"split": "train",
"index": 74608,
"acecode_id": "oss_26728",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a travel agency's itinerary management. The function takes a destination as input and returns a predefined list of itineraries for that destination. You are provided with the following destinations and their corresponding i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_itineraries('Sicily') == ['Visit Palermo', 'Explore Mount Etna', 'Relax at Taormina']\", \"assert get_itineraries('Hawaii') == ['Snorkeling in Hanauma Bay', 'Hiking Diamond Head', 'Visiting Pearl Harbor']\", \"assert get_itineraries('Japan') == ['Explore... | {
"split": "train",
"index": 74609,
"acecode_id": "oss_23526",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `s` and an integer `k`, write a function `rearrange(s: str, k: int) -> str` that rearranges the characters of `s` such that no two identical characters are adjacent to each other with a minimum gap of `k`. If it is impossible to rearrange the string to meet this ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rearrange('aaabc', 3) == ''\", \"assert rearrange('abc', 1) == 'abc'\", \"assert rearrange('aa', 1) == ''\", \"assert rearrange('a', 0) == 'a'\", \"assert rearrange('abcd', 4) == 'abcd'\", \"assert rearrange('aabbccdd', 1) == 'abcdabcd'\", \"assert rearrange... | {
"split": "train",
"index": 74610,
"acecode_id": "evol_21701",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple blockchain simulation. Your goal is to create a function `is_block_valid(block_data: dict) -> bool` that checks if the given block data is valid. The block data is considered valid if it contains the keys 'block_hash' and 'transactions'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_block_valid({'block_hash': '0x1234567890abcdef', 'transactions': []}) == False\", \"assert is_block_valid({'block_hash': '0x1234567890abcdef', 'transactions': ['tx1', 'tx2']}) == True\", \"assert is_block_valid({'block_hash': '0xabcdef1234567890', 'transa... | {
"split": "train",
"index": 74611,
"acecode_id": "oss_8128",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of 3D points represented as tuples (x, y, z), convert these Cartesian coordinates into spherical coordinates (theta, phi) and the radial distance r. The spherical coordinates are defined as follows: theta is the angle in the x-y plane from the positive x-axis, and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cartesian_to_spherical([(1, 0, 0)]) == [(0.0, 1.5707963267948966, 1.0)]\", \"assert cartesian_to_spherical([(0, 1, 0)]) == [(1.5707963267948966, 1.5707963267948966, 1.0)]\", \"assert cartesian_to_spherical([(0, 0, 1)]) == [(0.0, 0.0, 1.0)]\", \"assert cartes... | {
"split": "train",
"index": 74612,
"acecode_id": "bigcode_python_fns_12589",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Create a Python function that takes a list of floating point numbers as input and returns a new list containing those numbers sorted in descending order.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_desc([8.9, 1.3, 2.6, 7.1, 3.4, 5.0]) == [8.9, 7.1, 5.0, 3.4, 2.6, 1.3]\", \"assert sort_desc([5.5, 3.3, 9.9, 1.1]) == [9.9, 5.5, 3.3, 1.1]\", \"assert sort_desc([-1.0, -5.5, 0.0, 2.2]) == [2.2, 0.0, -1.0, -5.5]\", \"assert sort_desc([0.3, 0.2, 0.1]) == ... | {
"split": "train",
"index": 74613,
"acecode_id": "evol_23166",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates capturing images at specified intervals from a virtual rendering environment. The function should take in a list of intervals (in milliseconds) and a filename, and it should return a list of filenames indicating the ima... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert capture_images([], 'output') == []\", \"assert capture_images([50], 'output') == ['image_0.png']\", \"assert capture_images([10, 15, 20, 25], 'output') == ['image_0.png', 'image_1.png', 'image_2.png', 'image_3.png']\", \"assert capture_images([0], 'output') ... | {
"split": "train",
"index": 74614,
"acecode_id": "oss_13969",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that determines the scope and reuse flag for a given network and layer configuration. The function should take three parameters: an integer `network_id`, an integer `layer_id`, and an integer `num_separate_layers`. The rules for determini... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_scope_and_reuse_disc(1, 0, 3) == ('d1_encoder_0', False)\", \"assert get_scope_and_reuse_disc(1, 1, 3) == ('d1_encoder_1', False)\", \"assert get_scope_and_reuse_disc(1, 2, 3) == ('d1_encoder_2', False)\", \"assert get_scope_and_reuse_disc(1, 3, 3) == ('... | {
"split": "train",
"index": 74615,
"acecode_id": "bigcode_python_fns_49009",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_prime_factor_dict(numbers: tuple) -> dict` that takes a tuple of integers and returns a dictionary where each integer from the tuple is a key, and its value is the count of distinct prime factors of that integer. You must implement a custom prime fa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_prime_factor_dict((4, 7, 9, 11)) == {4: 1, 7: 1, 9: 1, 11: 1}\", \"assert create_prime_factor_dict((10, 15, 21)) == {10: 2, 15: 2, 21: 2}\", \"assert create_prime_factor_dict((1, 2, 3, 4, 5)) == {1: 0, 2: 1, 3: 1, 4: 1, 5: 1}\", \"assert create_prime_... | {
"split": "train",
"index": 74616,
"acecode_id": "evol_28077",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing room entities in a smart home system. Each room has a unique identifier and a name. Your task is to implement a function `get_room_details(room_name: str, unique_id: str) -> dict` that takes the name of the room and its unique identifier as input an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_room_details('Living Room', 'LR001') == {'room_name': 'Living Room', 'unique_id': 'LR001'}\", \"assert get_room_details('Kitchen', 'K001') == {'room_name': 'Kitchen', 'unique_id': 'K001'}\", \"assert get_room_details('Bedroom', 'B002') == {'room_name': '... | {
"split": "train",
"index": 74617,
"acecode_id": "oss_10044",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a model configuration for a deep learning architecture known as PyramidNet. The function should accept an integer parameter `classes` which represents the number of classification classes (with a default value of 100). It s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pyramidnet_config(100) == {'blocks': 110, 'alpha': 84, 'bottleneck': False, 'classes': 100}\", \"assert pyramidnet_config(10) == {'blocks': 110, 'alpha': 84, 'bottleneck': False, 'classes': 10}\", \"assert pyramidnet_config(50) == {'blocks': 110, 'alpha': 84... | {
"split": "train",
"index": 74618,
"acecode_id": "bigcode_python_fns_31330",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `cyrillic_text` that may contain characters from the Cyrillic alphabet, convert it to its Latin equivalent using specific transliteration rules. The conversion only applies to characters from the Cyrillic subset of Unicode, and any unknown characters should remai... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cyrillic_to_latin('\\u041f\\u0440\\u0438\\u0432\\u0435\\u0442') == 'Privet'\", \"assert cyrillic_to_latin('\\u041c\\u0438\\u0440') == 'Mir'\", \"assert cyrillic_to_latin('\\u041a\\u0430\\u043a \\u0434\\u0435\\u043b\\u0430?') == 'Kak dela?'\", \"assert cyrill... | {
"split": "train",
"index": 74619,
"acecode_id": "bigcode_python_fns_3842",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the order of various steps in a process. Your task is to write a function that receives this list and returns a new list containing only the steps that have a valid order (i.e., not None) sorted in ascending order. If there are no v... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_and_sort_steps([3, 1, 2, None, 5]) == [1, 2, 3, 5]\", \"assert filter_and_sort_steps([None, None, None]) == []\", \"assert filter_and_sort_steps([4, 2, None, 1]) == [1, 2, 4]\", \"assert filter_and_sort_steps([None]) == []\", \"assert filter_and_sort_... | {
"split": "train",
"index": 74620,
"acecode_id": "bigcode_python_fns_7269",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `sum_of_squares_of_primes(lower: int, upper: int) -> int` that calculates the summation of squares of all prime numbers in the inclusive range between `lower` and `upper`. The function should return the total sum of squares of these prime numbers.\nPlease reaso... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_squares_of_primes(1, 10) == 87\", \"assert sum_of_squares_of_primes(11, 11) == 121\", \"assert sum_of_squares_of_primes(2, 2) == 4\", \"assert sum_of_squares_of_primes(5, 5) == 25\", \"assert sum_of_squares_of_primes(10, 10) == 0\", \"assert sum_of_sq... | {
"split": "train",
"index": 74621,
"acecode_id": "evol_3893",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a list of event strings, each representing an event with a unique identifier (UID). Each event can have multiple instances, and you need to remove a specific instance of an event given its UID and the date of the instance to be removed. After removing the instance... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_event_instance(['UID:event1', 'UID:event2'], 'event1', '20230101T120000') == ['UID:event1', 'UID:event2']\", \"assert remove_event_instance(['UID:event1', 'UID:event2', 'UID:event3'], 'event4', '20230101T120000') == ['UID:event1', 'UID:event2', 'UID:e... | {
"split": "train",
"index": 74622,
"acecode_id": "bigcode_python_fns_23591",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function `calculate_weighted_sum(arr)` that takes a list of integers `arr` and returns the weighted sum of the elements, where each element is multiplied by its index in the list. The function should ignore the effect of any negative indices, meaning the first eleme... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_weighted_sum([0]) == 0\", \"assert calculate_weighted_sum([1, 2, 3, 4]) == 20\", \"assert calculate_weighted_sum([]) == 0\", \"assert calculate_weighted_sum([1, 1, 1, 1]) == 6\", \"assert calculate_weighted_sum([0, 0, 0]) == 0\", \"assert calculate... | {
"split": "train",
"index": 74623,
"acecode_id": "evol_14813",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D list 'board_matrix' that represents a grid where each cell can contain different characters. Among these characters, one specific character 'mh' represents the head of a snake. Your task is to implement a function 'head_finder(board_matrix)' that finds the co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert head_finder([['.', '.', '.'], ['.', 'mh', '.'], ['.', '.', '.']]) == [1, 1]\", \"assert head_finder([['.', '.', '.'], ['.', '.', '.'], ['.', '.', 'mh']]) == [2, 2]\", \"assert head_finder([['.', '.', '.'], ['.', '.', '.'], ['.', '.', '.']]) == [-1, -1]\", \"... | {
"split": "train",
"index": 74624,
"acecode_id": "bigcode_python_fns_45965",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the Jaccard similarity coefficient between two given sentences. The Jaccard similarity is defined as the size of the intersection divided by the size of the union of the sample sets. Your implementation should handle corner cases such as emp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_jaccard_sim('', '') == 1.0\", \"assert calculate_jaccard_sim('the quick brown fox', 'the quick brown fox') == 1.0\", \"assert calculate_jaccard_sim('abc', 'abc') == 1.0\", \"assert calculate_jaccard_sim('hello', 'world') == 0.0\", \"assert calculat... | {
"split": "train",
"index": 74625,
"acecode_id": "evol_24989",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a binary tree represented as a nested dictionary, implement a function `count_leaf_nodes(node)` that calculates the number of leaf nodes in the tree. A leaf node is defined as a node that does not have any children (i.e., both left and right children are None). The tree s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_leaf_nodes(None) == 0\", \"assert count_leaf_nodes({'data': 1, 'left': None, 'right': None}) == 1\", \"assert count_leaf_nodes({'data': 1, 'left': {'data': 2, 'left': None, 'right': None}, 'right': {'data': 3, 'left': None, 'right': None}}) == 2\", \"a... | {
"split": "train",
"index": 74626,
"acecode_id": "evol_35571",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Write a function `generate_password(length: int) -> str` that produces a secure password consisting of an arbitrary combination of alphanumeric and special characters. The length of the password must be at least 10 characters. If the provided length is less than 10, the functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_password(10) != ''\", \"assert len(generate_password(10)) == 10\", \"assert generate_password(11) != ''\", \"assert len(generate_password(11)) == 11\", \"assert generate_password(12) != ''\", \"assert len(generate_password(12)) == 12\", \"assert gen... | {
"split": "train",
"index": 74627,
"acecode_id": "evol_12876",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string `s` consisting only of the characters 'L' and 'R'. A balanced string is defined as one where there is an equal number of 'L' and 'R' characters. Your task is to write a function `balancedStringSplit` that returns the maximum number of balanced strings tha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert balancedStringSplit('RLRRLLRLRL') == 4\", \"assert balancedStringSplit('LLRR') == 1\", \"assert balancedStringSplit('RLRRRLLRLL') == 2\", \"assert balancedStringSplit('RLLR') == 2\", \"assert balancedStringSplit('R') == 0\", \"assert balancedStringSplit('L')... | {
"split": "train",
"index": 74628,
"acecode_id": "oss_26595",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with converting a given number of seconds into a formatted string that represents the equivalent time in hours, minutes, and seconds. Implement a function that takes a non-negative integer representing seconds and returns a string formatted as 'Xh YYm ZZs', where... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_sec_to_hms(0) == '0h 00m 00s'\", \"assert format_sec_to_hms(59) == '0h 00m 59s'\", \"assert format_sec_to_hms(60) == '0h 01m 00s'\", \"assert format_sec_to_hms(3600) == '1h 00m 00s'\", \"assert format_sec_to_hms(3661) == '1h 01m 01s'\", \"assert forma... | {
"split": "train",
"index": 74629,
"acecode_id": "bigcode_python_fns_10416",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `get_status_message(status: int) -> str` that takes an integer `status` as input and returns a corresponding status message based on the following rules: \n\n- If the status is 0, return 'Success'. \n- If the status is 1, return 'Warning'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_status_message(0) == 'Success'\", \"assert get_status_message(1) == 'Warning'\", \"assert get_status_message(2) == 'Error'\", \"assert get_status_message(-1) == 'Unknown Status'\", \"assert get_status_message(3) == 'Unknown Status'\", \"assert get_status... | {
"split": "train",
"index": 74630,
"acecode_id": "bigcode_python_fns_39448",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that converts a given integer into its English word representation. For example, the integer 123 would be converted to 'one hundred twenty three'. The function should support integers within the range of 0 to 999,999,999,999 (inclusiv... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert int_to_english(0) == 'zero'\", \"assert int_to_english(1) == 'one'\", \"assert int_to_english(10) == 'ten'\", \"assert int_to_english(15) == 'fifteen'\", \"assert int_to_english(21) == 'twenty one'\", \"assert int_to_english(99) == 'ninety nine'\", \"assert ... | {
"split": "train",
"index": 74631,
"acecode_id": "oss_13339",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of issues represented as dictionaries, each containing 'title', 'body', 'number', and 'total_subscribers', write a function `get_random_issues(issues: List[Dict[str, Union[str, int]]]) -> List[Dict[str, Union[str, int]]]` that selects 2 random issues from the list.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_random_issues([{'title': 'Issue 1', 'body': 'Description 1', 'number': 1, 'total_subscribers': 5}, {'title': 'Issue 2', 'body': 'Description 2', 'number': 2, 'total_subscribers': 10}]) in [[{'title': 'Issue 1', 'body': 'Description 1', 'number': 1, 'tota... | {
"split": "train",
"index": 74632,
"acecode_id": "bigcode_python_fns_42733",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given the lengths of the three sides of a triangle, write a function that calculates and returns the area of the triangle. You may assume that the input lengths are valid and will always form a triangle. The function signature is: def calculate_area(a: int, b: int, c: int) -> f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_area(3, 4, 5) == 6.0\", \"assert calculate_area(7, 8, 9) == 26.832815729997478\", \"assert calculate_area(10, 10, 10) == 43.30127018922193\", \"assert calculate_area(6, 8, 10) == 24.0\", \"assert calculate_area(5, 12, 13) == 30.0\", \"assert calcul... | {
"split": "train",
"index": 74633,
"acecode_id": "evol_20493",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given the root of a binary tree, return its nodes' values in a list following the in-order traversal approach without using recursion or a stack. You can assume that each node in the tree contains a unique integer value. The binary tree is defined by the following structure: ea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert morris_traversal(Node(1)) == [1]\", \"assert morris_traversal(Node(2, Node(1), Node(3))) == [1, 2, 3]\", \"assert morris_traversal(Node(4, Node(2, Node(1), Node(3)), Node(5))) == [1, 2, 3, 4, 5]\", \"assert morris_traversal(Node(4, Node(2), Node(6, Node(5), ... | {
"split": "train",
"index": 74634,
"acecode_id": "bigcode_python_fns_15108",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `text` and an integer `width`, implement a function `wrap_text` that wraps the given string at the specified width. The function should return a new string where each line contains at most `width` characters, breaking the text into multiple lines as necessary. If... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert wrap_text('Short text.', 100) == 'Short text.'\", \"assert wrap_text('', 10) == ''\", \"assert wrap_text('Wrap me!', 0) == ''\", \"assert wrap_text('Wrap me!', -5) == ''\", \"assert wrap_text('One more test case for you.', 30) == 'One more test case for you.... | {
"split": "train",
"index": 74635,
"acecode_id": "bigcode_python_fns_30406",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of integers as input and returns a new list containing only the unique integers from the original list, preserving their original order. The function should remove any duplicates while maintaining the sequence of their f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_duplicates([1, 2, 3, 2, 1, 4]) == [1, 2, 3, 4]\", \"assert remove_duplicates([5, 5, 5, 5]) == [5]\", \"assert remove_duplicates([-1, -2, -1, -3, -2]) == [-1, -2, -3]\", \"assert remove_duplicates([0, 0, 0, 1, 1, 2]) == [0, 1, 2]\", \"assert remove_dup... | {
"split": "train",
"index": 74636,
"acecode_id": "bigcode_python_fns_2609",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with updating a configuration dictionary that contains a path for processing state files. The dictionary has a key `DATA_CONVERSION_SUBSYSTEM_STATE_FILES_ROOT_FOLDER` which holds the path string, and a key `ID_WILDCARD_PATTERN` which holds a pattern string used f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_config({'DATA_CONVERSION_SUBSYSTEM_STATE_FILES_ROOT_FOLDER': 'C:/files/abc_{ID_WILDCARD_PATTERN}', 'ID_WILDCARD_PATTERN': '{ID_WILDCARD_PATTERN}'}, 1) == {'DATA_CONVERSION_SUBSYSTEM_STATE_FILES_ROOT_FOLDER': 'C:/files/abc_', 'ID_WILDCARD_PATTERN': '{I... | {
"split": "train",
"index": 74637,
"acecode_id": "oss_18614",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D array of integers representing labels in an image, where 0 indicates the background. Your task is to merge labels that are below a specified minimum size with their connected neighbors. The connectivity can be either 4 or 8. If a label has no connected neighb... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_labels_below_minsize([[1, 1, 0], [0, 0, 0], [2, 2, 2]], 1, 8) == [[1, 1, 0], [0, 0, 0], [2, 2, 2]]\", \"assert merge_labels_below_minsize([[1, 1, 2], [1, 0, 2], [3, 3, 3]], 2, 4) == [[1, 1, 2], [1, 0, 2], [3, 3, 3]]\", \"assert merge_labels_below_minsi... | {
"split": "train",
"index": 74638,
"acecode_id": "bigcode_python_fns_36784",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that modifies an IP address based on certain conditions. The function takes two parameters: `ip`, a string representing an IP address in the format 'x.x.x.x', and `mac`, a boolean value indicating whether a MAC address is present. If ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert modify_ip('192.168.0.100', True) == '192.168.0.1'\", \"assert modify_ip('10.0.0.1', False) == '10.0.0.1'\", \"assert modify_ip('172.16.0.254', True) == '172.16.0.1'\", \"assert modify_ip('192.168.1.1', None) == '192.168.1.1'\", \"assert modify_ip('255.255.25... | {
"split": "train",
"index": 74639,
"acecode_id": "oss_10866",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a function that simulates a primary mouse click at the current mouse pointer location. The click is represented by two boolean values: 'primaryDown' indicating that the primary button is pressed down, and 'primaryUp' indicating that the primary button is released.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_primary_click(True, True) == 'Click successful'\", \"assert simulate_primary_click(True, False) == 'Click failed'\", \"assert simulate_primary_click(False, True) == 'Click failed'\", \"assert simulate_primary_click(False, False) == 'Click failed'\",... | {
"split": "train",
"index": 74640,
"acecode_id": "bigcode_python_fns_17800",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `add(x: int, y: int) -> int` that takes two integers `x` and `y` as input and returns their sum.\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 add(1, 1) == 2\", \"assert add(0, 0) == 0\", \"assert add(-1, 1) == 0\", \"assert add(-5, -5) == -10\", \"assert add(100, 200) == 300\", \"assert add(50, 50) == 100\", \"assert add(123456, 654321) == 777777\", \"assert add(999, 1) == 1000\", \"assert add(-10... | {
"split": "train",
"index": 74641,
"acecode_id": "evol_1022",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an array of non-negative integers, `nums`. Define a number `x` to be special if exactly `x` numbers in `nums` are greater than or equal to `x`. Your task is to implement the function `specialNumber(nums)` that returns the special number `x` if it exists, or `-1` i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert specialNumber([3, 5]) == 2\", \"assert specialNumber([0, 0]) == -1\", \"assert specialNumber([0, 4, 3, 0, 4]) == 3\", \"assert specialNumber([3, 6, 7, 7, 0]) == -1\", \"assert specialNumber([1, 2, 3]) == 2\", \"assert specialNumber([0]) == -1\", \"assert spe... | {
"split": "train",
"index": 74642,
"acecode_id": "evol_32569",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a list of elements, which may include nested lists, write a function `count_total_elements` that returns the total number of elements in the list, including those within any nested lists. The function should accept a single parameter: `input_list`, which is a list that ca... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_total_elements([1, 2, [3, 4, [5, 6]], 7, [8, [9, 10]]]) == 10\", \"assert count_total_elements([]) == 0\", \"assert count_total_elements([1, [2, [3]], 4]) == 4\", \"assert count_total_elements([1, 2, 3]) == 3\", \"assert count_total_elements([[1, 2], [... | {
"split": "train",
"index": 74643,
"acecode_id": "oss_11062",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the results of a series of experiments. Each experiment can either result in a positive integer or a negative integer. Your task is to find the first positive integer in the list. If there are no positive integers in the list, retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_first_positive_integer([3, -5, 2, -8, 7, -1]) == 3\", \"assert find_first_positive_integer([-4, -6, -2, -8, -7, -1]) == 'guh'\", \"assert find_first_positive_integer([0, 0, 0, 1]) == 1\", \"assert find_first_positive_integer([-1, -2, -3, 4]) == 4\", \"a... | {
"split": "train",
"index": 74644,
"acecode_id": "oss_5259",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates applying a specified color to a given text using color codes in hexadecimal format. Your function should take two parameters: a string `text` and a string `color` in the format `#xxxxxx` (where `x` represents a hexadecimal ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert apply_color('Hello, World!', '#FF5733') == '\\\\033[38;2;255;87;51mHello, World!\\\\033[0m'\", \"assert apply_color('Test', '#00FF00') == '\\\\033[38;2;0;255;0mTest\\\\033[0m'\", \"assert apply_color('Sample Text', '#0000FF') == '\\\\033[38;2;0;0;255mSample ... | {
"split": "train",
"index": 74645,
"acecode_id": "oss_6343",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of words, write a function that returns every distinct permutation of the words in the list. Each permutation should be represented as a list of words. The input list may contain duplicates, and you should ensure that the output only includes unique permutations. F... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert permute_words(['a', 'a', 'b']) == [['a', 'a', 'b'], ['a', 'b', 'a'], ['b', 'a', 'a']]\", \"assert permute_words(['a']) == [['a']]\", \"assert permute_words([]) == [[]]\", \"assert permute_words(['test', 'test', 'test']) == [['test', 'test', 'test']]\", \"ass... | {
"split": "train",
"index": 74646,
"acecode_id": "evol_13873",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a prefix expression consisting of single-letter operands (A-Z), digits (0-9), and operators (+, -, *, /), convert it to a postfix expression. The input expression is guaranteed to be well-formed and space-separated. Implement the function `prefix_to_postfix(expression: st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert prefix_to_postfix('+ A B') == 'A B +'\", \"assert prefix_to_postfix('- A B') == 'A B -'\", \"assert prefix_to_postfix('* A B') == 'A B *'\", \"assert prefix_to_postfix('/ A B') == 'A B /'\", \"assert prefix_to_postfix('/ + A B - C D') == 'A B + C D - /'\", \... | {
"split": "train",
"index": 74647,
"acecode_id": "evol_30649",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing codes, write a function that returns a list of unique codes that appear exactly once in the input list. The output list should be sorted in ascending order. For example, if the input list is [1, 2, 2, 3, 4, 4, 5], the output should be [1, 3... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_codes([1, 2, 2, 3, 4, 4, 5]) == [1, 3, 5]\", \"assert unique_codes([1, 1, 2, 3, 3, 4]) == [2, 4]\", \"assert unique_codes([5, 5, 5, 5]) == []\", \"assert unique_codes([10, 10, 10, 20, 30, 30]) == [20]\", \"assert unique_codes([7, 8, 9, 7, 8]) == [9]\"... | {
"split": "train",
"index": 74648,
"acecode_id": "bigcode_python_fns_48358",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of file names along with their corresponding file types (either 'xlsx' or 'csv'), write a function `get_file_contents(file_names: List[str], file_types: List[str]) -> Dict[str, Any]` that simulates reading the contents of these files. The function should return a d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_file_contents(['data1', 'data2', 'data3'], ['xlsx', 'csv', 'txt']) == {'data1': 'Excel data from data1', 'data2': 'CSV data from data2', 'data3': 'Unknown file type for data3'}\", \"assert get_file_contents(['file1', 'file2'], ['xlsx', 'xlsx']) == {'file... | {
"split": "train",
"index": 74649,
"acecode_id": "bigcode_python_fns_40748",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the geometric mean of a list of positive numbers. If the list is empty or contains any non-positive numbers (zero or negative), return an error message indicating the issue. The function should take a single parameter, a list of numbers, and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert geometric_mean([10, 100]) == 31.622776601683793\", \"assert geometric_mean([3]) == 3.0\", \"assert geometric_mean([]) == 'Error: The list is empty.'\", \"assert geometric_mean([2, 2, 2]) == 2.0\", \"assert geometric_mean([1, 1, 1, 1]) == 1.0\", \"assert geom... | {
"split": "train",
"index": 74650,
"acecode_id": "evol_33023",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with converting a simple neural network represented as a list of layers into an ONNX-like structure. Each layer is represented as a dictionary containing the layer's name and its type. Your goal is to implement a function `convert_to_onnx(layers)` that takes a li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_onnx([{'name': 'input', 'type': 'InputLayer'}, {'name': 'dense', 'type': 'DenseLayer'}]) == {'layers': ['input', 'dense'], 'type_mapping': {'input': 'InputLayer', 'dense': 'DenseLayer'}}\", \"assert convert_to_onnx([{'name': 'conv1', 'type': 'Conv... | {
"split": "train",
"index": 74651,
"acecode_id": "oss_9841",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer n_grobs representing the number of images to be organized, and two optional integers nrow and ncol representing the desired number of rows and columns respectively, implement a function that returns a tuple (nrow, ncol) such that the product of nrow and ncol is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_dimensions(10) == (4, 3)\", \"assert check_dimensions(5) == (3, 2)\", \"assert check_dimensions(12, 3, None) == (3, 4)\", \"assert check_dimensions(7, None, 3) == (3, 3)\", \"assert check_dimensions(15, None, None) == (4, 4)\", \"assert check_dimension... | {
"split": "train",
"index": 74652,
"acecode_id": "bigcode_python_fns_18763",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of floating-point numbers representing partial charges and a floating-point number representing energy. Your task is to implement a function that calculates the total charge and the average energy from the provided inputs. The function should return a tuple... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_charge_and_average_energy([1.0, 2.0, -1.0], 5.0) == (2.0, 5.0)\", \"assert calculate_total_charge_and_average_energy([], 10.0) == (0.0, 0.0)\", \"assert calculate_total_charge_and_average_energy([-2.0, -3.0], 0.0) == (-5.0, 0.0)\", \"assert c... | {
"split": "train",
"index": 74653,
"acecode_id": "bigcode_python_fns_24550",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a command for a program. Your task is to check whether the command is valid or not. A valid command must start with 'run_' and can only contain alphanumeric characters and underscores. Implement a function that takes a single string command a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_command('run_sht_rudeadyet') == True\", \"assert is_valid_command('run_test123') == True\", \"assert is_valid_command('run_abc_def_ghi') == True\", \"assert is_valid_command('sht_rudeadyet') == False\", \"assert is_valid_command('123_run_test') == F... | {
"split": "train",
"index": 74654,
"acecode_id": "bigcode_python_fns_41467",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates the behavior of an energy reserve system for a single energy site. Your function, `get_backup_reserve_percent`, should accept a list of energy sites and return the backup reserve percentage of the first energy site i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_backup_reserve_percent([]) == 0\", \"assert get_backup_reserve_percent([10]) == 10\", \"assert get_backup_reserve_percent([20, 30]) == 20\", \"assert get_backup_reserve_percent([5, 15, 25]) == 5\", \"assert get_backup_reserve_percent([100, 0, 50]) == 100... | {
"split": "train",
"index": 74655,
"acecode_id": "oss_22547",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two tuples that may not necessarily have the same number of elements, your task is to create a function that generates a dictionary using these two tuples only if they have the same number of elements. If the tuples do not have the same number of elements, the function sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_dictionary(('apple', 'banana'), ('fruit', 'tasty')) == {'apple': 'fruit', 'banana': 'tasty'}\", \"assert create_dictionary(('apple', 'banana', 'cherry'), ('fruit', 'tasty')) == 'Error: The tuples do not have the same number of elements.'\", \"assert c... | {
"split": "train",
"index": 74656,
"acecode_id": "evol_570",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple animation system for a game. The animation system consists of an animation timer that keeps track of the current frame of an animation based on a specified update interval and total duration. You need to implement a function `getCurrent... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert getCurrentFrame(100, 1000, 500) == 5\", \"assert getCurrentFrame(200, 1000, 500) == 2\", \"assert getCurrentFrame(100, 1000, 0) == 0\", \"assert getCurrentFrame(0, 1000, 500) == -1\", \"assert getCurrentFrame(100, -1000, 500) == 0\", \"assert getCurrentFrame... | {
"split": "train",
"index": 74657,
"acecode_id": "oss_2524",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that takes a string input representing a title and returns a formatted string based on the given title. The output should include the title in uppercase letters followed by the length of the title in parentheses. For example, if th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_title('example') == 'EXAMPLE (7)'\", \"assert format_title('leetcode') == 'LEETCODE (8)'\", \"assert format_title('python') == 'PYTHON (6)'\", \"assert format_title('') == 'EMPTY TITLE (0)'\", \"assert format_title('OpenAI') == 'OPENAI (6)'\", \"asser... | {
"split": "train",
"index": 74658,
"acecode_id": "oss_11449",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that determines the command prefix for a server based on its ID. The command prefix can vary from server to server and is represented in a dictionary format within the function. Your task is to create a function `get_prefix(server_id)... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_prefix('server1_id') == '$'\", \"assert get_prefix('server2_id') == '!'\", \"assert get_prefix('server3_id') == '.'\", \"assert get_prefix('unknown_server_id') == '!'\", \"assert get_prefix('server1_id') == '$'\", \"assert get_prefix('server3_id') == '.'... | {
"split": "train",
"index": 74659,
"acecode_id": "oss_20271",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function that takes an integer 'n' as input and returns a list of perfect numbers and a list of amicable pairs from 1 to 'n'. Perfect numbers are defined as positive integers that are equal to the sum of their proper divisors, excluding themselves. Amicable pairs are t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_numbers(1) == ([], [])\", \"assert find_numbers(2) == ([], [])\", \"assert find_numbers(6) == ([6], [])\", \"assert find_numbers(10) == ([6], [])\", \"assert find_numbers(300) == ([6, 28], [(220, 284)])\", \"assert find_numbers(15) == ([6], [])\", \"ass... | {
"split": "train",
"index": 74660,
"acecode_id": "evol_34113",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that determines the type of a compressed file based on its initial bytes. Given a bytes object representing the first few bytes of a file, your function should return a string indicating the type of the archive: 'gz' for gzip files, 'bz2'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert determine_archive_type(b'\\\\x1f\\\\x8b\\\\x08') == 'gz'\", \"assert determine_archive_type(b'\\\\x42\\\\x5a\\\\x68') == 'bz2'\", \"assert determine_archive_type(b'\\\\x50\\\\x4b\\\\x03\\\\x04') == 'zip'\", \"assert determine_archive_type(b'\\\\x00\\\\x00\\\... | {
"split": "train",
"index": 74661,
"acecode_id": "bigcode_python_fns_15287",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Write a function `generate_random_string(length: int) -> str` that generates a random string composed of a sequence of alphanumeric characters (both uppercase and lowercase letters, and digits) of a specified length. The default length of the string should be 12 characters. The... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_random_string(12) != generate_random_string(12)\", \"assert len(generate_random_string(12)) == 12\", \"assert all(c.isalnum() for c in generate_random_string(12))\", \"assert len(generate_random_string(0)) == 0\", \"assert len(generate_random_string... | {
"split": "train",
"index": 74662,
"acecode_id": "evol_25204",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a cluster specification represented as a dictionary containing the number of 'chief' and 'worker' tasks, and an integer representing the number of GPUs per worker, implement a function `generate_device_list(cluster_spec: Dict[str, List[int]], num_gpus_per_worker: int) -> ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_device_list({'chief': [0], 'worker': [0]}, 0) == ['/job:chief/task:0', '/job:worker/task:0']\", \"assert generate_device_list({'chief': [0], 'worker': [0]}, 1) == ['/job:chief/task:0/device:GPU:0', '/job:worker/task:0/device:GPU:0']\", \"assert gene... | {
"split": "train",
"index": 74663,
"acecode_id": "bigcode_python_fns_15959",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `argmin` that returns the index of the smallest element in the list. If there are multiple occurrences of the smallest element, return the index of the first occurrence. The input list will contain at least one integer. The function sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert argmin([10, 20, 5, 30]) == 2\", \"assert argmin([-1, -2, -3, -2]) == 2\", \"assert argmin([0, 0, 0, 0]) == 0\", \"assert argmin([5]) == 0\", \"assert argmin([1, 2, 3, 4, 0]) == 4\", \"assert argmin([7, 8, 9, 6, 5]) == 4\", \"assert argmin([5, 5, 5, 2, 5]) ==... | {
"split": "train",
"index": 74664,
"acecode_id": "bigcode_python_fns_29914",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries, where each dictionary contains information about agricultural data. Each dictionary has three keys: 'subcategory', 'year', and 'yield_kg_per_head'. Your task is to implement a function, `generate_json_visualizations(data)`, that processes t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_json_visualizations([{'subcategory': 'Crops', 'year': 2020, 'yield_kg_per_head': 250}, {'subcategory': 'Crops', 'year': 2021, 'yield_kg_per_head': 300}]) == {'Crops': [(2020, 250), (2021, 300)]}\", \"assert generate_json_visualizations([{'subcategor... | {
"split": "train",
"index": 74665,
"acecode_id": "oss_12108",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `roundValue` that takes three parameters: a value which can be a float or a dictionary, an integer representing the number of decimal places to round to, and an optional string key. The function should behave as follows: 1. If the inp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert roundValue(3.14159, 2) == 3.14\", \"assert roundValue(2.71828, 3) == 2.718\", \"assert roundValue(-1.5, 0) == -2\", \"assert roundValue(5.555, 1) == 5.6\", \"assert roundValue({'speed': [10, 20, 30]}, 1, 'speed') == 20.0\", \"assert roundValue({'speed': [0, ... | {
"split": "train",
"index": 74666,
"acecode_id": "oss_12478",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that mixes two given strings by alternately swapping characters between them, while skipping non-alphabetic characters and ignoring case sensitivity. Finally, reverse the mixed result before returning it. Write a function `custom_mix_strings(s1: str, s2: st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert custom_mix_strings('', '') == ''\", \"assert custom_mix_strings('a', 'b') == 'ba'\", \"assert custom_mix_strings('a!b@c', '1d2e3f') == 'fecdba'\", \"assert custom_mix_strings('1234', '5678') == ''\", \"assert custom_mix_strings('x', 'y') == 'yx'\", \"assert ... | {
"split": "train",
"index": 74667,
"acecode_id": "evol_7107",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with validating a given workspace ID. The workspace ID must be a non-empty string that follows a specific format defined by a GUID regex pattern. Write a function `check_workspace_id(workspace_id: str) -> bool` that takes a single parameter, `workspace_id`, and r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_workspace_id('123e4567-e89b-12d3-a456-426614174000') == True\", \"assert check_workspace_id('123E4567-E89B-12D3-A456-426614174000') == True\", \"assert check_workspace_id('123e4567-e89b-12d3-a456-426614174000') == True\", \"assert check_workspace_id('1... | {
"split": "train",
"index": 74668,
"acecode_id": "bigcode_python_fns_8377",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a given dictionary of model settings and returns the count of unique labels present in the settings. The model settings are represented as a dictionary where the keys are strings and the values can be of various types. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_labels({'label_count': ['A', 'B', 'C', 'A', 'D', 'B']}) == 4\", \"assert count_unique_labels({'label_count': ['apple', 'banana', 'orange', 'banana']}) == 3\", \"assert count_unique_labels({'label_count': []}) == 0\", \"assert count_unique_labels... | {
"split": "train",
"index": 74669,
"acecode_id": "oss_10483",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a positive integer 'number', implement a function that decomposes it into a list of the largest powers of 2 that sum up to the original number. The function should return this list of powers in descending order. For instance, if the input is 42, the output should be [32, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decomposeArbitraryLength(42) == [32, 8, 2]\", \"assert decomposeArbitraryLength(1) == [1]\", \"assert decomposeArbitraryLength(2) == [2]\", \"assert decomposeArbitraryLength(3) == [2, 1]\", \"assert decomposeArbitraryLength(4) == [4]\", \"assert decomposeArb... | {
"split": "train",
"index": 74670,
"acecode_id": "bigcode_python_fns_24240",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that performs basic arithmetic operations. The function should accept three parameters: two integers and a string representing the operation to be performed. The operation can be one of the following: 'add', 'subtract', 'multiply', or 'di... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate(3, 2, 'add') == 5\", \"assert calculate(3, 2, 'subtract') == 1\", \"assert calculate(3, 2, 'multiply') == 6\", \"assert calculate(3, 2, 'divide') == 1.5\", \"assert calculate(3, 0, 'divide') == 'Division by zero is not allowed'\", \"assert calculat... | {
"split": "train",
"index": 74671,
"acecode_id": "oss_7932",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function to convert the given 10-digit phone number string into a formatted string that displays the number in the format 'XXX-XXX-XXXX'. The input will always be a valid 10-digit phone number without any special characters or spaces. Your function should only proce... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_phone_number('2125551212') == '212-555-1212'\", \"assert format_phone_number('1234567890') == '123-456-7890'\", \"assert format_phone_number('9876543210') == '987-654-3210'\", \"assert format_phone_number('1112223333') == '111-222-3333'\", \"assert fo... | {
"split": "train",
"index": 74672,
"acecode_id": "evol_5740",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You have been given a list of integers. Your task is to implement a function that checks if there are any duplicate integers in the list. If there are duplicates, the function should return True; otherwise, it should return False. The function should be defined as follows: `def... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_duplicates([1, 2, 3, 4, 5]) == False\", \"assert has_duplicates([1, 2, 3, 4, 5, 1]) == True\", \"assert has_duplicates([-1, -2, -3, -4, -5]) == False\", \"assert has_duplicates([-1, -2, -3, -4, -5, -2]) == True\", \"assert has_duplicates([0, 1, 2, 3, 0])... | {
"split": "train",
"index": 74673,
"acecode_id": "bigcode_python_fns_42804",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_json_object(name: str, age: int, country: str) -> str` that takes in three parameters: `name`, `age`, and `country`. The function should validate the input data as follows: the `name` must only contain letters and spaces (no special characters or nu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_json_object('John Smith', 34, 'US') == '{\\\"Name\\\": \\\"John Smith\\\", \\\"Age\\\": 34, \\\"Country\\\": \\\"US\\\"}'\", \"assert create_json_object('Alice', 28, 'CANADA') == '{\\\"Name\\\": \\\"Alice\\\", \\\"Age\\\": 28, \\\"Country\\\": \\\"CAN... | {
"split": "train",
"index": 74674,
"acecode_id": "evol_32370",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of integers, list1 and list2. Your task is to merge these two lists into a single list based on a specified merge type. The merge types can be 'inner', 'outer', 'left', or 'right'. The 'inner' merge will include only the elements that are present in both... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_lists([1, 2, 3], [3, 4, 5], 'inner') == [3]\", \"assert merge_lists([1, 2], [3, 4], 'left') == [1, 2]\", \"assert merge_lists([], [1, 2, 3], 'inner') == []\", \"assert merge_lists([], [1, 2, 3], 'outer') == [1, 2, 3]\", \"assert merge_lists([1, 2, 3], ... | {
"split": "train",
"index": 74675,
"acecode_id": "bigcode_python_fns_15471",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that validates a given solid property according to specific rules. A solid property is represented as a dictionary with the following keys: 'name', 'volume', and 'is_valid'. The 'name' key should be a string representing the name of t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_solid_property({'name': 'Cube', 'volume': 27.0, 'is_valid': True}) == True\", \"assert validate_solid_property({'name': 'Sphere', 'volume': 33.51, 'is_valid': True}) == True\", \"assert validate_solid_property({'name': '', 'volume': 15.0, 'is_valid'... | {
"split": "train",
"index": 74676,
"acecode_id": "oss_29472",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer radius and a padding value, implement a function that returns a square matrix (2D list) of size (2 * radius + 1) x (2 * radius + 1) filled entirely with the padding value. The function should have the signature: `def get_out_of_bounds_window(radius: int, paddin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_out_of_bounds_window(0, 5) == [[5]]\", \"assert get_out_of_bounds_window(1, 0) == [[0, 0, 0], [0, 0, 0], [0, 0, 0]]\", \"assert get_out_of_bounds_window(2, -1) == [[-1, -1, -1, -1, -1], [-1, -1, -1, -1, -1], [-1, -1, -1, -1, -1], [-1, -1, -1, -1, -1], [-... | {
"split": "train",
"index": 74677,
"acecode_id": "bigcode_python_fns_13363",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a citation generator function that takes in a title, author, year, and web address, and returns a formatted citation string. The citation should follow the APA (American Psychological Association) style, which includes the author's last name, th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_citation('The Power of Habit', 'Charles Duhigg', '2012', 'https://www.example.com/habit') == 'Duhigg (2012). The Power of Habit. Retrieved from https://www.example.com/habit'\", \"assert generate_citation('Understanding Machine Learning', 'Shai Shal... | {
"split": "train",
"index": 74678,
"acecode_id": "oss_26601",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a list of numbers, write a function that calculates the log density for a normal distribution with a specified mean and standard deviation. The log density is calculated using the formula: log_density = -0.5 * sum(((x - mean) / std_dev) ** 2) for each number x in the list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert abs(log_density([0.0, 0.0, 0.0], 0.0, 1.0) + 0.0) < 1e-9\", \"assert abs(log_density([1.0, 1.0, 1.0], 1.0, 2.0) + 0.0) < 1e-9\", \"assert abs(log_density([], 0.0, 1.0) + 0.0) < 1e-9\", \"assert abs(log_density([4.0], 5.0, 1.0) + 0.5) < 1e-9\", \"assert abs(l... | {
"split": "train",
"index": 74679,
"acecode_id": "bigcode_python_fns_5175",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Implement a function `findURLs` that extracts valid web addresses (HTTP/HTTPS) from a given Unicode character string. The function should reject URLs containing unsafe characters according to RFC 1738, as well as URLs that consist of IP addresses instead of domain names. The fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert findURLs('Check this out: http://example.com') == {'com': ['http://example.com']}\", \"assert findURLs('Visit our site at https://my-site.org') == {'org': ['https://my-site.org']}\", \"assert findURLs('Invalid URL: http://192.168.1.1') == {}\", \"assert find... | {
"split": "train",
"index": 74680,
"acecode_id": "evol_18190",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function `match_pattern(string: str) -> bool` that checks if a given string matches the following criteria: The string must start with one or more '1's (representing a unary number), followed by a hexadecimal quantity (which can include digits 0-9 and letters A-F, c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert match_pattern('111A0') == False\", \"assert match_pattern('1111F0') == False\", \"assert match_pattern('111abc1') == False\", \"assert match_pattern('1111C0') == False\", \"assert match_pattern('11A0') == False\", \"assert match_pattern('1111e01') == True\",... | {
"split": "train",
"index": 74681,
"acecode_id": "evol_24828",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple logging function for a software application. Your function should take a boolean parameter `disable_log` and a string parameter `message`. If `disable_log` is set to `False`, the function should print the `message`. If `disable_log` is ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_message(False, 'Log this message') == None\", \"assert log_message(True, 'Do not log this message') == None\", \"assert log_message(False, 'Logging is active') == None\", \"assert log_message(True, 'This should not appear') == None\", \"assert log_messag... | {
"split": "train",
"index": 74682,
"acecode_id": "oss_19682",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a binary tree represented by its root node. Write a function `isBalanced(root: Optional[TreeNode]) -> bool` that determines if the tree is height-balanced. A height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every no... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isBalanced(TreeNode(1, TreeNode(2), TreeNode(3))) == True\", \"assert isBalanced(TreeNode(1, TreeNode(2, TreeNode(4)), TreeNode(3))) == True\", \"assert isBalanced(TreeNode(1, TreeNode(2, TreeNode(4), TreeNode(5)), TreeNode(3))) == True\", \"assert isBalance... | {
"split": "train",
"index": 74683,
"acecode_id": "bigcode_python_fns_47960",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two binary strings, b1 and b2, implement a function that returns the longest common contiguous substring that occurs in both of them. For example, if b1 represents the binary series '10101011' and b2 corresponds to the binary pattern '01101001', the function should return... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longest_common_contiguous('10101011', '01101001') == '1010'\", \"assert longest_common_contiguous('1100', '1010') == '10'\", \"assert longest_common_contiguous('1111', '1111') == '1111'\", \"assert longest_common_contiguous('0000', '0000') == '0000'\", \"ass... | {
"split": "train",
"index": 74684,
"acecode_id": "evol_8724",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of migration fields and extracts specific information from each field. Each migration field is represented as a dictionary containing the model name, field name, field type, and help text. Your function should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_migration_info([{'model_name': 'model1', 'name': 'field1', 'field': 'models.IntegerField', 'help_text': 'Help text 1'}, {'model_name': 'model2', 'name': 'field2', 'field': 'models.CharField', 'help_text': None}]) == [('model1', 'field1')]\", \"assert... | {
"split": "train",
"index": 74685,
"acecode_id": "oss_24117",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of strings and a character, implement a function that returns an array containing only the strings that include the specified character. The returned array should have the strings sorted in descending order based on their lengths. Write a function `filter_strings... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_strings(['a', 'ab', 'abc', 'abcd'], 'a') == ['abcd', 'abc', 'ab', 'a']\", \"assert filter_strings(['test', 'example', 'sample', 'hello'], 'z') == []\", \"assert filter_strings([], 'a') == []\", \"assert filter_strings(['cat', 'dog', 'mouse', 'elephant... | {
"split": "train",
"index": 74686,
"acecode_id": "evol_9597",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a string that contains only lowercase letters. Your task is to implement a function that returns the first non-repeating character in the string. If there are no non-repeating characters, return an empty string. For example, given the string 'leetcode', the first ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert first_non_repeating_char('leetcode') == 'l'\", \"assert first_non_repeating_char('aabb') == ''\", \"assert first_non_repeating_char('loveleetcode') == 'v'\", \"assert first_non_repeating_char('abcd') == 'a'\", \"assert first_non_repeating_char('a') == 'a'\",... | {
"split": "train",
"index": 74687,
"acecode_id": "bigcode_python_fns_11216",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string s, implement a function that transforms the string into a 'sphinx' naming style for headings. This transformation should involve the following steps: 1. Replace all spaces in the string with hyphens ('-'). 2. Convert all characters in the string to lowercase. 3. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert to_nbsphinx('Hello World (Example)') == 'hello-world'\", \"assert to_nbsphinx('Python Programming (Basics)') == 'python-programming'\", \"assert to_nbsphinx('Data Science (With Python)') == 'data-science'\", \"assert to_nbsphinx('No (Parentheses) Here') == '... | {
"split": "train",
"index": 74688,
"acecode_id": "bigcode_python_fns_49284",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a list of capabilities, implement a function `get_revised_capabilities(caps: List[str], prefer_uncompressed: bool, local_formats: Set[str], experimental_bundle: bool, bundle_priority: List[str]) -> List[str]` that returns a revised list of capabilities based on the follow... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_revised_capabilities(['cap1', 'cap2'], True, {'revlogv1'}, False, ['priority1', 'priority2']) == ['cap1', 'cap2', 'stream-preferred', 'stream', 'unbundle=priority1,priority2', 'httpheader=1024']\", \"assert get_revised_capabilities(['cap1'], False, {'rev... | {
"split": "train",
"index": 74689,
"acecode_id": "bigcode_python_fns_31693",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks whether a given string is a valid palindrome or not. A palindrome is defined as a sequence of characters that reads the same forward and backward, ignoring spaces, punctuation, and capitalization. Implement the function `i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_palindrome('A man, a plan, a canal, Panama') == True\", \"assert is_valid_palindrome('race a car') == False\", \"assert is_valid_palindrome('No lemon, no melon') == True\", \"assert is_valid_palindrome('Was it a car or a cat I saw?') == True\", \"as... | {
"split": "train",
"index": 74690,
"acecode_id": "oss_15794",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a unique identifier for a test matrix. The identifier should be a string of 32 hexadecimal characters (0-9 and a-f). Write a function `generate_test_matrix_id()` that returns a unique identifier each time it is called. The ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_test_matrix_id() != generate_test_matrix_id()\", \"assert len(generate_test_matrix_id()) == 32\", \"assert all(c in '0123456789abcdef' for c in generate_test_matrix_id())\", \"assert generate_test_matrix_id() != generate_test_matrix_id()\", \"assert... | {
"split": "train",
"index": 74691,
"acecode_id": "bigcode_python_fns_27280",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two unordered lists of integers, implement a function that returns the count of distinct integers present in both lists combined. The function should take two parameters, list1 and list2, which are both lists of integers, and return an integer representing the number of u... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_unique_elements([1, 2, 3], [4, 5, 6]) == 6\", \"assert find_unique_elements([1, 2, 2], [2, 3, 3]) == 3\", \"assert find_unique_elements([10, 20], [30, 40]) == 4\", \"assert find_unique_elements([], [1, 2, 3]) == 3\", \"assert find_unique_elements([1, 1,... | {
"split": "train",
"index": 74692,
"acecode_id": "evol_18047",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an n-ary tree represented as an adjacency list. Write a function `maximum_distance(root: int, edges: List[Tuple[int, int]]) -> int` that calculates the maximum distance between any two nodes in the tree. The distance between two nodes is defined as the number of e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert maximum_distance(1, [(1, 2), (1, 3), (2, 4), (2, 5)]) == 3\", \"assert maximum_distance(10, [(10, 20), (10, 30), (20, 40), (20, 50), (40, 60)]) == 4\", \"assert maximum_distance(5, [(5, 6), (5, 7), (6, 8), (7, 9), (8, 10)]) == 5\", \"assert maximum_distance(... | {
"split": "train",
"index": 74693,
"acecode_id": "evol_1290",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given the dimensions of a winding and the surface area of a slot, compute the fill factor of the winding. The fill factor is defined as the ratio of the active surface area of the winding to the surface area of the slot. You are provided with the number of radial and tangential... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_fill_factor(0, 5, 100.0, 20.0, 2) == 0.0\", \"assert compute_fill_factor(10, 0, 100.0, 20.0, 2) == 0.0\", \"assert compute_fill_factor(10, 5, 100.0, 0.0, 2) == 0.0\", \"assert compute_fill_factor(1, 1, 50.0, 10.0, 1) == 0.2\", \"assert compute_fill_f... | {
"split": "train",
"index": 74694,
"acecode_id": "bigcode_python_fns_12946",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given a Vigenère cipher table, create a function that encrypts a given string. Use the first letter of the string as the key for encryption. The Vigenère cipher table is defined as follows: {'a': {'a': 'b', 'b': 'c', 'c': 'd'}, 'b': {'a': 'c', 'b': 'd', 'c': 'e'}, 'c': {'a': 'd... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert vigenere_encrypt('aab') == 'bbc'\", \"assert vigenere_encrypt('aaa') == 'bbb'\", \"assert vigenere_encrypt('bb') == 'dd'\", \"assert vigenere_encrypt('a') == 'b'\", \"assert vigenere_encrypt('bbbb') == 'dddd'\", \"assert vigenere_encrypt('ac') == 'bd'\", \"a... | {
"split": "train",
"index": 74695,
"acecode_id": "evol_1570",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that returns the first five prime numbers found in the list. If there are fewer than five prime numbers, return all the prime numbers found. If no prime numbers are found, return the message 'No prime numbers found.'\nPlease reason... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_primes([3, 4, 1, 6, 8, 9, 11, 13, 15, 17, 18]) == [3, 11, 13, 17]\", \"assert find_primes([4, 6, 8, 10, 12]) == 'No prime numbers found.'\", \"assert find_primes([2, 3, 5, 7, 11, 13, 17]) == [2, 3, 5, 7, 11]\", \"assert find_primes([1, 4, 6, 8, 9]) == '... | {
"split": "train",
"index": 74696,
"acecode_id": "evol_28111",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given the dimensions of a rectangle represented by two integers, `length` and `width`. Your task is to write a function `calculate_rectangle_perimeter` that calculates the perimeter of the rectangle. The perimeter is defined as the total distance around the rectangle, c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_rectangle_perimeter(5, 3) == 16\", \"assert calculate_rectangle_perimeter(10, 20) == 60\", \"assert calculate_rectangle_perimeter(0, 0) == 0\", \"assert calculate_rectangle_perimeter(1, 1) == 4\", \"assert calculate_rectangle_perimeter(7, 4) == 22\... | {
"split": "train",
"index": 74697,
"acecode_id": "oss_23474",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates loading application configurations from a given dictionary. The function should take a dictionary as input, where the keys represent configuration names and the values represent their respective settings. Your function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert load_configurations({'debug': 'true', 'host': '', 'port': 8080, 'timeout': None}) == {'debug': 'true', 'port': 8080}\", \"assert load_configurations({'app_name': 'my_app', 'version': '1.0', 'description': ''}) == {'app_name': 'my_app', 'version': '1.0'}\", \... | {
"split": "train",
"index": 74698,
"acecode_id": "bigcode_python_fns_19873",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that performs a binary search to find the index of a specific element x in a sorted array. The function should take a sorted array and the element to search for as input parameters. If the element is found, return its index; if not, return -1.\nPlease reaso... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binary_search([1, 2, 3, 4, 5], 3) == 2\", \"assert binary_search([10, 20, 30, 40, 50], 20) == 1\", \"assert binary_search([5, 15, 25, 35, 45], 45) == 4\", \"assert binary_search([1, 2, 3, 4, 5], 1) == 0\", \"assert binary_search([100, 200, 300, 400, 500], 60... | {
"split": "train",
"index": 74699,
"acecode_id": "evol_11652",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.