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 implementing a Python function that represents a beacon block for a blockchain system. A beacon block consists of a beacon block body, and your goal is to create a function that takes a string representation of the beacon block body and returns a formatted s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_beacon_block('Default Body') == '<BeaconBlock: Default Body>'\", \"assert format_beacon_block('Custom Body with Data') == '<BeaconBlock: Custom Body with Data>'\", \"assert format_beacon_block('Another Test Body') == '<BeaconBlock: Another Test Body>'... | {
"split": "train",
"index": 72100,
"acecode_id": "oss_8587",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that filters log entries based on their kind. Each log entry is represented by a timestamp, a format string, and a kind. Your function should take in a list of log entries and a list of filter kinds, and return a list of log entries t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_log_entries([], [LogKind.INFO]) == []\", \"assert filter_log_entries([LogEntry(1.0, 'Test entry', LogKind.INFO)], [LogKind.INFO]) == [LogEntry(1.0, 'Test entry', LogKind.INFO)]\", \"assert filter_log_entries([LogEntry(1.0, 'Test entry', LogKind.INFO)]... | {
"split": "train",
"index": 72101,
"acecode_id": "oss_15478",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing match scores, write a function `calculate_total_score(scores: List[int]) -> int` that returns the total score of all matches. The total score is calculated by summing all the integers in the list. If the input list is empty, return 0.\nPlea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_score([]) == 0\", \"assert calculate_total_score([1]) == 1\", \"assert calculate_total_score([1, 2, 3]) == 6\", \"assert calculate_total_score([-1, -2, -3]) == -6\", \"assert calculate_total_score([0, 0, 0]) == 0\", \"assert calculate_total_s... | {
"split": "train",
"index": 72102,
"acecode_id": "bigcode_python_fns_39231",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a selection of teams based on a given lottery information dictionary. The function should take two inputs: a list of team names selected by a user and a dictionary of lottery information containing team names and their corr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_selected_teams(['Team A', 'Team B'], {0: {'name': 'Team B'}, 1: {'name': 'Team A'}, 2: {'name': 'Team C'}}) == [1, 0]\", \"assert get_selected_teams(['Team D'], {0: {'name': 'Team A'}, 1: {'name': 'Team B'}}) == []\", \"assert get_selected_teams(['Team A... | {
"split": "train",
"index": 72103,
"acecode_id": "bigcode_python_fns_42655",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a function signature, which contains the function name followed by its parameters and their types. Your task is to write a function `extract_arguments(signature: str) -> List[str]` that extracts and returns a list of argument names while igno... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_arguments('my_function(arg1: int, arg2: str, socket_filename: str) -> None') == ['arg1', 'arg2']\", \"assert extract_arguments('calculate_sum(num1: float, num2: float) -> float') == ['num1', 'num2']\", \"assert extract_arguments('process_data(data: L... | {
"split": "train",
"index": 72104,
"acecode_id": "bigcode_python_fns_21803",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function named `calculate_distance_between_points` that takes two points in a 2D space represented as tuples of integers (x1, y1) and (x2, y2). The function should return the Euclidean distance between these two points. The distance can be calculat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_distance_between_points((0, 0), (3, 4)) == 5.0\", \"assert calculate_distance_between_points((1, 1), (4, 5)) == 5.0\", \"assert calculate_distance_between_points((0, 0), (0, 0)) == 0.0\", \"assert calculate_distance_between_points((-1, -1), (1, 1))... | {
"split": "train",
"index": 72105,
"acecode_id": "oss_9146",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `animal_sound(animal_type: str, name: str, age: int, extra: str) -> str` that simulates the sounds made by different types of animals based on their type. The function should take four parameters: `animal_type` which can be 'dog', 'ca... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert animal_sound('dog', 'Buddy', 3, 'Golden Retriever') == 'Buddy says Woof!'\", \"assert animal_sound('cat', 'Whiskers', 5, 'Gray') == 'Whiskers says Meow!'\", \"assert animal_sound('bird', 'Polly', 2, 'Parrot') == 'Polly says Chirp!'\", \"assert animal_sound('... | {
"split": "train",
"index": 72106,
"acecode_id": "oss_31035",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with evaluating the accuracy of a set of predictions against actual results. Write a function called `calculate_prediction_accuracy` that takes two lists of integers: `predicted_values` and `actual_values`. The function should calculate the accuracy of the predic... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_prediction_accuracy([1, 2, 3], [1, 2, 3]) == 100.0\", \"assert calculate_prediction_accuracy([1, 2, 3], [3, 2, 1]) == 33.33\", \"assert calculate_prediction_accuracy([0, 0, 0], [0, 0, 0]) == 100.0\", \"assert calculate_prediction_accuracy([1, 2, 3]... | {
"split": "train",
"index": 72107,
"acecode_id": "oss_35470",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `is_within_prime_range(num: int) -> bool` that checks whether a given integer `num` is within the range of prime numbers between 5 and 10 (inclusive). The function should return `True` if `num` is a prime number and lies within the range, and `False` otherwise.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_within_prime_range(5) == True\", \"assert is_within_prime_range(6) == False\", \"assert is_within_prime_range(7) == True\", \"assert is_within_prime_range(8) == False\", \"assert is_within_prime_range(9) == False\", \"assert is_within_prime_range(4) == Fa... | {
"split": "train",
"index": 72108,
"acecode_id": "evol_12081",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `categorize_data(data: str) -> Tuple[List[str], List[str]]` that takes a string `data` and categorizes its characters into two lists: one containing all the vowels and the other containing all the consonants. The function should consider only the lowercase ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert categorize_data('hello') == (['e', 'o'], ['h', 'l', 'l'])\", \"assert categorize_data('abcde') == (['a', 'e'], ['b', 'c', 'd'])\", \"assert categorize_data('xyz') == ([], ['x', 'y', 'z'])\", \"assert categorize_data('') == ([], [])\", \"assert categorize_dat... | {
"split": "train",
"index": 72109,
"acecode_id": "evol_19838",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the end byte positions of segments in a revision log, along with a list of indices representing specific revisions. Your task is to implement a function that calculates the total byte span of the segments defined by the provided rev... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert segment_span([5, 10, 12, 12, 17], [0, 1, 2, 3, 4]) == 17\", \"assert segment_span([5, 10, 12, 12, 17], [0, 4]) == 17\", \"assert segment_span([5, 10, 12, 12, 17], [3, 4]) == 5\", \"assert segment_span([5, 10, 12, 12, 17], [1, 2, 3]) == 7\", \"assert segment_... | {
"split": "train",
"index": 72110,
"acecode_id": "bigcode_python_fns_38208",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a list of purchase records represented as dictionaries, where each record contains the keys 'acc_id' (the account ID of the user), 'date' (the date of the purchase), and 'item' (the purchased item), implement a function `get_purchase_history(acc_id: int, purchases: List[D... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_purchase_history(1, [{'acc_id': 1, 'date': '2023-01-01', 'item': 'Book'}, {'acc_id': 1, 'date': '2023-01-02', 'item': 'Pen'}, {'acc_id': 2, 'date': '2023-01-01', 'item': 'Notebook'}]) == [{'date': '2023-01-02', 'item': 'Pen'}, {'date': '2023-01-01', 'ite... | {
"split": "train",
"index": 72111,
"acecode_id": "bigcode_python_fns_15876",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates comments based on the differences between a set of provided arguments and their default values. Your function should accept three parameters: `input_file` (a string representing the input file name), `output_file` (a string... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_comments('input.txt', 'output.txt', False) == []\", \"assert generate_comments('input.txt', 'output.txt', True) == ['[default: False]']\", \"assert generate_comments('custom_input.txt', 'output.txt', False) == ['[default: input.txt]']\", \"assert ge... | {
"split": "train",
"index": 72112,
"acecode_id": "oss_1487",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of game statistics represented as a list of dictionaries. Each dictionary contains the following keys: 'game_length' (an integer), 'score_red' (a float), 'score_green' (a float), and 'score_blue' (a float). Your task is to implement a function `calculate_av... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_scores([]) == {'red': 0.0, 'green': 0.0, 'blue': 0.0}\", \"assert calculate_average_scores([{'game_length': 10, 'score_red': 10.0, 'score_green': 5.0, 'score_blue': 7.5}, {'game_length': 15, 'score_red': 20.0, 'score_green': 25.0, 'score_bl... | {
"split": "train",
"index": 72113,
"acecode_id": "bigcode_python_fns_31113",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a stock of raw materials in a manufacturing plant. Each raw material has an ID, a name, a quantity, and a unit price. Your goal is to implement a function that takes a list of raw materials and returns the total value of the stock. The total value i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_stock_value([{'id': 1, 'name': 'Wood', 'quantity': 10, 'unit_price': 5.0}, {'id': 2, 'name': 'Steel', 'quantity': 20, 'unit_price': 10.0}]) == 250.0\", \"assert calculate_total_stock_value([{'id': 1, 'name': 'Plastic', 'quantity': 15, 'unit_p... | {
"split": "train",
"index": 72114,
"acecode_id": "oss_16909",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You have a string consisting of characters representing movements in a grid. The characters are as follows: '^' for up, 'v' for down, '>' for right, and '<' for left. Each movement is one unit in the respective direction. Your task is to write a function `number_of_houses_cover... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert number_of_houses_covered('^>v<') == 4\", \"assert number_of_houses_covered('>>>>>') == 6\", \"assert number_of_houses_covered('^v^v^v^v') == 2\", \"assert number_of_houses_covered('') == 1\", \"assert number_of_houses_covered('>v<^') == 4\", \"assert number_... | {
"split": "train",
"index": 72115,
"acecode_id": "bigcode_python_fns_4247",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function `read_mesh_data(file_name: str) -> str` that simulates reading a PLY mesh file by returning a string indicating the status of the file read operation. If the file name is valid, return 'Mesh data read successfully'. If the file name is invalid (for example,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert read_mesh_data('valid_mesh_name') == 'Mesh data read successfully'\", \"assert read_mesh_data('mesh-01.ply') == 'Invalid file name'\", \"assert read_mesh_data('') == 'Invalid file name'\", \"assert read_mesh_data('mesh@01.ply') == 'Invalid file name'\", \"as... | {
"split": "train",
"index": 72116,
"acecode_id": "bigcode_python_fns_32604",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing a collection of numbers and a target integer. Your task is to implement a function that checks if there are two distinct integers in the list that add up to the target integer. The function should return True if such a pair exists, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_find_pair([1, 2, 3, 4, 5], 9) == True\", \"assert can_find_pair([1, 2, 3, 4, 5], 10) == False\", \"assert can_find_pair([-1, 0, 1, 2], 1) == True\", \"assert can_find_pair([1, 5, 3, 2], 4) == True\", \"assert can_find_pair([1, 1, 2, 3], 4) == True\", \"a... | {
"split": "train",
"index": 72117,
"acecode_id": "bigcode_python_fns_9562",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string, implement a function `vowel_positions(phrase)` that returns a dictionary containing the positions of each vowel (a, e, i, o, u) in the string. Each vowel should be a key in the dictionary, and the corresponding value should be a list of indices where that vowel ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert vowel_positions('Hello World!') == {'e': [1], 'o': [4, 7]}\", \"assert vowel_positions('') == {}\", \"assert vowel_positions('aaa') == {'a': [0, 1, 2]}\", \"assert vowel_positions('AEIOU') == {'a': [0], 'e': [1], 'i': [2], 'o': [3], 'u': [4]}\", \"assert vow... | {
"split": "train",
"index": 72118,
"acecode_id": "evol_22718",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `bank_account_operations` that simulates a simple bank account. The function takes an initial balance, a list of operations, and an interest rate as input. The operations will be a list of tuples, where each tuple can be one of the follow... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bank_account_operations(1000, [('deposit', 200), ('withdraw', 100)], 0) == 1100\", \"assert bank_account_operations(100, [('deposit', 50), ('withdraw', 100)], 0) == 50\", \"assert bank_account_operations(0, [('deposit', 100), ('withdraw', 50)], 0) == 50\", \... | {
"split": "train",
"index": 72119,
"acecode_id": "oss_25912",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing a pull request event. Your task is to implement a function validate_pull_request(data) that checks if the required fields are present in the input dictionary. The function should return True if the dictionary contains the key 'action' and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_pull_request({'action': 'opened', 'pull_request': {'html_url': 'http://example.com'}}) == True\", \"assert validate_pull_request({'action': 'closed', 'pull_request': {'html_url': 'http://example.com'}}) == True\", \"assert validate_pull_request({'ac... | {
"split": "train",
"index": 72120,
"acecode_id": "bigcode_python_fns_16413",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that takes a list of tuples representing travel expenses and filters them based on a specified threshold value. Each tuple contains two elements: a 'WH' value (a numeric value representing the expense) and a 'TH' value (a string re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_expenses([(1, 'food'), (3, 'transport'), (5, 'accommodation')], 10) == ({}, {})\", \"assert filter_expenses([], 5) == ({}, {})\", \"assert filter_expenses([(7, 'food'), (8, 'transport')], 7) == ({7: 'food', 8: 'transport'}, {'food': 7, 'transport': 8}... | {
"split": "train",
"index": 72121,
"acecode_id": "oss_31224",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of buildings in a skyline. Your task is to write a function that determines the maximum height of the skyline, which is defined as the maximum value in the list. If the list is empty, return 0. Implement a function calle... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_skyline_height([3, 1, 4, 1, 5, 9, 2, 6]) == 9\", \"assert max_skyline_height([1, 2, 3, 4, 5]) == 5\", \"assert max_skyline_height([5, 5, 5, 5, 5]) == 5\", \"assert max_skyline_height([10]) == 10\", \"assert max_skyline_height([]) == 0\", \"assert max_sky... | {
"split": "train",
"index": 72122,
"acecode_id": "bigcode_python_fns_6997",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_card(suite: str, rank: str, value: int) -> dict` that takes a suite (string), rank (string), and value (integer) of a card and returns a dictionary representation of the card with keys 'suite', 'rank', and 'value'.\nPlease reason step by step, then ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_card('Hearts', 'Ace', 14) == {'suite': 'Hearts', 'rank': 'Ace', 'value': 14}\", \"assert create_card('Diamonds', '10', 10) == {'suite': 'Diamonds', 'rank': '10', 'value': 10}\", \"assert create_card('Clubs', '3', 3) == {'suite': 'Clubs', 'rank': '3', ... | {
"split": "train",
"index": 72123,
"acecode_id": "evol_20536",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a prefix sum mapping from a series of key-value pairs. You need to create a function `prefix_map_sum(operations: List[Tuple[str, Union[str, int]]]) -> List[int]` that takes a list of operations. Each operation is either... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert prefix_map_sum([('insert', 'apple', 3), ('sum', 'ap')]) == [3]\", \"assert prefix_map_sum([('insert', 'apple', 3), ('insert', 'app', 2), ('sum', 'ap')]) == [5]\", \"assert prefix_map_sum([('insert', 'banana', 4), ('insert', 'bandana', 3), ('sum', 'ban')]) ==... | {
"split": "train",
"index": 72124,
"acecode_id": "oss_27750",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that parses a given policy rule identifier and extracts the required permissions from it. The policy rules are defined using the following format: `RULE_<PERMISSION_NAME>`, where `<PERMISSION_NAME>` is a string that can contain mul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_permissions('RULE_AOO') == ['AOO']\", \"assert extract_permissions('RULE_ADMIN_OWNER') == ['ADMIN', 'OWNER']\", \"assert extract_permissions('RULE_USER_READ') == ['USER', 'READ']\", \"assert extract_permissions('RULE_MANAGER_WRITE_EXECUTE') == ['MANA... | {
"split": "train",
"index": 72125,
"acecode_id": "oss_10945",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes in a list of words and a target language and returns a new list containing the translations of each word. The function should simulate the translation by appending the target language code at the end of each word. For example, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert translate_words(['hello', 'world'], 'es') == ['hello_es', 'world_es']\", \"assert translate_words(['goodbye'], 'fr') == ['goodbye_fr']\", \"assert translate_words(['apple', 'banana', 'cherry'], 'de') == ['apple_de', 'banana_de', 'cherry_de']\", \"assert tran... | {
"split": "train",
"index": 72126,
"acecode_id": "bigcode_python_fns_21627",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the intrinsic parameters of a camera. Your task is to implement a function that returns the maximum intrinsic parameter from the list. If the list is empty, return -1. Write a function `get_max_intrinsic_parameter(params: List[int])... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_max_intrinsic_parameter([1, 2, 3, 4, 5]) == 5\", \"assert get_max_intrinsic_parameter([-1, -2, -3, -4, -5]) == -1\", \"assert get_max_intrinsic_parameter([10, 20, 30, 40]) == 40\", \"assert get_max_intrinsic_parameter([]) == -1\", \"assert get_max_intrin... | {
"split": "train",
"index": 72127,
"acecode_id": "bigcode_python_fns_41891",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a configuration dictionary based on given parameters. The function should take two arguments: `context` and `base`. If `context` is `None`, the function should use a default context represented by the string 'default_contex... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert make_options(None, None) == {'expandContext': 'default_context'}\", \"assert make_options('custom_context', None) == {'expandContext': 'custom_context'}\", \"assert make_options(None, 'http://example.com') == {'expandContext': 'default_context', 'base': 'htt... | {
"split": "train",
"index": 72128,
"acecode_id": "bigcode_python_fns_13935",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are required to write a function that verifies if a given string is a valid URL. A valid URL should start with 'http://' or 'https://', followed by a valid domain name. Your function should return True if the input is a valid URL and False otherwise. Implement a function ca... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_url('https://www.example.com') == True\", \"assert is_valid_url('http://example.com') == True\", \"assert is_valid_url('ftp://example.com') == False\", \"assert is_valid_url('www.example.com') == False\", \"assert is_valid_url('https://example') == ... | {
"split": "train",
"index": 72129,
"acecode_id": "oss_12567",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Write a function `least_common_characters(s: str) -> List[str]` that takes a string `s` containing alphanumeric characters. The function should identify and return a list of the least common alphanumeric characters in the string, maintaining the original order of their first ap... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert least_common_characters('') == []\", \"assert least_common_characters('abc') == ['a', 'b', 'c']\", \"assert least_common_characters('aaabbc') == ['c']\", \"assert least_common_characters('aabbccddeeffg') == ['g']\", \"assert least_common_characters('zzxxyy')... | {
"split": "train",
"index": 72130,
"acecode_id": "evol_23941",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_distinct_matrix(n: int, m: int) -> List[List[int]]` that generates a 2D matrix of size n x m filled with distinct integers. The integers should be populated sequentially starting from 0 in a row-wise manner. The function should ensure that there are... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_distinct_matrix(1, 1) == [[0]]\", \"assert create_distinct_matrix(1, 2) == [[0, 1]]\", \"assert create_distinct_matrix(2, 2) == [[0, 1], [2, 3]]\", \"assert create_distinct_matrix(3, 2) == [[0, 1], [2, 3], [4, 5]]\", \"assert create_distinct_matrix(2,... | {
"split": "train",
"index": 72131,
"acecode_id": "evol_8316",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to validate transactions within a blockchain system. Each transaction contains a payload and a script hash. The maximum allowable size for a transaction's payload is defined by the constant `MAX_TRANSACTION_SIZE_IN_BYTES`, and the scr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validateTransaction({'data': 'x' * 4096, 'script_hash': 'aabbccddeeff11223344556677889900'}) == True\", \"assert validateTransaction({'data': 'x' * 4095, 'script_hash': 'aabbccddeeff11223344556677889900'}) == True\", \"assert validateTransaction({'data': 'x'... | {
"split": "train",
"index": 72132,
"acecode_id": "oss_1125",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a sorted array of non-negative integers that may contain duplicates, implement a function `find_missing_numbers(arr)` that returns a list of all missing non-negative integers in the range from 0 to the maximum number present in the array. The output should not include any... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_missing_numbers([0, 1, 2, 3, 5, 6, 6, 8, 9]) == [4, 7]\", \"assert find_missing_numbers([1, 2, 2, 3, 4]) == [0]\", \"assert find_missing_numbers([0, 1, 1, 1, 1]) == []\", \"assert find_missing_numbers([2, 3, 4, 5, 6]) == [0, 1]\", \"assert find_missing_... | {
"split": "train",
"index": 72133,
"acecode_id": "evol_5336",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function to find the median in an array of floating point numbers. The median is the middle value in a sorted list of numbers. If the list has an even number of elements, the median is the average of the two middle numbers. Implement a function named `find_median` that ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_median([1.0, 2.0, 3.0]) == 2.0\", \"assert find_median([1.5, 2.5, 3.5, 4.5]) == 3.0\", \"assert find_median([10.0, 20.0, 30.0, 40.0, 50.0]) == 30.0\", \"assert find_median([7.0, 8.0, 9.0]) == 8.0\", \"assert find_median([5.5, 6.2, 7.1, 7.9]) == 6.65\", ... | {
"split": "train",
"index": 72134,
"acecode_id": "evol_28245",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `sum_of_evens(nums: List[int]) -> int` that returns the sum of all even integers in the list. If there are no even integers, return 0. The function should handle both positive and negative integers. \n\n### Example:\n1. Input: `nums = ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([1, 3, 5]) == 0\", \"assert sum_of_evens([-2, -4, 1, 3]) == -6\", \"assert sum_of_evens([]) == 0\", \"assert sum_of_evens([0, 1, 2, 3]) == 2\", \"assert sum_of_evens([-2, -3, -4, -5]) == -6\", \"ass... | {
"split": "train",
"index": 72135,
"acecode_id": "bigcode_python_fns_14781",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a timestamp represented as a string in the format 'YYYY-MM-DD HH:MM' and a frequency string '15T' (quarter-hour), 'H' (hour), 'D' (day), 'MS' (month), 'QS' (quarter), or 'AS' (year), implement a function that returns the floored timestamp to the nearest period boundary ba... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert floor_ts('2020-04-21 15:42', 'AS', 0) == '2020-01-01 00:00'\", \"assert floor_ts('2020-04-21 15:42', 'MS', 0) == '2020-04-01 00:00'\", \"assert floor_ts('2020-04-21 15:42', 'H', 0) == '2020-04-21 15:00'\", \"assert floor_ts('2020-04-21 15:42', 'D', 0) == '20... | {
"split": "train",
"index": 72136,
"acecode_id": "bigcode_python_fns_21177",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `calculate_total_income_by_category` that computes the total income amount for a specific category based on a list of income transactions. Each income transaction is represented by an `Income` object, which has an `amount`, a `categor... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_income_by_category([], IncomeCategory('Salary')) == 0\", \"assert calculate_total_income_by_category([Income(1000, IncomeCategory('Salary'), IncomeTag('Tag1'))], IncomeCategory('Salary')) == 1000\", \"assert calculate_total_income_by_category... | {
"split": "train",
"index": 72137,
"acecode_id": "oss_6398",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a given string representing an app name and returns a modified version of the app name. The modification involves converting the app name to lowercase, removing any underscores, and capitalizing the first letter of e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_app_name('user_feedback') == 'UserFeedback'\", \"assert process_app_name('data_visualization_app') == 'DataVisualizationApp'\", \"assert process_app_name('_invalid_app_') == 'InvalidApp'\", \"assert process_app_name('') == 'Invalid App Name'\", \"ass... | {
"split": "train",
"index": 72138,
"acecode_id": "oss_29101",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `generate_right_values(value_strategy: List[int]) -> List[Tuple[str, int]]` that takes in a list of integers and returns a list of tuples. Each tuple should contain the string 'Right' and the corresponding integer from the input list. The output list should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_right_values([0]) == [('Right', 0)]\", \"assert generate_right_values([1, 2, 3]) == [('Right', 1), ('Right', 2), ('Right', 3)]\", \"assert generate_right_values([-1, -2, -3]) == [('Right', -1), ('Right', -2), ('Right', -3)]\", \"assert generate_righ... | {
"split": "train",
"index": 72139,
"acecode_id": "bigcode_python_fns_44537",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a bank account with privacy constraints in Python. The function should maintain an account balance that starts at 0 and allows for depositing and withdrawing funds while ensuring the balance cannot be directly accessed.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bank_account_operations([('deposit', 100)]) == 'Current balance: 100'\", \"assert bank_account_operations([('deposit', 50), ('withdraw', 20)]) == 'Current balance: 30'\", \"assert bank_account_operations([('withdraw', 10)]) == 'Insufficient funds for withdra... | {
"split": "train",
"index": 72140,
"acecode_id": "oss_36675",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary, write a function `add_key_value_pair` that adds a new key-value pair to the dictionary if the key does not already exist and returns the updated dictionary. Additionally, if the key already exists, update the value for the key with the provided value and ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_key_value_pair({1: 'a', 2: 'b'}, 3, 'c') == {1: 'a', 2: 'b', 3: 'c'}\", \"assert add_key_value_pair({1: 'a', 2: 'b'}, 1, 'd') == {1: 'd', 2: 'b'}\", \"assert add_key_value_pair({}, 1, 'a') == {1: 'a'}\", \"assert add_key_value_pair({1: 'a'}, 2, 'b') == {... | {
"split": "train",
"index": 72141,
"acecode_id": "evol_19640",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to highlight a given string as if it were code in a specific programming language. Your task is to create a function `highlight_string` that takes a string and a programming language name as input and returns a simulated highlighted v... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert highlight_string('print(\\\"Hello, World!\\\")', 'python') == '[python] print(\\\"Hello, World!\\\")'\", \"assert highlight_string('console.log(\\\"Hello, World!\\\")', 'javascript') == '[javascript] console.log(\\\"Hello, World!\\\")'\", \"assert highlight_... | {
"split": "train",
"index": 72142,
"acecode_id": "oss_7884",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that converts a given binary string into its corresponding hexadecimal representation. The input binary string will consist only of '0' and '1' characters. You should return the hexadecimal string in lowercase without any leading '0x'.\nPlease reason step by st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binary_to_hex('10100101') == 'a5'\", \"assert binary_to_hex('00000000') == '0'\", \"assert binary_to_hex('11111111') == 'ff'\", \"assert binary_to_hex('1010') == 'a'\", \"assert binary_to_hex('1111') == 'f'\", \"assert binary_to_hex('100110011') == '133'\", ... | {
"split": "train",
"index": 72143,
"acecode_id": "evol_23352",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that initializes a video processing system based on several parameters. The function should take in parameters that indicate whether to use spatial processing and a pipeline, along with other configuration options. Based on the input ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_video_processor(True, True, 'spatial_data.mp4', True, True, 'pipeline_data.mp4', True, True, True, 1) == {'spatial': {'lfd_params': 'default', 'is_training': True, 'filename': 'spatial_data.mp4', 'input_size': 'bottleneck_size', 'consensus': 'max'... | {
"split": "train",
"index": 72144,
"acecode_id": "oss_8996",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that partitions the list into sublists of a specified maximum size. Each sublist should contain consecutive elements from the original list. If the last sublist has fewer elements than the maximum size, it should still be included. The... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert partition_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\", \"assert partition_list([], 3) == []\", \"assert partition_list([10, 20, 30, 40, 50, 60], 3) == [[10, 20, 30], [40, 50, 60]]\", \"assert partition_list([1, 2, 3], 1) == [[1], [2], [3]]\", \"asser... | {
"split": "train",
"index": 72145,
"acecode_id": "bigcode_python_fns_8728",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the binding of DNA motifs to their respective binding sites. Each motif is represented by a unique identifier (an integer), and each binding site is represented by a string sequence of DNA characters (A, T, C, G). Your func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bind_motifs([(1, 'ATCG'), (2, 'GCTA'), (1, 'TTAA')]) == {1: 'ATCG', 2: 'GCTA'}\", \"assert bind_motifs([(3, 'A'), (4, 'T'), (3, 'C'), (4, 'G')]) == {3: 'A', 4: 'T'}\", \"assert bind_motifs([(5, 'ACGT'), (5, 'TGCA'), (6, 'CGTA')]) == {5: 'ACGT', 6: 'CGTA'}\",... | {
"split": "train",
"index": 72146,
"acecode_id": "oss_31915",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a candy crushing game. Given a 2D integer array `board` where different positive integers represent different types of candies, and a value of `0` represents an empty cell, your goal is to restore the board to a stable ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert candyCrush([[1,2,3],[4,5,6],[7,8,9]]) == ([[1,2,3],[4,5,6],[7,8,9]], 0)\", \"assert candyCrush([[1,1,1],[1,1,1],[0,0,0]]) == ([[0,0,0],[0,0,0],[0,0,0]], 6)\", \"assert candyCrush([[6,6,6,6],[6,6,6,6],[6,6,6,6]]) == ([[0,0,0,0],[0,0,0,0],[0,0,0,0]], 12)\", \"... | {
"split": "train",
"index": 72147,
"acecode_id": "evol_18905",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing vehicle information for a fleet. Each vehicle has a unique identifier (ID) and is associated with a device ID. Your goal is to write a function that processes an array of vehicle data, where each element in the array is a list containing two integer... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_vehicle_dictionary([[1, 101], [2, 102], [3, 103]]) == {1: 101, 2: 102, 3: 103}\", \"assert create_vehicle_dictionary([[4, 201], [5, 202]]) == {4: 201, 5: 202}\", \"assert create_vehicle_dictionary([[10, 300], [11, 301], [12, 302]]) == {10: 300, 11: 30... | {
"split": "train",
"index": 72148,
"acecode_id": "oss_29559",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a dictionary as input and returns a new dictionary with its elements sorted by their values in ascending order. The order of keys with equal values should remain as they appeared in the input dictionary. The function should be defined as follows:... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_dict_by_value({'Alice': 5, 'Bob': 2, 'Charlie': 8}) == {'Bob': 2, 'Alice': 5, 'Charlie': 8}\", \"assert sort_dict_by_value({'A': 1, 'B': 1, 'C': 3}) == {'A': 1, 'B': 1, 'C': 3}\", \"assert sort_dict_by_value({'X': 10, 'Y': 20, 'Z': 10}) == {'X': 10, 'Z'... | {
"split": "train",
"index": 72149,
"acecode_id": "evol_3098",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that schedules events to be executed at specific times. Your function should accept a list of events, where each event is represented as a dictionary containing the following keys: `type`, `time`, and either `url` (for `LinkEvent`), `comm... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert schedule_events([{'type': 'LinkEvent', 'url': 'https://www.example.com', 'time': '2023-10-03T10:00:00'}, {'type': 'RunCMDEvent', 'command': 'echo Hello', 'time': '2023-10-03T10:05:00'}, {'type': 'OpenTermEvent', 'time': '2023-10-03T10:10:00'}]) == ['Schedule... | {
"split": "train",
"index": 72150,
"acecode_id": "oss_27836",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a string as input and returns a dictionary containing the count of each character in the string. The function should ignore spaces and be case insensitive, meaning 'A' and 'a' are considered the same character. If the input... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_characters('Hello World') == {'h': 1, 'e': 1, 'l': 3, 'o': 2, 'w': 1, 'r': 1, 'd': 1}\", \"assert count_characters('') == {}\", \"assert count_characters('abcABC') == {'a': 2, 'b': 2, 'c': 2}\", \"assert count_characters('12345!@#') == {'1': 1, '2': 1,... | {
"split": "train",
"index": 72151,
"acecode_id": "bigcode_python_fns_12749",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function that determines whether two input strings are equal using recursion. The function should return True if the strings are equal and False otherwise. You should consider that two strings are equal if they have the same characters in the same order, and both st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_strings('hello', 'hello') == True\", \"assert check_strings('abc', 'abc') == True\", \"assert check_strings('', '') == True\", \"assert check_strings('a', 'a') == True\", \"assert check_strings('test', 'test') == True\", \"assert check_strings('Python'... | {
"split": "train",
"index": 72152,
"acecode_id": "evol_12961",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program to manage the emailing of PDF reports to users based on certain conditions. You will be given a list of users, where each user is represented as a dictionary containing the user's email, a list of AWS keys, and the date of the last report ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_users_to_email([{ 'email': 'user4@example.com', 'aws_keys': ['key4'], 'report_last_emailed_at': '2023-01-15' }, { 'email': 'user5@example.com', 'aws_keys': ['key5'], 'report_last_emailed_at': '' }], '2023-02-01') == ['user5@example.com']\", \"assert get_... | {
"split": "train",
"index": 72153,
"acecode_id": "oss_25467",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `generate_submit(tab: List[int]) -> List[str]` that takes this list and returns a new list of strings where each integer from the input list is converted to a string and each string is followed by a newline character. The order of the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_submit([1, 2, 3]) == ['1\\\\n', '2\\\\n', '3\\\\n']\", \"assert generate_submit([10, 20, 30]) == ['10\\\\n', '20\\\\n', '30\\\\n']\", \"assert generate_submit([-1, 0, 1]) == ['-1\\\\n', '0\\\\n', '1\\\\n']\", \"assert generate_submit([]) == []\", \"... | {
"split": "train",
"index": 72154,
"acecode_id": "bigcode_python_fns_31619",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a bi-dimensional matrix (list of lists) consisting of characters, implement a function `count_letters(matrix)` that counts the occurrences of each alphabetic character in the matrix. The function should return a dictionary where the keys are the lowercase letters and the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_letters([['a', 'b', 'c'], ['a', 'b', 'c']]) == {'a': 2, 'b': 2, 'c': 2}\", \"assert count_letters([['A', 'b', 'C'], ['d', 'E', 'f']]) == {'a': 1, 'b': 1, 'c': 1, 'd': 1, 'e': 1, 'f': 1}\", \"assert count_letters([['1', '2', '3'], ['!', '@', '#']]) == {... | {
"split": "train",
"index": 72155,
"acecode_id": "evol_19386",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of expenses and calculates the total expenses for each year. The input will be a list of tuples, where each tuple contains a date in the format 'YYYY-MM-DD' and the corresponding expense amount as a float. You... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_yearly_expenses([('2021-01-15', 200.0), ('2021-02-10', 150.0), ('2022-03-05', 300.0)]) == {'2021': 350.0, '2022': 300.0}\", \"assert calculate_yearly_expenses([('2020-05-20', 500.0), ('2020-06-10', 450.0)]) == {'2020': 950.0}\", \"assert calculate_... | {
"split": "train",
"index": 72156,
"acecode_id": "oss_32759",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that calculates the sum of the products of the digits of a given binary number and its reverse. The digits should be interpreted as decimal values. Ensure that the input is a valid binary number, consisting only of '0's and '1's. If the input is invalid, raise ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_products_binary('0000') == 0\", \"assert sum_of_products_binary('1001') == 2\", \"assert sum_of_products_binary('0001') == 0\", \"assert sum_of_products_binary('1000') == 0\", \"assert sum_of_products_binary('0100') == 0\", \"assert sum_of_products_bi... | {
"split": "train",
"index": 72157,
"acecode_id": "evol_13140",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function that finds the largest prime factor of a given floating-point number 'n'. The input number can be positive or negative, but it must satisfy the condition that the absolute value of 'n' is greater than 1 and is not a prime number itself. If the input does no... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert exact_largest_prime_factor(13195.64) == 29\", \"assert exact_largest_prime_factor(2048.12) == 2\", \"assert exact_largest_prime_factor(-13195.98) == 29\", \"assert exact_largest_prime_factor(100.5) == 5\", \"assert exact_largest_prime_factor(21.0) == 7\", \"... | {
"split": "train",
"index": 72158,
"acecode_id": "evol_9974",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a 2D list of integers representing an image, where each integer represents the pixel intensity (0-255), and a tuple representing the desired scale range (min, max), write a function that rescales the pixel intensities of the image to fit within the specified range. The ou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert img_min_max_scaler([[0, 255], [0, 255]], (0, 100)) == [[0, 100], [0, 100]]\", \"assert img_min_max_scaler([[10]], (20, 30)) == [[20]]\", \"assert img_min_max_scaler([[0]], (0, 255)) == [[0]]\", \"assert img_min_max_scaler([[0, 0, 0], [0, 0, 0]], (100, 200)) ... | {
"split": "train",
"index": 72159,
"acecode_id": "bigcode_python_fns_32272",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates default values for various attributes based on their type and specific conditions. The function should take an attribute descriptor as input, which is a tuple containing the name of the attribute, its type, and additional p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isinstance(get_default_value(('my_array', 'array', 5)), list) and len(get_default_value(('my_array', 'array', 5))) == 5\", \"assert isinstance(get_default_value(('my_int', 'integer')), int) and get_default_value(('my_int', 'integer')) in range(100)\", \"asse... | {
"split": "train",
"index": 72160,
"acecode_id": "bigcode_python_fns_1711",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple caching system that optimizes data retrieval and storage based on read and write latencies. Your task is to design and implement a function `optimize_cache_operations(read_latency: int, write_latency: int, operations: List[Tuple[str, st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert optimize_cache_operations(2, 3, [('write', 'key1', 'Value1'), ('read', 'key1')]) == ['Value1']\", \"assert optimize_cache_operations(1, 1, [('write', 'keyA', 'ValueA'), ('read', 'keyA')]) == ['ValueA']\", \"assert optimize_cache_operations(5, 5, [('write', '... | {
"split": "train",
"index": 72161,
"acecode_id": "oss_31337",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that intertwines two given strings of equal length by swapping their characters, reverses the resulting string, and ensures that every other character is capitalized, starting with the first character. If the input strings are not of the same length, the fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert custom_mix_strings('', '') == ''\", \"assert custom_mix_strings('abcd', 'efghi') == ''\", \"assert custom_mix_strings('longer', 'short') == ''\", \"assert custom_mix_strings('abcd', '') == ''\", \"assert custom_mix_strings('', 'efgh') == ''\"]}"
} | {
"split": "train",
"index": 72162,
"acecode_id": "evol_4236",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function that simulates data collection based on a specified data type. The function should accept a string parameter `datatype`. If `datatype` is 'real', the function should return the string 'Collecting real-time data'. If `datatype` is anything else, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert collect_data('real') == 'Collecting real-time data'\", \"assert collect_data('fake') == 'Generating fake data'\", \"assert collect_data('') == 'Generating fake data'\", \"assert collect_data('test') == 'Generating fake data'\", \"assert collect_data('REAL') ... | {
"split": "train",
"index": 72163,
"acecode_id": "oss_12855",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer index n and a dictionary data that contains three keys: 'bools', 'ints', and 'conts', where each key maps to a set of integers, write a function `get_variable_type(n: int, data: Dict[str, Set[int]]) -> str` that returns the type of a variable based on its index... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_variable_type(1, {'bools': {0, 1}, 'ints': {2, 3}, 'conts': {4, 5}}) == 'BINARY'\", \"assert get_variable_type(2, {'bools': {0, 1}, 'ints': {2, 3}, 'conts': {4, 5}}) == 'INTEGER'\", \"assert get_variable_type(4, {'bools': {0, 1}, 'ints': {2, 3}, 'conts':... | {
"split": "train",
"index": 72164,
"acecode_id": "bigcode_python_fns_15177",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python decorator that logs the execution time of a function. Your decorator should print the name of the function being executed, the arguments passed to it, and the time taken for its execution in seconds with six decimal places. The decorator sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_execution_time(sample_function)(3, 4) == 12\", \"assert log_execution_time(sample_function)(1, 0) == 0\", \"assert log_execution_time(sample_function)(-1, 5) == -5\", \"assert log_execution_time(sample_function)(2, 2) == 4\", \"assert log_execution_time(... | {
"split": "train",
"index": 72165,
"acecode_id": "oss_8541",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `render_welcome_message()` that simulates rendering a welcome message for a website. The function should return a dictionary with a single key-value pair where the key is 'message' and the value is 'Welcome to the website!'.\nPlease reason step by step, the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert render_welcome_message() == {'message': 'Welcome to the website!'}\", \"assert render_welcome_message() is not None\", \"assert 'message' in render_welcome_message()\", \"assert render_welcome_message()['message'] == 'Welcome to the website!'\", \"assert typ... | {
"split": "train",
"index": 72166,
"acecode_id": "bigcode_python_fns_23719",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `get_instrument_files(instrument: str, multitrack_list: List[Dict[str, List[Dict[str, str]]]]) -> List[str]` that retrieves all audio file paths for a specified musical instrument from a given list of multitrack data. Each multitrack is represented as a dic... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_instrument_files('drum set', [{'stems': [{'instrument': 'drum set', 'audio_path': 'path/to/drum1.wav'}, {'instrument': 'guitar', 'audio_path': 'path/to/guitar1.wav'}]}, {'stems': [{'instrument': 'drum set', 'audio_path': 'path/to/drum2.wav'}]}]) == ['pat... | {
"split": "train",
"index": 72167,
"acecode_id": "bigcode_python_fns_48664",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function called `roll_magic_dice` that simulates the rolling of a magical six-sided dice. The function should return a random integer between 1 and 6 (inclusive). Implement the function without using any external resources.\nPlease reason step... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert roll_magic_dice() in {1, 2, 3, 4, 5, 6}\", \"assert roll_magic_dice() in {1, 2, 3, 4, 5, 6}\", \"assert roll_magic_dice() in {1, 2, 3, 4, 5, 6}\", \"assert roll_magic_dice() in {1, 2, 3, 4, 5, 6}\", \"assert roll_magic_dice() in {1, 2, 3, 4, 5, 6}\", \"asser... | {
"split": "train",
"index": 72168,
"acecode_id": "oss_29474",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing node attributes of a graph. Your task is to implement a function that removes (or marks as None) all node attributes that are greater than a specified threshold value. The function will take the following parameters: a list of integ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_above_threshold([10, 20, 30, 40], 25) == [10, 20, None, None]\", \"assert remove_above_threshold([5, 15, 25, 35, 45], 30) == [5, 15, 25, None, None]\", \"assert remove_above_threshold([100, 200, 300], 150) == [100, None, None]\", \"assert remove_above... | {
"split": "train",
"index": 72169,
"acecode_id": "bigcode_python_fns_45990",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that accepts a list of integers and returns the maximum sum of any contiguous subarray within that list. A contiguous subarray is defined as a sequence of elements that are consecutive in the array. Your function should be named `max_subar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_subarray_sum([1, 2, 3, -2, 5]) == 9\", \"assert max_subarray_sum([-2, -3, -1]) == -1\", \"assert max_subarray_sum([5, 4, -1, 7, 8]) == 23\", \"assert max_subarray_sum([0]) == 0\", \"assert max_subarray_sum([]) == 0\", \"assert max_subarray_sum([-1, -2, -... | {
"split": "train",
"index": 72170,
"acecode_id": "oss_30022",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a Python function to calculate the surface area of a circular sector. The function should accept a list of tuples, where each tuple contains the radius and central angle of a sector. The function must return a list of surface areas corresponding to each sector, with the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert surface_area([(10, 0)]) == [0.0]\", \"assert surface_area([(5, -30)]) == [None]\", \"assert surface_area([(5, 400)]) == [None]\", \"assert surface_area([(0, 90)]) == [0.0]\", \"assert surface_area([(1, 'angle')]) == ['Invalid input.']\", \"assert surface_are... | {
"split": "train",
"index": 72171,
"acecode_id": "evol_22197",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates a unique URL for deleting a specific tag from a dataset. The function should take in the access key, base URL, owner name, dataset name, and tag name as input parameters. The function should return the formatted URL use... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_delete_url('ACCESSKEY-123456', 'https://api.example.com', 'example-owner', 'example-dataset', 'example-tag') == 'https://api.example.com/v2/datasets/example-owner/example-dataset/tags/example-tag'\", \"assert generate_delete_url('ACCESSKEY-abcdef', ... | {
"split": "train",
"index": 72172,
"acecode_id": "bigcode_python_fns_15363",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers, `y_true` and `y_pred`, representing the ground truth and predicted labels respectively, write a function `sensitivity_score(y_true: List[int], y_pred: List[int]) -> float` to compute the classification sensitivity score. The sensitivity score is def... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sensitivity_score([1, 0, 1, 1], [1, 0, 1, 0]) == 0.6666666666666666\", \"assert sensitivity_score([1, 1, 1, 1], [1, 1, 1, 1]) == 1.0\", \"assert sensitivity_score([0, 0, 0, 0], [0, 0, 0, 0]) == 0.0\", \"assert sensitivity_score([1, 1, 0, 0], [0, 1, 0, 0]) ==... | {
"split": "train",
"index": 72173,
"acecode_id": "bigcode_python_fns_8347",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of strings, `residue` and `bead`, representing the names of atoms in two different molecular structures. You also receive a dictionary called `match`, where the keys are indices from the `residue` list and the values are indices from the `bead` list. You... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rate_match(['H', 'O', 'C'], ['H', 'N', 'C'], {0: 0, 2: 2}) == 2\", \"assert rate_match(['H', 'O', 'C'], ['H', 'N', 'C'], {0: 1, 1: 0}) == 0\", \"assert rate_match(['N', 'O', 'C'], ['H', 'N', 'C'], {0: 1, 1: 0, 2: 1}) == 1\", \"assert rate_match(['C', 'C', 'C... | {
"split": "train",
"index": 72174,
"acecode_id": "bigcode_python_fns_49184",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function called `get_user_data(user_id)` that retrieves user information from a database. The function should return a dictionary with the user's `id`, `name`, and `age` if the user exists. If the user does not exist, return a dictionary with ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_user_data(1) == {'id': 1, 'name': 'Alice', 'age': 30}\", \"assert get_user_data(2) == {'id': 2, 'name': 'Bob', 'age': 25}\", \"assert get_user_data(6) == {'error': 'User not found'}\", \"assert get_user_data(7) == {'error': 'User not found'}\", \"assert ... | {
"split": "train",
"index": 72175,
"acecode_id": "evol_24291",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_oo_sequence(sequence: str) -> bool` that checks if a given string ends with the consecutive letters 'oo'. The string must consist only of alphabetic characters (uppercase and lowercase) and must not contain any numbers or special characters. The funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_oo_sequence('Helloo') == True\", \"assert find_oo_sequence('Helloo!') == False\", \"assert find_oo_sequence('H3lloo') == False\", \"assert find_oo_sequence('foo') == True\", \"assert find_oo_sequence('baroo') == True\", \"assert find_oo_sequence('hello'... | {
"split": "train",
"index": 72176,
"acecode_id": "evol_19533",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of dictionaries, where each dictionary represents a field in a database model. Each dictionary contains key-value pairs for attributes such as 'model_name', 'name', and 'field'. Your function should take the l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_fields_by_model([{'model_name': 'yourorder', 'name': 'phone', 'field': 'models.CharField(max_length=10, null=True)'}, {'model_name': 'yourorder', 'name': 'address', 'field': 'models.CharField(max_length=100, null=True)'}, {'model_name': 'customer', 'name... | {
"split": "train",
"index": 72177,
"acecode_id": "oss_22333",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given four points in a 2D plane, determine if they form a convex quadrilateral. A convex quadrilateral is defined as a four-sided figure where all interior angles are less than 180 degrees and the line segments do not intersect each other. Each point is represented by an object... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isConvexQuadrilateral(Point(0, 0), Point(2, 0), Point(2, 2), Point(0, 2)) == True\", \"assert isConvexQuadrilateral(Point(0, 0), Point(0, 1), Point(1, 1), Point(1, 0)) == True\", \"assert isConvexQuadrilateral(Point(0, 0), Point(1, 1), Point(0, 2), Point(2, ... | {
"split": "train",
"index": 72178,
"acecode_id": "oss_16842",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing a sequence of numbers. Your task is to implement a function that takes this list and returns the sum of all even numbers in the list. If there are no even numbers, return 0. Implement this in a single function called `sum_of_evens(n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([-2, -4, 1, 3, 5]) == -6\", \"assert sum_of_evens([0, -1, -2, -3]) == -2\", \"assert sum_of_evens([10, 20, 30]) == 60\", \"assert sum_of_evens([1, 3, 5, 7]) == 0\", \"assert sum_of_evens([2, 4, 6, 8... | {
"split": "train",
"index": 72179,
"acecode_id": "bigcode_python_fns_22903",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a string as input and modifies the capitalization of each letter by switching the case alternately for each individual letter, starting with uppercase for the first letter. Non-alphabetic characters should remain unchanged. For example, given the inp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert alternate_case('Hello World!') == 'HeLlO WoRlD!'\", \"assert alternate_case('a quick brown fox') == 'A QuIcK BrOwN FoX'\", \"assert alternate_case('12345') == '12345'\", \"assert alternate_case('') == ''\", \"assert alternate_case('!@#$%^&*()') == '!@#$%^&*(... | {
"split": "train",
"index": 72180,
"acecode_id": "evol_1881",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given an integer n, write a function that calculates the number of distinct ways to ascend a staircase with n steps if you can take 1, 2, or 3 steps at a time. The function should return the number of distinct permutations available for climbing the staircase.\nPlease reason st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert num_of_permutations(0) == 0\", \"assert num_of_permutations(1) == 1\", \"assert num_of_permutations(2) == 2\", \"assert num_of_permutations(3) == 4\", \"assert num_of_permutations(4) == 7\", \"assert num_of_permutations(5) == 13\", \"assert num_of_permutatio... | {
"split": "train",
"index": 72181,
"acecode_id": "evol_30643",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of strings, each string representing a reference to an image in the format '[IMG-n]: image_name', where 'n' is a positive integer and 'image_name' is the name of the image. Your function should return a list of dicti... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_references(['[IMG-1]: cat.jpg']) == [{'number': '[IMG-1]', 'image': 'cat.jpg'}]\", \"assert parse_references(['[IMG-2]: dog.png', '[IMG-3]: bird.gif']) == [{'number': '[IMG-2]', 'image': 'dog.png'}, {'number': '[IMG-3]', 'image': 'bird.gif'}]\", \"asse... | {
"split": "train",
"index": 72182,
"acecode_id": "oss_17762",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the evaluation of a function with an optional noise addition. The function takes three parameters: a float `noise_level` (where 0 <= noise_level <= 1), an integer `num_test_evaluations` (the number of evaluations to per... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate_function(0, 10, lambda: 5) == 5\", \"assert evaluate_function(0, 10, lambda: 10) == 10\", \"assert evaluate_function(0.5, 1, lambda: 0) >= -0.5 and evaluate_function(0.5, 1, lambda: 0) <= 0.5\", \"assert evaluate_function(0.5, 1, lambda: 0) >= -0.5 ... | {
"split": "train",
"index": 72183,
"acecode_id": "oss_19142",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a python function that returns a list of all prime numbers between 1 and a given number n (inclusive). The function should have the following signature: def get_primes(n: int) -> List[int].\nPlease reason step by step, then write a self-contained Python solution. Give you... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_primes(1) == []\", \"assert get_primes(2) == [2]\", \"assert get_primes(3) == [2, 3]\", \"assert get_primes(4) == [2, 3]\", \"assert get_primes(5) == [2, 3, 5]\", \"assert get_primes(6) == [2, 3, 5]\", \"assert get_primes(10) == [2, 3, 5, 7]\", \"assert ... | {
"split": "train",
"index": 72184,
"acecode_id": "evol_21173",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple inventory management system for a small retail store. Your function should accept a list of operations on the inventory, where each operation is represented as a tuple. The operations can be of three types: add... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert inventory_management([('add', 'Apple', 10), ('add', 'Banana', 15)]) == {'Apple': 10, 'Banana': 15}\", \"assert inventory_management([('add', 'Apple', 10), ('add', 'Apple', 5)]) == {'Apple': 15}\", \"assert inventory_management([('add', 'Apple', 10), ('remove... | {
"split": "train",
"index": 72185,
"acecode_id": "oss_18682",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `generate_pascal_triangle(n: int) -> List[List[int]]` that generates Pascal's triangle with 'n' rows. Each row 'i' of Pascal's triangle contains 'i' elements, where each element is the sum of the two elements directly above it in the previous row. The first... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_pascal_triangle(0) == []\", \"assert generate_pascal_triangle(1) == [[1]]\", \"assert generate_pascal_triangle(2) == [[1], [1, 1]]\", \"assert generate_pascal_triangle(3) == [[1], [1, 1], [1, 2, 1]]\", \"assert generate_pascal_triangle(4) == [[1], [... | {
"split": "train",
"index": 72186,
"acecode_id": "evol_36103",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of whole numbers, implement a function that applies the following mathematical operation to each number: multiply the number by two, add three, and then raise the result to the power of two. The function should return a new list containing the results of this opera... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert mathematical_operation([2]) == [49]\", \"assert mathematical_operation([0]) == [9]\", \"assert mathematical_operation([-2]) == [1]\", \"assert mathematical_operation([10]) == [529]\", \"assert mathematical_operation([]) == []\"]}"
} | {
"split": "train",
"index": 72187,
"acecode_id": "evol_30532",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Write a function that converts a list of binary numbers into their hexadecimal equivalents. Each binary number in the list will be a string of up to 16 bits, and the function should output a list of strings representing the hexadecimal equivalents in uppercase. You can assume t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binary_to_hex(['0000']) == ['0']\", \"assert binary_to_hex(['1111']) == ['F']\", \"assert binary_to_hex(['10101010']) == ['AA']\", \"assert binary_to_hex(['110110101001', '1010', '1111']) == ['DA9', 'A', 'F']\", \"assert binary_to_hex(['0000000000000000']) =... | {
"split": "train",
"index": 72188,
"acecode_id": "evol_22279",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a Block class that has an optional attribute 'include_file_start_line'. Your task is to implement a function that retrieves the value of 'include_file_start_line' from a Block instance. If the value is set, return it as an integer. If it is not set or is invalid (... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_include_file_start_line(Block(include_file_start_line=10)) == 10\", \"assert get_include_file_start_line(Block(include_file_start_line=None)) is None\", \"assert get_include_file_start_line(Block(include_file_start_line=0)) == 0\", \"assert get_include_f... | {
"split": "train",
"index": 72189,
"acecode_id": "bigcode_python_fns_32726",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that manages a dictionary of words and their definitions. The function should accept a list of operations that can either add/update a word with its definition or search for the definition of a given word. If a word is added or upd... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_dictionary(['ADD apple a fruit', 'SEARCH apple']) == ['a fruit']\", \"assert manage_dictionary(['ADD banana a yellow fruit', 'SEARCH banana']) == ['a yellow fruit']\", \"assert manage_dictionary(['ADD orange a citrus fruit', 'UPDATE orange a sweet cit... | {
"split": "train",
"index": 72190,
"acecode_id": "oss_21470",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of floating-point numbers, implement a function `iround` that rounds each number in the list to the nearest integer. The function should return a new list containing the rounded integers. For example, if the input list is [2.3, 3.8, 4.5], the output should be [2, 4... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert iround([1.5, 2.5, 3.5]) == [2, 3, 4]\", \"assert iround([0.1, 0.6, 0.49]) == [0, 1, 0]\", \"assert iround([-1.5, -2.5, -3.5]) == [-2, -3, -4]\", \"assert iround([4.2, -4.8, 2.5]) == [4, -5, 3]\", \"assert iround([-2.5, 1.5, 0.5]) == [-3, 2, 1]\", \"assert ir... | {
"split": "train",
"index": 72191,
"acecode_id": "bigcode_python_fns_27238",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string containing a sequence of DNA bases represented by the characters 'A', 'C', 'G', and 'T'. Your task is to implement a function that splits this DNA sequence into multiple substrings, each of a specified maximum length. The function should return a list of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert split_dna_sequence('ACGTACGTGTA', 4) == ['ACGT', 'ACGT', 'GTA']\", \"assert split_dna_sequence('ACGT', 4) == ['ACGT']\", \"assert split_dna_sequence('A', 1) == ['A']\", \"assert split_dna_sequence('ACGTACGT', 2) == ['AC', 'GT', 'AC', 'GT']\", \"assert split_... | {
"split": "train",
"index": 72192,
"acecode_id": "bigcode_python_fns_16803",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a method labeled as 'isFull' for the Stack class. This method should check if the stack has reached its maximum capacity. The Stack class is defined as follows: class Stack: def __init__(self, max_size): self.max_size = max_size; self.data = []. The 'isFull' method sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert Stack(5).isFull() == False\", \"assert Stack(0).isFull() == True\", \"assert Stack(3).isFull() == False\"]}"
} | {
"split": "train",
"index": 72193,
"acecode_id": "evol_13365",
"num_tests": 3
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, implement a function that removes all duplicates from the list, counts the occurrences of each word, and returns a modified list sorted in descending order based on the count of their occurrences. If two words have the same count, sort them lexicographi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert solve(['apple', 'banana', 'apple', 'orange']) == (['apple', 'banana', 'orange'], {'apple': 2, 'banana': 1, 'orange': 1})\", \"assert solve(['dog', 'cat', 'dog', 'mouse', 'cat', 'dog']) == (['dog', 'cat', 'mouse'], {'dog': 3, 'cat': 2, 'mouse': 1})\", \"asser... | {
"split": "train",
"index": 72194,
"acecode_id": "evol_3566",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing text copied to a clipboard. Your task is to implement a function named `set_folder_name(clipboard_content: str) -> str` that returns the folder name that would be set based on the clipboard content. If the clipboard content is empty, the func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_folder_name('Documents') == 'Documents'\", \"assert set_folder_name('') == 'Untitled'\", \"assert set_folder_name('Photos') == 'Photos'\", \"assert set_folder_name('') == 'Untitled'\", \"assert set_folder_name('Project_A') == 'Project_A'\", \"assert set_... | {
"split": "train",
"index": 72195,
"acecode_id": "bigcode_python_fns_28494",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes an array of integers as input and returns a new array containing only the even integers from the input array. The order of the even integers in the output array should be the same as their order in the input array.\nPlease reason step by step, then w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([0, -2, -3, 7, 8]) == [0, -2, 8]\", \"assert filter_even_numbers([1, 3, 5, 7]) == []\", \"assert filter_even_numbers([10, 12, 14, 15]) == [10, 12, 14]\", \"assert filter_even_numb... | {
"split": "train",
"index": 72196,
"acecode_id": "evol_34321",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates all possible combinations of elements from a list of lists. Each inner list contains distinct elements, and the function should return a list of tuples, where each tuple represents a unique combination of one element fr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_combinations([[1, 2], [3, 4]]) == [(1, 3), (1, 4), (2, 3), (2, 4)]\", \"assert generate_combinations([[1], [2], [3]]) == [(1, 2, 3)]\", \"assert generate_combinations([['a', 'b'], ['c', 'd'], ['e', 'f']]) == [('a', 'c', 'e'), ('a', 'c', 'f'), ('a', ... | {
"split": "train",
"index": 72197,
"acecode_id": "bigcode_python_fns_49582",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function in Python that takes a 2D list of integers with varying row lengths and calculates the average of all integer values in this list. The function should return the average as a float. If the input is not a 2D list of integers or if the list is empty, the function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_2d_list([[1, 2, 3], [4, 5], [6]]) == 3.5\", \"assert average_2d_list([[10, 20], [30, 40, 50]]) == 30.0\", \"assert average_2d_list([[1], [2], [3], [4], [5]]) == 3.0\", \"assert average_2d_list([[], [1, 2, 3]]) == 2.0\", \"assert average_2d_list([[1, ... | {
"split": "train",
"index": 72198,
"acecode_id": "evol_4590",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a string of text and a list of words, and returns a dictionary with the frequency of each word in the text. The function should also return a dictionary where each word maps to a list of sentences from the text in which the word appears. The sear... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert search_words('Hello world! Hello everyone.', ['hello', 'world']) == ({'hello': 2, 'world': 1}, {'hello': ['Hello world!', 'Hello everyone.'], 'world': ['Hello world!']})\", \"assert search_words('This is a test. This is only a test.', ['this', 'test']) == ({... | {
"split": "train",
"index": 72199,
"acecode_id": "evol_11863",
"num_tests": 15
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.