data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "You are given a list of URLs. Your task is to identify which of these URLs are valid RSS feed links. Implement a function `filter_rss_feeds(urls: List[str]) -> List[str]` that takes a list of URLs and returns a list of the unique valid RSS feed URLs. A URL is considered a valid... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_rss_feeds(['http://example.com/feed.rss', 'http://example.com/page.html', 'http://example.com/data.xml']) == ['http://example.com/data.xml', 'http://example.com/feed.rss']\", \"assert filter_rss_feeds(['http://example.com/invalid', 'http://example.com... | {
"split": "train",
"index": 5100,
"acecode_id": "bigcode_python_fns_12514",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating initialization perturbations for a set of variables under specific bounds. Given a list of variables represented as tuples, where each tuple contains a variable's name, its current value, its lower bound, and its upper bound, implement a function ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_perturbations([('x3', None, 0.0, 1.0, False)], 0.1, 0.1) == []\", \"assert generate_perturbations([('x4', 0.5, 0.0, 1.0, True)], 0.1, 0.1) == []\", \"assert generate_perturbations([('x5', -0.5, -1.0, 1.0, False)], 0.1, 0.1) == []\", \"assert generat... | {
"split": "train",
"index": 5101,
"acecode_id": "bigcode_python_fns_608",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that translates a given text from one language to another using a predefined mapping of translations. The function should take the input text and the target language code as parameters and return the translated text based on the pr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert translate_text('hola', 'en') == 'hello'\", \"assert translate_text('hello', 'es') == 'hola'\", \"assert translate_text('cat', 'fr') == 'cat'\", \"assert translate_text('dog', 'fr') == 'dog'\", \"assert translate_text('bonjour', 'en') == 'bonjour'\", \"assert... | {
"split": "train",
"index": 5102,
"acecode_id": "oss_22455",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that counts the occurrences of specific words in a given text string. The function should accept a string of text and a list of words as input. It should be case-insensitive, meaning 'Word' and 'word' should be treated the same. The outpu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_word_occurrences('This is a sample text, and this text is just a sample.', ['sample', 'text', 'and']) == {'sample': 2, 'text': 2, 'and': 1}\", \"assert count_word_occurrences('Hello world! Hello everyone.', ['hello', 'everyone', 'world']) == {'hello': ... | {
"split": "train",
"index": 5103,
"acecode_id": "oss_15852",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with organizing image data for a machine learning project. Implement a function `process_data` that takes in the following parameters: 1. `data_split` (string): Indicates whether the data is for training or testing. It can take the values 'training' or 'testing'.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_data('testing', ['img1', 'img2'], 'flow_folder', 'occlusion_folder', 'invalid_folder') == {'image_folders': ['img1', 'img2'], 'flow_folders': [None, None], 'occlusion_folders': [None, None], 'invalid_folders': [None, None]}\", \"assert process_data('... | {
"split": "train",
"index": 5104,
"acecode_id": "oss_14833",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function that processes a given string to either split it into components based on whitespace, semicolons, or commas, or to analyze the string for character counts. If the string consists solely of upper-case letters, return the count of characters that are located ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_data('Hello, world!') == ['Hello', 'world!']\", \"assert extract_data('Apple;Banana;Cherry') == ['Apple', 'Banana', 'Cherry']\", \"assert extract_data('One,Two,Three') == ['One', 'Two', 'Three']\", \"assert extract_data('ABCDE') == 3\", \"assert extr... | {
"split": "train",
"index": 5105,
"acecode_id": "evol_35482",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a data structure that represents a location. This structure should include the following attributes: an ID (integer) and a name (string). Write a function named 'create_location' that takes two parameters: an integer 'id' and a string 'name', and re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_location(1, 'New York') == {'id': 1, 'name': 'New York'}\", \"assert create_location(2, 'Los Angeles') == {'id': 2, 'name': 'Los Angeles'}\", \"assert create_location(3, 'Chicago') == {'id': 3, 'name': 'Chicago'}\", \"assert create_location(4, 'Housto... | {
"split": "train",
"index": 5106,
"acecode_id": "oss_20442",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, `file_paths`, representing file paths in a file system. Each path is a string that may contain directories and a file name at the end. Write a function `get_file_name(file_paths: List[str]) -> List[str]` that returns a list of file names extract... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_file_name(['/usr/local/bin/file1.txt', '/home/user/', '/etc/config.cfg']) == ['file1.txt', '', 'config.cfg']\", \"assert get_file_name(['abc/def/ghi.txt', 'folder/', 'test.txt']) == ['ghi.txt', '', 'test.txt']\", \"assert get_file_name(['/var/log/syslog'... | {
"split": "train",
"index": 5107,
"acecode_id": "bigcode_python_fns_2276",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `menu_evasion()` that simulates the clearing of a terminal screen. This function should not take any parameters and should not return any value. When called, it should print a message indicating that the screen has been cleared. The messa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert menu_evasion() == None\", \"assert print('Screen cleared!') == None\", \"assert menu_evasion() is None\", \"assert menu_evasion() == None\", \"assert menu_evasion() == None\", \"assert menu_evasion() == None\", \"assert menu_evasion() == None\", \"assert men... | {
"split": "train",
"index": 5108,
"acecode_id": "bigcode_python_fns_39380",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that counts the occurrences of a specific word in a given text passage. The function should be case insensitive and should consider only whole words. For instance, in the text 'To be or not to be, that is the question.', the word 'be' should be counted twic... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_word_occurrences('To be or not to be, that is the question.', 'be') == 2\", \"assert count_word_occurrences('Python is great. Python is fun.', 'python') == 2\", \"assert count_word_occurrences('A quick brown fox jumps over the lazy dog.', 'cat') == 0\"... | {
"split": "train",
"index": 5109,
"acecode_id": "evol_31531",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that converts a given string into its equivalent Morse code representation. The function should ignore any non-alphabetical characters and spaces, and each Morse code letter should be separated by a space. If the input string contains only spaces or non-alp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert string_to_morse('Hello') == '.... . .-.. .-.. --- '\", \"assert string_to_morse('Morse code') == '-- --- .-. ... . -.-. --- -.. . '\", \"assert string_to_morse(' A ') == '.- '\", \"assert string_to_morse('Python 3.9') == '.--. -.-- - .... --- -. '\", \"a... | {
"split": "train",
"index": 5110,
"acecode_id": "evol_14063",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Create a function `insert_entry(dictionary: Dict[str, int], entry: Tuple[str, int]) -> Dict[str, int]` that accepts a dictionary and a new entry as a tuple. The function should add the entry to the dictionary if the key does not already exist. If the key exists, the function sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert insert_entry({'circle': 7, 'square': 4}, ('triangle', 2)) == {'circle': 7, 'square': 4, 'triangle': 2}\", \"assert insert_entry({'circle': 7, 'square': 4}, ('circle', 9)) == {'circle': 7, 'square': 4}\", \"assert insert_entry({}, ('pentagon', 5)) == {'pentag... | {
"split": "train",
"index": 5111,
"acecode_id": "evol_25649",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an array of integers, `cost`, where `cost[i]` represents the expense of the `ith` step on a staircase. After paying the cost, you can ascend one or two steps. You can start your climb from the step at index `0` or the one at index `1`. Your task is to implement a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert minCostClimbingStairs([10, 15, 20]) == 15\", \"assert minCostClimbingStairs([1, 100, 1, 1, 1, 100, 1, 1, 100, 1]) == 6\", \"assert minCostClimbingStairs([0, 0, 0, 0]) == 0\", \"assert minCostClimbingStairs([10, 20, 30]) == 20\", \"assert minCostClimbingStair... | {
"split": "train",
"index": 5112,
"acecode_id": "evol_11721",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function `are_anagrams(s1: str, s2: str) -> bool` that takes two strings as input and returns True if the two strings are anagrams of each other, and False otherwise. Two strings are considered anagrams if they contain the same characters in the same frequency, rega... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert are_anagrams('listen', 'silent') == True\", \"assert are_anagrams('triangle', 'integral') == True\", \"assert are_anagrams('apple', 'papel') == True\", \"assert are_anagrams('rat', 'car') == False\", \"assert are_anagrams('A gentleman', 'Elegant man') == Tru... | {
"split": "train",
"index": 5113,
"acecode_id": "evol_29612",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of positive integers representing coin denominations and a target value. Your task is to determine whether it is possible to make the target value using the given coin denominations. You can use each coin denomination an unlimited number of times. Write a f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_make_target([1, 2, 5], 11) == True\", \"assert can_make_target([3, 6, 9], 12) == True\", \"assert can_make_target([2, 4, 8], 10) == True\", \"assert can_make_target([1, 3, 4], 6) == True\", \"assert can_make_target([5, 10, 20], 25) == True\", \"assert ca... | {
"split": "train",
"index": 5114,
"acecode_id": "oss_22833",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with identifying which algorithms are supported based on the availability of required modules and solvers. You are given a list of algorithm names. Your function should return a list of available algorithms based on the following rules: 1. If the algorithm name c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_available_algorithms(['gurobi_solver', 'gmpy2-fractions', 'other_algo'], True, True) == ['gurobi_solver', 'gmpy2-fractions', 'other_algo']\", \"assert get_available_algorithms(['gurobi_solver', 'gmpy2-fractions', 'other_algo'], False, True) == ['gmpy2-fr... | {
"split": "train",
"index": 5115,
"acecode_id": "bigcode_python_fns_24009",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `product_distribution(arr: List[int]) -> List[int]` that returns a list containing the products of all integers in the input list except the integer at the current index. The function should return a new list where each element at ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert product_distribution([1, 2, 3, 4]) == [24, 12, 8, 6]\", \"assert product_distribution([5, 10, 15]) == [150, 75, 50]\", \"assert product_distribution([1, 1, 1]) == [1, 1, 1]\", \"assert product_distribution([2, 3, 4, 5]) == [60, 40, 30, 24]\", \"assert produc... | {
"split": "train",
"index": 5116,
"acecode_id": "bigcode_python_fns_23801",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `nearest_prime(numbers: List[int], target: int) -> int` that takes a list of integers `numbers` and an integer `target`. The function should return the nearest prime number from the list to the target value. If there are two prime numbers equally close to t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert nearest_prime([3, 6, 9, 11, 15, 23, 35, 42], 20) == 23\", \"assert nearest_prime([4, 6, 8, 10], 5) == -1\", \"assert nearest_prime([2, 5, 7, 10], 6) == 5\", \"assert nearest_prime([8, 9, 10], 11) == -1\", \"assert nearest_prime([11, 13, 15], 12) == 11\", \"a... | {
"split": "train",
"index": 5117,
"acecode_id": "evol_25590",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates establishing a connection to a server. The function should take the following parameters: a string `host`, a string `user`, a string `pwd`, an integer `port`, and a boolean `ssl`. The function should return a string that in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert establish_connection('192.168.1.1', 'admin', 'password', 443, True) == 'Connected with SSL to 192.168.1.1:443 as admin'\", \"assert establish_connection('10.0.0.5', 'user', 'secret', 80, False) == 'Connected without SSL to 10.0.0.5:80 as user'\", \"assert es... | {
"split": "train",
"index": 5118,
"acecode_id": "bigcode_python_fns_14769",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_individual(nickname: str, title: str, organization: str, role: str) -> str` that takes in an individual's nickname, title, affiliated organization, and role within that organization. The function should return a string representation of the individu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_individual('Johnny', 'Dr.', 'Medhub', 'Neurologist') == 'Nickname: Johnny, Title: Dr., Organization: Medhub, Role: Neurologist'\", \"assert create_individual('Sara', 'Ms.', 'TechCorp', 'Software Engineer') == 'Nickname: Sara, Title: Ms., Organization:... | {
"split": "train",
"index": 5119,
"acecode_id": "evol_27843",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that accepts a dictionary where the keys are English words and the values are their meanings. The function must return the key that contains the maximum number of consonant letters. If there are multiple keys with the same maximum number of consonants, r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_consonants({'hello': 'a greeting', 'world': 'the earth', 'python': 'a programming language'}) == 'python'\", \"assert max_consonants({'bicycle': 'a two-wheeled vehicle', 'car': 'a four-wheeled vehicle'}) == 'bicycle'\", \"assert max_consonants({'cucumber... | {
"split": "train",
"index": 5120,
"acecode_id": "evol_6941",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to validate a given cryptographic public key represented as a base64-encoded string. Your function should check whether the provided public key is valid based on the following criteria: 1. The key must consist only of alphanumeric cha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_public_key('U29tZSBkYXRhIGluIGJhc2U2NCBlbmNvZGluZw==') == True\", \"assert validate_public_key('SGVsbG8sIFdvcmxkIQ==') == True\", \"assert validate_public_key('SGVsbG8gV29ybGQ=') == True\", \"assert validate_public_key('U29tZSBkYXRh') == True\", \"a... | {
"split": "train",
"index": 5121,
"acecode_id": "oss_10047",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a list of mutual information data points represented as a dictionary where each key is a tuple (layer, epoch) and each value is a tuple (I_X_T, I_T_Y), write a function that processes this data to generate a summary of the maximum and minimum mutual information values for... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert summarize_mutual_information({(0, 0): (0.0, 0.0)}) == {0: {'max': 0.0, 'min': 0.0}}\", \"assert summarize_mutual_information({(1, 0): (0.5, 0.5), (1, 1): (0.5, 0.5), (1, 2): (0.5, 0.5)}) == {1: {'max': 0.5, 'min': 0.5}}\", \"assert summarize_mutual_informati... | {
"split": "train",
"index": 5122,
"acecode_id": "bigcode_python_fns_10596",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given a two-dimensional list of integers (matrix), write a function `flatten_matrix(matrix)` that flattens the matrix into a one-dimensional list containing all the integers in the same order. For example, if the input matrix is [[1, 2], [3, 4]], the output should be [1, 2, 3, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert flatten_matrix([[1, 2], [3, 4]]) == [1, 2, 3, 4]\", \"assert flatten_matrix([[5, 6], [7, 8], [9]]) == [5, 6, 7, 8, 9]\", \"assert flatten_matrix([[1], [2], [3], [4]]) == [1, 2, 3, 4]\", \"assert flatten_matrix([[10, 20], [30, 40], [50, 60], [70]]) == [10, 20... | {
"split": "train",
"index": 5123,
"acecode_id": "evol_27481",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representation of an XML snippet that contains a citation. The XML snippet has the format `<cit type=\"<type_value>\"><quote><quoted_text></quote></cit>`, where `<type_value>` is a string representing the type of citation and `<quoted_text>` is the text b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_citation('<cit type=\\\"trans\\\"><quote>snack</quote></cit>') == {'type': 'trans', 'quote': 'snack'}\", \"assert parse_citation('<cit type=\\\"quote\\\"><quote>Hello, world!</quote></cit>') == {'type': 'quote', 'quote': 'Hello, world!'}\", \"assert pa... | {
"split": "train",
"index": 5124,
"acecode_id": "oss_34220",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to calculate the average loss of examples in a mini-batch. The average loss is computed as the mean of the absolute differences between the prediction scores and the true labels. You are given a 2D list `predictions`, where each inner... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_loss([[0.0, 0.0], [0.0, 0.0]], [0.0, 0.0]) == 0.0\", \"assert calculate_average_loss([[1.0, 2.0], [2.0, 3.0]], [2.0, 2.0]) == 1.0\", \"assert calculate_average_loss([[4.0, 5.0], [6.0, 7.0]], [5.0, 6.0]) == 1.0\", \"assert calculate_average_... | {
"split": "train",
"index": 5125,
"acecode_id": "oss_9091",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the generation of update plans for a system based on a list of update modules. Each module is represented by a callable function that may return a boolean value indicating whether to continue processing the update or to sto... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_update_plans({'updateModuleList': [lambda x: False, lambda x: False]}) == False\", \"assert generate_update_plans({'updateModuleList': [lambda x: False, lambda x: True]}) == True\", \"assert generate_update_plans({'updateModuleList': [lambda x: True... | {
"split": "train",
"index": 5126,
"acecode_id": "bigcode_python_fns_14976",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating SQL Alchemy model definitions from a dictionary of table names and their corresponding column names. Write a function `generate_sqlalchemy_models` that takes a dictionary `table_columns` as input, where the keys are table names in lowercase and th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_sqlalchemy_models({'user': ['id', 'username', 'email']}) == \\\"class UserTable(Base):\\\\n __tablename__ = 'user'\\\\n\\\\n id = Column(String(250))\\\\n username = Column(String(250))\\\\n email = Column(String(250))\\\\n\\\\n\\\"\", \... | {
"split": "train",
"index": 5127,
"acecode_id": "oss_23144",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dataset from an Eddy Covariance tower that contains measurements of Net Radiation (NETRAD), Heat (H), and Latent Energy (LE) over time. Your task is to implement a function `calculate_averages` that takes the dataset and calculates the daily average for each mea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_averages([{'datetime': '2023-10-01T00:00:00', 'NETRAD': 100, 'H': 10, 'LE': 5}, {'datetime': '2023-10-01T12:00:00', 'NETRAD': 200, 'H': 20, 'LE': 10}, {'datetime': '2023-10-02T00:00:00', 'NETRAD': 150, 'H': 15, 'LE': 7}]) == {'2023-10-01': {'NETRAD... | {
"split": "train",
"index": 5128,
"acecode_id": "bigcode_python_fns_18815",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a ransom note string and a string containing letters from magazines, write a function that will return true if the ransom note can be constructed from the magazines; otherwise, it will return false. Additionally, the function should return the minimum number of magazines ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert canConstruct('a', 'b') == (False, 0)\", \"assert canConstruct('aa', 'ab') == (False, 0)\", \"assert canConstruct('aa', 'aab') == (True, 1)\", \"assert canConstruct('', 'abc') == (True, 0)\", \"assert canConstruct('abc', 'abc') == (True, 1)\", \"assert canCon... | {
"split": "train",
"index": 5129,
"acecode_id": "evol_34604",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries representing channels in a workspace. Each channel is represented by a dictionary with two keys: 'name' (a string representing the name of the channel) and 'is_general' (a boolean indicating whether the channel is the general channel or not)... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_general_channel([{'name': 'channel1', 'is_general': False}, {'name': 'channel2', 'is_general': False}]) == None\", \"assert find_general_channel([{'name': 'channel1', 'is_general': True}, {'name': 'channel2', 'is_general': False}]) == {'name': 'channel1... | {
"split": "train",
"index": 5130,
"acecode_id": "bigcode_python_fns_40969",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `string_to_integer(s: str) -> int` that converts a given string `s` to an integer. The function should handle the following requirements: \n- Ignore any leading whitespace characters in the input string. \n- Handle the sign of the integer (positive or negat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert string_to_integer('42') == 42\", \"assert string_to_integer(' -42') == -42\", \"assert string_to_integer('4193 with words') == 4193\", \"assert string_to_integer('words and 987') == 0\", \"assert string_to_integer(' +123') == 123\", \"assert string_to_in... | {
"split": "train",
"index": 5131,
"acecode_id": "oss_22941",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that checks if a given element exists in a linked list. The linked list is represented by an array of integers. The function should return True if the element is found, otherwise return False. Write a function called `search_in_linked_list` that takes two a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert search_in_linked_list([2, 5, 7, 9, 11], 11) == True\", \"assert search_in_linked_list([2, 5, 7, 9, 11], 5) == True\", \"assert search_in_linked_list([2, 5, 7, 9, 11], 2) == True\", \"assert search_in_linked_list([2, 5, 7, 9, 11], 9) == True\", \"assert searc... | {
"split": "train",
"index": 5132,
"acecode_id": "evol_5455",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing heights, write a function `reslice_image_heights(heights: List[int], numslices_above: int, numslices_below: int) -> List[int]` that simulates reslicing an image along a surface defined by the heights. The function should return a new list o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reslice_image_heights([0, 0, 0], 1, 1) == [0.0, 0.0, 0.0]\", \"assert reslice_image_heights([10, 20, 30], 0, 0) == [10, 20, 30]\", \"assert reslice_image_heights([1], 1, 1) == [1]\", \"assert reslice_image_heights([2, 4, 6], 1, 1) == [3.0, 4.0, 5.0]\", \"ass... | {
"split": "train",
"index": 5133,
"acecode_id": "bigcode_python_fns_28",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a function `search_podcasts(podcasts: List[Podcast], query: str) -> List[Podcast]` that takes a list of podcasts and a search query as input, and returns a list of podcasts that match the query in either the title or description. The search should be case-insensitive ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert search_podcasts([], 'test') == []\", \"assert search_podcasts([Podcast('Test Podcast', 'This is a test description', datetime(2023, 1, 1), 'link1', 'transcript1', 'channel1')], 'test') == [Podcast('Test Podcast', 'This is a test description', datetime(2023, ... | {
"split": "train",
"index": 5134,
"acecode_id": "evol_27518",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary of lists, where the keys are strings and the values are lists of integers. Your task is to implement a function `transform_data` that takes this dictionary as input and returns a new dictionary where each list has been transformed by filtering out val... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_data({'a': [5, 10, 15], 'b': [20, 3, 18]}) == {'a': [10, 15], 'b': [20, 18]}\", \"assert transform_data({'x': [1, 2, 3], 'y': [10, 20, 30]}) == {'x': [], 'y': [10, 20, 30]}\", \"assert transform_data({'p': [9, 8, 7], 'q': [11, 12, 13]}) == {'p': []... | {
"split": "train",
"index": 5135,
"acecode_id": "oss_9154",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the configuration of a machine learning model. The function should accept parameters for model type, number of hidden units, number of hidden layers, depth of stochastic layers, dropout rate, and other relevant options. Imp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert configure_model('vae', 128, 4, 2, 0.5, 'normal') == {'model': 'vae', 'hdim': 128, 'nlayers': 4, 'depth': 2, 'dropout': 0.5, 'prior': 'normal'}\", \"assert configure_model('conv-vae') == {'model': 'conv-vae', 'hdim': 64, 'nlayers': 3, 'depth': 3, 'dropout': 0... | {
"split": "train",
"index": 5136,
"acecode_id": "bigcode_python_fns_47691",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that checks if a given string is a palindrome. A palindrome is a string that reads the same backward as forward, ignoring spaces, punctuation, and capitalization. Create a function `is_palindrome(s)` where: - `s`: A string that may... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_palindrome('A man, a plan, a canal, Panama!') == True\", \"assert is_palindrome('racecar') == True\", \"assert is_palindrome('Hello, World!') == False\", \"assert is_palindrome('No lemon, no melon') == True\", \"assert is_palindrome('Was it a car or a cat... | {
"split": "train",
"index": 5137,
"acecode_id": "oss_15261",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string that may contain various characters, including both integers and floating-point numbers. Your task is to implement a function that takes a string as input and returns a list of all the floating-point numbers present in the input string, in the order they ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_floats('The price is $12.50 and the discount is 15%, the total is $10.63') == [12.50, 15.0, 10.63]\", \"assert extract_floats('No floats here! Just some text.') == []\", \"assert extract_floats('Negative floats: -1.5 and -2.75 are here') == [-1.5, -2... | {
"split": "train",
"index": 5138,
"acecode_id": "oss_20981",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a non-negative integer n, return the square of the integer n. Implement the function `square(n: int) -> int` that calculates the result.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block."
... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert square(0) == 0\", \"assert square(1) == 1\", \"assert square(2) == 4\", \"assert square(3) == 9\", \"assert square(4) == 16\", \"assert square(5) == 25\", \"assert square(6) == 36\", \"assert square(7) == 49\", \"assert square(8) == 64\", \"assert square(9) ... | {
"split": "train",
"index": 5139,
"acecode_id": "evol_32807",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes two lists of dictionaries representing repositories and their issues/pull requests, and returns a dictionary mapping each issue title to a boolean indicating whether it is a pull request or not. Each repository is represented a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_issues_for_org([{'issues': [{'title': 'Issue 1'}, {'title': 'Issue 2'}], 'pull_requests': [{'title': 'PR 1'}]}]) == {'Issue 1': False, 'Issue 2': False, 'PR 1': True}\", \"assert get_issues_for_org([{'issues': [{'title': 'Issue 1'}, {'title': 'Issue 2'}]... | {
"split": "train",
"index": 5140,
"acecode_id": "bigcode_python_fns_1232",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `generate_exercise_message(exercise: str, repetitions_range: Tuple[int, int], message_prefix: str, minutes_to_next: Optional[int] = None) -> str`. This function generates a message indicating how many repetitions of an exercise should be ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_exercise_message('Push-ups', (10, 15), 'Do') == '12 Do Push-ups RIGHT NOW!'\", \"assert generate_exercise_message('Squats', (5, 10), 'Time to') == '7 Time to Squats RIGHT NOW!'\", \"assert generate_exercise_message('Jumping Jacks', (20, 30), 'Start'... | {
"split": "train",
"index": 5141,
"acecode_id": "bigcode_python_fns_29862",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a list of sentences. Your task is to implement a function `clean_and_tokenize(sentences: List[str]) -> List[str]` that processes the list of sentences in the following way: \n1. Convert each sentence to lowercase. \n2. Remove all non-alphanumeric characters from t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert clean_and_tokenize(['Hello, World!!', 'This is a test.']) == ['hello world', 'this is a test']\", \"assert clean_and_tokenize(['Python is great!', ' Leetcode is fun! ']) == ['python is great', 'leetcode is fun']\", \"assert clean_and_tokenize([' A qu... | {
"split": "train",
"index": 5142,
"acecode_id": "bigcode_python_fns_8390",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `simulate_dispersion_image` that simulates the generation of a dispersed image based on input parameters. The function takes the following parameters: \n\n- `incat` (string): the name of the model object table.\n- `config` (string): the c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_dispersion_image('model_table.txt', 'config.cfg', None, None, 'model_spectra.txt', 'model_images.txt', 100, 100, 10.0, 0.0) == {'status': 0, 'dispim_name': 'model_table_slitless.fits', 'final_dirima_path': 'model_table_direct.fits'}\", \"assert simu... | {
"split": "train",
"index": 5143,
"acecode_id": "bigcode_python_fns_15148",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a hexadecimal number, implement a function that converts it to its binary representation. The function should handle edge cases such as empty strings, None inputs, and invalid hexadecimal characters by returning appropriate error messages. The functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hex_to_bin('3E') == '00111110'\", \"assert hex_to_bin('0') == '0000'\", \"assert hex_to_bin('A') == '1010'\", \"assert hex_to_bin('F') == '1111'\", \"assert hex_to_bin('10') == '00010000'\", \"assert hex_to_bin('1F') == '00011111'\", \"assert hex_to_bin('2A'... | {
"split": "train",
"index": 5144,
"acecode_id": "evol_7892",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a list of city names, implement a function that finds the shortest city name from the list. If there are multiple city names with the same shortest length, return them all in the order they appear in the list. The function should return an empty list if the input list is ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shortest_city_name(['Amsterdam', 'Oslo', 'Brisbane', 'Cairo', 'Rio', 'Paris', 'Havana']) == ['Rio']\", \"assert shortest_city_name(['A', 'B', 'C', 'D']) == ['A', 'B', 'C', 'D']\", \"assert shortest_city_name(['Seattle', 'Miami', 'Dallas', 'Austin']) == ['Mia... | {
"split": "train",
"index": 5145,
"acecode_id": "evol_496",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a list of snippets represented as dictionaries with 'startpos' and 'endpos' keys, and a list of states represented as lists of integers, implement a function `encode_snippets(snippets: List[Dict[str, int]], states: List[List[int]]) -> List[Dict[str, List[int]]]` that modi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert encode_snippets([{'startpos': 0, 'endpos': 1}], [[1, 2], [3, 4]]) == [{'startpos': 0, 'endpos': 1, 'embedding': [1, 2, 3, 4]}]\", \"assert encode_snippets([{'startpos': 0, 'endpos': 0}], [[5, 6]]) == [{'startpos': 0, 'endpos': 0, 'embedding': [5, 6, 5, 6]}]\... | {
"split": "train",
"index": 5146,
"acecode_id": "bigcode_python_fns_29419",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string `path` representing a path to a resource and a string `error` which represents an error message. Your task is to implement a function `is_fundamental_error(path: str, error: str) -> bool` that returns `True` if the error is not related to any fields in th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_fundamental_error('/user/data', 'field not found') == False\", \"assert is_fundamental_error('/user/data', 'unknown type') == True\", \"assert is_fundamental_error('/user/data', 'field access denied') == False\", \"assert is_fundamental_error('/user/data'... | {
"split": "train",
"index": 5147,
"acecode_id": "bigcode_python_fns_1156",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that determines if a recipe meets certain conditions based on its attributes. You are given a recipe's ID, type, time spent to prepare, a list of required ingredient IDs, and a list of corresponding quantities for those ingredients. Your ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_recipe_conditions(1, 'main course', 45, [101, 102, 103], [2, 1, 3]) == True\", \"assert check_recipe_conditions(3, 'appetizer', 61, [301], [1]) == False\", \"assert check_recipe_conditions(6, 'appetizer', 70, [601], [2]) == False\", \"assert check_reci... | {
"split": "train",
"index": 5148,
"acecode_id": "oss_13051",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the processing of RFID card readings. The function should accept a list of strings, where each string represents an RFID card identifier. The function must return the total number of unique RFID card readings processed.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_rfid_cards(['1234567890', '0987654321', '1234567890']) == 2\", \"assert count_unique_rfid_cards(['1111111111', '2222222222', '3333333333']) == 3\", \"assert count_unique_rfid_cards(['abcd', 'abcd', 'efgh', 'ijkl', 'efgh']) == 3\", \"assert count... | {
"split": "train",
"index": 5149,
"acecode_id": "oss_28651",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a function `benchmark_op(op: Callable[[], Any], burn_iters: int = 2, min_iters: int = 10) -> Any`. This function simulates the benchmarking of an operation `op`, which is a callable that performs some computation. The function runs the operation `op` after initial... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert benchmark_op(lambda: sum(range(100)), 2, 10) is not None\", \"assert benchmark_op(lambda: len('Hello, World!'), 2, 10) is not None\", \"assert benchmark_op(lambda: [x**2 for x in range(1000)], 2, 10) is not None\", \"assert benchmark_op(lambda: sum([x for x ... | {
"split": "train",
"index": 5150,
"acecode_id": "bigcode_python_fns_17537",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes an input string and processes it based on its type: integer, character, or array. If the input is an integer, multiply it by 5 and categorize the result: if it's a multiple of 3, return 'Multiple of 3'; if it's a multiple of 4, return 'Multiple o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_input('6') == 'Multiple of 3'\", \"assert process_input('8') == 'Multiple of 4'\", \"assert process_input('10') == 'Even Number'\", \"assert process_input('d') == 'ASCII Multiple of 4'\", \"assert process_input('[1,2,3]') == 'Array Positive'\", \"ass... | {
"split": "train",
"index": 5151,
"acecode_id": "evol_33149",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are working on a project that involves training a neural network. As part of the training process, you need to implement a function that simulates restoring the weights of the model from a previously saved checkpoint. The function should take a string representing the check... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert restore_weights('/path/to/your/checkpoint/model.ckpt') == 'Weights restored from /path/to/your/checkpoint/model.ckpt'\", \"assert restore_weights('/another/path/checkpoint.ckpt') == 'Weights restored from /another/path/checkpoint.ckpt'\", \"assert restore_we... | {
"split": "train",
"index": 5152,
"acecode_id": "oss_5197",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, implement a function that returns a new array where each element at index i is the sum of all the elements in the original array excluding the element at index i. The function should only take one parameter, the input array. For example, if the input... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_except_self([1, 2, 3, 4, 5]) == [14, 13, 12, 11, 10]\", \"assert sum_except_self([0, 0, 0]) == [0, 0, 0]\", \"assert sum_except_self([1]) == [0]\", \"assert sum_except_self([5, 10, 15]) == [25, 20, 15]\", \"assert sum_except_self([100, 200, 300]) == [500... | {
"split": "train",
"index": 5153,
"acecode_id": "evol_25760",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string consisting of alphabetical characters. Your task is to implement a function that checks if the string is a palindrome. A palindrome is a string that reads the same backward as forward. For example, 'radar' is a palindrome, while 'hello' is not. The functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_palindrome('radar') == True\", \"assert is_palindrome('hello') == False\", \"assert is_palindrome('level') == True\", \"assert is_palindrome('world') == False\", \"assert is_palindrome('a') == True\", \"assert is_palindrome('ab') == False\", \"assert is_p... | {
"split": "train",
"index": 5154,
"acecode_id": "bigcode_python_fns_40027",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a fitness tracker. The function should take a list of exercise activity strings and return a dictionary where the keys are the exercise activities and the values are the corresponding total durations in minutes. Each ex... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert track_exercises(['running', 'cycling', 'running']) == {'running': 2, 'cycling': 1}\", \"assert track_exercises(['swimming', 'yoga', 'swimming', 'yoga', 'yoga']) == {'swimming': 2, 'yoga': 3}\", \"assert track_exercises(['weightlifting', 'running', 'running',... | {
"split": "train",
"index": 5155,
"acecode_id": "oss_34729",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two multidimensional arrays, `varcube` and `tacube`, where `varcube` represents a variable cube with a specific dimension for 'air_pressure', write a function `reshape_data(varcube: List[List[List[float]]], tacube: List[List[List[float]]]) -> List[List[List[float]]]` that... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reshape_data([[[1, 2], [3, 4]], [[5, 6], [7, 8]]], [[[9, 10], [11, 12]], [[13, 14], [15, 16]]]) == [[[9, 10], [11, 12]], [[13, 14], [15, 16]]]\", \"assert reshape_data([[[1, 2]], [[3, 4]]], [[[5, 6]], [[7, 8]]]) == [[[5, 6]], [[7, 8]]]\", \"assert reshape_da... | {
"split": "train",
"index": 5156,
"acecode_id": "bigcode_python_fns_16561",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `train_batches(train_primary: List[List[int]], train_ss: List[List[int]], ss_padding_index: int) -> List[List[int]]` that simulates the batching process used in training a model. The function should take in a list of primary training ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert train_batches([[1,2,3],[4,5,6],[7,8,9]], [[1,0,1],[0,1,0],[1,1,0]], 0) == [[[1,0,1],[0,1,0],[1,1,0]]]\", \"assert train_batches([[1]], [[1]], 1) == [[[1]]]\", \"assert train_batches([[1,2,3],[4,5,6]], [[1,0,1],[0,1,0]], 0) == [[[1,0,1],[0,1,0]]]\", \"assert ... | {
"split": "train",
"index": 5157,
"acecode_id": "bigcode_python_fns_30796",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given an item represented by a dictionary with two keys: 'id' (a string in the format 'type:identifier') and 'handle' (a string), implement a function that returns a Markdown URL for the item. The URL should be formatted as 'https://www.w3.org/TR/WCAG21#<identifier>', where <id... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert item_url({'id': 'type:identifier', 'handle': 'example'}) == 'https://www.w3.org/TR/WCAG21#identifier'\", \"assert item_url({'id': 'type:123', 'handle': 'example'}) == 'https://www.w3.org/TR/WCAG21#123'\", \"assert item_url({'id': 'type:abc', 'handle': 'examp... | {
"split": "train",
"index": 5158,
"acecode_id": "bigcode_python_fns_43191",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that initializes a simple in-memory representation of a knowledge base. Your function should create two tables: 'users' and 'posts'. Each user should have a unique identifier, a username, and an email. Each post should have a unique ident... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_knowledgebase() == {'users': [{'id': 1, 'username': 'user1', 'email': 'user1@example.com'}, {'id': 2, 'username': 'user2', 'email': 'user2@example.com'}], 'posts': [{'id': 1, 'title': 'Post 1', 'content': 'Content of post 1', 'user_id': 1}, {'id':... | {
"split": "train",
"index": 5159,
"acecode_id": "oss_35531",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that takes a string as input and returns the string modified by converting all characters to uppercase. Your function should handle standard ASCII characters and should not manipulate any non-ASCII characters. Implement the function `conve... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_uppercase('Hello, World!') == 'HELLO, WORLD!'\", \"assert convert_to_uppercase('python is awesome') == 'PYTHON IS AWESOME'\", \"assert convert_to_uppercase('12345') == '12345'\", \"assert convert_to_uppercase('') == ''\", \"assert convert_to_upper... | {
"split": "train",
"index": 5160,
"acecode_id": "oss_15761",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an input dictionary and a separate input list of specific keys, write a function that looks for the existence of the keys within the dictionary. If they exist, the function should return a new dictionary where the keys are the found keys and the values are their associate... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert look_up_and_reverse({'one': 1, 'two': 21, 'three': 3}, ['two', 'five', 'nine']) == {'two': 12}\", \"assert look_up_and_reverse({'apple': 123, 'banana': 456}, ['apple', 'banana']) == {'apple': 321, 'banana': 654}\", \"assert look_up_and_reverse({'cat': 12, 'd... | {
"split": "train",
"index": 5161,
"acecode_id": "evol_5896",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the sum of two numbers. However, if the sum of the two numbers is greater than zero, you should return the sum. If the sum of the two numbers is less than or equal to zero, you should return zero instead. Write a funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_sum(3, 4) == 7\", \"assert calculate_sum(-5, 3) == 0\", \"assert calculate_sum(0, 0) == 0\", \"assert calculate_sum(10, 5) == 15\", \"assert calculate_sum(-1, -1) == 0\", \"assert calculate_sum(5, -5) == 0\", \"assert calculate_sum(2, 3) == 5\", \"... | {
"split": "train",
"index": 5162,
"acecode_id": "oss_25476",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that displays a paginated table based on input data and a search query. The function should take the following parameters: 'per_page' (an integer representing the number of items to display per page), 'table_head' (a dictionary contai... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert display_table(1, {'ID': 'id', 'Name': 'name'}, 'Bob', [{'id': 1, 'name': 'Alice'}, {'id': 2, 'name': 'Bob'}, {'id': 3, 'name': 'Alice'}]) == [[2, 'Bob']]\", \"assert display_table(2, {'ID': 'id', 'Name': 'name'}, 'X', [{'id': 1, 'name': 'Alice'}, {'id': 2, '... | {
"split": "train",
"index": 5163,
"acecode_id": "oss_30371",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a list of numbers, write a function `is_approximately_linear(arr: List[float], eps: float = 1e-3) -> bool` that checks if the numbers in the list are approximately linear. A list is considered approximately linear if the standard deviation of the differences between conse... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_approximately_linear([1.0, 2.0, 3.0, 4.0], 1e-3) == True\", \"assert is_approximately_linear([1.0, 2.1, 3.2, 4.5], 1e-3) == False\", \"assert is_approximately_linear([1.0, 2.0, 3.0], 1e-3) == True\", \"assert is_approximately_linear([10.0, 10.1, 10.2, 10.... | {
"split": "train",
"index": 5164,
"acecode_id": "bigcode_python_fns_21323",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary that contains various model configurations, where the keys are model names and the values can either be strings or other types. Your task is to implement a function that extracts and returns a list of model names (the keys) from the dictionary, but on... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_model_names({'modelA': 1, 'modelB': 'string', 'modelC': 3.5}) == ['modelA', 'modelC']\", \"assert get_model_names({'model1': 100, 'model2': 'text', 'model3': [1, 2, 3]}) == ['model1', 'model3']\", \"assert get_model_names({'a': 'hello', 'b': 'world'}) ==... | {
"split": "train",
"index": 5165,
"acecode_id": "bigcode_python_fns_9165",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `sum_pairs` that takes in this list and an integer target. The function should return a list of unique pairs of integers from the input list that sum up to the target value. Each pair should be represented as a tuple of two integers, a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_pairs([1, 2, 3, 4, 3], 6) == [(2, 4), (3, 3)]\", \"assert sum_pairs([1, 1, 1, 1], 2) == [(1, 1)]\", \"assert sum_pairs([2, 4, 3, 1, 2], 5) == [(1, 4), (2, 3)]\", \"assert sum_pairs([], 5) == []\", \"assert sum_pairs([5, 5, 5, 5], 10) == [(5, 5)]\", \"ass... | {
"split": "train",
"index": 5166,
"acecode_id": "bigcode_python_fns_36172",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a given URL is a valid image URL. The function should validate that the URL ends with a common image file extension (e.g., .jpg, .jpeg, .png, .gif) and that the URL is accessible (i.e., returns a status code of 200). Implem... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_image_url('https://example.com/image.bmp') == False\", \"assert is_valid_image_url('https://example.com/document.pdf') == False\", \"assert is_valid_image_url('https://example.com/image.txt') == False\", \"assert is_valid_image_url('https://example.... | {
"split": "train",
"index": 5167,
"acecode_id": "oss_30066",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a string `line` that may contain digits and other characters. Your task is to write a function `calculate_sum(line)` that returns the sum of all the digits in the string that are equal to the digit immediately preceding them. Digits are defined as characters betwe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_sum('12345') == 0\", \"assert calculate_sum('000') == 0\", \"assert calculate_sum('4444') == 12\", \"assert calculate_sum('') == 0\", \"assert calculate_sum('abc') == 0\", \"assert calculate_sum('a1b2c3d4') == 0\", \"assert calculate_sum('00') == 0... | {
"split": "train",
"index": 5168,
"acecode_id": "oss_33716",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function `check_similarity(string1: str, string2: str) -> Union[float, str]` that evaluates the degree of similarity between two lowercase alphabetical strings. The function should first check if both strings comply with the regular expression /^[a-z]+$/. If they do... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_similarity('hello', 'hello') == 1.0\", \"assert check_similarity('abc', 'abc') == 1.0\", \"assert check_similarity('abc', 'xyz') == 0.0\", \"assert check_similarity('python', 'java') == 0.0\", \"assert check_similarity('string', 'string') == 1.0\", \"a... | {
"split": "train",
"index": 5169,
"acecode_id": "evol_2212",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given an adjacency matrix `M` representing a graph, where `M[i][j]` is 1 if there is an edge between nodes `i` and `j`, and 0 otherwise. Your task is to implement a function `count_connected_components(M)` that returns the number of connected components in the graph. A ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_connected_components([[1]]) == 1\", \"assert count_connected_components([[1, 0], [0, 1]]) == 2\", \"assert count_connected_components([[1, 1], [1, 1]]) == 1\", \"assert count_connected_components([[1, 0, 0], [0, 1, 0], [0, 0, 1]]) == 3\", \"assert coun... | {
"split": "train",
"index": 5170,
"acecode_id": "oss_28790",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating a backup script based on a given configuration. The configuration is represented as a dictionary where the keys are the paths of files or directories to be included in the backup, and the value is the destination path for the backup. Your task is ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_backup_script({'/path/to/file1.txt': '/backup/location'}) == 'Backing up /path/to/file1.txt to /backup/location'\", \"assert generate_backup_script({'/path/to/dir1': '/backup/location'}) == 'Backing up /path/to/dir1 to /backup/location'\", \"assert ... | {
"split": "train",
"index": 5171,
"acecode_id": "oss_11745",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, write a function called `find_xy_strings` that returns a list of strings that start with the letter 'x' and end with the letter 'y'. If no strings match the criteria, the function should return an empty list. For example, given the input `['xray', 'xylo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_xy_strings(['x', 'xy', 'y', 'xyz']) == ['xy']\", \"assert find_xy_strings(['example', 'xample', 'x']) == []\", \"assert find_xy_strings(['x', 'y', 'xy', 'yx', 'xx']) == ['xy']\", \"assert find_xy_strings([]) == []\", \"assert find_xy_strings(['x', 'xy',... | {
"split": "train",
"index": 5172,
"acecode_id": "oss_12280",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks the validity of a configuration dictionary for a bioinformatics analysis pipeline. The configuration dictionary will contain various settings related to sequence analysis. Your function should check the following condition... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_config({'align': {'aligner': 'bwa'}, 'variants': {'caller': 'gatk'}, 'parse_reads': {'quality_trim_threshold': 0.5, 'min_percentage_good': 90, 'umi_one': 0, 'umi_two': 0}, 'general': {'umi_min_consensus_percentage': 50}}) == True\", \"assert is_vali... | {
"split": "train",
"index": 5173,
"acecode_id": "bigcode_python_fns_13412",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that deserializes a date from a byte array. Your function should take two parameters: a byte array `byts` and an integer `protocol_version`. It should attempt to deserialize the date from the byte array. If an overflow error occurs... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert deserialize_date_fallback_int(b'\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x01', 1) == datetime.fromtimestamp(1)\", \"assert deserialize_date_fallback_int(b'\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x02', 1) == datetime.fromtimestamp(2)\... | {
"split": "train",
"index": 5174,
"acecode_id": "oss_732",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a given text and returns a list of unique emojis present in the text. An emoji is defined as any Unicode character that represents an emoji. Write a function `extract_unique_emojis(text)` that takes a string `text` a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_unique_emojis('I love \\ud83d\\udc0d and \\ud83d\\udc3c') == ['\\ud83d\\udc0d', '\\ud83d\\udc3c']\", \"assert extract_unique_emojis('No emojis here!') == []\", \"assert extract_unique_emojis('One emoji alone \\ud83d\\ude03') == ['\\ud83d\\ude03']\", ... | {
"split": "train",
"index": 5175,
"acecode_id": "oss_9593",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given two integers, return a boolean value indicating whether one of the integers is a multiple of the other. You need to implement a function called `is_multiple` that takes two parameters, `num1` and `num2`. If either `num1` is a multiple of `num2` or `num2` is a multiple of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_multiple(9, 3) == True\", \"assert is_multiple(3, 9) == True\", \"assert is_multiple(10, 5) == True\", \"assert is_multiple(5, 10) == True\", \"assert is_multiple(7, 14) == True\", \"assert is_multiple(14, 7) == True\", \"assert is_multiple(8, 2) == True\... | {
"split": "train",
"index": 5176,
"acecode_id": "evol_4565",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of responsibilities for different components, a 2D list representing data points, an array indicating the number of samples assigned to each component, an array of means for each component, and a regularization float, write a function `estimate_spherical_variance` ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert estimate_spherical_variance([[1.0]], [[0.0, 0.0]], [1], [[0.0, 0.0]], 1.0) == [1.0]\", \"assert estimate_spherical_variance([[1.0, 0.0]], [[0.5, 0.5]], [1], [[0.5, 0.5]], 0.0) == [0.0]\", \"assert estimate_spherical_variance([[0.1, 0.9]], [[3.0, 4.0]], [1], ... | {
"split": "train",
"index": 5177,
"acecode_id": "bigcode_python_fns_6104",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of bars in a histogram. Write a function `max_area(heights: List[int]) -> int` that calculates the maximum rectangular area that can be formed in the histogram. The function should return the area of the largest rectangl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_area([2, 1, 5, 6, 2, 3]) == 10\", \"assert max_area([1, 1, 1, 1]) == 4\", \"assert max_area([4, 2, 0, 3, 2, 5]) == 6\", \"assert max_area([5, 2, 1, 3, 4]) == 6\", \"assert max_area([0, 1, 0, 2, 0, 1, 0]) == 2\", \"assert max_area([1, 3, 2, 5, 4]) == 8\",... | {
"split": "train",
"index": 5178,
"acecode_id": "bigcode_python_fns_37941",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing house prices. Your task is to implement a function `average_price(prices: List[int]) -> float` that returns the average price of the houses rounded to two decimal places. The input list will always contain at least one price. If the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_price([100, 200, 300]) == 200.0\", \"assert average_price([100]) == 100\", \"assert average_price([1, 2, 3, 4, 5]) == 3.0\", \"assert average_price([10, 20, 30, 40, 50]) == 30.0\", \"assert average_price([50, 50, 50]) == 50\", \"assert average_price(... | {
"split": "train",
"index": 5179,
"acecode_id": "bigcode_python_fns_19387",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with validating a webhook request. Implement a function `validate_webhook_request(timestamp: str, token: str, signature: str, previous_token: str, api_key: str) -> bool` that checks if a webhook request is valid based on the following criteria: \n\n1. The request... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_webhook_request('1700000000', 'same_token', 'valid_signature_2', 'same_token', 'api_key_2') == False\", \"assert validate_webhook_request('1700000000', 'new_token_2', 'invalid_signature', 'old_token_2', 'api_key_3') == False\", \"assert validate_web... | {
"split": "train",
"index": 5180,
"acecode_id": "bigcode_python_fns_27370",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a string as input and returns the string in reverse order without using any pre-existing functions or iterative constructs. The function should handle cases where the input is empty or of an unexpected type, returning an empty string in such cases. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert Reverse_text('Hello World') == 'dlroW olleH'\", \"assert Reverse_text('Python') == 'nohtyP'\", \"assert Reverse_text('') == ''\", \"assert Reverse_text('A') == 'A'\", \"assert Reverse_text('12345') == '54321'\", \"assert Reverse_text('racecar') == 'racecar'\... | {
"split": "train",
"index": 5181,
"acecode_id": "evol_25205",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to implement a function that returns the maximum sum of any contiguous subarray within the list. A contiguous subarray is defined as a sequence of elements that are adjacent in the array. You must find the maximum sum that can be o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_subarray_sum([1, 2, 3, -2, 5]) == 9\", \"assert max_subarray_sum([-2, -3, -1]) == -1\", \"assert max_subarray_sum([5, 4, -1, 7, 8]) == 23\", \"assert max_subarray_sum([1]) == 1\", \"assert max_subarray_sum([]) == 0\", \"assert max_subarray_sum([-1, -2, -... | {
"split": "train",
"index": 5182,
"acecode_id": "bigcode_python_fns_4652",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that can extract a value associated with a specific key from a given list of key-value pairs. Each key-value pair is represented as a string in the format 'key=value'. Your function should take in a list of these strings and a key,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_value(['s2srun=pyreshaper.cli.s2srun:main', 'install_requires=install_requires'], 's2srun') == 'pyreshaper.cli.s2srun:main'\", \"assert extract_value(['s2srun=pyreshaper.cli.s2srun:main', 'install_requires=install_requires'], 'install_requires') == '... | {
"split": "train",
"index": 5183,
"acecode_id": "oss_1214",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that builds a regular expression pattern from a list of strings. The function should take two parameters: a list of strings `patterns` and a boolean `escape`. If `escape` is `True`, each string in `patterns` should be escaped to ensure th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert build_or_pattern([], False) == ''\", \"assert build_or_pattern(['apple'], False) == '(apple)'\", \"assert build_or_pattern(['apple', 'banana'], False) == '(apple|banana)'\", \"assert build_or_pattern(['hello', 'world'], False) == '(hello|world)'\", \"assert ... | {
"split": "train",
"index": 5184,
"acecode_id": "bigcode_python_fns_10302",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a list of deposit and withdrawal transactions for a bank account starting with an initial balance of zero, your task is to detect if the bank account balance falls below zero at any time and the function should return true at that point. Otherwise, it should return false.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert below_zero([1, 2, 3]) == False\", \"assert below_zero([1, 2, -4]) == True\", \"assert below_zero([1, 2, -3.5], True) == True\", \"assert below_zero([1, 2, -1.5, 1], True) == False\", \"assert below_zero([-1, -2, -3]) == True\", \"assert below_zero([0, 0, 0])... | {
"split": "train",
"index": 5185,
"acecode_id": "evol_26053",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the behavior of a custom data loader for a machine learning model. The function should handle a dataset and allow for batching and shuffling of the data. Given a list of data items, a batch size, and a shuffle flag, imp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert custom_data_loader([1, 2, 3, 4, 5], 2, False) == [[1, 2], [3, 4], [5]]\", \"assert custom_data_loader([1, 2, 3, 4, 5], 2, True) != [[1, 2], [3, 4], [5]]\", \"assert custom_data_loader(['a', 'b', 'c'], 1, False) == [['a'], ['b'], ['c']]\", \"assert custom_dat... | {
"split": "train",
"index": 5186,
"acecode_id": "oss_16508",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating the states of a doorbell system that has three binary sensors: a motion sensor, an online status sensor, and a ding sensor. Each sensor can be in one of two states: 'ON' or 'OFF'. Write a function `simulate_doorbell_states()` that initializes the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_doorbell_states() == {'binary_sensor_name_motion': 'OFF', 'binary_sensor_name_online': 'ON', 'binary_sensor_name_ding': 'OFF'}\", \"assert simulate_doorbell_states()['binary_sensor_name_motion'] == 'OFF'\", \"assert simulate_doorbell_states()['binar... | {
"split": "train",
"index": 5187,
"acecode_id": "bigcode_python_fns_7141",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that determines the appropriate greeting based on the provided operating system and Python version. The function should return 'Hello, Windows user!' if the operating system is 'Windows' and the Python version is 3 or higher. If th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert greet_user('Windows', 3) == 'Hello, Windows user!'\", \"assert greet_user('Windows', 2) == 'Hello, Windows user, please upgrade your Python version!'\", \"assert greet_user('Linux', 3) == 'Hello, user of Linux!'\", \"assert greet_user('Linux', 2) == 'Hello, ... | {
"split": "train",
"index": 5188,
"acecode_id": "oss_16432",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string `iri` which can either be a valid URL (starting with 'http://' or 'https://') or a plain string. Your task is to implement a function `get_name_and_url(iri: str) -> dict` that processes the input as follows: If `iri` is a valid URL, return a dictionary co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_name_and_url('http://example.com') == {'name': 'valid_url', 'url': 'http://example.com'}\", \"assert get_name_and_url('https://example.com') == {'name': 'valid_url', 'url': 'https://example.com'}\", \"assert get_name_and_url('ftp://example.com') == {'nam... | {
"split": "train",
"index": 5189,
"acecode_id": "bigcode_python_fns_48280",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that applies a configuration change to a device using a specified configuration snippet. The function takes in a configuration string and a target configuration store. Your goal is to implement a function that simulates applying this conf... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert apply_configuration('interface GigabitEthernet0/1', 'running') == 'Configuration applied to running store.'\", \"assert apply_configuration('interface GigabitEthernet0/1', 'startup') == 'Configuration applied to startup store.'\", \"assert apply_configuratio... | {
"split": "train",
"index": 5190,
"acecode_id": "bigcode_python_fns_19455",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes a string input representing an English phrase and returns a list of unique words from the phrase, ignoring all punctuation marks. The words should be in the order of their first appearance in the input. The function should not differentiate be... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_lexemes('Hello, world! Hello again.') == ['hello', 'world', 'again']\", \"assert get_unique_lexemes('This is a test. This test is only a test.') == ['this', 'is', 'a', 'test', 'only']\", \"assert get_unique_lexemes('Python is great; python is fun!... | {
"split": "train",
"index": 5191,
"acecode_id": "evol_1784",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a metadata parser that extracts key-value pairs from a given metadata string. The metadata string is a series of key-value pairs separated by commas, where each key and value are separated by an equal sign. Additionally, the metadata string may ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_metadata('color=blue,size=large,shape=circle') == {'color': 'blue', 'size': 'large', 'shape': 'circle'}\", \"assert parse_metadata('empty={}') == {'empty': {}}\", \"assert parse_metadata('single_key=single_value') == {'single_key': 'single_value'}\", \... | {
"split": "train",
"index": 5192,
"acecode_id": "oss_2852",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Write a function `factorial(n: int) -> int` that computes the factorial of a non-negative integer `n`. The factorial of a non-negative integer `n` is the product of all positive integers less than or equal to `n`. For example, the factorial of 5 is 5 * 4 * 3 * 2 * 1 = 120. If `... | 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": 5193,
"acecode_id": "evol_426",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the behavior of an email verification system. The function `need_verified_email` takes an email request and returns a specific error message if the email is not verified. The function should accept an email request as input... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert need_verified_email('') == 'Error 401: Please verify your email.'\", \"assert need_verified_email('test@example.com') == 'Email verified.'\", \"assert need_verified_email('user@domain.com') == 'Email verified.'\", \"assert need_verified_email('') == 'Error 4... | {
"split": "train",
"index": 5194,
"acecode_id": "bigcode_python_fns_512",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple banking system. The function should accept an initial balance and a list of operations. Each operation is either a deposit or a withdrawal. The function should return the final balance after all operations are appl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert final_balance(1000, [('deposit', 500), ('withdraw', 200)]) == 1300\", \"assert final_balance(1000, [('withdraw', 200), ('withdraw', 900)]) == 800\", \"assert final_balance(1000, [('withdraw', 1100)]) == 1000\", \"assert final_balance(0, [('deposit', 100)]) =... | {
"split": "train",
"index": 5195,
"acecode_id": "oss_35452",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function `calculate_average(grades: List[float], weights: Optional[List[float]] = None) -> float` that calculates the weighted average of a list of grades. If weights are provided, they must be the same length as the grades list. If no weights are provided, the func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average([90, 80, 70]) == 80.0\", \"assert calculate_average([], [1]) == 0.0\", \"assert calculate_average([], None) == 0.0\", \"assert calculate_average([0, 0, 0]) == 0.0\", \"assert calculate_average([10, 20, 30], [1, 1, 1]) == 20.0\", \"assert ca... | {
"split": "train",
"index": 5196,
"acecode_id": "evol_28730",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Write a function that converts a given Pantone color code to a specified color format (CMYK, RGB, or HSL). The function should validate the Pantone code to ensure it is in the correct format before proceeding with the conversion. If the format is unsupported or the Pantone code... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pantone_to_color_format('#3498DB', 'rgb') == {'r': 52, 'g': 152, 'b': 219}\", \"assert pantone_to_color_format('#3498DB', 'hsl') == {'h': 204, 's': 70, 'l': 53}\", \"assert pantone_to_color_format('#FFFFFF', 'rgb') == {'r': 255, 'g': 255, 'b': 255}\", \"asse... | {
"split": "train",
"index": 5197,
"acecode_id": "evol_20997",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing patterns and a list of strings representing texts. Your task is to implement a function `pattern_matcher(patterns, texts)` that returns a list of lists. Each inner list should contain the indices of the texts that contain the corresp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pattern_matcher(['x', 'y'], ['xy', 'yx', 'xyz']) == [[0, 1, 2], [0, 1, 2]]\", \"assert pattern_matcher(['p'], ['hello', 'world', 'python']) == [[2]]\", \"assert pattern_matcher(['cat', 'dog'], ['catalog', 'doghouse', 'fish']) == [[0], [1]]\", \"assert patter... | {
"split": "train",
"index": 5198,
"acecode_id": "oss_9511",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the Simple Moving Average (SMA) of a financial instrument given its historical price data. The function should take in a list of historical prices and an integer period, and return the calculated SMA value for the spec... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_sma([100.0, 105.0, 110.0], 3) == 105.0\", \"assert calculate_sma([100.0, 105.0, 110.0], 2) == 107.5\", \"assert calculate_sma([100.0], 1) == 100.0\", \"assert calculate_sma([100.0, 105.0, 110.0], 1) == 110.0\", \"assert calculate_sma([], 3) == 0.0\... | {
"split": "train",
"index": 5199,
"acecode_id": "oss_257",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.