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 implementing a comparison tool for influencers in a marketing application. Given a list of influencers, where each influencer is represented by an instance of the Influencer class with attributes such as name, platform, followers, engagement_rate, and catego...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compare_influencers([Influencer('Alice', 'Instagram', 20000, 3.5, 'Beauty'), Influencer('Bob', 'YouTube', 50000, 4.2, 'Gaming')]) == {'Alice': {'name': 'Alice', 'platform': 'Instagram', 'followers': 20000, 'engagement_rate': 3.5, 'category': 'Beauty'}, 'Bob'...
{ "split": "train", "index": 65000, "acecode_id": "evol_11882", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a custom mean filter function for image processing. The mean filter is a technique used to smooth images by averaging the pixel values in a local neighborhood defined by a kernel size. Your function should take a 2D list of integers representing...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert customMeanFilter([[0, 0], [0, 0]], 1) == [[0, 0], [0, 0]]\", \"assert customMeanFilter([[255]], 1) == [[255]]\", \"assert customMeanFilter([[100, 200], [150, 250]], 1) == [[100, 200], [150, 250]]\", \"assert customMeanFilter([[1]], 1) == [[1]]\", \"assert cu...
{ "split": "train", "index": 65001, "acecode_id": "oss_22811", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a list of tuples representing the locations of buses on a specific route. Each tuple contains two floating-point numbers representing the latitude and longitude of a bus. Your task is to implement a function `get_closest_bus(buses: List[Tuple[float, float]]) -> Tu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_closest_bus([(1.0, 1.0), (3.0, 4.0), (5.0, 12.0)]) == (1.0, 1.0)\", \"assert get_closest_bus([(0.0, 0.0), (1.0, 1.0)]) == (0.0, 0.0)\", \"assert get_closest_bus([(10.0, 10.0), (2.0, 2.0)]) == (2.0, 2.0)\", \"assert get_closest_bus([]) == (False, False)\"...
{ "split": "train", "index": 65002, "acecode_id": "bigcode_python_fns_43421", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that adds an appointment to a schedule. The function should take a list of existing appointments (strings representing the appointments) and a new appointment (a string) as input. The function should then check if the new appointme...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_appointment(['Meeting at 10 AM', 'Lunch with John'], 'Doctor appointment') == ['Meeting at 10 AM', 'Lunch with John', 'Doctor appointment']\", \"assert add_appointment(['Meeting at 10 AM', 'Lunch with John'], 'Meeting at 10 AM') == ['Meeting at 10 AM', '...
{ "split": "train", "index": 65003, "acecode_id": "oss_10588", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two floating-point numbers, `balance` and `fee`. Your task is to determine if the `balance` is sufficient to cover the `fee`. Implement a function `check_balance_sufficient(balance, fee)` that returns `True` if `balance` is greater than or equal to `fee`, and `Fal...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_balance_sufficient(100.0, 20.0) == True\", \"assert check_balance_sufficient(15.0, 30.0) == False\", \"assert check_balance_sufficient(50.5, 50.5) == True\", \"assert check_balance_sufficient(0.0, 0.0) == True\", \"assert check_balance_sufficient(100.0...
{ "split": "train", "index": 65004, "acecode_id": "oss_4601", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes an HTTP request object and retrieves a message from it. The function should return the value associated with the key 'message' if it is present either in the query parameters or the JSON body of the request. If the key is n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_message({'args': {'message': 'Hello from args!'}, 'json': {}}) == 'Hello from args!'\", \"assert get_message({'args': {}, 'json': {'message': 'Hello from JSON!'}}) == 'Hello from JSON!'\", \"assert get_message({'args': {}, 'json': {}}) == 'No message pro...
{ "split": "train", "index": 65005, "acecode_id": "evol_19976", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that predicts the class label of an image based on the provided model weights and input image size. The function should take the following parameters: \n- `weights_path`: A string representing the file path to the model weights...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert predict('./models/model_weight.hdf5', [550, 600]) in range(10)\", \"assert predict('./models/model_weight.hdf5', [300, 400]) in range(10)\", \"assert predict('./models/model_weight.hdf5', [128, 128]) in range(10)\", \"assert predict('./models/model_weight.hd...
{ "split": "train", "index": 65006, "acecode_id": "oss_27553", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the execution of a script based on a sequence of events. The function should take in a list of events and their corresponding actions, and return the final state of the script after processing all events. Each event can eit...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert execute_script([{'type': 'wait', 'data': {'condition': 'on'}}, {'type': 'event', 'data': {'value': 1}}, {'type': 'event', 'data': {'value': 2}}]) == ['paused', 'running', 'running']\", \"assert execute_script([{'type': 'event', 'data': {'value': 3}}, {'type'...
{ "split": "train", "index": 65007, "acecode_id": "bigcode_python_fns_36996", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Implement a function that generates a list containing all multiples of 3 from 0 to a given integer n (inclusive). The function should take one parameter n, which is a non-negative integer. Optimize your solution using list comprehension.\nPlease reason step by step, then write ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert multiples_of_3_generator(0) == [0]\", \"assert multiples_of_3_generator(1) == [0]\", \"assert multiples_of_3_generator(2) == [0]\", \"assert multiples_of_3_generator(3) == [0, 3]\", \"assert multiples_of_3_generator(4) == [0, 3]\", \"assert multiples_of_3_ge...
{ "split": "train", "index": 65008, "acecode_id": "evol_27125", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing an attribute and a list of valid attributes. Write a function `get_help_string(attribute: str, valid_attributes: List[str]) -> str` that returns a help message based on the provided attribute. If the attribute is in the list of valid attribut...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_help_string('color', ['color', 'size', 'type']) == \\\"'color' is a valid attribute. You can use it as follows:\\\\n\\\"\", \"assert get_help_string('shape', ['color', 'size', 'type']) == \\\"'shape' is not allowed here.\\\"\", \"assert get_help_string('...
{ "split": "train", "index": 65009, "acecode_id": "bigcode_python_fns_38048", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that constructs a file path based on specified conditions. The function takes two parameters: `check` (a string) and `use_a6_conf_dir` (a boolean). Depending on the value of `use_a6_conf_dir`, the function should construct the file path u...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert construct_file_path('example', True) == '/path/to/A6_conf/example.d/conf*'\", \"assert construct_file_path('test', False) == '/path/to/A5_conf/test*'\", \"assert construct_file_path('config', True) == '/path/to/A6_conf/config.d/conf*'\", \"assert construct_f...
{ "split": "train", "index": 65010, "acecode_id": "oss_21585", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that accepts a string 's'. For each character in 's', if it is a letter, shift its case from lower to upper or the inverse. If the character is not a letter, it remains unchanged. If the string contains no alphabetic characters, return the input string in r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert solve('1234') == '4321'\", \"assert solve('ab') == 'AB'\", \"assert solve('#a@C') == '#A@c'\", \"assert solve('') == ''\", \"assert solve('hello') == 'HELLO'\", \"assert solve('WORLD') == 'world'\", \"assert solve('Hello World!') == 'hELLO wORLD!'\", \"asser...
{ "split": "train", "index": 65011, "acecode_id": "evol_14675", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with processing patient data to calculate their Body Mass Index (BMI) and categorize it into percentiles based on given age ranges. Implement a function that takes in a dictionary of patient data, a low age range, and a high age range. The patient data contains i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_patient_bmi({'patient1': {'mrn': 1, 'bmi': 22.5, 'age': 25, 'percentile': 75, 'label': 'Normal'}, 'patient2': {'mrn': 2, 'bmi': 30.1, 'age': 30, 'percentile': 85, 'label': 'Overweight'}}, 20, 40) == ([22.5, 30.1], [75.0, 85.0], ['Normal', 'Overweight'])\...
{ "split": "train", "index": 65012, "acecode_id": "bigcode_python_fns_31461", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a list of decimal numbers, implement a function `sort_decimal_numbers(numbers)` that takes a list of decimal numbers and returns a new list with those numbers sorted in ascending order.\nPlease reason step by step, then write a self-contained Python solution. Give your fi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_decimal_numbers([0.25, 1.6, 1.0]) == [0.25, 1.0, 1.6]\", \"assert sort_decimal_numbers([3.5, 2.1, 4.8]) == [2.1, 3.5, 4.8]\", \"assert sort_decimal_numbers([1.1, 0.1, 0.5]) == [0.1, 0.5, 1.1]\", \"assert sort_decimal_numbers([5.5, 3.3, 2.2, 4.4]) == [2....
{ "split": "train", "index": 65013, "acecode_id": "evol_16243", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing HTML elements. Write a function that converts each HTML string to its corresponding plain text representation, stripping away all HTML tags. The function should return a list of plain text strings. The input list may contain empty st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_html_to_plain_text(['<p>Hello World</p>', '<div>Test</div>']) == ['Hello World', 'Test']\", \"assert convert_html_to_plain_text(['<h1>Title</h1>', '<span>Content</span>']) == ['Title', 'Content']\", \"assert convert_html_to_plain_text(['<a href=\\\"#...
{ "split": "train", "index": 65014, "acecode_id": "bigcode_python_fns_45772", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Design a sparse 3D matrix of dimensions 64x64x64 that allows insertion of non-zero elements and retrieval of any element in constant time. The matrix should automatically assume any non-initialized element to be 0. Implement a function `insert(x: int, y: int, z: int, value: int...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sparseMatrix.get(0, 0, 0) == 0\", \"assert sparseMatrix.get(63, 63, 63) == 0\", \"assert sparseMatrix.get(1, 1, 1) == 0\", \"assert sparseMatrix.get(32, 31, 32) == 0\", \"assert sparseMatrix.get(64, 64, 64) == 0\", \"assert sparseMatrix.get(0, 63, 63) == 0\"...
{ "split": "train", "index": 65015, "acecode_id": "evol_31074", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Implement a function `char_frequency(str1: str) -> dict` that takes a string `str1` as input and returns a dictionary where each key is a distinct character from the string, and its corresponding value is the frequency of that character in the string. The function should be cas...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert char_frequency('Hello World') == {'H': 1, 'e': 1, 'l': 3, 'o': 2, ' ': 1, 'W': 1, 'r': 1, 'd': 1}\", \"assert char_frequency('') == {}\", \"assert char_frequency('aabbcc') == {'a': 2, 'b': 2, 'c': 2}\", \"assert char_frequency('abcABC') == {'a': 1, 'b': 1, '...
{ "split": "train", "index": 65016, "acecode_id": "evol_28487", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that takes a string representing time in the format 'HH:MM:SS' and returns a list of three integers representing the hours, minutes, and seconds. The input string will always be in the correct format and within the valid range (00 to 23 fo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert timeParser('12:30:45') == [12, 30, 45]\", \"assert timeParser('00:00:00') == [0, 0, 0]\", \"assert timeParser('23:59:59') == [23, 59, 59]\", \"assert timeParser('01:15:30') == [1, 15, 30]\", \"assert timeParser('10:05:05') == [10, 5, 5]\", \"assert timeParse...
{ "split": "train", "index": 65017, "acecode_id": "bigcode_python_fns_3884", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of strings and a character as input, and returns a new list of strings where each string is split into substrings based on the specified character. The split operation should result in a list of substrings for each strin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert split_strings(['abc,def', 'ghi,jkl'], ',') == ['abc', 'def', 'ghi', 'jkl']\", \"assert split_strings(['one,two,three', 'four,five'], ',') == ['one', 'two', 'three', 'four', 'five']\", \"assert split_strings(['apple|banana|cherry', 'date|fig'], '|') == ['appl...
{ "split": "train", "index": 65018, "acecode_id": "bigcode_python_fns_26233", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks if a given string is a valid hexadecimal color code. A valid hexadecimal color code starts with a '#' followed by exactly six characters, where each character can be a digit (0-9) or a letter from 'A' to 'F' (case insensit...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_hex_color_code('#FFFFFF') == True\", \"assert is_valid_hex_color_code('#000000') == True\", \"assert is_valid_hex_color_code('#123ABC') == True\", \"assert is_valid_hex_color_code('#1a2b3c') == True\", \"assert is_valid_hex_color_code('#abcdef') == ...
{ "split": "train", "index": 65019, "acecode_id": "bigcode_python_fns_46527", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a context object and an image represented as a dictionary. The context object contains information about whether the user is an admin and the owner of the image. Your task is to implement a function `is_image_sharable(context, image, membership=None)` that determi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_image_sharable({'is_admin': True, 'owner': 'user1'}, {'id': 'img1', 'owner': 'user2'}) == True\", \"assert is_image_sharable({'is_admin': False, 'owner': None}, {'id': 'img1', 'owner': 'user2'}) == False\", \"assert is_image_sharable({'is_admin': False, '...
{ "split": "train", "index": 65020, "acecode_id": "bigcode_python_fns_41322", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that validates a 6-digit numeric zip code. The zip code must meet the following criteria: the first three digits must be even numbers (0, 2, 4, 6, or 8), and the last three digits must be a valid number that does not start with 0 (must be between 100 and 99...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_zip('024123') == True\", \"assert validate_zip('246789') == True\", \"assert validate_zip('864500') == True\", \"assert validate_zip('123456') == False\", \"assert validate_zip('246001') == False\", \"assert validate_zip('482234') == True\", \"asser...
{ "split": "train", "index": 65021, "acecode_id": "evol_2338", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the movement of a robot based on its position and orientation. The function `move_robot` takes three parameters: `position`, `orientation`, `forward_rate`, and `turn_rate`. The `position` is represented as a tuple of (x...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert move_robot((0, 0), 0, 1, 0) == (1.0, 0.0, 0)\", \"assert move_robot((0, 0), 0, -1, 0) == (-1.0, 0.0, 0)\", \"assert move_robot((0, 0), 0, 0, 1) == (0.0, 0.0, 1)\", \"assert move_robot((0, 0), 0, 0, -1) == (0.0, 0.0, -1)\", \"assert move_robot((1, 1), 0, 1, 0...
{ "split": "train", "index": 65022, "acecode_id": "oss_982", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Construct a function to convert feet and inches to meters. The function should accept two parameters: feet (a non-negative number) and inches (a number between 0 and 12). The function should convert the total height in feet and inches into meters and return the result rounded t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert ft_to_meters(0, 0) == 0.00\", \"assert ft_to_meters(1, 0) == 0.30\", \"assert ft_to_meters(5, 0) == 1.52\", \"assert ft_to_meters(3, 6) == 1.07\", \"assert ft_to_meters(10, 11) == 3.33\", \"assert ft_to_meters(0, 6) == 0.15\", \"assert ft_to_meters(7, 3) == ...
{ "split": "train", "index": 65023, "acecode_id": "evol_9538", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Develop a function 'vowels_count' that accepts a string (which may include special and non-alphabetical characters), representing a word and returns the total count of vowels in it. Considering 'a', 'e', 'i', 'o', 'u', and 'y' (only at the end of the word) as vowels. The functi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert vowels_count('abcde!') == 2\", \"assert vowels_count('') == 0\", \"assert vowels_count('12345') == 0\", \"assert vowels_count('!@#$%^&*()') == 0\", \"assert vowels_count('hello') == 2\", \"assert vowels_count('world!') == 1\", \"assert vowels_count('Python3'...
{ "split": "train", "index": 65024, "acecode_id": "evol_33914", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a 13-character International Article Number (EAN-13) barcode as a string, implement a function `validate_ean13(ean: str) -> bool` that checks whether the checksum of the EAN-13 barcode is valid according to the globally accepted standards. The function should return True ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_ean13('9780201310054') == True\", \"assert validate_ean13('9780201310055') == False\", \"assert validate_ean13('1234567890128') == True\", \"assert validate_ean13('1234567890123') == False\", \"assert validate_ean13('4006381333931') == True\", \"ass...
{ "split": "train", "index": 65025, "acecode_id": "evol_4478", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a function that projects an image from MNI152 space to an fsLR surface. Your task is to create a function `project_image` that takes in three parameters: `img` (a string representing the file path of an image in MNI152 space), `fslr_density` (a string that can eit...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert project_image('image.nii', '32k', 'linear') == (True, 'Projection successful')\", \"assert project_image('image.nii', '164k', 'nearest') == (True, 'Projection successful')\", \"assert project_image('image.nii', '4k', 'linear') == (False, 'Density not support...
{ "split": "train", "index": 65026, "acecode_id": "bigcode_python_fns_18969", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string `text` and a substring `label`. Your task is to replace all occurrences of `label` in the `text` with a new substring `newstring`. Implement a function `replace_labels(text: str, label: str, newstring: str) -> str` that returns the modified string after p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert replace_labels('hello world', 'world', 'everyone') == 'hello everyone'\", \"assert replace_labels('ababab', 'ab', 'xy') == 'xyxyxy'\", \"assert replace_labels('abcabcabc', 'abc', '123') == '123123123'\", \"assert replace_labels('test', 'notfound', 'replace')...
{ "split": "train", "index": 65027, "acecode_id": "bigcode_python_fns_47865", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that generates a context-encoded tensor based on a mention embedding. The function should take the following parameters: \n- `mention_embed`: A list of floats representing the mention embedding (can be empty if None). \n- `context_enc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_context_encoded([1.0, 2.0], 5, 3, 'scope', 'cpu') == [1.0, 2.0, 0.0, 0.0, 0.0]\", \"assert calculate_context_encoded([], 5, 3, 'scope', 'cpu') == [0.0, 0.0, 0.0, 0.0, 0.0]\", \"assert calculate_context_encoded(None, 5, 3, 'scope', 'cpu') == [0.0, 0...
{ "split": "train", "index": 65028, "acecode_id": "oss_3474", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates two datasets based on a provided list of dimensions. Each dimension is represented by a dictionary containing 'name', 'values', and 'units'. The function should return two datasets: 'Indices' and 'Values'. The 'Indices' dat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert build_datasets([{'name': 'Dimension1', 'values': [1.0, 2.0], 'units': 'm'}, {'name': 'Dimension2', 'values': [3.0, 4.0], 'units': 's'}], True) == ([[1.0, 3.0], [1.0, 4.0], [2.0, 3.0], [2.0, 4.0]], [[1.0, 2.0], [3.0, 4.0]])\", \"assert build_datasets([{'name'...
{ "split": "train", "index": 65029, "acecode_id": "bigcode_python_fns_24344", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Write a Python function that takes a string consisting of ASCII characters and an integer 'n' as input. The function should return a list of 'n' distinct permutations of the input string's characters. If the number of distinct permutations is less than 'n', return all distinct ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert len(distinct_permutations('a', 1)) == 1\", \"assert distinct_permutations('aaa', 1) == ['aaa']\", \"assert distinct_permutations('', 1) == ['']\", \"assert distinct_permutations('abcd', 0) == []\", \"assert distinct_permutations('aaa', 2) == ['aaa']\", \"ass...
{ "split": "train", "index": 65030, "acecode_id": "evol_32548", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Implement a function `generate_frequency(words: List[str]) -> Dict[str, int]` that takes a list of strings `words` and returns a dictionary representing the frequency of each word in the list. The keys of the dictionary should be the words, and the values should be their corres...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_frequency(['apple', 'banana', 'apple', 'pear', 'apple', 'banana', 'peach']) == {'apple': 3, 'banana': 2, 'pear': 1, 'peach': 1}\", \"assert generate_frequency(['cat', 'dog', 'cat', 'mouse']) == {'cat': 2, 'dog': 1, 'mouse': 1}\", \"assert generate_f...
{ "split": "train", "index": 65031, "acecode_id": "evol_5256", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a nested structure that can contain dictionaries, lists, or basic data types (like strings, integers, etc.). Your task is to implement a function `convert_to_dict` that recursively converts this structure into a dictionary format. If the structure is a list, conve...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_dict({'a': 1, 'b': [2, 3]}) == {'a': 1, 'b': [2, 3]}\", \"assert convert_to_dict([{'a': None, 'b': 2}, 3]) == [{'b': 2}, 3]\", \"assert convert_to_dict([1, 2, 3]) == [1, 2, 3]\", \"assert convert_to_dict(5) == 5\", \"assert convert_to_dict(None) =...
{ "split": "train", "index": 65032, "acecode_id": "bigcode_python_fns_22082", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with determining the current week number of the semester based on a given date. The semester starts on a specified date and lasts for 22 weeks. Your function should return the week number for the provided date, where the first week of the semester is counted as w...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_current_week_number(datetime(2021, 10, 11), datetime(2021, 10, 11)) == 1\", \"assert get_current_week_number(datetime(2021, 10, 12), datetime(2021, 10, 11)) == 1\", \"assert get_current_week_number(datetime(2021, 10, 18), datetime(2021, 10, 11)) == 2\", ...
{ "split": "train", "index": 65033, "acecode_id": "bigcode_python_fns_1181", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are given a list of strings and a target string. Your task is to create a new list that includes all the original strings, and if a string contains the target string, you should also append a specified new string immediately after it. Implement a function `append_after_stri...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert append_after_strings(['hello', 'world', 'hello world'], 'hello', 'new line') == ['hello', 'new line', 'world', 'hello world', 'new line']\", \"assert append_after_strings(['apple', 'banana', 'cherry'], 'banana', 'fruit') == ['apple', 'banana', 'fruit', 'cher...
{ "split": "train", "index": 65034, "acecode_id": "bigcode_python_fns_9548", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a list of shapes and returns a string representation of the shapes drawn. Each shape is represented as a dictionary with a 'type' key and a 'color' key. Your function should concatenate the string representation of each sha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert draw_shapes([{ 'type': 'circle', 'color': 'red' }, { 'type': 'square', 'color': 'blue' }]) == 'Draw a red circleDraw a blue square'\", \"assert draw_shapes([{ 'type': 'triangle', 'color': 'green' }]) == 'Draw a green triangle'\", \"assert draw_shapes([]) == ...
{ "split": "train", "index": 65035, "acecode_id": "bigcode_python_fns_23747", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `delete_window` that simulates deleting an active window in a graphical user interface (GUI) application. The function receives a list of window states represented as strings. Each window state can either be 'active' or 'inactive'. Yo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert delete_window(['inactive', 'inactive', 'active', 'inactive']) == ['inactive', 'inactive', 'inactive']\", \"assert delete_window(['active', 'inactive', 'inactive']) == ['inactive', 'inactive']\", \"assert delete_window(['inactive', 'active', 'active']) == ['i...
{ "split": "train", "index": 65036, "acecode_id": "bigcode_python_fns_33790", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function to check if a solution can be activated based on its version. The function should take in two parameters: `solution` (a string) and `version` (a string). The function should return `True` if the solution can be activated with the given ve...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert activate_solution('FeatureA', 'v1.0') == True\", \"assert activate_solution('FeatureB', 'v2.3') == True\", \"assert activate_solution('FeatureC', 'v3.1') == True\", \"assert activate_solution('FeatureC', 'version3.1') == False\", \"assert activate_solution('...
{ "split": "train", "index": 65037, "acecode_id": "oss_14856", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two strings, determine whether the first string is a subsequence of the second string. A string is considered a subsequence of another if all characters of the first string can be found in the second string in the same order without rearranging them, but not necessarily c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_subsequence('abc', 'ahbgdc') == True\", \"assert is_subsequence('ace', 'abcde') == True\", \"assert is_subsequence('abc', 'ac') == False\", \"assert is_subsequence('', 'nonempty') == True\", \"assert is_subsequence('a', '') == False\", \"assert is_subsequ...
{ "split": "train", "index": 65038, "acecode_id": "evol_27411", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given the dimensions of a right rectangular prism defined by its length, breadth, and height, implement a function `calculate_volume(length: int, breadth: int, height: int) -> int` that computes the cubic capacity of the prism. The dimensions are guaranteed to be non-negative i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_volume(3, 4, 5) == 60\", \"assert calculate_volume(1, 1, 1) == 1\", \"assert calculate_volume(0, 0, 0) == 0\", \"assert calculate_volume(10, 10, 10) == 1000\", \"assert calculate_volume(2, 3, 4) == 24\", \"assert calculate_volume(7, 8, 9) == 504\",...
{ "split": "train", "index": 65039, "acecode_id": "evol_12686", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the sum of all prime numbers within a given inclusive range. A prime number is defined as a natural number greater than 1 that has no positive divisors other than 1 and itself. Your function should take two integers, `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_primes(10, 20) == 60\", \"assert sum_of_primes(1, 10) == 17\", \"assert sum_of_primes(0, 5) == 10\", \"assert sum_of_primes(5, 5) == 5\", \"assert sum_of_primes(2, 2) == 2\", \"assert sum_of_primes(11, 13) == 24\", \"assert sum_of_primes(1, 1) == 0\",...
{ "split": "train", "index": 65040, "acecode_id": "oss_2819", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Develop a function in Python that calculates the median of the five largest and the five smallest prime numbers in a given list. If there are fewer than five prime numbers in the list, the function should return None. The function must also account for duplicate prime numbers w...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert solve_problem([3, 5, 7, 11, 13, 17, 19, 23, 29, 31]) == {'median_least': 7, 'median_most': 23, 'second_largest_in_order': 29}\", \"assert solve_problem([1, 4, 6, 8, 10]) == None\", \"assert solve_problem([]) == None\", \"assert solve_problem([25, 35, 55, 65]...
{ "split": "train", "index": 65041, "acecode_id": "evol_4708", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Your task is to write a function that finds the third largest unique number in the list and returns it. If there are less than three unique numbers in the list, the function should return the maximum unique number present. Implement the followi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_third_largest_unique([3, 1, 4, 4, 5, 5, 5, 2, 2]) == 3\", \"assert find_third_largest_unique([10, 20, 20, 30]) == 10\", \"assert find_third_largest_unique([1, 2]) == 2\", \"assert find_third_largest_unique([5, 5, 5, 5]) == 5\", \"assert find_third_large...
{ "split": "train", "index": 65042, "acecode_id": "oss_27640", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with extracting the SHA1 checksum value from a given string. The checksum is expected to be in the format 'SHA1:<length>:<value>', where <length> is the length of the checksum value and <value> is the actual checksum value consisting of 40 hexadecimal characters....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_sha1_checksum('SHA1:40:2fd4e1c67a2d28fced849ee1bb76e7391b93eb12') == '2fd4e1c67a2d28fced849ee1bb76e7391b93eb12'\", \"assert extract_sha1_checksum('SHA1:40:1234567890abcdef1234567890abcdef12345678') == '1234567890abcdef1234567890abcdef12345678'\", \"a...
{ "split": "train", "index": 65043, "acecode_id": "oss_35895", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing a project with a set of tasks, contacts, and internal constraints. Write a function `manage_project` that takes in the following parameters: a list of tasks (each represented as a dictionary with keys 'task_id', 'task_name', 'assigned_to', 'deadline...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_project([{'task_id': 1, 'task_name': 'Design', 'assigned_to': 'Alice', 'deadline': '2023-12-01'}], [{'contact_id': 1, 'contact_name': 'Bob', 'contact_email': 'bob@example.com', 'contact_phone': '123-456-7890'}], [{'constraint_id': 1, 'constraint_type'...
{ "split": "train", "index": 65044, "acecode_id": "oss_19731", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a dictionary that maps interaction types to their respective maximum distances. Write a function `get_valid_interactions(interaction_data, max_distance)` that determines which interactions from the input data are valid based on their distances compared to the maxi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_valid_interactions({'A': {'dist': 1.0}, 'B': {'dist': 2.0}, 'C': {'dist': 3.0}}, 2.5) == ['A', 'B']\", \"assert get_valid_interactions({'Acid-base': {'dist': 4.0}, 'Hydrophobic interactions': {'dist': 4.5}}, 4.0) == ['Acid-base']\", \"assert get_valid_in...
{ "split": "train", "index": 65045, "acecode_id": "bigcode_python_fns_5156", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers, and your task is to determine the maximum sum of any contiguous subarray within that list. A contiguous subarray is defined as a subarray consisting of consecutive elements from the original array. Implement a function `max_subarray_sum(arr: Li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_subarray_sum([-2, 1, -3, 4, -1, 2, 1, -5, 4]) == 6\", \"assert max_subarray_sum([5, 4, -1, 7, 8]) == 23\", \"assert max_subarray_sum([-1, -2, -3, -4]) == -1\", \"assert max_subarray_sum([1]) == 1\", \"assert max_subarray_sum([3, 2, 5, 10, 7]) == 27\", \"...
{ "split": "train", "index": 65046, "acecode_id": "bigcode_python_fns_30787", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function `merge_sort(array)` that takes a list of integers and sorts it in ascending order using the merge sort algorithm. The function should return the sorted list.\nPlease reason step by step, then write a self-contained Python solution. Give your final program i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_sort([1, 10, 2, 5, 8, 7]) == [1, 2, 5, 7, 8, 10]\", \"assert merge_sort([]) == []\", \"assert merge_sort([3]) == [3]\", \"assert merge_sort([2, 1]) == [1, 2]\", \"assert merge_sort([5, 4, 3, 2, 1]) == [1, 2, 3, 4, 5]\", \"assert merge_sort([10, 9, 8, 7...
{ "split": "train", "index": 65047, "acecode_id": "evol_26438", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a configuration dictionary for a software package based on user input. The function, `generate_config`, should take in three parameters: `name` (a string representing the name of the package), `version` (a string representi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_config('my-package', '1.0.0', 'This is a sample package') == {'name': 'my-package', 'version': '1.0.0', 'description': 'This is a sample package'}\", \"assert generate_config('my-package', '1.0.0', 'This is a sample package', 'node') == {'name': 'my...
{ "split": "train", "index": 65048, "acecode_id": "bigcode_python_fns_23107", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that generates the Fibonacci sequence up to a given limit. The Fibonacci sequence starts with 0 and 1, and each subsequent number is the sum of the two preceding ones. Your function should take an integer `limit` as input and return a list of Fibonacci numbers ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_fibonacci(0) == []\", \"assert calculate_fibonacci(-5) == []\", \"assert calculate_fibonacci(1) == [0, 1, 1]\", \"assert calculate_fibonacci(2) == [0, 1, 1, 2]\", \"assert calculate_fibonacci(3) == [0, 1, 1, 2, 3]\", \"assert calculate_fibonacci(4)...
{ "split": "train", "index": 65049, "acecode_id": "oss_37037", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `s` consisting of words separated by spaces, write a function `lengthOfLastWord(s: str) -> int` that returns the length of the last word in the string. A word is defined as a maximal substring consisting of non-space characters. If there is no word in the string,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert lengthOfLastWord('Hello World') == 5\", \"assert lengthOfLastWord(' Hello ') == 5\", \"assert lengthOfLastWord(' ') == 0\", \"assert lengthOfLastWord('OpenAI is great') == 5\", \"assert lengthOfLastWord('Python programming') == 11\", \"assert lengthOfLas...
{ "split": "train", "index": 65050, "acecode_id": "evol_3866", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, implement a function that sorts the array in ascending order and then divides it into three equal parts. If the array cannot be evenly divided, the extra elements should be included in the last part. The function should return the three parts as a tu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert tripartite_partitioning([9,6,7,4,1,6,3]) == ([1, 3], [4, 6], [6, 7, 9])\", \"assert tripartite_partitioning([1, 2, 3, 4, 5, 6]) == ([1, 2], [3, 4], [5, 6])\", \"assert tripartite_partitioning([10, 20, 30, 40, 50, 60, 70]) == ([10, 20], [30, 40], [50, 60, 70]...
{ "split": "train", "index": 65051, "acecode_id": "evol_33200", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a 2D list of landmarks representing coordinates in an image, implement a function that flips the coordinates along the horizontal axis (y-axis) and returns the flipped landmarks. The input will be a list of tuples, where each tuple consists of two integers representing th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert flip_landmarks([(1, 2), (3, 4)]) == [(1, -2), (3, -4)]\", \"assert flip_landmarks([(0, 0), (1, 1), (2, 2)]) == [(0, 0), (1, -1), (2, -2)]\", \"assert flip_landmarks([(5, 10)]) == [(5, -10)]\", \"assert flip_landmarks([(3, 0), (0, 5), (-1, -1)]) == [(3, 0), (...
{ "split": "train", "index": 65052, "acecode_id": "oss_30679", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of user dictionaries representing users in an application. Each user dictionary contains the following keys: 'id' (a unique identifier), 'name' (the name of the user), and 'email' (the user's email address). Write a function named `filter_users_by_domain(us...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_users_by_domain([{'id': '1', 'name': 'Alice', 'email': 'alice@example.com'}, {'id': '2', 'name': 'Bob', 'email': 'bob@example.com'}], 'example.com') == [{'id': '1', 'name': 'Alice', 'email': 'alice@example.com'}, {'id': '2', 'name': 'Bob', 'email': 'b...
{ "split": "train", "index": 65053, "acecode_id": "bigcode_python_fns_3926", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a python function that takes a string as input, converts it to uppercase, reverses it, and removes any numerical digits present in it. The function should return the modified string.\nPlease reason step by step, then write a self-contained Python solution. Give your final...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert conv_uppercase_reverse_nondigit('hello123') == 'OLLEH'\", \"assert conv_uppercase_reverse_nondigit('abc456def') == 'FEDCBA'\", \"assert conv_uppercase_reverse_nondigit('LeetCode2021') == 'EDOCTEEL'\", \"assert conv_uppercase_reverse_nondigit('') == ''\", \"a...
{ "split": "train", "index": 65054, "acecode_id": "evol_2791", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a list of 3D coordinates representing the positions of different particles in space and a list of corresponding atomic masses of these particles, write a function `calculate_center_of_mass(positions: List[Tuple[float, float, float]], masses: List[float]) -> Tuple[float, f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_center_of_mass([(1.0, 2.0, 3.0), (4.0, 5.0, 6.0)], [1.0, 2.0]) == (3.0, 4.0, 5.0)\", \"assert calculate_center_of_mass([(0.0, 0.0, 0.0), (1.0, 1.0, 1.0)], [1.0, 1.0]) == (0.5, 0.5, 0.5)\", \"assert calculate_center_of_mass([(1.0, 2.0, 3.0)], [1.0])...
{ "split": "train", "index": 65055, "acecode_id": "bigcode_python_fns_33260", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a list of numbers, implement a function that finds the third smallest and third largest unique elements. If the list does not have enough unique values to determine these, the function should return 'Not enough unique elements'. Do not use a sorting function to solve this...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert third_smallest_and_largest([3, 4, 8, 1, 5, 0, 9, 9, 8, 2, 1, 0]) == (2, 5)\", \"assert third_smallest_and_largest([1, 2]) == 'Not enough unique elements'\", \"assert third_smallest_and_largest([5, 5, 5, 5]) == 'Not enough unique elements'\", \"assert third_s...
{ "split": "train", "index": 65056, "acecode_id": "evol_30340", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a setup script for a Python package named 'syntax_analyzer'. This package is structured using setuptools, and it should include specific files and directories as package data. Your goal is to implement a single function named `create_setup_script` t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_setup_script() == \\\"from setuptools import setup, find_packages\\\\n\\\\nsetup(\\\\n author='Data Monsters',\\\\n author_email='<EMAIL>',\\\\n packages=find_packages(),\\\\n package_data={\\\\n 'syntax_analyzer': ['dict/*', 'gramm...
{ "split": "train", "index": 65057, "acecode_id": "oss_6792", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of five integers, implement a function `calculate_median` that calculates the median of these integers without using any sort, comparison, or conditional operators. The median is defined as the middle value in a sorted list of numbers. If the list contains an even ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_median([3, 1, 4, 5, 2]) == 3\", \"assert calculate_median([12, 4, 5, 3, 8]) == 5\", \"assert calculate_median([0, 0, 0, 0, 0]) == 0\", \"assert calculate_median([10, 20, 30, 40, 50]) == 30\", \"assert calculate_median([1, 3, 2, 5, 4]) == 3\", \"ass...
{ "split": "train", "index": 65058, "acecode_id": "evol_33323", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given the temperature in Celsius from a weather service. Your task is to implement a function that converts this temperature into Fahrenheit. The conversion formula is F = (C * 9/5) + 32, where C is the temperature in Celsius. Write a function named 'convert_celsius_to_...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_celsius_to_fahrenheit(0) == 32.0\", \"assert convert_celsius_to_fahrenheit(100) == 212.0\", \"assert convert_celsius_to_fahrenheit(-40) == -40.0\", \"assert convert_celsius_to_fahrenheit(20) == 68.0\", \"assert convert_celsius_to_fahrenheit(37) == 98...
{ "split": "train", "index": 65059, "acecode_id": "oss_26029", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that computes the divisor-weighted mean of consecutive integers starting from n to m (inclusive). The function should round the mean to the nearest integer and convert it to a specified base system within the range [2, 10] (inclusive)...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rounded_avg_custom_base(1, 5, 2) == '0b11'\", \"assert rounded_avg_custom_base(7, 5, 2) == -1\", \"assert rounded_avg_custom_base(10, 20, 2) == '0b1111'\", \"assert rounded_avg_custom_base(20, 33, 2) == '0b11010'\", \"assert rounded_avg_custom_base(20, 33, 8...
{ "split": "train", "index": 65060, "acecode_id": "evol_4841", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given a list of strings, where each string represents a line of text. Each line may contain a JSON object or it may be an invalid JSON string. Your task is to write a function that processes this list and returns a new list containing either the parsed JSON object as a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_json_lines(['{\\\"key\\\": \\\"value\\\"}', '{\\\"number\\\": 123}', 'invalid json']) == [{'key': 'value'}, {'number': 123}, 'Invalid JSON']\", \"assert process_json_lines(['{\\\"name\\\": \\\"Alice\\\"}', 'Not a JSON', '{\\\"age\\\": 30}']) == [{'na...
{ "split": "train", "index": 65061, "acecode_id": "bigcode_python_fns_10389", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to implement a function `highest_priority_task(tasks: List[Tuple[str, int]]) -> str` that takes a list of tuples as input. Each tuple contains a task (a string) and its corresponding priority (an integer). Your function should return the task with the highest priority,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert highest_priority_task([('Task 1', 3), ('Task 2', 1), ('Task 3', 2)]) == 'Task 2'\", \"assert highest_priority_task([('Task A', 5), ('Task B', 4), ('Task C', 1)]) == 'Task C'\", \"assert highest_priority_task([('Task X', 0), ('Task Y', 2), ('Task Z', 1)]) == ...
{ "split": "train", "index": 65062, "acecode_id": "oss_33468", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of operators, where each operator is a function that takes a list of integers and returns a modified list of integers. Your task is to apply each operator to an initial list of integers, which starts as [1, 2, 3]. You need to implement a function called `ap...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert apply_operators([]) == [1, 2, 3]\", \"assert apply_operators([lambda x: [i * 2 for i in x]]) == [2, 4, 6]\", \"assert apply_operators([lambda x: [i * 2 for i in x], lambda x: [i + 1 for i in x]]) == [3, 5, 7]\", \"assert apply_operators([lambda x: [i for i i...
{ "split": "train", "index": 65063, "acecode_id": "bigcode_python_fns_34626", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that creates a custom scoping object for a mesh. The function should take a list of node IDs and return a dictionary representing the scoping configuration. The node IDs will be provided as a list of integers. If the input is not a li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_scoping([1, 2, 3]) == {'ids': [1, 2, 3], 'location': 'nodal'}\", \"assert create_scoping([10, 20, 30, 40]) == {'ids': [10, 20, 30, 40], 'location': 'nodal'}\", \"assert create_scoping([]) == {'ids': [], 'location': 'nodal'}\", \"assert create_scoping(...
{ "split": "train", "index": 65064, "acecode_id": "bigcode_python_fns_19438", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two dictionaries, `dict1` and `dict2`. Your task is to merge these two dictionaries into one. The values from `dict2` should be added to `dict1`. If there are any overlapping keys, the values from `dict2` should be added to `dict1` without replacing the existing v...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_dictionaries({'a': 1, 'b': 2}, {'c': 3}) == {'a': [1], 'b': [2], 'c': [3]}\", \"assert merge_dictionaries({'x': 5}, {'x': 10}) == {'x': [5, 10]}\", \"assert merge_dictionaries({}, {'a': 1}) == {'a': [1]}\", \"assert merge_dictionaries({'a': 1}, {}) == ...
{ "split": "train", "index": 65065, "acecode_id": "bigcode_python_fns_5439", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing a sequence of gates in a quantum computation. Each string can be of varying length, representing different gates. Your task is to split this list into multiple sublists such that the total number of instructions (gates) in each subli...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert split_exp_list(['G1'], 10) == [['G1']]\", \"assert split_exp_list(['G1', 'G2', 'G3', 'G4', 'G5'], 2) == [['G1'], ['G2'], ['G3'], ['G4'], ['G5']]\", \"assert split_exp_list(['G1', 'G2', 'G3'], 2) == [['G1'], ['G2'], ['G3']]\", \"assert split_exp_list(['G1'], ...
{ "split": "train", "index": 65066, "acecode_id": "bigcode_python_fns_10162", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Write a function `preprocess_data(data)` that takes a 2D list of numerical data as input, cleans it by removing any rows that contain negative numbers, and normalizes the remaining data using min-max normalization. The function should return the cleaned and normalized data as a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert preprocess_data([[1, 2], [3, 4], [5, 6]]) == [[0.0, 0.0], [0.5, 0.5], [1.0, 1.0]]\", \"assert preprocess_data([[1, -1], [3, 4], [5, 6]]) == [[0.0, 0.0], [1.0, 1.0]]\", \"assert preprocess_data([[2, 3], [4, 5], [6, 7], [-1, 2]]) == [[0.0, 0.0], [0.5, 0.5], [1...
{ "split": "train", "index": 65067, "acecode_id": "evol_10385", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a given HTML string and returns the content within the `<h1>` tags. Your function should ignore any leading or trailing whitespace within the tags and return the content as a string. If the input string does not cont...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_h1_content('<html><body><h1>Welcome to our website</h1></body></html>') == 'Welcome to our website'\", \"assert extract_h1_content('<html><body><h2>Introduction</h2></body></html>') == 'No <h1> tag found'\", \"assert extract_h1_content('<html><body><...
{ "split": "train", "index": 65068, "acecode_id": "oss_13110", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that computes the cube root of a given non-negative number. The function should take a single parameter, a non-negative integer, and return the cube root of that number. The cube root should be returned as a float.\nPlease reason step by step, then write a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert abs(cube_root(0) - 0.0) < 1e-9\", \"assert abs(cube_root(1) - 1.0) < 1e-9\", \"assert abs(cube_root(8) - 2.0) < 1e-9\", \"assert abs(cube_root(27) - 3.0) < 1e-9\", \"assert abs(cube_root(64) - 4.0) < 1e-9\", \"assert abs(cube_root(125) - 5.0) < 1e-9\", \"ass...
{ "split": "train", "index": 65069, "acecode_id": "evol_22654", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a list of folder names and performs specific operations based on their structure. The function will take in three parameters: an integer n1 representing the number of folder names, a list of strings folder_name represen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_data(2, ['folder1', 'folder2'], (0, 1)) == ([0, 0], None, None, 0, 1)\", \"assert process_data(3, ['folder1', 'folder2/', 'folder3'], (1, 2)) == ([0, 0, 0], None, None, 1, 2)\", \"assert process_data(2, ['folder1/', 'folder2/'], (0, 1)) == ([0, 0], N...
{ "split": "train", "index": 65070, "acecode_id": "oss_22901", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with designing a function `manage_database` that simulates basic database operations on a given SQL command. The function should take two parameters: a string `sql` representing the SQL command and a string `action` which can be either 'create', 'drop', or 'upgra...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_database('CREATE TABLE users (id INT, name TEXT);', 'create') == 'Created...'\", \"assert manage_database('DROP TABLE users;', 'drop') == 'Dropped...'\", \"assert manage_database('ALTER TABLE users ADD COLUMN age INT;', 'upgrade') == 'Upgraded...'\", ...
{ "split": "train", "index": 65071, "acecode_id": "bigcode_python_fns_6393", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with developing a function that takes a list of branch names and a branch pattern as input. The function should return a list of branch names that match the given pattern. The pattern may include wildcard characters '*' to indicate that any number of characters c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_branches(['android-1', 'android-2', 'ios-1', 'android-3'], 'android-*') == ['android-1', 'android-2', 'android-3']\", \"assert filter_branches(['feature-1', 'feature-2', 'bugfix-1'], 'feature-*') == ['feature-1', 'feature-2']\", \"assert filter_branch...
{ "split": "train", "index": 65072, "acecode_id": "bigcode_python_fns_30382", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `count_unique_elements(array1, array2)` that takes two unsorted arrays of integers and returns the count of unique elements present in both arrays combined. You must not use any preexisting library functions for handling collections or arrays. The function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_unique_elements([1, 2, 3], [4, 5, 6]) == 6\", \"assert count_unique_elements([1, 2, 2], [2, 3, 4]) == 4\", \"assert count_unique_elements([], [1, 2, 3]) == 3\", \"assert count_unique_elements([1, 1, 1], []) == 1\", \"assert count_unique_elements([1, 2,...
{ "split": "train", "index": 65073, "acecode_id": "evol_14456", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of integers and performs a specific calculation. Your function should take a list of integers as input and calculate the average of the numbers in the list. However, if the last number in the list is zero, you...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert handle_exceptions([1, 2, 3, 0]) == 'An error occurred during the operations.'\", \"assert handle_exceptions([10, 20, 30]) == 20\", \"assert handle_exceptions([5, 15, 25, 0]) == 'An error occurred during the operations.'\", \"assert handle_exceptions([8, 16, ...
{ "split": "train", "index": 65074, "acecode_id": "oss_28515", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing file patterns. Implement a function that filters these file patterns based on a specified sub-type. If no sub-type is provided, return the entire list. If the sub-type is specified and no files match, raise a ValueError with a messag...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_file_patterns(['document.txt', 'image.jpg', 'notes.docx'], None) == ['document.txt', 'image.jpg', 'notes.docx']\", \"assert filter_file_patterns(['report.pdf', 'summary.pdf', 'data.csv'], 'pdf') == ['report.pdf', 'summary.pdf']\", \"assert filter_file...
{ "split": "train", "index": 65075, "acecode_id": "bigcode_python_fns_1538", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks if a given documentation dictionary for a model is valid. The documentation must contain two fields: 'name' (a non-empty string) and 'documentation' (also a non-empty string). Your function should return True if both fields ar...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_documentation({'name': 'MyModel', 'documentation': 'This model does XYZ.'}) == True\", \"assert is_valid_documentation({'name': 'AnotherModel', 'documentation': 'Another documentation.'}) == True\", \"assert is_valid_documentation({'name': '', 'docu...
{ "split": "train", "index": 65076, "acecode_id": "bigcode_python_fns_40547", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a list of book items, each represented as a dictionary. Each book item contains the keys 'title', 'author', and 'cover_image'. Your function should return a list of tuples, where each tuple contains the title and author of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_books([{'title': 'Book A', 'author': 'Author A', 'cover_image': 'http://example.com/coverA.jpg'}]) == [('Book A', 'Author A', 'http://example.com/coverA.jpg')]\", \"assert process_books([{'title': 'Book A', 'author': 'Author A', 'cover_image': 'https...
{ "split": "train", "index": 65077, "acecode_id": "oss_6861", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a string `s` that contains only parentheses, write a function that determines if the input string is valid. A valid parentheses string is defined as follows: 1. Open parentheses must be closed by the corresponding closing parentheses. 2. Open parentheses must be closed in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_parentheses('()') == True\", \"assert is_valid_parentheses('()[]{}') == True\", \"assert is_valid_parentheses('(]') == False\", \"assert is_valid_parentheses('([)]') == False\", \"assert is_valid_parentheses('{[]}') == True\", \"assert is_valid_pare...
{ "split": "train", "index": 65078, "acecode_id": "bigcode_python_fns_49908", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of elements and a maximum number of frames. Your task is to check if a specified display format (in this case, 'png') is supported based on the provided list of display formats and a registry of supported element types. If 'png' is in the display formats an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_display_support(['element1'], 5, ['png', 'jpg'], 'backend1', {'backend1': ['element1', 'element2']}) == 'Display Supported'\", \"assert check_display_support(['element1'], 5, ['jpg'], 'backend1', {'backend1': ['element1', 'element2']}) == 'Display Not ...
{ "split": "train", "index": 65079, "acecode_id": "bigcode_python_fns_36495", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a program to categorize rewards obtained by players in a game. The rewards are categorized as 'above expected', 'as expected', or 'below expected' based on a predefined expected amount of 100. Your program should take a reward amount as input and re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert categorize_reward(100) == 'Recompensa obtida conforme o previsto. SUCCESS'\", \"assert categorize_reward(150) == 'Recompensa obtida acima do previsto. SUCCESS'\", \"assert categorize_reward(80) == 'Recompensa obtida abaixo do previsto. FAILED'\", \"assert ca...
{ "split": "train", "index": 65080, "acecode_id": "oss_5567", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a callback object that may have certain attributes. Write a function `get_view_class(callback)` that takes a callback as input and returns the value of the attribute `view_class` if it exists. If `view_class` does not exist, the function should return the value of...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_view_class(type('TestCallback', (), {'view_class': 'ViewClass'})) == 'ViewClass'\", \"assert get_view_class(type('TestCallback', (), {'cls': 'ClassName'})) == 'ClassName'\", \"assert get_view_class(type('TestCallback', (), {'view_class': None})) == None\...
{ "split": "train", "index": 65081, "acecode_id": "bigcode_python_fns_7713", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of items, each represented as a dictionary with keys 'type', 'url', 'typeKeywords', and 'id', write a function that returns a list of unique item IDs of type 'Feature Service' that are hosted (i.e., contain '/Hosted/' in their URL) and are associated with a scene s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_source_item_ids([{'type': 'Feature Service', 'url': 'http://example.com/Hosted/service1', 'typeKeywords': ['Hosted Service'], 'id': '1'}, {'type': 'Feature Service', 'url': 'http://example.com/Hosted/service2', 'typeKeywords': ['Hosted Service'], 'id': '...
{ "split": "train", "index": 65082, "acecode_id": "bigcode_python_fns_27730", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that determines the number of recovery codes left for a given user ID based on a predefined mapping. The predefined mapping is represented as a dictionary where the keys are user IDs (strings) and the values are integers representing the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_number_of_recovery_codes('user1', {'user1': 5, 'user2': 3}) == 5\", \"assert get_number_of_recovery_codes('user2', {'user1': 5, 'user2': 3}) == 3\", \"assert get_number_of_recovery_codes('user3', {'user1': 5, 'user2': 3}) == 0\", \"assert get_number_of_r...
{ "split": "train", "index": 65083, "acecode_id": "bigcode_python_fns_14932", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two sets of corners representing two boxes in a 2D plane, determine if each corner of the first box lies within or on the edge of the second box. Each box is defined by four corners in the format (x, y). The input will consist of two lists of corners, where each list cont...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert box1_in_box2([(0,0), (1,0), (1,1), (0,1)], [(0,0), (1,0), (1,1), (0,1)]) == [True, True, True, True]\", \"assert box1_in_box2([(0,0), (1,0), (1,1), (0,1)], [(0,0), (2,0), (2,2), (0,2)]) == [True, True, True, True]\", \"assert box1_in_box2([(1,1), (2,1), (2,2...
{ "split": "train", "index": 65084, "acecode_id": "bigcode_python_fns_32511", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a string representing a command configuration for a device. The string can contain multiple configuration commands separated by semicolons. Your task is to implement a function that checks if the command 'l2vpn evpn' is present in the configuration string. If it i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_l2vpn_evpn_present('interface GigabitEthernet0/0; no shutdown') == False\", \"assert is_l2vpn_evpn_present('l2vpn evpn') == True\", \"assert is_l2vpn_evpn_present('no l2vpn') == False\", \"assert is_l2vpn_evpn_present('L2VPN EVPN') == False\", \"assert is...
{ "split": "train", "index": 65085, "acecode_id": "bigcode_python_fns_16597", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates reading ABI (Application Binary Interface) definitions from a JSON-like structure represented as a string. The function should parse the string and return the ABI definitions as a dictionary. If the input string is empt...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_abi_json('{\\\"name\\\": \\\"MyContract\\\", \\\"abi\\\": []}') == {'name': 'MyContract', 'abi': []}\", \"assert parse_abi_json('{\\\"name\\\": \\\"TestContract\\\", \\\"abi\\\": [{\\\"type\\\": \\\"function\\\", \\\"name\\\": \\\"testFunc\\\"}]}') == ...
{ "split": "train", "index": 65086, "acecode_id": "oss_5477", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers 'data', an integer 'threshold', and an integer 'min_distance', write a function that detects the indices of the 'onset' and 'offset' positions in the data. An 'onset' occurs when the value of 'data' exceeds the 'threshold' for the first time after being...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert detect_onsets_offsets([0, 0, 0, 0, 1, 0, 0, 0, 0, 0], 0, 1) == ([4], [5])\", \"assert detect_onsets_offsets([0, 0, 0, 0, 0], 1, 1) == ([], [])\", \"assert detect_onsets_offsets([0, 0, 1, 0, 0, 1], 0, 1) == ([2, 5], [3])\", \"assert detect_onsets_offsets([10,...
{ "split": "train", "index": 65087, "acecode_id": "bigcode_python_fns_24570", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a sorted array of integers and a target integer, implement a function that determines if the target is present within the array and returns a tuple containing a boolean indicating presence and the number of times the target occurs in the array.\nPlease reason step by step...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_target([1, 2, 3, 4, 5], 3) == (True, 1)\", \"assert find_target([1, 1, 1, 1, 1], 1) == (True, 5)\", \"assert find_target([2, 4, 6, 8, 10], 5) == (False, 0)\", \"assert find_target([], 1) == (False, 0)\", \"assert find_target([1, 1, 2, 2, 2, 3], 2) == (T...
{ "split": "train", "index": 65088, "acecode_id": "evol_20569", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `create_prime_matrix()` that returns a 5 x 5 matrix (a list of lists) containing the first 25 prime numbers, where each row contains 5 prime numbers. The primes should be ordered from smallest to largest.\nPlease reason step by step, then write a self-contained...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_prime_matrix() == [[2, 3, 5, 7, 11], [13, 17, 19, 23, 29], [31, 37, 41, 43, 47], [53, 59, 61, 67, 71], [73, 79, 83, 89, 97]]\", \"assert create_prime_matrix()[0] == [2, 3, 5, 7, 11]\", \"assert create_prime_matrix()[1] == [13, 17, 19, 23, 29]\", \"ass...
{ "split": "train", "index": 65089, "acecode_id": "evol_18621", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given three arrays, l1, l2, and l3, write a function that identifies elements that are present at the same index in all three arrays and appear only once across all three arrays combined. The function should return an array of these unique elements. The length of the output sho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_singular_elements([1, 2, 3], [4, 5, 6], [7, 8, 9]) == []\", \"assert find_singular_elements([1, 2, 3, 4], [4, 3, 2, 1], [1, 2, 3, 4]) == []\", \"assert find_singular_elements([1, 1, 1], [2, 2, 2], [3, 3, 3]) == []\", \"assert find_singular_elements([1, ...
{ "split": "train", "index": 65090, "acecode_id": "evol_29924", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to process a list of strings and filter them based on their length. Your function should take a list of strings, `input_strings`, and an integer `threshold`. The goal is to return a list of strings that have a length greater than the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_strings(['a', 'b', 'c'], 1) == []\", \"assert process_strings(['python', 'java', 'c++'], 3) == ['python', 'java']\", \"assert process_strings(['one', 'two', 'three'], 5) == []\", \"assert process_strings(['abcd', 'efgh', 'ijkl'], 3) == ['abcd', 'efgh...
{ "split": "train", "index": 65091, "acecode_id": "oss_1814", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Create a function that translates a nested list into a dictionary and performs specific transformations on the incoming data. The function should take a list of tuples, where each tuple contains a fruit name (string) and a corresponding number (integer). The requirements are: 1...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transform([('apple', 1), ('banana', 2), ('orange', 3)]) == {'apple': ['1'], 'banana': ['6'], 'orange': ['9']}\", \"assert transform([('apple', 2), ('banana', 3), ('apple', 4)]) == {'apple': ['6', '12'], 'banana': ['9']}\", \"assert transform([('grape', 5), (...
{ "split": "train", "index": 65092, "acecode_id": "evol_25531", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes request parameters for a web application. The function takes three arguments: `source`, `start_date`, and `next_page_token`. The `source` argument represents the source of the request, which can take one of the followin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert request_params('api', '2022-01-01', 'token123') == {'source': 'api', 'start_date': '2022-01-01', 'next_page_token': 'token123'}\", \"assert request_params(None, '2022-01-01', None) == {'source': 'web', 'start_date': '2022-01-01', 'next_page_token': ''}\", \"...
{ "split": "train", "index": 65093, "acecode_id": "oss_37291", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes an array of integers and returns a list of the five elements that appear with the least frequency in the array. If there are fewer than five distinct elements, return all of them. The order of the elements in the output list should be from the le...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert least_frequent([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert least_frequent([1, 1, 2, 2, 3]) == [3, 1, 2]\", \"assert least_frequent([]) == []\", \"assert least_frequent([1, 1, 1]) == [1]\", \"assert least_frequent([1, 2, 2, 3, 3]) == [1, 2, 3]\", \"assert...
{ "split": "train", "index": 65094, "acecode_id": "evol_16268", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given the coordinates of a pixel in a 2D grid defined by its rows and columns. Implement a function that checks if a given pixel (identified by its coordinates) falls within a specified rectangular region of the grid. The grid has a defined width and height. The functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_pixel_in_grid(10, 10, 5, 5) is True\", \"assert check_pixel_in_grid(10, 10, 10, 5) is False\", \"assert check_pixel_in_grid(10, 10, 5, 10) is False\", \"assert check_pixel_in_grid(5, 5, 4, 4) is True\", \"assert check_pixel_in_grid(5, 5, -1, 0) is Fals...
{ "split": "train", "index": 65095, "acecode_id": "bigcode_python_fns_39933", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the execution of a command line tool based on provided environment variables and parameters. The function should take four inputs: `environment`, `source`, `arguments`, and `target`. The `environment` is a dictionary that m...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_execution({'GODOT_EXECUTABLE': 'godot'}, 'source_file', '--run', 'output_file') == '\\\"godot\\\" source_file --run'\", \"assert simulate_execution({'GODOT_VERSION': '3.2'}, 'source_file', '--run', 'output_file') == '\\\"3.2_executable_path\\\" sour...
{ "split": "train", "index": 65096, "acecode_id": "bigcode_python_fns_18639", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks whether a given event creation action has succeeded based on the input parameter. The function will take a single parameter, `page_event_new`, which represents the event to be processed. Your function should return `True` if t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert success_message({'title': ''}) == False\", \"assert success_message(None) == False\", \"assert success_message({'title': ' '}) == False\", \"assert success_message({'title': None}) == False\", \"assert success_message({'title': ''}) == False\", \"assert s...
{ "split": "train", "index": 65097, "acecode_id": "bigcode_python_fns_41615", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a list of integers called `AtomIndices` and a list of indices called `AtomMapIndices`, implement a function that filters the elements of `AtomIndices` based on the indices provided in `AtomMapIndices`. If `AtomMapIndices` is None, return the entire `AtomIndices` list. Oth...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_atoms([10, 20, 30, 40], [0, 2]) == [10, 30]\", \"assert filter_atoms([1, 2, 3, 4, 5], None) == [1, 2, 3, 4, 5]\", \"assert filter_atoms([5, 10, 15, 20], [1]) == [10]\", \"assert filter_atoms([100, 200, 300, 400], [0, 3]) == [100, 400]\", \"assert filt...
{ "split": "train", "index": 65098, "acecode_id": "bigcode_python_fns_47869", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string, write a function that returns a dictionary containing the characters that appear more than once in the string along with their frequencies. The function should only consider characters that are alphabetic and ignore case. The output should be case-insensitive, m...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert duplicate_characters('Hello World') == {'l': 3, 'o': 2}\", \"assert duplicate_characters('abcd') == {}\", \"assert duplicate_characters('abcABC') == {'a': 2, 'b': 2, 'c': 2}\", \"assert duplicate_characters('Test Test') == {'t': 4, 'e': 2, 's': 2}\", \"asser...
{ "split": "train", "index": 65099, "acecode_id": "evol_12061", "num_tests": 10 }