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 function that generates a structured response object based on user data, course context, and a status string. The function should take in three parameters: `current_user`, `context`, and `status`, and return a response object that includes spe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_response({'data': 'John Doe'}, {'id': 101, 'name': 'Math 101'}, 'active') == {'user': 'John Doe', 'context': {'id': 101, 'name': 'Math 101'}, 'status': 'active', 'variant': 'warning'}\", \"assert generate_response({'data': 'Alice'}, {'id': 202, 'nam...
{ "split": "train", "index": 84000, "acecode_id": "oss_15880", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a variable number of numerical input values and returns a list of their squares. The function should accept any number of integers or floats, and should return a list of these numbers, each squared. If no input is provided, the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert square_numbers(1, 2, 3) == [1, 4, 9]\", \"assert square_numbers(-1, -2, -3) == [1, 4, 9]\", \"assert square_numbers(0) == [0]\", \"assert square_numbers(2.5, 3.5) == [6.25, 12.25]\", \"assert square_numbers() == []\", \"assert square_numbers(1, -1, 0) == [1,...
{ "split": "train", "index": 84001, "acecode_id": "bigcode_python_fns_13156", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a nested list of integers, implement a function that flattens the list into a single list of integers. The input can contain integers and other lists, which may also contain integers or other lists. Your function should return a new list with all the integers in the same ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unravel([1, [2], 3, [4, [5, 6], 7]]) == [1, 2, 3, 4, 5, 6, 7]\", \"assert unravel([10, [20, [30]], 40]) == [10, 20, 30, 40]\", \"assert unravel([[1, 2], 3, [4, [5]]]) == [1, 2, 3, 4, 5]\", \"assert unravel([[[[1]]]]) == [1]\", \"assert unravel([]) == []\", \...
{ "split": "train", "index": 84002, "acecode_id": "evol_21818", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a list of course details and returns a filtered list of courses that have a specified minimum price and contain a specific topic. The function should accept three parameters: a list of dictionaries 'courses', a decimal 'min...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_courses([], Decimal('5000'), 'Innovation') == []\", \"assert filter_courses([{'url': 'url1', 'title': 'Course 1', 'dates': [], 'price': Decimal('6000'), 'topics': ['Innovation'], 'short_description': '', 'full_description': '', 'instructors': []}], De...
{ "split": "train", "index": 84003, "acecode_id": "bigcode_python_fns_6934", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Write a Python function `parse_requirements(cron_string)` that takes a cron string as input and returns a list of requirements based on the parsed values. The cron string will consist of various conditions and parameters separated by spaces. The function should extract the rele...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_requirements('CHECKHOURS0-6 CHECKMINUTES0-30 WEEKDAYS MINNUM10 MAXNUM50 LOOKBACKSECONDS1800') == ['CHECKHOURS0-6', 'CHECKMINUTES0-30', 'WEEKDAYS', 'MINNUM10', 'MAXNUM50', 'LOOKBACKSECONDS1800']\", \"assert parse_requirements('CHECKHOURS8-12 CHECKMINUTE...
{ "split": "train", "index": 84004, "acecode_id": "oss_26638", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary where the keys are argument names and the values are their corresponding values of various types (e.g., integers, floats, booleans, etc.). Your task is to write a function that takes this dictionary as input and returns a new dictionary where all valu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cast_arguments({'a': 42, 'b': 3.14, 'c': True}) == {'a': '42', 'b': '3.14', 'c': 'True'}\", \"assert cast_arguments({'x': None, 'y': False, 'z': 100}) == {'x': 'None', 'y': 'False', 'z': '100'}\", \"assert cast_arguments({'name': 'Alice', 'age': 30}) == {'na...
{ "split": "train", "index": 84005, "acecode_id": "bigcode_python_fns_37885", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a cookie management system for a web application. Your task is to write a function `manage_cookies` that takes in the following parameters: `request`, `func`, `shop`, `token_key` (optional, default=None), `unionid` (optional, default=None), `*ar...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_cookies('request', lambda r: 'response', 'shopA', 'token123') == {'set_cookie': ['shopA_key=token123']}\", \"assert manage_cookies('request', lambda r: 'response', 'shopB', None, 'union456') == {'set_cookie': ['shopB=union456']}\", \"assert manage_coo...
{ "split": "train", "index": 84006, "acecode_id": "oss_26680", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a command-line argument parser for a program that aligns codon sequences. Your function `parse_arguments` should accept a list of command-line arguments (as strings) and return a dictionary containing the parsed arguments. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_arguments([]) == {'inf': None, 'outf': None, 'prog': 'mafft', 'outtranslated': None, 'outtransaligned': None, 'outformat': 'fasta'}\", \"assert parse_arguments(['-inf', 'input.txt']) == {'inf': 'input.txt', 'outf': None, 'prog': 'mafft', 'outtranslated...
{ "split": "train", "index": 84007, "acecode_id": "bigcode_python_fns_22738", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of package names that need to be checked against a predefined set of package names. Your task is to implement a function `check_packages(packages: List[str]) -> List[str]` that returns a list of packages that are not available in the predefined set of packa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_packages(['pypi_atomicwrites', 'pypi_attrs', 'pypi_funcsigs']) == []\", \"assert check_packages(['pypi_atomicwrites', 'pypi_nonexistent']) == ['pypi_nonexistent']\", \"assert check_packages(['pypi_more_itertools', 'pypi_pluggy', 'pypi_random']) == ['py...
{ "split": "train", "index": 84008, "acecode_id": "bigcode_python_fns_15776", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `update_prices(documents: List[Dict[str, Union[str, bool]]]) -> List[Dict[str, Union[str, bool, int]]]` that takes a list of documents where each document is represented as a dictionary containing fields 'date' (as a string in the format 'YYYY-MM-DD'), 'is_disc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_prices([{'date': '2015-01-01', 'is_discounted': False, 'price': 100}, {'date': '2020-01-01', 'is_discounted': False, 'price': 150}]) == [{'date': '2015-01-01', 'is_discounted': False, 'price': 200}, {'date': '2020-01-01', 'is_discounted': False, 'pric...
{ "split": "train", "index": 84009, "acecode_id": "evol_15380", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that increments a specified component of a numerical array by a given input value. The function should return the modified array. If the provided index is invalid (either negative or greater than or equal to the length of the array), the function should ret...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert increment_array_element([1, 2, 3, 4], 2, 3) == [1, 2, 6, 4]\", \"assert increment_array_element([10, 20, 30], 0, 5) == [15, 20, 30]\", \"assert increment_array_element([1, 1, 1], 1, -1) == [1, 0, 1]\", \"assert increment_array_element([5, 10, 15], 3, 1) == '...
{ "split": "train", "index": 84010, "acecode_id": "evol_23995", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of albums, where each album is represented as a dictionary containing the following keys: 'date' (a string representing the release date), 'artist_tag' (a string representing the artist's tag), 'album_tag' (a string representing the album's tag), 'artist' (...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert playlists_by_date([{'date': '2023-01-01', 'artist_tag': 'artist1', 'album_tag': 'album1', 'artist': 'Artist One', 'album': 'Album One', 'tracks': ['Track 1', 'Track 2'], 'picks': [0]}, {'date': '2022-05-05', 'artist_tag': 'artist2', 'album_tag': 'album2', 'a...
{ "split": "train", "index": 84011, "acecode_id": "bigcode_python_fns_22211", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function `reverse_string(s: str) -> str` that takes a string as input and returns the string reversed. Do not use any built-in reversing functions or slicing techniques. You should implement the reversal using a stack data structure that you create from scratch. The...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_string('hello') == 'olleh'\", \"assert reverse_string('world') == 'dlrow'\", \"assert reverse_string('') == ''\", \"assert reverse_string('Python') == 'nohtyP'\", \"assert reverse_string('12345') == '54321'\", \"assert reverse_string('!@#$%') == '%$#...
{ "split": "train", "index": 84012, "acecode_id": "evol_18312", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with distributing counts of ambiguous k-mers to their corresponding contigs based on their abundance. Write a function `assign_kmer_counts(ambiguous_kmer_counts: Dict[str, int], kmer_to_contig: Dict[str, List[str]], contig_abundances: Dict[str, float]) -> Dict[st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert assign_kmer_counts({'kmer1': 10}, {'kmer1': ['contigA', 'contigB']}, {'contigA': 1.0, 'contigB': 2.0}) == {'contigA': 3.33, 'contigB': 6.67}\", \"assert assign_kmer_counts({'kmer1': 0}, {'kmer1': ['contigA', 'contigB']}, {'contigA': 1.0, 'contigB': 2.0}) == ...
{ "split": "train", "index": 84013, "acecode_id": "bigcode_python_fns_2104", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a string `s`, write a function `calculate_display_width(s: str) -> int` that determines the display width of the string. The display width should account for characters with different widths, where East Asian characters (like those found in Chinese, Japanese, and Korean) ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_display_width('abc') == 3\", \"assert calculate_display_width('\\u4f60\\u597d') == 4\", \"assert calculate_display_width('12345') == 5\", \"assert calculate_display_width(' ') == 2\", \"assert calculate_display_width('Hello') == 5\", \"assert calc...
{ "split": "train", "index": 84014, "acecode_id": "bigcode_python_fns_46557", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given two non-negative integers `num1` and `num2` represented as strings, write a function `multiply` that multiplies the two numbers and returns the result as a string. You should not use any built-in BigInteger library or convert the inputs to integers directly. Ensure that y...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert multiply('0', '0') == '0'\", \"assert multiply('0', '1234') == '0'\", \"assert multiply('1234', '0') == '0'\", \"assert multiply('1', '1') == '1'\", \"assert multiply('2', '3') == '6'\", \"assert multiply('10', '10') == '100'\", \"assert multiply('12', '34')...
{ "split": "train", "index": 84015, "acecode_id": "oss_13749", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function called `calculate_circle_area` that takes a float parameter `radius` and returns the area of a circle with that radius. The function should ensure that the radius is a non-negative real number. If the radius is negative or not a number, the function should rais...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_circle_area(0) == 0.0\", \"assert abs(calculate_circle_area(1) - 3.141592653589793) < 1e-9\", \"assert abs(calculate_circle_area(2.5) - 19.634954084936208) < 1e-9\", \"assert abs(calculate_circle_area(5) - 78.53981633974483) < 1e-9\", \"assert abs(...
{ "split": "train", "index": 84016, "acecode_id": "evol_2693", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates loading configuration and weights for a machine learning model. The function should accept three parameters: `yaml_config` (a string representing the YAML configuration), `weights` (a string representing the weights fil...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert test('config.yaml', 'weights.h5', 10) == {'config': 'config.yaml', 'weights': 'weights.h5', 'num_classes': 10}\", \"assert test('model_config.yaml', None, 5) == {'config': 'model_config.yaml', 'weights': 'default_weights', 'num_classes': 5}\", \"assert test(...
{ "split": "train", "index": 84017, "acecode_id": "oss_9228", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes a string sentence as input and returns a new string where the first letter of each word is capitalized. Words are defined as sequences of characters separated by spaces. The function should handle multiple spaces between words and should not change t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert capitalize_sentence('hello world') == 'Hello World'\", \"assert capitalize_sentence('this is a test') == 'This Is A Test'\", \"assert capitalize_sentence('capitalize each word') == 'Capitalize Each Word'\", \"assert capitalize_sentence(' leading spaces') ==...
{ "split": "train", "index": 84018, "acecode_id": "evol_32665", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of thumbnail URLs. Write a function `download_thumbnails(thumbnail_urls: List[str]) -> List[str]` that simulates the downloading of thumbnails from these URLs. If a URL is valid, it should return the URL itself in the result list. If a URL is invalid (i.e.,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert download_thumbnails(['http://example.com/image1.jpg', 'http://example.com/image2.jpg']) == ['http://example.com/image1.jpg', 'http://example.com/image2.jpg']\", \"assert download_thumbnails(['http://example.com/image1.jpg', 'http://example.com/fail_image.jpg...
{ "split": "train", "index": 84019, "acecode_id": "bigcode_python_fns_1358", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string s, implement a function find_longest_recurring_substrings(s) that returns the longest substrings that appear more than once in the string along with their starting and ending indices. If there are no recurring substrings, return a list containing a single tuple w...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_longest_recurring_substrings('') == [('', 0, 0)]\", \"assert find_longest_recurring_substrings('abcd') == [('', 0, 0)]\", \"assert find_longest_recurring_substrings('aabbcc') == [('a', 0, 1), ('b', 2, 3), ('c', 4, 5)]\", \"assert find_longest_recurring_...
{ "split": "train", "index": 84020, "acecode_id": "evol_36078", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a list of tuples, where each tuple contains three integers (a, b, c). Your task is to determine if the sum of 'a' and 'b' is equal to 'c' for each tuple in the list. Implement a function `check_sum(tuples: List[Tuple[int, int, int]]) -> List[bool]` that returns a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_sum([(1, 2, 3), (4, 5, 10), (1, 1, 2)]) == [True, False, True]\", \"assert check_sum([(0, 0, 0), (5, 5, 10), (10, 10, 20)]) == [True, True, True]\", \"assert check_sum([(1, -1, 0), (2, 3, 6), (5, 5, 10)]) == [True, False, True]\", \"assert check_sum([(...
{ "split": "train", "index": 84021, "acecode_id": "bigcode_python_fns_38550", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a list of domain dictionaries and returns a dictionary containing domain names as keys and their corresponding IDs as values. Each domain dictionary contains 'name' and 'id' keys, representing the name and ID of a domai...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_domains([]) == {}\", \"assert process_domains([{'name': 'site1.com', 'id': 101}]) == {'site1.com': 101}\", \"assert process_domains([{'name': 'site2.com', 'id': 202}, {'name': 'site3.com', 'id': 303}]) == {'site2.com': 202, 'site3.com': 303}\", \"ass...
{ "split": "train", "index": 84022, "acecode_id": "oss_14171", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Implement a function `find_average(a: float, b: float) -> float` that takes two numerical values as input and returns their mean value. The function should not include any user interaction, and should only calculate the mean based on the provided parameters.\nPlease reason step...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_average(1, 3) == 2.0\", \"assert find_average(0, 0) == 0.0\", \"assert find_average(-1, 1) == 0.0\", \"assert find_average(10.5, 2.5) == 6.5\", \"assert find_average(100, 200) == 150.0\", \"assert find_average(-5, -15) == -10.0\", \"assert find_average(...
{ "split": "train", "index": 84023, "acecode_id": "evol_13668", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of distinct integers, implement a function that returns the sum of the two largest integers in the list. If the list contains fewer than two integers, return 0.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_pair_sum([2, 8, 3, 5, 10, 1]) == 18\", \"assert max_pair_sum([1, 2]) == 3\", \"assert max_pair_sum([-1, -2, -3, -4]) == -3\", \"assert max_pair_sum([10, 20, 30]) == 50\", \"assert max_pair_sum([5]) == 0\", \"assert max_pair_sum([]) == 0\", \"assert max_p...
{ "split": "train", "index": 84024, "acecode_id": "evol_12780", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Your task is to implement a function that returns a new list containing only the unique integers from the input list, preserving the order of their first occurrence. The function should also handle the case where the input list is empty by retu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_integers([1, 2, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert unique_integers([1, 1, 1, 1]) == [1]\", \"assert unique_integers([]) == []\", \"assert unique_integers([7, 8, 9, 7, 8]) == [7, 8, 9]\", \"assert unique_integers([1, 2, 3, 4, 3, 2, 1]) == [1, 2, 3, ...
{ "split": "train", "index": 84025, "acecode_id": "oss_8524", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the behavior of a simplified exception handling system. Your function, `simulate_exception`, should take a string input, `error_message`, which represents the error message of a TypeError exception. The function should retu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_exception('TypeError: Invalid type provided') == True\", \"assert simulate_exception('TypeError: None is not allowed') == True\", \"assert simulate_exception('ValueError: Invalid value') == False\", \"assert simulate_exception('TypeError:') == False...
{ "split": "train", "index": 84026, "acecode_id": "bigcode_python_fns_8850", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple hash table that supports the following operations: `insert(key, value)`, `get(key)`, and `delete(key)`. The hash table uses a technique called 'separate chaining' to handle collisions, where each bucket is a linked list of key-value pai...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert hash_table_operations([('insert', 'a', 1), ('insert', 'b', 2), ('get', 'a')]) == [1]\", \"assert hash_table_operations([('insert', 'a', 1), ('insert', 'b', 2), ('get', 'c')]) == [None]\", \"assert hash_table_operations([('insert', 'a', 1), ('insert', 'a', 2)...
{ "split": "train", "index": 84027, "acecode_id": "oss_22349", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that initializes a logger with a specified logging level. The function should take an integer argument that represents the logging level, which can be one of the following values: 50 for CRITICAL, 40 for ERROR, 30 for WARNING, 20 for ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert initialize_logger(50) == 'CRITICAL'\", \"assert initialize_logger(40) == 'ERROR'\", \"assert initialize_logger(30) == 'WARNING'\", \"assert initialize_logger(20) == 'INFO'\", \"assert initialize_logger(10) == 'DEBUG'\", \"assert initialize_logger(5) == 'Inva...
{ "split": "train", "index": 84028, "acecode_id": "bigcode_python_fns_40885", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of model names as strings that represent different machine learning models. Implement a function `validate_models(model_names: List[str]) -> Tuple[bool, Dict[str, str]]` that checks if certain required models are present in the input list and returns a tupl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_models(['BaseModel', 'ElmanNet', 'LSTM1997', 'LSTM2000', 'LSTM2002']) == (True, {'BaseModel': 'BaseModel', 'ElmanNet': 'ElmanNet', 'LSTM1997': 'LSTM1997', 'LSTM2000': 'LSTM2000', 'LSTM2002': 'LSTM2002'})\", \"assert validate_models(['BaseModel', 'El...
{ "split": "train", "index": 84029, "acecode_id": "bigcode_python_fns_27536", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes two complex numbers as input and returns the result of their conjugate multiplication. The conjugate of a complex number a + bi is a - bi. The multiplication of two complex numbers (a + bi) and (c + di) is given by (ac - bd) + (ad + bc)i. Your fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert conjugate_multiplication(complex(2, 3), complex(4, -1)) == complex(11, -10)\", \"assert conjugate_multiplication(complex(0, 0), complex(1, 1)) == complex(0, 0)\", \"assert conjugate_multiplication(complex(2, -2), complex(-2, 2)) == complex(0, -8)\", \"assert...
{ "split": "train", "index": 84030, "acecode_id": "evol_28102", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given a list of numeric data, calculate the magnitude (Euclidean norm) of each sublist. The input can be a nested list of numbers or a string representation of such a list. If the input list is empty or None, return an empty list. If the input is a string, it should be in a val...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert magnitude_list([[3, 4], [1, 2, 2]]) == [5.0, 3.0]\", \"assert magnitude_list([[0, 0], [1, 1, 1]]) == [0.0, 1.7320508075688772]\", \"assert magnitude_list([[1, 2, 2], [3, 4, 0]]) == [3.0, 5.0]\", \"assert magnitude_list([]) == []\", \"assert magnitude_list(No...
{ "split": "train", "index": 84031, "acecode_id": "bigcode_python_fns_8498", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `positive_cubes_sum(lst)` that calculates the sum of cubes of both odd and even positive integers in a given list. If the input list is empty, the function should return 0. For example, `positive_cubes_sum([1, 2, 3, 4])` should return 100, and `positive_cub...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert positive_cubes_sum([1, 2, 3, 4]) == 100\", \"assert positive_cubes_sum([-1, -2, 1, 2]) == 9\", \"assert positive_cubes_sum([8, -3]) == 512\", \"assert positive_cubes_sum([0]) == 0\", \"assert positive_cubes_sum([]) == 0\", \"assert positive_cubes_sum([-10, -...
{ "split": "train", "index": 84032, "acecode_id": "evol_8943", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Design a function that accepts an array of random integers. Your task is to find and return the second smallest and the second largest numbers from the array using a single function only. You are not allowed to use any inbuilt sorting functions; you may only use if-else stateme...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_second_smallest_largest([5, 3, 9, 1, 7]) == (3, 7)\", \"assert find_second_smallest_largest([2, 2, 2, 2]) == 'List should contain at least two distinct numbers'\", \"assert find_second_smallest_largest([10]) == 'List should contain at least two distinct...
{ "split": "train", "index": 84033, "acecode_id": "evol_2054", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a string representing an email address, write a function `check_email` that checks if the email address starts with a number and ends with either '.org' or '.net'. The function should return True if both conditions are satisfied, otherwise return False.\nPlease reason ste...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_email('1user@domain.net') == True\", \"assert check_email('2example@domain.org') == True\", \"assert check_email('3test@something.net') == True\", \"assert check_email('4name@site.org') == True\", \"assert check_email('user1@domain.net') == False\", \"...
{ "split": "train", "index": 84034, "acecode_id": "evol_11054", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a simple online shopping cart. Your goal is to implement a function `shopping_cart_operations(operations: List[Tuple[str, str, int]]) -> Tuple[str, float]` that processes a sequence of operations on a shopping cart. The `operations` list will cont...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert shopping_cart_operations([('add', 'Apple', 2), ('add', 'Banana', 3), ('total', '', 0)]) == ('Apple - 2, Banana - 3', 3.50)\", \"assert shopping_cart_operations([('add', 'Apple', 1), ('remove', 'Apple', 1), ('total', '', 0)]) == ('Cart is empty', 0.00)\", \"a...
{ "split": "train", "index": 84035, "acecode_id": "oss_18986", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Develop a function that calculates the lateral surface area and volume of a cone, given the radius r and height h. The function should handle edge cases, such as when the radius or height is zero or negative, and manage floating point precision issues. The function should also ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cone_properties(0, 5) == 'The radius and height must be greater than zero'\", \"assert cone_properties(3, 0) == 'The radius and height must be greater than zero'\", \"assert cone_properties(-3, 4) == 'The radius and height must be greater than zero'\", \"ass...
{ "split": "train", "index": 84036, "acecode_id": "evol_21154", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the vertices of a graph. Your task is to create a function that takes this list and returns a new list where each element is a dictionary containing the vertex index and a boolean indicating if that vertex is positive (greater than ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_vertices([1, -2, 3]) == [{'vertex_index': 0, 'is_positive': True}, {'vertex_index': 1, 'is_positive': False}, {'vertex_index': 2, 'is_positive': True}]\", \"assert process_vertices([0, 0, 0]) == [{'vertex_index': 0, 'is_positive': False}, {'vertex_in...
{ "split": "train", "index": 84037, "acecode_id": "bigcode_python_fns_20315", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `count_subsequences(string: str, substring: str) -> (int, List[int])` that calculates the frequency and positions of a given substring in the initial string as a subsequence. Exclude overlapping cases.\nPlease reason step by step, then write a self-containe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_subsequences('abcdef', 'gh') == (0, [])\", \"assert count_subsequences('', 'abc') == (0, [])\", \"assert count_subsequences('a', 'a') == (1, [0])\", \"assert count_subsequences('a', 'b') == (0, [])\", \"assert count_subsequences('xyz', 'xyz') == (1, [0...
{ "split": "train", "index": 84038, "acecode_id": "evol_20718", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a list `socks_pile` representing a pile of socks, where each element in the list is an integer representing the color of a sock. Write a function `sockCount(socks_pile, ar)` that takes in the `socks_pile` list and another list `ar` representing a sequence of socks...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sockCount([1], [1, 1, 1]) == [3]\", \"assert sockCount([], [1, 2, 3]) == []\", \"assert sockCount([10, 20, 30], [10, 10, 20, 30, 30, 30]) == [2, 1, 3]\", \"assert sockCount([1, 2, 3], [4, 5, 6]) == [0, 0, 0]\", \"assert sockCount([1, 1, 2, 2], [1, 2, 1, 2, 3...
{ "split": "train", "index": 84039, "acecode_id": "oss_9793", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a transaction object, determine whether the previous transaction output point is considered 'null'. The transaction object has a property 'txIn' which is a list of input transactions. Each input transaction has a property 'previousOutPoint' that consists of three attribut...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert isNullOutpoint({'txIn': [{'previousOutPoint': {'index': 4294967295, 'hash': b'\\\\x00'*32, 'tree': 0}}]}) == True\", \"assert isNullOutpoint({'txIn': [{'previousOutPoint': {'index': 0, 'hash': b'\\\\x00'*32, 'tree': 0}}]}) == False\", \"assert isNullOutpoint...
{ "split": "train", "index": 84040, "acecode_id": "bigcode_python_fns_1352", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a JSON string representing user data, implement a function that parses this JSON to extract the user's name, address, phone number, and details of their transaction (transaction id, amount, date, and status). If any of these fields are missing or contain unexpected values...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_json('{\\\"data\\\":[{\\\"name\\\":\\\"John\\\",\\\"details\\\":{\\\"address\\\":\\\"123 Main St.\\\",\\\"phone\\\":\\\"000-123-4567\\\",\\\"transaction\\\":{\\\"id\\\":\\\"abc123\\\",\\\"amount\\\":500.00,\\\"date\\\":\\\"2022-01-01T00:00:00\\\",\\\"s...
{ "split": "train", "index": 84041, "acecode_id": "evol_35320", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a list of book names from a collection, implement a function `get_random_book(books: List[str]) -> str` that returns a random book name from the provided list. The input will be a list of strings where each string represents a book name. The function should return one of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_random_book(['Genesis', 'Exodus', 'Leviticus', 'Numbers', 'Deuteronomy']) in ['Genesis', 'Exodus', 'Leviticus', 'Numbers', 'Deuteronomy']\", \"assert get_random_book([]) == ''\", \"assert get_random_book(['Pride and Prejudice']) == 'Pride and Prejudice'\...
{ "split": "train", "index": 84042, "acecode_id": "bigcode_python_fns_38681", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `bank_account_operations(account_holder: str, initial_balance: float, transactions: List[Tuple[str, float]]) -> Tuple[float, int]` that simulates a simple banking system for a given account holder. The function should take in the acco...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bank_account_operations('Alice', 1000, [('deposit', 200), ('withdraw', 500), ('withdraw', 800), ('deposit', 300)]) == (1000, 3)\", \"assert bank_account_operations('Bob', 500, [('deposit', 100), ('withdraw', 200), ('withdraw', 100), ('withdraw', 50)]) == (25...
{ "split": "train", "index": 84043, "acecode_id": "oss_33723", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a list of organizations and returns a modified version of the list. Each organization is represented as a dictionary with various attributes. Your function should filter out organizations based on the following criteria...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_organizations([{'name': 'Org1', 'type': 'Non-profit', 'location': 'City A'}, {'name': 'Org2', 'type': 'For-profit', 'location': 'City B'}]) == [{'name': 'Org1', 'type': 'Non-profit', 'location': 'City A'}]\", \"assert filter_organizations([{'name': 'O...
{ "split": "train", "index": 84044, "acecode_id": "oss_10271", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function `fibonacci(n: int) -> int` that returns the nth number in the Fibonacci series. The Fibonacci series is defined as follows: the first two numbers are 0 and 1, and each subsequent number is the sum of the two preceding ones. Your implementation should effici...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci(0) == 0\", \"assert fibonacci(1) == 1\", \"assert fibonacci(2) == 1\", \"assert fibonacci(3) == 2\", \"assert fibonacci(4) == 3\", \"assert fibonacci(5) == 5\", \"assert fibonacci(6) == 8\", \"assert fibonacci(7) == 13\", \"assert fibonacci(8) == 2...
{ "split": "train", "index": 84045, "acecode_id": "evol_20775", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `word_freq_list(text: str) -> List[Tuple[Union[str, int], int]]` that generates a list of tuples containing unique words from a given text along with their frequency of occurrence. If the text contains any special characters or numbers, r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert word_freq_list('text with numbers 1234 and special chars @#$!') == [('text', 1), ('with', 1), ('numbers', 1), (49, 1), (50, 1), (51, 1), (52, 1), ('and', 1), ('special', 1), ('chars', 1), (64, 1), (35, 1), (36, 1), (33, 1)]\", \"assert word_freq_list('abc AB...
{ "split": "train", "index": 84046, "acecode_id": "evol_1683", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that generates a unique file name based on a specified file extension. The function should take a file extension as input and return a string representing the unique file name, which is created by concatenating a random UUID and th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_unique_filename('.txt') != generate_unique_filename('.txt')\", \"assert generate_unique_filename('.jpg') != generate_unique_filename('.jpg')\", \"assert generate_unique_filename('.png') != generate_unique_filename('.png')\", \"assert generate_unique...
{ "split": "train", "index": 84047, "acecode_id": "oss_22621", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `find_third_smallest(lst)` that returns the third smallest distinct number in the list. If the list contains fewer than three distinct numbers, return 'Not enough distinct elements'. Your algorithm should have a time complexity of O(n)...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_third_smallest([5, 2, 3, 1, 4]) == 3\", \"assert find_third_smallest([10, 20, 30, 10, 20]) == 30\", \"assert find_third_smallest([1, 1, 1, 1]) == 'Not enough distinct elements'\", \"assert find_third_smallest([7, 5, 5, 8, 6]) == 7\", \"assert find_third...
{ "split": "train", "index": 84048, "acecode_id": "evol_28242", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a MixNet Extra-Large model configuration. The configuration should be based on the parameters provided: `pretrained` (a boolean indicating if the model should use pretrained weights), `num_classes` (an integer representing ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_mixnet_config(True, 1000, 3) == {'model_type': 'MixNet Extra-Large', 'pretrained': True, 'num_classes': 1000, 'in_chans': 3, 'default_cfg': 'default_config'}\", \"assert generate_mixnet_config(False, 500, 1) == {'model_type': 'MixNet Extra-Large', '...
{ "split": "train", "index": 84049, "acecode_id": "bigcode_python_fns_48086", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string, determine if it is a pangram. A pangram is a sentence that contains every letter of the English alphabet (a-z) at least once, regardless of case. Implement the function `is_pangram(s: str) -> bool`, which takes a single string as input and returns `True` if the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_pangram('Pack my box with five dozen liquor jugs.') == True\", \"assert is_pangram('The quick brown fox jumps over the lazy dog') == True\", \"assert is_pangram('Hello, World!') == False\", \"assert is_pangram('The five boxing wizards jump quickly.') == T...
{ "split": "train", "index": 84050, "acecode_id": "oss_22555", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing steps taken in a game. Your task is to implement a function called `calculate_score(steps: List[int]) -> int` that calculates the total score based on the following rules: Each positive integer in the list represents a score increas...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_score([1, 2, 3]) == 6\", \"assert calculate_score([-1, -2, -3]) == 0\", \"assert calculate_score([5, -2, 1]) == 4\", \"assert calculate_score([-5, 5]) == 0\", \"assert calculate_score([0, 0, 0]) == 0\", \"assert calculate_score([10, -5, -3, 2]) == ...
{ "split": "train", "index": 84051, "acecode_id": "bigcode_python_fns_11556", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a factorial function in Python that calculates the factorial of a non-negative integer without using recursion or library functions. The function should return -1 for negative inputs and should handle the edge case of zero correctly. Your function should be defined as...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert factorial(0) == 1\", \"assert factorial(1) == 1\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", \"assert factorial(5) == 120\", \"assert factorial(6) == 720\", \"assert factorial(7) == 5040\", \"assert factorial(...
{ "split": "train", "index": 84052, "acecode_id": "evol_19691", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a positive integer n. Your task is to find the n-th prime number. A prime number is defined as a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. Implement a function `nth_prime(n: int) -> int` that returns the n-th p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert nth_prime(1) == 2\", \"assert nth_prime(2) == 3\", \"assert nth_prime(3) == 5\", \"assert nth_prime(4) == 7\", \"assert nth_prime(5) == 11\", \"assert nth_prime(10) == 29\", \"assert nth_prime(15) == 47\", \"assert nth_prime(20) == 71\", \"assert nth_prime(2...
{ "split": "train", "index": 84053, "acecode_id": "bigcode_python_fns_31926", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to calculate the number of video clips in a collection. You will receive a list of video clips represented as strings, where each string corresponds to a video clip. Your function should return the total number of video clips in the p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_num_videos(['clip1', 'clip2', 'clip3']) == 3\", \"assert get_num_videos([]) == 0\", \"assert get_num_videos(['clip1']) == 1\", \"assert get_num_videos(['clip1', 'clip2']) == 2\", \"assert get_num_videos(['clipA', 'clipB', 'clipC', 'clipD']) == 4\", \"ass...
{ "split": "train", "index": 84054, "acecode_id": "oss_24504", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of polynomial coefficients representing multiple polynomials, where each polynomial is represented by its coefficients in descending order of powers. Write a function that computes the m-th derivative of each polynomial. The function should take as input a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert polyder_vec([[1, 0, -1], [5, 3]], 3) == [[0], [0]]\", \"assert polyder_vec([[2, 0]], 0) == [[2, 0]]\", \"assert polyder_vec([[0]], 1) == [[0]]\", \"assert polyder_vec([[2, 3, 5], [0]], 0) == [[2, 3, 5], [0]]\", \"assert polyder_vec([[1, 2], [3, 4], [5]], 1) ...
{ "split": "train", "index": 84055, "acecode_id": "bigcode_python_fns_44961", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function that checks if all strings in a given array contain only uppercase letters. The function should return True if every string is composed entirely of uppercase letters, and False otherwise. You can assume that the input will always be a list of strings. For e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert are_all_uppercase(['HELLO', 'WORLD', 'TEST']) == True\", \"assert are_all_uppercase(['hello', 'WORLD', 'TEST']) == False\", \"assert are_all_uppercase(['HELLO', 'world', 'TEST']) == False\", \"assert are_all_uppercase(['HELLO', 'WORLD', 'test']) == False\", ...
{ "split": "train", "index": 84056, "acecode_id": "evol_30377", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of daily rewards represented as integers and a target day. Your task is to implement a function that returns the reward for the specified target day. If the target day exceeds the length of the rewards list, return 0. Write a function `get_daily_reward(rewa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_daily_reward([10, 20, 30], 1) == 10\", \"assert get_daily_reward([10, 20, 30], 2) == 20\", \"assert get_daily_reward([10, 20, 30], 3) == 30\", \"assert get_daily_reward([10, 20, 30], 4) == 0\", \"assert get_daily_reward([], 1) == 0\", \"assert get_daily_...
{ "split": "train", "index": 84057, "acecode_id": "bigcode_python_fns_44672", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that takes a list of strings as input and returns a new list containing only the strings that contain the letter 'e' and have an even length. If no strings meet these criteria, the function should return an empty list. Implemen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_even_length_with_e(['abc', 'def', 'ghi']) == []\", \"assert filter_even_length_with_e(['elephant', 'tiger', 'zebra']) == ['elephant']\", \"assert filter_even_length_with_e(['aaa', 'eee', 'iii', 'ooo']) == []\", \"assert filter_even_length_with_e(['a',...
{ "split": "train", "index": 84058, "acecode_id": "oss_14650", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given a list of integers representing a map layer's IDs, implement a function `show_map_layers(layer_ids: List[int]) -> None` that simulates showing each layer by its ID. The function should print 'Showing layer with ID: {layer_id}' for each layer ID provided in the list. If th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert show_map_layers([1, 2, 3]) == None\", \"assert show_map_layers([]) == None\", \"assert show_map_layers([10]) == None\", \"assert show_map_layers([5, 15, 25]) == None\", \"assert show_map_layers([100, 200, 300]) == None\", \"assert show_map_layers([1, 2, 3, 4...
{ "split": "train", "index": 84059, "acecode_id": "bigcode_python_fns_24202", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function to manage academic cycles. The function will take a list of tuples where each tuple contains the start and end years of a cycle. Your function should return a list of strings indicating the start and end years of each cycle in the format ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_cycles([(2020, 2021), (2021, 2022)]) == ['Cycle from 2020 to 2021', 'Cycle from 2021 to 2022']\", \"assert manage_cycles([(1990, 1995), (1996, 2000), (2001, 2005)]) == ['Cycle from 1990 to 1995', 'Cycle from 1996 to 2000', 'Cycle from 2001 to 2005']\"...
{ "split": "train", "index": 84060, "acecode_id": "oss_13868", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that manipulates a given string representing a variable name. The function should perform the following operations: 1. Remove any leading or trailing whitespace from the variable name. 2. Convert the variable name to lowercase. 3. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manipulate_variable_name(' tipo.colaborador ') == 'tipo_colaborador'\", \"assert manipulate_variable_name('Variable.Name') == 'variable_name'\", \"assert manipulate_variable_name(' leadingWhitespace') == 'leadingwhitespace'\", \"assert manipulate_variable_n...
{ "split": "train", "index": 84061, "acecode_id": "oss_30937", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that validates and formats a given file path string. The function should take a string input representing a file path, which may contain invalid characters for either Windows or Linux file systems. Your function should remove any invalid ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_path('C:/Users/Name/Document.txt') == 'C:/Users/Name/Document.txt'\", \"assert validate_path('Z://something') == 'Z:'\", \"assert validate_path('invalid_path@#%') == 'invalid_path'\", \"assert validate_path('Z:') == 'Z:'\", \"assert validate_path('i...
{ "split": "train", "index": 84062, "acecode_id": "bigcode_python_fns_15310", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given a list of integers and a list of indices, write a function that determines if all the integers at the specified indices are zero. Your function should return True if all specified indices point to zero, and False otherwise. The input list may contain both positive and neg...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert masks_empty([0, 0, 0, 0, 0], [0, 1, 2]) == True\", \"assert masks_empty([1, 0, 0, 0, 0], [0, 1, 2]) == False\", \"assert masks_empty([0, 2, 0, 0, 0], [0, 1, 2]) == False\", \"assert masks_empty([0, 0, 0, 0, 0], [0, 4]) == True\", \"assert masks_empty([0, 0, ...
{ "split": "train", "index": 84063, "acecode_id": "bigcode_python_fns_23444", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a non-empty array and an item (which can be either a string or an integer), and adds the item to the array while maintaining the sorted order. The function should first sort the array if it is not already sorted, then insert the item in its appro...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_to_sorted([3, 1, 2], 4) == [1, 2, 3, 4]\", \"assert add_to_sorted(['apple', 'banana'], 'cherry') == ['apple', 'banana', 'cherry']\", \"assert add_to_sorted([1, 3, 5], 4) == [1, 3, 4, 5]\", \"assert add_to_sorted(['grape', 'kiwi'], 'fig') == ['fig', 'grap...
{ "split": "train", "index": 84064, "acecode_id": "evol_23643", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the deletion of documents from a document store based on given filters. Write a function `delete_documents_by_filter(filters: Dict[str, List[str]]) -> bool` that takes in a dictionary representing filters and returns a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert delete_documents_by_filter({'name': ['some', 'more'], 'category': ['only_one']}) == True\", \"assert delete_documents_by_filter({'name': ['test1', 'test2'], 'category': []}) == True\", \"assert delete_documents_by_filter({'category': ['general']}) == True\",...
{ "split": "train", "index": 84065, "acecode_id": "bigcode_python_fns_49839", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of source file paths and a dictionary that maps file extensions to their corresponding compilation options. Write a Python function `identify_and_compile_sources` that identifies the source files with extensions listed in the dictionary and returns a list o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert identify_and_compile_sources(['file1.cpp', 'file2.c', 'file3.cpp', 'file4.py'], {'.cpp': 'compile_cpp', '.c': 'compile_c'}) == ['file1.o', 'file2.o', 'file3.o']\", \"assert identify_and_compile_sources(['test1.java', 'test2.c', 'test3.cs'], {'.c': 'compile_c...
{ "split": "train", "index": 84066, "acecode_id": "oss_28930", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `new_beggar` that takes in a list of integers representing the amount of money each fighter has and an integer `beggar_count` representing the number of beggars. The function should redistribute the money among the beggars so that eac...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert new_beggar([10, 20, 30], 1) == [60]\", \"assert new_beggar([], 5) == [0, 0, 0, 0, 0]\", \"assert new_beggar([0, 0, 0, 0], 3) == [0, 0, 0]\", \"assert new_beggar([1, 1, 1, 1, 1], 5) == [1, 1, 1, 1, 1]\", \"assert new_beggar([10], 1) == [10]\", \"assert new_be...
{ "split": "train", "index": 84067, "acecode_id": "oss_9628", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are developing a simple text-based application that responds to user commands. Implement a function `process_command(command)` that takes a single character input `command` and returns a string response based on the following rules: \n- If the command is 'x' or 'y', the fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_command('x') == 'Terminate process'\", \"assert process_command('y') == 'Terminate process'\", \"assert process_command('s') == 'Start process'\", \"assert process_command('a') == 'Unknown command'\", \"assert process_command('b') == 'Unknown command...
{ "split": "train", "index": 84068, "acecode_id": "oss_27371", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that validates a given URI string. A valid URI string must start with either 'http://' or 'https://', followed by at least one character. Your function should take a string as input and return True if the URI is valid, and False otherwise...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_uri('http://example.com') == True\", \"assert is_valid_uri('https://secure-site.org') == True\", \"assert is_valid_uri('ftp://not-valid.com') == False\", \"assert is_valid_uri('http://') == False\", \"assert is_valid_uri('https://') == False\", \"as...
{ "split": "train", "index": 84069, "acecode_id": "bigcode_python_fns_33450", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python class that represents a device and its various attributes. The class should have a constructor that initializes the attributes `name` and `serial_number`. Additionally, you need to implement a method `is_device` that returns `True` if t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert Device('Device1', '12345').is_device() == True\", \"assert Device('Device2', '67890').is_device() == True\", \"assert isinstance(Device('Device3', '11111'), Device) == True\", \"assert Device('Device4', '22222').is_device() == True\", \"assert Device('Device...
{ "split": "train", "index": 84070, "acecode_id": "oss_6507", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Implement a function that takes an HTML string as input and returns a structured JSON object representing the HTML content. Each HTML element should be represented as a nested dictionary containing: a `tag` key with its name as the value, an `attributes` key with a dictionary o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_html_to_json('<html><body><h1 class=\\\"header\\\">Hello World!</h1><p id=\\\"intro\\\">Welcome to the website.</p></body></html>') == {'html': {'attributes': {}, 'children': [{'body': {'attributes': {}, 'children': [{'h1': {'attributes': {'class': 'he...
{ "split": "train", "index": 84071, "acecode_id": "evol_15636", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the submission of a molecule to a dataset. The function should accept the following parameters: a dataset represented as a dictionary, a string representing the base entry name of the molecule, a dictionary representing...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert submit_molecule({}, 'molecule_A', {'property': 'value'}, 1) == ('molecule_A-1', True)\", \"assert submit_molecule({'molecule_A-1': {'property': 'value'}}, 'molecule_A', {'property': 'value'}, 1) == ('molecule_A-1', False)\", \"assert submit_molecule({}, 'mol...
{ "split": "train", "index": 84072, "acecode_id": "bigcode_python_fns_13757", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that checks if a given string is a palindrome, considering only alphanumeric characters and ignoring cases. The function should ignore any special characters and white spaces in the input string. Return true if it is a palindrome, otherwise return false.\nPleas...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_palindrome('racecar') == True\", \"assert is_palindrome('A man, a plan, a canal: Panama') == True\", \"assert is_palindrome('No lemon, no melon') == True\", \"assert is_palindrome('Was it a car or a cat I saw?') == True\", \"assert is_palindrome('') == Tr...
{ "split": "train", "index": 84073, "acecode_id": "evol_23281", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a one-dimensional list of integers representing the heights of a series of consecutive bars in a histogram. Your task is to implement a function that performs linear resampling on these heights. The function should take an input list of heights and a specified num...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert linear_resample([1, 3], 5) == [1.0, 1.5, 2.0, 2.5, 3.0]\", \"assert linear_resample([1, 5], 3) == [1.0, 3.0, 5.0]\", \"assert linear_resample([2, 8], 4) == [2.0, 4.0, 6.0, 8.0]\", \"assert linear_resample([4, 4], 2) == [4.0, 4.0]\", \"assert linear_resample(...
{ "split": "train", "index": 84074, "acecode_id": "bigcode_python_fns_11724", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given a list of integers, your task is to write a Python function that calculates the sum of these integers and returns the result. The function should take a single parameter, which is a list of integers, and it should return a single integer representing the sum of the intege...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_integers([5, 10, 15, 20]) == 50\", \"assert sum_of_integers([-1, -2, -3]) == -6\", \"assert sum_of_integers([0, 0, 0]) == 0\", \"assert sum_of_integers([1]) == 1\", \"assert sum_of_integers([-5, 5]) == 0\", \"assert sum_of_integers([100, 200, 300]) ==...
{ "split": "train", "index": 84075, "acecode_id": "oss_13166", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a function to generate a matrix with dimensions of m x n, where each element in the matrix is initialized to zero. The function should return this matrix. The dimensions are provided as two integers m (rows) and n (columns).\nPlease reason step by step, then write a self...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert print_matrix(4, 5) == [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]]\", \"assert print_matrix(1, 1) == [[0]]\", \"assert print_matrix(2, 3) == [[0, 0, 0], [0, 0, 0]]\", \"assert print_matrix(3, 2) == [[0, 0], [0, 0], [0, 0]]\", \"assert...
{ "split": "train", "index": 84076, "acecode_id": "evol_866", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `generate_multiplication_table(n: int) -> List[str]` that generates the multiplication table for the integer `n` from 1 to 10. The function should return the multiplication table formatted as a list of strings, where each string represents a line in the table. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_multiplication_table(5) == ['1 x 5 = 5', '2 x 5 = 10', '3 x 5 = 15', '4 x 5 = 20', '5 x 5 = 25', '6 x 5 = 30', '7 x 5 = 35', '8 x 5 = 40', '9 x 5 = 45', '10 x 5 = 50']\", \"assert generate_multiplication_table(1) == ['1 x 1 = 1', '2 x 1 = 2', '3 x 1...
{ "split": "train", "index": 84077, "acecode_id": "oss_9136", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of GitHub repositories, where each repository is represented as a dictionary containing its name and a list of star counts. Your task is to implement a function that calculates the total number of stars for each repository and returns the results as a dicti...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_total_stars([{'name': 'repo1', 'stars': [1, 2, 3]}, {'name': 'repo2', 'stars': [4, 5]}]) == {'repo1': 6, 'repo2': 9}\", \"assert calculate_total_stars([{'name': 'repoA', 'stars': []}, {'name': 'repoB', 'stars': [10, 20]}]) == {'repoA': 0, 'repoB': ...
{ "split": "train", "index": 84078, "acecode_id": "oss_11597", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of document ids in ascending order and a specific document id. Your task is to find the id of the next document in the list. If there is no next document, return the current document id. Write a function `get_next_document_id(doc_ids: List[int], document_id...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_next_document_id([1, 2, 3, 4, 5], 3) == 4\", \"assert get_next_document_id([1, 2, 3, 4, 5], 5) == 5\", \"assert get_next_document_id([1, 2, 3, 4, 5], 1) == 2\", \"assert get_next_document_id([1, 3, 5, 7, 9], 3) == 5\", \"assert get_next_document_id([1, 2...
{ "split": "train", "index": 84079, "acecode_id": "bigcode_python_fns_47955", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `harmonic_mean(num1, num2, num3)` that calculates the harmonic mean of three positive, non-zero integers provided as inputs. If any of the inputs are zero or negative, the function should return the string 'Invalid input. Please provide positive, non-zero i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert harmonic_mean(1, 2, 3) == 1.6363636363636365\", \"assert harmonic_mean(1, 1, 1) == 1.0\", \"assert harmonic_mean(8, 0, 12) == 'Invalid input. Please provide positive, non-zero integers only.'\", \"assert harmonic_mean(-1, 2, 3) == 'Invalid input. Please prov...
{ "split": "train", "index": 84080, "acecode_id": "evol_13942", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a list of votes represented as dictionaries, where each vote contains session information and voting results, write a function `filter_votes(votes: List[Dict[str, Any]], people_same: List[str], parties_same: List[str], people_different: List[str], parties_different: List[...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_votes([], [], [], [], []) == {'total': 0, 'results': []}\", \"assert filter_votes([{'session': {'name': 'Session 1', 'date': '2021-01-01', 'id': 1}, 'results': {'motion_id': 101, 'text': 'Vote 1', 'votes_for': 50, 'against': 10, 'abstain': 2, 'not_pre...
{ "split": "train", "index": 84081, "acecode_id": "bigcode_python_fns_33080", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that parses a simple XML string and extracts all elements with a specified tag name. The XML string will be well-formed and contain only a single level of tags (no nested tags). Your function should take two parameters: `xml_string`, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_xml('<bookstore><book>Harry Potter</book><book>Lord of the Rings</book></bookstore>', 'book') == ['Harry Potter', 'Lord of the Rings']\", \"assert parse_xml('<fruits><fruit>Apple</fruit><fruit>Banana</fruit></fruits>', 'fruit') == ['Apple', 'Banana']\"...
{ "split": "train", "index": 84082, "acecode_id": "oss_37164", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `file_data_range(data: bytes, start: int = None, end: int = None) -> bytes` that returns a slice of the given byte data. The function takes three parameters: a bytes object `data`, and two optional integers `start` and `end`. If `star...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert file_data_range(b'Hello, World!', 0, 5) == b'Hello'\", \"assert file_data_range(b'Hello, World!', 7, 12) == b'World'\", \"assert file_data_range(b'Hello, World!', 0, 13) == b'Hello, World!'\", \"assert file_data_range(b'Hello, World!', 5) == b', World!'\", \...
{ "split": "train", "index": 84083, "acecode_id": "oss_36523", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given an integer n, write a function that returns True if n is a prime number, and False otherwise. A prime number is defined as a number greater than 1 that has no positive divisors other than 1 and itself. Implement the function `is_prime(n: int) -> bool`.\nPlease reason step...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_prime(1) == False\", \"assert is_prime(2) == True\", \"assert is_prime(3) == True\", \"assert is_prime(4) == False\", \"assert is_prime(5) == True\", \"assert is_prime(6) == False\", \"assert is_prime(7) == True\", \"assert is_prime(8) == False\", \"asser...
{ "split": "train", "index": 84084, "acecode_id": "bigcode_python_fns_7360", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Construct a function in Python that checks if a given string is a valid hexadecimal color code. A valid hexadecimal color code starts with a '#' followed by either 3 or 6 hexadecimal digits (0-9, A-F). Implement a function named `is_valid_hex_color` that takes a single string p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_hex_color('#000') == True\", \"assert is_valid_hex_color('#FFF') == True\", \"assert is_valid_hex_color('#123456') == True\", \"assert is_valid_hex_color('#abcdef') == True\", \"assert is_valid_hex_color('#A1B2C3') == True\", \"assert is_valid_hex_c...
{ "split": "train", "index": 84085, "acecode_id": "evol_25265", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing distances between pairs of cities in the format 'City1-City2:Distance'. Each entry indicates the distance between two cities, where City1 and City2 are the names of the cities and Distance is a positive integer representing the dista...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average_distances(['New York-Los Angeles:400', 'New York-Los Angeles:300', 'New York-San Francisco:200']) == {('Los Angeles', 'New York'): 350.0, ('New York', 'San Francisco'): 200.0}\", \"assert calculate_average_distances(['Chicago-Houston:600', ...
{ "split": "train", "index": 84086, "acecode_id": "oss_8172", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function that takes a list of floats as an argument and returns the sum of all elements in the list. Additionally, calculate and return the statistical variance of the list without using any built-in Python statistics functions.\nPlease reason step by step, then ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_and_variance([0.0, 0.0, 0.0]) == (0.0, 0.0)\", \"assert sum_and_variance([10.0]) == (10.0, 0.0)\", \"assert sum_and_variance([5.0, 5.0, 5.0]) == (15.0, 0.0)\", \"assert sum_and_variance([1.5, 2.5, 3.5, 4.5, 5.5]) == (17.5, 2.0)\", \"assert sum_and_varian...
{ "split": "train", "index": 84087, "acecode_id": "evol_20897", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the ages of a group of people. Write a function `count_adults(ages: List[int]) -> int` that takes in this list and returns the number of adults in the group. An adult is defined as anyone aged 18 or older. The function should return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_adults([18, 22, 30]) == 3\", \"assert count_adults([17, 16, 15]) == 0\", \"assert count_adults([25, 15, 19, 12, 18]) == 3\", \"assert count_adults([18, 18, 18, 18]) == 4\", \"assert count_adults([17, 19, 20, 21, 16]) == 3\", \"assert count_adults([12, ...
{ "split": "train", "index": 84088, "acecode_id": "bigcode_python_fns_32996", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `day_of_week(date_string: str) -> str` that takes a date as a string in the format 'dd/mm/yyyy' and returns the corresponding day of the week for that date. The output should be the full name of the day (e.g., 'Monday', 'Tuesday', etc.).\nPlease reason step...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert day_of_week('01/01/2020') == 'Wednesday'\", \"assert day_of_week('29/02/2020') == 'Saturday'\", \"assert day_of_week('15/08/1947') == 'Friday'\", \"assert day_of_week('01/07/2000') == 'Saturday'\", \"assert day_of_week('25/12/2021') == 'Saturday'\", \"assert...
{ "split": "train", "index": 84089, "acecode_id": "evol_2845", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two integers, `a` and `b`. Implement a function `sum_two_numbers(a: int, b: int) -> int` that returns the sum of the two integers. Your function should handle both positive and negative integers. For example, if `a` is 3 and `b` is 5, the function should return 8....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_two_numbers(3, 5) == 8\", \"assert sum_two_numbers(-1, 1) == 0\", \"assert sum_two_numbers(-5, -10) == -15\", \"assert sum_two_numbers(0, 0) == 0\", \"assert sum_two_numbers(100, 200) == 300\", \"assert sum_two_numbers(-100, 100) == 0\", \"assert sum_two...
{ "split": "train", "index": 84090, "acecode_id": "bigcode_python_fns_49623", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `is_greater_than(x, y)` that takes two values, `x` and `y`, as input and returns a boolean value. The function should return `True` if `x` is greater than `y`, and `False` if `x` is less than or equal to `y`. If both `x` and `y` are `None`, the function sho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_greater_than(5, 3) == True\", \"assert is_greater_than(2, 4) == False\", \"assert is_greater_than(7, 7) == False\", \"assert is_greater_than(10.5, 9.8) == True\", \"assert is_greater_than(3.0, 3) == False\", \"assert is_greater_than('apple', 'banana') == ...
{ "split": "train", "index": 84091, "acecode_id": "bigcode_python_fns_11910", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes XML data representing the status of a network module. Your function should take a string input containing the XML data and return the status of the module based on the value contained within the `<status>` tag. The function...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_module_status('<module><status>selected pending</status></module>') == 'selected pending'\", \"assert get_module_status('<module><status>active</status></module>') == 'other status'\", \"assert get_module_status('<module><status>inactive</status></module...
{ "split": "train", "index": 84092, "acecode_id": "oss_1532", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function to manage a pet's hunger status and mood. The function should take the following parameters: a pet's name (string), age (integer), a boolean indicating if the pet is hungry, and a string indicating the current mood of the pet. It should r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_pet_hunger('Fido', 3, True, 'happy') == (False, 'happy')\", \"assert manage_pet_hunger('Whiskers', 2, False, 'excited') == (False, 'lethargic')\", \"assert manage_pet_hunger('Rex', 5, True, 'playful') == (False, 'playful')\", \"assert manage_pet_hunge...
{ "split": "train", "index": 84093, "acecode_id": "oss_35940", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a user profile URL based on the email alias and the provider type. The function should take in two parameters: a string 'provider' and a string 'email'. If the 'provider' is 'ISSUETRACKER' and the 'email' is not empty, the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert GenerateUserProfileUrl('ISSUETRACKER', 'user@example.com') == 'http://code.google.com/u/user'\", \"assert GenerateUserProfileUrl('ISSUETRACKER', 'test@gmail.com') == 'http://code.google.com/u/test'\", \"assert GenerateUserProfileUrl('OTHER_PROVIDER', 'user@e...
{ "split": "train", "index": 84094, "acecode_id": "bigcode_python_fns_30585", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates the output of multiple processes asynchronously. Each process has a unique name and can update its output message. Implement a function `simulate_process_output(process_names: List[str]) -> List[str]` that takes a li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_process_output(['Process_1']) == ['New output for Process_1']\", \"assert simulate_process_output(['Process_2']) == ['New output for Process_2']\", \"assert simulate_process_output(['Process_1', 'Process_2']) == ['New output for Process_1', 'New out...
{ "split": "train", "index": 84095, "acecode_id": "oss_30245", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a Python function that rotates an array by a specified number of positions and arranges the remaining segment of the array in descending order while preserving the order of duplicate elements. The function must manage edge cases such as an empty array, a single element a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rotate_and_sort([], 3) == []\", \"assert rotate_and_sort([1], 0) == [1]\", \"assert rotate_and_sort([1], 1) == [1]\", \"assert rotate_and_sort([1, 2, 3], 0) == [1, 2, 3]\", \"assert rotate_and_sort([1, 2, 3], 3) == [1, 2, 3]\"]}" }
{ "split": "train", "index": 84096, "acecode_id": "evol_11847", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a dictionary that maps model names to their corresponding ROC (Receiver Operating Characteristic) metrics. Each model's metrics include 'roc_auc', 'true_positive_rates', and 'false_positive_rates'. Write a function `roc_curve_auc(roc_thresholds_by_model)` that cal...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert roc_curve_auc({'model_a': {'roc_auc': 0.85, 'true_positive_rates': [0.1, 0.2], 'false_positive_rates': [0.1, 0.2]}, 'model_b': {'roc_auc': 0.90, 'true_positive_rates': [0.3, 0.4], 'false_positive_rates': [0.3, 0.4]}}) == 0.875\", \"assert roc_curve_auc({'mod...
{ "split": "train", "index": 84097, "acecode_id": "bigcode_python_fns_26479", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Implement a function to retrieve a unique list of character names from a given list of characters represented as dictionaries. Each dictionary contains a 'name' key. The function should take a list of dictionaries as input and return a list of unique character names sorted in a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_character_names([{ 'name': 'Rick Sanchez' }, { 'name': 'Morty Smith' }, { 'name': 'Rick Sanchez' }, { 'name': 'Summer Smith' }]) == ['Morty Smith', 'Rick Sanchez', 'Summer Smith']\", \"assert get_character_names([{ 'name': 'Beth Smith' }, { 'name': 'Jerr...
{ "split": "train", "index": 84098, "acecode_id": "evol_8919", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Define a function that takes two strings as arguments and returns a string composed of the unique characters that appear in both strings, in the order they first appear in the first string. If there are no common characters, return an empty string.\nPlease reason step by step, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert common_chars('apple', 'carrot') == 'a'\", \"assert common_chars('hello', 'world') == 'lo'\", \"assert common_chars('abcdef', 'ghijkl') == ''\", \"assert common_chars('abc', 'cba') == 'abc'\", \"assert common_chars('abcd', 'bcda') == 'abcd'\", \"assert common...
{ "split": "train", "index": 84099, "acecode_id": "evol_33094", "num_tests": 13 }