data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that calculates the frequency of words in a given string of text. Your function should take a string as input and return a dictionary where the keys are the unique words in the string and the values are the frequencies of those wor... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert word_frequency('Hello, hello world!') == {'hello': 2, 'world': 1}\", \"assert word_frequency('Python is great. Python is fun!') == {'python': 2, 'is': 2, 'great': 1, 'fun': 1}\", \"assert word_frequency('Word, word, WORD!') == {'word': 3}\", \"assert word_fr... | {
"split": "train",
"index": 81700,
"acecode_id": "oss_13576",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a translation function for a scheduling application that translates the days of the week into various languages. Implement a function that takes a day of the week in English and a specified language, returning the corresponding translation of th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert translate_day('Monday', 'Spanish') == 'Lunes'\", \"assert translate_day('Monday', 'French') == 'Lundi'\", \"assert translate_day('Monday', 'German') == 'Montag'\", \"assert translate_day('Tuesday', 'Spanish') == 'Martes'\", \"assert translate_day('Tuesday', ... | {
"split": "train",
"index": 81701,
"acecode_id": "oss_20290",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of file paths as strings. Your task is to implement a function that checks if each file path in the list is valid. A file path is considered valid if it contains at least one segment between slashes (/) and does not end with a slash. The function should ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_file_paths(['this-is-not-a-file']) == [False]\", \"assert check_file_paths(['valid/file/path', 'another/valid/path']) == [True, True]\", \"assert check_file_paths(['file/path/with/multiple/segments']) == [True]\", \"assert check_file_paths(['']) == [Fa... | {
"split": "train",
"index": 81702,
"acecode_id": "bigcode_python_fns_31797",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a script module represented as a dictionary that contains parameters and operations. Your task is to implement a function that checks the structure of this script module and generates a list of messages indicating potential issues. The script module is represented... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_mobile_module_lints({'parameters': {'weight': {'requires_grad': True}, 'bias': {'requires_grad': False}}, 'operations': ['conv', 'dropout']}) == ['Param weight requires grad, please set torch.no_grad() to reduce memory usage and improve computation ... | {
"split": "train",
"index": 81703,
"acecode_id": "bigcode_python_fns_48371",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `parse_email(email: str) -> Dict[str, Union[bool, str, None]]` that takes an email address as input and returns a dictionary containing the validity of the email, the username part, the domain, the top-level domain (TLD), and any subdomains. The validity sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_email('user@example.com') == {'valid': True, 'username': 'user', 'domain': 'example.com', 'tld': 'com', 'subdomains': ''}\", \"assert parse_email('user@sub.example.com') == {'valid': True, 'username': 'user', 'domain': 'sub.example.com', 'tld': 'com', ... | {
"split": "train",
"index": 81704,
"acecode_id": "evol_35175",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple function that simulates a recommendation system where you need to determine the total number of recommendations that can be generated based on the number of users and the number of items available for recommendation. The function should tak... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_recommendations(1, 1) == 1\", \"assert calculate_recommendations(2, 3) == 6\", \"assert calculate_recommendations(0, 5) == 0\", \"assert calculate_recommendations(3, 0) == 0\", \"assert calculate_recommendations(10, 10) == 100\", \"assert calculate... | {
"split": "train",
"index": 81705,
"acecode_id": "oss_17416",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an array of events, where each event is represented by a list of three integers: the event time in samples, a value (which you can ignore), and the event id. You are also given an array of durations, where each duration corresponds to the duration of the respectiv... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_events([[10, 0, 1], [20, 0, 2]], [1, 2], 0, 250, None) == [{'onset': 0.04, 'duration': 1, 'value': 1, 'sample': 10}, {'onset': 0.08, 'duration': 2, 'value': 2, 'sample': 20}]\", \"assert process_events([[150, 0, 2]], [2], 0, 250, None) == [{'onset': ... | {
"split": "train",
"index": 81706,
"acecode_id": "bigcode_python_fns_59",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function `below_zero` that takes a list of tuples representing deposit and withdrawal operations on a bank account, which starts with a zero balance. Each tuple consists of an operation type (either 'Deposit' or 'Withdrawal') and an operation value that can be an in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert below_zero([('Deposit', 5), ('Withdrawal', 5)]) == True\", \"assert below_zero([('deposit', '10'), ('withdrawal', '10')], True) == True\", \"assert below_zero([('Deposit', 15), ('Withdrawal', 5), ('Withdrawal', '10')]) == True\", \"assert below_zero([('Depos... | {
"split": "train",
"index": 81707,
"acecode_id": "evol_31642",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a configuration dictionary that contains a list of group names. Your task is to implement a function `get_group_names(config)` that retrieves the names of all unique groups from the configuration. The input `config` will contain a key 'groups' which is a list of g... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_group_names({'groups': ['dev', 'qa', 'dev', 'prod']}) == ['dev', 'prod', 'qa']\", \"assert get_group_names({'groups': []}) == []\", \"assert get_group_names({'groups': ['admin', 'user', 'admin', 'guest']}) == ['admin', 'guest', 'user']\", \"assert get_gr... | {
"split": "train",
"index": 81708,
"acecode_id": "bigcode_python_fns_5011",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a complex nested list containing integers and other lists, implement a function `calculate_sum` that returns the sum of all integers in the list. The input list may contain integers nested within multiple layers of lists. For example, the input list [2, [4, 6], 8, [[10, 1... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_sum([1, [2, [3]], 4]) == 10\", \"assert calculate_sum([[1], [2], [3]]) == 6\", \"assert calculate_sum([]) == 0\", \"assert calculate_sum([5, [5, [5]], 5]) == 20\", \"assert calculate_sum([[[]]]) == 0\", \"assert calculate_sum([10]) == 10\", \"asser... | {
"split": "train",
"index": 81709,
"acecode_id": "evol_9114",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a 2D list of integers representing a matrix, write a function that calculates the number of rows in the matrix. If the input is an empty list, return 0. If the input is not a 2D list, return -1. The function should handle cases where the rows are not of equal length by re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_rows([[1, 2, 3], [4, 5, 6]]) == 2\", \"assert count_rows([[1], [2], [3]]) == 3\", \"assert count_rows([]) == 0\", \"assert count_rows([[1, 2], [3]]) == -1\", \"assert count_rows([[1, 2, 3], [4, 5]]) == -1\", \"assert count_rows([[1, 2], [3, 4], [5, 6]]... | {
"split": "train",
"index": 81710,
"acecode_id": "bigcode_python_fns_3033",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that checks if a given dictionary is empty and whether all of its values are either empty dictionaries or None. The function should return True if the dictionary is empty or if all values are empty dictionaries or None, and False otherwise. If the input is ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_deeply_empty({}) == True\", \"assert is_deeply_empty({'a': None}) == True\", \"assert is_deeply_empty({'a': {}}) == True\", \"assert is_deeply_empty({'a': {}, 'b': None}) == True\", \"assert is_deeply_empty({'a': 1}) == False\", \"assert is_deeply_empty({... | {
"split": "train",
"index": 81711,
"acecode_id": "evol_17081",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary that may contain nested dictionaries, lists, or other data structures. Your task is to implement a function that filters out all keys that are associated with 'None' values, returning a new dictionary that maintains the original structure but without ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_none_values({'a': None, 'b': 2}) == {'b': 2}\", \"assert filter_none_values({'a': 1, 'b': None, 'c': '3'}) == {'a': 1, 'c': '3'}\", \"assert filter_none_values({'a': None, 'b': None}) == {}\", \"assert filter_none_values({'a': 1, 'b': {'ba': None, 'bb... | {
"split": "train",
"index": 81712,
"acecode_id": "bigcode_python_fns_12195",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with developing a function that calculates the total energy of a system based on the formation energies of its components. The function should take a list of formation energies (as floats) and return the sum of these energies. If the input list is empty, the func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_energy([]) == 0.0\", \"assert calculate_total_energy([1.5, 2.5, 3.0]) == 7.0\", \"assert calculate_total_energy([-1.0, -2.0, -3.0]) == -6.0\", \"assert calculate_total_energy([0.0]) == 0.0\", \"assert calculate_total_energy([1.1, 2.2, 3.3, 4.... | {
"split": "train",
"index": 81713,
"acecode_id": "bigcode_python_fns_8116",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to generate a macro name based on the provided conditions. The function should be defined as `generateMacroName(pssl, parsing_struct, data_decl)` where: \n\n- `pssl` (bool): A boolean indicating if the processing should proceed. \n- `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generateMacroName(False, [1, 2, 3], ('anotherArray', 'int')) == None\", \"assert generateMacroName(True, 'notAList', ('arrayDecl', 'char')) == None\", \"assert generateMacroName(False, None, ('ignoredArray', 'int')) == None\", \"assert generateMacroName(Fals... | {
"split": "train",
"index": 81714,
"acecode_id": "oss_37335",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given two lists of 3D vectors, each represented as a list of three integers [x, y, z], implement a function that computes the element-wise cross product of the vectors from the two lists. The function should return a new list containing the cross products, where the i-th elemen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cross_product([[1, 2, 3]], [[4, 5, 6]]) == [[-3, 6, -3]]\", \"assert cross_product([[1, 2, 3], [4, 5, 6]], [[7, 8, 9], [10, 11, 12]]) == [[-6, 12, -6], [-6, 12, -6]]\", \"assert cross_product([[1, 1, 1]], [[2, 2, 2]]) == [[0, 0, 0]]\", \"assert cross_product... | {
"split": "train",
"index": 81715,
"acecode_id": "bigcode_python_fns_6559",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that selects a workout window based on overlapping conditions and scores. You are given the following inputs: \n- `all_workouts`: a list of workout windows, where each window is represented as a dictionary with `start_row`, `end_row`, and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert select_workout([{'start_row': 1, 'end_row': 5, 'score': 10}, {'start_row': 4, 'end_row': 7, 'score': 15}], {'start_row': 0, 'end_row': 3, 'score': 5}, 1) == {'start_row': 4, 'end_row': 7, 'score': 15}\", \"assert select_workout([{'start_row': 1, 'end_row': 5... | {
"split": "train",
"index": 81716,
"acecode_id": "oss_27659",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with counting matching pairs of numbers generated by two different linear congruential generators. Implement a function `count_matching_pairs` that takes in two seed values, `seed_a` and `seed_b`, and a number of iterations `iterations`. The two generators produc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_matching_pairs(1, 2, 10) == 0\", \"assert count_matching_pairs(100, 200, 15) == 0\", \"assert count_matching_pairs(5, 10, 10) == 0\", \"assert count_matching_pairs(300, 400, 30) == 0\", \"assert count_matching_pairs(1000, 2000, 50) == 0\", \"assert cou... | {
"split": "train",
"index": 81717,
"acecode_id": "oss_34813",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a string that represents a command to run a project. The command contains the project path and the package name. Your task is to implement a function `run_project(command: str) -> str` that takes this command as input and returns a string indicating the result of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert run_project('python -m my_project.run') == 'Running project at my_project with package run'\", \"assert run_project('python -m another_project.module') == 'Running project at another_project with package module'\", \"assert run_project('python -m test_projec... | {
"split": "train",
"index": 81718,
"acecode_id": "bigcode_python_fns_29252",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple proxy server. The server listens to a list of pairs representing the ports it needs to handle. Each port can either be in an open or closed state. Your function should take in a list of pairs of integers as input, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_open_ports([(8080, 1), (8081, 0), (8082, 1)]) == [8080, 8082]\", \"assert get_open_ports([(3000, 0), (3001, 0), (3002, 0)]) == []\", \"assert get_open_ports([(5000, 1), (5001, 1), (5002, 0)]) == [5000, 5001]\", \"assert get_open_ports([(6000, 0), (6001, ... | {
"split": "train",
"index": 81719,
"acecode_id": "bigcode_python_fns_42214",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an agent represented by its position in a grid and a list of neighboring positions in the form of tuples. Implement a function `has_neighbours(agent_position: Tuple[int, int], neighbours: List[Tuple[int, int]]) -> List[bool]` that determines if the agent has neigh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_neighbours((1, 1), [(1, 2), (2, 1), (1, 1), (0, 1)]) == [False, False, True, False]\", \"assert has_neighbours((0, 0), [(0, 0), (0, 0), (1, 1)]) == [True, True, False]\", \"assert has_neighbours((5, 5), [(4, 5), (5, 5), (6, 5), (5, 5)]) == [False, True, ... | {
"split": "train",
"index": 81720,
"acecode_id": "bigcode_python_fns_14402",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a destination address represented as a string. Implement a function `trace_route(dest: str, hops: int, queries: int, timeout: int, ttl: int, wait: int) -> str` that simulates a traceroute to the given destination address. The function should return a string that d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert trace_route('192.168.1.1', 5, 3, 2, 64, 500) == 'Tracing route to 192.168.1.1 with 5 hops, 3 queries, timeout 2s, ttl 64, wait 500ms.'\", \"assert trace_route('example.com', 10, 4, 1, 128, 200) == 'Tracing route to example.com with 10 hops, 4 queries, timeou... | {
"split": "train",
"index": 81721,
"acecode_id": "bigcode_python_fns_3474",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `connection_type_validator(type: str) -> str` that checks if a given connection type is valid. The valid connection types are: 'CUSTOM', 'JDBC', 'KAFKA', 'MARKETPLACE', 'MONGODB', 'NETWORK', and 'SFTP'. If the provided type is valid, return the type; otherw... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert connection_type_validator('CUSTOM') == 'CUSTOM'\", \"assert connection_type_validator('JDBC') == 'JDBC'\", \"assert connection_type_validator('KAFKA') == 'KAFKA'\", \"assert connection_type_validator('MARKETPLACE') == 'MARKETPLACE'\", \"assert connection_typ... | {
"split": "train",
"index": 81722,
"acecode_id": "bigcode_python_fns_2661",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_validation_override` that takes the following parameters: `message_id` (str or None), `validate_edi_types` (bool), `validate_xsd_types` (bool), `allow_leading_and_trailing_spaces_and_zeroes` (bool), `validate_character_set` (bool), `trim_leading_and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_validation_override(None, True, True, True, True, True, 'optional') == {'message_id': 'default', 'validate_edi_types': True, 'validate_xsd_types': True, 'allow_leading_and_trailing_spaces_and_zeroes': True, 'validate_character_set': True, 'trim_leadin... | {
"split": "train",
"index": 81723,
"acecode_id": "evol_30470",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries, where each dictionary represents the settings of different agents identified by unique 'agent_id' keys. Your task is to merge this list of dictionaries with a second list that contains the agent configurations, where each configuration is a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_agent_data([{'agent_id': 0, 'name': 'Agent1'}, {'agent_id': 1, 'name': 'Agent2'}], [{'agent_id': 0, 'settingA': 'ValueA1'}, {'agent_id': 1, 'settingA': 'ValueA2'}]) == [{'agent_id': 0, 'name': 'Agent1', 'settingA': 'ValueA1'}, {'agent_id': 1, 'name': '... | {
"split": "train",
"index": 81724,
"acecode_id": "bigcode_python_fns_32779",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, implement a function that takes the array as input and returns a new array where each element is doubled. The function should be named 'double_elements' and it should take a single parameter, the input array.\nPlease reason step by step, then write a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert double_elements([1, 2, 3, 4]) == [2, 4, 6, 8]\", \"assert double_elements([0]) == [0]\", \"assert double_elements([-1, -2, -3]) == [-2, -4, -6]\", \"assert double_elements([]) == []\", \"assert double_elements([5]) == [10]\", \"assert double_elements([10, 20... | {
"split": "train",
"index": 81725,
"acecode_id": "evol_2529",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes three integer parameters: 'a', 'b', and 'c'. The parameter 'a' is required, while 'b' and 'c' are optional. If 'b' is not provided, it defaults to 10, and if 'c' is not provided, it defaults to 100. Your function should ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_with_defaults(1, 2, 3) == 6\", \"assert sum_with_defaults(1, 2) == 103\", \"assert sum_with_defaults(10, 20, 30) == 60\", \"assert sum_with_defaults(-1, -1, -1) == -3\", \"assert sum_with_defaults(3, 4) == 107\", \"assert sum_with_defaults(-10, -20) == 7... | {
"split": "train",
"index": 81726,
"acecode_id": "bigcode_python_fns_26083",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that simulates the movement of a rectangle on a 2D plane. The function takes in the current position and dimensions of the rectangle, the direction in which it should move, and the distance to move in that direction. The functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert move_rectangle({'left': 0, 'top': 0, 'width': 10, 'height': 5}, 'right', 5) == {'left': 5, 'top': 0, 'width': 10, 'height': 5}\", \"assert move_rectangle({'left': 5, 'top': 5, 'width': 10, 'height': 5}, 'left', 3) == {'left': 2, 'top': 5, 'width': 10, 'heigh... | {
"split": "train",
"index": 81727,
"acecode_id": "oss_30249",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a function that takes a string as input and removes all whitespace characters, including spaces, tabs, and newline characters, returning the modified string.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ``... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_whitespace('Hello World!') == 'HelloWorld!'\", \"assert remove_whitespace(' Leading and trailing ') == 'Leadingandtrailing'\", \"assert remove_whitespace('NoWhitespaceHere') == 'NoWhitespaceHere'\", \"assert remove_whitespace(' Multiple spaces ... | {
"split": "train",
"index": 81728,
"acecode_id": "evol_1602",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `encode(value: Any) -> Any` that encodes a given value or document. The function should handle various data types including integers, strings, lists, and dictionaries. However, if the input contains an instance of `ObjectId`, which is a p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert encode(42) == 42\", \"assert encode('hello') == 'hello'\", \"assert encode([1, 2, 3]) == [1, 2, 3]\", \"assert encode({'key': 'value'}) == {'key': 'value'}\", \"assert encode({'id': {'__ObjectId__': '507f1f77bcf86cd799439011'}}) == {'id': {'__ObjectId__': '5... | {
"split": "train",
"index": 81729,
"acecode_id": "bigcode_python_fns_37200",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a new admin class with a specific dashboard view. The function `generate_new_admin_class` should return a new admin class that has a designated dashboard class. The dashboard class should be a subclass of a given `Dashboard... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_new_admin_class().__bases__[0].__name__ == 'Admin'\", \"assert generate_new_admin_class().dashboard_class.__bases__[0].__name__ == 'DashboardView'\", \"assert isinstance(generate_new_admin_class(), type)\", \"assert isinstance(generate_new_admin_cla... | {
"split": "train",
"index": 81730,
"acecode_id": "bigcode_python_fns_35016",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a positive integer d, write a function that computes the number of reduced proper fractions n/d for all integers n such that 1 <= n < d. A reduced proper fraction is defined as a fraction where the greatest common divisor (GCD) of n and d is 1. The function should return ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_reduced_proper_fractions(1) == 0\", \"assert compute_reduced_proper_fractions(2) == 1\", \"assert compute_reduced_proper_fractions(3) == 2\", \"assert compute_reduced_proper_fractions(4) == 2\", \"assert compute_reduced_proper_fractions(5) == 4\", \"... | {
"split": "train",
"index": 81731,
"acecode_id": "evol_35040",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with formatting a list of history entries based on a specified format type. Your function should take a list of strings representing history entries and a format type, and return a new list of formatted strings. The history entries may contain information about i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_history_entries(['This is a history entry.', '===', 'Release 1.0.0', 'Features:', '** Feature 1', '** Feature 2'], 'basic') == ['This is a history entry.', '===', 'Release 1.0.0', 'Features:', '** Feature 1', '** Feature 2']\", \"assert format_history... | {
"split": "train",
"index": 81732,
"acecode_id": "bigcode_python_fns_11589",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to calculate the Julian day number corresponding to a given fixed date. The fixed date is represented as an integer, where 0 corresponds to November 24, 4714 BCE, and each subsequent day is represented by an incrementing integer. Your... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert jd_from_fixed(0) == 1721424\", \"assert jd_from_fixed(1) == 1721425\", \"assert jd_from_fixed(-1) == 1721423\", \"assert jd_from_fixed(10) == 1721434\", \"assert jd_from_fixed(100) == 1721524\", \"assert jd_from_fixed(200) == 1721624\", \"assert jd_from_fixe... | {
"split": "train",
"index": 81733,
"acecode_id": "oss_24697",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes two strings representing large numbers and returns their sum as a string. The numbers may be very large, so they should be handled as strings instead of regular integers. The function signature is: def add_large_numbers(num1: str, num2: str) -> s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_large_numbers('111', '1337') == '1448'\", \"assert add_large_numbers('999999999999999999999999999', '1') == '1000000000000000000000000000'\", \"assert add_large_numbers('12345678901234567890', '98765432109876543210') == '111111111011111111100'\", \"asser... | {
"split": "train",
"index": 81734,
"acecode_id": "evol_27635",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing different musical meters. Each meter is composed of various musical components, which are also represented as strings. Your task is to implement a function that takes a collection of musical components and returns a list of all music... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_musical_meters(['quarter']) == ['4/4', '3/4', '2/4']\", \"assert find_musical_meters(['eighth']) == ['6/8', '12/8']\", \"assert find_musical_meters(['quarter', 'eighth']) == []\", \"assert find_musical_meters(['quarter', 'quarter']) == ['4/4', '3/4', '2... | {
"split": "train",
"index": 81735,
"acecode_id": "bigcode_python_fns_41498",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function `generate_verification_code()` that generates a random six-digit verification code. The code should be an integer between 100000 and 999999 (inclusive). Each time the function is called, it should return a different random code. The function does not take a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_verification_code() >= 100000 and generate_verification_code() <= 999999\", \"assert generate_verification_code() >= 100000 and generate_verification_code() <= 999999\", \"assert generate_verification_code() >= 100000 and generate_verification_code(... | {
"split": "train",
"index": 81736,
"acecode_id": "evol_18708",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that calculates the numerical integral of a given set of data points using the trapezoidal rule. The function should take in a list of tuples, where each tuple consists of two floats representing the x and y coordinates of a data point. Th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_integral([(0, 1), (1, 3)]) == 2.0\", \"assert calculate_integral([(0, 1), (1, 1)]) == 1.0\", \"assert calculate_integral([(0, 0), (1, 0)]) == 0.0\", \"assert calculate_integral([(1, 1), (3, 1)]) == 2.0\", \"assert calculate_integral([(0, 0), (1, 1)... | {
"split": "train",
"index": 81737,
"acecode_id": "oss_11051",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of intervals, where each interval is represented as a list of two integers [start, end]. Your task is to merge all overlapping intervals and return a new list of non-overlapping intervals that cover all the intervals in the input. The intervals are represen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_intervals([[1,3],[2,6],[8,10],[15,18]]) == [[1,6],[8,10],[15,18]]\", \"assert merge_intervals([[1,4],[4,5]]) == [[1,5]]\", \"assert merge_intervals([[1,2],[3,4],[5,6]]) == [[1,2],[3,4],[5,6]]\", \"assert merge_intervals([[1,3],[2,4],[5,7],[6,8]]) == [[... | {
"split": "train",
"index": 81738,
"acecode_id": "bigcode_python_fns_47072",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes in a list of cryptocurrency symbols and a fiat currency. The function should retrieve the exchange rates for the given cryptocurrencies and return a dictionary mapping each cryptocurrency symbol to its corresponding exchange ra... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_crypto_exchange_rates(['BTC', 'ETH'], 'USD') == {'BTC': 50000, 'ETH': 4000}\", \"assert get_crypto_exchange_rates(['BTC', 'LTC'], 'USD') == {'BTC': 50000, 'LTC': 200}\", \"assert get_crypto_exchange_rates(['ETH', 'LTC'], 'USD') == {'ETH': 4000, 'LTC': 20... | {
"split": "train",
"index": 81739,
"acecode_id": "oss_21774",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the creation of user groups in a system. The function, `create_user_group`, should take in a `context` (a string representing the context of the request) and a `request` (a dictionary containing user data and a database con... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_user_group('test_context', {'user': {'user_id': 1}, 'db': 'active'}) == 'Group Created Successfully'\", \"assert create_user_group('test_context', {'user': {'user_id': None}, 'db': 'active'}) == 'Group Creation Failed'\", \"assert create_user_group('t... | {
"split": "train",
"index": 81740,
"acecode_id": "bigcode_python_fns_26061",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of bars in a histogram. Write a function `max_rectangle_area` that calculates the area of the largest rectangle that can be formed within the histogram. The function should accept a list of integers `heights` and return ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_rectangle_area([2, 1, 5, 6, 2, 3]) == 10\", \"assert max_rectangle_area([1, 1, 1, 1]) == 4\", \"assert max_rectangle_area([4, 2, 0, 3, 2, 5]) == 6\", \"assert max_rectangle_area([0, 0, 0, 0]) == 0\", \"assert max_rectangle_area([1, 2, 3, 4, 5]) == 9\", \... | {
"split": "train",
"index": 81741,
"acecode_id": "bigcode_python_fns_28866",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string phrase, write a function to count the total number of syllables in the phrase. A syllable is defined as a sequence of one or more vowels ('a', 'e', 'i', 'o', 'u') that may or may not be followed by consonants. The letter 'y' should only be counted as a vowel when... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_syllables('Hello world') == 3\", \"assert count_syllables('Fly away') == 4\", \"assert count_syllables('A quick brown fox jumps over the lazy dog') == 11\", \"assert count_syllables('I love programming in Python') == 8\", \"assert count_syllables('The ... | {
"split": "train",
"index": 81742,
"acecode_id": "evol_14585",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a string message. Your task is to create a function that modifies the message by converting it to uppercase and appending ' - Server' to the end of the message. Implement the function `modify_message(message: str) -> str` that takes a single parameter `message`, w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert modify_message('hello world') == 'HELLO WORLD - Server'\", \"assert modify_message('LeetCode') == 'LEETCODE - Server'\", \"assert modify_message('Python is fun') == 'PYTHON IS FUN - Server'\", \"assert modify_message('UDP Sockets') == 'UDP SOCKETS - Server'\... | {
"split": "train",
"index": 81743,
"acecode_id": "oss_1906",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that searches for a specific string in a list of strings and returns its index. The function should take in two parameters: a list of strings and a string key to search for. If the key is found in the list, the function should return ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_key_index(['name', 'age', 'gender', 'id'], 'gender') == 2\", \"assert find_key_index(['name', 'age', 'gender', 'id'], 'name') == 0\", \"assert find_key_index(['name', 'age', 'gender', 'id'], 'id') == 3\", \"assert find_key_index(['name', 'age', 'gender'... | {
"split": "train",
"index": 81744,
"acecode_id": "oss_36999",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a function that calculates the binomial confidence interval for a given number of trials and successes. However, the current implementation only supports two-sided confidence intervals. Write a function that checks if a given set of parameters for the binomial con... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_binom_conf_interval(10, 3, 0.95, 'two-sided', 'sterne') == True\", \"assert validate_binom_conf_interval(20, 10, 0.90, 'two-sided', 'sterne') == True\", \"assert validate_binom_conf_interval(5, 2, 0.99, 'two-sided', 'sterne') == True\", \"assert val... | {
"split": "train",
"index": 81745,
"acecode_id": "bigcode_python_fns_9146",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers, write a function `count_matching_indices` that returns a tuple containing two values: the number of indices where the values in both lists are equal and the sum of those indices. The input lists will have the same length and can contain negative int... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_matching_indices([1, 2, 3], [1, 2, 3]) == (3, 3)\", \"assert count_matching_indices([1, 2, 3], [4, 5, 6]) == (0, 0)\", \"assert count_matching_indices([0, 0, 0], [0, 0, 0]) == (3, 3)\", \"assert count_matching_indices([1, 2, 3], [3, 2, 1]) == (1, 1)\",... | {
"split": "train",
"index": 81746,
"acecode_id": "evol_29014",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that determines if a given string is a palindrome. A palindrome is a word, phrase, number, or other sequence of characters that reads the same forward and backward (ignoring spaces, punctuation, and capitalization). Your function shou... | 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') == False\", \"assert is_palindrome('Was it a car or a cat I saw?') == True\", \"assert is_palindrome('No lemon, no melon'... | {
"split": "train",
"index": 81747,
"acecode_id": "oss_17749",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a sentence as input and returns the longest word in that sentence, excluding words that contain digits or special characters. If there are multiple longest words, return the one that appears first in the sentence. The function should ignore case when... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longest_word('This is a test sentence.') == 'sentence'\", \"assert longest_word('Hello world!') == 'Hello'\", \"assert longest_word('Python is fun and exciting') == 'exciting'\", \"assert longest_word('Look at those beautiful flowers') == 'beautiful'\", \"as... | {
"split": "train",
"index": 81748,
"acecode_id": "evol_9854",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a data structure that represents a field with choices. Your task is to implement a function `number_of_choices(field)` that returns the number of choices available in the field. The field can be represented as an object with a method `get_flat_choices()` that retu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert number_of_choices({'get_flat_choices': lambda: []}) == 0\", \"assert number_of_choices({'get_flat_choices': lambda: []}) == 0\", \"assert number_of_choices({}) == 0\", \"assert number_of_choices(None) == 0\", \"assert number_of_choices({'non_flat_choices': l... | {
"split": "train",
"index": 81749,
"acecode_id": "bigcode_python_fns_16984",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that takes a list of integers as input and returns a new list containing only the even integers from the original list. The output list should maintain the original order of the even integers. If there are no even integers in the i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([1, 3, 5, 7]) == []\", \"assert filter_even_numbers([2, 4, 6, 8]) == [2, 4, 6, 8]\", \"assert filter_even_numbers([0, 1, 2, 3]) == [0, 2]\", \"assert filter_even_numbers([-2, -1, ... | {
"split": "train",
"index": 81750,
"acecode_id": "oss_7601",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing lines of a diff file. Each line can start with '+', '-' or be a regular line. Your task is to implement a function that counts the number of lines that were added and the number of lines that were deleted. Lines that start with '+ ' ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_changes(['+ line1', '- line2', 'line3']) == (1, 1)\", \"assert count_changes(['+ added line', '- removed line', '+ another addition']) == (2, 1)\", \"assert count_changes(['line1', 'line2', 'line3']) == (0, 0)\", \"assert count_changes(['+ first', '+ s... | {
"split": "train",
"index": 81751,
"acecode_id": "bigcode_python_fns_27799",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that determines the appropriate action based on the file extension of a given filename. The function should take a filename as input and return a string indicating the action to perform based on the file extension. The supported file ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert determine_import_action('mapfile.map') == 'Importing map file: mapfile.map'\", \"assert determine_import_action('model.obj') == 'Importing model file: model.obj'\", \"assert determine_import_action('texture.jpg') == 'Importing texture file: texture.jpg'\", \... | {
"split": "train",
"index": 81752,
"acecode_id": "oss_24511",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `check_phrase(input_phrase: str) -> bool` that checks if the given `input_phrase` matches the phrase 'an apple a day keeps the doctor away' or any variations of it where 1-3 words in the phrase can be replaced by their defined synonyms. The synonyms are: 'a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_phrase('an apple a day keeps the doctor away') == True\", \"assert check_phrase('a fruit a time holds a physician gone') == True\", \"assert check_phrase('an fruit a day maintains the physician away') == True\", \"assert check_phrase('an apple a day ke... | {
"split": "train",
"index": 81753,
"acecode_id": "evol_24333",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that returns the distinct elements that appear in all three input lists, sorted in ascending order. The program should not use Python's built-in list functions to sort the result, remove duplicates, or intersect the lists, and the algorithm should have a ti... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shared_elements([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121], [3, 1, 653, 5]) == [1, 5, 653]\", \"assert shared_elements([5, 3, 2, 8], [3, 2, 8], [4, 8, 3, 2]) == [2, 3, 8]\", \"assert shared_elements([], [], []) == []\", \"assert shared_elements([1, ... | {
"split": "train",
"index": 81754,
"acecode_id": "evol_17271",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of rectangles, where each rectangle is defined by two points on a Cartesian plane, implement a function `total_area(rectangles)` that calculates the total area of all the rectangles. Each rectangle is represented as a tuple containing two points, and each point is ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert total_area([((1, 2), (3, 4)), ((-1, -1), (1, 1))]) == 8\", \"assert total_area([((2, 2), (3, 3)), ((4, 4), (5, 5))]) == 2\", \"assert total_area([]) == 0\", \"assert total_area([((1, 1), (3, 2)), ((3, 3), (5, 4))]) == 4\", \"assert total_area([((1, 2), (2, 3... | {
"split": "train",
"index": 81755,
"acecode_id": "evol_12257",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries representing streams, where each dictionary contains the keys 'id' (an integer representing the stream ID) and 'recipient_id' (an integer representing the recipient ID). You also have a user profile represented as a string and a set of subsc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_subscriber_user_ids([{'id': 1, 'recipient_id': 101}, {'id': 2, 'recipient_id': 102}], 'user1', {1, 2}) == {1: [101], 2: [102]}\", \"assert get_subscriber_user_ids([{'id': 1, 'recipient_id': 101}, {'id': 3, 'recipient_id': 103}], 'user1', {1, 3}) == {1: [... | {
"split": "train",
"index": 81756,
"acecode_id": "bigcode_python_fns_30287",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given a directed acyclic graph with `n` vertices numbered from `0` to `n-1`, represented by an array `edges` where `edges[i] = [fromi, toi]` denotes a directed edge from node `fromi` to node `toi`, and an integer `k` representing the maximum path length, implement a function th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert findSmallestSetOfVertices(4, [[0,1],[1,2],[2,3]], 3) == [0]\", \"assert findSmallestSetOfVertices(3, [[0,1],[1,2]], 1) == [0]\", \"assert findSmallestSetOfVertices(7, [[0,1],[1,2],[3,4],[4,5],[5,6]], 2) == [0, 3]\", \"assert findSmallestSetOfVertices(8, [[0,... | {
"split": "train",
"index": 81757,
"acecode_id": "evol_34482",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary that represents the status of different services in a system. Each service is represented by a key-value pair where the key is a string (the service name) and the value is a boolean indicating whether the service is currently active or not. Implement ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unload_services({'service1': True, 'service2': True, 'service3': False}) == {'service1': False, 'service2': False, 'service3': False}\", \"assert unload_services({'service1': False, 'service2': False}) == {'service1': False, 'service2': False}\", \"assert un... | {
"split": "train",
"index": 81758,
"acecode_id": "bigcode_python_fns_12897",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a non-empty list of positive integers and returns all the distinct integers that meet the following conditions: 1. The frequency of the integer in the list is more than half its value. 2. The frequency of the integer is a prime number. 3. The lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert distinctive_elements([1, 1, 2, 3, 5, 8, 2, 2]) == []\", \"assert distinctive_elements([1, 1, 1, 2, 3]) == []\", \"assert distinctive_elements([2, 2, 2, 3, 5, 5]) == []\", \"assert distinctive_elements([3, 3, 3, 5, 8, 5, 5]) == []\", \"assert distinctive_elem... | {
"split": "train",
"index": 81759,
"acecode_id": "evol_36128",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with developing a function that takes a list of integers representing noise thresholds and returns a dictionary where each key is a noise threshold and the corresponding value is a string indicating whether the threshold is considered 'Low', 'Medium', or 'High'. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert categorize_noise_thresholds([1, 3, 5, 7, 11]) == {1: 'Low', 3: 'Low', 5: 'Medium', 7: 'Medium', 11: 'High'}\", \"assert categorize_noise_thresholds([0, 2, 4, 6, 8, 10, 12, 15]) == {0: 'Low', 2: 'Low', 4: 'Low', 6: 'Medium', 8: 'Medium', 10: 'Medium', 12: 'Hi... | {
"split": "train",
"index": 81760,
"acecode_id": "bigcode_python_fns_29142",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates a request's authenticity based on a given signature and associated data. The function will take three parameters: a string `signature`, a dictionary `data`, and a string `auth_token`. The `signature` represents the expected... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_request('wrong_signature', {'key1': 'value1', 'key2': 'value2'}, 'auth_token') == False\", \"assert validate_request('secret123key1value1key2value2wrong_token', {'key1': 'value1', 'key2': 'value2'}, 'wrong_token') == False\", \"assert validate_reque... | {
"split": "train",
"index": 81761,
"acecode_id": "bigcode_python_fns_13359",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of blog posts and extracts specific information from them. Implement a function called `extract_post_info(posts)` that takes a list of blog post dictionaries and returns a list of dictionaries containing the extracte... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_post_info([]) == []\", \"assert extract_post_info([{'id': 1, 'type': 'text', 'note_count': 10}]) == [{'post_id': 1, 'post_type': 'text', 'notes_count': 10}]\", \"assert extract_post_info([{'id': 2, 'type': 'photo', 'note_count': 5}, {'id': 3, 'type':... | {
"split": "train",
"index": 81762,
"acecode_id": "oss_10528",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a list of two strings made up of parentheses '(', ')', squared brackets '[', ']', and curly braces '{', '}', implement a function `match_braces_parens_brackets(lst)` that checks if the concatenation of these strings results in a correctly nested and balanced structure. Ea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert match_braces_parens_brackets(['()', '[]']) == 'Yes'\", \"assert match_braces_parens_brackets(['{[()]}', '({})']) == 'Yes'\", \"assert match_braces_parens_brackets(['(', '{', '[', '}', ')']) == 'No'\", \"assert match_braces_parens_brackets(['[[{}]]', '()']) =... | {
"split": "train",
"index": 81763,
"acecode_id": "evol_21077",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers, implement a function that returns a dictionary containing the elements that are common to both lists. The keys of the dictionary should be the common elements from the first list, and the values should be the count of occurrences of those elements i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert common_elements_frequency([1, 2, 2, 3, 4, 4, 4], [2, 2, 4, 6, 7]) == {2: 2, 4: 1}\", \"assert common_elements_frequency([5, 6, 6, 7], [5, 5, 6, 8]) == {5: 2, 6: 1}\", \"assert common_elements_frequency([9, 8, 7], [1, 2, 3]) == {}\", \"assert common_elements_... | {
"split": "train",
"index": 81764,
"acecode_id": "evol_9352",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `fetch_urls` that takes a string `html_content` as input and returns a list of unique URLs found in the HTML content. The function should ignore any URLs that are invalid or malformed. The URLs should be returned as absolute URLs. For the purpose of this fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fetch_urls('<a href=\\\"http://example.com\\\">Example</a><a href=\\\"/about\\\">About Us</a>') == ['http://example.com', 'http://example.com/about']\", \"assert fetch_urls('<a href=\\\"ftp://example.com/file\\\">FTP File</a><a href=\\\"/relative-path\\\">Re... | {
"split": "train",
"index": 81765,
"acecode_id": "evol_34573",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given an integer n, implement a function `fibfib(n: int) -> int` that calculates the FibFib sequence, which is defined as follows: \n- fibfib(0) == 0 \n- fibfib(1) == 0 \n- fibfib(2) == 1 \n- For n > 2: fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3) \n- For n < 0: fibfib(... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibfib(1) == 0\", \"assert fibfib(2) == 1\", \"assert fibfib(5) == 4\", \"assert fibfib(-1) == 1\", \"assert fibfib(-3) == 0\"]}"
} | {
"split": "train",
"index": 81766,
"acecode_id": "evol_15030",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that determines the latest migration version for a given app label from a list of migration operations. Each migration operation is represented as a tuple containing the app label (a string) and the migration version (a string). The m... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_latest_migration_version([('auth', '0001_auto_20170412_1548'), ('auth', '0002_auto_20170412_1549'), ('formation', '0011_auto_20170412_1548')], 'auth') == '0002_auto_20170412_1549'\", \"assert get_latest_migration_version([('auth', '0001_auto_20170412_154... | {
"split": "train",
"index": 81767,
"acecode_id": "oss_4323",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes a list of strings and returns a new list with the strings sorted by their length in ascending order. If two strings have the same length, sort them alphabetically while ignoring case. The function should not modify the original list.\nPlease r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_strings(['apple', 'banana', 'fig', 'date']) == ['fig', 'date', 'apple', 'banana']\", \"assert sort_strings(['zebra', 'ant', 'cat', 'dog', 'elephant']) == ['ant', 'cat', 'dog', 'zebra', 'elephant']\", \"assert sort_strings(['a', 'ab', 'abc', 'abcd']) == ... | {
"split": "train",
"index": 81768,
"acecode_id": "evol_4192",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D list of integers representing a matrix. Your task is to implement a function that detects the outlier rows in the matrix based on a specified threshold. An 'outlier' row is defined as any row where the maximum value exceeds the average of the maximum values o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_outlier_rows([[1, 1, 1], [2, 2, 2], [3, 3, 3]], 0.5) == [2]\", \"assert find_outlier_rows([[1], [2], [3], [4]], 0.5) == [3]\", \"assert find_outlier_rows([[2, 4, 6], [1, 3, 5], [8, 10, 12]], 2.0) == [2]\", \"assert find_outlier_rows([[0], [0], [0]], 1.0... | {
"split": "train",
"index": 81769,
"acecode_id": "bigcode_python_fns_27222",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the product of all elements in an array without using any built-in multiplication function or operator (*). The algorithm must run in O(n) time complexity and should not use recursion. You can assume the input array will contain only non-neg... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert product_of_all_elements([1, 2, 3, 4]) == 24\", \"assert product_of_all_elements([0, 1, 2, 3]) == 0\", \"assert product_of_all_elements([5, 5, 5]) == 125\", \"assert product_of_all_elements([10]) == 10\", \"assert product_of_all_elements([1]) == 1\", \"assert... | {
"split": "train",
"index": 81770,
"acecode_id": "evol_15524",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a rectangle represented as a 2D list of integers, where each integer denotes the color of that cell in the rectangle. Your task is to implement a function that counts the number of unique colors present in the rectangle. The function should take a single parameter... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_colors([[1, 2, 2], [3, 1, 2], [4, 4, 1]]) == 4\", \"assert count_unique_colors([[0, 0, 0], [0, 0, 0]]) == 1\", \"assert count_unique_colors([[1, 1], [1, 1]]) == 1\", \"assert count_unique_colors([[1, 2], [2, 1]]) == 2\", \"assert count_unique_co... | {
"split": "train",
"index": 81771,
"acecode_id": "bigcode_python_fns_40934",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `filtered_sorted_list(lst: List[str], reverse: bool = False) -> List[str]` that takes a list of strings as input and returns a new list containing only the strings of even length that do not contain any digits. The resulting list should be sorted primarily ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filtered_sorted_list(['a', 'aa', 'aaa', 'aaaa']) == ['aa', 'aaaa']\", \"assert filtered_sorted_list(['abcd', 'efgh', 'ijkl', 'mnop']) == ['abcd', 'efgh', 'ijkl', 'mnop']\", \"assert filtered_sorted_list(['ab1c', 'abcd', '12ef', 'ghij']) == ['abcd', 'ghij']\"... | {
"split": "train",
"index": 81772,
"acecode_id": "evol_26174",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a string input consisting of comma-separated values, write a function `create_list(input_string: str) -> List[str]` that constructs and returns a list of items. If the input string is empty, return an empty list. The function should handle inputs with leading or trailing ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_list('apple,banana,orange') == ['apple', 'banana', 'orange']\", \"assert create_list(' apple , banana , orange ') == ['apple', 'banana', 'orange']\", \"assert create_list('') == []\", \"assert create_list(' ') == []\", \"assert create_list('a... | {
"split": "train",
"index": 81773,
"acecode_id": "bigcode_python_fns_16671",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, determine the minimum number of changes required to make the array a palindrome, such that no number appears more than a specified limit. Implement a function `minimum_changes_to_palindrome(arr: List[int], limit: int) -> int` that takes an array and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert minimum_changes_to_palindrome([1, 2, 2, 1], 2) == 0\", \"assert minimum_changes_to_palindrome([1, 2, 3, 2, 1], 1) == 2\", \"assert minimum_changes_to_palindrome([5, 5, 5, 5, 5], 5) == 0\", \"assert minimum_changes_to_palindrome([1, 2, 3, 4, 5, 5], 3) == 3\",... | {
"split": "train",
"index": 81774,
"acecode_id": "evol_17048",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes conference data. The function should take a list of dictionaries, where each dictionary represents a conference. Your function will return a list of formatted strings, where each string contains the name of the confe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_conferences([]) == []\", \"assert format_conferences([{'name': 'Python Conference', 'description': 'A conference about Python programming.', 'begin': '2023-09-01', 'end': '2023-09-03'}]) == ['Conference Name: Python Conference - A conference about Pyt... | {
"split": "train",
"index": 81775,
"acecode_id": "oss_22125",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that calculates the sum of all positive integers in the list without using any standard mathematical functions. The function should ignore negative integers and return the total sum of the positive integers. Your function should ha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert positive_sum([5, -1, 4, 2, -3]) == 11\", \"assert positive_sum([-10, 4, 7, -5000, -15, 20]) == 31\", \"assert positive_sum([0, -1, -2, -3]) == 0\", \"assert positive_sum([-1, -2, -3, -4]) == 0\", \"assert positive_sum([1, 2, 3, 4, 5]) == 15\", \"assert posit... | {
"split": "train",
"index": 81776,
"acecode_id": "evol_17268",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string consisting of lowercase letters, write a function to find all unique combinations of its characters. The order of characters in each combination does not matter, and combinations should be returned as a list of strings, sorted in lexicographical order. The functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_combinations('abc') == ['a', 'ab', 'abc', 'ac', 'b', 'bc', 'c']\", \"assert find_combinations('') == []\", \"assert find_combinations('a') == ['a']\", \"assert find_combinations('aa') == ['a', 'aa']\", \"assert find_combinations('xyz') == ['x', 'xy', 'x... | {
"split": "train",
"index": 81777,
"acecode_id": "evol_32283",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a list of floating point numbers, implement a function that finds the two numbers with the maximum difference. The function should return these two numbers in ascending order. The input list will contain at least two numbers.\nPlease reason step by step, then write a self... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_furthest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.2]) == (1.0, 5.0)\", \"assert find_furthest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.0]) == (1.0, 5.0)\", \"assert find_furthest_elements([-1.0, 0.0, 1.0]) == (-1.0, 1.0)\", \"assert find_furthest_elements([10.5... | {
"split": "train",
"index": 81778,
"acecode_id": "evol_34278",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of strings, implement a function that converts each string to an integer and returns the total sum of these integers. If a string cannot be converted to an integer, count it as zero in the sum. The function signature is: def sum_strings(arr: List[str]) -> int.\nP... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_strings(['1', '2', '3', '4', '5', 'cat']) == 15\", \"assert sum_strings(['10', '20', '30']) == 60\", \"assert sum_strings(['1', 'two', '3', 'four']) == 4\", \"assert sum_strings(['-1', '-2', '-3']) == -6\", \"assert sum_strings(['abc', 'def', 'ghi']) == ... | {
"split": "train",
"index": 81779,
"acecode_id": "evol_3622",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string, implement a function `replace_multiple_spaces` that replaces all occurrences of multiple consecutive whitespace characters with a single space. The function should be able to handle any number of consecutive spaces, tabs, or other whitespace characters. The outp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_multiple_spaces('hello world how are you') == 'hello world how are you'\", \"assert replace_multiple_spaces(' leading spaces') == ' leading spaces'\", \"assert replace_multiple_spaces('trailing spaces ') == 'trailing spaces '\",... | {
"split": "train",
"index": 81780,
"acecode_id": "evol_32423",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of baseball pitch types and counts the occurrences of a specific type of pitch. The function should take a list of strings representing pitch types and a string representing a specific ball type as input. The ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_pitch_type(['fastball', 'curveball', 'slider', 'fastball'], 'fastball') == 2\", \"assert count_pitch_type(['changeup', 'changeup', 'fastball', 'curveball'], 'curveball') == 1\", \"assert count_pitch_type(['slider', 'slider', 'slider', 'fastball'], 'sli... | {
"split": "train",
"index": 81781,
"acecode_id": "oss_1523",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function to calculate the Euclidean distance between two points in a 2D plane. The Euclidean distance between two points (x1, y1) and (x2, y2) is given by the formula: √((x2 - x1)² + (y2 - y1)²). Please implement a function named `eucli... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert euclidean_distance((0, 0), (3, 4)) == 5.0\", \"assert euclidean_distance((-2, 3), (2, 3)) == 4.0\", \"assert euclidean_distance((1, 1), (1, 1)) == 0.0\", \"assert euclidean_distance((0, 0), (0, 0)) == 0.0\", \"assert euclidean_distance((5, 5), (5, 10)) == 5.... | {
"split": "train",
"index": 81782,
"acecode_id": "oss_32076",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary where each key is a string representing a label name and each value is an integer representing the corresponding file ID. Your task is to implement a function `get_label_file_dict(label_file_dict: Dict[str, int]) -> Dict[str, int]` that returns the sa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_label_file_dict({'apple': 1, 'banana': 2, 'cherry': 3}) == {'apple': 1, 'banana': 2, 'cherry': 3}\", \"assert get_label_file_dict({'banana': 2, 'cherry': 3, 'apple': 1}) == {'apple': 1, 'banana': 2, 'cherry': 3}\", \"assert get_label_file_dict({'grape': ... | {
"split": "train",
"index": 81783,
"acecode_id": "bigcode_python_fns_41452",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple function that simulates a server response for a specific resource. The function `get_resource_response` takes no parameters and returns a string that contains a predefined message. Your function should simply return 'This is me, Falcon, ser... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_resource_response() == 'This is me, Falcon, serving a resource!'\", \"assert get_resource_response() == 'This is me, Falcon, serving a resource!'\", \"assert get_resource_response() == 'This is me, Falcon, serving a resource!'\", \"assert get_resource_re... | {
"split": "train",
"index": 81784,
"acecode_id": "bigcode_python_fns_21355",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of events representing user interactions, determine if the application should exit based on a specific 'QUIT' event and process key presses based on 'KEYDOWN' and 'KEYUP' events. Each event is represented as a dictionary with a type field. The function should retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_events([{'type': 'QUIT'}, {'type': 'KEYDOWN', 'key': 'A'}, {'type': 'KEYUP', 'key': 'A'}]) == (True, ['KEYDOWN: A', 'KEYUP: A'])\", \"assert process_events([{'type': 'KEYDOWN', 'key': 'B'}, {'type': 'KEYUP', 'key': 'B'}, {'type': 'QUIT'}]) == (True, ... | {
"split": "train",
"index": 81785,
"acecode_id": "bigcode_python_fns_22932",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that performs a union operation on two sets. The function should take two sets as input and return a new set that contains all the unique elements from both input sets. Write a function named `union_sets` that takes two sets as parame... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert union_sets({1, 2, 3}, {3, 4, 5}) == {1, 2, 3, 4, 5}\", \"assert union_sets({1, 1, 2}, {2, 3, 3}) == {1, 2, 3}\", \"assert union_sets({10, 20}, {20, 30}) == {10, 20, 30}\", \"assert union_sets({1, 2, 3}, {3, 2, 1}) == {1, 2, 3}\", \"assert union_sets({-1, -2}... | {
"split": "train",
"index": 81786,
"acecode_id": "oss_12733",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that computes the n-th element of a modified Fibonacci sequence with the following definitions: fibfib(0) == 0, fibfib(1) == 0, fibfib(2) == 1. For n > 2, fibfib(n) is defined as fibfib(n-1) + fibfib(n-2) + fibfib(n-3). For n < 0, fibfib(n) is defined as fi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibfib(0) == 0\", \"assert fibfib(1) == 0\", \"assert fibfib(2) == 1\", \"assert fibfib(3) == 1\", \"assert fibfib(4) == 2\", \"assert fibfib(5) == 4\", \"assert fibfib(6) == 7\", \"assert fibfib(7) == 13\", \"assert fibfib(8) == 24\", \"assert fibfib(9) == ... | {
"split": "train",
"index": 81787,
"acecode_id": "evol_32751",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simplified file descriptor management system. A file descriptor is represented by an integer, and the system should support opening, closing, and reading from file descriptors. Implement a function `file_descriptor_operat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert file_descriptor_operations([('open', 'file1.txt')]) == [1]\", \"assert file_descriptor_operations([('open', 'file1.txt'), ('open', 'file1.txt')]) == [1, 1]\", \"assert file_descriptor_operations([('open', 'file1.txt'), ('close', 1)]) == [1, 'Closed file desc... | {
"split": "train",
"index": 81788,
"acecode_id": "oss_34192",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers `z` and a string `rule`. Your task is to implement a function `pivoting_remove(z: List[int], rule: Optional[str]) -> int` that determines the index of an element in the list `z` based on the following rules: 1. If `rule` is `None`, return the in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pivoting_remove([3, 1, 4, 1, 5], None) == 1\", \"assert pivoting_remove([-1, 2, -3, 4], 'bland') == 0\", \"assert pivoting_remove([5, 6, 7], 'bland') == -1\", \"assert pivoting_remove([-5, -1, -2, 0], 'bland') == 0\", \"assert pivoting_remove([-3, -1, -4, -2... | {
"split": "train",
"index": 81789,
"acecode_id": "bigcode_python_fns_41102",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the volumes of a source code. Your task is to implement a function that returns a sublist of volumes based on the provided limit and offset parameters. The function should take three parameters: a list of integers `volumes`, an inte... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_volume_sublist([1, 2, 3, 4, 5], 3, 0) == [1, 2, 3]\", \"assert get_volume_sublist([10, 20, 30, 40, 50], 2, 2) == [30, 40]\", \"assert get_volume_sublist([1, 2, 3], 5, 1) == [2, 3]\", \"assert get_volume_sublist([5, 6, 7], 1, 3) == []\", \"assert get_volu... | {
"split": "train",
"index": 81790,
"acecode_id": "bigcode_python_fns_1925",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with encoding an RSA public key into a specific format. The RSA public key is represented as a dictionary containing two attributes: 'modulus' and 'public_exponent', both of which are byte strings. Your goal is to create a function `encode_rsa_public_key` that ta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert encode_rsa_public_key({'modulus': b'\\\\x01', 'public_exponent': b'\\\\x01'}) == (1, 1)\", \"assert encode_rsa_public_key({'modulus': b'\\\\x00\\\\x02', 'public_exponent': b'\\\\x00\\\\x03'}) == (2, 3)\", \"assert encode_rsa_public_key({'modulus': b'\\\\x00\... | {
"split": "train",
"index": 81791,
"acecode_id": "bigcode_python_fns_15353",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a version number of GDAL in the format 'major.minor.patch', implement a function that checks if the major version is at least a specified minimum version. The function should take two inputs: a string representing the version number and an integer representing the minimum... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_gdal_version('1.2.3', 1) == True\", \"assert check_gdal_version('2.3.4', 1) == True\", \"assert check_gdal_version('0.9.9', 1) == False\", \"assert check_gdal_version('1.0.0', 1) == True\", \"assert check_gdal_version('1.0.1', 2) == False\", \"assert c... | {
"split": "train",
"index": 81792,
"acecode_id": "bigcode_python_fns_2866",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of numerical values, implement a function that calculates the discrete derivative of the data using the central difference method. For the first and last elements, the derivative should be calculated using their nearest neighbors. The function should return a new l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert central_difference_derivative([1.0, 2.0, 3.0]) == [1.0, 1.0, 1.0]\", \"assert central_difference_derivative([2.0, 4.0, 6.0, 8.0]) == [2.0, 2.0, 2.0, 2.0]\", \"assert central_difference_derivative([5.0, 5.0, 5.0]) == [0.0, 0.0, 0.0]\", \"assert central_differ... | {
"split": "train",
"index": 81793,
"acecode_id": "bigcode_python_fns_33766",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing user accounts in a notification authentication system. Implement a function `manage_users` that simulates the setup and removal of users. The function should take a list of operations, where each operation is a tuple containing an action and a usern... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_users([('setup', 'test-user'), ('setup', 'test-user'), ('dispose', 'test-user')]) == 0\", \"assert manage_users([('setup', 'test-user'), ('setup', 'test-user2'), ('dispose', 'test-user')]) == 1\", \"assert manage_users([('setup', 'user1'), ('setup', '... | {
"split": "train",
"index": 81794,
"acecode_id": "bigcode_python_fns_21693",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function in Python that finds the maximum number in a list of integers without using the built-in max function, any sorting functions, or looping constructs (like for or while). The function should handle both positive and negative integers as well as zero. It should be... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max([15, 32, 76, 48, -90, 22]) == 76\", \"assert find_max([0, -32, -76, -48, -90, -22]) == 0\", \"assert find_max([-1, -2, -3, -4]) == -1\", \"assert find_max([-10, -5, -3, 0, 2]) == 2\", \"assert find_max([100, 200, 300, 400]) == 400\", \"assert find_m... | {
"split": "train",
"index": 81795,
"acecode_id": "evol_24160",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string consisting of lowercase letters. Your task is to write a function that returns the longest substring without repeating characters. A substring is defined as a contiguous sequence of characters within the string. If there are multiple longest substrings, r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longest_unique_substring('abcabcbb') == 'abc'\", \"assert longest_unique_substring('bbbbb') == 'b'\", \"assert longest_unique_substring('pwwkew') == 'wke'\", \"assert longest_unique_substring('') == ''\", \"assert longest_unique_substring('a') == 'a'\", \"as... | {
"split": "train",
"index": 81796,
"acecode_id": "oss_17041",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a numeric value `n`, write a function `enlarge` that multiplies this number by 100 and returns the result. The function should handle both integers and floating-point numbers. For example, if the input is 5, the output should be 500. If the input is 2.5, the output should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert enlarge(0) == 0\", \"assert enlarge(1) == 100\", \"assert enlarge(5) == 500\", \"assert enlarge(-3) == -300\", \"assert enlarge(2.5) == 250.0\", \"assert enlarge(-1.5) == -150.0\", \"assert enlarge(100) == 10000\", \"assert enlarge(-100) == -10000\", \"asser... | {
"split": "train",
"index": 81797,
"acecode_id": "bigcode_python_fns_33398",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the sum of Fibonacci numbers up to a given limit `n`. The function should only consider Fibonacci numbers that are either divisible by 3 or 5, and whose last digit is either 3 or 7. Additionally, the function should return the indexes of the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacciSumIndexes(0) == {'sum': 0, 'indexes': []}\", \"assert fibonacciSumIndexes(1) == {'sum': 0, 'indexes': []}\", \"assert fibonacciSumIndexes(2) == {'sum': 0, 'indexes': []}\", \"assert fibonacciSumIndexes(5) == {'sum': 3, 'indexes': [4]}\", \"assert f... | {
"split": "train",
"index": 81798,
"acecode_id": "evol_14898",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a string that represents a host address. Your task is to implement a function `get_server_version(host: str) -> str` that simulates retrieving the version of a server based on the provided host address. The function should return a version string in the format 'vX... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_server_version('localhost') == 'v1.0.0'\", \"assert get_server_version('192.168.1.1') == 'v1.2.3'\", \"assert get_server_version('example.com') == 'v0.0.1'\", \"assert get_server_version('127.0.0.1') == 'v0.0.1'\", \"assert get_server_version('myserver.l... | {
"split": "train",
"index": 81799,
"acecode_id": "bigcode_python_fns_35385",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.