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": "Create a Python function that identifies and returns the frequency of a specific word in a list of strings while considering several conditions: 1) Words should be case-insensitive, i.e., 'Apple' and 'apple' should be considered the same, 2) Words can be multi-word expressions ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert word_frequency('grape', ['Grapes are sour.', 'I enjoy grape juice.', 'Grape soda is fantastic!']) == (3, ['Grape soda is fantastic!', 'I enjoy grape juice.', 'Grapes are sour.'])\", \"assert word_frequency('watermelon', ['Watermelons are refreshing.', 'I lov... | {
"split": "train",
"index": 5400,
"acecode_id": "evol_29614",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries, where each dictionary represents a patient's data containing various attributes including 'death_all' and 'days_to_fu'. Your task is to implement a function that processes this data by removing any entries that have missing values (where an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_patient_data([{'name': 'John', 'age': 30, 'death_all': None, 'days_to_fu': 10}, {'name': 'Jane', 'age': 25, 'death_all': 0, 'days_to_fu': 20}]) == [{'name': 'Jane', 'age': 25}]\", \"assert process_patient_data([{'name': 'Alice', 'age': 28, 'death_all... | {
"split": "train",
"index": 5401,
"acecode_id": "bigcode_python_fns_45078",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that measures the execution time of another function. Your function should take a callable function `func` as an argument and return the time taken for `func` to execute in milliseconds. The function `func` should not take any para... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert measure_execution_time(lambda: time.sleep(0.001)) >= 1.0\", \"assert measure_execution_time(lambda: time.sleep(0.002)) >= 2.0\", \"assert measure_execution_time(lambda: time.sleep(0.005)) >= 5.0\", \"assert measure_execution_time(lambda: time.sleep(0.01)) >=... | {
"split": "train",
"index": 5402,
"acecode_id": "oss_2944",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of nine distinct integers, implement a function that returns the second largest integer in the list. The function should be able to handle any valid input that meets the criteria.\nPlease reason step by step, then write a self-contained Python solution. Give your f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert penultimate_peak([45, 28, 72, 18, 24, 61, 97, 35, 16]) == 72\", \"assert penultimate_peak([1, 2, 3, 4, 5, 6, 7, 8, 9]) == 8\", \"assert penultimate_peak([10, 20, 30, 40, 50, 60, 70, 80, 90]) == 80\", \"assert penultimate_peak([-10, -20, -30, -40, -50, -60, -... | {
"split": "train",
"index": 5403,
"acecode_id": "evol_2783",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of lists (nested list), implement a function that returns a flat list containing all the individual elements from the nested lists. The function should take one parameter, the nested list, and return the flat list.\nPlease reason step by step, then write a self-con... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert flatten_list([[1, 2], [3, 4], [5, 6]]) == [1, 2, 3, 4, 5, 6]\", \"assert flatten_list([[1], [2], [3]]) == [1, 2, 3]\", \"assert flatten_list([[], [1, 2], []]) == [1, 2]\", \"assert flatten_list([[10, 20], [30, 40, 50]]) == [10, 20, 30, 40, 50]\", \"assert fl... | {
"split": "train",
"index": 5404,
"acecode_id": "evol_35892",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D binary matrix represented as a list of lists, where each element is either 0 or 1. Your task is to implement a function that checks if there exists at least one row in the matrix that contains only 1s. If such a row exists, return True; otherwise, return Fals... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_row_of_ones([[1, 1, 1], [0, 0, 0], [1, 1, 1]]) == True\", \"assert has_row_of_ones([[0, 0, 0], [0, 0, 0], [0, 0, 0]]) == False\", \"assert has_row_of_ones([[1, 1], [1, 1]]) == True\", \"assert has_row_of_ones([[0, 1], [1, 1]]) == True\", \"assert has_row... | {
"split": "train",
"index": 5405,
"acecode_id": "bigcode_python_fns_1706",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a nested dictionary, write a function that calculates the total number of key-value pairs present in the dictionary, including those in nested dictionaries. Each key-value pair is considered a single element, and you should count each key as well. The function should hand... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_elements({'name': 'Alice', 'age': 25}) == 4\", \"assert sum_elements({'x': {'y': {'z': 5}}}) == 4\", \"assert sum_elements({}) == 0\", \"assert sum_elements({'single_key': 'single_value'}) == 2\", \"assert sum_elements({'root': {'child1': {'grandchild1':... | {
"split": "train",
"index": 5406,
"acecode_id": "evol_32859",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the behavior of a simple logging system. The function `manage_logging` takes a list of log messages and a boolean value indicating whether to mute the logs. When mute is set to `True`, the function should return an empty st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_logging(['Error: File not found', 'Warning: Low memory'], False) == 'Error: File not found, Warning: Low memory'\", \"assert manage_logging(['Info: Process started'], False) == 'Info: Process started'\", \"assert manage_logging(['Debug: Variable x=10'... | {
"split": "train",
"index": 5407,
"acecode_id": "bigcode_python_fns_6883",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that extracts and returns the first number found in a given string. The number can be an integer or a floating-point number, and it can be preceded by whitespace or other characters. If there is no number in the string, the function s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_first_number('42 apples') == 42.0\", \"assert extract_first_number('The price is 3.14 dollars') == 3.14\", \"assert extract_first_number('No numbers here') == None\", \"assert extract_first_number('3.1415 is pi') == 3.1415\", \"assert extract_first_n... | {
"split": "train",
"index": 5408,
"acecode_id": "bigcode_python_fns_15316",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of claims and their relationships in the form of a dictionary. Each claim is associated with a major claim (MC) and can either support or attack it. Your task is to create a graph representing the relationships between the claims and the major claim based o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_claim_graph(['A', 'B', 'C'], {'A': {'MC': 'SUPPORT'}, 'B': {'MC': 'ATTACK'}, 'C': {'MC': 'SUPPORT'}}) == {'A': ['Inference'], 'B': ['Conflict'], 'C': ['Inference']}\", \"assert create_claim_graph(['X', 'Y'], {'X': {'MC': 'SUPPORT'}, 'Y': {'MC': 'SUPPO... | {
"split": "train",
"index": 5409,
"acecode_id": "bigcode_python_fns_22943",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that parses a URI and extracts various components from it. The URI follows the format `scheme://username:password@host:port/path?query#fragment`. Your goal is to create a Python function `parse_uri` that takes a URI string as input an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_uri('pgsql://foo:bar@baz:5444/qux?options=foo&options=bar&keepalives=1&invalid=true') == {'scheme': 'pgsql', 'username': 'foo', 'password': 'bar', 'host': 'baz', 'port': 5444, 'path': '/qux', 'query': {'options': ['foo', 'bar'], 'keepalives': '1', 'inv... | {
"split": "train",
"index": 5410,
"acecode_id": "oss_21798",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that returns the preferred API instance based on the provided parameters. The function should take in a default API instance, an optional specific API instance, and any number of additional keyword arguments. If the specific API instance ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_api_instance('default_api', 'specific_api') == 'specific_api'\", \"assert get_api_instance('default_api', None) == 'default_api'\", \"assert get_api_instance(None, 'api_instance') == 'api_instance'\", \"assert get_api_instance('default', 'api', key1='val... | {
"split": "train",
"index": 5411,
"acecode_id": "bigcode_python_fns_4530",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple login process for a user on a website. The function should take in three parameters: `username`, `password`, and `stored_credentials`, which is a dictionary containing valid username-password pairs. The function sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert login('user1', 'password1', {'user1': 'password1', 'user2': 'password2'}) == 'Login successful!'\", \"assert login('user3', 'password3', {'user1': 'password1', 'user2': 'password2'}) == 'Login failed!'\", \"assert login('user2', 'wrongpassword', {'user1': 'p... | {
"split": "train",
"index": 5412,
"acecode_id": "oss_30512",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a Python dictionary containing key-value pairs, but the dictionary may contain comments in the keys. Your task is to write a function that cleans up the dictionary by removing comments from the keys and ensuring that all keys are in lowercase. Write a function `cl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert clean_up_dictionary({'Name#comment': 'Alice', 'Age': 30}) == {'name': 'Alice', 'age': 30}\", \"assert clean_up_dictionary({'City#info': 'New York', 'Country': 'USA'}) == {'city': 'New York', 'country': 'USA'}\", \"assert clean_up_dictionary({'key#1': 100, 'K... | {
"split": "train",
"index": 5413,
"acecode_id": "oss_28407",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a tree represented as a list of edges, where each edge is represented as a tuple (parent, child). Your task is to write a function that calculates the depth of the tree. The depth of a tree is defined as the length of the longest path from the root to a leaf node.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_tree_depth([]) == 0\", \"assert calculate_tree_depth([(1, 2), (1, 3)]) == 1\", \"assert calculate_tree_depth([(1, 2), (1, 3), (2, 4)]) == 2\", \"assert calculate_tree_depth([(1, 2), (2, 3), (3, 4)]) == 3\", \"assert calculate_tree_depth([(0, 1), (0... | {
"split": "train",
"index": 5414,
"acecode_id": "bigcode_python_fns_40896",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of integers and returns a list of unique integers from that list, preserving the order of their first appearance. Write a function `get_unique_integers(nums: List[int]) -> List[int]` that accomplishes this. The input wil... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_integers([1, 2, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert get_unique_integers([4, 5, 4, 6, 7, 8, 5]) == [4, 5, 6, 7, 8]\", \"assert get_unique_integers([1, 1, 1, 1]) == [1]\", \"assert get_unique_integers([]) == []\", \"assert get_unique_integers([3, ... | {
"split": "train",
"index": 5415,
"acecode_id": "oss_387",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given three tuples of the same length, generate two dictionaries. The first dictionary should map the elements of the first tuple to the elements of the second tuple. The second dictionary should map the elements of the first tuple to the elements of the third tuple. Implement ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_dictionaries(('apple', 'banana', 'cherry', 'date'), ('fruit', 'tasty', 'healthy', 'sweet'), ('vitamin', 'potassium', 'antioxidant', 'fiber')) == ({'apple': 'fruit', 'banana': 'tasty', 'cherry': 'healthy', 'date': 'sweet'}, {'apple': 'vitamin', 'bana... | {
"split": "train",
"index": 5416,
"acecode_id": "evol_6524",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates changing the background color based on button clicks. You will implement a function called `choiceColor` that takes a string argument `button_label`. The function should return the corresponding background color as a string... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert choiceColor('DARK') == 'black'\", \"assert choiceColor('PURPLE') == 'purple'\", \"assert choiceColor('BLUE') == 'blue'\", \"assert choiceColor('GREEN') == 'green'\", \"assert choiceColor('YELLOW') == 'invalid color'\", \"assert choiceColor('') == 'invalid co... | {
"split": "train",
"index": 5417,
"acecode_id": "oss_2294",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that can validate whether a given string represents a valid subtitle entry in the SRT format. The SRT (SubRip Subtitle) format is a widely used format for storing subtitles alongside video content. Each subtitle entry consists of thre... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isValidSRTEntry('1\\\\n00:00:10,500 --> 00:00:13,000\\\\nHello, world!') == True\", \"assert isValidSRTEntry('2\\\\n00:00:10,500 --> 00:00:13,000\\\\nHello, world!') == False\", \"assert isValidSRTEntry('1\\\\n00:00:10,500 --> 00:00:13\\\\nHello, world!') ==... | {
"split": "train",
"index": 5418,
"acecode_id": "oss_19367",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `custom_validation` that validates input data for a product creation system. The function should take a dictionary `serializer_data` as input and perform the following checks:\n1. Ensure that the 'name' field in the dictionary is not empt... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert custom_validation({'name': 'Product', 'quantity': 5}) is None\", \"assert custom_validation({'name': 'Product', 'quantity': 1}) is None\", \"assert custom_validation({'name': 'Test Item', 'quantity': 10}) is None\", \"assert custom_validation({'name': 'Apple... | {
"split": "train",
"index": 5419,
"acecode_id": "oss_11598",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function called `appropriate_animals` that determines the list of animal species suitable for a given climate. The function should take two parameters: a dictionary `climate_animals` that maps climate names (strings) to lists of animal species... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert appropriate_animals({'Sunny': ['Lion', 'Elephant', 'Giraffe'], 'Rainy': ['Frog', 'Duck', 'Fish'], 'Snowy': ['Polar Bear', 'Penguin', 'Seal']}, 'Sunny') == ['Lion', 'Elephant', 'Giraffe']\", \"assert appropriate_animals({'Sunny': ['Lion', 'Elephant', 'Giraffe... | {
"split": "train",
"index": 5420,
"acecode_id": "oss_30722",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple logging system. Your task is to implement a function `get_logger(name: str, level: int = logging.DEBUG) -> Logger` that takes in a `name` and an optional `level` parameter with a default value of `logging.DEBUG`. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_logger('testLogger1').name == 'testLogger1'\", \"assert get_logger('testLogger2').level == logging.DEBUG\", \"assert get_logger('testLogger3', level=logging.INFO).level == logging.INFO\", \"assert get_logger('testLogger4').handlers == [LogHelper.handler]... | {
"split": "train",
"index": 5421,
"acecode_id": "oss_21052",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple networking function in Python that simulates the behavior of a network connection. Your function should take three parameters: a hostname (string), a port (integer), and a number of connections (integer). The function should perform the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert network_operation('localhost', 8000, 5) == 'Bound; Connected; Listening for 5 connections'\", \"assert network_operation('127.0.0.1', 8080, 10) == 'Bound; Connected; Listening for 10 connections'\", \"assert network_operation('localhost', 3000, 0) == 'Bound;... | {
"split": "train",
"index": 5422,
"acecode_id": "oss_3401",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a simple representation of a Node object based on given attributes. The function should accept a dictionary of attributes, and if the attribute 'id' is not provided, the function should ignore it when creating the Node repr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_node({'name': 'Node1', 'id': 1}) == {'name': 'Node1'}\", \"assert create_node({'name': 'Node2'}) == {'name': 'Node2'}\", \"assert create_node({'type': 'TypeA', 'id': 2}) == {'type': 'TypeA'}\", \"assert create_node({'value': 100, 'id': 3}) == {'value'... | {
"split": "train",
"index": 5423,
"acecode_id": "bigcode_python_fns_43058",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary containing the results of a computational run, where the keys represent different metrics and their corresponding values represent the results. Your task is to implement a function `extract_metrics(run_info: Dict[str, str]) -> Dict[str, Union[int, flo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_metrics({'memory': '2048B', 'walltime': '1.5s', 'cputime': '1.2s', 'exitcode': '0'}) == {'memory': 2048, 'walltime': 1.5, 'cputime': 1.2, 'exitcode': 0}\", \"assert extract_metrics({'memory': '4096B', 'exitcode': '1', 'unknownKey': 'someValue'}) == {... | {
"split": "train",
"index": 5424,
"acecode_id": "bigcode_python_fns_5072",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that applies the Rectified Linear Unit (ReLU) activation function to a given 1D list of integers. The ReLU activation function is defined as f(x) = max(0, x), where x is the input to the function. Your goal is to create a Python funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert apply_relu_activation([2, -3, 4, -1, 0, 5]) == [2, 0, 4, 0, 0, 5]\", \"assert apply_relu_activation([-1, -2, -3, -4]) == [0, 0, 0, 0]\", \"assert apply_relu_activation([0, 0, 0, 0]) == [0, 0, 0, 0]\", \"assert apply_relu_activation([1, 2, 3, 4, 5]) == [1, 2,... | {
"split": "train",
"index": 5425,
"acecode_id": "oss_17739",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are provided with a dictionary containing various string representations of dump contents, where each key represents a dump format and its corresponding value is the content to be saved. Implement a function `generate_dump_names(module_name: str, dumps: Dict[str, str]) -> L... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_dump_names('module1', {'json': 'content1', 'txt': 'content2'}) == ['module1.json', 'module1.txt']\", \"assert generate_dump_names('moduleA', {'xml': 'data1', 'csv': 'data2'}) == ['moduleA.xml', 'moduleA.csv']\", \"assert generate_dump_names('myModul... | {
"split": "train",
"index": 5426,
"acecode_id": "bigcode_python_fns_7857",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_prime(n)` that determines if a given integer n is a prime number. A prime number is defined as a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. The function should return True if n is a prime number and F... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_prime(6) == False\", \"assert is_prime(101) == True\", \"assert is_prime(11) == True\", \"assert is_prime(13441) == True\", \"assert is_prime(61) == True\", \"assert is_prime(4) == False\", \"assert is_prime(1) == False\", \"assert is_prime(2) == True\", ... | {
"split": "train",
"index": 5427,
"acecode_id": "evol_24080",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with analyzing a collection of finding types in a software codebase. Implement a function `has_finding_types(code_elements, types)` that checks whether any of the specified finding types are present in the provided list of code elements. The function should retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_finding_types(['error in code', 'warning: possible null dereference', 'info: performance issue'], ['error', 'warning']) == True\", \"assert has_finding_types(['critical failure', 'minor warning', 'note'], ['critical', 'warning']) == True\", \"assert has_... | {
"split": "train",
"index": 5428,
"acecode_id": "oss_21317",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `factorial_sequence(a, b)` that takes in two integers `a` and `b`. The function should calculate the factorial of `a` and return a string representing a sequence of decreasing products in the format `a x (b-1) > (b-1) x (b-2) > ... > ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert factorial_sequence(5, 1) == '1 > 120'\", \"assert factorial_sequence(4, 1) == '1 > 24'\", \"assert factorial_sequence(3, 1) == '1 > 6'\", \"assert factorial_sequence(2, 1) == '1 > 2'\", \"assert factorial_sequence(1, 1) == '1 > 1'\"]}"
} | {
"split": "train",
"index": 5429,
"acecode_id": "oss_16612",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python decorator that measures the execution time of a function. The decorator should extract preload options from a provided context object and update the keyword arguments passed to the original function accordingly. The preload options are ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert handle_preload_options(lambda ctx, **kwargs: kwargs.get('option1', 0))(MockContext()) == 0\", \"assert handle_preload_options(lambda ctx, **kwargs: kwargs.get('option4', None))(MockContext()) is None\", \"assert handle_preload_options(lambda ctx, **kwargs: k... | {
"split": "train",
"index": 5430,
"acecode_id": "oss_7666",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_palindrome(input_string: str) -> bool` that determines whether the given input string is a palindrome. A string is considered a palindrome if it reads the same forward and backward, ignoring spaces, punctuation, and case sensitivity. For example, 'A man... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_palindrome('A man, a plan, a canal, Panama') == True\", \"assert is_palindrome('Was it a car or a cat I saw?') == True\", \"assert is_palindrome('No lemon, no melon') == True\", \"assert is_palindrome('Able was I ere I saw Elba') == True\", \"assert is_pa... | {
"split": "train",
"index": 5431,
"acecode_id": "evol_2953",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that converts a given hexadecimal numeral (as a string) into its corresponding binary representation (as a string). The function should take a single argument, a string representing the hexadecimal number, and return a string that represents the binary equi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hex_to_bin('1A') == '11010'\", \"assert hex_to_bin('0') == '0'\", \"assert hex_to_bin('F') == '1111'\", \"assert hex_to_bin('10') == '10000'\", \"assert hex_to_bin('1') == '1'\", \"assert hex_to_bin('2B') == '101011'\", \"assert hex_to_bin('FF') == '11111111... | {
"split": "train",
"index": 5432,
"acecode_id": "evol_32649",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function `fib(n: int) -> int` that calculates the n-th Fibonacci number using the following rules: If n is less than or equal to 2, return 1. For n greater than 2, return the sum of the two preceding Fibonacci numbers. The Fibonacci sequence starts with 1, 1, 2, 3, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fib(1) == 1\", \"assert fib(2) == 1\", \"assert fib(3) == 2\", \"assert fib(4) == 3\", \"assert fib(5) == 5\", \"assert fib(6) == 8\", \"assert fib(7) == 13\", \"assert fib(8) == 21\", \"assert fib(9) == 34\", \"assert fib(10) == 55\", \"assert fib(11) == 89... | {
"split": "train",
"index": 5433,
"acecode_id": "evol_29877",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a 2D square matrix represented as a list of lists, write a function that rotates the matrix 90 degrees clockwise in place. The function should modify the input matrix directly. The matrix is guaranteed to be non-empty and will have dimensions n x n where 1 <= n <= 20. For... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rotate([[1,2,3],[4,5,6],[7,8,9]]) == [[7,4,1],[8,5,2],[9,6,3]]\", \"assert rotate([[1]]) == [[1]]\", \"assert rotate([[1,2],[3,4]]) == [[3,1],[4,2]]\", \"assert rotate([[1,2,3,4],[5,6,7,8],[9,10,11,12],[13,14,15,16]]) == [[13,9,5,1],[14,10,6,2],[15,11,7,3],[... | {
"split": "train",
"index": 5434,
"acecode_id": "bigcode_python_fns_33888",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Design a Python function that rotates a square matrix in a clockwise direction by 90 degrees. The function should handle errors by returning a message if the input is not a square matrix or contains non-integer entries. Implement the function 'rotate(mat)' where 'mat' is the in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rotate([[1,2,3],[4,5,6],[7,8,9]]) == [[7,4,1],[8,5,2],[9,6,3]]\", \"assert rotate([[1]]) == [[1]]\", \"assert rotate([[1,2],[3,4]]) == [[3,1],[4,2]]\", \"assert rotate([[1,2,3,4],[5,6,7,8],[9,10,11,12],[13,14,15,16]]) == [[13,9,5,1],[14,10,6,2],[15,11,7,3],[... | {
"split": "train",
"index": 5435,
"acecode_id": "evol_34673",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that returns the last successful hour from a list of hourly statuses. Each hour is represented by a boolean value, where `True` indicates that the hour was successful and `False` indicates failure. The function should return the index... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_last_successful_hour([True, False, True, True, False]) == 3\", \"assert get_last_successful_hour([False, False, False]) == -1\", \"assert get_last_successful_hour([True, True, True]) == 2\", \"assert get_last_successful_hour([False, True, False, True]) =... | {
"split": "train",
"index": 5436,
"acecode_id": "bigcode_python_fns_33893",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a user's profile attributes: name, age, email, and access token. The function should return a string representation of the user's profile, excluding any attributes that start with an underscore, are in all uppercase, or con... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert user_profile_to_string('Alice', 25, 'alice@example.com', 'abc123xyz') == 'name=Alice, age=25, email=alice@example.com'\", \"assert user_profile_to_string('Bob', 30, 'bob@example.com', 'xyz987abc') == 'name=Bob, age=30, email=bob@example.com'\", \"assert user... | {
"split": "train",
"index": 5437,
"acecode_id": "oss_8598",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string, write a function that reverses the order of consonants in the string while keeping the vowels in their original positions. Vowels are defined as 'a', 'e', 'i', 'o', 'u' (case insensitive). Implement the function `reverse_consonants(input: str) -> str` that takes... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_consonants('aAeEiIoOuU') == 'aAeEiIoOuU'\", \"assert reverse_consonants('xyz') == 'zyx'\", \"assert reverse_consonants('') == ''\", \"assert reverse_consonants('a') == 'a'\", \"assert reverse_consonants('b') == 'b'\", \"assert reverse_consonants('ae'... | {
"split": "train",
"index": 5438,
"acecode_id": "evol_20564",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a square matrix represented as a list of lists, where each inner list represents a row of the matrix. Your task is to implement a function that performs the Gauss elimination process on this matrix and returns the row echelon form of the matrix as a list of lists.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert gauss_elimination([[1, 1, 1], [0, 1, 1], [0, 0, 1]]) == [[1, 1, 1], [0, 1, 1], [0, 0, 1]]\", \"assert gauss_elimination([[0, 0, 0], [0, 0, 0], [0, 0, 0]]) == [[0, 0, 0], [0, 0, 0], [0, 0, 0]]\", \"assert gauss_elimination([[1, 0, 0], [0, 1, 0], [0, 0, 1]]) =... | {
"split": "train",
"index": 5439,
"acecode_id": "bigcode_python_fns_14228",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing a list of API server entries to extract project IDs and their corresponding ports. Each entry in the list has the format 'API_SERVER_PREFIX-project_id-port', where 'API_SERVER_PREFIX' is a constant string. Your goal is to return a dictionary that ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_api_server_info(['API_SERVER_PREFIX-123-8080', 'API_SERVER_PREFIX-456-9090']) == {'123': 8080, '456': 9090}\", \"assert extract_api_server_info(['API_SERVER_PREFIX-789-7070', 'API_SERVER_PREFIX-123-8080', 'INVALID_ENTRY']) == {'789': 7070, '123': 808... | {
"split": "train",
"index": 5440,
"acecode_id": "bigcode_python_fns_9552",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a basic conversation with a user based on their input. The function should accept a list of strings representing user responses and should return a string indicating whether the conversation continues or ends. The rules for... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_conversation(['Hello', 'How are you?', 'n']) == 'Goodbye.'\", \"assert simulate_conversation(['Yes', 'Maybe', 'I am fine']) == 'Conversation continues.'\", \"assert simulate_conversation(['What is your name?', 'n']) == 'Goodbye.'\", \"assert simulat... | {
"split": "train",
"index": 5441,
"acecode_id": "oss_740",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries representing animals, where each dictionary contains information about an animal's name and age. Your task is to implement a function `add_species` that takes in two parameters: a list of animal dictionaries named `animals` and a string `spe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert(animals[0]['type'] == 'dog')\", \"assert(animals[0]['species'] == 'Canine')\", \"assert(animals[1]['type'] == 'dog')\", \"assert(animals[1]['species'] == 'Canine')\", \"assert(animals[0]['species'] == 'Canine')\", \"assert(animals[0]['type'] == 'dog')\", \"a... | {
"split": "train",
"index": 5442,
"acecode_id": "evol_31837",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of detections from a sensor network. Each detection is represented as a tuple containing the arrival time, site ID, time gap from the previous detection at the same site, and the phase of the detection. Your task is to implement a function that takes this l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_overlaps([(1, 1, 0.5, 'A'), (2, 1, 0.3, 'A'), (3, 2, 0.7, 'B')]) == 0\", \"assert count_overlaps([(1, 1, 0.5, 'A'), (1.1, 2, 0.3, 'B'), (1.2, 3, 0.5, 'C')]) == 3\", \"assert count_overlaps([(1, 1, 0.5, 'A'), (2, 1, 0.5, 'A'), (3, 1, 0.5, 'A')]) == 0\",... | {
"split": "train",
"index": 5443,
"acecode_id": "oss_6789",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that compares two version numbers following the Semantic Versioning (SemVer) specification. Semantic Versioning consists of three parts: major version, minor version, and patch version, separated by dots (e.g., 1.2.3). Additionally... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compare_versions('1.0.0', '1.0.0') == 0\", \"assert compare_versions('1.0.1', '1.0.0') == 1\", \"assert compare_versions('1.0.0', '1.0.1') == -1\", \"assert compare_versions('1.1.0', '1.0.9') == 1\", \"assert compare_versions('2.0.0', '1.999.999') == 1\", \"... | {
"split": "train",
"index": 5444,
"acecode_id": "oss_36698",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the process of importing a module named `foo_c` from a subdirectory using a relative import. Write a Python function named `import_foo_c` that attempts to import the `foo_c` module. The function should return a string 'Impo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert import_foo_c() == 'Import successful'\", \"assert import_foo_c() == 'Import successful'\", \"assert import_foo_c() == 'Import successful'\", \"assert import_foo_c() == 'Import successful'\", \"assert import_foo_c() == 'Import successful'\", \"assert import_f... | {
"split": "train",
"index": 5445,
"acecode_id": "oss_5566",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a string as input and returns a list of its individual characters. The function should handle any kind of string, including empty strings, and should maintain the order of the characters in the output list.\nPlease reason step by step, then write a s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert disassemble_string('') == []\", \"assert disassemble_string('a') == ['a']\", \"assert disassemble_string('abc') == ['a', 'b', 'c']\", \"assert disassemble_string('Hello') == ['H', 'e', 'l', 'l', 'o']\", \"assert disassemble_string('123') == ['1', '2', '3']\"... | {
"split": "train",
"index": 5446,
"acecode_id": "evol_187",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program that calculates the sum of a list of integers. Your function should take a list of integers as input and return the sum of these integers. The input will be a list of integers and the output should be a single integer representing the tota... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_sum([1, 2, 3]) == 6\", \"assert calculate_sum([10, 20, 30]) == 60\", \"assert calculate_sum([-1, -2, -3]) == -6\", \"assert calculate_sum([0, 0, 0]) == 0\", \"assert calculate_sum([100, 200, 300]) == 600\", \"assert calculate_sum([1]) == 1\", \"ass... | {
"split": "train",
"index": 5447,
"acecode_id": "oss_10729",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes three strings as input and returns the length of the longest common subsequence among them. The function should handle any erroneous input values by raising a ValueError if any of the input strings is not of string type. The function should tr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longest_common_subsequence('abc', 'abc', 'abc') == 3\", \"assert longest_common_subsequence('abc', 'def', 'ghi') == 0\", \"assert longest_common_subsequence('abcdef', 'aebdcf', 'abc') == 3\", \"assert longest_common_subsequence('xyz', 'xy', 'x') == 1\", \"as... | {
"split": "train",
"index": 5448,
"acecode_id": "evol_5415",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of integers representing the x and y coordinates of turbines located in a 2D plane. You need to implement a function `calculate_average_power(turbine_indices, power_values, x_turbs, y_turbs, max_radius, include_self)` that calculates and returns the aver... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_power([0], [100], [0], [0], 5, False) == 0\", \"assert calculate_average_power([0], [100], [0], [0], 5, True) == 100\", \"assert calculate_average_power([0, 1], [100, 150], [0, 3], [0, 4], 5, True) == 125\", \"assert calculate_average_power... | {
"split": "train",
"index": 5449,
"acecode_id": "bigcode_python_fns_35787",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that checks if a given username and password combination is valid based on predefined valid credentials. You will receive a list of valid credentials, where each credential is a tuple consisting of a username and a password. Your function ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_credentials([('user1', 'pass1'), ('user2', 'pass2')], 'user1', 'pass1') == True\", \"assert is_valid_credentials([('user1', 'pass1'), ('user2', 'pass2')], 'user2', 'pass2') == True\", \"assert is_valid_credentials([('user1', 'pass1'), ('user2', 'pas... | {
"split": "train",
"index": 5450,
"acecode_id": "oss_9569",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a k-NN algorithm that categorizes a new point as 'positive' or 'negative' based on the provided dataset. The dataset may contain erroneous inputs that should be ignored. The algorithm should also normalize the data before calculating distances. Your function should ta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert k_nn([('1', '2', 'Positive'), ('4', '6', 'Positive'), ('6', '8', 'Negative')], 3, ['2.5', '3']) == 'Positive'\", \"assert k_nn([('10', '15', 'Negative'), ('5', '5', 'Positive'), ('7', '9', 'Positive')], 2, ['6', '7']) == 'Positive'\", \"assert k_nn([('0', '0... | {
"split": "train",
"index": 5451,
"acecode_id": "evol_1970",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of integers and returns a new list containing only the unique elements from the input list, preserving the original order of their first occurrence. Write a Python function `unique_elements` that takes a list of inte... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_elements([1, 2, 2, 3, 4, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert unique_elements([5, 5, 5, 5]) == [5]\", \"assert unique_elements([]) == []\", \"assert unique_elements([1, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert unique_elements([1, 2, 1, 3, 2]) == [1, 2, ... | {
"split": "train",
"index": 5452,
"acecode_id": "oss_8207",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `calculate_total_cost(items: List[Tuple[str, float]]) -> float` that takes a list of tuples, where each tuple contains the name of an item as a string and its price as a float. The function should return the total cost of all the items in the list. If the l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_cost([]) == 0.0\", \"assert calculate_total_cost([('Apples', 5.0)]) == 5.0\", \"assert calculate_total_cost([('Bananas', 3.0), ('Oranges', 2.0)]) == 5.0\", \"assert calculate_total_cost([('Milk', 1.5), ('Bread', 2.5), ('Cheese', 3.0)]) == 7.0... | {
"split": "train",
"index": 5453,
"acecode_id": "evol_13868",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an input string (`s`) and a pattern (`p`). Your task is to implement a function that determines if the input string matches the pattern. The pattern can include the special characters `'.'` which matches any single character, and `'*'` which matches zero or more o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_match('aa', 'a') == False\", \"assert is_match('aa', 'a*') == True\", \"assert is_match('ab', '.*') == True\", \"assert is_match('aab', 'c*a*b') == True\", \"assert is_match('mississippi', 'mis*is*p*.') == False\", \"assert is_match('', '') == True\", \"a... | {
"split": "train",
"index": 5454,
"acecode_id": "evol_31397",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with converting a human-readable size string into bytes. The input will be a string that represents a size followed by a unit. The units can be 'B' (bytes), 'K' (kilobytes), 'M' (megabytes), 'G' (gigabytes), 'T' (terabytes), or 'P' (petabytes). The conversion sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert string_to_bytes('1K', False) == 1000\", \"assert string_to_bytes('1M', False) == 1000000\", \"assert string_to_bytes('1G', False) == 1000000000\", \"assert string_to_bytes('1T', False) == 1000000000000\", \"assert string_to_bytes('1P', False) == 100000000000... | {
"split": "train",
"index": 5455,
"acecode_id": "bigcode_python_fns_35888",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a dictionary representing dynamic render states. The function should take in a dictionary `data` which may contain the following keys: 'lineWidth', 'depthBiasConstantFactor', 'depthBiasClamp', 'depthBiasSlopeFactor', 'b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_render_states({'lineWidth': 2.0}) == (2.0, 0.0, 0.0, 0.0, [0.0, 0.0, 0.0, 0.0], [0.0, 1.0], 4294967295, 4294967295, 4294967295, 0, 0, 0, 0, 0, 0)\", \"assert process_render_states({'depthBiasConstantFactor': 1.5}) == (1.0, 1.5, 0.0, 0.0, [0.0, 0.0, 0... | {
"split": "train",
"index": 5456,
"acecode_id": "bigcode_python_fns_3734",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `format_message(message: str) -> str` that formats a given message by prepending a predefined hostname '[MyHost]' to it. The function should return the formatted message. For example, if the input message is 'Hello, World!', the output sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_message('Hello, World!') == '[MyHost] Hello, World!'\", \"assert format_message('Test message') == '[MyHost] Test message'\", \"assert format_message('Python is fun!') == '[MyHost] Python is fun!'\", \"assert format_message('LeetCode Challenge') == '[... | {
"split": "train",
"index": 5457,
"acecode_id": "bigcode_python_fns_34285",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that determines the number of unique colors in a given list of RGB color tuples. Each color is represented as a tuple of three integers, corresponding to the red, green, and blue components of the color (each ranging from 0 to 255). Your ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_colors([(255, 0, 0), (0, 255, 0), (0, 0, 255), (255, 0, 0)]) == 3\", \"assert count_unique_colors([(0, 0, 0), (255, 255, 255), (255, 255, 255)]) == 2\", \"assert count_unique_colors([(123, 234, 45), (123, 234, 45)]) == 1\", \"assert count_unique... | {
"split": "train",
"index": 5458,
"acecode_id": "oss_29678",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `binary_search_with_count(arr: List[Union[int, float]], x: Union[int, float]) -> Tuple[int, int]` that performs a binary search on a sorted list of numeric values and returns the index of the element `x` if found, along with the number of comparisons made d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binary_search_with_count([1.1, 2.2, 3.3, 4.4], 2.2) == (1, 1)\", \"assert binary_search_with_count([2, 4, 6, 8, 10], 10) == (4, 3)\", \"assert binary_search_with_count([1, 3, 5, 7, 9], 9) == (4, 3)\", \"assert binary_search_with_count([1, 2, 3], 2) == (1, 1)... | {
"split": "train",
"index": 5459,
"acecode_id": "evol_22896",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `turn_off_device(device_status: str) -> str` that simulates turning off a device. The function takes a single parameter `device_status`, which can either be 'on' or 'off'. If the device is 'on', the function should return the message ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert turn_off_device('on') == 'Device turned off'\", \"assert turn_off_device('on') == 'Device turned off'\", \"assert turn_off_device('on') == 'Device turned off'\", \"assert turn_off_device('on') == 'Device turned off'\", \"assert turn_off_device('on') == 'Devi... | {
"split": "train",
"index": 5460,
"acecode_id": "bigcode_python_fns_30824",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Write a function `translate(message: str) -> str` that can interpret and translate a string to Morse code and vice versa. The function should accept a string of words and translate it to Morse code or accept a string of Morse code and translate it back to alphanumeric character... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert translate('Hello World') == '.... . .-.. .-.. --- / .-- --- .-. .-.. -..'\", \"assert translate('123') == '.---- ..--- ...--'\", \"assert translate('.---- ..--- ...--') == '123'\", \"assert translate('Good morning!') == '--. --- --- -.. / -- --- .-. -. .. -.... | {
"split": "train",
"index": 5461,
"acecode_id": "evol_21180",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a 2D matrix of integers, implement a function that returns the elements of the matrix in diagonal zigzag order. The elements should be traversed starting from the top-left corner, going to the bottom-right corner, and alternating the direction of traversal on each diagona... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert printDiagonalZigZag([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == [1, 2, 4, 7, 5, 3, 6, 8, 9]\", \"assert printDiagonalZigZag([[1]]) == [1]\", \"assert printDiagonalZigZag([[1, 2], [3, 4]]) == [1, 2, 3, 4]\", \"assert printDiagonalZigZag([[1, 2], [3, 4], [5, 6]]) ==... | {
"split": "train",
"index": 5462,
"acecode_id": "evol_12924",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a function `load_xml_string(xml_string: str) -> Element` that takes an XML string as input and returns the root element of the parsed XML. The function should be able to handle well-formed XML strings and raise an exception for malformed XML strings.\nPlease reason st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert load_xml_string('<root><child>data</child></root>').tag == 'root'\", \"assert load_xml_string('<book><title>Python Programming</title><author>John Doe</author></book>').find('title').text == 'Python Programming'\", \"assert load_xml_string('<catalog><product... | {
"split": "train",
"index": 5463,
"acecode_id": "evol_35635",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary that maps (place, year) pairs to sets of diseases reported in that place during that year. Your task is to implement a function that updates this dictionary with new disease reports provided in a list of tuples. Each tuple contains a place (string), a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_diseases({('New York', 2020): {'Flu'}, ('California', 2019): {'Cold'}}, [('New York', 2020, 'COVID-19'), ('California', 2019, 'Flu')]) == {('New York', 2020): {'Flu', 'COVID-19'}, ('California', 2019): {'Cold', 'Flu'}}\", \"assert update_diseases({}, ... | {
"split": "train",
"index": 5464,
"acecode_id": "bigcode_python_fns_2751",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `count_character_types(s: str) -> Tuple[int, int, int]` that takes a string `s` as input and returns a tuple containing three integers. The first integer should represent the count of alphabetic characters, the second integer should represent the count of n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_character_types('123456') == (0, 6, 0)\", \"assert count_character_types('') == (0, 0, 0)\", \"assert count_character_types('!!!@@@') == (0, 0, 6)\", \"assert count_character_types('abc 123 !!!') == (3, 3, 3)\", \"assert count_character_types('!@#$%^&*... | {
"split": "train",
"index": 5465,
"acecode_id": "evol_27019",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a string that represents a database URI. Your task is to write a function that extracts and returns the database path from the URI. The database URI follows the format: 'db_engine://username:password@host:port/database_name'. If the URI is invalid or does not cont... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_db_path('postgresql://user:pass@localhost:5432/mydb') == '/mydb'\", \"assert extract_db_path('mongodb://user:pass@localhost:27017/mydb') == '/mydb'\", \"assert extract_db_path('mysql://user:pass@localhost:3306/mydb') == '/mydb'\", \"assert extract_db... | {
"split": "train",
"index": 5466,
"acecode_id": "bigcode_python_fns_25360",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes two integers, `from_range` and `to_range`, and returns a list of all prime numbers within the inclusive range from `from_range` to `to_range`. A prime number is defined as a natural number greater than 1 that is not divisible by any natural numbe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert print_primes(10, 20) == [11, 13, 17, 19]\", \"assert print_primes(1, 10) == [2, 3, 5, 7]\", \"assert print_primes(15, 30) == [17, 19, 23, 29]\", \"assert print_primes(20, 30) == [23, 29]\", \"assert print_primes(25, 35) == [29, 31]\", \"assert print_primes(5... | {
"split": "train",
"index": 5467,
"acecode_id": "evol_21338",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a custom admin interface for a project management application. The application manages projects, and you need to create a function that simulates the configuration of an admin interface for a Project model. Your function should accept a list of proj... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert configure_admin_interface([{'title': 'Project A', 'start_date': '2023-01-01', 'end_date': '2023-06-01'}, {'title': 'Project B', 'start_date': '2022-05-01', 'end_date': '2022-12-01'}], '2023-01-01') == [('Project A', '2023-01-01', '2023-06-01')]\", \"assert c... | {
"split": "train",
"index": 5468,
"acecode_id": "oss_3595",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of products, each represented as a dictionary with keys 'name', 'description', and 'price', and returns a list of product names that are above a given price threshold. The function should be called `filter_products_by_price` and should acc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_products_by_price([{'name': 'Apple', 'description': 'Fresh apples', 'price': 1.0}, {'name': 'Banana', 'description': 'Ripe bananas', 'price': 0.5}], 0.75) == ['Apple']\", \"assert filter_products_by_price([], 1.0) == []\", \"assert filter_products_by_... | {
"split": "train",
"index": 5469,
"acecode_id": "evol_33792",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing a sequence of numbers. Your task is to implement a function that removes all occurrences of the last number in the list. The function should take a list of integers as input and return a new list with the last number removed. If the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_last_number([1, 2, 3, 4, 4]) == [1, 2, 3]\", \"assert remove_last_number([1, 1, 1]) == []\", \"assert remove_last_number([5, 6, 7, 8, 9, 9]) == [5, 6, 7, 8]\", \"assert remove_last_number([10, 20, 30]) == [10, 20]\", \"assert remove_last_number([4]) =... | {
"split": "train",
"index": 5470,
"acecode_id": "bigcode_python_fns_48691",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a list of integers and an integer n. The function should reverse the list in-place and then return the value of the nth element from the end of the reversed list. If n is larger than the length of the list or if n is 0 or negative, the function shoul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_and_return([1, 2, 3, 4, 5], 2) == 4\", \"assert reverse_and_return([1], 1) == 1\", \"assert reverse_and_return([], 1) == None\", \"assert reverse_and_return([7, 14, 21], 0) == None\", \"assert reverse_and_return([8, 16, 24, 32], 5) == None\", \"asser... | {
"split": "train",
"index": 5471,
"acecode_id": "evol_19072",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates starting a timer. When the function is called, it should return another function that, when called, returns the number of seconds elapsed since the timer was started. Implement the function `offset_timer()` that achieves th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert abs(offset_timer()()) < 0.01\", \"assert abs(offset_timer()()) < 0.01\", \"assert abs(offset_timer()()) < 0.01\", \"assert abs(offset_timer()()) < 0.01\", \"assert abs(offset_timer()()) < 0.01\", \"assert abs(offset_timer()()) < 0.01\", \"assert abs(offset_t... | {
"split": "train",
"index": 5472,
"acecode_id": "bigcode_python_fns_29650",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two points in a 3D space represented by their coordinates (x1, y1, z1) and (x2, y2, z2), write a function `unit_vector(location_1: List[float], location_2: List[float]) -> List[float]` that calculates the unit vector pointing from the first point to the second point. The ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unit_vector([1.0, 2.0, 3.0], [4.0, 5.0, 6.0]) == [0.5773502691896257, 0.5773502691896257, 0.5773502691896257]\", \"assert unit_vector([2.0, 3.0, 4.0], [5.0, 6.0, 7.0]) == [0.5773502691896257, 0.5773502691896257, 0.5773502691896257]\", \"assert unit_vector([1... | {
"split": "train",
"index": 5473,
"acecode_id": "bigcode_python_fns_17290",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of tuples, where each tuple contains details about a game in the format (game_full_name, game_full_path, game_icon, game_dir, game_state). Your task is to implement a function that takes this list of games and a string representing a directory location. The... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert list_installed_games([('Game A', '/games/GameA', 'iconA.png', '/games', 'installed'), ('Game B', '/games/GameB', 'iconB.png', '/games', 'uninstalled')], '/games') == ['Game A']\", \"assert list_installed_games([('Game A', '/games/GameA', 'iconA.png', '/games... | {
"split": "train",
"index": 5474,
"acecode_id": "bigcode_python_fns_36661",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function `construct_params(args)` that takes a namespace object `args` with the following boolean attributes: `no_sound`, `disable_net`, `disable_fin`, `enable_kinect`, `prod`, `mpd`, and `max`. The function should construct and return a list of parameters based on ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert construct_params(MockNamespace(no_sound=True, disable_net=False, disable_fin=True, enable_kinect=True, prod=False, mpd=False, max=True)) == ['--no-sound', '--disable-fin', '--enable-kinect', '--max']\", \"assert construct_params(MockNamespace(no_sound=False,... | {
"split": "train",
"index": 5475,
"acecode_id": "oss_19392",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing reads in the FASTQ format. Each read consists of four lines: the first line starts with a '@' symbol followed by the read name, the second line contains the nucleotide sequence, the third line is a line starting with a '+' symbol (wh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_fastq(['@read1', 'AGCT', '+', 'IIII', '@read2', 'CGTA', '+', 'IIII']) == [('read1', 'AGCT', 'IIII'), ('read2', 'CGTA', 'IIII')]\", \"assert parse_fastq(['@seq1', 'ATCG', '+', 'FFFF', '@seq2', 'GCTA', '+', 'JJJJ']) == [('seq1', 'ATCG', 'FFFF'), ('seq2',... | {
"split": "train",
"index": 5476,
"acecode_id": "bigcode_python_fns_14857",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list `x` containing a sequence of elements. Your task is to implement a function `manipulate_list(x)` that simulates a specific manipulation process on the list according to the following rules:\n1. While the length of `x` is greater than 1, perform the followin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manipulate_list([10, 20, 30, 40]) == [40]\", \"assert manipulate_list([1]) == [1]\", \"assert manipulate_list([7, 8]) == [8]\", \"assert manipulate_list([0, 1, 2, 3]) == [3]\", \"assert manipulate_list([100]) == [100]\", \"assert manipulate_list([2, 2, 2, 2]... | {
"split": "train",
"index": 5477,
"acecode_id": "oss_20389",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a list of actions where each action is represented as a tuple containing a syscall name, a list of paths, and a result, write a function `extract_paths(actions)` that extracts all unique absolute and relative paths from the actions. An absolute path starts with a forward ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_paths([('open_syscall', ['/home/user/file.txt'], (0, ''))]) == (['/home/user/file.txt'], [])\", \"assert extract_paths([('open_syscall', ['file.txt'], (0, ''))]) == ([], ['file.txt'])\", \"assert extract_paths([('creat_syscall', ['/var/log/syslog'], ... | {
"split": "train",
"index": 5478,
"acecode_id": "bigcode_python_fns_6284",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that sorts a list of integers in ascending order using the selection sort algorithm. The function should take a list of integers as input and return a new list that contains the same integers sorted in ascending order. Do not modify the original list. For e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert selection_sort([10, 4, 5, 7, 2]) == [2, 4, 5, 7, 10]\", \"assert selection_sort([3, 1, 4, 1, 5]) == [1, 1, 3, 4, 5]\", \"assert selection_sort([5, 5, 5, 5]) == [5, 5, 5, 5]\", \"assert selection_sort([-1, -3, 0, 2, 1]) == [-3, -1, 0, 1, 2]\", \"assert select... | {
"split": "train",
"index": 5479,
"acecode_id": "evol_15559",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that calculates the median value from a provided list of integers. The function should handle cases with repeated values and negative integers. If the list is empty, the function should return None. The median is defined as the value separating the higher half ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_median([12, 30, 4, 18, 24, 18]) == 18\", \"assert find_median([-12, -30, -18, -18, -24]) == -18\", \"assert find_median([1, 3, 3, 6, 7, 8, 9]) == 6\", \"assert find_median([1, 2, 3, 4]) == 2.5\", \"assert find_median([]) == None\", \"assert find_median(... | {
"split": "train",
"index": 5480,
"acecode_id": "evol_4085",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with optimizing a piece of code that retrieves user data from a database. The current implementation makes redundant queries to obtain the count of users. Your task is to refactor the code to eliminate the redundant query for user count while still achieving the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert optimize_user_data(['Alice', 'Bob', 'Alice']) == (2, ['Alice', 'Bob'])\", \"assert optimize_user_data(['Alice', 'Alice', 'Alice']) == (1, ['Alice'])\", \"assert optimize_user_data(['Alice', 'Bob', 'Charlie']) == (3, ['Alice', 'Bob', 'Charlie'])\", \"assert o... | {
"split": "train",
"index": 5481,
"acecode_id": "oss_15323",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of preference names represented as strings, implement a function `create_preference_branch(preference_names: List[str]) -> Dict[str, str]` that creates a preference branch by mapping each preference name to its corresponding string representation in a dictionary. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_preference_branch(['preference1', 'preference2', 'preference3']) == {'preference1': 'preference1', 'preference2': 'preference2', 'preference3': 'preference3'}\", \"assert create_preference_branch(['preferenceA']) == {'preferenceA': 'preferenceA'}\", \... | {
"split": "train",
"index": 5482,
"acecode_id": "bigcode_python_fns_28665",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with extracting the package name and version from a given package specification string. The input will be a string in the format 'package-name-version-release' (e.g., 'example-package-1.0.0-1'). Your goal is to return the package name and version as a single stri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_package_nvr('example-package-1.0.0-1') == 'example-package-1.0.0'\", \"assert get_package_nvr('test-app-2.3.4-5') == 'test-app-2.3.4'\", \"assert get_package_nvr('my-tool-0.1.2-3') == 'my-tool-0.1.2'\", \"assert get_package_nvr('data-analyzer-4.5.6-7') =... | {
"split": "train",
"index": 5483,
"acecode_id": "bigcode_python_fns_11707",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, implement a function that returns the sum of the squares of the elements in the array. The function should take a single parameter, an array of integers, and return a single integer representing the sum of the squares.\nPlease reason step by step, th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_square([1, 2, 3]) == 14\", \"assert sum_square([0, 0, 0]) == 0\", \"assert sum_square([-1, -2, -3]) == 14\", \"assert sum_square([4, 5]) == 41\", \"assert sum_square([10]) == 100\", \"assert sum_square([]) == 0\", \"assert sum_square([2, 2]) == 8\", \"as... | {
"split": "train",
"index": 5484,
"acecode_id": "evol_27758",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `unmount_ramdisk` that takes two strings as input: `dev_path` and `path`. This function simulates the unmounting of a RAM disk. Your function should return a message indicating the successful unmounting of the RAM disk and the removal... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unmount_ramdisk('disk1', '/mnt/ramdisk') == 'Unmounted /mnt/ramdisk and removed disk1'\", \"assert unmount_ramdisk('disk2', '/mnt/test') == 'Unmounted /mnt/test and removed disk2'\", \"assert unmount_ramdisk('disk3', '/home/user/ram') == 'Unmounted /home/use... | {
"split": "train",
"index": 5485,
"acecode_id": "bigcode_python_fns_39321",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_and_validate_linked_list(data_list: List[Any]) -> bool` that takes a list of data values and creates a singly linked list from the values. The function should ensure that the data value in the head node is identical to the data value in the tail nod... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_and_validate_linked_list(['A', 'B', 'C', 'A']) == True\", \"assert create_and_validate_linked_list(['Node1', 'Node2', 'Node3', 'Node1']) == True\", \"assert create_and_validate_linked_list(['X', 'Y', 'Z', 'W']) == False\", \"assert create_and_validate... | {
"split": "train",
"index": 5486,
"acecode_id": "evol_1187",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that determines if there exists at least one even number in the list. The function should return True if there is at least one even number, and False otherwise. The input list can be empty. You need to implement a function called `cont... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert contains_even([1, 3, 5]) == False\", \"assert contains_even([1, 2, 3]) == True\", \"assert contains_even([0, 1, 2]) == True\", \"assert contains_even([]) == False\", \"assert contains_even([2, 4, 6]) == True\", \"assert contains_even([-1, -3, -5]) == False\"... | {
"split": "train",
"index": 5487,
"acecode_id": "bigcode_python_fns_1975",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of items in a store. Each item is represented as a dictionary with two keys: 'name' (a string representing the item's name) and 'type' (a string representing the item's type, which is optional). The function should r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_store_items([{'name': 'Apple', 'type': 'Fruit'}, {'name': 'Laptop'}]) == [{'name': 'Apple', 'type': 'Fruit'}, {'name': 'Laptop', 'type': 'Laptop'}]\", \"assert process_store_items([{'name': 'Banana'}, {'name': 'Carrot', 'type': 'Vegetable'}]) == [{'n... | {
"split": "train",
"index": 5488,
"acecode_id": "oss_20960",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a tuple, implement a function `convert_tuple_to_json` that converts the tuple into a JSON string. The function should raise a TypeError if the input is not a tuple and handle any potential exceptions by returning None. The function should have good readability and efficie... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_tuple_to_json((1, 2, 3)) == '[1, 2, 3]'\", \"assert convert_tuple_to_json((True, False, None)) == '[true, false, null]'\", \"assert convert_tuple_to_json((1.5, 2.5, 3.5)) == '[1.5, 2.5, 3.5]'\", \"assert convert_tuple_to_json(((),)) == '[[]]'\", \"as... | {
"split": "train",
"index": 5489,
"acecode_id": "evol_16383",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a browser history navigation system. Your goal is to create a function that simulates navigating through browser history. The function should take an initial URL and a list of operations to perform. Each operation can be a 'visit' with a new URL... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert browser_history('google.com', [('visit', 'facebook.com'), ('visit', 'twitter.com'), ('back', 1), ('visit', 'linkedin.com')]) == 'linkedin.com'\", \"assert browser_history('example.com', [('back', 1), ('visit', 'site1.com'), ('back', 1), ('forward', 1)]) == '... | {
"split": "train",
"index": 5490,
"acecode_id": "oss_10097",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function in python that removes duplicates from a given list while maintaining the original order of the first appearance of each element. The input list can contain both integers and strings. The function should return a new list with the duplicates removed.\nPleas... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_duplicates([1, 2, 3, 1, 2, 3]) == [1, 2, 3]\", \"assert remove_duplicates(['apple', 'banana', 'apple', 'orange']) == ['apple', 'banana', 'orange']\", \"assert remove_duplicates([1, 'apple', 2, 'banana', 1, 'apple']) == [1, 'apple', 2, 'banana']\", \"a... | {
"split": "train",
"index": 5491,
"acecode_id": "evol_17214",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of numerical features representing characteristics of a tumor. Your task is to implement a function that normalizes these features based on predefined mean and range values of the training dataset, and predicts whether the tumor is benign or malignant. The ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert predict_tumor([10.0, 20.0, 30.0, 40.0, 50.0]) == 'Prediction: Benign Tumor Found'\", \"assert predict_tumor([0.0, 10.0, 20.0, 30.0, 40.0]) == 'Prediction: Malignant Tumor Found'\", \"assert predict_tumor([-5.0, 5.0, 15.0, 25.0, 35.0]) == 'Prediction: Maligna... | {
"split": "train",
"index": 5492,
"acecode_id": "bigcode_python_fns_22678",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers and your task is to implement a function `sum_of_even_numbers(nums)` that calculates the sum of all even numbers in the provided list. The function should take the following parameter: \n- `nums`: A list of integers. \n\nThe function should retu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_even_numbers([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_even_numbers([10, 15, 20, 25]) == 30\", \"assert sum_of_even_numbers([1, 3, 5, 7]) == 0\", \"assert sum_of_even_numbers([2, 4, 6, 8]) == 20\", \"assert sum_of_even_numbers([-2, -4, -6, 1]) == -12\"... | {
"split": "train",
"index": 5493,
"acecode_id": "oss_885",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of memory arena descriptions. Each description is represented as a tuple containing the following elements: an integer ID, a hexadecimal memory address (as a string), a status string ('active' or 'inactive'), and an ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_memory_arenas([(1, '0x1a2b3c4d', 'active', 512), (2, '0x2b3c4d5e', 'inactive', 256)]) == ['1: 0x1a2b3c4d active 512 KB', '2: 0x2b3c4d5e inactive 256 KB']\", \"assert format_memory_arenas([(3, '0x3c4d5e6f', 'inactive', 1024), (4, '0x4d5e6f7a', 'active'... | {
"split": "train",
"index": 5494,
"acecode_id": "bigcode_python_fns_22949",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, implement a function `find_shortest_unique_substring(strings)` that returns the shortest unique sub-string among those strings. A unique sub-string is defined as the smallest-length string that appears in one string but not in any other string in the li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_shortest_unique_substring(['abc', 'def', 'xyz', 'abcde']) == 'f'\", \"assert find_shortest_unique_substring(['a', 'b', 'c', 'd']) == 'a'\", \"assert find_shortest_unique_substring(['abcd', 'efgh', 'ijkl', 'mnop']) == 'a'\", \"assert find_shortest_unique... | {
"split": "train",
"index": 5495,
"acecode_id": "evol_32676",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the number of steps required to complete one epoch of training a neural network model. Given two integers, `file_count` (the total number of training samples) and `batch_size` (the number of samples processed in one it... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_steps(100, 10) == 10\", \"assert calculate_steps(105, 10) == 11\", \"assert calculate_steps(50, 5) == 10\", \"assert calculate_steps(50, 7) == 8\", \"assert calculate_steps(0, 10) == 0\", \"assert calculate_steps(1, 1) == 1\", \"assert calculate_st... | {
"split": "train",
"index": 5496,
"acecode_id": "bigcode_python_fns_19202",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a simple user management system. Implement a function `manage_users` that takes a list of user operations and returns the final state of the users after applying all the operations. The operations will be given as a list of tuples, where each tuple ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_users([]) == []\", \"assert manage_users([('add', {'username': 'alice', 'email': 'alice@example.com'})]) == [{'username': 'alice', 'email': 'alice@example.com'}]\", \"assert manage_users([('add', {'username': 'bob', 'email': 'bob@example.com'}), ('add... | {
"split": "train",
"index": 5497,
"acecode_id": "oss_31662",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that returns a new list containing only the even numbers from the original list, preserving the order of appearance. If no even numbers are found, return an empty list. The function should be defined as follows: `def filter_even_number... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 15, 20, 25]) == [10, 20]\", \"assert filter_even_numbers([1, 3, 5, 7]) == []\", \"assert filter_even_numbers([2, 4, 6, 8]) == [2, 4, 6, 8]\", \"assert filter_even_numbers([-2... | {
"split": "train",
"index": 5498,
"acecode_id": "bigcode_python_fns_2691",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a configuration for a VGG model based on the number of blocks. The function should take an integer `blocks` as input, which determines the architecture of the VGG model. The function should return a list representing the nu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_vgg_configuration(11) == [64, 64, 128, 128, 128]\", \"assert generate_vgg_configuration(13) == [64, 64, 128, 128, 128]\", \"assert generate_vgg_configuration(16) == [64, 64, 128, 128, 256]\", \"assert generate_vgg_configuration(19) == [64, 64, 128, ... | {
"split": "train",
"index": 5499,
"acecode_id": "bigcode_python_fns_28540",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.