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 function that simulates a book search by returning predefined details about a book based on its name. Write a function called `book_search` that takes a string `book_name` as its parameter. The function should return a dictionary containing the fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert book_search('Python Programming') == {'title': 'Python Programming', 'author': ['John Doe'], 'published_date': '2020-01-01', 'description': 'An introduction to Python programming.'}\", \"assert book_search('Data Science 101') == {'title': 'Data Science 101',... | {
"split": "train",
"index": 78700,
"acecode_id": "oss_22754",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked to implement a function that simulates adding values with different priorities to a priority queue. The function should take a list of tuples, where each tuple consists of a value (a string) and its associated priority (an integer). Your function should return a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_to_priority_queue([('a', 1), ('b', 2), ('c', 1)]) == {1: ['a', 'c'], 2: ['b']}\", \"assert add_to_priority_queue([('x', 3), ('y', 2), ('z', 3), ('w', 1)]) == {3: ['x', 'z'], 2: ['y'], 1: ['w']}\", \"assert add_to_priority_queue([]) == {}\", \"assert add_... | {
"split": "train",
"index": 78701,
"acecode_id": "bigcode_python_fns_48931",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that reads a string representation of a YAML configuration and returns its equivalent Python data structure (a list or dictionary). If the input string is empty or invalid, the function should return an empty dictionary. If the string... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert load_yaml_string('') == {}\", \"assert load_yaml_string('key: value') == {'key': 'value'}\", \"assert load_yaml_string('- item1\\\\n- item2') == ['item1', 'item2']\", \"assert load_yaml_string('key1: value1\\\\nkey2: value2') == {'key1': 'value1', 'key2': 'v... | {
"split": "train",
"index": 78702,
"acecode_id": "bigcode_python_fns_19923",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing actions that may be performed on a software package. The first action in the list can either be 'plugin' or 'plugins', indicating that subsequent actions are related to uninstalling plugins. Write a function `complete_uninstall(actio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert complete_uninstall([]) == ['uninstall']\", \"assert complete_uninstall(['plugin']) == []\", \"assert complete_uninstall(['plugins']) == []\", \"assert complete_uninstall(['plugin', 'remove']) == ['remove']\", \"assert complete_uninstall(['plugins', 'delete']... | {
"split": "train",
"index": 78703,
"acecode_id": "bigcode_python_fns_9472",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary that contains integer values associated with two specific keys: 'y' for yellow values and 's' for silver values. Your task is to implement a function `calculate_total(dictionary)` that calculates and returns the total sum of the values associated with... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total({'y': 10, 's': 5}) == 15\", \"assert calculate_total({'y': 20, 's': 30}) == 50\", \"assert calculate_total({'y': 0, 's': 0}) == 0\", \"assert calculate_total({'y': 5, 's': 5}) == 10\", \"assert calculate_total({'y': -5, 's': -10}) == -15\", \... | {
"split": "train",
"index": 78704,
"acecode_id": "oss_28506",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that sorts an array of integers based on a multi-stage condition defined by a provided condition function. The condition function should prioritize even numbers over odd numbers, and for numbers within the same category, sort them in ascending order. The fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_elements([4, 1, 2, 6, 3, 5], lambda e: (e % 2, e)) == [2, 4, 6, 1, 3, 5]\", \"assert sort_elements([10, 7, 8, 3], lambda e: (e % 2, e)) == [8, 10, 3, 7]\", \"assert sort_elements([1, 3, 5], lambda e: (e % 2, e)) == [1, 3, 5]\", \"assert sort_elements([2... | {
"split": "train",
"index": 78705,
"acecode_id": "evol_24709",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that extracts only alphanumeric characters from a given input, which can be a string or a list of strings, and counts the frequency of each alphanumeric character in the input (consider case insensitivity). The function should return a dictionary where t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert char_freq('abc123') == {'a': 1, 'b': 1, 'c': 1, '1': 1, '2': 1, '3': 1}\", \"assert char_freq('Hello World!') == {'h': 1, 'e': 1, 'l': 3, 'o': 2, 'w': 1, 'r': 1, 'd': 1}\", \"assert char_freq('12345!@#$%') == {'1': 1, '2': 1, '3': 1, '4': 1, '5': 1}\", \"ass... | {
"split": "train",
"index": 78706,
"acecode_id": "evol_777",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a list of run entries, where each entry is represented as a dictionary with the following keys: 'run_id', 'protocol_id', 'created_at' (a datetime string in the format 'YYYY-MM-DDTHH:MM:SSZ'), 'actions' (a list of action strings), and 'is_current' (a boolean indica... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_run_entry([{'run_id': 'run-id', 'protocol_id': None, 'created_at': '2021-01-01T00:00:00Z', 'actions': [], 'is_current': False}], 'run-id') == {'run_id': 'run-id', 'protocol_id': None, 'created_at': '2021-01-01T00:00:00Z', 'actions': [], 'is_current': Fal... | {
"split": "train",
"index": 78707,
"acecode_id": "bigcode_python_fns_32498",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating a report for a system that processes NAG (Next-Generation Architecture) statistics. Implement a function `get_nag_statistics(constant_number: int, input_number: int, nand_number: int, output_number: int, input_to_output_min_distance: int, input_to... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_nag_statistics(5, 10, 15, 20, 2, 7) == 'Constants: 5\\\\nInputs: 10\\\\nNANDs: 15\\\\nOutputs: 20\\\\nMin. I/O distance: 2\\\\nMax. I/O distance: 7'\", \"assert get_nag_statistics(0, 0, 0, 0, 0, 0) == 'Constants: 0\\\\nInputs: 0\\\\nNANDs: 0\\\\nOutputs:... | {
"split": "train",
"index": 78708,
"acecode_id": "bigcode_python_fns_39159",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `validate_sequence(seq: str) -> bool` that checks if a given sequence contains only uppercase letters and digits, where the first character must be a letter and the sequence must end in a digit. Furthermore, the sequence must contain a minimum of two upperc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_sequence('AB12') == True\", \"assert validate_sequence('A1') == False\", \"assert validate_sequence('45XY') == False\", \"assert validate_sequence('B5') == False\", \"assert validate_sequence('AA12') == True\", \"assert validate_sequence('AAB1') == ... | {
"split": "train",
"index": 78709,
"acecode_id": "evol_14573",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to implement a function `unique_count(arr: List[int]) -> Dict[int, int]` that takes in this list and returns a dictionary where the keys are the unique integers from the list and the values are the counts of their occurrences in th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_count([1, 2, 2, 3]) == {1: 1, 2: 2, 3: 1}\", \"assert unique_count([1, 1, 1, 1]) == {1: 4}\", \"assert unique_count([]) == {}\", \"assert unique_count([5, 5, 5, 6, 6]) == {5: 3, 6: 2}\", \"assert unique_count([0, 0, 0]) == {0: 3}\", \"assert unique_co... | {
"split": "train",
"index": 78710,
"acecode_id": "bigcode_python_fns_472",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `unique(l: list) -> list` that takes a list of integers as input, identifies the elements that appear exactly once, and returns a new list containing these unique elements sorted in ascending order. The function should maintain the integrity of the list by ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique([4, 7, 2, 4, 6, 7, 7, 10, 0, 124]) == [0, 2, 6, 10, 124]\", \"assert unique([1, 2, 2, 3, 4, 4, 5]) == [1, 3, 5]\", \"assert unique([5, 5, 5, 5]) == []\", \"assert unique([10, 20, 20, 30, 40]) == [10, 30, 40]\", \"assert unique([]) == []\", \"assert un... | {
"split": "train",
"index": 78711,
"acecode_id": "evol_15629",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of city data, where each city is represented as a tuple containing an ID (as a string) and a name (as a string). Your task is to implement a function `get_city_objects(city_data: List[Tuple[str, str]]) -> List[City]` that converts this list of city data int... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_city_objects([('1', 'New York'), ('2', 'Los Angeles')]) == [City(1, 'New York'), City(2, 'Los Angeles')]\", \"assert get_city_objects([('3', 'Chicago'), ('4', 'Houston')]) == [City(3, 'Chicago'), City(4, 'Houston')]\", \"assert get_city_objects([('5', 'P... | {
"split": "train",
"index": 78712,
"acecode_id": "bigcode_python_fns_32416",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a method reference, write a function that checks whether the method is bound to an instance of a class and returns the instance it is bound to if applicable. If the method is not bound to any instance, return None. The function should take a single argument, which is the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_bound_method(obj.test_method) == obj\", \"assert is_bound_method(TestClass.test_method) == None\", \"assert is_bound_method(None) == None\", \"assert is_bound_method(lambda x: x) == None\", \"assert is_bound_method(TestClass.test_method.__get__(obj)) == o... | {
"split": "train",
"index": 78713,
"acecode_id": "evol_28837",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that validates a Bitcoin block header based on its hash and difficulty target. The validation process involves checking if the block header's hash meets a specified difficulty target, which is determined by the maximum target and the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_block_header('0000000000000000000a2f8b0e2c3b3d4f5e6a7b8c9d0e1f2a3b4c5d6e7f8a9b', 0x1f00ffff, 0x0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff, '9c89283ba0f3227f6c03b70216b9f665f0118d5e0fa729cedf4fb34d6a34f463', 0x1f00ffff, unhexlif... | {
"split": "train",
"index": 78714,
"acecode_id": "oss_11542",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a list of creatures and a specific creature, implement a function `is_mammal(x: str, creatures: List[str]) -> bool` that determines whether the specified creature is classified as a mammal. The function should return `True` if the creature is found in the list of mammals ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_mammal('dog', ['dog', 'cat', 'elephant']) == True\", \"assert is_mammal('fish', ['dog', 'cat', 'elephant']) == False\", \"assert is_mammal('elephant', ['dog', 'cat', 'elephant']) == True\", \"assert is_mammal('bird', ['dog', 'cat', 'elephant']) == False\"... | {
"split": "train",
"index": 78715,
"acecode_id": "evol_29374",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of key-value pairs in the form of strings where each key is a dot-separated string representing nested dictionary keys and each corresponding value is a string representation of the value to be set. Your task is to create a function named `set_config_values... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_config_values(['database.host', '127.0.0.1', 'database.port', '5432']) is None\", \"assert set_config_values(['application.name', 'YourApp', 'application.version', '2.0']) is None\", \"assert set_config_values(['database.host', 'localhost', 'database.por... | {
"split": "train",
"index": 78716,
"acecode_id": "bigcode_python_fns_109",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates a grid-based image with specific properties. The function should create a grid of cells, each of which can be colored black or white. The grid should have a minimum area size of 30x30 cells, initialized with all cells c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_and_color_grid(30, 30, [(29, 29, 255)]) == [[255]*30 for _ in range(29)]+[[255]*29+[255]]\", \"assert generate_and_color_grid(30, 30, [(15, 15, 0), (15, 15, 255)]) == [[255]*30 for _ in range(30)]\", \"assert generate_and_color_grid(29, 29, [(0, 0, ... | {
"split": "train",
"index": 78717,
"acecode_id": "oss_11016",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Develop a Python function called `binary_search` that takes a sorted list of integers and an integer value to search for. The function should return the index of the value in the list if it exists, or -1 if it does not. The function should raise a ValueError if the list is not ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binary_search([1, 2, 3, 4, 5], 3) == 2\", \"assert binary_search([10, 20, 30, 40, 50], 10) == 0\", \"assert binary_search([10, 20, 30, 40, 50], 50) == 4\", \"assert binary_search([5, 10, 15, 20, 25], 15) == 2\", \"assert binary_search([1, 2, 3, 4, 5], 6) == ... | {
"split": "train",
"index": 78718,
"acecode_id": "evol_13403",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers and your task is to implement a function that calculates the sum of all the even numbers in the list. The function should take a single parameter, which is a list of integers, and return the sum of all even numbers. If there are no even numbers,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_evens([2, 4, 6, 1, 3, 5, 7, 8, 9]) == 20\", \"assert sum_of_evens([1, 3, 5, 7, 9]) == 0\", \"assert sum_of_evens([0, 2, 4, 6]) == 12\", \"assert sum_of_evens([-2, -4, -6, -1, -3]) == -12\", \"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_o... | {
"split": "train",
"index": 78719,
"acecode_id": "oss_15664",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that adds a signal for a bank member in a bank's database. A bank member is identified by their unique bank_member_id, and each bank is identified by its bank_id. The function should ensure that duplicate signals (defined as the combi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_bank_member_signal('bank123', 'member001', 'typeA', 'value1') == 'Signal added successfully'\", \"assert add_bank_member_signal('bank123', 'member002', 'typeB', 'value2') == 'Signal added successfully'\", \"assert add_bank_member_signal('bank124', 'membe... | {
"split": "train",
"index": 78720,
"acecode_id": "bigcode_python_fns_47400",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Write a function that identifies the longest string from a list that starts with a given prefix, ends with a given suffix, and contains a specific sequence within the string. If there are multiple candidates with the same length, return the first one encountered. Additionally, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_longest_string_sum(['abc', 'ac', 'a', 'ab'], ('a', 'c'), 'b') == ('abc', 6)\", \"assert find_longest_string_sum(['abc', 'abcd', 'abcde'], ('a', 'd'), 'c') == ('abcd', 10)\", \"assert find_longest_string_sum(['no', 'yes', 'maybe'], ('y', 'e'), 'ab') == (... | {
"split": "train",
"index": 78721,
"acecode_id": "evol_5594",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating the control of a multi-outlet device. The device has a specific number of outlets, each of which can be switched on or off. Write a function `switch_on_outlet(devices: List[int], outlet: int) -> List[int]` that takes in a list of integers represen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert switch_on_outlet([0, 0, 0], 2) == [0, 1, 0]\", \"assert switch_on_outlet([1, 0, 1], 1) == [1, 0, 1]\", \"assert switch_on_outlet([1, 1, 1], 3) == [1, 1, 1]\", \"assert switch_on_outlet([0, 0, 0], 4) == [0, 0, 0]\", \"assert switch_on_outlet([0, 0, 0], 0) == ... | {
"split": "train",
"index": 78722,
"acecode_id": "bigcode_python_fns_38034",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a graph representing a network of rooms in a building. Each room is labeled with a unique integer identifier. The graph is represented as an adjacency list, where each key-value pair in the dictionary `rooms` represents a room and the rooms it is connected to. For... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_connected_rooms({1: [2], 2: [1]}, 1) == [1, 2]\", \"assert find_connected_rooms({1: [2, 3], 2: [1], 3: [1]}, 2) == [2, 1, 3]\", \"assert find_connected_rooms({1: [], 2: [], 3: []}, 1) == [1]\", \"assert find_connected_rooms({1: [2], 2: [3], 3: []}, 1) =... | {
"split": "train",
"index": 78723,
"acecode_id": "oss_35",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function 'queue_operations' that simulates a queue with a maximum size. The function takes an integer 'max_size' and a list of operations, where each operation is a tuple. The operations can be one of the following: ('enqueue', value), ('dequeue',), ('front',), ('is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert queue_operations(1, [('enqueue', 5), ('enqueue', 6), ('front',), ('dequeue',), ('size',), ('isEmpty',)]) == [5, 0, True]\", \"assert queue_operations(2, [('enqueue', 7), ('front',), ('dequeue',), ('front',)]) == [7, None]\", \"assert queue_operations(2, [('e... | {
"split": "train",
"index": 78724,
"acecode_id": "evol_3295",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `process_data(data: str, encode_hints: bool, decode_hints: bool) -> str` that processes an input string based on encoding and decoding hints. If `encode_hints` is set to `True`, the function should return the input string reversed. If `de... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_data('hello', False, True) == 'HELLO'\", \"assert process_data('hello', True, True) == 'OLLEH'\", \"assert process_data('hello', False, False) == 'hello'\", \"assert process_data('', False, True) == ''\", \"assert process_data('', True, True) == ''\"... | {
"split": "train",
"index": 78725,
"acecode_id": "oss_26811",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a string representation of a molecular structure in SMILES notation and returns a string that describes the corresponding molecule. The output should be a simple textual description that includes the number of atoms and the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert describe_molecule('C') == '1 Carbon atom'\", \"assert describe_molecule('CC') == '2 Carbon atoms'\", \"assert describe_molecule('O') == '1 Oxygen atom'\", \"assert describe_molecule('CCO') == '2 Carbon atoms, 1 Oxygen atom'\", \"assert describe_molecule('CC(... | {
"split": "train",
"index": 78726,
"acecode_id": "bigcode_python_fns_5325",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that performs division and handles potential errors. The function should take two parameters, `a` and `b`, representing the numerator and denominator, respectively. Your task is to complete the function `div` so that it returns the re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert div(10, 2) == 5.0\", \"assert div(-10, 2) == -5.0\", \"assert div(10, -2) == -5.0\", \"assert div(0, 1) == 0.0\", \"assert div(8, '2') == 'Invalid input'\", \"assert div(8, None) == 'Invalid input'\", \"assert div('8', 2) == 'Invalid input'\", \"assert div(8... | {
"split": "train",
"index": 78727,
"acecode_id": "oss_15362",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of bus voltages in per unit (pu) format and two voltage boundaries: a maximum voltage (vm_max) and a minimum voltage (vm_min). Your task is to determine whether all the bus voltages in the list are within the specified boundaries. Implement a function `chec... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_voltage_boundaries([1.0, 0.98, 0.96], 0.96, 1.04) == True\", \"assert check_voltage_boundaries([1.05, 0.98, 0.96], 0.96, 1.04) == False\", \"assert check_voltage_boundaries([0.95, 0.98, 1.0], 0.96, 1.04) == False\", \"assert check_voltage_boundaries([0... | {
"split": "train",
"index": 78728,
"acecode_id": "bigcode_python_fns_17501",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates an output based on a user's permission and a specified action. The function takes two parameters: a user object and an action string. The user object has a method `has_access_to` that checks if the user has permission t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_action_response(User(True), 'export') == 'Action export successful.'\", \"assert generate_action_response(User(True), 'view') == 'Action view successful.'\", \"assert generate_action_response(User(True), 'delete') == 'Action delete successful.'\", \... | {
"split": "train",
"index": 78729,
"acecode_id": "bigcode_python_fns_38790",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a grid representing a game board with a certain number of rows and columns. Your task is to implement a function `edit_moves` that takes a `position` represented as a tuple `(row, col)` indicating the current position on the board. The function should generate all... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert edit_moves((0, 0)) == [(1, 1)]\", \"assert edit_moves((6, 6)) == [(5, 5)]\", \"assert edit_moves((0, 6)) == [(1, 5)]\", \"assert edit_moves((6, 0)) == [(5, 1)]\", \"assert edit_moves((3, 0)) == [(2, 1), (4, 1)]\", \"assert edit_moves((0, 3)) == [(1, 4), (1, ... | {
"split": "train",
"index": 78730,
"acecode_id": "oss_6743",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a robot movement system that processes a series of instructions. The robot can move along three axes: X, Y, and Z, and in four directions: FORWARD, BACKWARD, LEFT, and RIGHT. The movements are specified using a list of instructions, where each i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_instructions([('Y', 2), ('LEFT', 4), ('Z', 1)]) == {'X': -4, 'Y': 2, 'Z': 1}\", \"assert process_instructions([('Z', 5), ('BACKWARD', 3), ('X', 2)]) == {'X': 2, 'Y': -3, 'Z': 5}\", \"assert process_instructions([('Y', -10), ('RIGHT', 5), ('Z', 0)]) =... | {
"split": "train",
"index": 78731,
"acecode_id": "oss_14809",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Define an abstract base class in Python with the name 'Animal'. This class should contain two abstract methods called 'communicate' and 'display_behavior'. Create four different classes 'Cat', 'Dog', 'Parrot', and 'Elephant' derived from the 'Animal' class. Each derived class s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert animal_info('Snowball', 'Cat', 2) == 'Snowball says Meow! Snowball, the cat, is playing with yarn.'\", \"assert animal_info('Rex', 'Dog', 5) == 'Rex says Woof! Rex, the dog, is chasing its tail.'\", \"assert animal_info('Whiskers', 'Cat', 3) == 'Whiskers say... | {
"split": "train",
"index": 78732,
"acecode_id": "evol_17803",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function called `check_maintenance_status` that determines whether a specific host is past its maintenance end time. The function takes two parameters: a hostname (string) and a boolean value indicating whether the host is past its maintenance... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_maintenance_status('host1', True) == True\", \"assert check_maintenance_status('host2', False) == False\", \"assert check_maintenance_status('host3', True) == True\", \"assert check_maintenance_status('host4', False) == False\", \"assert check_maintena... | {
"split": "train",
"index": 78733,
"acecode_id": "oss_10746",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of music tracks and returns a new list with each track repeated a specific number of times based on a corresponding list of repeat flags. Each track is represented by a string and the repeat flags are represented by ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_playlist(['song1.mp3', 'song2.mp3'], [False, True]) == ['song1.mp3', 'song2.mp3', 'song2.mp3']\", \"assert manage_playlist(['song1.mp3'], [True]) == ['song1.mp3', 'song1.mp3']\", \"assert manage_playlist([], []) == []\", \"assert manage_playlist(['son... | {
"split": "train",
"index": 78734,
"acecode_id": "oss_25354",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that calculates the median of a list of scores. The median is defined as the middle value in a sorted list of numbers. If the list has an odd number of elements, the median is the middle element. If the list has an even number ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_median([85, 90, 92, 88, 78]) == 88\", \"assert calculate_median([1, 3, 3, 6, 7, 8, 9]) == 6\", \"assert calculate_median([1, 2, 3, 4]) == 2.5\", \"assert calculate_median([5, 1, 2, 4, 3]) == 3\", \"assert calculate_median([10, 20, 30]) == 20\", \"a... | {
"split": "train",
"index": 78735,
"acecode_id": "oss_30800",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `s`, remove the vowels 'a', 'e', 'i', 'o', and 'u' from it, and return the new string along with the count of each removed vowel in a dictionary. The dictionary should have vowels as keys and their respective counts as values.\nPlease reason step by step, then wr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert removeVowels('aeiou') == ('', {'a': 1, 'e': 1, 'i': 1, 'o': 1, 'u': 1})\", \"assert removeVowels('hello') == ('hll', {'a': 0, 'e': 1, 'i': 0, 'o': 1, 'u': 0})\", \"assert removeVowels('python') == ('pythn', {'a': 0, 'e': 0, 'i': 0, 'o': 1, 'u': 0})\", \"asse... | {
"split": "train",
"index": 78736,
"acecode_id": "evol_758",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python class to manage user profiles. Your task is to implement the `User` class with the following methods: 1. `getProfile()`: Returns the user's profile as a dictionary. 2. `fromEmail(email)`: A class method that takes an email address as a para... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert User('user1@example.com', {'testfield1': 'value1', 'testfield2': 'value2'}).getProfile() == {'testfield1': 'value1', 'testfield2': 'value2'}\", \"assert User.fromEmail('user1@example.com').getProfile() == {'testfield1': 'value1', 'testfield2': 'value2'}\", \... | {
"split": "train",
"index": 78737,
"acecode_id": "oss_644",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple echo WebSocket server and client using a hypothetical WebSocket library. The server should accept messages from the client and respond by sending the same message back to the client. Your goal is to implement a single function `echoWebSocke... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert echoWebSocket(['Hello', 'World']) == ['Hello', 'World']\", \"assert echoWebSocket(['Test', 'Message']) == ['Test', 'Message']\", \"assert echoWebSocket(['']) == ['']\", \"assert echoWebSocket(['Single']) == ['Single']\", \"assert echoWebSocket(['Echo', 'This... | {
"split": "train",
"index": 78738,
"acecode_id": "oss_7791",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks whether a given list of integers contains any duplicates. The function should take a list of integers as input and return a boolean value: `True` if there are any duplicates in the list, and `False` otherwise. Implement a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert contains_duplicates([1, 2, 3, 1]) == True\", \"assert contains_duplicates([1, 2, 3, 4]) == False\", \"assert contains_duplicates([]) == False\", \"assert contains_duplicates([5, 5, 5]) == True\", \"assert contains_duplicates([10, 20, 30, 40, 50]) == False\",... | {
"split": "train",
"index": 78739,
"acecode_id": "oss_16993",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are working on a quality control system for inspecting printed circuit boards (PCBs). You need to implement a function that adds solder joint defects to a PCB view. Each solder joint defect is associated with a component, a unique defect ID, a defect name, and a region of i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_solder_joint('Resistor', 'D001', 'Cold Solder', [0, 0, 10, 10]) == None\", \"assert add_solder_joint('Capacitor', 'D002', 'Solder Bridge', [10, 10, 20, 20]) == None\", \"assert add_solder_joint('Inductor', 'D003', 'Open Circuit', [20, 20, 30, 30]) == Non... | {
"split": "train",
"index": 78740,
"acecode_id": "oss_16943",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple function that generates a command to create a namespace in a Kubernetes cluster. The function should take a configuration dictionary as input, which contains a 'namespace' key. Your function should return a command string formatted to creat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_k8s_namespace_command({'namespace': 'test-namespace'}) == 'kubectl create namespace test-namespace'\", \"assert create_k8s_namespace_command({'namespace': 'prod'}) == 'kubectl create namespace prod'\", \"assert create_k8s_namespace_command({'namespace... | {
"split": "train",
"index": 78741,
"acecode_id": "bigcode_python_fns_3815",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that converts between hexadecimal and decimal formats. The function should take a positive integer as input when converting from decimal to hexadecimal, and a string representing a hexadecimal number consisting of digits (0-9) and letters (A-F) when convert... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert switch_format('A', 'hexadecimal_to_decimal') == 10\", \"assert switch_format('1F', 'hexadecimal_to_decimal') == 31\", \"assert switch_format('FF', 'hexadecimal_to_decimal') == 255\", \"assert switch_format('10', 'hexadecimal_to_decimal') == 16\", \"assert sw... | {
"split": "train",
"index": 78742,
"acecode_id": "evol_13169",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a generator expression that iterates through a provided list of whole numbers and yields only the prime numbers from the list. Implement a function `yield_primes(numbers)` that takes a list of integers and returns a generator for the prime numbers in that list.\nPlease ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert list(yield_primes([23, 45, 7, 18, 9, 11, 14, 39, 22])) == [23, 7, 11]\", \"assert list(yield_primes([1, 4, 6, 8, 9, 10])) == []\", \"assert list(yield_primes([2, 3, 5, 7, 11])) == [2, 3, 5, 7, 11]\", \"assert list(yield_primes([])) == []\", \"assert list(yie... | {
"split": "train",
"index": 78743,
"acecode_id": "evol_25552",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, where each string contains comma-separated values. Each string represents a record of credentials in the format 'username,email,access_key,secret_key'. Write a function `extract_keys(records: List[str]) -> List[Tuple[str, str]]` that takes a lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_keys(['user1,user1@example.com,key1,secret1', 'user2,user2@example.com,key2,secret2']) == [('key1', 'secret1'), ('key2', 'secret2')]\", \"assert extract_keys(['user1,user1@example.com,key1,secret1', 'user2,user2@example.com,key2']) == [('key1', 'secr... | {
"split": "train",
"index": 78744,
"acecode_id": "bigcode_python_fns_4664",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of integers as input and returns a new list containing only the unique integers from the original list, preserving their order of first appearance. Your function should eliminate all duplicates while maintaining the sequ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_duplicates([1, 2, 3, 2, 1, 4]) == [1, 2, 3, 4]\", \"assert remove_duplicates([5, 5, 5, 5]) == [5]\", \"assert remove_duplicates([1, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert remove_duplicates([]) == []\", \"assert remove_duplicates([1, 2, 3, 1, 2]) == [1,... | {
"split": "train",
"index": 78745,
"acecode_id": "oss_4786",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that returns the string 'Model is served on RedisAI.' when called. The function should not take any parameters and should not perform any external operations. Implement the function to fulfill this requirement.\nPlease reason step by step... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert commands() == 'Model is served on RedisAI.'\", \"assert commands() == 'Model is served on RedisAI.'\", \"assert commands() == 'Model is served on RedisAI.'\", \"assert commands() == 'Model is served on RedisAI.'\", \"assert commands() == 'Model is served on ... | {
"split": "train",
"index": 78746,
"acecode_id": "bigcode_python_fns_4695",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of 3D poses represented as tuples (x, y, theta), write a function `compute_translation_error(pred_pose: List[Tuple[float, float, float]], gt_pose: List[Tuple[float, float, float]], reduction: str = 'mean') -> float` that computes the translation error between th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_translation_error([(1.0, 2.0, 0.0), (3.0, 4.0, 0.0)], [(1.0, 2.0, 0.0), (3.0, 4.0, 0.0)]) == 0.0\", \"assert compute_translation_error([(1.0, 2.0, 0.0), (3.0, 4.0, 0.0)], [(1.0, 3.0, 0.0), (3.0, 5.0, 0.0)]) == 1.0\", \"assert compute_translation_erro... | {
"split": "train",
"index": 78747,
"acecode_id": "bigcode_python_fns_20404",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that determines the sex of an individual based on genetic data. The function `determine_sex` takes a single parameter `genetic_code`, which is a string representing the genetic data. The function should return 'Male' if the genetic co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert determine_sex('XY') == 'Male'\", \"assert determine_sex('XX') == 'Female'\", \"assert determine_sex('X') == 'Unknown'\", \"assert determine_sex('YY') == 'Unknown'\", \"assert determine_sex('XYZ') == 'Unknown'\", \"assert determine_sex('XXY') == 'Unknown'\", ... | {
"split": "train",
"index": 78748,
"acecode_id": "oss_12618",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with validating a version parameter for a configuration system. The valid version parameters are 'buffer' and 'committed'. Write a function `validate_version_parameter(version: str) -> bool` that takes a single string input, `version`, and returns `True` if the v... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_version_parameter('buffer') == True\", \"assert validate_version_parameter('committed') == True\", \"assert validate_version_parameter('asdfjkl') == False\", \"assert validate_version_parameter('') == False\", \"assert validate_version_parameter('ve... | {
"split": "train",
"index": 78749,
"acecode_id": "bigcode_python_fns_42825",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that returns a new list containing only the unique integers from the original list while maintaining their original order. The function should remove any duplicate integers from the original list. For example, if the input list is [4, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_duplicates([4, 5, 4, 3, 2, 5, 6]) == [4, 5, 3, 2, 6]\", \"assert remove_duplicates([1, 2, 2, 3, 4, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert remove_duplicates([10, 20, 10, 30, 40, 50, 20]) == [10, 20, 30, 40, 50]\", \"assert remove_duplicates([]) == []\",... | {
"split": "train",
"index": 78750,
"acecode_id": "bigcode_python_fns_25858",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a non-negative integer `num`, return the number of steps to reduce it to zero. If the current number is even, you have to divide it by 2, otherwise, you have to subtract 1 from it. However, if the number is divisible by 3, you have to subtract 2 from it instead of 1. Impl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert numberOfSteps(14) == 6\", \"assert numberOfSteps(8) == 4\", \"assert numberOfSteps(0) == 0\", \"assert numberOfSteps(1) == 1\", \"assert numberOfSteps(3) == 2\", \"assert numberOfSteps(4) == 3\", \"assert numberOfSteps(6) == 4\", \"assert numberOfSteps(7) ==... | {
"split": "train",
"index": 78751,
"acecode_id": "evol_24033",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes incoming data from a messaging platform and extracts relevant information about users who are ready to engage on the platform. The incoming data is in the form of a list of dictionaries, each representing a user ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_ready_data([{ 'version': '1.0', 'session_id': 'abc123', 'user': { 'id': 'user123', 'username': 'john_doe', 'bot': False }, 'shard': [1, 2, 3] }]) == [('user123', 'john_doe')]\", \"assert process_ready_data([{ 'version': '1.0', 'session_id': 'abc123',... | {
"split": "train",
"index": 78752,
"acecode_id": "oss_10371",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the median of a list containing mixed data types (integers, floats, and strings) without sorting the list. The function should handle variable-sized tuples and duplicates, using a custom comparison function to determine the order of elements... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert advanced_median([1, 2, 2, 4, 5], lambda a, b: a - b) == 2\", \"assert advanced_median(['a', 'b', 1, 2], lambda a, b: a - b) == None\", \"assert advanced_median(['apple', 'banana', 'cherry', 1], lambda a, b: a - b) == None\", \"assert advanced_median([7, 5, 9... | {
"split": "train",
"index": 78753,
"acecode_id": "evol_23579",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a data publishing system for environmental readings. The function should take a list of readings, each represented as a dictionary with the keys 'OutsideAirTemperature', 'MixedAirTemperature', and 'DamperSignal'. Your funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_valid_readings([{'OutsideAirTemperature': 32, 'MixedAirTemperature': 34, 'DamperSignal': 20}, {'OutsideAirTemperature': 100, 'MixedAirTemperature': 99, 'DamperSignal': 50}]) == 2\", \"assert count_valid_readings([{'OutsideAirTemperature': 29, 'MixedAir... | {
"split": "train",
"index": 78754,
"acecode_id": "bigcode_python_fns_40443",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks whether a given URL is safe from directory traversal attacks. The function should take a single string parameter, `url`, and return a boolean value. The URL is considered unsafe if it contains the substring '../' anywhere ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_safe_url('http://example.com/index.html') == True\", \"assert is_safe_url('http://example.com/../index.html') == False\", \"assert is_safe_url('http://example.com/folder/../file.txt') == False\", \"assert is_safe_url('http://example.com/folder/index.html'... | {
"split": "train",
"index": 78755,
"acecode_id": "oss_19240",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the transfer of a specified amount of an ERC20 token to a given address. The function should take the following parameters: 'to_fund_address' (a string representing the address to which tokens will be sent), 'erc20_token_sy... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transfer_tokens('0x123456789', 'ETH', 0.1, '0xABCDEF01') == 'Funded 0x123456789 with 0.1 ETH.'\", \"assert transfer_tokens('0x987654321', 'DAI', 0.5) == 'Funded 0x987654321 with 0.5 DAI.'\", \"assert transfer_tokens('0x111111111', 'USDC', 1.0, '0x00000000') ... | {
"split": "train",
"index": 78756,
"acecode_id": "bigcode_python_fns_19294",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `flatten_array` that takes a nested list as input and returns a flat list containing all the elements from the nested structure. The input list may contain integers and other lists at various depths. You must utilize recursion to achieve this flatten... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert flatten_array([[1, [2, [3, [[4, 5], 6]]]], 7]) == [1, 2, 3, 4, 5, 6, 7]\", \"assert flatten_array([1, [2, 3], 4]) == [1, 2, 3, 4]\", \"assert flatten_array([[1], [2], [3]]) == [1, 2, 3]\", \"assert flatten_array([[[[1]]], [[2]], 3]) == [1, 2, 3]\", \"assert ... | {
"split": "train",
"index": 78757,
"acecode_id": "evol_60",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that enables a debug mode for a hypothetical software system. The debug mode can be toggled on or off using a boolean variable. Implement a function called `enable_debug_mode` that sets a global variable `_DEBUG_MODE_ENABLED` to `True` wh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert _DEBUG_MODE_ENABLED == False; enable_debug_mode(); assert _DEBUG_MODE_ENABLED == True\", \"assert _DEBUG_MODE_ENABLED == False; enable_debug_mode(); assert _DEBUG_MODE_ENABLED == True\", \"assert _DEBUG_MODE_ENABLED == False; enable_debug_mode(); assert _DEB... | {
"split": "train",
"index": 78758,
"acecode_id": "bigcode_python_fns_13580",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with building a simplified text processing function. This function should take a list of strings (documents) and return a list of unique words that meet the following criteria: the word must have a minimum length of 3 characters and must appear in at least 2 diff... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert build_unique_words(['hello world', 'world of python', 'hello again'], ['hello']) == ['world']\", \"assert build_unique_words(['apple banana', 'banana orange', 'kiwi apple'], ['kiwi']) == ['banana', 'apple']\", \"assert build_unique_words(['dog cat', 'dog', '... | {
"split": "train",
"index": 78759,
"acecode_id": "bigcode_python_fns_40208",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a list of tuples, where each tuple contains two elements: an education level (a string) and an integer representing the income of an individual. Your task is to implement a function `education_income_summary(education_data: List[Tuple[str, int]]) -> Dict[str, Tupl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert education_income_summary([('HS-grad', 50000), ('Bachelors', 60000), ('HS-grad', 40000)]) == {'HS-grad': (45000.0, 2), 'Bachelors': (60000.0, 1)}\", \"assert education_income_summary([('Masters', 80000), ('PhD', 90000), ('Masters', 70000), ('Bachelors', 60000... | {
"split": "train",
"index": 78760,
"acecode_id": "bigcode_python_fns_15668",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function `process_numbers` that takes in a list of integers. Your function should perform the following operations: 1. Calculate the square of each number in the list. 2. Sum all the squared numbers. 3. If the sum is even, raise a custom ex... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_numbers([1, 3, 5]) == 35\", \"assert process_numbers([2, 4, 6]) == None\", \"assert process_numbers([0, 1, 2]) == 5\", \"assert process_numbers([1]) == 1\", \"assert process_numbers([]) == None\", \"assert process_numbers([10, 20]) == None\", \"asser... | {
"split": "train",
"index": 78761,
"acecode_id": "oss_12636",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function `primes_up_to(n)` that generates a list of all prime numbers up to a given non-negative integer `n`. Use memoization to cache results so that if the function is called multiple times with the same or smaller number, it can return the cached list of prime nu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert primes_up_to(0) == []\", \"assert primes_up_to(1) == []\", \"assert primes_up_to(2) == [2]\", \"assert primes_up_to(3) == [2, 3]\", \"assert primes_up_to(4) == [2, 3]\", \"assert primes_up_to(5) == [2, 3, 5]\", \"assert primes_up_to(10) == [2, 3, 5, 7]\", \"... | {
"split": "train",
"index": 78762,
"acecode_id": "evol_14776",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a simple banking system. Your goal is to implement a function `bank_account_operations(operations: List[Tuple[str, int]]) -> int` that takes a list of operations and returns the final balance of a single bank account after processing all the opera... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bank_account_operations([('deposit', 100), ('withdraw', 50)]) == 50\", \"assert bank_account_operations([('deposit', 500), ('withdraw', 200), ('withdraw', 400)]) == 300\", \"assert bank_account_operations([('withdraw', 100)]) == 0\", \"assert bank_account_op... | {
"split": "train",
"index": 78763,
"acecode_id": "oss_9948",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that manually renders a custom file upload field called `AdminFileFormField` for a user profile form. The function `renderAdminFileFormField` takes in an instance of `AdminFileFormField` as input and returns the HTML markup for render... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert renderAdminFileFormField(AdminFileFormField('Profile Picture')) == '<div class=\\\"admin-file-field\\\"><label>Profile Picture</label><input type=\\\"file\\\" name=\\\"Profile Picture\\\"></div>'\", \"assert renderAdminFileFormField(AdminFileFormField('Resum... | {
"split": "train",
"index": 78764,
"acecode_id": "oss_28811",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of timestamps representing the real time of frames extracted from a video file. Your task is to create a function that organizes these frames into directories based on their dates. Each timestamp corresponds to a frame, and you need to move the frame files ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert organize_frames_by_date(['2023-10-01 12:00:00', '2023-10-01 15:30:00', '2023-10-02 09:00:00'], ['frame1.jpg', 'frame2.jpg', 'frame3.jpg']) == {'2023-10-01': ['frame1.jpg', 'frame2.jpg'], '2023-10-02': ['frame3.jpg']}\", \"assert organize_frames_by_date(['202... | {
"split": "train",
"index": 78765,
"acecode_id": "bigcode_python_fns_10791",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers, where each integer represents an item in a shopping cart. Each item has a price associated with it. Your task is to implement a function `calculate_total_cost(prices: List[int]) -> int` that takes in a list of integers `prices`, where each inte... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_cost([10, 20, 30]) == 60\", \"assert calculate_total_cost([0, 0, 0]) == 0\", \"assert calculate_total_cost([5]) == 5\", \"assert calculate_total_cost([1, 2, 3, 4, 5]) == 15\", \"assert calculate_total_cost([100, 200, 300]) == 600\", \"assert ... | {
"split": "train",
"index": 78766,
"acecode_id": "bigcode_python_fns_43697",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an iterator of tuples, where each tuple contains four elements: (literal_text, field_name, format_spec, conversion), your task is to implement a function that reconstructs and returns a format string from these parsed inputs. The format string should include the literal t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compile_str_from_parsed([('', 'name', '', None), (' is ', '', '', None), ('!', None, None, None)]) == '{name} is !'\", \"assert compile_str_from_parsed([('User: ', 'username', '', None), (' - ', '', '', None), ('ID: ', 'user_id', '', None)]) == 'User: {usern... | {
"split": "train",
"index": 78767,
"acecode_id": "bigcode_python_fns_14056",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with filtering and organizing images based on their associated labels. Write a function named `filter_images` that takes in three parameters: a list of tuples `imgs_all`, an integer `n_class`, and an integer `num_perclass`. Each tuple in `imgs_all` contains an im... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_images([('img1', 0), ('img2', 1)], 2, 1) == [('img2', 1), ('img1', 0)]\", \"assert filter_images([('img1', 0), ('img1', 0), ('img2', 1)], 2, 1) == [('img2', 1), ('img1', 0)]\", \"assert filter_images([('img1', 0), ('img2', 1), ('img3', 0), ('img4', 1)... | {
"split": "train",
"index": 78768,
"acecode_id": "oss_19260",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a recursive function to perform a ternary search in a one-dimensional array. The function should take a sorted array and a target element as input parameters, and return the index of the target element if found; otherwise, return -1. Ensure that the function handles e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert ternary_search([1, 2, 3, 4, 5, 6, 7, 8, 9], 5) == 4\", \"assert ternary_search([1, 2, 3, 4, 5, 6, 7, 8, 9], 1) == 0\", \"assert ternary_search([1, 2, 3, 4, 5, 6, 7, 8, 9], 9) == 8\", \"assert ternary_search([1, 2, 3, 4, 5, 6, 7, 8, 9], 10) == -1\", \"assert ... | {
"split": "train",
"index": 78769,
"acecode_id": "evol_33614",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `generate_server_response(thread_name: str) -> str` that simulates a web server response based on the name of the thread handling the request. The function should return a string message indicating the thread name that is processing the request. The input i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_server_response('Thread-1') == 'Response from thread: Thread-1'\", \"assert generate_server_response('Thread-2') == 'Response from thread: Thread-2'\", \"assert generate_server_response('MainThread') == 'Response from thread: MainThread'\", \"assert... | {
"split": "train",
"index": 78770,
"acecode_id": "evol_24962",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that filters a list of tuples based on specific criteria. The function should take a list of tuples as input, where each tuple contains two strings: the source path and the destination path. The function should return a list of tup... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_pubsub_paths([('c:\\\\path\\\\to\\\\file.py', 'pubsub1')]) == [('c:\\\\path\\\\to\\\\file.py', 'pubsub1')]\", \"assert filter_pubsub_paths([('c:\\\\path\\\\to\\\\file.py', 'pubsub2')]) == [('c:\\\\path\\\\to\\\\file.py', 'pubsub2')]\", \"assert filter... | {
"split": "train",
"index": 78771,
"acecode_id": "oss_34236",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of news articles and their associated categories, and returns a list of articles with their categories in a structured format. Each article is represented as a dictionary with the keys 'title' and 'category', where 'titl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_news_articles([{'title': 'Article 1', 'category': 'Sports'}, {'title': 'Article 2', 'category': 'Technology'}]) == ['Article 1 (Sports)', 'Article 2 (Technology)']\", \"assert format_news_articles([{'title': 'Breaking News', 'category': 'World'}, {'ti... | {
"split": "train",
"index": 78772,
"acecode_id": "oss_19814",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of reactions represented by their BiGG IDs and a target metabolite represented by its BiGG ID. Your task is to determine if the target metabolite can be produced based on the provided reactions. Write a function `can_produce_target(reactions: List[str], tar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_produce_target(['EX_a_e', 'EX_b_e', 'EX_c_e'], 'a') == True\", \"assert can_produce_target(['EX_a_e', 'EX_b_e', 'EX_c_e'], 'd') == False\", \"assert can_produce_target(['EX_a_e', 'EX_b_e', 'EX_c_e', 'EX_d_e'], 'd') == True\", \"assert can_produce_target(... | {
"split": "train",
"index": 78773,
"acecode_id": "bigcode_python_fns_30051",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string 'text' and a string 'pattern', implement a function that counts the number of occurrences of 'pattern' within 'text'. The function should be case-sensitive and should return the total count of non-overlapping occurrences.\nPlease reason step by step, then write a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_subsequence('Hello world, hello world!', 'world') == 2\", \"assert count_subsequence('abcabcabc', 'abc') == 3\", \"assert count_subsequence('aaaaa', 'b') == 0\", \"assert count_subsequence('This is a test. This is only a test.', 'test') == 2\", \"asser... | {
"split": "train",
"index": 78774,
"acecode_id": "evol_6323",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two strings, `ref_seq` and `que_seq`, representing reference and query sequences of DNA. Your task is to implement a function `find_codons(ref_seq: str, que_seq: str) -> List[str]` that extracts all unique codons (substrings of length 3) from the `ref_seq` and che... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_codons('AAAAA', 'AAA') == ['AAA']\", \"assert find_codons('XYZXYZXYZ', 'XYZ') == ['XYZ']\", \"assert find_codons('CATCATCAT', 'TAC') == []\", \"assert find_codons('ACGT', 'TGCA') == []\", \"assert find_codons('AAA', 'AAA') == ['AAA']\", \"assert find_co... | {
"split": "train",
"index": 78775,
"acecode_id": "bigcode_python_fns_43105",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that manages a list of club members. Each member is represented as a dictionary with the following keys: 'name' (a string), 'age' (an integer), and 'email' (a string). Your function should take a list of such member dictionaries and retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_emails_above_age([{'name': 'Alice', 'age': 30, 'email': 'alice@example.com'}, {'name': 'Bob', 'age': 25, 'email': 'bob@example.com'}], 28) == ['alice@example.com']\", \"assert get_emails_above_age([{'name': 'Charlie', 'age': 40, 'email': 'charlie@example... | {
"split": "train",
"index": 78776,
"acecode_id": "oss_7861",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that grants a specific permission to a user role within a hypothetical database system. The function should take two parameters: 'role', a string representing the name of the user role, and 'db', a string representing the name of the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert grant_permission('admin', 'users_db') == 'Permission granted to admin for users_db.'\", \"assert grant_permission('editor', 'content_db') == 'Permission granted to editor for content_db.'\", \"assert grant_permission('viewer', 'media_db') == 'Permission gran... | {
"split": "train",
"index": 78777,
"acecode_id": "bigcode_python_fns_23685",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `second_smallest(num_list)` that returns the second smallest number in the list. If the list has fewer than two distinct numbers, the function should return None.\nPlease reason step by step, then write a self-contained Python solution... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert second_smallest([2, 9, 3, 8, 5]) == 3\", \"assert second_smallest([1, 1, 1]) == None\", \"assert second_smallest([5, 5, 5, 5, 5]) == None\", \"assert second_smallest([10, 20, 30, 40, 50]) == 20\", \"assert second_smallest([2]) == None\", \"assert second_smal... | {
"split": "train",
"index": 78778,
"acecode_id": "evol_10213",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the initialization of a configuration entry in a system. The function should accept a domain string and a context dictionary. The function should return a dictionary with two keys: 'type' and 'step_id'. The 'type' key shoul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert init_config_entry('test_domain', {'source': 'user'}) == {'type': 'form', 'step_id': 'user'}\", \"assert init_config_entry('test_domain', {'source': 'admin'}) == {'type': 'error', 'step_id': 'invalid'}\", \"assert init_config_entry('test_domain', {}) == {'typ... | {
"split": "train",
"index": 78779,
"acecode_id": "bigcode_python_fns_38782",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `loopai(n)` that takes an integer `n` as input. The function should perform the following operations on a predefined list `z` which contains the elements `[1, 2, 3, 4, 5]`: 1. Convert the list `z` to a string. 2. Remove all square bra... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert loopai(0) == '12345'\", \"assert loopai(1) == '12345'\", \"assert loopai(2) == '12345'\", \"assert loopai(3) == '12345'\", \"assert loopai(4) == '12345'\", \"assert loopai(-1) == '12345'\", \"assert loopai(100) == '12345'\", \"assert loopai(999) == '12345'\"... | {
"split": "train",
"index": 78780,
"acecode_id": "oss_19668",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates sending an email message. The function should take an email address, an email type, and optional template data as input. It should return a dictionary representing the email message that would be sent, including the email a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert send_email('test@example.com', 'EMAIL_WELCOME', {'name': 'John'}) == {'to': 'test@example.com', 'type': 'EMAIL_WELCOME', 'data': {'name': 'John'}}\", \"assert send_email('user@domain.com', 'EMAIL_NOTIFICATION', {'event': 'signup'}) == {'to': 'user@domain.com... | {
"split": "train",
"index": 78781,
"acecode_id": "bigcode_python_fns_40361",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that extracts the default app configuration from a given string. The default app configuration is specified in the format `default_app_config = '<app_config_path>'`, where `<app_config_path>` is the path to the app configuration. W... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_default_app_config(\\\"default_app_config = 'waldur_openstack.openstack.apps.OpenStackConfig'\\\") == 'waldur_openstack.openstack.apps.OpenStackConfig'\", \"assert extract_default_app_config(\\\"default_app_config = 'another_app_config'\\\") == 'anot... | {
"split": "train",
"index": 78782,
"acecode_id": "oss_21518",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that checks for the availability of two different modules: 'module_a' and 'module_b'. You need to implement a function called `check_modules_availability()` that simulates the import behavior of these modules. The function should r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_modules_availability(True, True) == 'Both modules are available.'\", \"assert check_modules_availability(True, False) == 'Only module_a is available.'\", \"assert check_modules_availability(False, False) == 'Neither module is available.'\", \"assert ch... | {
"split": "train",
"index": 78783,
"acecode_id": "oss_11657",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of frame records where each frame is represented as a dictionary containing 'lineno' (an integer representing the line number) and 'code_context' (a list of strings representing the lines of code), implement a function `create_source_location_str(frame, key)` that ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_source_location_str([{'lineno': 10, 'code_context': ['print(x)']}, {'lineno': 20, 'code_context': ['return y']}], 0) == '10 print(x)'\", \"assert create_source_location_str([{'lineno': 5, 'code_context': ['a = 1']}, {'lineno': 15, 'code_context': ['b ... | {
"split": "train",
"index": 78784,
"acecode_id": "bigcode_python_fns_1297",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary containing the properties of a vessel representing small hydrogen. The dictionary has the following keys: 'call_size', 'LOA', 'draft', and 'beam', each with corresponding numerical values. Write a function `get_vessel_properties(vessel_data: Dict[str,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_vessel_properties({'call_size': 100, 'LOA': 50, 'draft': 20, 'beam': 30}) == (100, 50, 20, 30)\", \"assert get_vessel_properties({'call_size': 200, 'LOA': 75, 'draft': 25, 'beam': 35}) == (200, 75, 25, 35)\", \"assert get_vessel_properties({'call_size': ... | {
"split": "train",
"index": 78785,
"acecode_id": "bigcode_python_fns_13605",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing a graph where keys are node identifiers and values are lists of neighboring node identifiers. Your task is to implement a function that checks if label propagation is complete. Label propagation is considered complete when every node has ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert labeling_complete({'A': 'red', 'B': 'blue', 'C': 'red'}, {'A': ['B', 'C'], 'B': ['A'], 'C': ['A']}) == False\", \"assert labeling_complete({'A': 'green'}, {'A': []}) == True\", \"assert labeling_complete({'A': 'blue', 'B': 'red', 'C': 'red'}, {'A': ['B', 'C'... | {
"split": "train",
"index": 78786,
"acecode_id": "bigcode_python_fns_45987",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function `validate_url(url: str) -> bool` that checks if the given URL is a valid HTTP or HTTPS URL. The function should return `True` if the URL starts with 'http://' or 'https://' and follows a proper structure, otherwise it should return `False`.\nPlease reason s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_url('http://example.com') == True\", \"assert validate_url('https://example.com') == True\", \"assert validate_url('http://www.example.com') == True\", \"assert validate_url('https://www.example.com') == True\", \"assert validate_url('http://example... | {
"split": "train",
"index": 78787,
"acecode_id": "evol_9305",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `generate_primes(n)` that returns a list of the first 'n' prime numbers. The input 'n' is guaranteed to be a positive integer. You do not need to handle any exceptions or validations in this function.\nPlease reason step by step, then write a self-contained Pyt... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_primes(1) == [2]\", \"assert generate_primes(2) == [2, 3]\", \"assert generate_primes(3) == [2, 3, 5]\", \"assert generate_primes(4) == [2, 3, 5, 7]\", \"assert generate_primes(5) == [2, 3, 5, 7, 11]\", \"assert generate_primes(10) == [2, 3, 5, 7, 1... | {
"split": "train",
"index": 78788,
"acecode_id": "evol_15579",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D list representing a tic-tac-toe board. Each cell in the list can contain either 'X', 'O', or an empty space. Your task is to write a function that determines the winner of the game, if any. The winner is the player who has three of their marks in a horizontal... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert tic_tac_toe_winner([['X', 'O', 'O'], ['O', 'X', 'O'], ['X', 'X', 'X']]) == 'X'\", \"assert tic_tac_toe_winner([['X', 'X', 'X'], ['O', 'O', ' '], [' ', ' ', ' ']]) == 'X'\", \"assert tic_tac_toe_winner([['O', ' ', 'X'], [' ', 'O', ' '], [' ', ' ', 'O']]) == '... | {
"split": "train",
"index": 78789,
"acecode_id": "oss_37451",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary containing two keys: 'Bucket' and 'Key'. Your task is to implement a function that generates a resource identifier string in the form of 's3://<Bucket>/<Key>', where <Bucket> and <Key> are the values from the input dictionary. Write a function named '... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_physical_id({'Bucket': 'my-bucket', 'Key': 'my-file.txt'}) == 's3://my-bucket/my-file.txt'\", \"assert get_physical_id({'Bucket': 'test-bucket', 'Key': 'image.png'}) == 's3://test-bucket/image.png'\", \"assert get_physical_id({'Bucket': 'example-bucket',... | {
"split": "train",
"index": 78790,
"acecode_id": "bigcode_python_fns_7279",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `create_population` that generates a population of either type 1 or type 2 based on the input parameter. The function takes a single parameter `type` which can be either 'type1' or 'type2'. If the input is 'type1', the function should ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_population('type1') == 'Population of type 1 created'\", \"assert create_population('type2') == 'Population of type 2 created'\", \"assert create_population('type3') == 'Invalid type'\", \"assert create_population('') == 'Invalid type'\", \"assert cre... | {
"split": "train",
"index": 78791,
"acecode_id": "oss_31484",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a server connection string and a file URL. The function should take four parameters: a server string in the format 'username@host', an SSH password, a file URL, and an optional filename argument. If the filename argument is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_connection('user@host.com', 'securepassword', 'http://example.com/file.txt') == {'username': 'user', 'host': 'host.com', 'password': 'securepassword', 'filename': 'file.txt'}\", \"assert process_connection('admin@server.org', 'mypassword', 'ftp://exa... | {
"split": "train",
"index": 78792,
"acecode_id": "oss_12791",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of guilds (represented as strings) and a member's name (also a string), write a function `add_role_to_member(guilds: List[str], member: str) -> str` that returns a string indicating whether the member has been successfully assigned the role 'dumb' in the first guil... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_role_to_member(['Guild1', 'Guild2'], 'Alice') == 'Alice has been assigned the role dumb in Guild1.'\", \"assert add_role_to_member(['Guild1'], 'Bob') == 'Bob has been assigned the role dumb in Guild1.'\", \"assert add_role_to_member([], 'Charlie') == 'No... | {
"split": "train",
"index": 78793,
"acecode_id": "bigcode_python_fns_17522",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that evaluates a simple 3-parameter Gaussian function. Given the parameters `x`, `b`, `ampl`, `cent`, and `sigm`, the function should return the value of the Gaussian function defined by the equation: `G(x) = b + ampl * exp(-((cent - ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate_gaussian(0, 0, 1, 0, 1) == 1.0\", \"assert evaluate_gaussian(1, 0, 1, 0, 1) == 0.6065306597126334\", \"assert evaluate_gaussian(0, 1, 1, 0, 1) == 2.0\", \"assert evaluate_gaussian(0, 0, 0, 0, 1) == 0.0\", \"assert evaluate_gaussian(1, 2, 3, 1, 1) ==... | {
"split": "train",
"index": 78794,
"acecode_id": "bigcode_python_fns_16269",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function called `display_organization_info` that takes two parameters: a string `name` representing the name of an organization and a string `org_type` that can either be 'normal' or 'NIR'. The function should return a string displaying the name a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert display_organization_info('ABC Inc.', 'normal') == 'Organization Name: ABC Inc., Type: Normal'\", \"assert display_organization_info('XYZ Foundation', 'NIR') == 'Organization Name: XYZ Foundation, Type: NIR'\", \"assert display_organization_info('Global Corp... | {
"split": "train",
"index": 78795,
"acecode_id": "oss_9365",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates a list of credentials. Each credential is represented by a dictionary containing the following fields: 'credential_id' (an integer), 'issuer' (a string), 'subject' (a string), 'issue_date' (a string in 'YYYY-MM-DD' format),... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_credentials([{'credential_id': 1, 'issuer': 'Issuer A', 'subject': 'Subject A', 'issue_date': '2022-01-01', 'expiry_date': '2023-01-01'}]) == [True]\", \"assert validate_credentials([{'credential_id': -1, 'issuer': 'Issuer A', 'subject': 'Subject A'... | {
"split": "train",
"index": 78796,
"acecode_id": "oss_6069",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string, implement a function that finds all words that start with the characters 'ha'. A word is defined as a sequence of characters separated by whitespace or punctuation. The function should return a list of these words.\nPlease reason step by step, then write a self-... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_words_starting_with_ha('The hat of harry is at the harbor. It\\u2018s a hard case to solve.') == ['hat', 'harry', 'harbor', 'hard']\", \"assert find_words_starting_with_ha('I have a habit of haggling and haphazardly moving.') == ['have', 'habit', 'haggl... | {
"split": "train",
"index": 78797,
"acecode_id": "evol_10244",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function `check_email(email: str) -> str` that checks the syntactical correctness of an electronic mail identifier. The function should return 'Invalid email syntax.' if the email format is incorrect. If the email is correctly formatted, the function should check fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_email('user@example.com') == 'Email appears to be valid and free from common phishing indicators.'\", \"assert check_email('user@google.com') == 'Email appears to be valid and free from common phishing indicators.'\", \"assert check_email('user@yahoo.c... | {
"split": "train",
"index": 78798,
"acecode_id": "evol_21371",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a list of train schedules, where each schedule is represented as a tuple containing the start time and end time of the train's journey (in seconds from the beginning of the day), write a function `max_simultaneous_trains` that returns the maximum number of trains that can... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_simultaneous_trains([(3600, 7200), (5400, 9000), (6000, 7200), (3000, 5400)]) == 3\", \"assert max_simultaneous_trains([(0, 3600), (3600, 7200), (7200, 86400)]) == 1\", \"assert max_simultaneous_trains([(0, 100), (50, 150), (100, 200)]) == 2\", \"assert ... | {
"split": "train",
"index": 78799,
"acecode_id": "oss_32524",
"num_tests": 13
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.