data_source
large_stringclasses
1 value
prompt
listlengths
1
1
ability
large_stringclasses
1 value
reward_model
dict
extra_info
dict
acecode
[ { "role": "user", "content": "You are given a list of integers. Write a function `find_maximum` that takes in a list of integers and returns the maximum value from the list. If the list is empty, return None. You should implement this function without using any built-in max functions. The input list can con...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_maximum([1, 2, 3, 4, 5]) == 5\", \"assert find_maximum([-1, -2, -3, -4]) == -1\", \"assert find_maximum([0, 0, 0]) == 0\", \"assert find_maximum([2, 3, 1, 5, 4]) == 5\", \"assert find_maximum([-10, -20, -5]) == -5\", \"assert find_maximum([100, 200, 300...
{ "split": "train", "index": 69400, "acecode_id": "oss_21178", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that calculates the mean (average) of a list of integers. The function should take a list of integers as input and return the mean as a float. If the input list is empty, your function should return 0.0. Implement the function named `calc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_mean([1, 2, 3, 4, 5]) == 3.0\", \"assert calculate_mean([-1, -2, -3, -4, -5]) == -3.0\", \"assert calculate_mean([0, 0, 0]) == 0.0\", \"assert calculate_mean([10]) == 10.0\", \"assert calculate_mean([]) == 0.0\", \"assert calculate_mean([1, 1, 1, 1...
{ "split": "train", "index": 69401, "acecode_id": "oss_19457", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of buildings along a street. Your task is to determine how many pairs of buildings can be formed such that the height of the first building is strictly less than the height of the second building. Implement a function `c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_valid_pairs([1, 2, 3]) == 3\", \"assert count_valid_pairs([3, 2, 1]) == 0\", \"assert count_valid_pairs([2, 2, 2]) == 0\", \"assert count_valid_pairs([1]) == 0\", \"assert count_valid_pairs([]) == 0\", \"assert count_valid_pairs([1, 2, 3, 4, 5]) == 10\...
{ "split": "train", "index": 69402, "acecode_id": "bigcode_python_fns_8611", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Implement a function 'locate_numbers' that takes a list of integers and returns a tuple (a, b, c, d, e, f). Here, 'a' is the smallest prime number, 'b' is the largest prime number, 'c' is the smallest composite number, 'd' is the largest composite number, 'e' is the sum of all ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert locate_numbers([]) == (None, None, None, None, None, None)\", \"assert locate_numbers([2, 9]) == (2, 2, 9, 9, 2, 9)\", \"assert locate_numbers([4, 6, 8, 10]) == (None, None, 4, 10, None, 28)\", \"assert locate_numbers([11, 13, 17]) == (11, 17, None, None, 41...
{ "split": "train", "index": 69403, "acecode_id": "evol_20995", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that finds the indices of specific types of elements in a 2D mesh. The function should take a list of elements, where each element is represented as a list of integers indicating its vertices. The function should also take a keyword a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_elements([[0], [1, 2, 3], [4, 5, 6]], 'quadrilateral') == []\", \"assert find_elements([[0], [1, 2, 3], [4, 5, 6]], 'node') == [0]\", \"assert find_elements([[1, 2, 3], [3, 4, 5], [5, 6, 7, 8]], 'triangle') == [0, 1]\", \"assert find_elements([[1, 2, 3]...
{ "split": "train", "index": 69404, "acecode_id": "oss_49", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing a dataset. Your task is to implement a function that takes this list as input and returns a new list where each element is the square of the original element. The function should not modify the input list and should handle empty lis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert square_dataset([1, 2, 3]) == [1, 4, 9]\", \"assert square_dataset([-1, 0, 1]) == [1, 0, 1]\", \"assert square_dataset([]) == []\", \"assert square_dataset([2, 4, 6]) == [4, 16, 36]\", \"assert square_dataset([-2, -3, -4]) == [4, 9, 16]\", \"assert square_dat...
{ "split": "train", "index": 69405, "acecode_id": "oss_35777", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with extracting multiple files from various 7z archives based on a list of file paths provided in a text format. Each line in the text file contains the name of the 7z file and the relative path to the file that needs to be extracted, separated by a comma. Write ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_files(['A20000to22000.7z, A20000to22000/rows/A21673.Lo1sign.jpg']) == None\", \"assert extract_files(['B20000to22000.7z, B20000to22000/rows/B21673.Lo1sign.jpg']) == None\", \"assert extract_files(['C30000to32000.7z, C30000to32000/rows/C31673.Lo1sign....
{ "split": "train", "index": 69406, "acecode_id": "evol_20542", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of 7 integers, each representing a card in a hand. Your task is to determine the best combination of 5 cards from this hand based on the following ranking system: 1. The highest card (the largest integer) wins. If there's a tie, the next highest card is con...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert best_hand([10, 9, 8, 7, 6, 5, 4]) == [10, 9, 8, 7, 6]\", \"assert best_hand([4, 4, 4, 4, 4, 4, 4]) == [4, 4, 4, 4, 4]\", \"assert best_hand([5, 3, 2, 1, 10, 7, 8]) == [10, 8, 7, 5, 3]\", \"assert best_hand([20, 15, 10, 5, 1, 25, 30]) == [30, 25, 20, 15, 10]\...
{ "split": "train", "index": 69407, "acecode_id": "bigcode_python_fns_33124", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a 2D list of probabilities for each class and a list of true class labels. Write a function `accuracy(y: List[List[float]], t: List[int]) -> float` that calculates the accuracy of the predicted class labels. The function should take two arguments: \n1. `y`: A 2D l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert accuracy([[0.2, 0.5, 0.3], [0.3, 0.4, 0.3], [0.1, 0.2, 0.7]], [1, 2, 2]) == 0.6666666666666666\", \"assert accuracy([[0.9, 0.1], [0.4, 0.6]], [0, 1]) == 1.0\", \"assert accuracy([[0.0, 1.0], [1.0, 0.0], [0.5, 0.5]], [1, 0, 0]) == 1.0\", \"assert accuracy([[0...
{ "split": "train", "index": 69408, "acecode_id": "bigcode_python_fns_44873", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a list of function calls represented as tuples, where each tuple consists of the function name and a list of its arguments. Your task is to implement a function that takes this list of function calls and returns a dictionary where each key is the function name and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_function_arity([('foo', [1, 2]), ('bar', [3]), ('foo', [4, 5, 6])]) == {'foo': 2, 'bar': 1}\", \"assert count_function_arity([]) == {}\", \"assert count_function_arity([('baz', [])]) == {'baz': 0}\", \"assert count_function_arity([('alpha', [1]), ('bet...
{ "split": "train", "index": 69409, "acecode_id": "bigcode_python_fns_17442", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that generates relevant query suggestions based on user input. The function should take a string input representing a user's query and return a list of suggestions that are relevant based on certain predefined criteria. The criteria a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_suggestions('search for something') == ['search for...']\", \"assert generate_suggestions('search') == ['search for...']\", \"assert generate_suggestions('some query data') == ['data analysis']\", \"assert generate_suggestions('data') == ['data anal...
{ "split": "train", "index": 69410, "acecode_id": "oss_18489", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Write a function `formulate_string(length: int) -> str` that generates a random string of lowercase alphabetic characters of the specified length. The function should use the characters from the string 'abcdefghijklmnopqrstuvwxyz'. The output should be a string consisting of ra...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert formulate_string(0) == ''\", \"assert len(formulate_string(1)) == 1\", \"assert len(formulate_string(5)) == 5\", \"assert len(formulate_string(10)) == 10\", \"assert len(formulate_string(20)) == 20\", \"assert len(formulate_string(50)) == 50\", \"assert len(...
{ "split": "train", "index": 69411, "acecode_id": "evol_10367", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that takes a dictionary representing configuration data and extracts the storage mode specified by the key 'storage_mode'. If the key 'storage_mode' is not present in the dictionary, the function should return 'Storage mode not specified'....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_storage_mode({'storage_mode': 'local'}) == 'local'\", \"assert get_storage_mode({'storage_mode': 'cloud'}) == 'cloud'\", \"assert get_storage_mode({'storage_mode': 'database'}) == 'database'\", \"assert get_storage_mode({}) == 'Storage mode not specified...
{ "split": "train", "index": 69412, "acecode_id": "oss_28038", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two 3-dimensional vectors represented as tuples of three numbers, `v` and `r`, implement a function `vec_project(v, r)` that calculates the length of vector `v` projected onto vector `r`. The length of a vector projected onto another vector can be calculated using the for...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert vec_project((3, 4, 0), (1, 0, 0)) == 3.0\", \"assert vec_project((1, 2, 2), (0, 0, 1)) == 2.0\", \"assert vec_project((0, 0, 0), (5, 5, 5)) == 0.0\", \"assert vec_project((0, 3, 4), (0, 0, 1)) == 4.0\", \"assert vec_project((1, -1, 0), (1, 1, 0)) == 0.0\", \...
{ "split": "train", "index": 69413, "acecode_id": "oss_11161", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `get_package_version()` that returns the version number of a hypothetical package. The version number is stored in a string format, and you are given the version string directly as an input parameter to the function. If the version string...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_package_version('1.0.0') == '1.0.0'\", \"assert get_package_version('2.1.5') == '2.1.5'\", \"assert get_package_version('3.0.1') == '3.0.1'\", \"assert get_package_version('4.0') == 'Version not found'\", \"assert get_package_version('5.0.0.1') == 'Versi...
{ "split": "train", "index": 69414, "acecode_id": "oss_18316", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing scores of students in a test. Your task is to implement a function that determines the number of students who scored above a given threshold. The function should take two parameters: a list of integers 'scores' (1 <= len(scores) <= ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_students_above_threshold([70, 85, 90, 60, 75], 80) == 2\", \"assert count_students_above_threshold([50, 60, 70, 80, 90], 55) == 4\", \"assert count_students_above_threshold([100, 100, 100], 100) == 0\", \"assert count_students_above_threshold([0, 0, 0,...
{ "split": "train", "index": 69415, "acecode_id": "bigcode_python_fns_27986", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a function named `create_unicycle` that takes two parameters, `color` (a string representing the color of the unicycle) and `wheel_size` (an integer representing the size of the unicycle wheel). The function should return a dictionary representing the unicycle with the k...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_unicycle('Red', 24) == {'color': 'Red', 'wheel_size': 24}\", \"assert create_unicycle('Blue', 20) == {'color': 'Blue', 'wheel_size': 20}\", \"assert create_unicycle('Green', 26) == {'color': 'Green', 'wheel_size': 26}\", \"assert create_unicycle('Yell...
{ "split": "train", "index": 69416, "acecode_id": "evol_19541", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to generate unique sample IDs for a research project. The sample IDs follow a specific format: \"YYYY-GCRSR-XXXX\", where \"YYYY\" is the year, \"GCRSR\" is a project code, and \"XXXX\" is a unique 4-digit identifier. Write a Python f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_sample_ids(2021, 'TEST', 5) == ['2021-TEST-0001', '2021-TEST-0002', '2021-TEST-0003', '2021-TEST-0004', '2021-TEST-0005']\", \"assert generate_sample_ids(2020, 'GCRSR', 0) == []\", \"assert generate_sample_ids(2022, 'XYZ', 10) == ['2022-XYZ-0001', '...
{ "split": "train", "index": 69417, "acecode_id": "oss_19577", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the adjustment of an audio player's volume and cone outer gain. The function should take two parameters: `volume` and `cone_outer_gain`, both of which are floating-point numbers. The `volume` represents the audio volume...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert adjust_audio_settings(0.5, 0.3) == (0.5, 0.3)\", \"assert adjust_audio_settings(1.2, 0.5) == (1.0, 0.5)\", \"assert adjust_audio_settings(-0.5, 0.8) == (0.0, 0.8)\", \"assert adjust_audio_settings(0.7, 1.5) == (0.7, 1.0)\", \"assert adjust_audio_settings(0.0...
{ "split": "train", "index": 69418, "acecode_id": "oss_701", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `auto_link(elements: List[int]) -> List[int]` that returns a new list where each element is the sum of itself and the previous element in the original list. The first element of the new list should remain the same as the first element ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert auto_link([1, 2, 3, 4]) == [1, 3, 6, 10]\", \"assert auto_link([5, 5, 5]) == [5, 10, 15]\", \"assert auto_link([0, 0, 0]) == [0, 0, 0]\", \"assert auto_link([-1, -2, -3]) == [-1, -3, -6]\", \"assert auto_link([10]) == [10]\", \"assert auto_link([]) == []\", ...
{ "split": "train", "index": 69419, "acecode_id": "bigcode_python_fns_24692", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that generates a command string for launching a simulation program in a specific mode. The function takes the following parameters: `exec_file` (str): the executable file path, `jobname` (str): the name of the job, `nproc` (int): the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_command('program.exe', 'job1', 4, '-v') == 'program.exe -aas -j job1 -np 4 -v '\", \"assert generate_command('', 'job1', 4, '') == ''\", \"assert generate_command('program.exe', 'job2', 2, '-d') == 'program.exe -aas -j job2 -np 2 -d '\", \"assert ge...
{ "split": "train", "index": 69420, "acecode_id": "bigcode_python_fns_21725", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a dictionary where the values can be either integers or strings. Write a function that sorts the values in the following order: first, all integers in descending order, followed by all strings in lexicographical order. Additionally, provide an option to ignore cas...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_dict({}, True) == []\", \"assert sort_dict({'a': 1}, True) == [1]\", \"assert sort_dict({'a': 1, 'b': 2}, True) == [2, 1]\", \"assert sort_dict({'a': 1, 'b': 'apple'}, True) == [1, 'apple']\", \"assert sort_dict({'a': 'banana', 'b': 'apple'}, True) == [...
{ "split": "train", "index": 69421, "acecode_id": "evol_4800", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing a dataset. Your task is to remove all even numbers from this dataset and return a new list containing only the odd numbers. Implement a function called `filter_odd_numbers(dataset: List[int]) -> List[int]` that takes a list of integ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_odd_numbers([1, 2, 3, 4, 5]) == [1, 3, 5]\", \"assert filter_odd_numbers([2, 4, 6, 8]) == []\", \"assert filter_odd_numbers([10, 15, 20, 25]) == [15, 25]\", \"assert filter_odd_numbers([0, 1, 2, 3]) == [1, 3]\", \"assert filter_odd_numbers([-1, -2, -3...
{ "split": "train", "index": 69422, "acecode_id": "bigcode_python_fns_20623", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `finalize(data: dict, models: dict) -> dict` that converts references in a given dictionary into actual instances based on a mapping provided in another dictionary. The `data` dictionary contains key-value pairs where the value could ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert finalize({'ref1': 1, 'ref2': 2, 'other': 'value'}, {1: 'instance1', 2: 'instance2'}) == {'ref1': 'instance1', 'ref2': 'instance2', 'other': 'value'}\", \"assert finalize({'key1': 3, 'key2': 4}, {3: 'instance3'}) == {'key1': 'instance3', 'key2': 4}\", \"asser...
{ "split": "train", "index": 69423, "acecode_id": "oss_15590", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `freeze_system(args: List[str], config: Dict[str, Any]) -> None` that takes two parameters: a list of strings `args` representing command-line arguments and a dictionary `config` representing configuration settings. The function should no...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert freeze_system([], {}) == None\", \"assert freeze_system(['--help'], {'option': 'value'}) == None\", \"assert freeze_system(['--config', 'test.cfg'], {'setting1': 'enabled', 'setting2': 'disabled'}) == None\", \"assert freeze_system(['arg1', 'arg2', 'arg3'], ...
{ "split": "train", "index": 69424, "acecode_id": "bigcode_python_fns_40489", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `substitution_cipher(text: str, offset: int) -> Tuple[str, str]` that encrypts and decrypts a given text using a simple substitution cipher based on a specified offset. The function should return a tuple containing two strings: the en...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert substitution_cipher('abc', 3) == ('def', 'abc')\", \"assert substitution_cipher('xyz', 3) == ('abc', 'xyz')\", \"assert substitution_cipher('Hello, World!', 5) == ('Mjqqt, Btwqi!', 'Hello, World!')\", \"assert substitution_cipher('Python3.8', 2) == ('Ravjqp3...
{ "split": "train", "index": 69425, "acecode_id": "oss_2854", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a custom form in Django that overrides the default widget for a specific model's `TextField` with a widget called `AdminPagedownWidget`. Your goal is to implement a function that takes a model name and a field name as input, and returns a dictionary...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert custom_widget_config('YourModel', 'your_text_field') == {'YourModel': {'your_text_field': 'AdminPagedownWidget'}}\", \"assert custom_widget_config('AnotherModel', 'description') == {'AnotherModel': {'description': 'AdminPagedownWidget'}}\", \"assert custom_w...
{ "split": "train", "index": 69426, "acecode_id": "oss_10921", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the IDs of tweets. Your task is to implement a function that returns the number of unique tweet IDs in the list. Write a function `count_unique_tweets(tweet_ids: List[int]) -> int` that takes a list of integers `tweet_ids` and retur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_unique_tweets([1, 2, 3, 1, 2]) == 3\", \"assert count_unique_tweets([1, 1, 1, 1]) == 1\", \"assert count_unique_tweets([]) == 0\", \"assert count_unique_tweets([5, 6, 7, 8, 9]) == 5\", \"assert count_unique_tweets([10, 10, 10, 10, 10]) == 1\", \"assert...
{ "split": "train", "index": 69427, "acecode_id": "bigcode_python_fns_36971", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing a filename that may contain a datetime in the format 'YYYY-MM-DD_HH-MM-SS'. Write a function `extract_datetime_from_filename(filename: str) -> str` that extracts and returns the first valid datetime found in the filename. If no valid datetime...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_datetime_from_filename('notes.txt') == None\", \"assert extract_datetime_from_filename('data_2023-10-05.txt') == None\", \"assert extract_datetime_from_filename('meeting_2022-12-05_HH-MM-SS.txt') == None\", \"assert extract_datetime_from_filename('ev...
{ "split": "train", "index": 69428, "acecode_id": "bigcode_python_fns_36439", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You have been given a list of commit hashes representing the history of a repository. Each hash is a unique string and represents a commit in the order of their creation. Your task is to implement a function named `get_commits_between` that takes two commit hashes, `base_sha` a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_commits_between('a1b2c3', 'd4e5f6', ['a1b2c3', 'b2c3d4', 'c3d4e5', 'd4e5f6', 'e5f6g7']) == ['b2c3d4', 'c3d4e5']\", \"assert get_commits_between('a1b2c3', 'd4e5f6', ['a1b2c3', 'b2c3d4', 'c3d4e5']) == []\", \"assert get_commits_between('a1b2c3', 'b2c3d4', ...
{ "split": "train", "index": 69429, "acecode_id": "bigcode_python_fns_40672", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates a user search feature in a hypothetical system. Implement the `find_user_by_email` function, which takes an email address as a parameter and returns the user details if found, or a message indicating that the user wa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_user_by_email('alice@example.com') == {'name': 'Alice', 'age': 30, 'email': 'alice@example.com'}\", \"assert find_user_by_email('bob@example.com') == {'name': 'Bob', 'age': 25, 'email': 'bob@example.com'}\", \"assert find_user_by_email('david@example.co...
{ "split": "train", "index": 69430, "acecode_id": "oss_9057", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a list of metrics, where each metric is represented as a dictionary containing the following keys: 'Dataset', 'Value', and 'Timestamp'. Your task is to implement a function that processes the list of metrics and organizes them into a dictionary where each key is a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_metrics([{'Dataset': 'A', 'Value': 10, 'Timestamp': '2023-01-01'}, {'Dataset': 'B', 'Value': 20, 'Timestamp': '2023-01-02'}, {'Dataset': 'A', 'Value': 15, 'Timestamp': '2023-01-03'}]) == {'A': [(10, '2023-01-01'), (15, '2023-01-03')], 'B': [(20, '202...
{ "split": "train", "index": 69431, "acecode_id": "bigcode_python_fns_13510", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that updates the preferences for a camera entity. The function should accept the current preferences of the camera and a dictionary of changes to be applied. Your function should return the updated preferences after applying the chang...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_camera_prefs({'preload_stream': True}, {'preload_stream': False}) == {'preload_stream': False}\", \"assert update_camera_prefs({'preload_stream': False}, {'preload_stream': True}) == {'preload_stream': True}\", \"assert update_camera_prefs({'preload_s...
{ "split": "train", "index": 69432, "acecode_id": "bigcode_python_fns_14898", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a string as input and returns the string reversed. The function should handle any special characters and whitespace in the string. For example, given the input 'Hello World!', the output should be '!dlroW olleH'.\nPlease reason step by step, then...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_string('Hello World!') == '!dlroW olleH'\", \"assert reverse_string('Python') == 'nohtyP'\", \"assert reverse_string('12345') == '54321'\", \"assert reverse_string('') == ''\", \"assert reverse_string('A man a plan a canal Panama') == 'amanaP lanac a...
{ "split": "train", "index": 69433, "acecode_id": "evol_27697", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function `caesar_cipher` that takes a string `text` and an integer `shift` as input and returns the string after applying the Caesar Cipher technique. The function should transpose alphabetic characters by the specified number of positions in the alphabetical order,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert caesar_cipher('Hello World!', 3) == 'Khoor Zruog!'\", \"assert caesar_cipher('abc XYZ', 2) == 'cde ZAB'\", \"assert caesar_cipher('a', 1) == 'b'\", \"assert caesar_cipher('A', 1) == 'B'\", \"assert caesar_cipher('z', 1) == 'a'\", \"assert caesar_cipher('Z', ...
{ "split": "train", "index": 69434, "acecode_id": "evol_28598", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing token IDs. Your task is to implement a function `predict(input_tokens: List[int]) -> List[int]` that processes these token IDs and returns a list of predicted token IDs. The function should first filter out all token IDs that are le...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert predict([1, 2, 3]) == [1, 4, 9]\", \"assert predict([-1, -2, -3]) == []\", \"assert predict([0, 1, 2]) == [1, 4]\", \"assert predict([-5, 0, 5]) == [25]\", \"assert predict([3, 2, 1]) == [1, 4, 9]\", \"assert predict([10, -10, 5]) == [25, 100]\", \"assert pr...
{ "split": "train", "index": 69435, "acecode_id": "bigcode_python_fns_27659", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that determines the type of auction based on the provided auction identifier. The identifier can be one of the following types: a string representing the auction hash, an integer representing the auction height, or None, which indicates t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert auction_info('abc123') == {'type': 'hash', 'id': 'abc123', 'details': 'Auction details here'}\", \"assert auction_info(5) == {'type': 'height', 'id': 5, 'details': 'Auction details here'}\", \"assert auction_info(None) == {'type': 'latest', 'id': None, 'deta...
{ "split": "train", "index": 69436, "acecode_id": "bigcode_python_fns_4132", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given three points A, B, and C in a 3D space represented as arrays of three floats each, determine the orientation of point A with respect to the plane defined by points B and C. The function should return 1 if A is on one side of the plane, -1 if it is on the other side, and 0...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert orientation_point_plane([0, 0, 0], [1, 0, 0], [0, 1, 0]) == 0\", \"assert orientation_point_plane([0, 0, 0], [1, 1, 1], [2, 2, 2]) == 0\", \"assert orientation_point_plane([1, 1, 1], [2, 2, 2], [3, 3, 3]) == 0\", \"assert orientation_point_plane([0, 0, 0], [...
{ "split": "train", "index": 69437, "acecode_id": "bigcode_python_fns_40612", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given two coefficients and two values, implement a function `add` that calculates the result of the expression `((coefficient_1 * value_1) + (coefficient_2 * value_2))`. The function should support both scalar values and lists of numbers. If the input values are lists, they mus...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add(2, 3, 3, 4) == 18\", \"assert add(1, [1, 2, 3], 2, [4, 5, 6]) == [9, 12, 15]\", \"assert add(0, 5, 1, 3) == 3\", \"assert add(1, [1, 2], 1, [3, 4]) == [4, 6]\", \"assert add(3, 0, 2, 5) == 10\", \"assert add(-1, 1, 1, 2) == 1\", \"assert add(0, [0, 0], 0...
{ "split": "train", "index": 69438, "acecode_id": "bigcode_python_fns_16134", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that returns the maximum product of any two distinct integers from the list. If the list contains fewer than two integers, return 0. Your function should have the following signature: `def max_product(nums: List[int]) -> int:`. The fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_product([3, 5, -2, 8]) == 40\", \"assert max_product([1]) == 0\", \"assert max_product([]) == 0\", \"assert max_product([1, 2]) == 2\", \"assert max_product([0, 0, 0]) == 0\", \"assert max_product([5, 5, 5]) == 25\", \"assert max_product([-1, 0, 1, 2]) =...
{ "split": "train", "index": 69439, "acecode_id": "bigcode_python_fns_22100", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a generator function `cube_root_generator(list_of_nums)` that takes a list of numbers and yields the cube root of each number one at a time. The generator should calculate the cube root only when requested. It should also correctly handle negative numbers and zero, co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list(cube_root_generator([0, -1, -8, 8])) == [0.0, -1.0, -2.0, 2.0]\", \"assert list(cube_root_generator([-1, -27, 0, 8])) == [-1.0, -3.0, 0.0, 2.0]\", \"assert list(cube_root_generator([0])) == [0.0]\", \"assert list(cube_root_generator([1, 8, 27, -1, -8, -...
{ "split": "train", "index": 69440, "acecode_id": "evol_8137", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Write a function that takes two numbers as inputs and returns the larger number. If the two numbers are equal, return a message stating that both numbers are the same along with the repeated number. The function should handle both integer and floating-point inputs.\nPlease reas...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_num(10, 5) == 10\", \"assert max_num(5, 10) == 10\", \"assert max_num(3.5, 3.5) == 'Both numbers are the same: 3.5'\", \"assert max_num(-1, -5) == -1\", \"assert max_num(0, 0) == 'Both numbers are the same: 0'\", \"assert max_num(2.2, 2.2) == 'Both numbe...
{ "split": "train", "index": 69441, "acecode_id": "evol_24066", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `advanced_monotonic(l: list, strict: bool = False) -> bool` that determines if the elements of the input list `l` are sorted in a monotonically increasing or decreasing order, taking into account a `strict` parameter. The function should return True if the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert advanced_monotonic([], strict=False) == True\", \"assert advanced_monotonic([1, 2, 3, 4], strict=False) == True\", \"assert advanced_monotonic([1, 2, 2, 4], strict=False) == True\", \"assert advanced_monotonic([4, 3, 2, 1], strict=False) == True\", \"assert ...
{ "split": "train", "index": 69442, "acecode_id": "evol_35074", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string, remove all duplicated characters in-place, ensuring that only the first occurrence of each character remains. The function should not use any additional data structures. The case sensitivity of the characters should be considered, meaning 'A' and 'a' should not ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_duplicates('abcabcabc') == 'abc'\", \"assert remove_duplicates('aabbcc') == 'abc'\", \"assert remove_duplicates('abcd') == 'abcd'\", \"assert remove_duplicates('aA') == 'aA'\", \"assert remove_duplicates('') == ''\", \"assert remove_duplicates('112233...
{ "split": "train", "index": 69443, "acecode_id": "evol_21407", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of supported formats and a user's request represented by a dictionary. The request contains a 'format' key which signifies the requested format and an 'accept' key which is a list of preferred formats with their quality scores. Implement a function `get_ser...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_serializer({'format': 'json', 'accept': [('text/html', 1), ('application/json', 0)]}) == 'json'\", \"assert get_serializer({'format': 'xml', 'accept': [('text/html', 1), ('application/xml', 0)]}) == 'xml'\", \"assert get_serializer({'format': 'csv', 'acc...
{ "split": "train", "index": 69444, "acecode_id": "bigcode_python_fns_33408", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given an integer `n`, return the sum of the first `n` natural numbers. The natural numbers are the positive integers starting from 1. Implement a function `sum_of_n(n: int) -> int` that takes a single integer `n` as input and returns the sum of the first `n` natural numbers. If...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_n(1) == 1\", \"assert sum_of_n(2) == 3\", \"assert sum_of_n(3) == 6\", \"assert sum_of_n(4) == 10\", \"assert sum_of_n(5) == 15\", \"assert sum_of_n(6) == 21\", \"assert sum_of_n(10) == 55\", \"assert sum_of_n(100) == 5050\", \"assert sum_of_n(0) == 0...
{ "split": "train", "index": 69445, "acecode_id": "bigcode_python_fns_7773", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `is_valid_declaration(declaration: str) -> bool` that checks if a given telemetry streaming declaration is valid. The declaration is considered valid if it is a well-formed JSON string and contains the key 'telemetry' with a non-empty...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_declaration('{\\\"telemetry\\\": \\\"some_value\\\"}') == True\", \"assert is_valid_declaration('{\\\"telemetry\\\": \\\"\\\"}') == False\", \"assert is_valid_declaration('{\\\"wrong_key\\\": \\\"some_value\\\"}') == False\", \"assert is_valid_decla...
{ "split": "train", "index": 69446, "acecode_id": "bigcode_python_fns_22425", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Construct a function that computes the total count of consonants from a specified list of sentences, but only after disregarding sentences that start with a vowel, end with a consonant, contain any numbers, or have fewer than 5 words. Implement a function called `count_consonan...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_consonants(['A quick brown fox jumps over the lazy dog']) == 0\", \"assert count_consonants(['123 testing sentence']) == 0\", \"assert count_consonants(['Are you ready for the challenge?']) == 0\", \"assert count_consonants(['It is a sunny day']) == 0\...
{ "split": "train", "index": 69447, "acecode_id": "evol_4789", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes command line arguments for a service. The function should accept a list of strings representing command line arguments and return a dictionary where the keys are the names of the arguments (without the leading '-') and ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_arguments(['-zk', 'localhost:2181', '-s', 'myapp', '-host', 'localhost', '-p', '9090', '-e', 'stage', '-hcu', 'http://localhost:9091/healthcheck?pretty=true']) == {'zk': 'localhost:2181', 's': 'myapp', 'host': 'localhost', 'p': '9090', 'e': 'stage', ...
{ "split": "train", "index": 69448, "acecode_id": "bigcode_python_fns_6845", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing a LaTeX formula that may contain occurrences of the substring '\\\\dot'. Your task is to implement a function that replaces all occurrences of '\\\\dot' with '\\dot' in the given string. The input string will not contain any other escape sequ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert replace_dot('This is a formula with \\\\\\\\dot and more text.') == 'This is a formula with \\\\dot and more text.'\", \"assert replace_dot('No replacements here.') == 'No replacements here.'\", \"assert replace_dot('Replace \\\\\\\\dot in the middle \\\\\\\...
{ "split": "train", "index": 69449, "acecode_id": "bigcode_python_fns_39446", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given the root of a binary tree, return the subtree that contains all the deepest nodes. If there are multiple deepest subtrees, return any of them. A subtree is defined as a tree consisting of a node and all its descendants. You need to implement the function `subtreeWithAllDe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert subtreeWithAllDeepest(None) is None\", \"assert subtreeWithAllDeepest(TreeNode(1)).val == 1\", \"assert subtreeWithAllDeepest(TreeNode(1, TreeNode(2), TreeNode(3))).val == 1\", \"assert subtreeWithAllDeepest(TreeNode(1, TreeNode(2, TreeNode(4), TreeNode(5)),...
{ "split": "train", "index": 69450, "acecode_id": "evol_20508", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a list of strings representing CIPRS record file names. Your function should take three parameters: `files`, `user`, and `parser_mode`. The `files` parameter is a list of strings where each string represents a file name...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert import_ciprs_records_custom(['file1.txt', 'file2.txt'], 'admin', 'mode1') == ['Successfully processed file1.txt for user admin', 'Successfully processed file2.txt for user admin']\", \"assert import_ciprs_records_custom(['file_error.txt', 'file3.txt'], 'user...
{ "split": "train", "index": 69451, "acecode_id": "oss_23110", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of integers. The function should return a dictionary where the keys are the unique integers from the input list, and the values are the counts of how many times each integer appears in the list. If the input l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_integers([1, 2, 2, 3]) == {1: 1, 2: 2, 3: 1}\", \"assert count_integers([4, 4, 4, 5, 5]) == {4: 3, 5: 2}\", \"assert count_integers([]) == {}\", \"assert count_integers([0, 0, 1, -1, -1]) == {0: 2, 1: 1, -1: 2}\", \"assert count_integers([1]) == {1: 1}...
{ "split": "train", "index": 69452, "acecode_id": "oss_36458", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a canonical cache name based on the type of cache provided and an optional unique tag. The function should follow these rules: 1. The base name of the cache should always be 'tmp.cache'. 2. The cache type must be a valid st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_cache_name('mem') == 'tmp.cache.mem'\", \"assert get_cache_name('disk') == 'tmp.cache.disk'\", \"assert get_cache_name('db') == 'tmp.cache.db'\", \"assert get_cache_name('mem', 'session1') == 'tmp.cache.mem.session1'\", \"assert get_cache_name('disk', 's...
{ "split": "train", "index": 69453, "acecode_id": "bigcode_python_fns_33919", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a configuration dictionary representing a setup for a sensor platform. Your task is to implement a function that checks if a given platform is present in the configuration. The function should return True if the platform is present and set up correctly, and False ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_platform_configured({'platform': 'unifi'}, 'unifi') == True\", \"assert is_platform_configured({'platform': 'unifi'}, 'other') == False\", \"assert is_platform_configured({'platform': 'other'}, 'unifi') == False\", \"assert is_platform_configured({}, 'uni...
{ "split": "train", "index": 69454, "acecode_id": "bigcode_python_fns_19471", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to implement a function `log(func: Callable[..., RT]) -> Callable[..., RT]` that takes a callable function as an argument and returns a new function that logs messages when the function is entered and exited. The log messages should print the name of the function being...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert log(lambda x: x + 1)(10) == 11\", \"assert log(lambda x: x * 2)(5) == 10\", \"assert log(lambda x, y: x - y)(10, 5) == 5\", \"assert log(lambda x: x ** 2)(3) == 9\", \"assert log(lambda: 'Hello, World!')() == 'Hello, World!'\", \"assert log(lambda a, b, c: a...
{ "split": "train", "index": 69455, "acecode_id": "bigcode_python_fns_36484", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing paragraphs. Each string can either be a title or a regular paragraph. A title is defined as a non-empty string that starts with a capital letter, while a regular paragraph can be any non-empty string. Your task is to implement a func...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert handle_paragraphs(['Hello World', 'this is a test', 'Another Title']) == ['Hello World', 'Another Title']\", \"assert handle_paragraphs(['a title', 'Another one', '', 'Yet another title']) == ['Another one', 'Yet another title']\", \"assert handle_paragraphs...
{ "split": "train", "index": 69456, "acecode_id": "bigcode_python_fns_11948", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates saving a model to a file. The function should take two parameters: a string representing the model name and a string representing the file path where the model should be saved. The function should return a confirmation ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert save_model_to_file('DecisionTreeClassifier', '/models/decision_tree.pkl') == 'Model DecisionTreeClassifier saved to /models/decision_tree.pkl'\", \"assert save_model_to_file('RandomForestClassifier', '/models/random_forest.pkl') == 'Model RandomForestClassif...
{ "split": "train", "index": 69457, "acecode_id": "bigcode_python_fns_34097", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `parse_request` that takes an HTTP request represented as a dictionary and extracts specific information from it. The input dictionary will have an 'args' key containing the request's method and URI. Your goal is to return a dictionary th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_request({'args': {'method': 'GET', 'uri': '/_all/_settings'}}) == {'indices': ['_all'], 'cluster': False, 'call': '_settings', 'scripted': False}\", \"assert parse_request({'args': {'method': 'POST', 'uri': '/_cluster/health'}}) == {'indices': ['_clust...
{ "split": "train", "index": 69458, "acecode_id": "bigcode_python_fns_29822", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the starting of a fund by calculating the initial market value based on the given date. The function should accept a dictionary representing the fund's initial state, which contains the 'added_usd' and 'market_value' fi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert start_fund({'added_usd': 1000, 'market_value': 0}, '2023-01-01') == {'added_usd': 2000, 'market_value': 2000}\", \"assert start_fund({'added_usd': 500, 'market_value': 0}, '2023-01-01') == {'added_usd': 1000, 'market_value': 1000}\", \"assert start_fund({'ad...
{ "split": "train", "index": 69459, "acecode_id": "bigcode_python_fns_38672", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of positive integers representing the sizes of different files and a maximum capacity that you can use to store these files. Your task is to implement a function `max_files(files: List[int], max_capacity: int) -> int` that returns the maximum number of file...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_files([1, 2, 3, 4, 5], 5) == 2\", \"assert max_files([10, 20, 30, 40], 50) == 2\", \"assert max_files([1, 2, 3], 10) == 3\", \"assert max_files([5, 5, 5, 5], 10) == 2\", \"assert max_files([1, 1, 1, 1], 2) == 2\", \"assert max_files([2, 3, 4, 5], 8) == 2...
{ "split": "train", "index": 69460, "acecode_id": "bigcode_python_fns_38608", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `min_max_scaler(data: List[float], feature_range: Tuple[float, float] = (0, 1)) -> List[float]` that scales a list of numerical data to a specified range between two given end point values. By default, these end point values should be 0 and 1. The function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert min_max_scaler([1, 2, 3, 4, 5]) == [0.0, 0.25, 0.5, 0.75, 1.0]\", \"assert min_max_scaler([10, 20, 30, 40, 50], feature_range=(10, 20)) == [10.0, 12.5, 15.0, 17.5, 20.0]\", \"assert min_max_scaler([-1, 0, 1]) == [0.0, 0.5, 1.0]\", \"assert min_max_scaler([-1...
{ "split": "train", "index": 69461, "acecode_id": "evol_26663", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that manages a dictionary of synonyms for named entities. The function should provide the following functionalities: retrieve synonyms for a specified entity, add a synonym for an entity, and remove a synonym from an entity. You need ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_synonyms([('add', 'cat', 'feline'), ('get', 'cat')]) == [['feline']]\", \"assert manage_synonyms([('add', 'cat', 'feline'), ('add', 'cat', 'kitty'), ('get', 'cat')]) == [['feline', 'kitty']]\", \"assert manage_synonyms([('add', 'dog', 'canine'), ('get...
{ "split": "train", "index": 69462, "acecode_id": "oss_36568", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks if a given filename is a valid Linux kernel module file. A valid kernel module file should have the filename ending with the suffix '.ko.xz'. Write a function `is_valid_kernel_module(filename: str) -> bool` that takes a single...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_kernel_module('module.ko.xz') == True\", \"assert is_valid_kernel_module('driver.ko.xz') == True\", \"assert is_valid_kernel_module('test_module.ko.xz') == True\", \"assert is_valid_kernel_module('example.ko') == False\", \"assert is_valid_kernel_mo...
{ "split": "train", "index": 69463, "acecode_id": "bigcode_python_fns_22766", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `prod_signs(arr)` that takes an array of mixed data types as input and returns the sign of the product of all unique, nonzero floating point numbers in the array. If there are no valid floating point numbers, return 0. The function should ignore integers, s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert prod_signs([1, 2.5, 3.0, 2.5, 4.0]) == 1\", \"assert prod_signs([1.5, 2.5, -3.5]) == -1\", \"assert prod_signs([1.1, 1.1, 1.1]) == 1\", \"assert prod_signs([-1.0, -2.0, 0.5]) == 1\", \"assert prod_signs([-5.0, -5.0, -5.0]) == -1\", \"assert prod_signs([1.0, ...
{ "split": "train", "index": 69464, "acecode_id": "evol_11057", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of lens models represented as strings. Your task is to write a function that counts how many of these lens models are of type 'CURVED_ARC'. Implement a function `count_curved_arc_models(lens_models: List[str]) -> int` that takes in a list of lens model stri...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_curved_arc_models(['CURVED_ARC', 'STRAIGHT_LINE', 'CURVED_ARC']) == 2\", \"assert count_curved_arc_models(['CURVED_ARC', 'CURVED_ARC', 'CURVED_ARC']) == 3\", \"assert count_curved_arc_models(['STRAIGHT_LINE', 'PARABOLA', 'ELLIPSE']) == 0\", \"assert co...
{ "split": "train", "index": 69465, "acecode_id": "bigcode_python_fns_40713", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves the names of all unique cryptocurrency networks from a given list of network names. The function should accept a list of network names (some of which may be duplicates) and return a JSON string containing a list of unique n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_networks(['bitcoin', 'bitcoin-cash', 'dash', 'litecoin', 'dash']) == \\\"['bitcoin', 'bitcoin-cash', 'dash', 'litecoin']\\\"\", \"assert get_unique_networks(['ethereum', 'ripple', 'ethereum', 'litecoin']) == \\\"['ethereum', 'litecoin', 'ripple']\...
{ "split": "train", "index": 69466, "acecode_id": "bigcode_python_fns_7231", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of numbers, write a function `max_subarray(arr)` that finds the maximum subarray sum and returns both the starting and ending indices of that subarray. The function should handle negative numbers and floating-point values efficiently. Ensure that your solution ru...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_subarray([1, -2, 3, 4, -5, 6]) == (2, 5, 8)\", \"assert max_subarray([-1, -2, -3, -4]) == (0, 0, -1)\", \"assert max_subarray([1.5, -0.5, 2.5, -1.5, 3.0]) == (0, 4, 5.0)\", \"assert max_subarray([-2, -1, -3, 4, -1, 2, 1, -5, 4]) == (3, 6, 6)\", \"assert ...
{ "split": "train", "index": 69467, "acecode_id": "evol_17288", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that determines whether a configuration file should be updated based on a user's input. The function should take a string as input, which represents the user's response. If the response is 'yes', the function should return True indica...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert should_update_config('yes') == True\", \"assert should_update_config('no') == False\", \"assert should_update_config('YES') == True\", \"assert should_update_config('No') == False\", \"assert should_update_config('y') == False\", \"assert should_update_confi...
{ "split": "train", "index": 69468, "acecode_id": "bigcode_python_fns_27213", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a nested data structure that can contain integers, floats, strings, lists, tuples, sets, and dictionaries. Your task is to implement a function that replaces all occurrences of the string 'nan' with the float value NaN, and all occurrences of the string 'inf' with...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert replace_nan_inf('inf') == float('inf')\", \"assert replace_nan_inf(42) == 42\", \"assert replace_nan_inf({'key': 'inf', 'value': 10}) == {'key': float('inf'), 'value': 10}\", \"assert replace_nan_inf({1, 2, 'inf'}) == {1, 2, float('inf')}\", \"assert replace...
{ "split": "train", "index": 69469, "acecode_id": "bigcode_python_fns_29087", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Implement a function that takes a string as input and returns the longest palindromic substring within that string. The function should ignore spaces, punctuation, and case when determining if a substring is a palindrome. For example, the input 'Was it a car or a cat I saw' sho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longest_palindrome('Able was I saw Elba') == 'Able was I saw Elba'\", \"assert longest_palindrome('racecar') == 'racecar'\", \"assert longest_palindrome('12321') == '12321'\", \"assert longest_palindrome('') == ''\", \"assert longest_palindrome('a') == 'a'\"...
{ "split": "train", "index": 69470, "acecode_id": "evol_17907", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with verifying the configuration parameters of a system. You have a dictionary representing the current configuration of different modules in the system, and another dictionary representing the nominal (expected) configuration values. Write a function `verify_con...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert verify_configuration({'MODULE_GPIO': 1, 'MODULE_AI': 2, 'MODULE_LOGGING': 3}, {'MODULE_GPIO': 1, 'MODULE_AI': 2, 'MODULE_LOGGING': 3}) == []\", \"assert verify_configuration({'MODULE_GPIO': 1, 'MODULE_AI': 2, 'MODULE_LOGGING': 4}, {'MODULE_GPIO': 1, 'MODULE_...
{ "split": "train", "index": 69471, "acecode_id": "bigcode_python_fns_38599", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given three lists, `l1`, `l2`, and `l3`, write a function `find_common_elements` that returns a list of elements that are common across all three lists at the same index. The function should only consider elements up to the length of the shortest list among the three. The lists...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_common_elements([1, 2, 3], [1, 2, 3], [1, 2, 3]) == [1, 2, 3]\", \"assert find_common_elements([1, 2, 3], [4, 5, 6], [7, 8, 9]) == []\", \"assert find_common_elements(['a', 'b', 'c'], ['a', 'b', 'd'], ['a', 'b', 'e']) == ['a', 'b']\", \"assert find_comm...
{ "split": "train", "index": 69472, "acecode_id": "evol_14105", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `simple_stack_operations(operations: List[Tuple[str, int]]) -> List[Optional[int]]` that simulates a simple stack data structure. The function takes a list of operations where each operation is a tuple. The first element of the tuple is a string representin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simple_stack_operations([('push', 5), ('push', 10), ('peek', None)]) == [10]\", \"assert simple_stack_operations([('push', 1), ('pop', None)]) == [1]\", \"assert simple_stack_operations([('pop', None)]) == [None]\", \"assert simple_stack_operations([('push',...
{ "split": "train", "index": 69473, "acecode_id": "oss_30489", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that takes a list of integers and returns a new list that contains only the unique elements from the original list, maintaining the order of their first appearance. Write a function named `get_unique_elements` that accepts the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_elements([1, 2, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert get_unique_elements([5, 5, 5, 5]) == [5]\", \"assert get_unique_elements([]) == []\", \"assert get_unique_elements([1, 1, 2, 2, 3, 3]) == [1, 2, 3]\", \"assert get_unique_elements([4, 3, 2, 1, ...
{ "split": "train", "index": 69474, "acecode_id": "oss_11485", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that initializes three components for a web application: a Bootstrap component, a SQLAlchemy database component, and a LoginManager component. Each component can be initialized with a simple string representing the app name. Your function...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert initialize_components('MyApp') == {'bootstrap': 'Bootstrap initialized with MyApp', 'database': 'SQLAlchemy initialized with MyApp', 'login_manager': 'LoginManager initialized with MyApp'}\", \"assert initialize_components('TestApp') == {'bootstrap': 'Bootst...
{ "split": "train", "index": 69475, "acecode_id": "oss_4839", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that merges two dictionaries in Python. The function should take two dictionaries as input and return a new dictionary containing all the key-value pairs from both input dictionaries. If a key exists in both dictionaries, the value fr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_dicts({'a': 1, 'b': 2}, {'b': 3, 'c': 4}) == {'a': 1, 'b': 3, 'c': 4}\", \"assert merge_dicts({}, {'a': 1}) == {'a': 1}\", \"assert merge_dicts({'a': 1}, {}) == {'a': 1}\", \"assert merge_dicts({'a': 1}, {'a': 2}) == {'a': 2}\", \"assert merge_dicts({'...
{ "split": "train", "index": 69476, "acecode_id": "oss_3578", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `fibonacci(n: int) -> List[int]` that generates the Fibonacci sequence up to the nth number. The Fibonacci sequence is defined as follows: the first two numbers are 0 and 1, and each subsequent number is the sum of the two preceding ones. The function shoul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci(0) == []\", \"assert fibonacci(1) == [0]\", \"assert fibonacci(2) == [0, 1]\", \"assert fibonacci(3) == [0, 1, 1]\", \"assert fibonacci(4) == [0, 1, 1, 2]\", \"assert fibonacci(5) == [0, 1, 1, 2, 3]\", \"assert fibonacci(6) == [0, 1, 1, 2, 3, 5]\",...
{ "split": "train", "index": 69477, "acecode_id": "evol_25355", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a list of random weights for a specified number of actions. Each weight should be a floating-point number between 0 and 1. The function should return these weights as a list of length equal to the number of actions. Impleme...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_random_weights(1) == [1.0]\", \"assert len(generate_random_weights(10)) == 10\", \"assert round(sum(generate_random_weights(8)), 2) == 1.0\", \"assert round(sum(generate_random_weights(3)), 2) == 1.0\", \"assert round(sum(generate_random_weights(7))...
{ "split": "train", "index": 69478, "acecode_id": "bigcode_python_fns_16823", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given an array of strings and a target word, write a function that counts the number of occurrences of the target word in the array and also counts how many words in the array are anagrams of the target word. An anagram is a word formed by rearranging the letters of a different...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_occurrences_and_anagrams(['apple', 'banana', 'apple', 'kiwi', 'apple', 'elppa', 'paple'], 'apple') == (3, 2)\", \"assert count_occurrences_and_anagrams(['aaa', 'aaa', 'aaa', 'aab'], 'aaa') == (3, 0)\", \"assert count_occurrences_and_anagrams(['race', '...
{ "split": "train", "index": 69479, "acecode_id": "evol_14006", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `get_notification_user(operations_shift)` that determines the user ID of the person who should receive a notification based on a series of hierarchical checks. The input is an object `operations_shift` which contains the following pro...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_notification_user({'supervisor': 'user1', 'site': {'account_supervisor': 'user2', 'project': {'account_manager': 'user3'}}}) == 'user1'\", \"assert get_notification_user({'supervisor': None, 'site': {'account_supervisor': 'user2', 'project': {'account_ma...
{ "split": "train", "index": 69480, "acecode_id": "bigcode_python_fns_34638", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a list of songs in a playlist represented as a list of dictionaries. Each song is a dictionary with 'name' and 'path' keys. Your function should take a list of song dictionaries and a song name as input. If the song is ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert select_song([{'name': 'song1', 'path': 'songs/song1.mp3'}, {'name': 'song2', 'path': 'songs/song2.mp3'}], 'song1') == {'name': 'song1', 'path': 'songs/song1.mp3', 'index': 0}\", \"assert select_song([{'name': 'song1', 'path': 'songs/song1.mp3'}, {'name': 'so...
{ "split": "train", "index": 69481, "acecode_id": "oss_18167", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates unique identifiers for objects. The function should take an initial value as input and return a list of unique identifiers. Each identifier should be generated by incrementing the initial value for each subsequent identifie...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_unique_ids(1000, 5) == ([1000, 1001, 1002, 1003, 1004], 5)\", \"assert generate_unique_ids(2000, 3) == ([2000, 2001, 2002], 3)\", \"assert generate_unique_ids(1, 0) == ([], 0)\", \"assert generate_unique_ids(-5, 4) == ([-5, -4, -3, -2], 4)\", \"asse...
{ "split": "train", "index": 69482, "acecode_id": "oss_32213", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that resets a user's password using a password reset token. The function should take in two parameters: a token (string) and a new password (string). If the token is valid, the function should return a confirmation message stating tha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reset_password('valid_token', 'new_passw0rd') == 'Password has been reset successfully.'\", \"assert reset_password('invalid_token', 'new_passw0rd') == 'Invalid token.'\", \"assert reset_password('valid_token', 'another_pass123') == 'Password has been reset ...
{ "split": "train", "index": 69483, "acecode_id": "bigcode_python_fns_40927", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a binary search tree (BST) represented by its root node, implement a function `insertion_sort_bst(root: Node) -> List[int]` that returns a sorted list of the unique values present in the BST. The function should perform an in-order traversal of the tree to gather the valu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert insertion_sort_bst(Node(5)) == [5]\", \"assert insertion_sort_bst(Node(5, Node(3), Node(8))) == [3, 5, 8]\", \"assert insertion_sort_bst(Node(5, Node(3, Node(2)), Node(8, Node(7)))) == [2, 3, 5, 7, 8]\", \"assert insertion_sort_bst(Node(5, Node(3, Node(3)), ...
{ "split": "train", "index": 69484, "acecode_id": "evol_4057", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that detects the unique elements in two unsorted arrays of integers and returns a list of these unique elements.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block." } ]
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert analyze_unique_elements([11, 17, 8, 29, 29, 29], [2, 8, 11, 42, 42, 42]) == [2, 8, 11, 17, 29, 42]\", \"assert analyze_unique_elements([1, 2, 3], [4, 5, 6]) == [1, 2, 3, 4, 5, 6]\", \"assert analyze_unique_elements([1, 1, 1], [1, 1, 1]) == [1]\", \"assert an...
{ "split": "train", "index": 69485, "acecode_id": "evol_27263", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that validates transaction responses in a payment processing system. Implement the function `validate_transaction_response(error: bool, kind: str) -> str` with the following requirements: \n\n- The function should take two parameters: \n ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_transaction_response(True, 'AUTH') == 'Valid'\", \"assert validate_transaction_response(False, 'CAPTURE') == 'Valid'\", \"assert validate_transaction_response(False, 'REFUND') == 'Valid'\", \"assert validate_transaction_response(True, 'CAPTURE') == ...
{ "split": "train", "index": 69486, "acecode_id": "oss_4783", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `fib(n: int) -> List[int]` that calculates the Fibonacci sequence up to the nth Fibonacci number. The function should return a list containing the Fibonacci numbers starting from 0 up to the nth number. For example, if n = 5, the function should return [0, 1, 1...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fib(0) == [0]\", \"assert fib(1) == [0, 1]\", \"assert fib(2) == [0, 1, 1]\", \"assert fib(3) == [0, 1, 1, 2]\", \"assert fib(4) == [0, 1, 1, 2, 3]\", \"assert fib(5) == [0, 1, 1, 2, 3, 5]\", \"assert fib(6) == [0, 1, 1, 2, 3, 5, 8]\", \"assert fib(7) == [0,...
{ "split": "train", "index": 69487, "acecode_id": "evol_18550", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of a series of mountains. Your task is to implement a function that finds the highest mountain that can be reached by traversing from the first mountain (index 0) to the last mountain (index n-1). You can only move to ad...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_highest_mountain([1, 2, 3, 4, 5]) == 5\", \"assert find_highest_mountain([5, 5, 5, 5]) == 5\", \"assert find_highest_mountain([3, 2, 1, 0]) == -1\", \"assert find_highest_mountain([1, 3, 2, 4, 1, 5]) == 5\", \"assert find_highest_mountain([1, 1, 1, 1, 1...
{ "split": "train", "index": 69488, "acecode_id": "bigcode_python_fns_44549", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that validates whether a given input is a valid string. A valid string is defined as a string that is not None and contains at least one character. Implement the function `is_valid_string(input_string: Optional[str]) -> bool`, which takes...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_string(None) == False\", \"assert is_valid_string('') == False\", \"assert is_valid_string(' ') == True\", \"assert is_valid_string('Hello') == True\", \"assert is_valid_string('123') == True\", \"assert is_valid_string('!@#$') == True\", \"assert i...
{ "split": "train", "index": 69489, "acecode_id": "bigcode_python_fns_43256", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `dog_cat_x_finder` that takes a single string input and returns the total count of occurrences of the substring 'CAT'. The string must start with the substring 'dog', have 'CAT' anywhere in the middle with an arbitrary number of occurrences, only contain up...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert dog_cat_x_finder('dogCATX') == 1\", \"assert dog_cat_x_finder('dogCATCATX') == 2\", \"assert dog_cat_x_finder('dogXYZCATX') == 1\", \"assert dog_cat_x_finder('dogCATDOGX') == 1\", \"assert dog_cat_x_finder('dogX') == 0\", \"assert dog_cat_x_finder('dogCATCAT...
{ "split": "train", "index": 69490, "acecode_id": "evol_29819", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that processes a given time value and returns a status code based on certain conditions. The function should handle exceptions and return the appropriate status code and type. Implement the function `process_time_status(time_va...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_time_status(50, True) == (None, 200, StatusType.OK)\", \"assert process_time_status(50, False) == (None, 440, StatusType.NOOP)\", \"assert process_time_status(0, True) == (None, 200, StatusType.OK)\", \"assert process_time_status(100, False) == (None...
{ "split": "train", "index": 69491, "acecode_id": "oss_3660", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string that contains a series of commands. Each command is represented by a single character and can be followed by an integer indicating how many times the command should be executed. You need to implement a function `execute_commands(commands: str) -> str` tha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert execute_commands('A') == 'X'\", \"assert execute_commands('B') == 'Y'\", \"assert execute_commands('C') == 'Z'\", \"assert execute_commands('A4') == 'XXXX'\", \"assert execute_commands('C5A2B2') == 'ZZZZZXXYY'\", \"assert execute_commands('A1B1C1') == 'XYZ'\...
{ "split": "train", "index": 69492, "acecode_id": "bigcode_python_fns_1605", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a deque in Python, implement a function that retrieves the last element of the deque without using the built-in indexing. You should not use any built-in methods that directly access the last element. The function should take a deque as its parameter and return the last e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_last_element_without_index(deque([1, 2, 3, 4, 5])) == 5\", \"assert get_last_element_without_index(deque([10, 20, 30, 40, 50])) == 50\", \"assert get_last_element_without_index(deque(['apple', 'banana', 'cherry'])) == 'cherry'\", \"assert get_last_elemen...
{ "split": "train", "index": 69493, "acecode_id": "evol_26669", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a function that controls the stiffness of a robot's joints. Your task is to implement a function `set_robot_stiffness(stiffness: float) -> str` that takes a stiffness value as input and returns a message indicating whether the stiffness has been successfully set. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_robot_stiffness(0.75) == 'Stiffness set to 0.75'\", \"assert set_robot_stiffness(-0.1) == 'Invalid stiffness value'\", \"assert set_robot_stiffness(1.1) == 'Invalid stiffness value'\", \"assert set_robot_stiffness(0.25) == 'Stiffness set to 0.25'\", \"as...
{ "split": "train", "index": 69494, "acecode_id": "bigcode_python_fns_46898", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function named `remove_digits_from_filenames` that takes a list of filenames as input. Your goal is to process this list and return a new list where all numerical digits have been removed from each filename. The input list will consist of s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_digits_from_filenames(['file1.txt', 'file2.txt', 'file3.txt']) == ['file.txt', 'file.txt', 'file.txt']\", \"assert remove_digits_from_filenames(['document1.pdf', 'report2023.docx']) == ['document.pdf', 'report.docx']\", \"assert remove_digits_from_fil...
{ "split": "train", "index": 69495, "acecode_id": "oss_14316", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of integers and returns a new list containing only the even numbers from the original list. Your function should preserve the order of the even numbers as they appeared in the input list. Implement a single function name...
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([]) =...
{ "split": "train", "index": 69496, "acecode_id": "oss_18528", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to validate a specific instruction format for a pseudo assembly language. The instruction has the following format: 'bltz <register1>, <register2>, <label>'. Your task is to implement a function that checks if a given instruction string matches the expected format of '...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_instruction('bltz $zero, $t1, label') == True\", \"assert is_valid_instruction('bltz $t1, label') == True\", \"assert is_valid_instruction('bltz $t0') == False\", \"assert is_valid_instruction('bltz $zero, $t1, $s1') == False\", \"assert is_valid_in...
{ "split": "train", "index": 69497, "acecode_id": "bigcode_python_fns_10058", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of non-negative integers, implement a function `product_of_digits(n)` that calculates the product of all the digits contained in the numbers of the array. For example, for the input `n = [145, 233, 445, 719]`, the function should return the product of all digits:...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert product_of_digits([0]) == 0\", \"assert product_of_digits([123, 456]) == 1 * 2 * 3 * 4 * 5 * 6 == 720\", \"assert product_of_digits([111, 222]) == 1 * 1 * 1 * 2 * 2 * 2 == 8\", \"assert product_of_digits([999]) == 9 * 9 * 9 == 729\", \"assert product_of_digi...
{ "split": "train", "index": 69498, "acecode_id": "evol_9183", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary that represents a set of integration orders for different geometries. Each geometry is a string key, and its value is a dictionary where keys are the available integration orders (integers) and the values are their respective descriptions (strings). W...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_actual_order('circle', 2, {'circle': {1: 'low', 2: 'medium', 3: 'high'}}) == 2\", \"assert get_actual_order('circle', 4, {'circle': {1: 'low', 2: 'medium', 3: 'high'}}) == 3\", \"assert get_actual_order('circle', 1, {'circle': {1: 'low', 2: 'medium', 3: ...
{ "split": "train", "index": 69499, "acecode_id": "bigcode_python_fns_46872", "num_tests": 16 }