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 managing a list of software project changelogs. Create a function `manage_changelog` that takes a list of operations as input, where each operation is a tuple consisting of an action ('add', 'get', 'delete') and its associated parameters. The function should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_changelog([('add', '1.0', 'Initial release'), ('get', '1.0')]) == [None, 'Initial release']\", \"assert manage_changelog([('add', '2.0', 'Second release'), ('get', '2.0'), ('delete', '2.0'), ('get', '2.0')]) == [None, 'Second release', True, 'Not foun... | {
"split": "train",
"index": 61300,
"acecode_id": "oss_3988",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an integer n representing the number of steps in a staircase. You can climb either 1 or 2 steps at a time. Write a function `countWays(n)` that returns the number of distinct ways to climb to the top of the staircase.\nPlease reason step by step, then write a self... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert countWays(0) == 1\", \"assert countWays(1) == 1\", \"assert countWays(2) == 2\", \"assert countWays(3) == 3\", \"assert countWays(4) == 5\", \"assert countWays(5) == 8\", \"assert countWays(6) == 13\", \"assert countWays(7) == 21\", \"assert countWays(8) == ... | {
"split": "train",
"index": 61301,
"acecode_id": "evol_2053",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing house prices. Your task is to write a function that computes the average house price. The function should take a list of integers as input and return a single integer representing the average price, rounded down to the nearest whole... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_house_price([200000, 300000, 250000]) == 250000\", \"assert average_house_price([150000, 300000, 400000, 500000]) == 337500\", \"assert average_house_price([100000]) == 100000\", \"assert average_house_price([]) == 0\", \"assert average_house_price([... | {
"split": "train",
"index": 61302,
"acecode_id": "oss_30275",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `monotonic_with_even_check(l: list, strict: bool = False) -> bool` that checks if a numerical array follows a monotonically increasing or decreasing pattern. Additionally, the function must first check if there exists at least one even number in the list. I... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert monotonic_with_even_check([1, 2, 4, 20]) == True\", \"assert monotonic_with_even_check([1, 20, 4, 10]) == False\", \"assert monotonic_with_even_check([4, 1, 1, 0, -10], strict=True) == False\", \"assert monotonic_with_even_check([2, 4, 6, 8]) == True\", \"as... | {
"split": "train",
"index": 61303,
"acecode_id": "evol_17377",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple web service status tracker. The function should allow you to initialize a status, update it with a new status, retrieve the current status, and reset the status to a default value. Implement a function named `servi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert service_status_tracker('FAILED', 'SUCCESS', False) == 'SUCCESS'\", \"assert service_status_tracker('INITIAL', 'UPDATED', True) == 'UPDATED'\", \"assert service_status_tracker('START', 'RUNNING', True) == 'RUNNING'\", \"assert service_status_tracker('UNKNOWN'... | {
"split": "train",
"index": 61304,
"acecode_id": "oss_27657",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks if a given string is a valid palindrome. A palindrome is a word, phrase, number, or other sequences of characters that reads the same forward and backward (ignoring spaces, punctuation, and capitalization). Your function s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_palindrome('A man, a plan, a canal: Panama') == True\", \"assert is_palindrome('racecar') == True\", \"assert is_palindrome('No lemon, no melon') == True\", \"assert is_palindrome('') == True\", \"assert is_palindrome(' ') == True\", \"assert is_palindrom... | {
"split": "train",
"index": 61305,
"acecode_id": "oss_16079",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple slot machine game. The slot machine has three reels, each displaying a symbol from a provided set of possible symbols. Your function should take a list of symbols as input, randomly select a symbol for each ree... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert slot_machine_game(['cherry', 'cherry', 'cherry']) == True\", \"assert slot_machine_game(['bell', 'bell', 'bell']) == True\", \"assert slot_machine_game(['lemon', 'lemon', 'lemon']) == True\", \"assert slot_machine_game(['orange', 'orange', 'orange']) == True... | {
"split": "train",
"index": 61306,
"acecode_id": "oss_28057",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that sends data through a UART interface. The function takes three parameters: an index (integer), a flag indicating whether the data is in binary format (boolean), and a data string. If the binary flag is set to true, the data string... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert send_data(1, False, 'Hello') == 'Data sent.'\", \"assert send_data(2, True, '48656c6c6f') == 'Data sent.'\", \"assert send_data(3, True, 'invalid_hex') == 'Invalid binary data'\", \"assert send_data(4, False, '') == 'Data sent.'\", \"assert send_data(0, True... | {
"split": "train",
"index": 61307,
"acecode_id": "bigcode_python_fns_9788",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer n, return a list of all the prime numbers less than n. A prime number is a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. Implement a function `list_primes(n: int) -> List[int]` that takes an integer n as input a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert list_primes(10) == [2, 3, 5, 7]\", \"assert list_primes(20) == [2, 3, 5, 7, 11, 13, 17, 19]\", \"assert list_primes(1) == []\", \"assert list_primes(2) == []\", \"assert list_primes(15) == [2, 3, 5, 7, 11, 13]\", \"assert list_primes(30) == [2, 3, 5, 7, 11, ... | {
"split": "train",
"index": 61308,
"acecode_id": "bigcode_python_fns_48013",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that executes the Karatsuba algorithm for multiplying two polynomials represented as lists of coefficients. Each polynomial is represented as a list where the index corresponds to the power of x (e.g., [1, 2, 3] represents 1 + 2x + 3x^2). The function shoul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert karatsuba_poly_mult([1], [1]) == [1]\", \"assert karatsuba_poly_mult([1, 2], [2, 3]) == [2, 7, 6]\", \"assert karatsuba_poly_mult([0], [0]) == [0]\", \"assert karatsuba_poly_mult([1, 1], [1, 1]) == [1, 2, 1]\", \"assert karatsuba_poly_mult([1, 0, 1, 0], [0, ... | {
"split": "train",
"index": 61309,
"acecode_id": "evol_1111",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a string formula that contains specific variable names that need to be reformatted according to a defined convention. Your task is to implement a function `xsthrow_format(formula: str) -> str` that replaces all occurrences of the following substrings in the input ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert xsthrow_format('accum_level[0] + selmu_mom[0] - selmu_theta[0]') == 'accum_level[xstool_throw] + selmu_mom[xstool_throw] - selmu_theta[xstool_throw]'\", \"assert xsthrow_format('no replacement needed here') == 'no replacement needed here'\", \"assert xsthrow... | {
"split": "train",
"index": 61310,
"acecode_id": "bigcode_python_fns_33356",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that generates and returns a list of the squares of successive integer values within a specified range (inclusive). The function should take two arguments, `start` and `end`, which define the range. The function should handle invalid inputs by returning an ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert square_values(1, 5) == [1, 4, 9, 16, 25]\", \"assert square_values(3, 3) == [9]\", \"assert square_values(5, 5) == [25]\", \"assert square_values(1, 1) == [1]\", \"assert square_values(1, 10) == [1, 4, 9, 16, 25, 36, 49, 64, 81, 100]\", \"assert square_value... | {
"split": "train",
"index": 61311,
"acecode_id": "evol_24674",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers and returns a new list containing only the even numbers from the original list, while maintaining the original order of the even numbers. Implement a function named `filter_even_numbers` that takes a list... | 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([])... | {
"split": "train",
"index": 61312,
"acecode_id": "oss_28368",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function called `generate_unit_vectors` that generates unit vectors in two dimensions. A unit vector is a vector with a magnitude of 1 and is used to represent direction. The function should yield unit vectors for angles ranging from 0 to 360 ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert next(generate_unit_vectors()) == (1.0000000000000000, 0.0000000000000000)\", \"assert list(generate_unit_vectors())[1] == (0.7071067811865476, 0.7071067811865475)\", \"assert list(generate_unit_vectors())[3] == (-0.7071067811865475, 0.7071067811865476)\", \"... | {
"split": "train",
"index": 61313,
"acecode_id": "oss_4713",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that determines the status of a garage door based on the state of a sensor. The function should take two parameters: `is_active` (a boolean indicating whether the sensor is active) and `value` (an integer that can be either 0 or 1). T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert garage_status(True, 1) == 'OPEN'\", \"assert garage_status(False, 0) == 'CLOSED'\", \"assert garage_status(False, 1) == 'UNKNOWN'\", \"assert garage_status(True, 0) == 'UNKNOWN'\", \"assert garage_status(True, 0) == 'UNKNOWN'\", \"assert garage_status(True, ... | {
"split": "train",
"index": 61314,
"acecode_id": "bigcode_python_fns_31971",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that deletes a specific record from a list of records. Each record is represented as a dictionary containing the following keys: 'name', 'type', 'ttl', 'identifier', 'weight', and 'values'. Your function should accept a list of records an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delete_record([{'name': 'example.com', 'type': 'A', 'ttl': 600, 'identifier': '1', 'weight': 10, 'values': ['192.0.2.1']}], {'name': 'example.com', 'type': 'A', 'identifier': '1', 'weight': 10}) == []\", \"assert delete_record([{'name': 'example.com', 'type'... | {
"split": "train",
"index": 61315,
"acecode_id": "bigcode_python_fns_32064",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that adds an item to a given sorted list of numbers in ascending order. The function should insert the new item in such a way that the list remains sorted after the addition. The input list will always be sorted and can contain duplicate numbers. Impleme... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_item_sorted_list([1, 2, 3, 4, 5], 3) == [1, 2, 3, 3, 4, 5]\", \"assert add_item_sorted_list([1, 2, 2, 4, 5], 3) == [1, 2, 2, 3, 4, 5]\", \"assert add_item_sorted_list([], 1) == [1]\", \"assert add_item_sorted_list([1], 1) == [1, 1]\", \"assert add_item_s... | {
"split": "train",
"index": 61316,
"acecode_id": "evol_29150",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of lists, where each inner list is a sorted list of integers. Your task is to merge these sorted lists into a single sorted list. Implement the function `merge_sorted_lists(lists: List[List[int]]) -> List[int]` that merges the provided lists and returns a s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_sorted_lists([[1, 4, 5], [1, 3, 4], [2, 6]]) == [1, 1, 2, 3, 4, 4, 5, 6]\", \"assert merge_sorted_lists([[1, 2, 3], [4, 5, 6]]) == [1, 2, 3, 4, 5, 6]\", \"assert merge_sorted_lists([[10, 20, 30], [5, 15, 25]]) == [5, 10, 15, 20, 25, 30]\", \"assert mer... | {
"split": "train",
"index": 61317,
"acecode_id": "bigcode_python_fns_30716",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries where each dictionary represents a Directed Acyclic Graph (DAG) with a unique identifier (ID). Your task is to implement a function `get_dag(dags: List[Dict[str, Any]], dag_id: int) -> Union[Dict[str, Any], str]` that retrieves the DAG with ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_dag([{'id': 1, 'name': 'DAG1'}, {'id': 2, 'name': 'DAG2'}], 1) == {'id': 1, 'name': 'DAG1'}\", \"assert get_dag([{'id': 1, 'name': 'DAG1'}, {'id': 2, 'name': 'DAG2'}], 2) == {'id': 2, 'name': 'DAG2'}\", \"assert get_dag([{'id': 1, 'name': 'DAG1'}, {'id':... | {
"split": "train",
"index": 61318,
"acecode_id": "oss_14770",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of numbers, `train_values` and `test_values`, representing the actual values of a regression task for training and testing datasets, respectively. Additionally, you are given two lists of numbers, `train_predictions` and `test_predictions`, representing ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_rmse([3, -0.5, 2, 7], [2.5, 0.0, 2, 8]) == 0.6123724356957945\", \"assert calculate_rmse([1, 2, 3], [1, 2, 3]) == 0.0\", \"assert calculate_rmse([1, 2, 3], [2, 3, 4]) == 1.0\", \"assert calculate_rmse([0, 0, 0], [0, 0, 0]) == 0.0\", \"assert calcul... | {
"split": "train",
"index": 61319,
"acecode_id": "bigcode_python_fns_12942",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a bot command parser that extracts bot commands from a given JSON object. The JSON object contains a message and a list of entities, where each entity has a type, an offset, and a length. Your function should identify the bot commands by checkin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_bot_commands({\\\"message\\\": {\\\"text\\\": \\\"Hello, /start command!\\\", \\\"entities\\\": [{\\\"type\\\": \\\"bot_command\\\", \\\"offset\\\": 7, \\\"length\\\": 6}]}}) == ['/start']\", \"assert parse_bot_commands({\\\"message\\\": {\\\"text\\\":... | {
"split": "train",
"index": 61320,
"acecode_id": "oss_1445",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a deeply nested dictionary, you need to implement a function that replaces all integer values in the dictionary with their squares. The nested dictionary can have varying levels of depth. The function should return the updated dictionary. The integer values are represente... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert square_integers_in_dict({'key1': {'inner_key1': '1', 'inner_key2': '2'}}) == {'key1': {'inner_key1': '1', 'inner_key2': '4'}}\", \"assert square_integers_in_dict({'a': '3', 'b': {'c': '4', 'd': '5'}}) == {'a': '9', 'b': {'c': '16', 'd': '25'}}\", \"assert sq... | {
"split": "train",
"index": 61321,
"acecode_id": "evol_20325",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that traverses a binary tree. For each node of the tree, if the value of the node is less than 10, increment it by one. The function should return the total count of how many nodes were incremented during this process. You may assume that the binary tree nodes ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert incrementNode(Node(5)) == 1\", \"assert incrementNode(Node(15)) == 0\", \"assert incrementNode(Node(10)) == 0\", \"assert incrementNode(Node(3, Node(1), Node(9))) == 3\", \"assert incrementNode(Node(4, Node(8), Node(2))) == 3\", \"assert incrementNode(Node(1... | {
"split": "train",
"index": 61322,
"acecode_id": "evol_13294",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that checks if a given string is a palindrome. A palindrome is a word, phrase, number, or other sequence of characters that reads the same forward and backward (ignoring spaces, punctuation, and capitalization). Your function shoul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_palindrome('A man, a plan, a canal, Panama') == True\", \"assert is_palindrome('racecar') == True\", \"assert is_palindrome('hello') == False\", \"assert is_palindrome('Was it a car or a cat I saw?') == True\", \"assert is_palindrome('No lemon, no melon')... | {
"split": "train",
"index": 61323,
"acecode_id": "oss_33171",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_access_granted(user_attributes: List[str], required_attributes: List[str]) -> bool` that determines if a user has access based on the given attributes. The function should return True if the user possesses at least one of the required attributes, and Fa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_access_granted(['admin', 'editor'], ['admin', 'viewer']) == True\", \"assert is_access_granted(['user', 'contributor'], ['admin', 'viewer']) == False\", \"assert is_access_granted(['staff'], ['admin', 'staff']) == True\", \"assert is_access_granted([], ['... | {
"split": "train",
"index": 61324,
"acecode_id": "evol_26939",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a Python function that processes a list of integers and returns a new list containing only the unique integers from the original list, in the order they first appeared. Your function should be named `get_unique_integers` and should take one parameter... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_integers([1, 2, 2, 3, 4, 1]) == [1, 2, 3, 4]\", \"assert get_unique_integers([1, 1, 1, 1]) == [1]\", \"assert get_unique_integers([3, 3, 3, 2, 1, 1, 2]) == [3, 2, 1]\", \"assert get_unique_integers([]) == []\", \"assert get_unique_integers([10, 20... | {
"split": "train",
"index": 61325,
"acecode_id": "oss_11963",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a Python function called `access_first_element` that takes a list `x` as input and attempts to access its first element. If the list is empty, the function should return a custom error message 'List is empty, cannot access first element.' Otherwi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert access_first_element([]) == 'List is empty, cannot access first element.'\", \"assert access_first_element([1]) == 1\", \"assert access_first_element([0]) == 0\", \"assert access_first_element([-1]) == -1\", \"assert access_first_element([3, 5, 7]) == 3\", \... | {
"split": "train",
"index": 61326,
"acecode_id": "oss_11371",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks if a given string is a valid identifier in Python. A valid identifier is defined as follows: it must start with a letter or underscore, followed by any combination of letters, digits, or underscores. The identifier cannot ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_identifier('valid_identifier') == True\", \"assert is_valid_identifier('_validIdentifier123') == True\", \"assert is_valid_identifier('2invalidStart') == False\", \"assert is_valid_identifier('invalid-char!') == False\", \"assert is_valid_identifier... | {
"split": "train",
"index": 61327,
"acecode_id": "oss_15169",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that converts HTML character entities back to their corresponding characters. The function should take a single string as input, which may contain HTML character entities such as `"`, `&`, `<`, `>`, and `'`. Your goal i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unescape_html('<div>Hello & welcome!</div>') == '<div>Hello & welcome!</div>'\", \"assert unescape_html('"This is a quote"') == '\\\"This is a quote\\\"'\", \"assert unescape_html('Escape & Unescape') == 'Escape & Unescape'\", \... | {
"split": "train",
"index": 61328,
"acecode_id": "bigcode_python_fns_22598",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries, where each dictionary represents a cell with a 'value' and a list of 'cand' (candidates). Your task is to implement a function `select_candidates(cells: List[Dict[str, Union[str, List[str]]]]) -> List[Dict[str, Union[str, List[str]]]]` that... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert select_candidates([{'value': 'apple', 'cand': ['apple', 'banana']}, {'value': 'orange', 'cand': ['peach', 'nectarine', 'orange']}, {'value': 'grape', 'cand': []}]) == [{'value': 'apple', 'cand': ['apple', 'banana'], 'sel_cand': 'apple'}, {'value': 'orange', ... | {
"split": "train",
"index": 61329,
"acecode_id": "bigcode_python_fns_27354",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a string 'pattern' representing a regular expression, write a function that takes this pattern as input and returns a sorted list of all strings from a predefined list of method names that match the given regular expression. The predefined list of method names is: ['getUs... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert method_matching('^get') == ['getAdmin', 'getProduct', 'getUser']\", \"assert method_matching('^create.*') == ['createAdmin', 'createUser']\", \"assert method_matching('^set') == ['setAdmin', 'setProduct', 'setUser']\", \"assert method_matching('^delete.*') =... | {
"split": "train",
"index": 61330,
"acecode_id": "bigcode_python_fns_26154",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a string, return a list of its characters where each character is followed by an empty string if it is classified as a 'wide' character. A 'wide' character is defined as a character that occupies more space than a regular ASCII character. For this problem, assume that cha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert string_to_charlist('abc') == ['a', 'b', 'c']\", \"assert string_to_charlist('hello') == ['h', 'e', 'l', 'l', 'o']\", \"assert string_to_charlist('') == []\", \"assert string_to_charlist('Hello World!') == ['H', 'e', 'l', 'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd... | {
"split": "train",
"index": 61331,
"acecode_id": "bigcode_python_fns_25893",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Write a function `parse_date(date_str: str) -> Tuple[int, int, int]` that takes a date string in the format 'YYYY-MM-DD' and returns a tuple containing the day, month, and year as integers. The input date string will always be valid and follow the specified format.\nPlease reas... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_date('2020-11-03') == (3, 11, 2020)\", \"assert parse_date('1999-12-31') == (31, 12, 1999)\", \"assert parse_date('2000-01-01') == (1, 1, 2000)\", \"assert parse_date('2021-02-28') == (28, 2, 2021)\", \"assert parse_date('2021-03-01') == (1, 3, 2021)\"... | {
"split": "train",
"index": 61332,
"acecode_id": "evol_12877",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that manages a simple graph of nodes represented by their names. Implement a function `create_graph` that takes a list of names and creates a graph where each name is a node. Each node should also have a relationship with the next node in ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_graph([]) == {}\", \"assert create_graph(['Alice']) == {'Alice': []}\", \"assert create_graph(['Alice', 'Bob']) == {'Alice': ['Bob'], 'Bob': []}\", \"assert create_graph(['Alice', 'Bob', 'Charlie']) == {'Alice': ['Bob'], 'Bob': ['Charlie'], 'Charlie':... | {
"split": "train",
"index": 61333,
"acecode_id": "evol_19214",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D list of integers representing a grid of values, where each value represents a specific score for a cell in the grid. Your task is to implement a function `find_max_scores(grid: List[List[int]]) -> List[int]` that returns a list containing the maximum score fr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max_scores([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == [3, 6, 9]\", \"assert find_max_scores([[10, 20, 30], [15, 25, 35], [5, 50, 45]]) == [30, 35, 50]\", \"assert find_max_scores([[1], [2], [3]]) == [1, 2, 3]\", \"assert find_max_scores([[0, -1, -2], [-3, -4... | {
"split": "train",
"index": 61334,
"acecode_id": "bigcode_python_fns_9214",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes in a wrapping key and a wrapped key, both represented as byte strings, and returns the unwrapped key. Before unwrapping the key, you must ensure that both the wrapping key and the wrapped key are valid based on a predefined... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unwrap_key(b'1234567890123456', b'abcdefabcdefabcd') == b'unwrapped_key_example_1'\", \"assert unwrap_key(b'validkey12345678', b'invalidkey') == None\", \"assert unwrap_key(b'1234567890123456', b'12345678') == None\", \"assert unwrap_key(b'1234567890123456',... | {
"split": "train",
"index": 61335,
"acecode_id": "bigcode_python_fns_19721",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that performs basic statistical operations on a dataset represented as a list of dictionaries. The function should be able to calculate the mean of a specified column and fill missing values in the dataset with a specified value. The func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_dataset([{'a': 1, 'b': 2}, {'a': 3, 'b': None}], 'a', 0) == (2.0, [{'a': 1, 'b': 2}, {'a': 3, 'b': None}])\", \"assert analyze_dataset([{'x': 1, 'y': None}, {'x': 2, 'y': 3}], 'y', 0) == (1.5, [{'x': 1, 'y': 0}, {'x': 2, 'y': 3}])\", \"assert analyze... | {
"split": "train",
"index": 61336,
"acecode_id": "oss_33041",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given two datasets, each containing exactly 10 integers. Write a function called `compare_datasets` that takes two lists of integers as input and returns a list of strings. Each string should indicate whether the corresponding element in the first dataset is 'greater', ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compare_datasets([5, 5, 5, 5, 5, 5, 5, 5, 5, 5], [5, 5, 5, 5, 5, 5, 5, 5, 5, 5]) == ['equal', 'equal', 'equal', 'equal', 'equal', 'equal', 'equal', 'equal', 'equal', 'equal']\", \"assert compare_datasets([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [9, 8, 7, 6, 5, 4, 3, ... | {
"split": "train",
"index": 61337,
"acecode_id": "evol_7304",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing grid data. Your task is to implement a function that returns the count of all positive values in the list. The function should ignore any negative values when calculating the count. Implement the function with the following signatur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_positive_grid_values([1, 2, 3, -1, -2]) == 3\", \"assert count_positive_grid_values([-1, -2, -3, -4]) == 0\", \"assert count_positive_grid_values([10, 20, 30, 40, 50]) == 5\", \"assert count_positive_grid_values([-1, 0, 1, 2, 3]) == 3\", \"assert count... | {
"split": "train",
"index": 61338,
"acecode_id": "oss_24565",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the reset of a virtual machine (VM) in a simplified task execution system. The function should take a VM object as input and simulate the initiation of a reset operation, while also simulating the handling of a callback... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert vm_reset({'uuid': 'vm-123', 'node': {'fast_queue': 'queue-1'}}) == 'success'\", \"assert vm_reset({'uuid': 'vm-456', 'node': {'fast_queue': 'queue-2'}}) == 'success'\", \"assert vm_reset({'uuid': 'vm-789', 'node': {'fast_queue': 'queue-3'}}) == 'success'\", ... | {
"split": "train",
"index": 61339,
"acecode_id": "oss_3451",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `validate_byte_length` that checks if the length of the list is exactly 5. The function should return True if the length is 5, and False otherwise. \\n\\n**Input**: A list of integers `bytes_list` where 1 <= len(bytes_list) <= 100. \\n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_byte_length([1, 2, 3, 4, 5]) == True\", \"assert validate_byte_length([1, 2, 3, 4]) == False\", \"assert validate_byte_length([1, 2, 3, 4, 5, 6]) == False\", \"assert validate_byte_length([]) == False\", \"assert validate_byte_length([1, 2, 3, 4, 5,... | {
"split": "train",
"index": 61340,
"acecode_id": "bigcode_python_fns_12802",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a custom list-like structure called `SetList`. The `SetList` can hold a collection of items, and it allows you to assign values to specific indices in a way that ensures all values in the collection are unique. When a value is assigned to an ind... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert setlist_setitem(['a', 'b', 'c'], 0, 'd') == ['d', 'b', 'c']\", \"assert setlist_setitem(['a', 'b', 'c'], 1, 'd') == ['a', 'd', 'c']\", \"assert setlist_setitem(['a', 'b', 'c'], 2, 'd') == ['a', 'b', 'd']\", \"assert setlist_setitem(['a', 'a', 'b'], 0, 'c') =... | {
"split": "train",
"index": 61341,
"acecode_id": "bigcode_python_fns_21608",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the sizes of different groups of items. Your task is to determine the maximum size among these groups. If the list is empty, return 0. Write a function `max_group_size(groups: List[int]) -> int` that takes a list of integers and ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_group_size([1, 2, 3]) == 3\", \"assert max_group_size([10, 20, 30, 40]) == 40\", \"assert max_group_size([-1, -2, -3]) == -1\", \"assert max_group_size([5]) == 5\", \"assert max_group_size([]) == 0\", \"assert max_group_size([0, 0, 0]) == 0\", \"assert m... | {
"split": "train",
"index": 61342,
"acecode_id": "bigcode_python_fns_18524",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a string input representing a number, which can be either an integer or a float. Your function should convert this string to a numerical format and return the number. If the input string cannot be converted to a valid number, t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_number('15') == 15\", \"assert convert_to_number('15.83') == 15.83\", \"assert convert_to_number('-4.5') == -4.5\", \"assert convert_to_number('0') == 0\", \"assert convert_to_number('1.0') == 1.0\", \"assert convert_to_number('3.14159') == 3.1415... | {
"split": "train",
"index": 61343,
"acecode_id": "bigcode_python_fns_27029",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of architectures and a list of source checks. Your task is to create a list of jobs based on the given source checks and architectures. Each job should have a name that combines the source check name and its corresponding architecture name. The job should a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_jobs(['x86', 'arm', 'all'], ['build', 'test'], False) == [{'name': 'build [x86]', 'check': 'build', 'arch': 'x86', 'externally_blocked': False}, {'name': 'build [arm]', 'check': 'build', 'arch': 'arm', 'externally_blocked': False}, {'name': 'build [al... | {
"split": "train",
"index": 61344,
"acecode_id": "bigcode_python_fns_29645",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of floating point numbers, implement a function that identifies the two numbers with the maximum difference. The function should return these two numbers in ascending order, meaning the lesser value should come first and the greater value should come second. The in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_furthest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.2]) == (1.0, 5.0)\", \"assert find_furthest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.0]) == (1.0, 5.0)\", \"assert find_furthest_elements([-1.0, -2.0, -3.0, -4.0, -5.0]) == (-5.0, -1.0)\", \"assert find_furthest... | {
"split": "train",
"index": 61345,
"acecode_id": "evol_24330",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of image modes as strings, such as '1', 'L', 'P', 'RGB', 'I', and 'F'. Your task is to create a function called `image_mode_info(image_modes: List[str]) -> List[Tuple[Optional[str], str, Tuple[int, int]]]` that returns a list of tuples, each containing info... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert image_mode_info(['1']) == [(None, '1', (128, 128))]\", \"assert image_mode_info(['L']) == [(None, 'L', (128, 128))]\", \"assert image_mode_info(['P']) == [(None, 'P', (128, 128))]\", \"assert image_mode_info(['RGB']) == [(None, 'RGB', (128, 128))]\", \"asser... | {
"split": "train",
"index": 61346,
"acecode_id": "bigcode_python_fns_36539",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string that contains XML-like data, write a function that extracts and returns the content enclosed within the <bank> tags. If the <bank> tags are not found, return None. The input string will not contain any nested <bank> tags. For example, for the input '<bank>12345</... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_letter('<bank>12345</bank>') == '12345'\", \"assert get_letter('<bank>abcde</bank>') == 'abcde'\", \"assert get_letter('<data><bank>money</bank></data>') == 'money'\", \"assert get_letter('<bank>9876543210</bank>') == '9876543210'\", \"assert get_letter(... | {
"split": "train",
"index": 61347,
"acecode_id": "bigcode_python_fns_27111",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that extracts information from a log message. The log message is in the format 'email Sent! smtp server: {smtp} port: {port}', where {smtp} is the SMTP server and {port} is the port number used for sending an email. Your function ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_log_message('email Sent! smtp server: mail.example.com port: 587') == ('mail.example.com', '587')\", \"assert parse_log_message('email Sent! smtp server: smtp.mail.com port: 465') == ('smtp.mail.com', '465')\", \"assert parse_log_message('email Sent!... | {
"split": "train",
"index": 61348,
"acecode_id": "oss_5182",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with organizing a collection of services by moving them to their respective repositories based on a predefined mapping. You are given a list of service names defined in a central location and a mapping that indicates which repository each service belongs to. Your... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert move_services(['service1', 'service2', 'service3'], {'service1': 'repo1', 'service2': 'repo2', 'service3': 'repo1'}) == {'repo1': ['service1', 'service3'], 'repo2': ['service2']}\", \"assert move_services(['serviceA', 'serviceB'], {'serviceA': 'repoX', 'serv... | {
"split": "train",
"index": 61349,
"acecode_id": "oss_27132",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given an integer id, return the corresponding dataset from Anscombe's quartet. The function should return two lists: one containing the x-values and another containing the y-values for the specified id. The valid ids are 1, 2, 3, and 4. If the id is not valid, the function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert data_anscombes_quartet(1) == ([10.0, 8.0, 13.0, 9.0, 11.0, 14.0, 6.0, 4.0, 12.0, 7.0, 5.0], [8.04, 6.95, 7.58, 8.81, 8.33, 9.96, 7.24, 4.26, 10.84, 4.82, 5.68])\", \"assert data_anscombes_quartet(2) == ([10.0, 8.0, 13.0, 9.0, 11.0, 14.0, 6.0, 4.0, 12.0, 7.0,... | {
"split": "train",
"index": 61350,
"acecode_id": "bigcode_python_fns_42907",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary where the keys are regions and the values are lists of fuzzer names that cover those regions. You also receive a list of fuzzer names. Your task is to write a function `get_unique_region_coverage(unique_region_dict: Dict[str, List[str]], fuzzer_names:... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_region_coverage({'region1': ['fuzzerA', 'fuzzerB'], 'region2': ['fuzzerA'], 'region3': ['fuzzerC']}, ['fuzzerA', 'fuzzerB', 'fuzzerC']) == {'fuzzerA': 2, 'fuzzerB': 1, 'fuzzerC': 1}\", \"assert get_unique_region_coverage({'region1': ['fuzzerX'], '... | {
"split": "train",
"index": 61351,
"acecode_id": "bigcode_python_fns_843",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that sets up a basic environment structure for a project. The function should take a boolean parameter 'make_project_ini'. If 'make_project_ini' is True, it will simulate the creation of a project initialization file. The function should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert setup_environment(True) == 'Environment set up successfully with project initialization file created.'\", \"assert setup_environment(False) == 'Environment set up successfully without creating project initialization file.'\", \"assert setup_environment(True)... | {
"split": "train",
"index": 61352,
"acecode_id": "bigcode_python_fns_1078",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of dictionaries, where each dictionary represents a record with field names as keys and corresponding data as values. Your function should return a list of dictionaries containing only the records where a specific fi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_records([{'name': 'Alice', 'age': 30}, {'name': 'Bob', 'age': 25}], 'age', lambda x: x > 28) == [{'name': 'Alice', 'age': 30}]\", \"assert filter_records([{'name': 'Alice', 'age': 30}, {'name': 'Bob', 'age': 25}], 'age', lambda x: x < 30) == [{'name':... | {
"split": "train",
"index": 61353,
"acecode_id": "oss_13776",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a photo by checking if its license is allowed and then managing its upload based on certain conditions. The function should take in a photo information dictionary and return an integer based on the upload status. If the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_photo({'photo_file_url': 'http://example.com/photo1.jpg', 'license': 'allowed'}, False) == 1\", \"assert process_photo({'photo_file_url': 'http://example.com/photo1.jpg', 'license': 'not_allowed'}, False) == 0\", \"assert process_photo({'photo_file_u... | {
"split": "train",
"index": 61354,
"acecode_id": "bigcode_python_fns_26694",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of folders represented as dictionaries, where each folder has a 'title' key. Implement a function `delete_folders(folders)` that simulates deleting the folders by printing out their titles. If the `Settings.is_delete()` function returns True, the titles of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delete_folders([{'title': 'Folder1'}, {'title': 'Folder2'}]) == ['Deleting folder: Folder1', 'Deleting folder: Folder2']\", \"assert delete_folders([{'title': 'Documents'}, {'title': 'Images'}]) == ['Deleting folder: Documents', 'Deleting folder: Images']\",... | {
"split": "train",
"index": 61355,
"acecode_id": "bigcode_python_fns_41449",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that converts a given image into a binary representation of black and white pixels based on a specified threshold. Write a function `convert_to_binary(image, threshold)` where: \n- `image` is a 2D list representing the grayscale pi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_binary([[0, 255], [128, 64]], 100) == [[0, 1], [1, 0]]\", \"assert convert_to_binary([[255, 255], [255, 0]], 200) == [[1, 1], [1, 0]]\", \"assert convert_to_binary([[100, 100], [100, 100]], 100) == [[0, 0], [0, 0]]\", \"assert convert_to_binary([[... | {
"split": "train",
"index": 61356,
"acecode_id": "oss_5041",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to retrieve the appropriate database credentials based on a configuration dictionary and a tokens dictionary. You need to implement a function `get_database_credentials(config: dict, tokens: dict) -> dict` that takes in the `config` d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_database_credentials({}, {'database_deploy_user': 'deploy_user', 'database_user': 'default_user', 'database_deploy_password': 'deploy_password', 'database_password': 'default_password'}) == {'user': 'deploy_user', 'password': 'deploy_password'}\", \"asse... | {
"split": "train",
"index": 61357,
"acecode_id": "oss_35030",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to compute the value of lambda that satisfies a specific transformation property. The transformation is defined by the equation theta* = theta + lambda, where theta is a coordinate represented by three values: L, m, and n. Your functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_lambda([1, 2, 3], [[1, 0, 0], [0, 1, 0], [0, 0, 1]]) == 0\", \"assert compute_lambda([5, 1, 2], [[1, 0, 0], [0, 1, 0], [0, 0, 1]]) == 0\", \"assert compute_lambda([10, 5, 7], [[1, 0, 0], [0, 1, 0], [0, 0, 1]]) == 0\", \"assert compute_lambda([0, 0, 0... | {
"split": "train",
"index": 61358,
"acecode_id": "oss_37592",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given an array `piles` where `piles[i]` represents the number of stones in the `i`-th pile. You are playing a game against an opponent, taking turns to pick either the first or last pile from the array. Both players play optimally, and you are the first to move. Write a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert stoneGame([5, 3, 4, 5]) == True\", \"assert stoneGame([7, 8, 8, 10]) == True\", \"assert stoneGame([7, 8, 8, 10, 5]) == True\", \"assert stoneGame([1, 5, 3, 4]) == True\", \"assert stoneGame([10, 2, 3, 8]) == True\", \"assert stoneGame([1, 2, 3, 4, 5]) == Tr... | {
"split": "train",
"index": 61359,
"acecode_id": "oss_35547",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes three arguments: a list of strings, a string, and a boolean. The function should return the frequency of the passed string in the list. If the boolean is True, the function should also return a list of indices where the string appears in the list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_frequency_and_indices(['apple', 'banana', 'apple', 'orange'], 'apple', True) == (2, [2, 0])\", \"assert get_frequency_and_indices(['cat', 'dog', 'cat', 'fish'], 'cat', False) == 2\", \"assert get_frequency_and_indices([], 'test', True) == (0, [])\", \"as... | {
"split": "train",
"index": 61360,
"acecode_id": "evol_27837",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates an error response for a specific object not found in a RESTful API. The function should take two parameters: the object's name (a string) and its lookup key (a string). The error response should include a message indica... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_error_response('User', '123') == {'data': \\\"User with ID '123' not found.\\\", 'status': 404, 'total_count': None}\", \"assert generate_error_response('Product', '456', True) == {'data': \\\"Product with ID '456' not found.\\\", 'status': 404, 'to... | {
"split": "train",
"index": 61361,
"acecode_id": "oss_15962",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that shuffles a given list of floating point numbers without modifying the original list. The function should return a new shuffled list. You can use any built-in libraries to achieve this.\nPlease reason step by step, then write a self-contained Python sol... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fixed_shuffle([3.6, 7.1, 12.9, 0.5]) != [3.6, 7.1, 12.9, 0.5]\", \"assert sorted(fixed_shuffle([1.1, 2.2, 3.3])) == [1.1, 2.2, 3.3]\", \"assert len(fixed_shuffle([0.0, 1.0, 2.0])) == 3\", \"assert fixed_shuffle([5.5]) == [5.5]\", \"assert fixed_shuffle([]) =... | {
"split": "train",
"index": 61362,
"acecode_id": "evol_33819",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function `areAllElementsUnique(lst)` that determines whether all elements in a list are distinct. The function should return True if all elements are unique, and False otherwise. Additionally, if the list contains any non-integer elements, the function should raise ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert areAllElementsUnique([1, 2, 3, 4, 5]) == True\", \"assert areAllElementsUnique([1, 2, 2, 4, 5]) == False\", \"assert areAllElementsUnique([]) == True\", \"assert areAllElementsUnique([1]) == True\", \"assert areAllElementsUnique([1, 1, 1]) == False\", \"asse... | {
"split": "train",
"index": 61363,
"acecode_id": "evol_14430",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that registers a new account based on the provided URLs and details. The function takes the following parameters: 'playstore_url', 'appstore_url', 'winstore_url', 'default_url', 'title', 'banner', and 'description'. If all provided URLs a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert register_account(None, None, None, None, 'My App', 'banner_image.png', 'This is a description.') == (False, 'Insufficient information to register.', None)\", \"assert register_account('', '', '', '', 'My App', 'banner_image.png', 'This is a description.') ==... | {
"split": "train",
"index": 61364,
"acecode_id": "bigcode_python_fns_31400",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that modifies the structure of a SQL expression based on a given SQL operation. The function should take in a SQL expression represented as a dictionary and an alias string. The SQL expression can have operations such as '=', 'AND', a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert modify_sql_expression({'sql_op': '=', 'left': {'names': ['a']}, 'right': {'names': ['b']}}, 'alias1') == {'sql_op': '=', 'left': {'names': ['alias1', 'a']}, 'right': {'names': ['b']}}\", \"assert modify_sql_expression({'sql_op': '=', 'left': {'names': []}, '... | {
"split": "train",
"index": 61365,
"acecode_id": "oss_17489",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that standardizes the list by subtracting the mean of the list from each element and then dividing the result by the standard deviation of the list. The function should return a new list containing the standardized values. The mean... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert standardize_list([5, 5, 5, 5]) == [0.0, 0.0, 0.0, 0.0]\", \"assert standardize_list([-1, 0, 1]) == [-1.224744871391589, 0.0, 1.224744871391589]\", \"assert standardize_list([10, 20, 30]) == [-1.224744871391589, 0.0, 1.224744871391589]\", \"assert standardize... | {
"split": "train",
"index": 61366,
"acecode_id": "bigcode_python_fns_30571",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function `imgbb_chatbot(user_input)` that simulates a chatbot for a Telegram bot called ImgBB. The chatbot should respond to user input with predefined messages based on specific keywords. The function should take a string `user_input` as i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert imgbb_chatbot('hello') == START_TEXT\", \"assert imgbb_chatbot('Hi there!') == START_TEXT\", \"assert imgbb_chatbot('ABOUT') == ABOUT_TEXT\", \"assert imgbb_chatbot('Tell me about you') == ABOUT_TEXT\", \"assert imgbb_chatbot('Hello World') == START_TEXT\", ... | {
"split": "train",
"index": 61367,
"acecode_id": "oss_537",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Write a Python function named `combine_dicts` that takes two dictionaries as input and combines them into a single dictionary. If both dictionaries have the same key, the function should add their values if they are numerical (integer or float) or concatenate them if they are s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert combine_dicts({'a': 1, 'b': 2}, {'b': 3, 'c': 4}) == {'a': 1, 'b': 5, 'c': 4}\", \"assert combine_dicts({'a': 'Hello', 'b': 'World'}, {'b': '!', 'c': 'Python'}) == {'a': 'Hello', 'b': 'World!', 'c': 'Python'}\", \"assert combine_dicts({'a': 1.5, 'b': 2.5}, {... | {
"split": "train",
"index": 61368,
"acecode_id": "evol_10549",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function in Python that transforms this list into a 2D array (list of lists) with 2 columns. Column 1 should contain the square roots of the original integers calculated without using any built-in libraries, and Column 2 should contain the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_list([0, 1]) == [[0.0, 0], [1.0, 1]]\", \"assert transform_list([9, 16, 25]) == [[3.0, 81], [4.0, 256], [5.0, 625]]\", \"assert transform_list([100]) == [[10.0, 10000]]\", \"assert transform_list([4, 9, 16, 25, 36]) == [[2.0, 16], [3.0, 81], [4.0, ... | {
"split": "train",
"index": 61369,
"acecode_id": "evol_35135",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of tuples, where each tuple contains a pair of integers (geneId, probeId), and returns a dictionary that maps each geneId to a list of corresponding probeIds. The output dictionary should only include geneIds that have a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert gene_id_probe_id_mapping([(1, 101), (2, 102), (1, 103), (3, 104), (2, 105)]) == {1: [101, 103], 2: [102, 105], 3: [104]}\", \"assert gene_id_probe_id_mapping([(1, 101), (1, 101), (2, 102)]) == {1: [101], 2: [102]}\", \"assert gene_id_probe_id_mapping([(5, 20... | {
"split": "train",
"index": 61370,
"acecode_id": "bigcode_python_fns_42572",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a plot's title, x-axis limits, y-axis limits, x-axis label, y-axis label, and a function that adds additional elements to the plot. Your task is to create a function that formats the plot according to these parameters and returns a string representing the filename... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_plot('Sample Plot', [0, 10], [0, 20], 'X-Axis', 'Y-Axis', lambda: None) == 'history/plot_sample_plot.png'\", \"assert format_plot('Test Plot (2023)', [0, 5], [0, 10], 'X', 'Y', lambda: None) == 'history/plot_test_plot_2023.png'\", \"assert format_plot... | {
"split": "train",
"index": 61371,
"acecode_id": "bigcode_python_fns_14216",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `add_duel(duel_id: int, challenger: str, prize: int, target: str) -> str` that manages a duel between two users in a game. The function should receive the following parameters: a unique `duel_id` (an integer), a `challenger` (a string... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_duel(1, 'Alice', 100, 'Bob') == 'DUEL_SUCCESSFUL'\", \"assert add_duel(2, 'Alice', 100, 'Alice') == 'CANNOT_DUEL_WITH_YOURSELF'\", \"assert add_duel(3, 'Charlie', 200, 'Diana') == 'DUEL_SUCCESSFUL'\", \"assert add_duel(4, 'Eve', 150, 'Frank') == 'DUEL_SU... | {
"split": "train",
"index": 61372,
"acecode_id": "oss_346",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a docstring, write a function `tokenize_docstring(text: str) -> List[str]` that tokenizes the docstring into a list of lowercase words. Your function should ignore any whitespace characters and return a list of words. Each word in the list should be ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert tokenize_docstring('Hello world. Hello LeetCode!') == ['hello', 'world', 'leetcode']\", \"assert tokenize_docstring('This is a test. This is only a test.') == ['this', 'is', 'a', 'test', 'only']\", \"assert tokenize_docstring('Tokenization is key!') == ['tok... | {
"split": "train",
"index": 61373,
"acecode_id": "bigcode_python_fns_3419",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that simulates the configuration of a server application. The function should take multiple parameters that define the server's settings, such as the model directories, server interface, and port number. The function will return a string t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert configure_server('model_dir_1', 'data_dir_1', 'qa_model_1', '127.0.0.1', 8080) == 'Server configured with kb_model_dir: model_dir_1, kb_data_dir: data_dir_1, qa_model_dir: qa_model_1, running on 127.0.0.1:8080'\", \"assert configure_server('model_dir_2', 'da... | {
"split": "train",
"index": 61374,
"acecode_id": "bigcode_python_fns_496",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two integers x and y, write a function that returns a dictionary representing a coordinate with keys 'x' and 'y', where 'x' is the first integer and 'y' is the second integer. The dictionary should be structured as follows: {'x': x_value, 'y': y_value}. You need to implem... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert make_coordinate(0, 0) == {'x': 0, 'y': 0}\", \"assert make_coordinate(1, 2) == {'x': 1, 'y': 2}\", \"assert make_coordinate(10, 20) == {'x': 10, 'y': 20}\", \"assert make_coordinate(5, 5) == {'x': 5, 'y': 5}\", \"assert make_coordinate(-1, -1) == {'x': -1, '... | {
"split": "train",
"index": 61375,
"acecode_id": "bigcode_python_fns_22564",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function `api_client_request(method: str, endpoint: str, data: Optional[dict] = None) -> Union[dict, int]` that simulates sending a request to a third-party web service API. The function should take three parameters: a string `method` which can be 'GET', 'POST', 'PUT',... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert api_client_request('GET', '/resource') == {'id': 1, 'name': 'Sample Resource'}\", \"assert api_client_request('POST', '/resource', {'name': 'New Resource'}) == 201\", \"assert api_client_request('PUT', '/resource/1', {'name': 'Updated Resource'}) == 200\", \... | {
"split": "train",
"index": 61376,
"acecode_id": "evol_24496",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple representation of a node in a doubly linked list. Your implementation should support the following functionality: A `Node` class should be created with the following methods and properties: 1. `__init__(self, data, prev=None, next=None)... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert Node(10).Next() == 'At end of the list!'\", \"assert Node(10, None, Node(20)).Next() == 20\", \"assert Node(10, None, Node(20)).Prev == 'At front of the list!'\", \"assert Node(20, Node(10), None).Prev == 10\", \"assert Node(10, None, Node(20)).Next() == 20\... | {
"split": "train",
"index": 61377,
"acecode_id": "oss_17435",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of various buildings. Your task is to implement a function that determines how many buildings can be seen from the left side of the skyline. A building can be seen if it is taller than all the previous buildings to its l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_visible_buildings([3, 1, 4, 1, 5]) == 3\", \"assert count_visible_buildings([1, 2, 3, 4]) == 4\", \"assert count_visible_buildings([4, 3, 2, 1]) == 1\", \"assert count_visible_buildings([1, 3, 2, 5, 4]) == 3\", \"assert count_visible_buildings([10, 12,... | {
"split": "train",
"index": 61378,
"acecode_id": "bigcode_python_fns_3119",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of animal types represented as strings, where each string can either be 'dog' or 'cat'. Your task is to implement a function that counts the total number of 'dog' and 'cat' entries in the list and returns a dictionary with the counts. The dictionary should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_animals(['dog', 'cat', 'dog']) == {'dog': 2, 'cat': 1}\", \"assert count_animals(['cat', 'cat', 'cat']) == {'dog': 0, 'cat': 3}\", \"assert count_animals(['dog', 'dog', 'dog', 'dog']) == {'dog': 4, 'cat': 0}\", \"assert count_animals([]) == {'dog': 0, ... | {
"split": "train",
"index": 61379,
"acecode_id": "bigcode_python_fns_36253",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing an autocorrect function that replaces certain words or phrases with a predefined replacement. The function should take a string as input and replace specific words or phrases with the designated replacements. Your task is to write a Python funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert autocorrect('u') == 'your sister'\", \"assert autocorrect('you') == 'your sister'\", \"assert autocorrect('You') == 'your sister'\", \"assert autocorrect('YOU') == 'your sister'\", \"assert autocorrect('u and you') == 'your sister and your sister'\", \"asser... | {
"split": "train",
"index": 61380,
"acecode_id": "oss_37311",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `relu_backward(dout: List[float], x: List[float]) -> List[float]` that calculates the gradient of the input with respect to the ReLU activation function during the backward pass. The function should take two arguments: `dout`, a list of floats representing ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert relu_backward([1.0, 2.0, 3.0], [1.0, -1.0, 2.0]) == [1.0, 0.0, 3.0]\", \"assert relu_backward([1.0, 1.0, 1.0], [2.0, 3.0, -1.0]) == [1.0, 1.0, 0.0]\", \"assert relu_backward([-1.0, -2.0, -3.0], [1.0, 2.0, 3.0]) == [-1.0, -2.0, -3.0]\", \"assert relu_backward... | {
"split": "train",
"index": 61381,
"acecode_id": "bigcode_python_fns_47585",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing a collection of objects, where each object is identified by a unique 'about' tag. Each object contains various attributes. Your task is to implement a function `get_object_info(objects: Dict[str, Dict[str, Any]], about: str) -> Dict[str, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_object_info({'object1': {'color': 'red', 'size': 'large'}, 'object2': {'color': 'blue', 'size': 'medium'}}, 'object1') == {'color': 'red', 'size': 'large'}\", \"assert get_object_info({'object1': {'color': 'red', 'size': 'large'}, 'object2': {'color': 'b... | {
"split": "train",
"index": 61382,
"acecode_id": "bigcode_python_fns_29004",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates the content of an email message. The function should take in two parameters: a string representing the email body and a string representing the expected site name. The function should return True if the expected site name i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_email_content('Welcome to Test Site! We are glad to have you.', 'Test Site') == True\", \"assert validate_email_content('Hello, this is a test email.', 'Test Site') == False\", \"assert validate_email_content('Your account on Test Site has been crea... | {
"split": "train",
"index": 61383,
"acecode_id": "oss_15510",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given the coordinates of two orthogonal rectangles on a Cartesian plane, compute the total area encompassed by both rectangles and the area of their intersection. The first rectangle is defined by its lower-left vertex (A, B) and its upper-right vertex (C, D). The second rectan... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_areas(-3, 0, 3, 4, 0, -1, 9, 2) == (45, 6)\", \"assert compute_areas(-2, -2, 2, 2, -2, -2, 2, 2) == (16, 16)\", \"assert compute_areas(0, 0, 1, 1, 1, 1, 2, 2) == (2, 0)\", \"assert compute_areas(1, 1, 4, 4, 2, 2, 3, 3) == (9, 1)\", \"assert compute_a... | {
"split": "train",
"index": 61384,
"acecode_id": "evol_13050",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a string that represents a command in the format '<x>', where x is a single digit (0-9), write a function that extracts and returns the integer value of x. If the string does not conform to this format, or if x is not a single digit, return -1. The function should handle ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_command('<1>') == 1\", \"assert extract_command('<9>') == 9\", \"assert extract_command('<0>') == 0\", \"assert extract_command('<5>') == 5\", \"assert extract_command('<10>') == -1\", \"assert extract_command('5>') == -1\", \"assert extract_command(... | {
"split": "train",
"index": 61385,
"acecode_id": "bigcode_python_fns_31995",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of dictionaries as input and returns a list of integers, where each integer represents the number of key-value pairs in the corresponding dictionary from the input list.\nPlease reason step by step, then write a self-contained Python solut... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_counts([{'a': 1, 'b': 2}, {'c': 3}]) == [2, 1]\", \"assert get_counts([{}, {'x': 10, 'y': 20, 'z': 30}, {'p': 'hello'}]) == [0, 3, 1]\", \"assert get_counts([{'name': 'Alice'}, {'age': 30}, {'city': 'New York', 'country': 'USA'}]) == [1, 1, 2]\", \"asser... | {
"split": "train",
"index": 61386,
"acecode_id": "evol_35821",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a function that accepts a one-dimensional dictionary as input and returns a list of all the keys whose values are of type integer. Additionally, the function should also check for any integer values within nested dictionaries and include their respective keys. The neste... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_integer_keys({'a': 1, 'b': 2, 'c': {'d': 3}}) == ['a', 'b', 'c.d']\", \"assert find_integer_keys({'x': 'hello', 'y': 5, 'z': {'w': 10, 'v': 'world'}}) == ['y', 'z.w']\", \"assert find_integer_keys({'foo': {'bar': {'baz': 1}, 'qux': 2}, 'quux': 3}) == ['... | {
"split": "train",
"index": 61387,
"acecode_id": "evol_12839",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that removes all special characters from a given string and returns the cleaned string. Special characters are any characters that are not letters, digits, or spaces. For example, given the input 'Hello@ World#!', the function should return 'Hello World'.\nPlea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_special_characters('C# Programming') == 'C Programming'\", \"assert remove_special_characters('') == ''\", \"assert remove_special_characters('A1B2C3') == 'A1B2C3'\", \"assert remove_special_characters('Special char: $&*()') == 'Special char '\", \"as... | {
"split": "train",
"index": 61388,
"acecode_id": "evol_35500",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with identifying duplicate bug reports from a given list of strings. Each string contains a bug report ID followed by the IDs of its duplicate bug reports, separated by spaces. Your goal is to implement a function that processes this list and returns a list of tu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_duplicates(['1234 5678 91011', '5678 1234']) == [('1234', '5678'), ('1234', '91011'), ('5678', '1234')]\", \"assert find_duplicates(['a b c', 'b a', 'c d']) == [('a', 'b'), ('a', 'c'), ('b', 'a'), ('c', 'd')]\", \"assert find_duplicates(['1 2 3', '2 1 4... | {
"split": "train",
"index": 61389,
"acecode_id": "oss_13222",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of buildings in a city. Your task is to write a function that determines the maximum height of the buildings that can be seen from the left side when looking at the skyline. A building can be seen from the left side if i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_visible_height([3, 7, 8, 3, 6, 1]) == 8\", \"assert max_visible_height([1, 2, 3, 4, 5]) == 5\", \"assert max_visible_height([5, 4, 3, 2, 1]) == 5\", \"assert max_visible_height([1, 3, 2, 4, 1]) == 4\", \"assert max_visible_height([10]) == 10\", \"assert ... | {
"split": "train",
"index": 61390,
"acecode_id": "oss_13647",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of genetic variants in sheep, where each variant is represented as a dictionary containing the 'name', 'chrom', and 'position' of the variant. Your task is to implement a function `get_variant_locations(variants: List[Dict[str, Union[str, int]]]) -> List[Di... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_variant_locations([]) == []\", \"assert get_variant_locations([{'name': 'variant1', 'chrom': 'chr1', 'position': 100}]) == [{'name': 'variant1', 'chrom': 'chr1', 'position': 100}]\", \"assert get_variant_locations([{'name': 'variant2', 'chrom': 'chr2', '... | {
"split": "train",
"index": 61391,
"acecode_id": "oss_23082",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks whether a user is considered active based on a given user object. The user object has two attributes: `is_active` and `is_blocked`. The function should return `True` if the user is active and not blocked, and `False` other... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_user_active({'is_active': True, 'is_blocked': False}) == True\", \"assert is_user_active({'is_active': False, 'is_blocked': False}) == False\", \"assert is_user_active({'is_active': True, 'is_blocked': True}) == False\", \"assert is_user_active(None) == F... | {
"split": "train",
"index": 61392,
"acecode_id": "oss_14991",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of alias pairs for import statements, write a function `construct_import_statement` that constructs a valid Python import statement as a string. The input is a list of strings or lists, where each element represents an alias. If the element is a single string, it s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert construct_import_statement(['math', 'sys']) == 'import math, sys'\", \"assert construct_import_statement(['math', ['sys', 'system']]) == 'import math, sys as system'\", \"assert construct_import_statement([['os', 'operating_system'], ['json', 'json_parser']]... | {
"split": "train",
"index": 61393,
"acecode_id": "bigcode_python_fns_49460",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `validate_url(url: str) -> bool` that checks if the given URL is valid according to standard URL formatting rules. The URL should start with 'http://' or 'https://', followed by a domain name which may include subdomains and must end with a valid top-level ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_url('https://www.example.com') == True\", \"assert validate_url('http://example.com') == True\", \"assert validate_url('https://subdomain.example.com') == True\", \"assert validate_url('ftp://example.com') == False\", \"assert validate_url('https://... | {
"split": "train",
"index": 61394,
"acecode_id": "evol_35432",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a Bag of Words model from scratch without using any external libraries. Your implementation should include a function `fit(text_data)` that takes a list of strings as input, which represents multiple documents. This function should create a bag of words model and comp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bog.word_counts == {'hello': 3, 'world': 2, 'test': 1}\", \"assert bog.word_counts['test'] == 1\", \"assert 'nonexistent' not in bog.idf\", \"assert len(bog.idf) == 3\", \"assert all(isinstance(k, str) for k in bog.idf.keys())\", \"assert all(isinstance(v, f... | {
"split": "train",
"index": 61395,
"acecode_id": "evol_2892",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing daily stock prices. Write a function that calculates the maximum profit you could achieve from buying and selling a single stock. You must buy before you sell, and you can only complete one transaction (i.e., buy one and sell one sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_profit([7, 1, 5, 3, 6, 4]) == 5\", \"assert max_profit([7, 6, 4, 3, 1]) == 0\", \"assert max_profit([1, 2, 3, 4, 5]) == 4\", \"assert max_profit([5, 4, 3, 2, 1]) == 0\", \"assert max_profit([2, 1, 2, 1, 0, 1, 2]) == 2\", \"assert max_profit([1]) == 0\", ... | {
"split": "train",
"index": 61396,
"acecode_id": "bigcode_python_fns_14237",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function called `combine_texts` that takes a list of strings as input and returns a single string that combines all the strings in the list, separated by a space. If the input list is empty, the function should return an empty string. Implement the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert combine_texts(['Hello', 'world']) == 'Hello world'\", \"assert combine_texts(['Python', 'is', 'fun']) == 'Python is fun'\", \"assert combine_texts(['LeetCode', 'is', 'a', 'platform']) == 'LeetCode is a platform'\", \"assert combine_texts(['Multiple', 'spaces... | {
"split": "train",
"index": 61397,
"acecode_id": "oss_31064",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simplified version of a URL routing system in Python. The system should allow for the addition of URL patterns to a list of existing patterns. Each URL pattern is represented as a string and can include placeholders for variable parts of the U... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_url_pattern(['/home/'], '/about/') == ['/home/', '/about/']\", \"assert add_url_pattern([], '/home/') == ['/home/']\", \"assert add_url_pattern(['/home/'], '/products/') == ['/home/', '/products/']\", \"assert add_url_pattern(['/home/', '/products/'], '/... | {
"split": "train",
"index": 61398,
"acecode_id": "oss_36365",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of file names and need to modify each file name according to the following rules: append the suffix '_backup' to each file name in the list. Your task is to implement a function `append_backup_suffix` that takes a list of file names as input and returns a n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert append_backup_suffix([\\\"file1.txt\\\", \\\"file2.txt\\\", \\\"file3.txt\\\"]) == [\\\"file1.txt_backup\\\", \\\"file2.txt_backup\\\", \\\"file3.txt_backup\\\"]\", \"assert append_backup_suffix([\\\"report.pdf\\\", \\\"summary.doc\\\"]) == [\\\"report.pdf_b... | {
"split": "train",
"index": 61399,
"acecode_id": "oss_14931",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.