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": "Given a function f1 that takes an integer x, increment it by 1 and return the result. Then, implement another function f2 that takes an integer x, invokes f1 with x, and returns the product of the result of f1(x) with itself. Implement the function f2.\nPlease reason step by st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert f2(1) == 4\", \"assert f2(2) == 9\", \"assert f2(3) == 16\", \"assert f2(4) == 25\", \"assert f2(5) == 36\", \"assert f2(0) == 1\", \"assert f2(-1) == 0\", \"assert f2(-2) == 1\", \"assert f2(10) == 121\", \"assert f2(100) == 10201\", \"assert f2(50) == 2601... | {
"split": "train",
"index": 67000,
"acecode_id": "evol_34667",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that manages modules by name and version. Each module has a name and a version. Your goal is to implement a function `manage_modules(operations: List[Tuple[str, str, str]]) -> List[Optional[Tuple[str, str]]]` where the input is a list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_modules([('add', 'module1', '1.0'), ('get', 'module1', ''), ('remove', 'module1', ''), ('get', 'module1', '')]) == [('module1', '1.0'), None]\", \"assert manage_modules([('add', 'module2', '2.0'), ('get', 'module2', ''), ('get', 'module3', '')]) == [(... | {
"split": "train",
"index": 67001,
"acecode_id": "oss_16244",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a security system which can be activated or deactivated by a specific key combination of Control, Shift, and M. The security system should maintain its activation state and toggle this state each time the key combination is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert toggle_security_system(1) == 'Activated, LED is On'\", \"assert toggle_security_system(2) == 'Deactivated, LED is Off'\", \"assert toggle_security_system(3) == 'Activated, LED is On'\", \"assert toggle_security_system(4) == 'Deactivated, LED is Off'\", \"ass... | {
"split": "train",
"index": 67002,
"acecode_id": "oss_3861",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of usernames and returns a list of corresponding user profile details. Each user profile should include the username and an associated ID, which is generated as a simple increasing integer starting from 1. The... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_user_profiles(['alice', 'bob', 'charlie']) == [{'username': 'alice', 'id': 1}, {'username': 'bob', 'id': 2}, {'username': 'charlie', 'id': 3}]\", \"assert create_user_profiles(['john', 'doe']) == [{'username': 'john', 'id': 1}, {'username': 'doe', 'id... | {
"split": "train",
"index": 67003,
"acecode_id": "oss_34833",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integer pairs. Your task is to write a function that categorizes each pair of integers based on their parity. If the first integer in the pair is odd and the second integer is even, the function should return 'Odd Even' for that pair. If the first intege... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert categorize_pairs([(3, 4), (2, 5), (6, 8), (7, 1)]) == ['Odd Even', 'Even Odd', 'Even Even', 'Odd Odd']\", \"assert categorize_pairs([(1, 2), (4, 3), (0, 0), (5, 5)]) == ['Odd Even', 'Even Odd', 'Even Even', 'Odd Odd']\", \"assert categorize_pairs([(10, 20), ... | {
"split": "train",
"index": 67004,
"acecode_id": "oss_35298",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `hex_to_ascii(hex_string: str) -> str` that converts a given hexadecimal string into its equivalent ASCII characters. The input string consists of hexadecimal values and may contain invalid characters. The function should gracefully handle invalid input by ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hex_to_ascii('48656c6c6f') == 'Hello'\", \"assert hex_to_ascii('576f726c64') == 'World'\", \"assert hex_to_ascii('') == ''\", \"assert hex_to_ascii('48656c6c6f20576f726c64') == 'Hello World'\", \"assert hex_to_ascii('4e6f7420412075736572') == 'Not A user'\",... | {
"split": "train",
"index": 67005,
"acecode_id": "evol_2732",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function that checks if two given alpha-numeric sequences are case-sensitive lexical anagrams, considering special characters and spaces. Your function should take two strings as input and return True if they are anagrams of each other, and False otherwise.\nPlease ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_anagrams('listen', 'silent') == True\", \"assert check_anagrams('12345', '54321') == True\", \"assert check_anagrams('a1b2c3', '3c2b1a') == True\", \"assert check_anagrams('abc', 'def') == False\", \"assert check_anagrams('abc123', '123abc') == True\",... | {
"split": "train",
"index": 67006,
"acecode_id": "evol_13313",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates user profile data based on specified criteria. The function, `validate_user_profile`, should take four parameters: `user_id` (an integer), `display_name` (a string), `username` (a string), and `email` (a string). The functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_user_profile(1, 'John Doe', 'johndoe123', 'johndoe@example.com') == {'valid': True, 'errors': []}\", \"assert validate_user_profile(2, 'Jane Doe', 'janedoe', 'jane.doe@example.com') == {'valid': True, 'errors': []}\", \"assert validate_user_profile(... | {
"split": "train",
"index": 67007,
"acecode_id": "oss_10457",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a DNA sequence represented as a string and a list of nucleotide patterns. Write a function `count_nucleotide_patterns(dna_sequence, patterns)` that counts the occurrences of each nucleotide pattern within the DNA sequence. The function should return a dictionary w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_nucleotide_patterns('CCCCCCCCCC', ['C', 'CC', 'CCC']) == {'C': 10, 'CC': 9, 'CCC': 8}\", \"assert count_nucleotide_patterns('TTTTTTTTTT', ['T', 'TT', 'TTT', 'TTTT']) == {'T': 10, 'TT': 9, 'TTT': 8, 'TTTT': 7}\", \"assert count_nucleotide_patterns('ATCG... | {
"split": "train",
"index": 67008,
"acecode_id": "oss_19396",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that takes a list of integers as input and returns a new list containing the squares of those integers. The output list should maintain the same order as the input list. Implement the function `square_numbers(nums: List[int]) -> List[int]:... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert square_numbers([-2, -1, 0, 1, 2]) == [4, 1, 0, 1, 4]\", \"assert square_numbers([0]) == [0]\", \"assert square_numbers([3, -3, 2, -2, 1, -1]) == [9, 9, 4, 4, 1, 1]\", \"assert square_numbers([]) == []\", \"assert square_numbers([1, 2, 3]) == [1, 4, 9]\", \"a... | {
"split": "train",
"index": 67009,
"acecode_id": "bigcode_python_fns_29352",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an integer array `nums` and an integer `x`. In one operation, you can either remove the leftmost or the rightmost element from the array `nums` and modify `x` based on the value of the element removed. If the element removed is even, you subtract its value from `x... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert min_operations([2,4,6,8,10], 3) == -1\", \"assert min_operations([1,1,1,1,1], 3) == 3\", \"assert min_operations([8,6,4], 18) == 3\", \"assert min_operations([1,2,3], 1) == 1\", \"assert min_operations([10,20,30], 10) == 1\", \"assert min_operations([1,2,3,4... | {
"split": "train",
"index": 67010,
"acecode_id": "evol_11170",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple bank account. The function should accept a list of operations, each represented by a tuple. The first element in the tuple is a string that indicates the type of operation: 'deposit' or 'withdraw', and the seco... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bank_account_operations(100, [('deposit', 50), ('withdraw', 30)]) == 120\", \"assert bank_account_operations(200, [('withdraw', 100), ('deposit', 50), ('withdraw', 200)]) == 150\", \"assert bank_account_operations(0, [('withdraw', 10)]) == 0\", \"assert bank... | {
"split": "train",
"index": 67011,
"acecode_id": "oss_31203",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function `drop(lst: List[int], n: int) -> List[int]` that takes a list of integers `lst` and a non-negative integer `n` as input and returns a new list with the first `n` elements removed from the original list. If `n` is greater than or equal to the length of the l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert drop([1, 2, 3, 4, 5], 2) == [3, 4, 5]\", \"assert drop([1, 2, 3, 4, 5], 0) == [1, 2, 3, 4, 5]\", \"assert drop([1, 2, 3, 4, 5], 5) == []\", \"assert drop([1, 2, 3, 4, 5], 6) == []\", \"assert drop([], 0) == []\", \"assert drop([], 1) == []\", \"assert drop([... | {
"split": "train",
"index": 67012,
"acecode_id": "oss_17855",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of hexadecimal strings, implement a function that converts each hexadecimal string into its corresponding binary representation. The function should return a list of strings, where each string is the binary representation of the hexadecimal input, without any leadi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hex_to_binary_list(['A']) == ['1010']\", \"assert hex_to_binary_list(['B2']) == ['10110010']\", \"assert hex_to_binary_list(['0']) == ['0']\", \"assert hex_to_binary_list(['1']) == ['1']\", \"assert hex_to_binary_list(['2']) == ['10']\", \"assert hex_to_bina... | {
"split": "train",
"index": 67013,
"acecode_id": "evol_8424",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two binary arrays, `sx` and `so`, and a 2D array `q` representing the action values for each possible state. The length of `sx` and `so` will be the same as the length of the first dimension of `q`. Your task is to implement a function `choose_action(q: List[List[... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert choose_action([[0, 0], [0, 0]], [False, False], [False, False], 0.1) == ((0, 0), (0, 0))\", \"assert choose_action([[1, 3], [2, 4]], [True, False], [False, False], 0.5) == ((1, 1), (1, 1))\", \"assert choose_action([[10, 20], [30, 40]], [False, True], [True,... | {
"split": "train",
"index": 67014,
"acecode_id": "bigcode_python_fns_39203",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a dice roll based on user input. The input will be a string that contains the number of dice to roll, the number of sides on each die, and an optional modifier. The string format will be `'_dice_**d**_sides_[+|-_modifier_]'`, where '_dice_' is the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_dice_roll('1d20+3') == 4 or 5 or 6 or ... or 23\", \"assert simulate_dice_roll('2d6') == 2 or 3 or 4 or ... or 12\", \"assert simulate_dice_roll('3d8-1') == 2 or 3 or 4 or ... or 23\", \"assert simulate_dice_roll('1d4-1') == 0 or 1 or 2 or 3\", \"as... | {
"split": "train",
"index": 67015,
"acecode_id": "bigcode_python_fns_28631",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the deletion of a cluster in a project management system. The function should take three parameters: an access token (string), a project ID (string), and a cluster ID (string). The function should return a confirmation ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delete_cluster('token123', 'projectA', 'cluster1') == 'Cluster cluster1 in project projectA has been deleted.'\", \"assert delete_cluster('tokenXYZ', 'projectB', 'cluster2') == 'Cluster cluster2 in project projectB has been deleted.'\", \"assert delete_clust... | {
"split": "train",
"index": 67016,
"acecode_id": "bigcode_python_fns_31340",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that returns the largest prime factor of a given integer n. The function should handle both positive and negative values of n, and it is guaranteed that |n| > 1 and is not prime. Optimize the factorization process by only considering odd numbers after check... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert largest_prime_factor(13195) == 29\", \"assert largest_prime_factor(2048) == 2\", \"assert largest_prime_factor(-13195) == 29\", \"assert largest_prime_factor(100) == 5\", \"assert largest_prime_factor(-100) == 5\", \"assert largest_prime_factor(15) == 5\", \... | {
"split": "train",
"index": 67017,
"acecode_id": "evol_7464",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that retrieves metadata attributes from a widefield image dataset represented as a dictionary. The function should take a dictionary representing the attributes of a widefield image and return a new dictionary containing specific meta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_metadata({'prefix': 'Cos7', 'acqID': 1, 'datasetType': 'WidefieldImage', 'channelID': 'A647', 'dateID': 'None', 'posID': 'None', 'sliceID': 'None', 'Version': '1.0'}) == {'SMLM_prefix': 'Cos7', 'SMLM_acqID': 1, 'SMLM_datasetType': 'WidefieldImage', '... | {
"split": "train",
"index": 67018,
"acecode_id": "bigcode_python_fns_42705",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes an image input in the form of a string, which can either be a URL or a local file path. Your function should return a string indicating whether the image was successfully retrieved from a URL or loaded from a local file. If the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_image_source('http://example.com/image.jpg') == 'Image retrieved from URL'\", \"assert get_image_source('/path/to/local/image.jpg') == 'Image loaded from local file'\", \"assert get_image_source('https://example.com/image.png') == 'Image retrieved from U... | {
"split": "train",
"index": 67019,
"acecode_id": "bigcode_python_fns_32838",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `count_chars(phrase: str) -> dict` that takes a linguistic phrase as input and returns a dictionary containing the occurrence count of each distinct alphabetic character in the phrase. The keys of the dictionary should be the characters, and the values should b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_chars('Hello World') == {'h': 1, 'e': 1, 'l': 3, 'o': 2, 'w': 1, 'r': 1, 'd': 1}\", \"assert count_chars('Python') == {'p': 1, 'y': 1, 't': 1, 'h': 1, 'o': 1, 'n': 1}\", \"assert count_chars('') == {}\", \"assert count_chars('AaBbCc') == {'a': 2, 'b': ... | {
"split": "train",
"index": 67020,
"acecode_id": "evol_5439",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Determine the third highest odd element in the provided array without using Python's built-in functions and disregarding negative numbers. If there are fewer than three positive odd numbers, return None.\nPlease reason step by step, then write a self-contained Python solution. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert third_highest_odd_element([1, 2, 4, 3]) == None\", \"assert third_highest_odd_element([2, 4, 6]) == None\", \"assert third_highest_odd_element([]) == None\", \"assert third_highest_odd_element([-1, -3, -5]) == None\", \"assert third_highest_odd_element([3]) ... | {
"split": "train",
"index": 67021,
"acecode_id": "evol_4161",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `evaluate_accuracy(images: List[int], annotations: List[int]) -> float` that computes the accuracy of a model based on the number of correctly classified images. The function takes in two parameters: `images`, which is a list of intege... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate_accuracy([1, 1, 0, 1], [1, 1, 0, 1]) == 1.0\", \"assert evaluate_accuracy([1, 0, 1, 0], [1, 0, 1, 0]) == 1.0\", \"assert evaluate_accuracy([0, 0, 0, 0], [0, 0, 0, 0]) == 1.0\", \"assert evaluate_accuracy([1, 1, 1, 1], [0, 0, 0, 0]) == 0.0\", \"asser... | {
"split": "train",
"index": 67022,
"acecode_id": "bigcode_python_fns_3",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two sorted arrays, merge them into one array and then sort the merged array in descending order without using any built-in sort function. Implement the function `merge_and_sort(arr1: List[int], arr2: List[int]) -> List[int]` that takes two sorted lists of integers and ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_and_sort([1, 2, 3], [4, 5, 6]) == [6, 5, 4, 3, 2, 1]\", \"assert merge_and_sort([10, 20, 30], [5, 15, 25]) == [30, 25, 20, 15, 10, 5]\", \"assert merge_and_sort([1, 3, 5], [2, 4, 6]) == [6, 5, 4, 3, 2, 1]\", \"assert merge_and_sort([], []) == []\", \"a... | {
"split": "train",
"index": 67023,
"acecode_id": "evol_13712",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a file renaming utility that checks if the new file name has a valid file extension before renaming the file. The utility should only allow renaming if the new file name has a valid extension based on a predefined list of allowed file types. Wri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_rename_allowed('document.txt', 'new_document.pdf', ['txt', 'doc', 'pdf']) == True\", \"assert is_rename_allowed('document.txt', 'new_document.doc', ['txt', 'doc', 'pdf']) == True\", \"assert is_rename_allowed('document.txt', 'new_document.txt', ['txt', 'd... | {
"split": "train",
"index": 67024,
"acecode_id": "oss_25031",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an iterable of dictionaries where each dictionary represents a JSON-encodable object. Your task is to implement a function that takes this iterable as input and returns a JSON-formatted string representation of all the dictionaries in the iterable combined into a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert stream_json([]) == '[]'\", \"assert stream_json([{ 'key1': 'value1' }]) == '[{\\\"key1\\\": \\\"value1\\\"}]'\", \"assert stream_json([{ 'key1': 'value1' }, { 'key2': 'value2' }]) == '[{\\\"key1\\\": \\\"value1\\\"}, {\\\"key2\\\": \\\"value2\\\"}]'\", \"ass... | {
"split": "train",
"index": 67025,
"acecode_id": "bigcode_python_fns_42906",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a mathematical expression represented as a string, implement a function that rearranges the parentheses to ensure the computation yields the correct outcome. The input expression will only involve non-negative integers and the operators: addition (+), subtraction (-), mul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rearrange_and_compute('8 / 2 * (2 + 2)') == 16\", \"assert rearrange_and_compute('3 + 5 * 2') == 13\", \"assert rearrange_and_compute('10 - (2 + 3) * 2') == 0\", \"assert rearrange_and_compute('4 * (3 + 2) - 5') == 15\", \"assert rearrange_and_compute('(8 - ... | {
"split": "train",
"index": 67026,
"acecode_id": "evol_1871",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a list of navigation data entries for three Global Navigation Satellite Systems (GNSS) - GPS (G), Galileo (E), and BeiDou (C), write a function that organizes the data into a 2D list. Each GNSS should have its data represented in 21 rows. The input to the function will be... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert organize_navigation_data(['G 01 0.1 0.2 0.3', 'G 02 0.4 0.5 0.6', 'E 01 0.7 0.8 0.9', 'E 02 1.0 1.1 1.2', 'C 01 1.3 1.4 1.5', 'C 02 1.6 1.7 1.8']) == ([['01', '0.1', '0.2', '0.3'], ['02', '0.4', '0.5', '0.6']], [['01', '0.7', '0.8', '0.9'], ['02', '1.0', '1.... | {
"split": "train",
"index": 67027,
"acecode_id": "bigcode_python_fns_12219",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary `features_definition` where each key represents a feature and its value is another dictionary containing valid options for that feature. Your task is to create a function `generate_invalid_requests(features_definition: dict) -> list` that generates a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_invalid_requests({'a': {'x': 10}, 'b': {'y': 20}, 'c': {'z': 30}}) == [{'a': 'q', 'b': 'y', 'c': 'z'}, {'a': 'x', 'b': 'q', 'c': 'z'}, {'a': 'x', 'b': 'y', 'c': 'q'}]\", \"assert generate_invalid_requests({'color': {'red': 1, 'green': 2}, 'shape': {... | {
"split": "train",
"index": 67028,
"acecode_id": "bigcode_python_fns_4036",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function that accepts a list of blog post titles and a list of comments, and returns a dictionary where each title is a key and the value is a list of comments associated with that title. If a title has no comments, the value should be an empty list.\nPlease reason ste... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_blog_comments_dict(['First Post', 'Second Post'], ['Great post!', 'Very informative']) == {'First Post': ['Great post!'], 'Second Post': ['Very informative']}\", \"assert create_blog_comments_dict(['Hello World', 'Python Tips'], []) == {'Hello World':... | {
"split": "train",
"index": 67029,
"acecode_id": "evol_387",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given multiple arrays of integers, each potentially having different lengths, implement a function `find_median(arrays)` that calculates the median of all the integers across these arrays without sorting them. The function should handle both odd and even total counts of integer... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_median([[1, 2], [3, 4], [5, 6], [7]]) == 4\", \"assert find_median([[1, 1, 1], [1, 1], [1]]) == 1\", \"assert find_median([[1], [2], [3], [4]]) == 2.5\", \"assert find_median([[10, 20], [30], [5, 15]]) == 15\", \"assert find_median([[1, 2, 3], [4, 5], [... | {
"split": "train",
"index": 67030,
"acecode_id": "evol_4816",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `max_difference(arr: List[int]) -> int` that returns the maximum difference between any two elements in the list such that the larger element comes after the smaller element. If no such pair exists, return -1. The function should handl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_difference([3, 5, 1, 9, 2]) == 8\", \"assert max_difference([5, 4, 3, 2, 1]) == -1\", \"assert max_difference([1, 2, 3, 4, 5]) == 4\", \"assert max_difference([10, 20, 5, 30, 15]) == 25\", \"assert max_difference([1]) == -1\", \"assert max_difference([])... | {
"split": "train",
"index": 67031,
"acecode_id": "bigcode_python_fns_40773",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Create a function `length_of_episode(episode_length_seconds: int) -> float` that takes the length of a podcast episode in seconds and returns its length in minutes. The function should handle both integer and float inputs and return the result as a float.\nPlease reason step by... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert length_of_episode(120) == 2.0\", \"assert length_of_episode(90) == 1.5\", \"assert length_of_episode(0) == 0.0\", \"assert length_of_episode(300) == 5.0\", \"assert length_of_episode(1500) == 25.0\", \"assert length_of_episode(3600) == 60.0\", \"assert lengt... | {
"split": "train",
"index": 67032,
"acecode_id": "evol_31826",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function that takes a dictionary as input and returns a list of tuples (key, value) where the value is a Fibonacci number. A Fibonacci number is defined as a number that appears in the Fibonacci sequence, which starts with 0 and 1, and each subsequent number is the sum... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci_pairs({'A': 1, 'B': 2, 'C': 3, 'D': 4, 'E': 5, 'F': 8, 'G': 13, 'H': 21, 'I': 34}) == [('A', 1), ('B', 2), ('C', 3), ('E', 5), ('F', 8), ('G', 13), ('H', 21), ('I', 34)]\", \"assert fibonacci_pairs({'X': 4, 'Y': 6, 'Z': 10}) == []\", \"assert fibon... | {
"split": "train",
"index": 67033,
"acecode_id": "evol_22940",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates searching through multiple predefined search engines. Each search engine has specific results for given queries. Your function should take a search query and return a list of results based on the predefined search engin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert search_multiple_engines('python') == ['Python Documentation', 'Learn Python', 'Python for Data Science']\", \"assert search_multiple_engines('tutorial') == ['Python Tutorial', 'Tutorial on Data Science']\", \"assert search_multiple_engines('code') == ['Pytho... | {
"split": "train",
"index": 67034,
"acecode_id": "oss_22351",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a web page visit counter for a session in a web application. The visit counter should track the number of visits to each unique page path during a user's session. Your task is to implement a function `update_visit_count(path: str) -> None` that ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_visit_count('/') is None\", \"assert update_visit_count('/') is None\", \"assert update_visit_count('/page-1/') is None\", \"assert update_visit_count('/page-1/') is None\", \"assert update_visit_count('/page-2/') is None\", \"assert update_visit_coun... | {
"split": "train",
"index": 67035,
"acecode_id": "oss_11354",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that simulates switching an object into edit mode in a 3D graphics application. The function `set_edit_mode` takes a string parameter `current_mode` which represents the current mode of the object. If the `current_mode` is not 'EDIT', the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_edit_mode('OBJECT') == 'EDIT'\", \"assert set_edit_mode('EDIT') == 'EDIT'\", \"assert set_edit_mode('OBJECT_MODE') == 'EDIT'\", \"assert set_edit_mode('EDIT') == 'EDIT'\", \"assert set_edit_mode('MODE') == 'EDIT'\", \"assert set_edit_mode('EDIT') == 'EDI... | {
"split": "train",
"index": 67036,
"acecode_id": "bigcode_python_fns_8594",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of strings representing IDs from a training dataset and a test dataset. Write a function `check_common_ids(train_ids: List[str], test_ids: List[str]) -> bool` that checks if there are any common IDs between the two lists. The function should return True ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_common_ids(['1', '2', '3'], ['4', '5', '6']) == False\", \"assert check_common_ids(['a', 'b', 'c'], ['d', 'e', 'f']) == False\", \"assert check_common_ids(['1', '2', '3'], ['3', '4', '5']) == True\", \"assert check_common_ids(['ID1', 'ID2', 'ID3'], ['i... | {
"split": "train",
"index": 67037,
"acecode_id": "bigcode_python_fns_48003",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a 2D matrix as input and returns a list of its elements in spiral order. The input matrix will be a list of lists where each inner list represents a row of the matrix. If the input matrix is empty, return an empty list.\nPlease reason step by ste... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert spiralPrint([[1,2,3],[4,5,6],[7,8,9]]) == [1, 2, 3, 6, 9, 8, 7, 4, 5]\", \"assert spiralPrint([[1]]) == [1]\", \"assert spiralPrint([[1, 2], [3, 4]]) == [1, 2, 4, 3]\", \"assert spiralPrint([[1, 2, 3], [4, 5, 6]]) == [1, 2, 3, 6, 5, 4]\", \"assert spiralPrin... | {
"split": "train",
"index": 67038,
"acecode_id": "evol_15096",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function to generate a verification code for a new user registration system. The verification code should be a random alphanumeric string of a specified length. Implement the `generate_verification_code` function that takes an integer `length` as ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert len(generate_verification_code(1)) == 1\", \"assert len(generate_verification_code(5)) == 5\", \"assert len(generate_verification_code(8)) == 8\", \"assert len(generate_verification_code(10)) == 10\", \"assert all(c.isalnum() for c in generate_verification_c... | {
"split": "train",
"index": 67039,
"acecode_id": "oss_13076",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, implement a function that finds and returns the 'k' longest strings in the order of their occurrence. If the list is empty, return None. If 'k' exceeds the list length, return all the strings. If multiple strings have the same length, prioritize the ear... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longest([], 2) is None\", \"assert longest(['a', 'b', 'c'], 1) == ['a']\", \"assert longest(['hello', 'world', 'hi'], 3) == ['hello', 'world', 'hi']\", \"assert longest(['same', 'size', 'size'], 2) == ['same', 'size']\", \"assert longest(['abc', 'abcd', 'ab'... | {
"split": "train",
"index": 67040,
"acecode_id": "evol_21435",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, determine if there exists a pair of integers that sum up to a specific target value. Write a function `has_pair_with_sum(nums: List[int], target: int) -> bool` that returns `True` if such a pair exists, and `False` otherwise. The list can contain both ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_pair_with_sum([1, 2, 3, 4, 5], 9) == True\", \"assert has_pair_with_sum([-1, 0, 1, 2], 1) == True\", \"assert has_pair_with_sum([3, 5, 2, -4, 8, 11], 7) == True\", \"assert has_pair_with_sum([10, 15, 3, 7], 17) == True\", \"assert has_pair_with_sum([], 5... | {
"split": "train",
"index": 67041,
"acecode_id": "bigcode_python_fns_48195",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `check_all_equal(arr)` that takes an array of integers and returns `True` if all elements in the array are equal, and `False` otherwise. For example, given the input array `[1, 1, 1]`, the function should return `True`, while for the array `[1, 2, 1]`, it s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_all_equal([2, 2, 2]) == True\", \"assert check_all_equal([3, 3, 3, 3]) == True\", \"assert check_all_equal([1, 1, 2]) == False\", \"assert check_all_equal([5, 5, 5, 5, 5]) == True\", \"assert check_all_equal([0, 0, 0]) == True\", \"assert check_all_equ... | {
"split": "train",
"index": 67042,
"acecode_id": "evol_27048",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `perfect_squares(start: int, end: int) -> Dict[int, Tuple[bool, List[int]]]` that takes two integers, `start` and `end`, and returns a dictionary of perfect squares between `start` and `end` (inclusive). For each perfect square, the key should be the perfec... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert perfect_squares(1, 1) == {1: (False, [])}\", \"assert perfect_squares(36, 36) == {36: (False, [2, 2, 3, 3])}\", \"assert perfect_squares(2, 2) == {}\", \"assert perfect_squares(100, 100) == {100: (False, [2, 2, 5, 5])}\", \"assert perfect_squares(10, 10) == ... | {
"split": "train",
"index": 67043,
"acecode_id": "evol_15573",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of dependencies and a boolean value indicating whether an extra dependency should be included. The function should return the complete list of dependencies, which includes 'extra_dependency' only if the boolean value is ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_dependencies(['Pillow>=4.0.0', 'tflite-runtime==2.5.0'], True) == ['Pillow>=4.0.0', 'tflite-runtime==2.5.0', 'extra_dependency']\", \"assert get_dependencies(['Pillow>=4.0.0', 'tflite-runtime==2.5.0'], False) == ['Pillow>=4.0.0', 'tflite-runtime==2.5.0']... | {
"split": "train",
"index": 67044,
"acecode_id": "oss_28001",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes a list of integers and returns a new list containing only the even numbers from the original list, maintaining the order of their first occurrences. The function should handle cases where the input list may be empty or contain no even numbers.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5, 6]) == [2, 4, 6]\", \"assert filter_even_numbers([2, 4, 6, 8, 10]) == [2, 4, 6, 8, 10]\", \"assert filter_even_numbers([1, 3, 5, 7]) == []\", \"assert filter_even_numbers([]) == []\", \"assert filter_even_numbers([0, -2, -... | {
"split": "train",
"index": 67045,
"acecode_id": "evol_29221",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes address information and geographical coordinates from a given data structure. The function should take a dictionary as input that contains the following keys: 'address', 'maps_link', and 'url'. The 'address' key cont... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_data({'address': [' 123 Main St ', ' Apt 4B ', ' New York ', ' NY '], 'maps_link': 'https://maps.example.com/?q=40.7128,-74.0060', 'url': 'https://realestate.example.com/property/12345'}) == {'address_parts': ['123 Main St', 'Apt 4B', 'New York', 'NY... | {
"split": "train",
"index": 67046,
"acecode_id": "oss_21473",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a function that accepts a list of distinct English words and returns the words that contain the maximum number of vowel characters (a, e, i, o, u). In case of a tie, return a list of all words with the maximum quantity of vowels. Do not use any built-in Python functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_vowels(['apple', 'banana', 'cherry', 'date']) == ['banana']\", \"assert max_vowels(['a', 'e', 'i', 'o', 'u']) == ['a', 'e', 'i', 'o', 'u']\", \"assert max_vowels(['programming', 'is', 'fun']) == ['programming']\", \"assert max_vowels(['apple', 'orange', ... | {
"split": "train",
"index": 67047,
"acecode_id": "evol_6366",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given the names of three text files: 'before.txt', 'prettier.txt', and 'after.txt'. Your task is to create a function that reads the contents of these three files and returns them as a tuple in the order: (before_content, prettier_content, formatted_content). Each file ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_file_contents('Before content', 'Prettier content', 'After content') == ('Before content', 'Prettier content', 'After content')\", \"assert get_file_contents('Line 1\\\\nLine 2', 'Formatted Line 1\\\\nFormatted Line 2', 'Final Line 1\\\\nFinal Line 2') =... | {
"split": "train",
"index": 67048,
"acecode_id": "bigcode_python_fns_1254",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a method for a Queue class that checks if a specific value exists in the queue. The method should return True if the value is found, and False otherwise. Implement the function 'contains(value)' in the Queue class that accepts a value as a parameter.\nPlease reason step ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert Queue().contains(5) == False\", \"assert Queue().enqueue(15) or Queue().contains(20) == False\", \"assert not Queue().contains(100) == True\", \"assert Queue().enqueue(4) or Queue().enqueue(5) or Queue().contains(6) == False\", \"assert Queue().enqueue(7) or... | {
"split": "train",
"index": 67049,
"acecode_id": "evol_6583",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of numbers, `fpr` and `tpr`, representing the false positive rates and true positive rates of a binary classification model, respectively. Your task is to implement a function `plot_roc_curve(fpr: List[float], tpr: List[float]) -> str` that simulates the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert plot_roc_curve([0.0, 0.1, 0.2], [0.0, 0.5, 1.0]) == 'Plot created successfully'\", \"assert plot_roc_curve([0.0, 0.1, 0.2], [0.0, 0.5]) == 'Invalid input'\", \"assert plot_roc_curve([0.0], [0.0]) == 'Plot created successfully'\", \"assert plot_roc_curve([0.0... | {
"split": "train",
"index": 67050,
"acecode_id": "bigcode_python_fns_37193",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes two lists of integers, `list1` and `list2`, and returns a new list containing the result of subtracting the corresponding elements of `list2` from `list1`. If the lists have different lengths, the function should raise a ValueError. Handle any po... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert list_subtraction([15, 20, 25], [7, 10, 15]) == [8, 10, 10]\", \"assert list_subtraction([1, 2, 3], [1, 1, 1]) == [0, 1, 2]\", \"assert list_subtraction([-5, -10, -15], [-1, -2, -3]) == [-4, -8, -12]\", \"assert list_subtraction([100], [50]) == [50]\", \"asse... | {
"split": "train",
"index": 67051,
"acecode_id": "evol_29708",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary of students' grades in multiple subjects, write a Python function named 'calculate_average' that calculates and returns a dictionary with the respective student's name as key and their average grade as value. The function should follow these conditions: 1. If... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average({'John': [85, 90, 78], 'Anna': [80, 85, 88], 'Smith': [30, 40, 45], 'James': [95, 100, 98]}) == {'John': 84.33333333333333, 'Anna': 84.33333333333333, 'Smith': 38.333333333333336, 'James': 97.66666666666667}\", \"assert calculate_average({'... | {
"split": "train",
"index": 67052,
"acecode_id": "evol_28412",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a list of import statements in Python, write a function called `extract_module_names` that extracts and returns a list of unique module names. An import statement is defined as a string that starts with 'import' or 'from', followed by the module name. The module name can ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_module_names(['import os', 'import sys', 'import os', 'import sys']) == ['os', 'sys']\", \"assert extract_module_names(['from collections import Counter', 'from collections import defaultdict', 'import collections']) == ['collections']\", \"assert ex... | {
"split": "train",
"index": 67053,
"acecode_id": "oss_27946",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a function that generates the Fibonacci sequence values that are less than or equal to a given integer n. The function should return a list of these Fibonacci numbers in ascending order. If n is less than 0, return an empty list.\nPlease reason step by step, then writ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(0) == [0]\", \"assert fibonacci(4) == [0, 1, 1, 2, 3]\", \"assert fibonacci(5) == [0, 1, 1, 2, 3, 5]\", \"assert fibonacci(6) == [0, 1, 1, 2, 3, 5]\", \"assert fibonacci(7) == [0, 1, 1, 2, 3, 5]\", \"assert fibonacci(8) == [0, 1, 1, 2, 3, 5, 8]\", ... | {
"split": "train",
"index": 67054,
"acecode_id": "evol_1176",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists: one representing the input names of a command and another representing the inputs of an element. Your task is to implement a function `analyze_inputs(input_names: List[str], element_inputs: List[str]) -> bool` that checks if the inputs of the command ma... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_inputs(['input1', 'input2'], ['input1', 'input2']) == True\", \"assert analyze_inputs(['input1', 'input2'], ['input2', 'input1']) == False\", \"assert analyze_inputs(['input1'], ['input1']) == True\", \"assert analyze_inputs(['input1', 'input2'], ['i... | {
"split": "train",
"index": 67055,
"acecode_id": "oss_19172",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_game` that initializes a Pacman game with given parameters. The function should take the following parameters: `pacman_position` (a tuple of two integers representing the initial position of Pacman), `ghost_positions` (a list of tuples, each represe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_game((1, 1), [(5, 5), (10, 10)], (20, 20), [(2, 2), (3, 3), (4, 4), (5, 5), (6, 6)]) is not None\", \"assert isinstance(create_game((0, 0), [(1, 1)], (10, 10), [(2, 2)]), Game)\", \"assert create_game((5, 5), [], (5, 5), []) is not None\", \"assert cr... | {
"split": "train",
"index": 67056,
"acecode_id": "evol_31537",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a string as input and checks if it is a valid identifier in Python. A valid identifier is a non-empty string that starts with a letter (a-z, A-Z) or an underscore (_), followed by letters, digits (0-9), or underscores. Your fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_identifier('valid_identifier_1') == True\", \"assert is_valid_identifier('1_invalid_identifier') == False\", \"assert is_valid_identifier('_validIdentifier') == True\", \"assert is_valid_identifier('anotherValid123') == True\", \"assert is_valid_ide... | {
"split": "train",
"index": 67057,
"acecode_id": "bigcode_python_fns_1048",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an input variable, determine if it behaves like a string. A variable is considered to behave like a string if you can concatenate it with another empty string ('') without raising any exceptions. Implement a function `isStringLike(s)` that takes a single argument `s` and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isStringLike('hello') == True\", \"assert isStringLike('') == True\", \"assert isStringLike(123) == False\", \"assert isStringLike(45.67) == False\", \"assert isStringLike(['a', 'b', 'c']) == False\", \"assert isStringLike(('x', 'y')) == False\", \"assert is... | {
"split": "train",
"index": 67058,
"acecode_id": "bigcode_python_fns_48140",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of non-negative integers, rearrange the digits in such a way that you can form two numbers whose sum is maximized. Return these two numbers as a tuple. The digits should be used in such a way that each digit is used exactly once, and the formed numbers should be as... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rearrange_digits([9, 8, 7]) == (97, 8)\", \"assert rearrange_digits([1, 1, 1, 1]) == (11, 11)\", \"assert rearrange_digits([0, 0, 0]) == (0, 0)\", \"assert rearrange_digits([6, 5, 4, 3]) == (64, 53)\", \"assert rearrange_digits([1, 9, 9, 8]) == (98, 91)\", \... | {
"split": "train",
"index": 67059,
"acecode_id": "bigcode_python_fns_30383",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes a list of real numbers (which may include negative values and zero) and returns the second smallest distinct value in that list. The input list will always contain at least two distinct values. You need to implement a function called `second_s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert second_smallest([-14.1, 25.2, 25.2, 0, -66.9, 5.3]) == -14.1\", \"assert second_smallest([1.5, 2.5, 3.5, 2.5, 1.5]) == 2.5\", \"assert second_smallest([0.0, 0.0, -1.0, -2.0]) == -1.0\", \"assert second_smallest([3.5, 3.5, 2.2, 1.1]) == 2.2\", \"assert second... | {
"split": "train",
"index": 67060,
"acecode_id": "evol_3730",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the uninstallation of a software configuration. The function should take a list of plugin names (strings) and a boolean indicating whether the uninstallation is headless. It should return a list of messages indicating the s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert uninstall_plugins(['pluginA', 'pluginB'], False) == ['Successfully uninstalled pluginA', 'Successfully uninstalled pluginB']\", \"assert uninstall_plugins(['pluginA', ''], False) == ['Successfully uninstalled pluginA', 'Invalid plugin name for uninstallation... | {
"split": "train",
"index": 67061,
"acecode_id": "bigcode_python_fns_20229",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with configuring the OSPF (Open Shortest Path First) protocol for a set of routers based on the given input data. Each router may have multiple links to other routers, and you need to generate the appropriate configuration commands based on the OSPF settings prov... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_ospf_config({'r1': {'links': {'r2': {'ospf': {'area': '0', 'authentication': 'message-digest', 'message-digest-key': '10', 'authentication-key': 'ospf'}}}}}) == {'r1': ['interface r1-r2', 'ip ospf area 0', 'ip ospf authentication message-digest', 'i... | {
"split": "train",
"index": 67062,
"acecode_id": "bigcode_python_fns_32893",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_monotonic_increasing(arr: List[int]) -> bool` that determines if a given list of integers is strictly monotonically increasing. A strictly monotonically increasing sequence means that each integer in the array is greater than the preceding integer. If t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_monotonic_increasing([]) == False\", \"assert is_monotonic_increasing([1, 2, 3, 4, 5]) == True\", \"assert is_monotonic_increasing([1, 1, 2, 3]) == False\", \"assert is_monotonic_increasing([2, 5, 6]) == True\", \"assert is_monotonic_increasing([1, 2, 2, ... | {
"split": "train",
"index": 67063,
"acecode_id": "evol_24934",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the total size of items stored in a hierarchical storage system represented as a dictionary. Each key in the dictionary represents a path to an item, and its value represents the size of that item. Given a dictionary 'store' that may contain nest... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_storage_size({'a': 10, 'b': 20, 'c': 30}, 'a') == 10\", \"assert get_storage_size({'a': 10, 'b': 20, 'c': 30}, 'b') == 20\", \"assert get_storage_size({'a': 10, 'b': 20, 'c': 30}, 'c') == 30\", \"assert get_storage_size({'a': 10, 'b': 20, 'c': 30}, '') =... | {
"split": "train",
"index": 67064,
"acecode_id": "bigcode_python_fns_13975",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of numbers, implement a function that calculates the exponential of each number in the list. The exponential of a number x is defined as e raised to the power of x, where e is Euler's number (approximately 2.71828). Your function should return a new list containing... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert (result := calculate_exponential([0])) == [1.0]\", \"assert (result := calculate_exponential([1])) == [2.718281828459045]\", \"assert (result := calculate_exponential([-1])) == [0.36787944117144233]\", \"assert (result := calculate_exponential([2])) == [7.38... | {
"split": "train",
"index": 67065,
"acecode_id": "bigcode_python_fns_29825",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, each representing a line of text. Your task is to create a function that formats these lines into a well-indented string, where each subsequent line is indented based on the number of leading spaces in the previous line. The first line should no... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_lines(['First', 'Second']) == 'First\\\\n Second'\", \"assert format_lines(['Single line']) == 'Single line'\", \"assert format_lines(['First line', 'Second line', 'Third line']) == 'First line\\\\n Second line\\\\n Third line'\", \"assert format... | {
"split": "train",
"index": 67066,
"acecode_id": "bigcode_python_fns_26284",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a function `execute_arithmetic_functions(operation_elements, number_elements)` that takes in two lists: `operation_elements` containing primitive arithmetic operations (`+`, `-`, `*`, `//`, `**`) and `number_elements` containing positive integers. The function should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert execute_arithmetic_functions(['-', '+'], [10, 3, 4]) == 11\", \"assert execute_arithmetic_functions(['//', '+'], [10, 3, 2]) == 5\", \"assert execute_arithmetic_functions(['+', '+'], [1, 2, 3]) == 6\", \"assert execute_arithmetic_functions(['+', '/'], [10, 2... | {
"split": "train",
"index": 67067,
"acecode_id": "evol_32820",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Write a function that returns a list of all even numbers in the range between two given integers, inclusive. The function should not use any loop constructs or libraries. Implement the function as a recursive function. For example, if the input is start = 10 and end = 20, the o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert print_even(10, 20) == [10, 12, 14, 16, 18, 20]\", \"assert print_even(1, 10) == [2, 4, 6, 8, 10]\", \"assert print_even(5, 5) == []\", \"assert print_even(0, 0) == [0]\", \"assert print_even(-10, -1) == [-10, -8, -6, -4, -2]\", \"assert print_even(-5, 5) == ... | {
"split": "train",
"index": 67068,
"acecode_id": "evol_19125",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes a string and a character as inputs and returns a list of all the words in the string that start with the given character, ignoring case sensitivity.\nPlease reason step by step, then write a self-contained Python solution. Give your final prog... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_words('She sells seashells by the seashore.', 's') == ['She', 'sells', 'seashells', 'seashore']\", \"assert extract_words('Hello world!', 'h') == ['Hello']\", \"assert extract_words('Silly Sally sells sea shells!', 's') == ['Silly', 'Sally', 'sells',... | {
"split": "train",
"index": 67069,
"acecode_id": "evol_9586",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Design a function `store_integers` that takes a list of integers as input and returns a list of unique integers sorted in ascending order. If the input list contains non-integer values, the function should ignore those values. The function should return an empty list if no vali... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert store_integers([1, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert store_integers([4, 3, 2, 1]) == [1, 2, 3, 4]\", \"assert store_integers([1, 2, 2, 3, 4, 4]) == [1, 2, 3, 4]\", \"assert store_integers([]) == []\", \"assert store_integers(['a', 'b', 'c']) == []\", \"a... | {
"split": "train",
"index": 67070,
"acecode_id": "evol_19673",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that extracts modules from a given string representation of a top-level `.txt` file content of a Python distribution. The input to your function is a string, where each line may contain module information in the format 'modules=module... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_modules_from_txt('no_modules_info_here') == []\", \"assert get_modules_from_txt('modules=') == ['']\", \"assert get_modules_from_txt('modules=moduleX') == ['moduleX']\", \"assert get_modules_from_txt('modules=module1,module2,module1') == ['module1', 'mod... | {
"split": "train",
"index": 67071,
"acecode_id": "oss_21873",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that splits a dataset into training and testing sets based on specified parameters. The function takes in two parameters: `data`, a list of data points, and `targets`, a list of corresponding target values. The function should return ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert split_dataset([1, 2, 3, 4], [10, 20, 30, 40], test=1) == (([1, 2, 3], [10, 20, 30]), ([4], [40]))\", \"assert split_dataset([5, 6, 7, 8, 9], [50, 60, 70, 80, 90], trainval=4, test=1) == (([5, 6, 7, 8], [50, 60, 70, 80]), ([9], [90]))\", \"assert split_datase... | {
"split": "train",
"index": 67072,
"acecode_id": "oss_16282",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a user login process. The function should take three parameters: a username (string), a password (string), and a MAC address (string). The function should check if the username exists in the system. If it does not exist... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert login_simulation('user1', 'password123', '00:1A:2B:3C:4D:5E') == 'token_user1'\", \"assert login_simulation('user2', 'password456', '00:1A:2B:3C:4D:5E') == 'token_user2'\", \"assert login_simulation('user1', 'password123', '11:22:33:44:55:66') == 'token_user... | {
"split": "train",
"index": 67073,
"acecode_id": "bigcode_python_fns_14558",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Design a function named 'create_individual' that takes two parameters: 'name' (a string) and 'age' (an integer). The function should create and return a dictionary representing an individual with the provided name and age. If the age is not a valid integer (i.e., if it is a str... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_individual('Alice', 25) == {'name': 'Alice', 'age': 25}\", \"assert create_individual('Bob', 30) == {'name': 'Bob', 'age': 30}\", \"assert create_individual('Charlie', 40) == {'name': 'Charlie', 'age': 40}\", \"assert create_individual('Diana', 18) ==... | {
"split": "train",
"index": 67074,
"acecode_id": "evol_19167",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a library interface in Python using the `ctypes` module. In your implementation, you need to create a function that attempts to assign a new value to `ctypes.CDLL`. If the assignment is successful, return True. However, if an OSError or AttributeErr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert assign_cdll('valid_value') == True\", \"assert assign_cdll('another_valid_value') == True\", \"assert assign_cdll('some_library.so') == True\", \"assert assign_cdll('ctypes.CDLL') == True\", \"assert assign_cdll('tmp3') == True\", \"assert assign_cdll('path/... | {
"split": "train",
"index": 67075,
"acecode_id": "oss_28353",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple state machine transition. The function should take in the current state and a desired destination state, and return whether the transition is valid based on the following rules: 1. A transition is valid if the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_transition('idle', 'active') == True\", \"assert can_transition('active', 'inactive') == True\", \"assert can_transition('inactive', 'idle') == True\", \"assert can_transition('active', 'active') == False\", \"assert can_transition('inactive', 'active') ... | {
"split": "train",
"index": 67076,
"acecode_id": "bigcode_python_fns_8209",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that validates a URL. The function should check if the URL has a scheme of 'http' or 'https', and if the domain matches one of the allowed domains provided in a list. If the URL is valid, return True; otherwise, return False. The input to ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_url('https://example.com', ['example.com', 'test.com']) == True\", \"assert validate_url('http://example.com', ['example.com', 'test.com']) == True\", \"assert validate_url('https://test.com', ['example.com', 'test.com']) == True\", \"assert validat... | {
"split": "train",
"index": 67077,
"acecode_id": "bigcode_python_fns_15553",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function that takes an arbitrary list of integers and an integer k, and returns the k-th largest prime number in the list. If there are fewer than k prime numbers, return 'Not enough primes'.\nPlease reason step by step, then write a self-contained Python solution. Giv... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_kth_largest_prime([13, 18, 23, 17, 29, 34, 37], 3) == 23\", \"assert find_kth_largest_prime([10, 15, 3, 7, 11], 1) == 11\", \"assert find_kth_largest_prime([1, 4, 6, 8, 9], 2) == 'Not enough primes'\", \"assert find_kth_largest_prime([2, 3, 5, 7, 11], 5... | {
"split": "train",
"index": 67078,
"acecode_id": "evol_16642",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are working on a bioinformatics project to analyze the binding affinity of antigens to antibodies. In this project, you are given a function that calculates the Levenshtein distance between a wild-type (wt) peptide sequence and a mutated peptide sequence based on the antige... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_ld('her2', 'WGGDGFYAMR') == 1\", \"assert calculate_ld('pd1', 'EYLNCSVTDF') == 0\", \"assert calculate_ld('egfr', 'LPPRNLHDSLL') == 1\", \"assert calculate_ld('her2', 'WGGDGFYAMK') == 0\", \"assert calculate_ld('pd1', 'EYLNCSVTDFE') == 1\", \"asser... | {
"split": "train",
"index": 67079,
"acecode_id": "oss_5051",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string S, write a function `reverseOnlyLetters(S)` that reverses the letters in the string while keeping all other characters (including numbers and punctuation) in their original positions. Letters are defined as uppercase and lowercase English letters. The function sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverseOnlyLetters('Test1ng-Leet=code-Q!') == 'Qedo1ct-eeLg=ntse-T!'\", \"assert reverseOnlyLetters('ab-cd') == 'dc-ba'\", \"assert reverseOnlyLetters('') == ''\", \"assert reverseOnlyLetters('12345') == '12345'\", \"assert reverseOnlyLetters('hello!') == 'o... | {
"split": "train",
"index": 67080,
"acecode_id": "evol_27043",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function to extract and return the 7th element from a given list of integers. The function should return the 7th element if it exists; otherwise, it should return 'List doesn't have 7 elements.'\nPlease reason step by step, then write a self-contained Python solutio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_seventh_element([1, 7, 3, 9, 5, 11, 0, 6, 2, 8]) == 0\", \"assert get_seventh_element([10, 20, 30, 40, 50, 60, 70]) == 70\", \"assert get_seventh_element([1, 2, 3, 4, 5, 6, 7, 8]) == 7\", \"assert get_seventh_element([1, 2, 3, 4, 5, 6, 7]) == 7\", \"asse... | {
"split": "train",
"index": 67081,
"acecode_id": "evol_24409",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a portfolio represented as a dictionary containing investment quantities and their corresponding purchase prices, along with a dictionary of current prices for those investments and a purchase date, write a function that calculates the total initial value of the portfolio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_portfolio_returns({'TSLA': {'qty': 15, 'prc': 600}}, {'TSLA': 600}, '2023-03-01') == {'abs': 0.0, 'rel': 0.0, 'old': 9000.0, 'new': 9000.0, 'date': '2023-03-01'}\", \"assert calculate_portfolio_returns({'NFLX': {'qty': 10, 'prc': 500}}, {'NFLX': 40... | {
"split": "train",
"index": 67082,
"acecode_id": "bigcode_python_fns_38580",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Create a function `choose_path(choice: str) -> str` that simulates a simple text-based interactive entertainment system. The function takes a string input `choice`, which can either be 'left' or 'right'. If the choice is 'left', the function should return 'You chose the left do... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert choose_path('left') == 'You chose the left door, adventure awaits!'\", \"assert choose_path('right') == 'You chose the right door, danger lurks ahead!'\", \"assert choose_path('up') == 'Invalid choice, please choose again.'\", \"assert choose_path('down') ==... | {
"split": "train",
"index": 67083,
"acecode_id": "evol_31835",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the uploading of a file to a specified URL. The function should accept three parameters: a `filename` (string), a `url` (string), and an optional `token` (string). The function should return `True` if the upload is consider... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert upload_file('valid_file.txt', 'http://example.com/upload') == True\", \"assert upload_file('invalid_file.txt', 'http://example.com/upload') == None\", \"assert upload_file('valid_file.txt', 'http://invalid_url.com') == None\", \"assert upload_file('another_f... | {
"split": "train",
"index": 67084,
"acecode_id": "bigcode_python_fns_1456",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings that may represent valid numbers or erroneous formats. Your task is to implement a function that parses the list, filters out invalid entries, and returns the maximum, minimum, and average of the valid numbers found in the list. If there are no v... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_min_avg(['', 'abc', 'null']) == (None, None, None)\", \"assert max_min_avg(['10', '20', '30']) == (30.0, 10.0, 20.0)\", \"assert max_min_avg(['3.14', '2.71', 'invalid']) == (3.14, 2.71, 2.925)\", \"assert max_min_avg(['-10', '0', '10']) == (10.0, -10.0, ... | {
"split": "train",
"index": 67085,
"acecode_id": "evol_29503",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of dictionaries where each dictionary contains a key 'FULL_NAME' representing a person's full name, write a function `sort_by_fullname(data: List[dict]) -> List[dict]` that sorts the list of dictionaries in ascending order by the 'FULL_NAME' value. The function sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_by_fullname([{'FULL_NAME': 'John Doe'}, {'FULL_NAME': 'Jane Smith'}, {'FULL_NAME': 'Alice Johnson'}]) == [{'FULL_NAME': 'Alice Johnson'}, {'FULL_NAME': 'Jane Smith'}, {'FULL_NAME': 'John Doe'}]\", \"assert sort_by_fullname([{'FULL_NAME': 'Charlie Brown'... | {
"split": "train",
"index": 67086,
"acecode_id": "bigcode_python_fns_30762",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a two-dimensional array representing an image, where each element corresponds to a pixel value. You need to calculate the ratio of minor elements to major elements based on a given threshold. Minor elements are defined as those pixel values that are less than the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert getMinorMajorRatio([[120, 90, 110], [130, 95, 105], [85, 115, 125]], 100) == 0.5\", \"assert getMinorMajorRatio([[200, 150], [50, 75]], 100) == 2/2\", \"assert getMinorMajorRatio([[10, 20, 30], [40, 50, 60]], 25) == 2/4\", \"assert getMinorMajorRatio([[100, ... | {
"split": "train",
"index": 67087,
"acecode_id": "oss_15125",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a string that contains HTML-like blocks of code. Your task is to implement a function that parses this string and extracts the content between specific tags. The tags you need to support are '{% include file=<filename> %}' and '{% endinclude %}'. Your function sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parseHtml('{% include file=test.js %}Some content{% endinclude %}') == 'Some content'\", \"assert parseHtml('{% include file=example.txt %}Hello World{% endinclude %}') == 'Hello World'\", \"assert parseHtml('No includes here.') == ''\", \"assert parseHtml('... | {
"split": "train",
"index": 67088,
"acecode_id": "bigcode_python_fns_31006",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `cube_and_sum` that computes the cube of each integer in the list and returns the total sum of these cubes.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python cod... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cube_and_sum([2, 3, 4]) == 99\", \"assert cube_and_sum([1, 1, 1]) == 3\", \"assert cube_and_sum([0, 0, 0]) == 0\", \"assert cube_and_sum([-1, -2, -3]) == -36\", \"assert cube_and_sum([2]) == 8\", \"assert cube_and_sum([-2]) == -8\", \"assert cube_and_sum([0]... | {
"split": "train",
"index": 67089,
"acecode_id": "evol_15792",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Define a function that accepts an array of positive integers and returns the second most common digit across these integers. In case of a tie, return the smaller digit. If there is only one kind of digit, the function should return that digit. The input will always consist of p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_second_frequent([12345, 67890, 54321]) == '2'\", \"assert find_second_frequent([112233, 445566]) == '2'\", \"assert find_second_frequent([1, 2, 3, 4, 5]) == '2'\", \"assert find_second_frequent([11111, 22222, 33333]) == '2'\", \"assert find_second_frequ... | {
"split": "train",
"index": 67090,
"acecode_id": "evol_28490",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a First-In-First-Out (FIFO) buffer. The buffer can hold a maximum number of packets, defined by its size. You will receive packets over time and need to process them accordingly. The function will take three parameters:... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fifo_buffer(2, [10, 20, 30], 2) == [10, 20]\", \"assert fifo_buffer(5, [1, 2, 3, 4], 6) == [1, 2, 3, 4]\", \"assert fifo_buffer(0, [1, 2, 3], 2) == []\", \"assert fifo_buffer(4, [], 2) == []\", \"assert fifo_buffer(3, [1, 2], 5) == [1, 2]\", \"assert fifo_bu... | {
"split": "train",
"index": 67091,
"acecode_id": "bigcode_python_fns_44720",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates setting up a server. The function should take two parameters: `port_num`, an integer representing the TCP port number (1 <= port_num <= 65535), and `ws_port_num`, an integer representing the WebSocket port number (1 <= ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert setup_server(8345, 8344) == {'tcp_port': 8345, 'ws_port': 8344}\", \"assert setup_server(1, 1) == {'tcp_port': 1, 'ws_port': 1}\", \"assert setup_server(65535, 65535) == {'tcp_port': 65535, 'ws_port': 65535}\", \"assert setup_server(5000, 5000) == {'tcp_port... | {
"split": "train",
"index": 67092,
"acecode_id": "bigcode_python_fns_33185",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a list of keys, where each key is represented as a tuple of two integers. Your task is to implement a function that groups the keys based on their values and returns a list of labels for each group. Each unique group of keys should be labeled with an alphabetic ch... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cluster_junctions([(1, 2), (3, 4), (1, 2), (5, 6), (3, 4)]) == ['A', 'B', 'A', 'C', 'B']\", \"assert cluster_junctions([(1, 1), (2, 2), (1, 1), (2, 2)]) == ['A', 'B', 'A', 'B']\", \"assert cluster_junctions([(0, 0), (0, 0), (0, 1), (1, 0)]) == ['A', 'A', 'B'... | {
"split": "train",
"index": 67093,
"acecode_id": "oss_29239",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a random Fumo character from a predefined list. A Fumo character is represented by specific emoticons such as 'ᗜˬᗜ', 'ᗜᗨᗜ', 'ᗜ◉ᗜ', and 'ᗜ⌒ᗜ'. Your function should return one random Fumo character each time it is called. Imp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_random_fumo() in ['\\u15dc\\u02ec\\u15dc', '\\u15dc\\u15e8\\u15dc', '\\u15dc\\u25c9\\u15dc', '\\u15dc\\u2312\\u15dc']\", \"assert get_random_fumo() in ['\\u15dc\\u02ec\\u15dc', '\\u15dc\\u15e8\\u15dc', '\\u15dc\\u25c9\\u15dc', '\\u15dc\\u2312\\u15dc']\",... | {
"split": "train",
"index": 67094,
"acecode_id": "oss_11026",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `hex_chars` consisting of hexadecimal characters (0-9, a-f), convert each character to its corresponding binary representation, where each hexadecimal digit is represented by 4 bits. The output should be a string of concatenated binary digits. For example, the he... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hex_to_binary('0') == '0000'\", \"assert hex_to_binary('1') == '0001'\", \"assert hex_to_binary('2') == '0010'\", \"assert hex_to_binary('3') == '0011'\", \"assert hex_to_binary('4') == '0100'\", \"assert hex_to_binary('5') == '0101'\", \"assert hex_to_binar... | {
"split": "train",
"index": 67095,
"acecode_id": "bigcode_python_fns_9794",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists: `run_info` which contains task names and `timer_info` which contains timer information with a global clock and a start time. Your task is to implement a function `calculate_real_start_times(run_info: List[str], timer_info: Dict[str, Union[int, List[int]... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_real_start_times(['task1', 'task2'], {'global_clock': 100, 't0': 20}) == [('task1', 80), ('task2', 80)]\", \"assert calculate_real_start_times(['taskA', 'taskB', 'taskC'], {'global_clock': 150, 't0': 50}) == [('taskA', 100), ('taskB', 100), ('taskC... | {
"split": "train",
"index": 67096,
"acecode_id": "oss_6370",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that selects a GUI library based on the operating system platform provided as input. Write a Python function `select_gui_library(platform)` that takes a string `platform` as input and returns the appropriate GUI library to be used based o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert select_gui_library('linux') == 'PySimpleGUI'\", \"assert select_gui_library('darwin') == 'PySimpleGUIWeb'\", \"assert select_gui_library('win32') == 'tkinter'\", \"assert select_gui_library('android') == 'Unsupported platform'\", \"assert select_gui_library(... | {
"split": "train",
"index": 67097,
"acecode_id": "oss_31250",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the amplitude of a pockels signal over time. Your task is to implement a function that identifies the indices of local maxima in this signal. A local maximum is defined as an element that is greater than its neighbors. Additionally,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_local_maxima([1, 2, 3, 2, 1], 1, 1) == [2]\", \"assert find_local_maxima([1, 3, 2, 3, 1], 1, 1) == [1, 3]\", \"assert find_local_maxima([1, 1, 1, 1, 1], 1, 1) == []\", \"assert find_local_maxima([1, 3, 5, 4, 2, 1], 2, 1) == [2]\", \"assert find_local_ma... | {
"split": "train",
"index": 67098,
"acecode_id": "bigcode_python_fns_23715",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a list of geographical points defined by their longitude and latitude. Each point is represented as a dictionary with 'lon' for longitude and 'lat' for latitude. Your task is to calculate the total area covered by these geographical points, assuming they form a po... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert abs(calculate_area([{'lon': 0, 'lat': 0}, {'lon': 0, 'lat': 1}, {'lon': 1, 'lat': 0}]) - 0.5) < 0.01\", \"assert abs(calculate_area([{'lon': 1, 'lat': 1}, {'lon': 4, 'lat': 1}, {'lon': 4, 'lat': 5}, {'lon': 1, 'lat': 5}]) - 12.0) < 0.01\", \"assert abs(calcu... | {
"split": "train",
"index": 67099,
"acecode_id": "bigcode_python_fns_43471",
"num_tests": 14
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.