data_source
large_stringclasses
1 value
prompt
listlengths
1
1
ability
large_stringclasses
1 value
reward_model
dict
extra_info
dict
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes in a list of dictionaries representing genetic kit information and returns a formatted string that summarizes this information. Each dictionary contains the following keys: 'kit', 'group', 'ancestor', 'country', and 'haplogroup...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_kit_info([{'kit': 'YF104', 'group': 'E', 'ancestor': 'Sarah', 'country': 'Germany', 'haplogroup': 'G1'}]) == 'Kit Number: YF104, Group: E, Paternal Ancestor Name: Sarah, Country: Germany, Haplogroup: G1'\", \"assert format_kit_info([]) == ''\", \"asse...
{ "split": "train", "index": 77100, "acecode_id": "bigcode_python_fns_18399", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Implement a function that checks if two given strings are anagrams of each other. Two strings are considered anagrams if they contain the same characters in the same frequency but may be in a different order. The function should return True if the strings are anagrams, and Fals...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_permutation('listen', 'silent') == True\", \"assert check_permutation('triangle', 'integral') == True\", \"assert check_permutation('apple', 'pale') == False\", \"assert check_permutation('rat', 'car') == False\", \"assert check_permutation('evil', 'vi...
{ "split": "train", "index": 77101, "acecode_id": "evol_18839", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a command string that represents a meta command in a database interface. Your task is to implement a function that checks if the command is a valid meta command and returns the appropriate response based on the command. The available commands are: '\\l' for listin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_meta_command('\\\\d?') == True\", \"assert check_meta_command('help') == True\", \"assert check_meta_command('?') == True\", \"assert check_meta_command('\\\\conninfo') == True\", \"assert check_meta_command('\\\\dt my_schema') == True\", \"assert chec...
{ "split": "train", "index": 77102, "acecode_id": "bigcode_python_fns_39204", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with writing a Python function `extract_arn_info(arn)` that takes an AWS resource ARN (Amazon Resource Name) as input and returns a dictionary containing specific extracted information from the ARN. The ARN is represented in the format: `arn:partition:service:reg...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_arn_info('arn:aws:iam::018835827632:role/bioanalyze-ec2-test-nf-rnaseq-batch_execution_role') == {'resource_type': 'IAM role', 'account_id': '018835827632', 'region': '', 'resource_name': 'bioanalyze-ec2-test-nf-rnaseq-batch_execution_role'}\", \"ass...
{ "split": "train", "index": 77103, "acecode_id": "oss_23233", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a class `S3Key` that represents an S3 object key with a private attribute `_boto_object`. Your task is to implement a function `test_private_methods(key: S3Key) -> bool` that checks if the `_boto_object` attribute is truthy. The function should return `True` if th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert test_private_methods(S3Key(True)) == True\", \"assert test_private_methods(S3Key(False)) == False\", \"assert test_private_methods(S3Key(None)) == False\", \"assert test_private_methods(S3Key('string')) == True\", \"assert test_private_methods(S3Key(0)) == F...
{ "split": "train", "index": 77104, "acecode_id": "bigcode_python_fns_47424", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function in Python that converts a given string into Morse Code. Each character must be converted according to a predefined mapping for letters, numbers, and some punctuation. Spaces between words should be represented by a slash (/). Implement a function `text_to_mors...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert text_to_morse('Hello world!') == '.... . .-.. .-.. --- / .-- --- .-. .-.. -.. -.-.--'\", \"assert text_to_morse('') == ''\", \"assert text_to_morse('A B C') == '.- / -... / -.-.'\", \"assert text_to_morse('1 2 3') == '.---- / ..--- / ...--'\", \"assert text_...
{ "split": "train", "index": 77105, "acecode_id": "evol_2599", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that formats an email sender's address and a list of recipient addresses from a given sender's name and a contact's email. The function should take the following parameters: a sender's name (a string), a contact's name (a string), and a c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_email('Lucas King', 'Invalid', 'no-at-sign.com') == ('lking@example.com', [])\", \"assert format_email('Oliver Twist', 'Invalid', 'invalid-email.com') == ('otwist@example.com', [])\", \"assert format_email('Quincy Adams', 'No Email', '') == ('qadams@e...
{ "split": "train", "index": 77106, "acecode_id": "bigcode_python_fns_14496", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with determining the relationship between two symbols in a symbolic algebra system based on their Fermi level status. A symbol is defined by its name and a boolean attribute, `above_fermi`, which indicates whether the symbol is above the Fermi level. Your goal is...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_only_below_fermi(Symbol('a', above_fermi=False), Symbol('b', above_fermi=False)) == True\", \"assert is_only_below_fermi(Symbol('c', above_fermi=True), Symbol('d', above_fermi=False)) == False\", \"assert is_only_below_fermi(Symbol('e', above_fermi=False)...
{ "split": "train", "index": 77107, "acecode_id": "oss_5306", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of numerical values representing a dataset. Write a function `summarize_data(data: List[float]) -> Dict[str, float]` that computes and returns a summary of the dataset. The summary should include the mean, standard deviation, maximum, and minimum values of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert summarize_data([1.0, 2.0, 3.0, 4.0, 5.0]) == {'mean': 3.0, 'stddev': 1.4142135623730951, 'max': 5.0, 'min': 1.0}\", \"assert summarize_data([5.5]) == {'mean': 5.5, 'stddev': 0.0, 'max': 5.5, 'min': 5.5}\", \"assert summarize_data([]) == {'mean': None, 'stdde...
{ "split": "train", "index": 77108, "acecode_id": "bigcode_python_fns_41568", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a list of integers and a target sum, implement a function that returns the first pair of integers from the list that add up to the target sum. If no such pair exists, the function should return an empty list. The function should handle duplicate values in the input list a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_pair_sum([0, 0, 0, 0], 0) == [0, 0]\", \"assert find_pair_sum([1, 1, 1, 1], 2) == [1, 1]\", \"assert find_pair_sum([2, 4, 6, 8], 12) == [4, 8]\", \"assert find_pair_sum([3, 3, 3], 6) == [3, 3]\", \"assert find_pair_sum([1, 2, 3, 4, 5], 10) == []\", \"as...
{ "split": "train", "index": 77109, "acecode_id": "oss_28303", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function that computes the nth Fibonacci number using memoization. The function should be able to handle larger Fibonacci numbers efficiently without exceeding the default Python recursion limit. The Fibonacci sequence is defined as follows: F(0) = 0, F(1) = 1, and ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fib(0) == 0\", \"assert fib(1) == 1\", \"assert fib(2) == 1\", \"assert fib(3) == 2\", \"assert fib(4) == 3\", \"assert fib(5) == 5\", \"assert fib(6) == 8\", \"assert fib(7) == 13\", \"assert fib(8) == 21\", \"assert fib(9) == 34\", \"assert fib(10) == 55\"...
{ "split": "train", "index": 77110, "acecode_id": "evol_34686", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes command-line argument inputs for a reinforcement learning environment. The function should take the following parameters: a string `expert_policy_file` representing the file path to the expert policy file, a string `envname...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_args('path/to/expert_policy', 'CartPole-v1') == {'expert_policy_file': 'path/to/expert_policy', 'envname': 'CartPole-v1', 'render': False, 'num_rollouts': 20}\", \"assert process_args('path/to/expert_policy', 'CartPole-v1', True) == {'expert_policy_f...
{ "split": "train", "index": 77111, "acecode_id": "oss_31856", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `prefix` and a list of strings `collection`, write a function `unique_name(prefix: str, collection: List[str]) -> str` that generates a unique name based on the `prefix`. The generated unique name should be the `prefix` itself if it is not already present in the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_name('apple', ['banana', 'orange']) == 'apple'\", \"assert unique_name('apple', ['apple', 'banana', 'orange']) == 'apple0'\", \"assert unique_name('test', ['test', 'test0', 'test1']) == 'test2'\", \"assert unique_name('item', ['item', 'item1', 'item2'...
{ "split": "train", "index": 77112, "acecode_id": "bigcode_python_fns_48458", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the creation of a model object based on certain input parameters. Implement a function `create_model` that takes the following parameters: \n1. `model` (str): A string reference to a model name. \n2. `input_types` (dict): ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_model('my_model', {'feature1': 'float', 'feature2': 'int'}, {'label1': 'bool'}, 'integrated_gradients') == {'model': 'my_model', 'input_types': {'feature1': 'float', 'feature2': 'int'}, 'output_types': {'label1': 'bool'}, 'attribution_method': 'integr...
{ "split": "train", "index": 77113, "acecode_id": "bigcode_python_fns_12245", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two lists of floating-point numbers, `x` and `y`, representing ranges of values on the x-axis and y-axis respectively, implement a function `find_closest_indices(x: List[float], y: List[float], xi: float, yi: float) -> Tuple[int, int]`. The function should return a tuple ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_closest_indices([1.0, 2.0, 3.0], [4.0, 5.0, 6.0], 2.5, 5.5) == (1, 1)\", \"assert find_closest_indices([1.0, 2.0, 3.0], [4.0, 5.0, 6.0], 0.5, 5.5) == (0, 1)\", \"assert find_closest_indices([1.0, 2.0, 3.0], [4.0, 5.0, 6.0], 3.5, 5.5) == (2, 1)\", \"asse...
{ "split": "train", "index": 77114, "acecode_id": "bigcode_python_fns_25544", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two numeric values representing the opponent color dimensions `a` and `b`, implement a function `hue_angle(a: float, b: float) -> float` that calculates and returns the hue angle `h` in degrees. The hue angle is computed using the formula `h = (atan2(b, a) * (180 / pi)) %...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert abs(hue_angle(-0.0006241120682426434, -0.0005062701067729668) - 219.0484326) < 1e-7\", \"assert abs(hue_angle(1, 0) - 0) < 1e-7\", \"assert abs(hue_angle(0, 1) - 90) < 1e-7\", \"assert abs(hue_angle(-1, 0) - 180) < 1e-7\", \"assert abs(hue_angle(0, -1) - 270...
{ "split": "train", "index": 77115, "acecode_id": "bigcode_python_fns_30989", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that determines the type and extension of a file given its filename. The function should return a tuple containing the file type and the file extension. The file types are defined as follows: 'Document' for extensions '.txt', '.doc', and ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_file_info('example.txt') == ('Document', 'txt')\", \"assert get_file_info('photo.jpg') == ('Image', 'jpg')\", \"assert get_file_info('sound.mp3') == ('Audio', 'mp3')\", \"assert get_file_info('movie.mp4') == ('Video', 'mp4')\", \"assert get_file_info('do...
{ "split": "train", "index": 77116, "acecode_id": "bigcode_python_fns_36424", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a contaminated binary search tree where all nodes have a value of -1, recover the binary search tree according to the following rules: the root value must be 0, the left child must have a value less than its parent, and the right child must have a value greater than its p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert recover_and_find(TreeNode(-1, None, TreeNode(-1)), 1) == (False, 0)\", \"assert recover_and_find(TreeNode(-1, TreeNode(-1, None, TreeNode(-1)), TreeNode(-1)), 1) == (False, 0)\", \"assert recover_and_find(TreeNode(-1, None, TreeNode(-1)), 1) == (False, 0)\",...
{ "split": "train", "index": 77117, "acecode_id": "evol_17643", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that tracks changes in the number of faces detected in a facial recognition system. The function should accept an initial number of faces detected and a list of updates representing new face counts. The function should return a list of me...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert track_face_changes(3, [4, 4, 5]) == ['Face count has changed from 3 to 4', 'Face count has changed from 4 to 5']\", \"assert track_face_changes(0, [0, 1, 0]) == ['Face count has changed from 0 to 1', 'Face count has changed from 1 to 0']\", \"assert track_fa...
{ "split": "train", "index": 77118, "acecode_id": "oss_27900", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of strings, where each string represents a line in a configuration file. Each line is formatted as 'key: value'. Your task is to implement a function that parses this list and returns the value associated with the key 'type' if it starts with 'ossim'. If th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert identify_ossim_type(['type: ossimModel1', 'version: 1.0']) == 'ossimModel1'\", \"assert identify_ossim_type(['type: otherModel', 'version: 1.0']) == None\", \"assert identify_ossim_type(['name: example', 'description: test']) == None\", \"assert identify_oss...
{ "split": "train", "index": 77119, "acecode_id": "bigcode_python_fns_13040", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 3D tensor representing an image with dimensions [rows, cols, channels], write a function that computes the sum of pixel values for each channel separately. The function should take the tensor as input and return a list of sums, where each element in the list corresponds...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_channel_values([[[0]], [[1]], [[2]]], 1) == [3]\", \"assert sum_of_channel_values([[[1, 0], [0, 1]], [[0, 1], [1, 0]]], 2) == [2, 2]\", \"assert sum_of_channel_values([[[1], [2]], [[3], [4]], [[5], [6]]], 1) == [21]\", \"assert sum_of_channel_values([...
{ "split": "train", "index": 77120, "acecode_id": "bigcode_python_fns_34954", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a list of headers and a list of test suites. Each header is a string and each test suite is a list of strings. Your task is to implement a function `gather_inputs(headers: List[str], test_suites: List[List[str]]) -> Dict[str, Any]` that processes these inputs and ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert gather_inputs(['header1', 'header2'], [['test1', 'test2'], ['test3']]) == {'header_count': 2, 'test_case_count': 3}\", \"assert gather_inputs(['header1', 'header1'], [['test1', 'test2'], ['test3']]) == {'header_count': 1, 'test_case_count': 3}\", \"assert ga...
{ "split": "train", "index": 77121, "acecode_id": "bigcode_python_fns_15633", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a positive integer m, define g(m) as the product of the cubes of the digits (in base 10) of m. For example, g(2) = 2^3 = 8, g(13) = 1^3 * 3^3 = 1 * 27 = 27, and g(521) = 5^3 * 2^3 * 1^3 = 125 * 8 * 1 = 1000. Your task is to implement a function `is_perfect_cube(n: int) ->...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_perfect_cube(0) == True\", \"assert is_perfect_cube(1) == True\", \"assert is_perfect_cube(8) == True\", \"assert is_perfect_cube(27) == True\", \"assert is_perfect_cube(64) == True\", \"assert is_perfect_cube(125) == True\", \"assert is_perfect_cube(216)...
{ "split": "train", "index": 77122, "acecode_id": "evol_9773", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function called `dec_to_hex` that converts a given decimal number (integer) into its corresponding hexadecimal notation. The output should be in uppercase letters. For example, the decimal number 255 should be converted to the hexadecimal string 'FF'.\nPlease reason...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert dec_to_hex(0) == '0'\", \"assert dec_to_hex(1) == '1'\", \"assert dec_to_hex(10) == 'A'\", \"assert dec_to_hex(15) == 'F'\", \"assert dec_to_hex(16) == '10'\", \"assert dec_to_hex(255) == 'FF'\", \"assert dec_to_hex(256) == '100'\", \"assert dec_to_hex(4095)...
{ "split": "train", "index": 77123, "acecode_id": "evol_5117", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a list of integers and returns a new list containing only the unique elements from the original list, preserving the order of their first appearance. Write a function `get_unique_elements(arr: List[int]) -> List[int]` that ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_elements([1, 2, 2, 3, 4, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert get_unique_elements([1, 1, 1, 1, 1]) == [1]\", \"assert get_unique_elements([]) == []\", \"assert get_unique_elements([5, 5, 5, 5, 2, 2, 1]) == [5, 2, 1]\", \"assert get_unique_element...
{ "split": "train", "index": 77124, "acecode_id": "bigcode_python_fns_42662", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with counting the occurrences of a specific word in a list of strings, where each string represents the content of a file. Your function should be able to handle a dynamic number of file contents provided as input. Implement a function `count_word_occurrences_in_...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_word_occurrences_in_contents(['hello world', 'python is great', 'python python'], 'python') == 3\", \"assert count_word_occurrences_in_contents(['hello world', 'hello python'], 'hello') == 2\", \"assert count_word_occurrences_in_contents(['file content...
{ "split": "train", "index": 77125, "acecode_id": "oss_35430", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that retrieves an object from a collection based on its unique identifier (ID). The function should handle cases where the object does not exist by returning a specific error message. The function should take an ID as input and a coll...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert retrieve_object({1: 'apple', 2: 'banana', 3: 'cherry'}, 1) == {'message': 'Object found', 'object': 'apple'}\", \"assert retrieve_object({1: 'apple', 2: 'banana', 3: 'cherry'}, 2) == {'message': 'Object found', 'object': 'banana'}\", \"assert retrieve_object...
{ "split": "train", "index": 77126, "acecode_id": "oss_11493", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that filters a list of media playlists based on a specific document playlist ID. Each media playlist is represented as a dictionary containing an 'id', a 'name', and a 'document_playlist_id'. Your function should take in a list of media p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_media_playlists([{'id': 1, 'name': 'Playlist 1', 'document_playlist_id': 101}, {'id': 2, 'name': 'Playlist 2', 'document_playlist_id': 102}, {'id': 3, 'name': 'Playlist 3', 'document_playlist_id': 101}], 101) == [{'id': 1, 'name': 'Playlist 1', 'docum...
{ "split": "train", "index": 77127, "acecode_id": "oss_25675", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries, each representing an individual's profile with fields for name, age, work, and education. Implement a function `construct_profiles(data)` that processes this list and returns a list of formatted strings for each individual. Each string shou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert construct_profiles([{'name': 'Peter', 'age': 25, 'work': {'company': 'Tech Inc', 'position': 'Software Engineer', 'years': 2}, 'education': {'university': 'Harvard University', 'degree': 'B.S. in Computer Science', 'graduationYear': 2018}}]) == ['Name: Peter...
{ "split": "train", "index": 77128, "acecode_id": "evol_6143", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a dictionary containing keyboard layout names as keys and their corresponding layout art as values. Write a function `show_layouts(kb_info, title_caps=True)` that takes in this dictionary and a boolean `title_caps`. The function should print each layout name, form...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert show_layouts({'qwerty': 'QWERTY ART', 'dvorak': 'DVORAK ART'}, True) == 'Qwerty:\\\\nDvorak:\\\\n'\", \"assert show_layouts({'abcd': 'ART A', 'efgh': 'ART B'}, False) == 'abcd:\\\\nefgh:\\\\n'\", \"assert show_layouts({'layout1': 'ART 1', 'layout2': 'ART 2'}...
{ "split": "train", "index": 77129, "acecode_id": "bigcode_python_fns_7283", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves user credentials from a given list of credential dictionaries. Each dictionary contains 'username', 'password', and 'valid' keys. The function should return a list of valid credentials, where a credential is considered vali...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_valid_credentials([{'username': 'user1', 'password': 'pass1', 'valid': True}, {'username': 'user2', 'password': 'pass2', 'valid': False}]) == [{'username': 'user1', 'password': 'pass1', 'valid': True}]\", \"assert get_valid_credentials([{'username': 'use...
{ "split": "train", "index": 77130, "acecode_id": "bigcode_python_fns_25453", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a scoring function that evaluates the similarity between two elements. Your function should take two parameters, `match` and `mismatch`, which are both integers. The function should return a new scoring function that takes two inputs, `x` and `y`. I...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_scorer(1, -1)(2, 2) == 1\", \"assert create_scorer(5, -5)(3, 3) == 5\", \"assert create_scorer(10, -10)(1, 2) == -10\", \"assert create_scorer(0, -1)(0, 0) == 0\", \"assert create_scorer(100, -100)(10, 10) == 100\", \"assert create_scorer(2, -2)(-1, -...
{ "split": "train", "index": 77131, "acecode_id": "bigcode_python_fns_12175", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `store_user_details(first_name: str, last_name: str) -> str` that takes a user's first name and last name as inputs, and returns a success message indicating that the details have been successfully stored. The function does not actually store the details bu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert store_user_details('John', 'Doe') == 'Success!'\", \"assert store_user_details('Jane', 'Smith') == 'Success!'\", \"assert store_user_details('Alice', 'Johnson') == 'Success!'\", \"assert store_user_details('Bob', 'Brown') == 'Success!'\", \"assert store_user...
{ "split": "train", "index": 77132, "acecode_id": "evol_7252", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `linear_search(arr: List[int], target: int) -> int` that performs a linear search on the given list `arr`. The function should return the index of the first occurrence of `target` in the list. If `target` is not found, return -1.\nPlease reason step by step...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert linear_search([1, 2, 3, 4, 5, 6], 5) == 4\", \"assert linear_search([1, 2, 3, 4, 5, 6], 3) == 2\", \"assert linear_search([1, 2, 3, 4, 5, 6], 1) == 0\", \"assert linear_search([1, 2, 3, 4, 5, 6], 6) == 5\", \"assert linear_search([1, 2, 3, 4, 5, 6], 7) == -1...
{ "split": "train", "index": 77133, "acecode_id": "evol_30033", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of user logins represented as a dictionary where each key is a string of user IDs (discord_id) and each value is a string representing the corresponding login information, implement a function `get_login_info(logins: Dict[str, str], discord_id: int) -> Optional[str...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_login_info({'123': 'user1', '456': 'user2'}, 123) == 'user1'\", \"assert get_login_info({'123': 'user1', '456': 'user2'}, 456) == 'user2'\", \"assert get_login_info({'123': 'user1', '789': 'user3'}, 456) == None\", \"assert get_login_info({}, 123) == Non...
{ "split": "train", "index": 77134, "acecode_id": "bigcode_python_fns_10766", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a validation function for a location confirmation feature in a land charge management system. Write a function `validate_location_confirmation(action: str, is_confirmed: bool)` that takes two parameters: - `action` (string): Represents the action to...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_location_confirmation('add', True) == 'Add action validated.'\", \"assert validate_location_confirmation('update', True) == 'Update action validated.'\", \"assert validate_location_confirmation('add', True) == 'Add action validated.'\", \"assert val...
{ "split": "train", "index": 77135, "acecode_id": "oss_36579", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a simple online review system for products. Your function should allow users to submit reviews for various products and calculate the average rating for each product based on submitted reviews. The function will take a list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_product_ratings([('Laptop', 4), ('Laptop', 5), ('Phone', 3), ('Phone', 4)]) == {'Laptop': 4.5, 'Phone': 3.5}\", \"assert average_product_ratings([('Laptop', 5), ('Laptop', 2), ('Tablet', 4)]) == {'Laptop': 3.5, 'Tablet': 4.0}\", \"assert average_prod...
{ "split": "train", "index": 77136, "acecode_id": "oss_16693", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a bit removal operation from a binary representation of data. The function should take three parameters: a string representing the name of the binary data, an integer representing the byte offset from which to start removin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bit_remove_operation('data_bin', 0, 4) == {'operation': 'BIT_REMOVE', 'bin_name': 'data_bin', 'byte_offset': 0, 'byte_size': 4}\", \"assert bit_remove_operation('test_bin', 1, 2) == {'operation': 'BIT_REMOVE', 'bin_name': 'test_bin', 'byte_offset': 1, 'byte_...
{ "split": "train", "index": 77137, "acecode_id": "bigcode_python_fns_9930", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates retrieving public user information. The function should take a boolean parameter `is_authenticated`, a string `username`, a string `email`, and a string `avatar_url`. If `is_authenticated` is True, the function should retur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_public_user_info(True, 'test_user', 'test_user@example.com', 'https://example.com/avatar.jpg') == {'username': 'test_user', 'email': 'test_user@example.com', 'avatar_url': 'https://example.com/avatar.jpg'}\", \"assert get_public_user_info(False, 'test_us...
{ "split": "train", "index": 77138, "acecode_id": "oss_32189", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `get_max_difference(arr: List[int]) -> int` that returns the maximum difference between any two elements in the list such that the larger element appears after the smaller element. If no such pair exists, return -1. For example, for th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_max_difference([2, 3, 10, 6, 4, 8, 1]) == 8\", \"assert get_max_difference([7, 1, 2, 4]) == 3\", \"assert get_max_difference([1, 2, 3, 4, 5]) == 4\", \"assert get_max_difference([1, 5, 2, 10, 6]) == 9\", \"assert get_max_difference([]) == -1\", \"assert ...
{ "split": "train", "index": 77139, "acecode_id": "bigcode_python_fns_12036", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a square matrix representing a covariance matrix. Write a function that computes the maximum absolute value in the covariance matrix and returns it. The function should take a single parameter which is the covariance matrix, represented as a 2D list of floats. The...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_absolute_covariance([[1.0, -2.0], [3.0, 4.0]]) == 4.0\", \"assert max_absolute_covariance([[0.0, 0.0], [0.0, 0.0]]) == 0.0\", \"assert max_absolute_covariance([[5.0, -3.5], [-1.5, 2.0]]) == 5.0\", \"assert max_absolute_covariance([[10.0, -10.0, 5.0], [5....
{ "split": "train", "index": 77140, "acecode_id": "bigcode_python_fns_48479", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `max_magnitude(num1, num2)` that takes in two distinct numerical inputs and returns the one with the greater magnitude. The magnitude of a number is defined as its absolute value. If both numbers have the same magnitude, return the first number. You may assume ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_magnitude(4, 5) == 5\", \"assert max_magnitude(-10, 10) == -10\", \"assert max_magnitude(3, -7) == -7\", \"assert max_magnitude(-15, -8) == -15\", \"assert max_magnitude(0, 3) == 3\", \"assert max_magnitude(6, -6) == 6\", \"assert max_magnitude(8, 2) == ...
{ "split": "train", "index": 77141, "acecode_id": "evol_33838", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of pixel values representing a grayscale image and a threshold value. Your task is to create a function that highlights the pixels in the image whose values exceed the given threshold. When a pixel's value exceeds the threshold, it should be replaced with a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert highlight_pixels([(255, 255, 255), (0, 0, 0)], [150, 200], 150, (255, 0, 0)) == [(255, 255, 255), (255, 0, 0)]\", \"assert highlight_pixels([(255, 255, 255), (0, 0, 0)], [50, 150], 50, (255, 0, 0)) == [(255, 255, 255), (255, 0, 0)]\", \"assert highlight_pixe...
{ "split": "train", "index": 77142, "acecode_id": "bigcode_python_fns_41094", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Write a function `extract_primes(numbers: List[int]) -> List[int]` that takes a list of integers and returns a new list containing only the prime numbers from the input list. A prime number is defined as a natural number greater than 1 that cannot be formed by multiplying two s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_primes([2, 3, 4, 5, 6, 7, 8, 9, 10]) == [2, 3, 5, 7]\", \"assert extract_primes([1, 4, 6, 8, 10]) == []\", \"assert extract_primes([11, 13, 15, 17, 19]) == [11, 13, 17, 19]\", \"assert extract_primes([20, 22, 23, 25, 27]) == [23]\", \"assert extract_...
{ "split": "train", "index": 77143, "acecode_id": "evol_26188", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to create a function that formats a payload for a multipart/form-data API request. The function should take three parameters: the name of the highest-level JSON field (as a string), a JSON payload (as a dictionary), and a files payload (as a dictionary containing file ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_full_payload('data', {'key': 'value'}, {'file1': (b'some content', 'file1.txt', 'text/plain')}) == {'data': (None, '{\\\"key\\\": \\\"value\\\"}', 'application/json'), 'file1': (b'some content', 'file1.txt', 'text/plain')}\", \"assert format_full_payl...
{ "split": "train", "index": 77144, "acecode_id": "bigcode_python_fns_46252", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes an array of integers as input and returns a tuple containing the original array, its reverse (without using any built-in reverse functions), and the count of prime numbers present in the array. The function should be named `process_array` and sho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_array([2, 3, 4, 5, 6, 7, 8, 9, 10]) == ([2, 3, 4, 5, 6, 7, 8, 9, 10], [10, 9, 8, 7, 6, 5, 4, 3, 2], 4)\", \"assert process_array([1, 4, 6, 8]) == ([1, 4, 6, 8], [8, 6, 4, 1], 0)\", \"assert process_array([13, 17, 19, 23]) == ([13, 17, 19, 23], [23, 1...
{ "split": "train", "index": 77145, "acecode_id": "evol_12768", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that converts a hexadecimal string into its corresponding binary representation as a string. The input string will consist of valid hexadecimal digits (0-9, A-F, a-f). The output should be the binary representation of the hexadecimal input without any leadi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert hexadecimal_to_binary('A') == '1010'\", \"assert hexadecimal_to_binary('F') == '1111'\", \"assert hexadecimal_to_binary('13') == '10011'\", \"assert hexadecimal_to_binary('1A') == '11010'\", \"assert hexadecimal_to_binary('2F') == '101111'\", \"assert hexade...
{ "split": "train", "index": 77146, "acecode_id": "evol_14722", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `is_perfect_number(n: int) -> bool` that determines whether the given integer `n` is a perfect number. A perfect number is a positive integer that is equal to the sum of its proper divisors, excluding itself. For example, 6 is a perfect number because its d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_perfect_number(6) == True\", \"assert is_perfect_number(28) == True\", \"assert is_perfect_number(496) == True\", \"assert is_perfect_number(8128) == True\", \"assert is_perfect_number(1) == False\", \"assert is_perfect_number(2) == False\", \"assert is_p...
{ "split": "train", "index": 77147, "acecode_id": "evol_30072", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists of hexadecimal strings, where each string represents a number. Your task is to compare these two lists and return a tuple containing three elements: 1) a list of hexadecimal strings from the first list that differ from the corresponding strings in the se...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert diff(['1A', '2B', '3C'], ['1A', '2B', '3C'], True) == (['__', '__', '__'], ['__', '__', '__'], [])\", \"assert diff(['10', '20'], ['10', '30'], False) == (['20'], ['30'], [1])\", \"assert diff(['A', 'B', 'C'], ['a', 'b', 'c'], True) == (['__', '__', '__'], [...
{ "split": "train", "index": 77148, "acecode_id": "bigcode_python_fns_39348", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with analyzing geographical data represented as a list of tuples. Each tuple consists of a latitude and a longitude value. Your goal is to calculate the number of unique geographical points present in this data. Write a function that takes a list of tuples as inp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_unique_points([]) == 0\", \"assert count_unique_points([(10.0, 20.0)]) == 1\", \"assert count_unique_points([(10.0, 20.0), (10.0, 20.0)]) == 1\", \"assert count_unique_points([(10.0, 20.0), (15.0, 25.0)]) == 2\", \"assert count_unique_points([(10.0, 20...
{ "split": "train", "index": 77149, "acecode_id": "oss_16463", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that takes in a list of integers and returns a new list containing only the even integers from the original list. The function should maintain the order of the original integers. If there are no even integers, the function should r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 15, 20, 25]) == [10, 20]\", \"assert filter_even_numbers([1, 3, 5]) == []\", \"assert filter_even_numbers([0, -2, -4, 1]) == [0, -2, -4]\", \"assert filter_even_numbers([-1, ...
{ "split": "train", "index": 77150, "acecode_id": "oss_33363", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `get_done_tasks(tasks: List[Dict[str, Union[str, int]]], page_number: int) -> List[Dict[str, Union[str, int]]]` that takes a list of task dictionaries and a page number as input. Each task dictionary contains a 'Status' field and a 'Priority' field. The fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_done_tasks([{'Status': 'Done', 'Priority': 1}, {'Status': 'Done', 'Priority': 3}, {'Status': 'Not Done', 'Priority': 2}], 1) == [{'Status': 'Done', 'Priority': 3}, {'Status': 'Done', 'Priority': 1}]\", \"assert get_done_tasks([{'Status': 'Done', 'Priorit...
{ "split": "train", "index": 77151, "acecode_id": "evol_16197", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing an algorithm buffer, which is represented as a dictionary where the keys are algorithm names (strings) and the values are hash values (strings). Implement a function `UpdateAlgo` that updates the buffer with a new hash value for a given algorithm. I...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert UpdateAlgo('Algo1', 'newhash') is None\", \"assert UpdateAlgo('Algo3', 'hash3') is None\", \"assert UpdateAlgo('Algo2', 'hash2new') is None\", \"assert UpdateAlgo('Algo1', 'updatedhash1') is None\", \"assert UpdateAlgo('Algo4', 'hash4') is None\", \"assert U...
{ "split": "train", "index": 77152, "acecode_id": "oss_7224", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design and implement a predictive text generator that can suggest the next word based on the user's input. The generator should be able to learn from past input phrases and provide predictions based on n-grams. Implement a function called `generate_predictions` that takes a lis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_predictions(['I like', 'I love', 'I really like', 'I really love'], 'I really') == ['like', 'love']\", \"assert generate_predictions(['I enjoy playing', 'I enjoy reading', 'I enjoy cooking'], 'I enjoy') == ['playing', 'reading', 'cooking']\", \"asse...
{ "split": "train", "index": 77153, "acecode_id": "evol_19016", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a command to start a Python application server based on specific parameters. Your function should take the following inputs: \n\n- `app_name` (str): The name of the application to run.\n- `login_ip` (str): The public IP add...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_start_command('my_app', '192.168.1.1', 8080, 'load_balancer_host', '10.0.0.1') == '/usr/bin/python2 /path/to/dev_appserver.py --port 8080 --admin_port 18080 --login_server 192.168.1.1 --skip_sdk_update_check --nginx_host load_balancer_host --require...
{ "split": "train", "index": 77154, "acecode_id": "bigcode_python_fns_47124", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Implement a function `examine_string(text: str) -> int` that checks the given string for the presence of the digit '7'. The function should ignore any characters that are not numerical. If '7' is found, it should check if it is surrounded by prime numbers on both sides. If it i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert examine_string('123456789') == -1\", \"assert examine_string('7') == -1\", \"assert examine_string('4 7 6') == -1\", \"assert examine_string('0 7 0') == -1\", \"assert examine_string('3 7 5') == 1\", \"assert examine_string('1 2 3 7 5 11 13') == 3\", \"asser...
{ "split": "train", "index": 77155, "acecode_id": "evol_19479", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that parses a parameter string formatted as '<name:[pattern]>' and returns a tuple containing the parameter's name, its type, and its pattern. If the pattern is not specified, it should default to 'string'. The function should recognize a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_parameter_string('<param_one>') == ('param_one', str, 'string')\", \"assert parse_parameter_string('<param_two:int>') == ('param_two', int, 'int')\", \"assert parse_parameter_string('<param_three:custom>') == ('param_three', str, 'custom')\", \"assert ...
{ "split": "train", "index": 77156, "acecode_id": "bigcode_python_fns_12828", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the interior angle of a regular polygon. Implement a function `calculate_interior_angle(n: int) -> float` that takes an integer `n`, representing the number of sides of the polygon, and returns the measure of the interior angle in degrees. The in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_interior_angle(3) == 60.0\", \"assert calculate_interior_angle(4) == 90.0\", \"assert calculate_interior_angle(5) == 108.0\", \"assert calculate_interior_angle(6) == 120.0\", \"assert calculate_interior_angle(7) == 128.57142857142858\", \"assert ca...
{ "split": "train", "index": 77157, "acecode_id": "oss_8397", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a string as input and swaps all whitespace characters with underscores and all underscores with whitespace characters. The function should return the modified string.\nPlease reason step by step, then write a self-contained Python solution. Give ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert swap_whitespace_and_underscore('Hello World') == 'Hello_World'\", \"assert swap_whitespace_and_underscore('This_is_a_test') == 'This is a test'\", \"assert swap_whitespace_and_underscore('A B C') == 'A_B_C'\", \"assert swap_whitespace_and_underscore('Python_...
{ "split": "train", "index": 77158, "acecode_id": "evol_15891", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given two lists of integers, `allocation_shimenreservoir` and `allocation_houchiweir`, write a function `calculate_ratio` that calculates the ratio of the sum of the `allocation_houchiweir` list to the sum of the `allocation_shimenreservoir` list. If the sum of the `allocation_...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_ratio([10, 20, 30], [5, 15]) == 0.3333\", \"assert calculate_ratio([0], [5, 15]) == 0.0\", \"assert calculate_ratio([], [10, 20]) == 0.0\", \"assert calculate_ratio([10, 20], [0]) == 0.0\", \"assert calculate_ratio([5], [10]) == 2.0\", \"assert cal...
{ "split": "train", "index": 77159, "acecode_id": "bigcode_python_fns_15409", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Implement a function `intern_string` that accepts a list containing a single string and modifies that string in place to its interned version. Interning a string means that if the string is already interned, the function should return the reference to the existing interned stri...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert intern_string(['hello']) == 'hello'\", \"assert intern_string(['hello']) is intern_string(['hello'])\", \"assert intern_string(['world']) == 'world'\", \"assert intern_string(['world']) is intern_string(['world'])\", \"assert intern_string(['foo']) == 'foo'\...
{ "split": "train", "index": 77160, "acecode_id": "bigcode_python_fns_43840", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with analyzing sensor data from a monitoring system. Each type of sensor has a unique identifier associated with it. Implement a function `count_sensor_models` that takes a list of sensor identifiers as input and returns a dictionary where the keys are the unique...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_sensor_models(['sensor1', 'sensor1', 'sensor1']) == {'sensor1': 3}\", \"assert count_sensor_models(['sensor2', 'sensor3', 'sensor2', 'sensor2']) == {'sensor2': 3, 'sensor3': 1}\", \"assert count_sensor_models(['sensorX', 'sensorY']) == {'sensorX': 1, '...
{ "split": "train", "index": 77161, "acecode_id": "oss_22776", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given an array of integers representing a binary tree in level order. Write a function `find_sum_index(arr, idx)` that takes an array `arr` and an integer `idx` as input, and returns the index of the node in the array that contains the sum of values from the root to the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_sum_index([1, 2, 3, 4, 5, 6, 7], 3) == 6\", \"assert find_sum_index([1, 2, 3, 4, 5, 6, 7], 0) == 0\", \"assert find_sum_index([1, 2, 3, 4, 5, 6, 7], 2) == 3\", \"assert find_sum_index([1, 2, 3, 4, 5, 6, 7], 6) == -1\", \"assert find_sum_index([1, 2, 3, ...
{ "split": "train", "index": 77162, "acecode_id": "oss_13168", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given a dictionary of arguments where one of the keys may represent options for a QR code. Your task is to implement a function that processes this dictionary and returns a valid QRCodeOptions instance. If the 'options' key exists and is of type QRCodeOptions, return it...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_qr_code_options({'options': None}) is None\", \"assert isinstance(process_qr_code_options({'options': QRCodeOptions()}), QRCodeOptions)\", \"assert isinstance(process_qr_code_options({'options': QRCodeOptions(), 'color': 'red'}), QRCodeOptions)\", \"...
{ "split": "train", "index": 77163, "acecode_id": "bigcode_python_fns_40643", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that initializes parameters for a text processing model. The function should take the following parameters: `use_cuda` (a boolean indicating if CUDA should be used), `vocab_size` (an integer representing the size of the vocabulary), `batc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert initialize_text_model(True, 1000, 32, 64, 128, 256) == {'use_cuda': True, 'vocab_size': 1000, 'batch_size': 32, 'seq_len': 64, 'embedding_size': 128, 'hidden_state_dim': 256}\", \"assert initialize_text_model(False, 5000, 16, 128, 256, 512) == {'use_cuda': F...
{ "split": "train", "index": 77164, "acecode_id": "oss_7385", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with building a representation of a network of islands connected by bridges. Each island is represented by a unique integer identifier ranging from 1 to `num_islands`. You are given a list of bridge configurations, where each configuration consists of a tuple con...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_graph(3, [(1, 2, 4), (2, 3, 5)]) == [[], [(2, 4)], [(1, 4), (3, 5)], [(2, 5)]]\", \"assert create_graph(1, []) == [[], []]\", \"assert create_graph(2, [(1, 2, 10)]) == [[], [(2, 10)], [(1, 10)]]\", \"assert create_graph(0, []) == [[]]\", \"assert crea...
{ "split": "train", "index": 77165, "acecode_id": "bigcode_python_fns_30111", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates retrieving network interfaces information and returns it in a specific format. Write a function `get_network_interfaces_info` that takes no arguments and returns a dictionary containing the following keys: \n- \"inte...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_network_interfaces_info() == {'interfaces': ['eth0', 'wlan0'], 'bytes_sent': 1000, 'bytes_recv': 2000}\", \"assert get_network_interfaces_info() == {'interfaces': ['eth0', 'wlan0'], 'bytes_sent': 1000, 'bytes_recv': 2000}\", \"assert get_network_interfac...
{ "split": "train", "index": 77166, "acecode_id": "oss_1818", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes two strings and returns a new string obtained by concatenating the first string with the second string. Your function should be efficient and handle strings of various lengths. Implement the function `concat_strings(s1: str...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert concat_strings('Hello, ', 'world!') == 'Hello, world!'\", \"assert concat_strings('Python', ' is awesome!') == 'Python is awesome!'\", \"assert concat_strings('', 'test') == 'test'\", \"assert concat_strings('test', '') == 'test'\", \"assert concat_strings('...
{ "split": "train", "index": 77167, "acecode_id": "oss_11673", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Implement a function that generates the first n elements of the Lucas number series. The Lucas numbers are defined similarly to the Fibonacci numbers, but they start with 2 and 1. Specifically, the sequence begins with L(0) = 2, L(1) = 1, and for n >= 2, L(n) = L(n-1) + L(n-2)....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert lucas_sequence(0) == []\", \"assert lucas_sequence(1) == [2]\", \"assert lucas_sequence(2) == [2, 1]\", \"assert lucas_sequence(3) == [2, 1, 3]\", \"assert lucas_sequence(4) == [2, 1, 3, 4]\", \"assert lucas_sequence(5) == [2, 1, 3, 4, 7]\", \"assert lucas_s...
{ "split": "train", "index": 77168, "acecode_id": "evol_23002", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes in information about a graph relationship and returns a dictionary representation of that relationship. The function should accept three parameters: `start_node`, `end_node`, and `relationship_type`. It should return a dictiona...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_graph_relationship('node1', 'node2', 'CONNECTED_TO') == {'start_node': 'node1', 'end_node': 'node2', 'relationship_type': 'CONNECTED_TO'}\", \"assert create_graph_relationship('A', 'B', 'FRIENDS_WITH') == {'start_node': 'A', 'end_node': 'B', 'relation...
{ "split": "train", "index": 77169, "acecode_id": "oss_29496", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that extracts the domain name from a given URL. The domain name is defined as the combination of the second-level domain and the top-level domain (e.g., 'example.com'). Your function should be able to handle various URL formats, in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_domain('http://www.example.com') == 'example.com'\", \"assert extract_domain('http://example.com') == 'example.com'\", \"assert extract_domain('https://www.test.org') == 'test.org'\", \"assert extract_domain('https://www.subdomain.test.com') == 'test...
{ "split": "train", "index": 77170, "acecode_id": "oss_24317", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a string representing a unique identifier for a docker image. Your task is to extract the name of the image and the version from this identifier. The identifier is formatted as 'repository/image_name:version'. Your function should return a tuple containing the ima...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_image_info('myrepo/myimage:1.0') == ('myimage', '1.0')\", \"assert extract_image_info('myrepo/myimage') == ('myimage', 'latest')\", \"assert extract_image_info('anotherrepo/anotherimage:2.5.1') == ('anotherimage', '2.5.1')\", \"assert extract_image_i...
{ "split": "train", "index": 77171, "acecode_id": "bigcode_python_fns_24459", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple caching mechanism for disk I/O operations. The cache will store frequently accessed data blocks to improve read performance. Your task is to implement the function `cache_operations(operations: List[Tuple[str, int, Optional[bytes]]]) ->...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cache_operations([('write', 1, b'Block 1 data'), ('read', 1, None)]) == [b'Block 1 data']\", \"assert cache_operations([('write', 1, b'Block 1 data'), ('write', 2, b'Block 2 data'), ('read', 1, None)]) == [b'Block 1 data']\", \"assert cache_operations([('wri...
{ "split": "train", "index": 77172, "acecode_id": "oss_5055", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with evaluating the performance of multiple artificial intelligence models based on their precision levels. Given a list of predicted labels and actual labels for a specific model, implement a function `calculate_precision(predictions: List[int], actuals: List[in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_precision([0, 0, 0, 0], [0, 0, 0, 0]) == 0.0\", \"assert calculate_precision([1, 1, 1], [1, 0, 1]) == 0.6666666666666666\", \"assert calculate_precision([1, 0, 0, 0], [1, 0, 0, 0]) == 1.0\", \"assert calculate_precision([], []) == 0.0\", \"assert c...
{ "split": "train", "index": 77173, "acecode_id": "evol_5194", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that performs a URL reverse lookup and deletion process in a hypothetical web application. The function should take in an institution ID and user email as input parameters, and perform the following steps: 1. Generate a URL for the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_and_delete(1, 'test1@example.com') == None\", \"assert reverse_and_delete(2, 'test2@example.com') == None\", \"assert reverse_and_delete(3, 'test3@example.com') == None\", \"assert reverse_and_delete(4, 'test4@example.com') == None\", \"assert revers...
{ "split": "train", "index": 77174, "acecode_id": "oss_37023", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `logout_response(status_code: int) -> str` that simulates the logout process for a hypothetical application. The function takes a single parameter, `status_code`, which represents the HTTP status code returned from a logout request. Based...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert logout_response(200) == 'Logged Out.'\", \"assert logout_response(400) == 'Error: Bad credentials'\", \"assert logout_response(401) == 'Error: You are not logged in'\", \"assert logout_response(404) == 'Error: Problem happened'\", \"assert logout_response(50...
{ "split": "train", "index": 77175, "acecode_id": "bigcode_python_fns_9098", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that determines the maximum sum of any contiguous subarray of the list. A subarray is defined as a contiguous part of the array. You need to implement a function `max_subarray_sum(nums: List[int]) -> int` that takes a list of integers ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_subarray_sum([-2,1,-3,4,-1,2,1,-5,4]) == 6\", \"assert max_subarray_sum([1]) == 1\", \"assert max_subarray_sum([5,4,-1,7,8]) == 23\", \"assert max_subarray_sum([-1,-2,-3,-4]) == -1\", \"assert max_subarray_sum([-1, -2, -3, 0, -1, 1]) == 1\", \"assert max...
{ "split": "train", "index": 77176, "acecode_id": "bigcode_python_fns_19616", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that determines the status of a trading order based on a set of attributes. The function should take the following parameters: pegPriceMax (float), pegPriceDeviation (float), cancelDuration (int), timestamp (int), orderID (str), stealth (...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert order_status(100.0, 5.0, 10, 1, 'order_001', 0.5, 'buy', 95.0, 90.0, 1, 0.1, 12) == 'Cancelled'\", \"assert order_status(100.0, 5.0, 10, 1, 'order_002', 0.5, 'sell', 95.0, 90.0, 1, 0.1, 10) == ''\", \"assert order_status(150.0, 8.0, 0, 5, 'order_003', 0.2, '...
{ "split": "train", "index": 77177, "acecode_id": "oss_19532", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the daily earnings of a taxi driver over a week. Write a function `max_weekly_earning(earnings: List[int]) -> int` that computes the maximum total earnings over any consecutive 7-day period. If the list contains fewer than 7 days, r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_weekly_earning([10, 20, 30, 40, 50, 60, 70]) == 280\", \"assert max_weekly_earning([7, 6, 5, 4, 3, 2, 1]) == 28\", \"assert max_weekly_earning([1, 2, 3]) == 6\", \"assert max_weekly_earning([0, 0, 0, 0, 0, 0, 0]) == 0\", \"assert max_weekly_earning([]) =...
{ "split": "train", "index": 77178, "acecode_id": "bigcode_python_fns_9944", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates uploading two batches of files to a storage system. Each batch contains three files: 'part-m-00000', 'part-m-00001', and '_SUCCESS'. The function should accept a list of two batches, where each batch is represented as a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert upload_files(['batch0', 'batch1']) == ['batch0/part-m-00000', 'batch0/part-m-00001', 'batch0/_SUCCESS', 'batch1/part-m-00000', 'batch1/part-m-00001', 'batch1/_SUCCESS']\", \"assert upload_files(['test1', 'test2']) == ['test1/part-m-00000', 'test1/part-m-0000...
{ "split": "train", "index": 77179, "acecode_id": "bigcode_python_fns_47553", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates sending data and retrieving a response based on a version string. Implement a function `get_version(version: str) -> str` that takes a version string as input. If the version string is '1.0', the function should return 'Ver...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_version('1.0') == 'Version 1.0 is active'\", \"assert get_version('2.0') == 'Version 2.0 is active'\", \"assert get_version('1.0') == 'Version 1.0 is active'\", \"assert get_version('2.0') == 'Version 2.0 is active'\", \"assert get_version('1.0') == 'Ver...
{ "split": "train", "index": 77180, "acecode_id": "bigcode_python_fns_42768", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a string representation of a list of type arguments. Your task is to implement a function `parse_args` that takes this string as input and returns a tuple containing the parsed types. The input string can be a sequence of argument types separated by commas. If the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_args('') == ()\", \"assert parse_args('int') == ('int',)\", \"assert parse_args('int,str') == ('int', 'str')\", \"assert parse_args('float,double,char') == ('float', 'double', 'char')\", \"assert parse_args('a,b,c') == ('a', 'b', 'c')\", \"assert parse...
{ "split": "train", "index": 77181, "acecode_id": "bigcode_python_fns_34974", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers representing the precision, recall, and L-measure scores for various features from an experiment, your task is to compute the average score for each of these three metrics. Return a dictionary where the keys are 'Precision', 'Recall', and 'L-Measure', a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_scores([(1, 2, 3), (4, 5, 6), (7, 8, 9)]) == {'Precision': 4.0, 'Recall': 5.0, 'L-Measure': 6.0}\", \"assert average_scores([]) == {'Precision': 0.0, 'Recall': 0.0, 'L-Measure': 0.0}\", \"assert average_scores([(0, 0, 0), (0, 0, 0)]) == {'Precision':...
{ "split": "train", "index": 77182, "acecode_id": "bigcode_python_fns_10209", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the creation of a sample ingredient for a user. The function should accept two parameters: 'user' (a string representing the user's name) and an optional 'name' (a string representing the ingredient's name, which defaults t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_sample_ingredient('Alice') == {'user': 'Alice', 'name': 'cinnoan'}\", \"assert create_sample_ingredient('Bob') == {'user': 'Bob', 'name': 'cinnoan'}\", \"assert create_sample_ingredient('Charlie', 'sugar') == {'user': 'Charlie', 'name': 'sugar'}\", \"...
{ "split": "train", "index": 77183, "acecode_id": "bigcode_python_fns_43148", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that paginates a list of recipes based on the current page number and the number of recipes to display per page. The function should take three parameters: a list of recipes (strings), an integer page_number representing the current p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert paginate_recipes(['Pasta', 'Pizza', 'Salad', 'Soup', 'Sandwich'], 1, 2) == ['Pasta', 'Pizza']\", \"assert paginate_recipes(['Pasta', 'Pizza', 'Salad', 'Soup', 'Sandwich'], 2, 2) == ['Salad', 'Soup']\", \"assert paginate_recipes(['Pasta', 'Pizza', 'Salad', 'S...
{ "split": "train", "index": 77184, "acecode_id": "oss_7415", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of floating-point numbers. Your task is to implement a function that formats each number in the list to two decimal places and returns a string that contains all the formatted numbers, separated by commas. The function should handle large datasets efficient...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_data([17.45739184, 19.38927384, 23.23892384, 42.2389238491]) == '17.46, 19.39, 23.24, 42.24'\", \"assert format_data([1.0, 2.0, 3.0]) == '1.00, 2.00, 3.00'\", \"assert format_data([0.12345, 0.6789]) == '0.12, 0.68'\", \"assert format_data([]) == ''\",...
{ "split": "train", "index": 77185, "acecode_id": "evol_2505", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes user form submissions. The function should accept a dictionary representing form data with keys 'name' and 'email'. It should return a message indicating whether the form submission was successful. If both 'name' and 'email...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_form_submission({'name': 'Alice', 'email': 'alice@example.com'}) == 'Thank you for submitting the form, Alice! Your email address alice@example.com has been recorded.'\", \"assert process_form_submission({'name': 'Bob', 'email': 'bob@example.com'}) =...
{ "split": "train", "index": 77186, "acecode_id": "oss_7311", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function `is_valid_palindrome(s: str) -> bool` that checks if the input string `s` contains only alphanumeric characters (a-z, A-Z, 0-9) and is a palindrome. Ignore cases during the comparison. A palindrome is a sequence that reads the same backward as forward. If t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_palindrome('A man, a plan, a canal: Panama') == True\", \"assert is_valid_palindrome('racecar') == True\", \"assert is_valid_palindrome('12321') == True\", \"assert is_valid_palindrome('No lemon, no melon') == True\", \"assert is_valid_palindrome('W...
{ "split": "train", "index": 77187, "acecode_id": "evol_12751", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `parse_personal_info(text: str) -> dict` that extracts an individual's name, birth date, domicile location, and Social Security Number from a given textual string. The birth date should be in the format DD/MM/YYYY and the Social Security Number must comply ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_personal_info('John Smith; 10/03/1994; 9 Hall Street, Anytown; 578-70-0890') == {'Name': 'John Smith', 'Birthdate': '10/03/1994', 'Address': '9 Hall Street, Anytown', 'SSN': '578-70-0890'}\", \"assert parse_personal_info('Alice Johnson; 15/05/1985; 123...
{ "split": "train", "index": 77188, "acecode_id": "evol_3217", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function called `apply_operation` that takes two arguments: `data` and `operation`. The `data` argument can be of any type (integer, float, string, list, etc.), and the `operation` argument will be a function that defines the operation to be perfo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert apply_operation(5, lambda x: x * x) == 25\", \"assert apply_operation(3.5, lambda x: x + 1) == 4.5\", \"assert apply_operation([1, 2, 3], len) == 3\", \"assert apply_operation('hello', str.upper) == 'HELLO'\", \"assert apply_operation([1, 2, 3], sum) == 6\",...
{ "split": "train", "index": 77189, "acecode_id": "oss_21336", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `delete_empty_directories(directory_list)` that takes a list of directory names as input and returns the number of non-empty directories encountered. The function should simulate the deletion of directories without actually performing file system operations. An...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert delete_empty_directories(['dir1', 'dir2', 'dir3']) == 0\", \"assert delete_empty_directories(['dir1', 'dir2', 'dir3', 'dir4', 'dir5']) == 0\", \"assert delete_empty_directories(['empty_dir1']) == 0\", \"assert delete_empty_directories(['test1', 'test2', 'tes...
{ "split": "train", "index": 77190, "acecode_id": "evol_28674", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given a string that may represent a resource and may or may not have an associated access control list (ACL) attribute. Your task is to implement a function `normalize_acl(resource: str) -> List[str]` that takes a string `resource` as input. If the resource string does ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert normalize_acl('__acl__ present here') == ['ACL exists']\", \"assert normalize_acl('this is an ACL test __acl__') == ['ACL exists']\", \"assert normalize_acl('no acl here') == []\", \"assert normalize_acl('another test without acl') == []\", \"assert normaliz...
{ "split": "train", "index": 77191, "acecode_id": "bigcode_python_fns_30333", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a function x_dot(y) that describes the rate of change of position with respect to time, your task is to implement a function that takes an integer y as input and returns the same integer y. The function should simply return the input value without any modifications. Pleas...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert x_dot(0) == 0\", \"assert x_dot(1) == 1\", \"assert x_dot(-1) == -1\", \"assert x_dot(100) == 100\", \"assert x_dot(-100) == -100\", \"assert x_dot(42) == 42\", \"assert x_dot(-42) == -42\", \"assert x_dot(2147483647) == 2147483647\", \"assert x_dot(-2147483...
{ "split": "train", "index": 77192, "acecode_id": "bigcode_python_fns_15834", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the scores of a game. The game has a special rule: if the current score is the same as the previous score, the current score is not added to the total score. Write a function to calculate the total score of the game according to thi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_total_score([]) == 0\", \"assert calculate_total_score([0]) == 0\", \"assert calculate_total_score([1]) == 1\", \"assert calculate_total_score([1, 1]) == 1\", \"assert calculate_total_score([1, 2]) == 3\", \"assert calculate_total_score([1, 1, 1]) ...
{ "split": "train", "index": 77193, "acecode_id": "oss_4440", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Write a Python function that takes a list of integers and returns the second lowest unique numerical element in that list. If there are not enough unique elements to determine a second lowest, return None.\nPlease reason step by step, then write a self-contained Python solution...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert second_lowest([4, 2, 9, 6, 5, 2, 8, 7, 3]) == 3\", \"assert second_lowest([1, 1, 1, 1]) == None\", \"assert second_lowest([5, 5, 5, 5, 5, 10]) == 10\", \"assert second_lowest([4, 2, 9, 9, 6]) == 4\", \"assert second_lowest([3, 1, 2, 1, 4]) == 2\", \"assert s...
{ "split": "train", "index": 77194, "acecode_id": "evol_24638", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a Python function `decode_text(text: str) -> str` that deciphers a given text string using a custom decoding algorithm. The decoding algorithm should map specific characters to others as follows: 'x' to 'a', 'y' to 'b', 'z' to 'c', 'X' to 'A', 'Y' to 'B', 'Z' to 'C', ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert decode_text('abcXYZ!') == 'abcABC,'\", \"assert decode_text('1?2!3.') == '0.1,2!'\", \"assert decode_text('!Hello?') == ',Hello.'\", \"assert decode_text('xYz!') == 'aBc,'\", \"assert decode_text('') == ''\", \"assert decode_text('123xyz') == '012abc'\", \"a...
{ "split": "train", "index": 77195, "acecode_id": "evol_19767", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two lists of numerical values, write a function `interchange_arrays(list1, list2)` that interchanges the elements of the two lists while preserving their corresponding index positions. The function should return the two lists after the interchange. Both lists will have th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert interchange_arrays([1, 2, 3], [4, 5, 6]) == ([4, 5, 6], [1, 2, 3])\", \"assert interchange_arrays([10, 20], [30, 40]) == ([30, 40], [10, 20])\", \"assert interchange_arrays([1], [2]) == ([2], [1])\", \"assert interchange_arrays([1, 3, 5], [2, 4, 6]) == ([2, ...
{ "split": "train", "index": 77196, "acecode_id": "evol_19187", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `sophisticated_function` that takes one required argument `arg1`, an optional argument `arg2`, an optional argument `arg3` with a default value, and allows for a variable number of additional positional and keyword arguments. The function should validate th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sophisticated_function(10) is None\", \"assert sophisticated_function(10, 'hello') is None\", \"assert sophisticated_function(10, 'hello', 'world') is None\", \"assert sophisticated_function(10, arg2='hello', arg3='test') is None\", \"assert sophisticated_fu...
{ "split": "train", "index": 77197, "acecode_id": "evol_4290", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a 9x9 Sudoku board represented as a 2D list, where empty cells are denoted by 0. Your task is to implement a function that identifies all the 'naked quads' in the Sudoku board. A 'naked quad' consists of four cells in the same row, column, or 3x3 box that contain ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_naked_quads([[5, 3, 0, 0, 7, 0, 0, 0, 0], [6, 0, 0, 1, 9, 5, 0, 0, 0], [0, 9, 8, 0, 0, 0, 0, 6, 0], [8, 0, 0, 0, 6, 0, 0, 0, 3], [4, 0, 0, 8, 0, 3, 0, 0, 1], [7, 0, 0, 0, 2, 0, 0, 0, 6], [0, 6, 0, 0, 0, 0, 2, 8, 0], [0, 0, 0, 4, 1, 9, 0, 0, 5], [0, 0, 0...
{ "split": "train", "index": 77198, "acecode_id": "bigcode_python_fns_41340", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are given a list of floating-point numbers `x`, a list of lower bounds `lb`, and a list of upper bounds `ub`. Your task is to implement a function `make_strictly_feasible(x: List[float], lb: List[float], ub: List[float], rstep: float = 1e-10) -> List[float]` that adjusts ea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert make_strictly_feasible([1.0, 5.0], [0.0, 4.0], [2.0, 6.0]) == [1.0, 5.0]\", \"assert make_strictly_feasible([1.0, 5.0], [0.0, 4.1], [2.0, 6.0]) == [1.0, 5.0]\", \"assert make_strictly_feasible([3.0, 7.0], [2.0, 6.0], [4.0, 8.0]) == [3.0, 7.0]\", \"assert mak...
{ "split": "train", "index": 77199, "acecode_id": "bigcode_python_fns_305", "num_tests": 9 }