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 numeric score between 0 and 100, implement a function `numeric_to_alpha_grade(score)` that converts the score into its corresponding alphabetic grading representation. The grading scale is as follows: scores of 93 and above receive an 'A', scores between 90 and 92 recei... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert numeric_to_alpha_grade(95) == 'A'\", \"assert numeric_to_alpha_grade(91) == 'A-'\", \"assert numeric_to_alpha_grade(88) == 'B+'\", \"assert numeric_to_alpha_grade(85) == 'B'\", \"assert numeric_to_alpha_grade(81) == 'B-'\", \"assert numeric_to_alpha_grade(78... | {
"split": "train",
"index": 61100,
"acecode_id": "evol_29867",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a string of text as input and returns a dictionary containing the frequency of unique words in the text, while filtering out common stop words. The function should handle special characters by removing them and should convert all words to lowercase b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert word_frequency('An example: an example!') == {'example': 2}\", \"assert word_frequency('Python is great. Python is fun!') == {'python': 2, 'great': 1, 'fun': 1}\", \"assert word_frequency('The quick brown fox jumps over the lazy dog.') == {'quick': 1, 'brown... | {
"split": "train",
"index": 61101,
"acecode_id": "evol_29783",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given a valid IPv4 address as a string, implement a function that converts this address from its standard dot-decimal notation into a 32-bit integer representation. The function should take a string input of the form 'A.B.C.D' where 0 <= A, B, C, D <= 255, and return the corres... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert ip_address('192.168.1.1') == 3232235777\", \"assert ip_address('0.0.0.0') == 0\", \"assert ip_address('255.255.255.255') == 4294967295\", \"assert ip_address('10.0.0.1') == 167772161\", \"assert ip_address('198.51.100.0') == 3325256704\", \"assert ip_address... | {
"split": "train",
"index": 61102,
"acecode_id": "bigcode_python_fns_44459",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to handle scrolling behavior in a text panel. The function takes in several parameters related to the current view and the desired position to scroll to. Your task is to determine the appropriate scrolling action based on the given pa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert handle_scroll_behavior(100, 100, 0, 100, None, [], 0, 100, 10) == 'scroll to top'\", \"assert handle_scroll_behavior(100, 80, 0, 100, None, [], 0, 100, 10) == 'scroll to top'\", \"assert handle_scroll_behavior(50, 50, 0, 100, None, [], 0, 100, 10) == 'scroll... | {
"split": "train",
"index": 61103,
"acecode_id": "oss_35463",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given a list of purchase invoices represented as dictionaries, each containing keys 'total', 'reverse_charge', 'recoverable_reverse_charge', and 'docstatus', write a function `get_reverse_charge_recoverable_total(invoices: List[Dict[str, Union[str, float]]]) -> float` that calc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_reverse_charge_recoverable_total([{'total': 100, 'reverse_charge': 'Y', 'recoverable_reverse_charge': 50, 'docstatus': 1}, {'total': 200, 'reverse_charge': 'Y', 'recoverable_reverse_charge': 0, 'docstatus': 1}]) == 100\", \"assert get_reverse_charge_reco... | {
"split": "train",
"index": 61104,
"acecode_id": "bigcode_python_fns_45064",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a continuous function defined as `f(x) = ax^2 + bx + c`, where `a`, `b`, and `c` are constants, and a list of real numbers representing the intervals [x1, x2] where the function is evaluated, write a function `find_zero_crossings` that returns a sorted list of the x-value... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_zero_crossings(1, -3, 2, [0, 1, 2, 3]) == [1.0, 2.0]\", \"assert find_zero_crossings(1, 0, -1, [-2, -1, 0, 1]) == [-1.0]\", \"assert find_zero_crossings(1, 0, 0, [-1, 1]) == []\", \"assert find_zero_crossings(1, 1, 1, [-2, 0, 2]) == []\", \"assert find_... | {
"split": "train",
"index": 61105,
"acecode_id": "bigcode_python_fns_10987",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given two dictionaries representing the states of two neural networks, where the keys are strings and the values are 3x3 matrices (as lists of lists). The goal is to calculate the absolute difference between the corresponding weights of the two networks, normalized by t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert absolute_weight_difference({'layer1_weight': [[1, 1, 1], [1, 1, 1], [1, 1, 1]]}, {'layer1_weight': [[1, 1, 1], [1, 1, 1], [1, 1, 1]], 'layer2_weight': [[2, 2, 2], [2, 2, 2], [2, 2, 2]]}) == [0.0]\", \"assert absolute_weight_difference({'layer1_weight': [[5, ... | {
"split": "train",
"index": 61106,
"acecode_id": "bigcode_python_fns_25457",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given an integer array, implement a function that calculates the sum of all elements in the array that are divisible by a given divisor. Your function should take two parameters: the input array and the divisor. Return the calculated sum as an integer. You can assume that the i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_divisible([1, 2, 3, 4, 5], 2) == 6\", \"assert sum_divisible([3, 6, 9, 12], 3) == 30\", \"assert sum_divisible([10, 20, 30], 10) == 60\", \"assert sum_divisible([15, 25, 35], 5) == 75\", \"assert sum_divisible([7, 14, 21, 28], 7) == 70\", \"assert sum_di... | {
"split": "train",
"index": 61107,
"acecode_id": "oss_23703",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of unsigned long integers. Your task is to determine if the list meets the minimum length requirement of 5 elements. Return True if the list has at least 5 elements, otherwise return False. Note that the list can contain any unsigned long integers (0 or pos... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_min_length_valid([1, 2, 3, 4, 5]) == True\", \"assert is_min_length_valid([0, 1, 2, 3, 4]) == True\", \"assert is_min_length_valid([10, 20, 30, 40, 50, 60]) == True\", \"assert is_min_length_valid([100, 200, 300]) == False\", \"assert is_min_length_valid(... | {
"split": "train",
"index": 61108,
"acecode_id": "bigcode_python_fns_5756",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that will take a list of player aliases and return a list of unique aliases. The function should ignore any empty strings and should not change the order of the unique aliases as they first appeared in the input list. Implement the fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_aliases(['Alice', 'Bob', 'Alice', '', 'Charlie', 'Bob']) == ['Alice', 'Bob', 'Charlie']\", \"assert unique_aliases(['', 'Alice', '', 'Bob', 'Alice', 'Bob', 'Charlie']) == ['Alice', 'Bob', 'Charlie']\", \"assert unique_aliases(['Alice', 'Alice', 'Alice... | {
"split": "train",
"index": 61109,
"acecode_id": "oss_22835",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a positive integer `n`, write a function that determines if `n` is a perfect number. A perfect number is defined as a positive integer that is equal to the sum of its positive divisors, excluding the number itself. Implement the function `is_perfect_number(n: int) -> bool... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_perfect_number(28) == True\", \"assert is_perfect_number(6) == True\", \"assert is_perfect_number(496) == True\", \"assert is_perfect_number(8128) == True\", \"assert is_perfect_number(2) == False\", \"assert is_perfect_number(12) == False\", \"assert is_... | {
"split": "train",
"index": 61110,
"acecode_id": "evol_4066",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing a time series data. Your task is to downsample this time series data to a specified number of samples by averaging the values in each segment. Implement a function `downsample(data: List[int], target: int) -> List[float]` that takes... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert downsample([1, 2, 3], 1) == [2.0]\", \"assert downsample([1], 1) == [1.0]\", \"assert downsample([10, 15, 25], 2) == [12.5, 25.0]\", \"assert downsample([1, 1, 1, 1], 2) == [1.0, 1.0]\", \"assert downsample([5, 10, 15], 1) == [10.0]\", \"assert downsample([1... | {
"split": "train",
"index": 61111,
"acecode_id": "bigcode_python_fns_33484",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a function `estimate_circle_area(radius: float, total_points: int) -> float` that calculates the area of a circle with a given radius using the Monte Carlo method. The function should use a specified number of random points to estimate the area. The area of the circle... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert abs(estimate_circle_area(1.0, 100000) - 3.14159) < 0.01\", \"assert abs(estimate_circle_area(0.5, 100000) - 0.78539) < 0.01\", \"assert abs(estimate_circle_area(0.1, 100000) - 0.03141) < 0.01\", \"assert abs(estimate_circle_area(1.5, 100000) - 7.06858) < 0.0... | {
"split": "train",
"index": 61112,
"acecode_id": "evol_7012",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Write a function `is_armstrong(num: int) -> bool` that determines whether a given integer `num` is an Armstrong number. An Armstrong number is defined as a number that is equal to the sum of its digits each raised to the power of the number of digits in the number. For example,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_armstrong(153) == True\", \"assert is_armstrong(370) == True\", \"assert is_armstrong(371) == True\", \"assert is_armstrong(9474) == True\", \"assert is_armstrong(1634) == True\", \"assert is_armstrong(8208) == True\", \"assert is_armstrong(9474) == True\... | {
"split": "train",
"index": 61113,
"acecode_id": "evol_2893",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to display the transfer functions and linear approximations for a control system. You will receive two parameters: a dictionary representing the transfer functions and a list of dictionaries representing the linear approximation table... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_tables({'x1': '2*x1 + 1', 'x2': '3*x2^2'}, [{'x1': 1, 'x2': 2}]) == 'Input Variable: x1, Transfer Function: 2*x1 + 1\\\\nInput Variable: x2, Transfer Function: 3*x2^2\\\\nLinear Approximation Table:\\\\nx1 1\\\\nx2 2'\", \"assert process_tables({'a':... | {
"split": "train",
"index": 61114,
"acecode_id": "oss_26650",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a string `s`, an integer `k`, and a substring `sub`, implement a function that returns `true` if `s` can be transformed into a palindrome by removing at most `k` characters and contains `sub` as a substring. A string is `k`-palindrome if it can be transformed into a palin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isValidKPalindromeSubString('abcdeca', 2, 'cde') == True\", \"assert isValidKPalindromeSubString('abbababa', 1, 'bab') == True\", \"assert isValidKPalindromeSubString('racecar', 0, 'ace') == True\", \"assert isValidKPalindromeSubString('xyzzyx', 1, 'zz') == ... | {
"split": "train",
"index": 61115,
"acecode_id": "evol_34742",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a command-line input parser that accepts three arguments: a GPU device ID, a CPU mode flag, and a network type. Implement a function `parse_args()` that simulates the parsing of these command-line arguments. The function should take three parameters: `gpu_id` (an ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_args(0, False, 'vgg16') == {'gpu_id': 0, 'cpu_mode': False, 'demo_net': 'vgg16'}\", \"assert parse_args(1, True, 'resnet50') == {'gpu_id': 1, 'cpu_mode': True, 'demo_net': 'resnet50'}\", \"assert parse_args(2, False, 'mobilenet') == {'gpu_id': 2, 'cpu_... | {
"split": "train",
"index": 61116,
"acecode_id": "bigcode_python_fns_49918",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to retrieve and process context logs for a specific project and log store. Your goal is to implement the `process_context_logs` function which takes the following parameters: \n- `project` (str): The name of the project for which cont... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_context_logs('project1', 'logstore1', 'log1') == None\", \"assert process_context_logs('project2', 'logstore2', 'log2') == None\", \"assert process_context_logs('project3', 'logstore3', 'log3') == None\", \"assert process_context_logs('project4', 'lo... | {
"split": "train",
"index": 61117,
"acecode_id": "oss_9090",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `char_frequency(s: str) -> Dict[str, int]` that takes a string `s` as input and returns a dictionary containing the frequency of each unique character in the string. The dictionary should include all characters, such as uppercase letters, lowercase letters, num... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert char_frequency('Hello, World!') == {'H': 1, 'e': 1, 'l': 3, 'o': 2, ',': 1, ' ': 1, 'W': 1, 'r': 1, 'd': 1, '!': 1}\", \"assert char_frequency('') == {}\", \"assert char_frequency('aabbcc') == {'a': 2, 'b': 2, 'c': 2}\", \"assert char_frequency('AbC123!') ==... | {
"split": "train",
"index": 61118,
"acecode_id": "evol_15415",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Construct a function that accepts a string representing a sentence and returns a new string with the words in that sentence rearranged in reverse order. Ensure that the original capitalization and punctuation placements of each word are maintained in the output.\nPlease reason ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_sentence('Hello, world!') == 'world! Hello,'\", \"assert reverse_sentence('Python is awesome.') == 'awesome. is Python'\", \"assert reverse_sentence('I love programming!') == 'programming! love I'\", \"assert reverse_sentence('A quick brown fox jumps... | {
"split": "train",
"index": 61119,
"acecode_id": "evol_14686",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates a simple machine learning model training and prediction process. Write a function named `train_and_predict` that takes the following parameters: \n- `train_data`: A list of integers representing the training data. \n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert train_and_predict([10, 20, 30], [10, 15, 25]) == [-10.0, -5.0, 5.0]\", \"assert train_and_predict([5, 5, 5], [5, 5, 5]) == [0.0, 0.0, 0.0]\", \"assert train_and_predict([1], [1, 2, 3]) == [0.0, 1.0, 2.0]\", \"assert train_and_predict([100, 200, 300], [100, 1... | {
"split": "train",
"index": 61120,
"acecode_id": "oss_33556",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Write a function `number_to_portuguese(n: int) -> str` that converts a given integer input into its Portuguese word equivalent. The input `n` will be a number between 0 and 20 (inclusive). The function should return the Portuguese word for that number. The Portuguese words for ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert number_to_portuguese(0) == 'zero'\", \"assert number_to_portuguese(1) == 'um'\", \"assert number_to_portuguese(2) == 'dois'\", \"assert number_to_portuguese(3) == 'tr\\u00eas'\", \"assert number_to_portuguese(4) == 'quatro'\", \"assert number_to_portuguese(5... | {
"split": "train",
"index": 61121,
"acecode_id": "oss_27438",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing file extensions. Your task is to implement a function that takes this list of extensions and returns a single string that concatenates these extensions in the format '*.ext1 *.ext2 ...' (where ext1, ext2 are the extensions from the l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_file_patterns(['cpp', 'h', 'py']) == '*.cpp *.h *.py'\", \"assert format_file_patterns(['txt']) == '*.txt'\", \"assert format_file_patterns(['jpg', 'png']) == '*.jpg *.png'\", \"assert format_file_patterns([]) == ''\", \"assert format_file_patterns(['... | {
"split": "train",
"index": 61122,
"acecode_id": "bigcode_python_fns_36271",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that takes a dictionary containing template metadata and extracts specific details from it. The input dictionary contains the following keys: 'template_name', 'description', 'returned', 'type', 'sample', and 'long_description'. You... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_template_metadata({'template_name': 'test_template', 'description': ['A simple test template.'], 'returned': 'success', 'type': 'str', 'sample': 'test_sample', 'long_description': ['This is a long description for the test template.']}) == {'template_na... | {
"split": "train",
"index": 61123,
"acecode_id": "oss_3706",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks if a given list of permissions contains all the necessary permissions to uninstall a specific service. The necessary permissions are defined as ['lambda:GetFunction', 'lambda:UpdateFunctionConfiguration']. Your function sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_permissions(['lambda:GetFunction', 'lambda:UpdateFunctionConfiguration']) == 'All permissions are granted.'\", \"assert check_permissions(['lambda:GetFunction', 'lambda:UpdateFunctionConfiguration', 'lambda:AnotherPermission']) == 'All permissions are ... | {
"split": "train",
"index": 61124,
"acecode_id": "bigcode_python_fns_2585",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes an integer as input and returns its square. The function should be named `square` and should accept one parameter, `number`, which is an integer. The function should return the square of the given number.\nPlease reason step by step, then write a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert square(0) == 0\", \"assert square(1) == 1\", \"assert square(2) == 4\", \"assert square(-1) == 1\", \"assert square(-2) == 4\", \"assert square(3) == 9\", \"assert square(-3) == 9\", \"assert square(10) == 100\", \"assert square(-10) == 100\", \"assert squar... | {
"split": "train",
"index": 61125,
"acecode_id": "evol_30692",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `get_setting_value(setting_name: str) -> str` that returns the value of a specified setting variable. If the setting variable does not exist, the function should return an empty string. The settings are predefined as a dictionary with... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_setting_value('LANGUAGE_CODE') == 'en-US'\", \"assert get_setting_value('TIME_ZONE') == 'UTC'\", \"assert get_setting_value('DEBUG') == 'True'\", \"assert get_setting_value('DATABASE_URL') == 'sqlite:///:memory:'\", \"assert get_setting_value('NON_EXISTE... | {
"split": "train",
"index": 61126,
"acecode_id": "bigcode_python_fns_46428",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You have a list of drives, each represented by a dictionary that contains an 'id' and an 'erase_status'. Your task is to implement a function `sanitize_drives(drives: List[Dict[str, Union[str, int]]]) -> Dict[str, Union[str, Dict[str, str]]]` which takes in a list of drives and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sanitize_drives([{'id': 'drive1', 'erase_status': 'OK'}, {'id': 'drive2', 'erase_status': 'Not OK'}]) == {'drive1': 'OK', 'drive2': 'Not OK', 'Summary': 'Sanitize Erase performed on the disks attached to the controller.'}\", \"assert sanitize_drives([{'id': ... | {
"split": "train",
"index": 61127,
"acecode_id": "bigcode_python_fns_43378",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the ranks of players in a game. Your task is to write a function that identifies the sizes of the largest sets of consecutive ranks that are the same and returns them in sorted order. The function should only return sizes of sets th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_largest_sets([1, 1, 1, 1, 1, 1, 1]) == [7]\", \"assert find_largest_sets([4, 4, 4, 4, 4, 4, 4, 4, 4, 4]) == [10]\", \"assert find_largest_sets([1, 2, 3, 4, 5]) == []\", \"assert find_largest_sets([2, 2, 2, 1, 1, 1, 1]) == [3, 4]\", \"assert find_largest... | {
"split": "train",
"index": 61128,
"acecode_id": "oss_17203",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `remove_first_element(lists)` that removes the first element from the list and returns the modified list. The function should not create a new list, but instead modify the existing one. Note that the input list will always have at ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_first_element([1, 2, 3]) == [2, 3]\", \"assert remove_first_element([5, 10, 15]) == [10, 15]\", \"assert remove_first_element([-1, 0, 1]) == [0, 1]\", \"assert remove_first_element(['a', 'b', 'c']) == ['b', 'c']\", \"assert remove_first_element([100])... | {
"split": "train",
"index": 61129,
"acecode_id": "evol_5890",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with extracting specific properties from a given dictionary that contains detector properties. Implement a function `extract_detector_properties(detprop)` that takes a dictionary `detprop` as input. The required properties to extract are: 1. `lut_vox_div`: A list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_detector_properties({'lut_vox_div': [1, 2, 3], 'n_op_channel': 4, 'op_channel_efficiency': [0.9, 0.8]}) == (True, [1, 2, 3], 4, [0.9, 0.8])\", \"assert extract_detector_properties({'lut_vox_div': [1, 2, 3], 'n_op_channel': 4}) == (False, None, None, ... | {
"split": "train",
"index": 61130,
"acecode_id": "oss_8045",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of positive integers and a target integer, write a function that returns true if any two adjacent integers in the list have a product equal to the target integer, and false otherwise. For example, if the input list is [4, 5, 10, 2] and the target is 50, the functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert product_pair([1, 2, 3, 4], 6) == True\", \"assert product_pair([2, 3, 5, 7], 15) == True\", \"assert product_pair([1, 1, 1, 1], 1) == True\", \"assert product_pair([4, 5, 10, 2], 50) == True\", \"assert product_pair([2, 2, 2, 2], 4) == True\", \"assert produ... | {
"split": "train",
"index": 61131,
"acecode_id": "evol_6748",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_valid_uuid(uuid_to_test: str, version: int = 4) -> bool` that checks if the given string `uuid_to_test` is a valid UUID according to the RFC 4122 standard. The function should accept an optional parameter `version`, which can be either 1, 2, 3, or 4. Th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_uuid('12345678123456781234567812345678') == False\", \"assert is_valid_uuid('550e8400-e29b-41d4-a716-446655440000') == True\", \"assert is_valid_uuid('550e8400-e29b-41d4-a716-446655440000', 4) == True\", \"assert is_valid_uuid('550e8400-e29b-41d4-a7... | {
"split": "train",
"index": 61132,
"acecode_id": "evol_5754",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function that encodes a given string using a simple monoalphabetic substitution cipher. The cipher shifts each letter in the string by a specified number of positions in the alphabet. The function should take two parameters: the input string and the shift value. The... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert caesar_cipher_encryptor('abc', 2) == 'cde'\", \"assert caesar_cipher_encryptor('xyz', 3) == 'abc'\", \"assert caesar_cipher_encryptor('hello world!', 1) == 'ifmmp xpsme!'\", \"assert caesar_cipher_encryptor('zebra', 1) == 'afcsb'\", \"assert caesar_cipher_en... | {
"split": "train",
"index": 61133,
"acecode_id": "evol_10519",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of home automation entities and returns their names in uppercase. Write a function `get_entity_names_in_uppercase` that takes in a single parameter `entities`, which is a list of entity objects. Each entity ob... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_entity_names_in_uppercase([{'name': 'Light'}, {'name': 'Thermostat'}]) == ['LIGHT', 'THERMOSTAT']\", \"assert get_entity_names_in_uppercase([{'name': 'fan'}, {'name': 'sensor'}, {'name': 'camera'}]) == ['FAN', 'SENSOR', 'CAMERA']\", \"assert get_entity_n... | {
"split": "train",
"index": 61134,
"acecode_id": "oss_6099",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates command-line argument parsing. The function should accept a list of strings that represent command-line arguments. The first argument is a required input file name (a string) and the second argument is an optional integer l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_arguments(['input.txt', '2']) == {'infile': 'input.txt', 'level': 2}\", \"assert parse_arguments(['input.txt']) == {'infile': 'input.txt', 'level': 0}\", \"assert parse_arguments(['input.txt', '-1']) == {'infile': 'input.txt', 'level': -1}\", \"assert ... | {
"split": "train",
"index": 61135,
"acecode_id": "bigcode_python_fns_5158",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, implement a function that sorts the strings in alphabetical order. Additionally, for each string in the list, sort the characters of that string in alphabetical order before returning the final sorted list. The sorting should be case-insensitive.\nPleas... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_strings(['abc', 'xyz', 'def']) == ['abc', 'def', 'xyz']\", \"assert sort_strings(['abcd', 'efgh', 'ijkl']) == ['abcd', 'efgh', 'ijkl']\", \"assert sort_strings(['aaa', 'bbb', 'ccc']) == ['aaa', 'bbb', 'ccc']\", \"assert sort_strings(['a', 'b', 'c', 'd']... | {
"split": "train",
"index": 61136,
"acecode_id": "evol_9358",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a function `calculate_median(numbers: List[float]) -> float` that takes a list of floating point numbers and returns the median of the numbers. The median is the middle value when the numbers are sorted. If there is an even number of values, return the average of the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_median([1.0, 3.0, 2.0]) == 2.0\", \"assert calculate_median([5.0, 1.0, 3.0]) == 3.0\", \"assert calculate_median([7.0, 8.0, 5.0, 3.0]) == 6.0\", \"assert calculate_median([2.2, 4.4, 6.6]) == 4.4\", \"assert calculate_median([10.0, 20.0]) == 15.0\",... | {
"split": "train",
"index": 61137,
"acecode_id": "evol_26463",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `reverse_and_sort(arr: List[Union[int, float, str]], pos: int) -> List[Union[int, float, str]]` that takes an array `arr` and an integer `pos`. The function should reverse the elements of the array up to the specified index `pos`, and then sort the remaining el... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_and_sort([], 3) == []\", \"assert reverse_and_sort([1, 2, 3], 0) == [3, 2, 1]\", \"assert reverse_and_sort([1, 2, 3], 3) == [3, 2, 1]\", \"assert reverse_and_sort([1.5, 2.5, 3.5], 2) == [2.5, 1.5, 3.5]\", \"assert reverse_and_sort([3, 2, 1], 2) == [2... | {
"split": "train",
"index": 61138,
"acecode_id": "evol_34811",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with validating a list of button inputs for a control stage. Implement a function named `validate_buttons(buttons: List[int]) -> None` that checks whether the provided `buttons` list meets the following criteria: 1. It must be a list of integers. 2. It must conta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_buttons([1, 2, 3, 4]) is None\", \"assert validate_buttons([2, 3, 1, 4]) is None\", \"assert validate_buttons([4, 3, 2, 1]) is None\", \"assert validate_buttons([1, 2, 3, 4]) is None\", \"assert validate_buttons([3, 4, 1, 2]) is None\", \"assert val... | {
"split": "train",
"index": 61139,
"acecode_id": "bigcode_python_fns_5504",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given two values representing the predicted price of a house based on certain features. Your task is to implement a function that checks whether the absolute difference between the two predicted prices does not exceed $5000. The function should return True if the differ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_price_similar(250000.0, 245000.0) == True\", \"assert is_price_similar(300000.0, 295000.0) == True\", \"assert is_price_similar(200000.0, 205000.0) == True\", \"assert is_price_similar(150000.0, 154000.0) == True\", \"assert is_price_similar(100000.0, 950... | {
"split": "train",
"index": 61140,
"acecode_id": "bigcode_python_fns_18535",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given the dimensions of an image represented by its width and height in pixels, along with a border removal percentage and a patch width. Your task is to implement a function that calculates the total number of pixels to be removed from the border of the image based on ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_border_removal(800, 600, 0.04, 8) == 32\", \"assert calculate_border_removal(1024, 768, 0.0, 16) == 0\", \"assert calculate_border_removal(800, 600, 0.1, 8) == 80\", \"assert calculate_border_removal(1600, 900, 0.02, 8) == 32\", \"assert calculate_... | {
"split": "train",
"index": 61141,
"acecode_id": "bigcode_python_fns_2720",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the creation of a template rendering environment. The function `create_template_environment(templates_dir: str) -> dict` takes a directory name as input and returns a dictionary representing the environment settings for tem... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_template_environment('my_templates') == {'loader': 'PackageLoader(charmcraft, templates/my_templates)', 'autoescape': False, 'keep_trailing_newline': True, 'optimized': False, 'undefined': 'StrictUndefined'}\", \"assert create_template_environment('yo... | {
"split": "train",
"index": 61142,
"acecode_id": "bigcode_python_fns_41642",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with redirecting log messages from one output stream to another within a logging system. Implement a function `redirectLoggerStreamHandlers(oldStream: Any, newStream: Any) -> None` that takes in two parameters, `oldStream` and `newStream`, representing the curren... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert redirectLoggerStreamHandlers(sys.stdout, sys.stderr) is None\", \"assert redirectLoggerStreamHandlers(sys.stderr, sys.stdout) is None\", \"assert redirectLoggerStreamHandlers(open('old_log.txt', 'w'), open('new_log.txt', 'w')) is None\", \"assert redirectLog... | {
"split": "train",
"index": 61143,
"acecode_id": "bigcode_python_fns_412",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating a broker URL for a messaging system based on the provided host and predefined configuration parameters. Write a function `generate_broker_url(host: str) -> str` that constructs the URL using the following format: '{broker_scheme}://{username}:{pas... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_broker_url('localhost') == 'amqp://user:pass@localhost:5672//'\", \"assert generate_broker_url('192.168.1.1') == 'amqp://user:pass@192.168.1.1:5672//'\", \"assert generate_broker_url('example.com') == 'amqp://user:pass@example.com:5672//'\", \"asser... | {
"split": "train",
"index": 61144,
"acecode_id": "bigcode_python_fns_3386",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of Tic-Tac-Toe boards, where each board is represented as a list of strings. Each string represents a row of the board, containing three characters: 'X', 'O', or ' ' (space). Your task is to implement a function `print_boards(boards)` that prints each Tic-T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert print_boards([['XO ', 'OX ', 'X O'], ['X ', ' OX', 'O X']]) is None\", \"assert print_boards([['XOX', ' O ', 'XOX'], [' O ', 'XOX', ' O ']]) is None\", \"assert print_boards([[' ', ' ', ' ']]) is None\", \"assert print_boards([['XOX', 'XOX', 'XOX'], [... | {
"split": "train",
"index": 61145,
"acecode_id": "oss_25364",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates user profile data. The function should take two parameters: a string representing the user's full name and a string representing the user's email address. The function should return True if the full name is not empty and th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_user_profile('John Doe', 'john.doe@example.com') == True\", \"assert validate_user_profile('Jane Smith', 'jane.smith@domain.org') == True\", \"assert validate_user_profile('', 'john.doe@example.com') == False\", \"assert validate_user_profile('John ... | {
"split": "train",
"index": 61146,
"acecode_id": "oss_1508",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that resets a table view (TV) component's columns to their initial settings. The function, named `reset_tv_columns`, takes two parameters: a list of current column settings and a list of initial column settings. It should return a new... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reset_tv_columns(['col1', 'col2', 'col3'], ['init1', 'init2', 'init3']) == ['init1', 'init2', 'init3']\", \"assert reset_tv_columns(['col1', 'col2'], ['init1', 'init2', 'init3']) == ['col1', 'col2']\", \"assert reset_tv_columns(['col1'], ['init1']) == ['init... | {
"split": "train",
"index": 61147,
"acecode_id": "oss_10133",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that selects a random word from a predefined list of words, ensuring that previously selected words are not chosen again. The function should take a list of indices representing already used words and return a randomly selected word along... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert select_random_word([0]) != 'hangman'\", \"assert select_random_word([1]) != 'kanban'\", \"assert select_random_word([2]) != 'evidence'\", \"assert select_random_word([3]) != 'problem'\", \"assert select_random_word([4]) != 'decomposed'\", \"assert select_ran... | {
"split": "train",
"index": 61148,
"acecode_id": "bigcode_python_fns_27941",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a mute role in a server for a chat application. The mute role should have specific permissions: users with this role should be able to read messages but not send messages. Your function should take a list of channel names a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_mute_role(['general', 'random']) == [{'channel': 'general', 'send_messages': False, 'read_messages': True}, {'channel': 'random', 'send_messages': False, 'read_messages': True}]\", \"assert create_mute_role(['announcements', 'help']) == [{'channel': '... | {
"split": "train",
"index": 61149,
"acecode_id": "bigcode_python_fns_20138",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with determining if a given text channel fits into any of a list of section criteria. Each section has its own method to check if it fits a text channel. Implement a function `list_fits(section_list: list, text_channel: str) -> bool` that takes a list of section ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert list_fits([SectionMock(True)], 'general') == True\", \"assert list_fits([SectionMock(False)], 'general') == False\", \"assert list_fits([SectionMock(True), SectionMock(False)], 'general') == True\", \"assert list_fits([SectionMock(False), SectionMock(False)]... | {
"split": "train",
"index": 61150,
"acecode_id": "oss_15727",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a signal handler. The function should accept an integer representing a signal number and modify a dictionary to indicate whether certain signals have been received. The signals of interest are SIGTERM (value 15), SIGINT... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert signal_handler(15) == {'down': True, 'hup': False}\", \"assert signal_handler(2) == {'down': True, 'hup': False}\", \"assert signal_handler(1) == {'down': False, 'hup': True}\", \"assert signal_handler(0) == {'down': False, 'hup': False}\", \"assert signal_h... | {
"split": "train",
"index": 61151,
"acecode_id": "bigcode_python_fns_49320",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `sentiment_analysis(sentence: str) -> str` that categorizes the given text as 'Positive', 'Neutral', or 'Negative' based on its sentiment. The function should consider the presence of negation and emoticons in the sentence. Use a simple scoring mechanism wh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sentiment_analysis('I love this movie :)') == 'Positive'\", \"assert sentiment_analysis('This is the worst experience ever :( ') == 'Negative'\", \"assert sentiment_analysis('The event was okay.') == 'Neutral'\", \"assert sentiment_analysis('I am feeling gre... | {
"split": "train",
"index": 61152,
"acecode_id": "evol_27585",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a metric profile for a fan-in system. A fan-in profile consists of several metric regions defined by their name and their range of values. The metric regions are as follows: \n1. '1-10' covering values from 1 to 10 (inclusi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_fan_in_profile() == [{'name': '1-10', 'range': [1, 10]}, {'name': '11-20', 'range': [11, 20]}, {'name': '21-50', 'range': [21, 50]}, {'name': '50+', 'range': [51, 1000]}]\", \"assert create_fan_in_profile()[0] == {'name': '1-10', 'range': [1, 10]}\", ... | {
"split": "train",
"index": 61153,
"acecode_id": "bigcode_python_fns_41989",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the unit vector for a given numerical input value. A unit vector is a vector with a magnitude of 1 that points in the same direction as the original vector. Your function `unit_vector` should take a single numerical ar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unit_vector(5) == [1.0, 0.0]\", \"assert unit_vector(0) == [0.0, 0.0]\", \"assert unit_vector(10) == [1.0, 0.0]\", \"assert unit_vector(1) == [1.0, 0.0]\", \"assert unit_vector(3) == [1.0, 0.0]\", \"assert unit_vector(7) == [1.0, 0.0]\", \"assert unit_vector... | {
"split": "train",
"index": 61154,
"acecode_id": "oss_28040",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a class Property that takes a name and a value, implement a function `is_property_valid(prop: Property) -> bool` that returns True if the property is valid. A property is considered valid if its value is not None, not an empty string, and not an empty list. If the value i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_property_valid(Property('Name', '')) is False\", \"assert is_property_valid(Property('Name', 'value')) is True\", \"assert is_property_valid(Property('Name', [])) is False\", \"assert is_property_valid(Property('Name', [1, 2, 3])) is True\", \"assert is_p... | {
"split": "train",
"index": 61155,
"acecode_id": "bigcode_python_fns_3685",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to determine if a given polygon is completely contained within a specified bounding box. The function should take the bounding box and a polygon as input and return `True` if the polygon lies entirely within the bounding box, and `Fal... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_polygon_within_bbox((0, 0, 5, 5), [(1, 1), (4, 1), (4, 4), (1, 4)]) == True\", \"assert is_polygon_within_bbox((0, 0, 5, 5), [(6, 6), (8, 6), (8, 8), (6, 8)]) == False\", \"assert is_polygon_within_bbox((0, 0, 2, 2), [(0, 0), (1, 0), (1, 1), (0, 1)]) == T... | {
"split": "train",
"index": 61156,
"acecode_id": "oss_14436",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates the management of a network of connections based on a given configuration. The function should take in two parameters: `settings`, which is a list of dictionaries where each dictionary contains connection details (in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_connections([{'name': 'conn1', 'ip': '192.168.1.1', 'port': 8080}], True) == [{'name': 'conn1', 'ip': '192.168.1.1', 'port': 8080, 'status': 'bound'}]\", \"assert manage_connections([{'name': 'conn2', 'ip': '192.168.1.2', 'port': 8081}], False) == [{'... | {
"split": "train",
"index": 61157,
"acecode_id": "oss_5711",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that extracts the integer component of a floating-point number. This function should return the largest integer less than or equal to the input number for positive numbers, and the smallest integer greater than or equal to the input number for negative numb... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_integer(4.7) == 4\", \"assert extract_integer(-3.2) == -3\", \"assert extract_integer(0.0) == 0\", \"assert extract_integer(5.5) == 5\", \"assert extract_integer(-1.1) == -1\", \"assert extract_integer(2.9) == 2\", \"assert extract_integer(-4.8) == -... | {
"split": "train",
"index": 61158,
"acecode_id": "evol_7424",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that merges two strings by alternating their characters. If one string is longer than the other, append the remaining characters of the longer string to the end of the merged string. The function should take in two strings as parameters and return the me... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_strings('abc', '123') == 'a1b2c3'\", \"assert merge_strings('abcde', '12') == 'a1b2cde'\", \"assert merge_strings('', '12345') == '12345'\", \"assert merge_strings('hello', '') == 'hello'\", \"assert merge_strings('a', 'b') == 'ab'\", \"assert merge_st... | {
"split": "train",
"index": 61159,
"acecode_id": "evol_35675",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that identifies specific import statements in a list of Python file contents. Your function should return a list of tuples, where each tuple contains the file name and the specific import statement found in that file. The function ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_import_statements([\\\"# File 1\\\\nimport os\\\\n\\\"], 'from ygo import globals') == []\", \"assert find_import_statements([\\\"# File 1\\\\nfrom abc import xyz\\\\n\\\"], 'from ygo import globals') == []\", \"assert find_import_statements([\\\"# File... | {
"split": "train",
"index": 61160,
"acecode_id": "oss_1102",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a user's current height in centimeters and an object containing the user's preferred unit of length and an amount to modify their height. Your task is to implement a function `modify_height(current_height: float, height_change: dict) -> float` that takes two param... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert modify_height(170, {'unit': 'cm', 'amount': 10}) == 180\", \"assert modify_height(170, {'unit': 'in', 'amount': 5}) == 170 + 5 * 2.54\", \"assert modify_height(180, {'unit': 'cm', 'amount': -5}) == 175\", \"assert modify_height(160, {'unit': 'in', 'amount': ... | {
"split": "train",
"index": 61161,
"acecode_id": "oss_16022",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function to find the nth nonagonal number using recursion and memoization for optimization. The function should also handle cases where the input is not a positive integer or exceeds 1000. The function should return 'Please provide a positive integer.' if the input is n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert nonagonal_number(1) == 1\", \"assert nonagonal_number(1001) == 'Input is too large. Please provide an input less than or equal to 1000.'\", \"assert nonagonal_number(0) == 'Please provide a positive integer.'\", \"assert nonagonal_number(-10) == 'Please prov... | {
"split": "train",
"index": 61162,
"acecode_id": "evol_10432",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings representing Python code lines, write a function `contains_vendored_imports(code_lines)` that returns `True` if any line contains either 'import botocore.vendored' or 'from botocore.vendored import'. If none of the lines contain these strings, return `Fa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert contains_vendored_imports(['import os', 'import sys']) == False\", \"assert contains_vendored_imports(['import botocore.vendored']) == True\", \"assert contains_vendored_imports(['from botocore.vendored import something']) == True\", \"assert contains_vendor... | {
"split": "train",
"index": 61163,
"acecode_id": "bigcode_python_fns_31331",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to validate Chinese citizen identification numbers (ID numbers). Chinese citizen ID numbers consist of 18 characters, where the first 17 characters are digits (0-9) and the last character can either be a digit (0-9) or the letter 'X'.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_id_number('11010119900307651X') == True\", \"assert validate_id_number('123456789012345678') == False\", \"assert validate_id_number('12345678901234567Z') == False\", \"assert validate_id_number('98765432101234567Y') == False\", \"assert validate_id... | {
"split": "train",
"index": 61164,
"acecode_id": "oss_33795",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to implement a function `find_duplicates(arr)` that returns a list of integers that appear more than once in the input list, preserving their order of first appearance. If there are no duplicates, return an empty list. The input li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_duplicates([1, 2, 3, 4, 5]) == []\", \"assert find_duplicates([5, 5, 5, 5]) == [5]\", \"assert find_duplicates([-1, -2, -1, -3, -2]) == [-1, -2]\", \"assert find_duplicates([]) == []\", \"assert find_duplicates([1]) == []\", \"assert find_duplicates([2,... | {
"split": "train",
"index": 61165,
"acecode_id": "oss_17403",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function called `product_properties(serial_number: str) -> Tuple[bool, bool]`. This function takes a string `serial_number` representing the serial number of a product and returns a tuple of two boolean values. The first boolean indicates whet... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert product_properties('abc123') == (True, True)\", \"assert product_properties('xyz456') == (False, False)\", \"assert product_properties('test789') == (True, True)\", \"assert product_properties('12345') == (False, True)\", \"assert product_properties('vowel')... | {
"split": "train",
"index": 61166,
"acecode_id": "oss_22015",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of dictionaries, implement a function that counts the occurrences of values associated with a specified key across all dictionaries in the list. The function should take two parameters: a list of dictionaries and a string representing the key to count occurrences f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_key_occurrences([], 'name') == {}\", \"assert count_key_occurrences([{'name': 'Alice'}, {'name': 'Bob'}], 'name') == {'Alice': 1, 'Bob': 1}\", \"assert count_key_occurrences([{'name': 'Alice'}, {'name': 'Alice'}, {'name': 'Alice'}], 'name') == {'Alice'... | {
"split": "train",
"index": 61167,
"acecode_id": "oss_4568",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function `clone_file_info(input: str, output: str) -> bool` that simulates the process of cloning data from one file to another. The function should take two parameters: `input`, which is the name of the source file, and `output`, which is the name... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert clone_file_info('source.txt', 'destination.txt') == True\", \"assert clone_file_info('data.csv', 'backup.csv') == True\", \"assert clone_file_info('report.pdf', 'report_copy.pdf') == True\", \"assert clone_file_info('image.png', 'image_copy.png') == True\", ... | {
"split": "train",
"index": 61168,
"acecode_id": "bigcode_python_fns_35858",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an array of `n` strings `strs`, all of the same length. These strings can be arranged in a grid, where each string represents a row. Your task is to implement a function that counts the number of columns that must be deleted so that the remaining columns are sorte... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert minDeletionSize(['cba', 'daf', 'ghi']) == 1\", \"assert minDeletionSize(['a', 'b']) == 0\", \"assert minDeletionSize(['zyx', 'wvu', 'tsr']) == 3\", \"assert minDeletionSize(['abc', 'bce', 'cae']) == 1\", \"assert minDeletionSize(['x', 'y', 'z']) == 0\", \"as... | {
"split": "train",
"index": 61169,
"acecode_id": "evol_9302",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a dictionary as input and returns a string representation of its key-value pairs sorted by keys in a specific format. The keys should be sorted in ascending order, and each key-value pair should be represented as 'key:value'. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert keyify_dict({'b': 2, 'a': 1}) == 'a:1,b:2'\", \"assert keyify_dict({'c': 3, 'a': 1, 'b': 2}) == 'a:1,b:2,c:3'\", \"assert keyify_dict({'x': 10, 'y': 20, 'z': 30}) == 'x:10,y:20,z:30'\", \"assert keyify_dict({'apple': 5, 'banana': 3, 'cherry': 7}) == 'apple:5... | {
"split": "train",
"index": 61170,
"acecode_id": "bigcode_python_fns_20632",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a string representation of a valid equivalence class. The equivalence class should always be the string 'VALID'. Implement a function called `get_equivalence_class` that takes no parameters and returns the string 'VALID'.\n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_equivalence_class() == 'VALID'\", \"assert get_equivalence_class() == 'VALID'\", \"assert get_equivalence_class() == 'VALID'\", \"assert get_equivalence_class() == 'VALID'\", \"assert get_equivalence_class() == 'VALID'\", \"assert get_equivalence_class()... | {
"split": "train",
"index": 61171,
"acecode_id": "oss_22524",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two numerical inputs, `nir` (representing the Near Infrared band acquisition) and `swir1` (representing the Short Wave Infrared band acquisition), implement a function `ndmi(nir: float, swir1: float) -> float` that calculates the Normalized Difference Moisture Index (NDMI... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert ndmi(0.0, 0.0) == 0.0\", \"assert ndmi(1.0, 1.0) == 0.0\", \"assert ndmi(2.0, 1.0) == 0.3333333333333333\", \"assert ndmi(3.0, 1.0) == 0.5\", \"assert ndmi(10.0, 0.0) == 1.0\", \"assert ndmi(0.0, 10.0) == -1.0\", \"assert ndmi(5.0, 5.0) == 0.0\", \"assert nd... | {
"split": "train",
"index": 61172,
"acecode_id": "bigcode_python_fns_1961",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing tab-delimited data records where each record consists of several columns. Your task is to extract specific columns from this data. Write a function `extract_columns(data: List[str]) -> List[List[str]]` that takes a list of strings an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_columns(['col0\\tcol1\\tcol2\\tcol3\\tcol4', 'val0\\tval1\\tval2\\tval3\\tval4']) == [['col0', 'col1', 'col2', 'col4'], ['val0', 'val1', 'val2', 'val4']]\", \"assert extract_columns(['a\\tb\\tc\\td\\te', '1\\t2\\t3\\t4\\t5', 'foo\\tbar\\tbaz']) == [[... | {
"split": "train",
"index": 61173,
"acecode_id": "oss_35311",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that takes a list of integers and a binary operation (function) as arguments. The function should apply the binary operation sequentially to the elements of the list, starting from the first element. The result of applying the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binary_operation([1, 2, 3, 4], lambda x, y: x + y) == 10\", \"assert binary_operation([5, 5, 5], lambda x, y: x * y) == 125\", \"assert binary_operation([1], lambda x, y: x - y) == 1\", \"assert binary_operation([], lambda x, y: x + y) == None\", \"assert bi... | {
"split": "train",
"index": 61174,
"acecode_id": "oss_26047",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that generates a command for running a simulation tool based on specified parameters. The function should take in the following parameters: \n\n- `OPENRAM_HOME` (str): A string representing the path to the OpenRAM home directory. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_simulation_command('/path/to/openram', 'techA', 'output.txt', '/path/to/output', '--verbose') == 'coverage run -p /path/to/openram/openram.py -n -o output.txt -p /path/to/output --verbose 2>&1 > /path/to/output/output.log'\", \"assert generate_simul... | {
"split": "train",
"index": 61175,
"acecode_id": "oss_13858",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the scores of a group of students. Your task is to implement a function that takes this list of scores and returns a tuple containing two values: the average score of the students and the highest score from the list. The average sco... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_scores([90, 80, 70]) == (80.0, 90)\", \"assert calculate_scores([100, 90, 95, 85]) == (92.5, 100)\", \"assert calculate_scores([50, 60, 70, 80]) == (65.0, 80)\", \"assert calculate_scores([0, 0, 0]) == (0.0, 0)\", \"assert calculate_scores([45]) ==... | {
"split": "train",
"index": 61176,
"acecode_id": "bigcode_python_fns_25720",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `mobilenet_wd4_cub(num_classes: int = 200) -> str` that returns a string representation of a MobileNet model configuration based on the number of classes specified. The model configuration should include the width scale set to 0.25 and the model name as 'mo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert mobilenet_wd4_cub() == 'Model Name: mobilenet_wd4_cub, Width Scale: 0.25, Number of Classes: 200'\", \"assert mobilenet_wd4_cub(100) == 'Model Name: mobilenet_wd4_cub, Width Scale: 0.25, Number of Classes: 100'\", \"assert mobilenet_wd4_cub(50) == 'Model Nam... | {
"split": "train",
"index": 61177,
"acecode_id": "bigcode_python_fns_30770",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of string module names and simulates the reloading of these modules. Write a function called `simulate_module_reloading` that takes a list of module names (strings) as input and performs the following actions:... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_module_reloading(['csa', 'da', 'oa', 'cs', 'sa', 'da', 'qea']) == {'csa': 'csa reloaded', 'da': 'da reloaded', 'oa': 'oa reloaded', 'cs': 'cs reloaded', 'sa': 'sa reloaded', 'qea': 'qea reloaded'}\", \"assert simulate_module_reloading(['module1', 'm... | {
"split": "train",
"index": 61178,
"acecode_id": "oss_6072",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of instruments and their corresponding labels and colors. Each instrument has associated confidence contours represented by a dictionary containing 'amplitude_alpha', 'amplitude_beta', and 'alpha_beta'. Your task is to implement a function that takes in the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_contour_data(['fermi'], ['Fermi-LAT'], ['red'], [{'amplitude': [1], 'alpha': [2.2]}, {'amplitude': [3], 'beta': [0.2]}, {'alpha': [2.2], 'beta': [0.2]}]) == [{'instrument': 'fermi', 'label': 'Fermi-LAT', 'color': 'red', 'contours': {'amplitude_alpha':... | {
"split": "train",
"index": 61179,
"acecode_id": "bigcode_python_fns_23320",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of commands represented as lists of strings, where the first element is the command name and the subsequent elements are its arguments. The function should support the command 'os-apply-config' and two argumen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_commands([['os-apply-config', '--metadata', '/path/to/metadata', '--boolean-key', 'true']]) == [0]\", \"assert process_commands([['os-apply-config', '--metadata', '/path/to/metadata', '--boolean-key', 'false']]) == [0]\", \"assert process_commands([[... | {
"split": "train",
"index": 61180,
"acecode_id": "oss_25287",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with assigning tasks to workers based on their capacities. Each task is labeled with a unique ID from `0` to `n - 1`. You are given an integer array `workerCapacities`, where `workerCapacities[i]` indicates the number of tasks that worker `i` can handle. Your goa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert assignTasks([1,1,1,1,1]) in [[[0],[1],[2],[3],[4]], [[4],[3],[2],[1],[0]]]\", \"assert assignTasks([0,0,0,1]) == [[],[],[],[0]]\", \"assert assignTasks([3,2,1]) in [[[0,1,2],[3,4],[5]],[[1,2,3],[0,4],[5]]]\", \"assert assignTasks([1,3]) in [[[0],[1,2,3]],[[1... | {
"split": "train",
"index": 61181,
"acecode_id": "evol_23039",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function to generate a class configuration string for a code block in a code editor application. The function should take the following parameters: a string `brush` representing the programming language of the code, a string `code` representing th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_class_configuration('python', 'print(\\\"Hello, World!\\\")', 20, 1, 1) == \\\"brush: python;toolbar: true;class-name: '20'gutter: true;first-line: 1;\\\"\", \"assert generate_class_configuration('javascript', 'console.log(\\\"Hello, World!\\\")', 1... | {
"split": "train",
"index": 61182,
"acecode_id": "oss_11727",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary and a unique string, implement a Python function that returns a list of all the key-value pairs (as tuples) in the dictionary where either the key or the value contains the given string. If the dictionary is empty or if no pairs match the search string, retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert print_matching_pairs({'apple': 1, 'banana': 2, 'cherry': 3}, 'a') == [('apple', 1), ('banana', 2)]\", \"assert print_matching_pairs({'apple': 1, 'banana': 2, 'cherry': 3}, 'z') == []\", \"assert print_matching_pairs({}, 'a') == []\", \"assert print_matching_... | {
"split": "train",
"index": 61183,
"acecode_id": "evol_29638",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of file names and a database name. Write a function `validate_files(file_names: List[str], db_name: str) -> List[str]` that checks the validity of each file name and the database name. The function should return a list of invalid file names and the database... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_files(['file1.tsv', 'file2.txt'], 'database.db') == ['file2.txt']\", \"assert validate_files(['file1.tsv'], 'database.db') == []\", \"assert validate_files([], 'database.db') == []\", \"assert validate_files(['file1.tsv'], 'invalid_database.db') == ... | {
"split": "train",
"index": 61184,
"acecode_id": "bigcode_python_fns_17773",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of payload values for different flight phases and determines the maximum payload from the list. The function should then calculate the fuel required for each flight phase based on the maximum payload according to a p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_fuel_with_max_payload([1000, 1200, 1100, 1300]) == {0: 650.0, 1: 650.0, 2: 650.0, 3: 650.0}\", \"assert calculate_fuel_with_max_payload([1500, 1600, 1550, 1700]) == {0: 850.0, 1: 850.0, 2: 850.0, 3: 850.0}\", \"assert calculate_fuel_with_max_payloa... | {
"split": "train",
"index": 61185,
"acecode_id": "oss_9461",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of unique integers, implement a function `rearrange(arr)` that rearranges the elements such that all prime numbers appear on the left and non-prime numbers appear on the right. Both the prime and non-prime numbers should be sorted in ascending order. The function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rearrange([3, 1, 4, 6, 5, 2]) == [2, 3, 5, 1, 4, 6]\", \"assert rearrange([1, 2, 3, 4, 5, 6]) == [2, 3, 5, 1, 4, 6]\", \"assert rearrange([17, 19, 21, 23, 24, 25]) == [17, 19, 23, 21, 24, 25]\", \"assert rearrange([9, 8, 7, 6, 5, 4]) == [5, 7, 4, 6, 8, 9]\",... | {
"split": "train",
"index": 61186,
"acecode_id": "evol_8725",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `safe_division(numerator: float, denominator: float) -> float` that takes two floating-point numbers as input and returns the result of dividing the numerator by the denominator. If the denominator is zero, the function should return None instead of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert safe_division(10, 2) == 5.0\", \"assert safe_division(5, 0) == None\", \"assert safe_division(-10, 2) == -5.0\", \"assert safe_division(0, 5) == 0.0\", \"assert safe_division(3.5, 1.5) == 2.3333333333333335\", \"assert safe_division(1, 0) == None\", \"assert... | {
"split": "train",
"index": 61187,
"acecode_id": "evol_15788",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `zeros_like_list` that returns a new list of the same length, where all elements are set to zero. The resulting list should have the same type as the input list (i.e., if the input list contains integers, the output should contain zero... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert zeros_like_list([1, 2, 3]) == [0, 0, 0]\", \"assert zeros_like_list([-1, -2, -3]) == [0, 0, 0]\", \"assert zeros_like_list([0, 0, 0]) == [0, 0, 0]\", \"assert zeros_like_list([100, 200]) == [0, 0]\", \"assert zeros_like_list([5]) == [0]\", \"assert zeros_lik... | {
"split": "train",
"index": 61188,
"acecode_id": "bigcode_python_fns_48483",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D binary matrix filled with '0's and '1's. Write a function `maximalSquare(matrix: List[List[str]]) -> int` to find the size of the largest square containing only '1's and return its area. The input matrix will only contain '0' and '1' strings. If there are no ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert maximalSquare([['0', '0'], ['0', '0']]) == 0\", \"assert maximalSquare([['1', '1'], ['1', '1']]) == 4\", \"assert maximalSquare([['1', '0', '1'], ['1', '1', '1'], ['1', '0', '1']]) == 1\", \"assert maximalSquare([['1', '1', '1'], ['1', '1', '1'], ['1', '1', ... | {
"split": "train",
"index": 61189,
"acecode_id": "oss_11230",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes in a list of environment variable strings formatted as 'key=value', where 'key' is the name of the environment variable and 'value' is its corresponding value. Your task is to parse the input list and construct a dictionary... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_environment_variables([]) == {}\", \"assert parse_environment_variables(['USER=johndoe']) == {'USER': 'johndoe'}\", \"assert parse_environment_variables(['HOST=localhost', 'PORT=8080']) == {'HOST': 'localhost', 'PORT': '8080'}\", \"assert parse_environ... | {
"split": "train",
"index": 61190,
"acecode_id": "oss_33136",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, write a function that takes this list as input and returns a new list containing only the strings that start with the letter 'A'. The output list should maintain the order of the strings as they appeared in the input list. If there are no strings that s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_strings(['Apple', 'banana', 'Avocado', 'grape']) == ['Apple', 'Avocado']\", \"assert filter_strings(['cat', 'dog', 'elephant']) == []\", \"assert filter_strings(['Ant', 'Bear', 'Alligator']) == ['Ant', 'Alligator']\", \"assert filter_strings(['a', 'b'... | {
"split": "train",
"index": 61191,
"acecode_id": "bigcode_python_fns_11988",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `replace_negatives_with_zero(nums)` that replaces all negative integers in the list with zero and returns the modified list. If the list is empty, return an empty list. The function should not modify the original list. \n\n### Example:... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_negatives_with_zero([-1, 2, -3, 4, -5]) == [0, 2, 0, 4, 0]\", \"assert replace_negatives_with_zero([1, -2, 3, -4]) == [1, 0, 3, 0]\", \"assert replace_negatives_with_zero([-1, -1, -1]) == [0, 0, 0]\", \"assert replace_negatives_with_zero([0, 0, 0]) =... | {
"split": "train",
"index": 61192,
"acecode_id": "bigcode_python_fns_43632",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of bookmarks and their associated tags, write a function `get_user_tags(bookmarks: List[Dict[str, Any]], user_id: int) -> List[str]` that returns a list of unique tags associated with the bookmarks of the user identified by `user_id`. Each bookmark is represented a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_user_tags([{'user_id': 2, 'tags': ['sports', 'music']}, {'user_id': 3, 'tags': ['art', 'history']}], 2) == ['sports', 'music']\", \"assert get_user_tags([{'user_id': 1, 'tags': ['tag1']}, {'user_id': 1, 'tags': ['tag2']}, {'user_id': 2, 'tags': ['tag3']}... | {
"split": "train",
"index": 61193,
"acecode_id": "bigcode_python_fns_13717",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that reads a list of dictionaries representing image annotations in a COCO-like format and processes them to return the total number of unique categories and the total number of images. Each annotation dictionary contains an 'image_id... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_annotations([{'image_id': 1, 'category_id': 1}, {'image_id': 2, 'category_id': 2}, {'image_id': 1, 'category_id': 2}]) == (2, 2)\", \"assert process_annotations([{'image_id': 1, 'category_id': 1}]) == (1, 1)\", \"assert process_annotations([]) == (0,... | {
"split": "train",
"index": 61194,
"acecode_id": "bigcode_python_fns_28379",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `f(n)` that accepts an integer `n` and returns a list of length `n`, where each element at index `i` (starting from 0) represents the factorial of `i + 1` if `i + 1` is even, and the summation of numbers from 1 to `i + 1` if `i + 1` is odd. The factorial of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert f(1) == [1]\", \"assert f(2) == [1, 2]\", \"assert f(3) == [1, 2, 6]\", \"assert f(4) == [1, 2, 6, 24]\", \"assert f(5) == [1, 2, 6, 24, 15]\", \"assert f(6) == [1, 2, 6, 24, 15, 720]\", \"assert f(7) == [1, 2, 6, 24, 15, 720, 28]\", \"assert f(8) == [1, 2, ... | {
"split": "train",
"index": 61195,
"acecode_id": "evol_8423",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing the versioning of a software package. Write a function `check_version(current_version: str, expected_version: str) -> bool` that takes in two strings: `current_version` and `expected_version`. The function should return `True` if the `current_versio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_version('0.0.7', '0.0.7') == True\", \"assert check_version('1.0.0', '1.0.0') == True\", \"assert check_version('2.1.3', '2.1.3') == True\", \"assert check_version('1.2.3', '1.2.4') == False\", \"assert check_version('1.10.2', '1.10.2') == True\", \"as... | {
"split": "train",
"index": 61196,
"acecode_id": "bigcode_python_fns_15641",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a string input representing a base Process Variable (PV) for a Fixed Focus Kirkpatrick-Baez Mirror. The function should return the base PV, ensuring it is in uppercase and has no leading or trailing whitespace. Implement a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_pv(' mirror ') == 'MIRROR'\", \"assert format_pv(' basePV ') == 'BASEPV'\", \"assert format_pv('kirkpatrick-baez') == 'KIRKPATRICK-BAEZ'\", \"assert format_pv(' LCLS-II ') == 'LCLS-II'\", \"assert format_pv('ToyamaDesigns') == 'TOYAMADESIGNS'\",... | {
"split": "train",
"index": 61197,
"acecode_id": "oss_35428",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `validate_ip(ip_address: str) -> str` that takes a string `ip_address` as input and determines whether it is a valid IPv4 or IPv6 address. If the address is a valid IPv4 address, return 'Valid IPv4'. If it is a valid IPv6 address, return 'Valid IPv6'. If the ad... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_ip('192.168.1.1') == 'Valid IPv4'\", \"assert validate_ip('255.255.255.255') == 'Valid IPv4'\", \"assert validate_ip('0.0.0.0') == 'Valid IPv4'\", \"assert validate_ip('127.0.0.1') == 'Valid IPv4'\", \"assert validate_ip('2001:0db8:85a3:0000:0000:8a... | {
"split": "train",
"index": 61198,
"acecode_id": "evol_20872",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function called `get_sorted_installed_modules` that returns a list of all installed Python modules in the current environment, excluding those that were updated within the last week. The list should be sorted in alphabetical order and contain the module names along with... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_sorted_installed_modules() == []\", \"assert isinstance(get_sorted_installed_modules(), list)\", \"assert all(isinstance(module, str) for module in get_sorted_installed_modules())\", \"assert all('==' in module for module in get_sorted_installed_modules(... | {
"split": "train",
"index": 61199,
"acecode_id": "evol_12286",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.