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": "Implement a function that identifies Fibonacci numbers from a list of integers. The function should take a list as input and return a tuple containing two elements: a sorted list of Fibonacci numbers present in the input list and the sum of these Fibonacci numbers. The function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_fibonacci_numbers([0, 1, 2, 3, 4, 5]) == ([0, 1, 2, 3, 5], 11)\", \"assert find_fibonacci_numbers([-5, -3, 0, 1, 1, 2, 3, 8]) == ([0, 1, 1, 2, 3, 8], 15)\", \"assert find_fibonacci_numbers([13, 21, 34, 55]) == ([13, 21, 34, 55], 123)\", \"assert find_fi... | {
"split": "train",
"index": 83700,
"acecode_id": "evol_9373",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that counts the occurrences of different types of migration operations from a list. Each operation is represented by a string that indicates its type. The types of operations include 'AddField', 'AlterField', 'DeleteModel', and 'Re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_migration_operations(['AddField', 'AlterField', 'AddField', 'RenameField', 'DeleteModel']) == {'AddField': 2, 'AlterField': 1, 'DeleteModel': 1, 'RenameField': 1}\", \"assert count_migration_operations(['AlterField', 'AlterField', 'AlterField']) == {'A... | {
"split": "train",
"index": 83701,
"acecode_id": "oss_4294",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You have been tasked with creating a function that generates a unique context name based on a variable number of input strings. The function should take any number of string arguments and concatenate them into a single string separated by underscores ('_'). If no arguments are ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_context_name() == 'default_context'\", \"assert generate_context_name('Hello', 'World') == 'hello_world'\", \"assert generate_context_name('Python', 'is', 'great') == 'python_is_great'\", \"assert generate_context_name('Leet', 'Code') == 'leet_code'... | {
"split": "train",
"index": 83702,
"acecode_id": "bigcode_python_fns_39069",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string that represents a dotted module path, your task is to implement a function that extracts the module name and the class name from the path. The input will be a string in the format 'module_name.class_name'. The function should return a tuple containing the module ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_module_and_class('my_module.MyClass') == ('my_module', 'MyClass')\", \"assert extract_module_and_class('package.subpackage.MyClass') == ('package.subpackage', 'MyClass')\", \"assert extract_module_and_class('simplemodule.SimpleClass') == ('simplemodu... | {
"split": "train",
"index": 83703,
"acecode_id": "bigcode_python_fns_2160",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that formats student information into a specific string format. The function should take four parameters: Id (an integer), FirstName (a string), LastName (a string), and GroupId (an integer). Your function should return a string in the fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_student_info(1, 'John', 'Doe', 101) == 'Student[Id = 1, First Name = John, Last Name = Doe, GroupId = 101]'\", \"assert format_student_info(2, 'Alice', 'Smith', 102) == 'Student[Id = 2, First Name = Alice, Last Name = Smith, GroupId = 102]'\", \"asser... | {
"split": "train",
"index": 83704,
"acecode_id": "oss_19949",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simplified version of a convolutional block in a neural network. The function should take the following parameters: number of input channels, number of output channels, strides, padding, whether to use bias, whether t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert conv_block(3, 64) == {'in_channels': 3, 'out_channels': 64, 'kernel_size': 7, 'strides': 1, 'padding': 3, 'use_bias': False, 'use_bn': True, 'bn_eps': 1e-5, 'activation': 'relu', 'data_format': 'channels_last'}\", \"assert conv_block(1, 32, strides=2) == {'i... | {
"split": "train",
"index": 83705,
"acecode_id": "bigcode_python_fns_36920",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the enabling of a dodge feature in a game editor. The function `enable_dodge` should accept two parameters: a boolean `is_enabled` and a string `player_name`. The function should return a string that confirms the action tak... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert enable_dodge(True, 'player1') == 'Dodge feature has been enabled for player1.'\", \"assert enable_dodge(False, 'player1') == 'Dodge feature has been disabled for player1.'\", \"assert enable_dodge(True, 'player2') == 'Dodge feature has been enabled for playe... | {
"split": "train",
"index": 83706,
"acecode_id": "oss_31498",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string s and an integer n, write a function that returns the first n characters of the string s as a new string. If n is greater than the length of s, return the entire string s. The function should be defined as follows: def subsequence(s: str, n: int) -> str:\nPlease ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert subsequence('hello world', 6) == 'hello '\", \"assert subsequence('python', 3) == 'pyt'\", \"assert subsequence('abcdef', 10) == 'abcdef'\", \"assert subsequence('', 5) == ''\", \"assert subsequence('data', 0) == ''\", \"assert subsequence('LeetCode', 4) == ... | {
"split": "train",
"index": 83707,
"acecode_id": "evol_26613",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Construct a function named `prime_less_than` that takes a positive integer `n` as input and returns a list of all prime numbers that are strictly less than `n`. A prime number is defined as a natural number greater than 1 that cannot be formed by multiplying two smaller natural... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert prime_less_than(10) == [2, 3, 5, 7]\", \"assert prime_less_than(20) == [2, 3, 5, 7, 11, 13, 17, 19]\", \"assert prime_less_than(2) == []\", \"assert prime_less_than(15) == [2, 3, 5, 7, 11, 13]\", \"assert prime_less_than(1) == []\", \"assert prime_less_than(... | {
"split": "train",
"index": 83708,
"acecode_id": "evol_19698",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `to_number(value)` that attempts to convert the given input to a number. The function should handle the following cases: \n1. If the input is a string, it should convert it to a number (int or float) if possible. \n2. If the input is a list, tuple, or set, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert to_number('123') == 123\", \"assert to_number('123.45') == 123.45\", \"assert to_number(10) == 10\", \"assert to_number(10.5) == 10.5\", \"assert to_number([1, '2', '3.0', 'four']) == [1, 2, 3.0, math.nan]\", \"assert to_number((1, 2.5, '3.14', 'text')) == [... | {
"split": "train",
"index": 83709,
"acecode_id": "bigcode_python_fns_1327",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that generates a file path for an input file based on specific criteria. The function should take three parameters: `output_file` which is a string, `percentage_sample` which is an integer, and `exclude_samples` which is a list of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_input_file_path('', 50, []) == '../../classes_input/test_input_sampled_50.csv'\", \"assert generate_input_file_path('', 75, ['test_input_sampled_a', 'test_input_sampled_b']) == '../../classes_input/test_input_sampled_75_exclude_a_b.csv'\", \"assert ... | {
"split": "train",
"index": 83710,
"acecode_id": "oss_14401",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers, `run_list`, and a separator value `run_list_sep`. Write a function that returns the mean of the integers in `run_list` that are greater than the `run_list_sep` value. If there are no integers greater than `run_list_sep`, return 0. The function ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert mean_above_separator([10, 20, 30, 40], 25) == 35.0\", \"assert mean_above_separator([5, 10, 15], 20) == 0\", \"assert mean_above_separator([0, 0, 0, 0], 0) == 0\", \"assert mean_above_separator([1, 3, 5, 7, 9], 5) == 8.0\", \"assert mean_above_separator([], ... | {
"split": "train",
"index": 83711,
"acecode_id": "bigcode_python_fns_10610",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of a series of buildings. Your task is to write a function that determines the maximum amount of rainwater that can be trapped between these buildings. The function should take in a list of integers representing the heig... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_rainwater_trapped([3, 0, 2, 0, 4]) == 7\", \"assert max_rainwater_trapped([1, 0, 1]) == 1\", \"assert max_rainwater_trapped([4, 2, 0, 3, 2, 5]) == 9\", \"assert max_rainwater_trapped([0, 0, 0]) == 0\", \"assert max_rainwater_trapped([1, 1, 1, 1]) == 0\",... | {
"split": "train",
"index": 83712,
"acecode_id": "oss_1596",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Write a python function that takes a list of integers as input and returns the sum of the XOR of all unique pairs of numbers in the list. A unique pair is defined as a pair of indices (i, j) where i < j.\nPlease reason step by step, then write a self-contained Python solution. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_xor_pairs([0, 0, 0]) == 0\", \"assert sum_xor_pairs([1, 1, 1, 1]) == 0\", \"assert sum_xor_pairs([1]) == 0\", \"assert sum_xor_pairs([]) == 0\", \"assert sum_xor_pairs([255, 255, 255]) == 0\"]}"
} | {
"split": "train",
"index": 83713,
"acecode_id": "evol_17146",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a function that simulates a simple profiling system which generates a report. Your task is to implement a function called `generate_report` that returns a string containing the text 'Profiler Report' when called. This function does not take any parameters and shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_report() == 'Profiler Report'\", \"assert generate_report() == 'Profiler Report'\", \"assert generate_report() == 'Profiler Report'\", \"assert generate_report() == 'Profiler Report'\", \"assert generate_report() == 'Profiler Report'\", \"assert gen... | {
"split": "train",
"index": 83714,
"acecode_id": "bigcode_python_fns_6688",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to implement a function that returns a new list containing only the unique integers from the original list, preserving the order of their first occurrences. Write a function `get_unique_integers(arr: List[int]) -> List[int]:` where... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_integers([1, 2, 3, 2, 1, 4]) == [1, 2, 3, 4]\", \"assert get_unique_integers([5, 3, 5, 5, 2]) == [5, 3, 2]\", \"assert get_unique_integers([7, 8, 9, 7, 8, 9]) == [7, 8, 9]\", \"assert get_unique_integers([]) == []\", \"assert get_unique_integers([... | {
"split": "train",
"index": 83715,
"acecode_id": "bigcode_python_fns_44912",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of integers and an integer target. The function should replace every occurrence of the target integer in the list with a specified replacement integer and return the modified list.\nPlease reason step by step, then write a self-contained P... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert substitute_entity([1, 2, 3, 4, 2], 2, 5) == [1, 5, 3, 4, 5]\", \"assert substitute_entity([1, 1, 1, 1], 1, 0) == [0, 0, 0, 0]\", \"assert substitute_entity([5, 6, 7, 5, 8], 5, 9) == [9, 6, 7, 9, 8]\", \"assert substitute_entity([10, 20, 30], 40, 50) == [10, ... | {
"split": "train",
"index": 83716,
"acecode_id": "evol_28206",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that performs basic arithmetic operations on decimal numbers represented as floats and determines if a number is negative. Implement a function `decimal_operations(num1: float, num2: float) -> Tuple[float, float, float, float, Tuple[b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decimal_operations(5.5, -3.2) == (2.3, 8.7, -17.6, -1.71875, (False, True))\", \"assert decimal_operations(-5.5, 3.2) == (-2.3, -8.7, -17.6, -1.71875, (True, False))\", \"assert decimal_operations(-5.5, -3.2) == (-8.7, -2.3, 17.6, 1.71875, (True, True))\", \... | {
"split": "train",
"index": 83717,
"acecode_id": "oss_23293",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer representing a TCP port number, determine if the port is available for binding. A port is available if it can be successfully bound to without raising an error. Implement a function `is_port_available(port: int) -> bool` that returns `True` if the port is avail... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_port_available(0) == True\", \"assert is_port_available(1) == True\", \"assert is_port_available(1023) == True\", \"assert is_port_available(2048) == True\", \"assert is_port_available(3306) == True\", \"assert is_port_available(8080) == True\", \"assert ... | {
"split": "train",
"index": 83718,
"acecode_id": "bigcode_python_fns_9357",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with verifying a simple query input represented as a string. The function should take in a query string and evaluate whether it is valid based on certain predefined rules. A query is considered valid if it meets the following criteria: 1. It must not be empty. 2.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_query('SELECT * FROM users;') == True\", \"assert is_valid_query('SELECT name, age FROM students;') == True\", \"assert is_valid_query('SELECT id, email FROM contacts;') == True\", \"assert is_valid_query('SELECT * FROM orders;') == True\", \"assert... | {
"split": "train",
"index": 83719,
"acecode_id": "bigcode_python_fns_26783",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a Python decorator that takes a function as input and modifies its return value by appending the string 'Modified: ' to it. The decorator should also handle any exceptions that may occur during the function execution by returning None instead of raising the exception.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert modify_return_val_decorator(lambda: 'Hello')() == 'Modified: Hello'\", \"assert modify_return_val_decorator(lambda: 42)() == 'Modified: 42'\", \"assert modify_return_val_decorator(lambda: [1, 2, 3])() == 'Modified: [1, 2, 3]'\", \"assert modify_return_val_de... | {
"split": "train",
"index": 83720,
"acecode_id": "evol_17970",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `check_item_in_list(data, item)` that checks if a specified `item` is present in the provided list `data`. The function should return a message indicating whether the item was found or not. If the list is empty, return 'List is empty'.\nPlease reason step b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_item_in_list([3, 4, 5, 6, 7], 5) == 'Found the item: 5'\", \"assert check_item_in_list([3, 4, 5, 6, 7], 10) == 'Item not found in the list'\", \"assert check_item_in_list([], 5) == 'List is empty'\", \"assert check_item_in_list([1, 2, 3], 3) == 'Found ... | {
"split": "train",
"index": 83721,
"acecode_id": "evol_30534",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `find_primes(n)` that takes an integer n and returns a list of all prime numbers between 1 and n (inclusive). A prime number is a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. For example, 2, 3, 5, and 7 are pri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_primes(1) == []\", \"assert find_primes(2) == [2]\", \"assert find_primes(3) == [2, 3]\", \"assert find_primes(4) == [2, 3]\", \"assert find_primes(5) == [2, 3, 5]\", \"assert find_primes(6) == [2, 3, 5]\", \"assert find_primes(7) == [2, 3, 5, 7]\", \"a... | {
"split": "train",
"index": 83722,
"acecode_id": "evol_19313",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function called `create_weight_note` that takes two parameters: an integer `weight` (in grams) and an optional string `note`. The function should return a dictionary representing a weight measurement along with the optional note. The dictionar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_weight_note(100, 'Ate breakfast') == {'weight': 100, 'note': 'Ate breakfast'}\", \"assert create_weight_note(200) == {'weight': 200, 'note': None}\", \"assert create_weight_note(-50, 'Lost weight') == {'weight': -50, 'note': 'Lost weight'}\", \"assert... | {
"split": "train",
"index": 83723,
"acecode_id": "oss_29991",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings where each string contains tab-separated values representing protein information in the following format: 'protein_identifier\\tstart_position\\tend_position\\torthologous_group\\tprotein_annotation'. Your task is to implement a function that tak... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_labels(['P1\\\\t0\\\\t10\\\\tG1\\\\tAnnotation1', 'P2\\\\t11\\\\t20\\\\tG2\\\\tAnnotation2', 'P3\\\\t21\\\\t30\\\\tG3\\\\tAnnotation3']) == {'P1': 'G1', 'P2': 'G2', 'P3': 'G3'}\", \"assert create_labels(['P1\\\\t0\\\\t10\\\\tG1\\\\tAnnotation1', 'P2\\... | {
"split": "train",
"index": 83724,
"acecode_id": "bigcode_python_fns_31730",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Write a Python function `palindrome_freq(text: str) -> float` that calculates the frequency of palindrome words in a given block of text. A palindrome word is defined as a word that reads the same backward as forward. The function should return the frequency as a float, which i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert palindrome_freq('radar level is not a palindrome') == 0.5\", \"assert palindrome_freq('madam racecar') == 1.0\", \"assert palindrome_freq('hello world') == 0.0\", \"assert palindrome_freq('') == 0.0\", \"assert palindrome_freq('a') == 1.0\", \"assert palindr... | {
"split": "train",
"index": 83725,
"acecode_id": "evol_24308",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Write a function that, when given a sequence of Deoxyribonucleic Acid (DNA), calculates the estimated atomic composition of the DNA and the corresponding Ribonucleic Acid (RNA) strand. The function should return a tuple containing two lists: the first list should include the at... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dna_rna_composition('A') == ([['Adenine', 'C5H5N5']], ['A'], [['Adenine', 'C5H5N5']])\", \"assert dna_rna_composition('T') == ([['Thymine', 'C5H6N2O2']], ['U'], [['Uracil', 'C4H4N2O2']])\", \"assert dna_rna_composition('C') == ([['Cytosine', 'C4H5N3O']], ['C... | {
"split": "train",
"index": 83726,
"acecode_id": "evol_32720",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that verifies if an order is valid based on the following criteria: \n1. The customer's name should be a string of 1 to 30 characters.\n2. The phone number should be a string of exactly 10 digits.\n3. The quantity should be a numeric stri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_order_valid('Alice', '1234567890', '5', '123 Main St', '1234567890', '2023-10-03', 'Laptop') == True\", \"assert is_order_valid('Bob', '0987654321', '10', '456 Elm St', '0987654321', '2023-10-04', 'Headphones') == True\", \"assert is_order_valid('', '1234... | {
"split": "train",
"index": 83727,
"acecode_id": "oss_36183",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a function `remove_odd_elements(t)` that eliminates non-even elements from a nested heterogeneous tuple. This function should handle tuples embedded within other tuples, as well as lists and dictionaries by converting them into tuples. The function should retain even in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_odd_elements((1, 2, 3, 4)) == (2, 4)\", \"assert remove_odd_elements((1.0, 2.0, 3.5, 4.0)) == (2, 4)\", \"assert remove_odd_elements((1, '2', '3', '4')) == ('2', '4')\", \"assert remove_odd_elements((1, 3, 5, 7)) == ()\", \"assert remove_odd_elements(... | {
"split": "train",
"index": 83728,
"acecode_id": "evol_9018",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a given package name and returns a formatted version of the name. The formatting rules are as follows: 1. The package name should be converted to lowercase. 2. Any whitespace characters at the beginning or end of the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_package_name(' python-requests ') == 'requests'\", \"assert format_package_name(' python-tensorflow ') == 'tensorflow'\", \"assert format_package_name(' python-requests ') == 'requests'\", \"assert format_package_name('python-example') == 'exampl... | {
"split": "train",
"index": 83729,
"acecode_id": "oss_30124",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks if an email address is valid according to the following criteria: 1) It must contain exactly one '@' symbol. 2) The '@' symbol must not be the first or last character. 3) The domain name (the part after '@') must consist o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_email('user@example.com') == True\", \"assert is_valid_email('user.name+tag+sorting@example.com') == True\", \"assert is_valid_email('user@subdomain.example.com') == True\", \"assert is_valid_email('user@domain.co.in') == True\", \"assert is_valid_e... | {
"split": "train",
"index": 83730,
"acecode_id": "oss_21815",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings. Your task is to implement a function `append_to_list(arr: List[str], string: str) -> List[str]` that appends the given string to the end of the list. The function should return the modified list. The input list may contain any number of strings,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert append_to_list([], 'hello') == ['hello']\", \"assert append_to_list(['apple', 'banana'], 'orange') == ['apple', 'banana', 'orange']\", \"assert append_to_list(['a', 'b', 'c'], '') == ['a', 'b', 'c', '']\", \"assert append_to_list(['test'], 'sample') == ['tes... | {
"split": "train",
"index": 83731,
"acecode_id": "bigcode_python_fns_6531",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary representing a geographical site, implement a function `get_lat_lng(site)` that retrieves the latitude and longitude of the site from the 'org_coordinates' key. The function should return a tuple of (latitude, longitude) if the 'org_coordinates' key is presen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_lat_lng({'org_coordinates': {'lat': 34.0522, 'lon': -118.2437}}) == (34.0522, -118.2437)\", \"assert get_lat_lng({'org_coordinates': {'lat': 40.7128}}) == None\", \"assert get_lat_lng({'org_coordinates': {'lon': -74.0060}}) == None\", \"assert get_lat_ln... | {
"split": "train",
"index": 83732,
"acecode_id": "bigcode_python_fns_46961",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of category names and a list of super category IDs, write a function `add_subcategories(cat_names: List[str], super_cat_ids: List[int]) -> List[str]` that adds subcategories to a database. Each subcategory is defined by a category name and a super category ID. If a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_subcategories(['Books', 'Electronics', 'Books'], [1, 2, 1]) == ['Category Books added successfully.', 'Category Electronics added successfully.', 'Category Books already exists.']\", \"assert add_subcategories(['Toys', 'Games'], [3, 3]) == ['Category Toy... | {
"split": "train",
"index": 83733,
"acecode_id": "bigcode_python_fns_27059",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `calculate_surface_area(shape, *params)` that takes a string representing the geometric shape and a variable number of parameters corresponding to that shape's dimensions. The function should support the following shapes: 'cylinder', 'sphere', 'torus', 'men... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_surface_area('cylinder', 3, 5) == 150.79644737231007\", \"assert calculate_surface_area('cylinder', -3, 5) == None\", \"assert calculate_surface_area('sphere', 0) == None\", \"assert calculate_surface_area('torus', 2, -5) == None\", \"assert calcul... | {
"split": "train",
"index": 83734,
"acecode_id": "evol_8605",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to create a new object representing a fruit inventory. The function should create an inventory object with specific attributes and allow you to optionally store a unique identifier for the inventory. \n\nWrite a function `create_fruit... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_fruit_inventory('test_case_1', True) == {'fruit': 'apple', 'count': 34, 'task_id': '10293847565647382910abdcef1029384756'}\", \"assert create_fruit_inventory('test_case_1', False) == {'fruit': 'apple', 'count': 34}\", \"assert create_fruit_inventory('... | {
"split": "train",
"index": 83735,
"acecode_id": "oss_21946",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a binary array represented as a list of integers, where each integer is either 0 or 1, write a function `findMaxConsecutiveOnes(nums: List[int]) -> int` that returns the maximum number of consecutive 1s in the array `nums`. For example, if the input is `nums = [1, 1, 0, 1... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert findMaxConsecutiveOnes([1, 1, 0, 1, 1, 1]) == 3\", \"assert findMaxConsecutiveOnes([0, 0, 0, 0]) == 0\", \"assert findMaxConsecutiveOnes([1, 1, 1, 1]) == 4\", \"assert findMaxConsecutiveOnes([0, 1, 1, 1, 0]) == 3\", \"assert findMaxConsecutiveOnes([1, 0, 1, ... | {
"split": "train",
"index": 83736,
"acecode_id": "oss_5635",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `get_top_n_items(data: List[Dict[str, Union[str, float]]], n: int, price_type: str) -> List[Dict[str, Union[str, float]]]` that identifies the top n most expensive items from a given dataset, categorized by their respective categories. Each item in the data... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_top_n_items([{'name': 'Item1', 'category': 'A', 'regular_price': 100, 'sale_price': 90}, {'name': 'Item2', 'category': 'A', 'regular_price': 200, 'sale_price': 180}, {'name': 'Item3', 'category': 'B', 'regular_price': 50, 'sale_price': 40}], 2, 'regular_... | {
"split": "train",
"index": 83737,
"acecode_id": "evol_15456",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that converts a formatted monetary string into a numerical value. The function should handle various formats, including empty strings, percentages, and currency symbols. Specifically, the function should perform the following: \n- If the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_number(' ') == 0.0\", \"assert convert_to_number('10.95%') == 10.95\", \"assert convert_to_number('$404,691,250') == 404691250.0\", \"assert convert_to_number('$8105.52') == 8105.52\", \"assert convert_to_number('0%') == 0.0\", \"assert convert_t... | {
"split": "train",
"index": 83738,
"acecode_id": "bigcode_python_fns_31825",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that sends a registration confirmation email for a session to a participant. The function should take two parameters: a string `participant` representing the email address of the registered participant, and a dictionary `session` cont... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert send_registration_email('john.doe@example.com', {'title': 'Python 101', 'date': '2023-10-15', 'location': 'Room A'}) == 'Email sent to john.doe@example.com for session Python 101 on 2023-10-15 at Room A.'\", \"assert send_registration_email('jane.smith@examp... | {
"split": "train",
"index": 83739,
"acecode_id": "oss_24549",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of CPU statistics, where each statistic is represented by a dictionary containing the following keys: 'core', 'usage', and 'temperature'. Write a function `aggregate_cpu_stats(cpu_stats: List[Dict[str, Union[int, float]]]) -> Dict[str, Union[int, float]]` t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert aggregate_cpu_stats([{'core': 1, 'usage': 30, 'temperature': 70}, {'core': 2, 'usage': 50, 'temperature': 75}]) == {'average_usage': 40.0, 'max_temperature': 75}\", \"assert aggregate_cpu_stats([{'core': 1, 'usage': 100, 'temperature': 80}, {'core': 2, 'usag... | {
"split": "train",
"index": 83740,
"acecode_id": "bigcode_python_fns_48766",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of astronomical targets represented as a dictionary, where each key is the name of the target and the value is its altitude, write a function that returns a list of target names that have an altitude greater than a specified threshold. The function should take thre... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_target_names_above_altitude({'Star1': 30.0, 'Star2': 45.0, 'Star3': 25.0}, 30.0, True) == ['Star1', 'Star2']\", \"assert get_target_names_above_altitude({'Star1': 30.0, 'Star2': 45.0, 'Star3': 25.0}, 30.0, False) == ['Star2']\", \"assert get_target_names... | {
"split": "train",
"index": 83741,
"acecode_id": "bigcode_python_fns_23837",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_prime(n: int) -> bool` that determines if a given integer `n` is a prime number. A prime number is defined as a number greater than 1 that has no positive divisors other than 1 and itself. The function should return `True` if `n` is prime and `False` ot... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_prime(0) == False\", \"assert is_prime(1) == False\", \"assert is_prime(2) == True\", \"assert is_prime(3) == True\", \"assert is_prime(4) == False\", \"assert is_prime(5) == True\", \"assert is_prime(6) == False\", \"assert is_prime(7) == True\", \"asser... | {
"split": "train",
"index": 83742,
"acecode_id": "evol_32389",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program that generates a tower made of asterisks. The tower should have a specified number of floors, and each floor should have an increasing number of asterisks, creating a pyramid-like shape. The tower should be centered within the output, with... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_tower(1) == ['*']\", \"assert generate_tower(2) == [' * ', '***']\", \"assert generate_tower(3) == [' * ', ' *** ', '*****']\", \"assert generate_tower(4) == [' * ', ' *** ', ' ***** ', '*******']\", \"assert generate_tower(5) == [' * ... | {
"split": "train",
"index": 83743,
"acecode_id": "oss_21584",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers and a target integer. Your task is to return a string that represents the indices of the two numbers in the list that add up to the target integer. If no such indices exist, return 'No solution'. If there are multiple pairs, return the indices o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_indices([2, 7, 11, 15], 9) == '0, 1'\", \"assert find_indices([3, 2, 4], 6) == '1, 2'\", \"assert find_indices([3, 3], 6) == '0, 1'\", \"assert find_indices([10, 15, 3, 7], 17) == '0, 3'\", \"assert find_indices([1, 1, 1, 3], 4) == '2, 3'\", \"assert fi... | {
"split": "train",
"index": 83744,
"acecode_id": "bigcode_python_fns_35163",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a 3D list `x` representing a sequence of observations over time, where `x` has dimensions [nsteps, nbatch, obs_shape], implement a function `batch_to_seq` that transforms this list into a sequence of 2D lists. The function should take the following parameters: `x` (a 3D l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert batch_to_seq([[[1]], [[2]]], 1, 2, False) == [[[1]], [[2]]]\", \"assert batch_to_seq([[[1, 2]], [[3, 4]]], 1, 2, False) == [[[1, 2]], [[3, 4]]]\", \"assert batch_to_seq([[[1], [2]], [[3], [4]]], 2, 2, False) == [[[1], [2]], [[3], [4]]]\", \"assert batch_to_s... | {
"split": "train",
"index": 83745,
"acecode_id": "bigcode_python_fns_3247",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of buildings in a city skyline. Your task is to find the maximum area of a rectangle that can be formed by consecutive buildings. The rectangle's height is determined by the shortest building in the selected range. Imple... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert maxRectangleArea([1, 2, 3, 4, 5]) == 9\", \"assert maxRectangleArea([2, 1, 5, 6, 2, 3]) == 10\", \"assert maxRectangleArea([2, 4]) == 4\", \"assert maxRectangleArea([1]) == 1\", \"assert maxRectangleArea([5, 4, 3, 2, 1]) == 9\", \"assert maxRectangleArea([0,... | {
"split": "train",
"index": 83746,
"acecode_id": "bigcode_python_fns_38673",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a base URL string and a list of route patterns, and returns a list of formatted route strings. Each route pattern should be formatted by appending the base URL to the pattern, ensuring that the base URL ends with a '/' befo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_routes('http://example.com', ['route1', 'route2']) == ['http://example.com/route1', 'http://example.com/route2']\", \"assert format_routes('http://example.com/', ['route1', 'route2']) == ['http://example.com/route1', 'http://example.com/route2']\", \"... | {
"split": "train",
"index": 83747,
"acecode_id": "bigcode_python_fns_36676",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing the original file name (including its extension), write a function `transform_file_name(original_file_name: str) -> str` that transforms the file name by appending '_derp_i_moved_this_thing' before the file extension. The file extension is defined as... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_file_name('document.txt') == 'document_derp_i_moved_this_thing.txt'\", \"assert transform_file_name('image.jpeg') == 'image_derp_i_moved_this_thing.jpeg'\", \"assert transform_file_name('report.pdf') == 'report_derp_i_moved_this_thing.pdf'\", \"ass... | {
"split": "train",
"index": 83748,
"acecode_id": "bigcode_python_fns_19724",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of file paths and a list of allowed file extensions, write a function `filter_files(file_paths: List[str], allowed_extensions: List[str]) -> List[str]` that filters out the file paths whose extensions are not in the allowed extensions list. The function should retu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_files(['file1.txt', 'file2.doc', 'file3.pdf', 'image.png'], ['txt', 'pdf']) == ['file1.txt', 'file3.pdf']\", \"assert filter_files(['document.pdf', 'presentation.pptx', 'notes.txt'], ['txt', 'pptx']) == ['presentation.pptx', 'notes.txt']\", \"assert f... | {
"split": "train",
"index": 83749,
"acecode_id": "bigcode_python_fns_43978",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a file's content as a byte string and returns a dictionary with the following keys: 'content', 'length', and 'mime_type'. The 'content' key should hold the original byte string, 'length' should be the total number of bytes ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert file_info(b'Hello, World!', 'example.txt') == {'content': b'Hello, World!', 'length': 13, 'mime_type': 'text/plain'}\", \"assert file_info(b'\\\\x89PNG\\\\x0D\\\\x0A\\\\x1A\\\\x0A', 'image.png') == {'content': b'\\\\x89PNG\\\\x0D\\\\x0A\\\\x1A\\\\x0A', 'leng... | {
"split": "train",
"index": 83750,
"acecode_id": "bigcode_python_fns_48413",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that initializes a list of optimizers for a deep learning model. The function should take a list of model parameters and a learning rate as inputs. For each parameter, create an Adam optimizer with the given learning rate, and return ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_optimizers(['param1', 'param2'], 0.001) == ['Adam(param1, lr=0.001)', 'Adam(param2, lr=0.001)']\", \"assert initialize_optimizers(['paramA'], 0.01) == ['Adam(paramA, lr=0.01)']\", \"assert initialize_optimizers([], 0.001) == []\", \"assert initial... | {
"split": "train",
"index": 83751,
"acecode_id": "oss_24048",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of body speeds recorded during a bout, implement a function that returns the average speed over a specified range of indices (start and end). The function should take in a list of body speeds, a start index, and an end index. If the end index is -1, it should be in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_speed([2.5, 3.0, 4.0, 5.0, 3.5], 0, 4) == 3.6\", \"assert average_speed([1.0, 2.0, 3.0, 4.0], 1, 3) == 3.0\", \"assert average_speed([5.0, 5.0, 5.0], 0, -1) == 5.0\", \"assert average_speed([10.0], 0, 0) == 10.0\", \"assert average_speed([1.0, 2.0, 3... | {
"split": "train",
"index": 83752,
"acecode_id": "bigcode_python_fns_30927",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `sort_2d_array_by_row_sum(arr: List[List[int]]) -> List[List[int]]` that takes a two-dimensional array of integers and sorts it in ascending order based on the sum of each row. The function should handle any exceptions that may arise from invalid input. Ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_2d_array_by_row_sum([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == [[1, 2, 3], [4, 5, 6], [7, 8, 9]]\", \"assert sort_2d_array_by_row_sum([[5, 1], [2, 3], [0, 4]]) == [[0, 4], [2, 3], [5, 1]]\", \"assert sort_2d_array_by_row_sum([[1]]) == [[1]]\", \"assert sort_... | {
"split": "train",
"index": 83753,
"acecode_id": "evol_18411",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a given dictionary containing input data and an operation type. Your function should return a response dictionary with a specific structure indicating the status of the operation. The input dictionary will have t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_response({'input_data': [1, 2, 3], 'operation': 'sum'}) == {'code': 200, 'msg': 'Query was successful!', 'data': 6}\", \"assert process_response({'input_data': [1, 2, 3], 'operation': 'product'}) == {'code': 200, 'msg': 'Query was successful!', 'data... | {
"split": "train",
"index": 83754,
"acecode_id": "oss_35424",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary where the keys are string representations of integers, implement a function that computes the product of all distinct integer values derived from the dictionary keys. For example, if the dictionary is d = {'1': 'a', '2': 'b', '3': 'b', '4': 'c'}, the function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_product({'1': 'a', '2': 'b', '3': 'b', '4': 'c'}) == 24\", \"assert compute_product({'1': 'x', '2': 'y', '3': 'z'}) == 6\", \"assert compute_product({'5': 'apple', '6': 'banana', '7': 'cherry'}) == 210\", \"assert compute_product({'10': 'a', '20': 'b... | {
"split": "train",
"index": 83755,
"acecode_id": "evol_3949",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a method to check the status of a device. Your function should determine if the device is currently active or not based on its status. Implement a function `ShouldWaitForDevice` that takes a boolean input `is_active` which indicates whether the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert ShouldWaitForDevice(True) == False\", \"assert ShouldWaitForDevice(False) == True\", \"assert ShouldWaitForDevice(True) == False\", \"assert ShouldWaitForDevice(False) == True\", \"assert ShouldWaitForDevice(True) == False\", \"assert ShouldWaitForDevice(Fal... | {
"split": "train",
"index": 83756,
"acecode_id": "oss_28679",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to convert freestream static quantities into stagnation quantities in aerospace engineering applications. The function `convert_static_to_stagnation(static_quantities: dict) -> dict` will take a dictionary `static_quantities` containi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_static_to_stagnation({'pressure': 100000, 'temperature': 288, 'velocity': 50}) == {'pressure': 100000 + 0.5 * 1.225 * 50**2, 'temperature': 288 + (50**2 / (2 * 1005)), 'velocity': sqrt(50**2 + 2 * 340 * (288 + (50**2 / (2 * 1005)) - 288))}\", \"asser... | {
"split": "train",
"index": 83757,
"acecode_id": "oss_12571",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function to validate a string input for a specific data field. The function should take two parameters: a string 'input_value' that represents the user input, and an integer 'min_length' that represents the minimum number of characters required fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_input('hello', 5) == True\", \"assert validate_input('hi', 3) == False\", \"assert validate_input('data', 4) == True\", \"assert validate_input('test', 5) == False\", \"assert validate_input('python', 6) == True\", \"assert validate_input('code', 4)... | {
"split": "train",
"index": 83758,
"acecode_id": "oss_32509",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function to generate a Fibonacci sequence of given length n. The function should return a list containing the first n numbers in the Fibonacci sequence, where the sequence starts with 0 and 1. For example, if n is 8, the output should be [0, 1, 1, 2, 3, 5, 8, 13].\nPlea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_fibonacci(1) == [0]\", \"assert generate_fibonacci(2) == [0, 1]\", \"assert generate_fibonacci(3) == [0, 1, 1]\", \"assert generate_fibonacci(4) == [0, 1, 1, 2]\", \"assert generate_fibonacci(5) == [0, 1, 1, 2, 3]\", \"assert generate_fibonacci(6) =... | {
"split": "train",
"index": 83759,
"acecode_id": "evol_17639",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the adjustment of learning rates for a neural network optimizer at specific milestones during training. Write a function `adjust_learning_rate` that takes three parameters: a list of floats `learning_rates`, a list of i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert adjust_learning_rate([0.1, 0.1, 0.1, 0.1], [1, 3], 0.5) == [0.1, 0.05, 0.1, 0.05]\", \"assert adjust_learning_rate([0.5, 0.5], [0], 0.2) == [0.1, 0.5]\", \"assert adjust_learning_rate([1.0, 1.0, 1.0, 1.0, 1.0], [1, 4], 0.3) == [1.0, 0.3, 1.0, 1.0, 0.3]\", \"... | {
"split": "train",
"index": 83760,
"acecode_id": "oss_6773",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python decorator that restricts access to a function based on the value of a context variable. The decorator should raise a `Forbidden` exception if the context is `None`, preventing the decorated function from being executed. Your task is to ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert restricted('value')(lambda: 'allowed')() == 'allowed'\", \"assert restricted('test')(lambda: 'test')() == 'test'\", \"assert restricted('context')(lambda: 'function')() == 'function'\", \"assert restricted('example')(lambda: 'example')() == 'example'\", \"as... | {
"split": "train",
"index": 83761,
"acecode_id": "oss_19950",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a dataset for geospatial analysis. The function should take the following parameters: a string `file` representing the path to the dataset, a string `var` indicating the variable name to process, a dictionary `subarea` ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_geospatial_data('data/file1.nc', 'temperature', {'lat': 10, 'lon': 20}, 0.1, 'temp_src.tif', 'temp_dst.tif') == {'glob_attrs': 'global_info', 'temperature': 'var_info'}\", \"assert process_geospatial_data('data/file2.nc', 'precipitation', {'lat': 15,... | {
"split": "train",
"index": 83762,
"acecode_id": "bigcode_python_fns_13044",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple random selector for a list of games. The function, `get_random_game`, takes a list of game names and an integer `n` as input. It should return a random game name from the list. If the list contains fewer than `n` g... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_random_game(['Chess', 'Monopoly', 'Scrabble'], 2) in ['Chess', 'Monopoly', 'Scrabble']\", \"assert get_random_game(['Tennis', 'Football'], 1) in ['Tennis', 'Football']\", \"assert get_random_game(['Pac-Man'], 1) == 'Pac-Man'\", \"assert get_random_game([... | {
"split": "train",
"index": 83763,
"acecode_id": "bigcode_python_fns_9537",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a specified event name is present in a list of calendar events. The function should take a list of events and a target event name as input and return a boolean indicating whether the target event is found in the list. The e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_event_present(['Meeting', 'Lunch', 'Conference'], 'Lunch') == True\", \"assert is_event_present(['Meeting', 'Lunch', 'Conference'], 'Dinner') == False\", \"assert is_event_present(['Birthday Party', 'Anniversary', 'Graduation'], 'Graduation') == True\", \... | {
"split": "train",
"index": 83764,
"acecode_id": "bigcode_python_fns_31083",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the final value of a variable `cur` after executing a specific code snippet. The initial value of `cur` is set to 0. The code snippet increments `cur` by 2 and then iterates through a while loop equal to the number of static fields specified by t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_final_cur_value(1) == 6\", \"assert calculate_final_cur_value(2) == 10\", \"assert calculate_final_cur_value(3) == 14\", \"assert calculate_final_cur_value(4) == 18\", \"assert calculate_final_cur_value(5) == 22\", \"assert calculate_final_cur_valu... | {
"split": "train",
"index": 83765,
"acecode_id": "oss_3303",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates dealing cards from a standard deck of playing cards. Each card in the deck is represented as a string in the format 'RANKSUIT', where RANK is a single character representing the card's rank (e.g., 'A' for Ace, '2' for 2... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert deal_hand(['AS', '2H', '3D', '4C', '5S', '6H', '7D', '8C', '9S', '10H', 'JH', 'QD', 'KC', 'AH', '2D', '3C', '4S', '5H', '6D', '7C', '8S', '9H', '10D', 'JS', 'QC', 'KD', 'AS', '2H', '3D', '4C', '5S', '6H', '7D', '8C', '9S', '10H', 'JH', 'QD', 'KC', 'AH', '2D'... | {
"split": "train",
"index": 83766,
"acecode_id": "oss_22133",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates updating a topic in a collection. The function should take in three parameters: `collection_item_id` (a string representing the ID of the collection item), `topic_id` (a string representing the ID of the topic), and `re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_topic(collection_item_id='123', topic_id='456', request_kwargs={}) == 'Update successful for collection_item_id: 123, topic_id: 456'\", \"assert update_topic(collection_item_id='abc', topic_id='def', request_kwargs={'key': 'value'}) == 'Update success... | {
"split": "train",
"index": 83767,
"acecode_id": "bigcode_python_fns_18068",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `count_letters(s: str) -> dict` that takes a string input and returns a dictionary where each key is a unique alphabet letter found in the string (case insensitive), and the corresponding value is the number of times that letter appears in the string. Punct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_letters('Hello World') == {'h': 1, 'e': 1, 'l': 3, 'o': 2, 'w': 1, 'r': 1, 'd': 1}\", \"assert count_letters('') == {}\", \"assert count_letters('Hello, World! 123') == {'h': 1, 'e': 1, 'l': 3, 'o': 2, 'w': 1, 'r': 1, 'd': 1}\", \"assert count_letters(... | {
"split": "train",
"index": 83768,
"acecode_id": "evol_11536",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a function `selection_choices(state, selection_type)` that takes in two parameters: a dictionary `state` representing the current state of a graphical user interface (GUI) application, and a string `selection_type` that specifies the type of selection. The dictionary ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert selection_choices({'combo': ['x', 'y', 'z']}, 'combo') == 'x:y:z'\", \"assert selection_choices({'radio': ['a', 'b', 'c']}, 'radio') == 'a:b:c'\", \"assert selection_choices({'check': ['1', '2', '3']}, 'check') == '1:2:3'\", \"assert selection_choices({'comb... | {
"split": "train",
"index": 83769,
"acecode_id": "oss_28492",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two integers m and n, implement a function that returns a matrix (list of lists) of size m x n filled with zeros. The matrix should be represented as a list where each element is a list of n zeros. For example, if m=2 and n=3, the output should be [[0, 0, 0], [0, 0, 0]]. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_zero_matrix(1, 1) == [[0]]\", \"assert create_zero_matrix(2, 2) == [[0, 0], [0, 0]]\", \"assert create_zero_matrix(3, 3) == [[0, 0, 0], [0, 0, 0], [0, 0, 0]]\", \"assert create_zero_matrix(0, 5) == []\", \"assert create_zero_matrix(4, 1) == [[0], [0],... | {
"split": "train",
"index": 83770,
"acecode_id": "bigcode_python_fns_5667",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `evaluate` that takes a string representing a mathematical expression containing non-negative integers, the operators `+`, `-`, `*`, `/`, and parentheses `(`, `)` as input. The function should return the result of evaluating the expression. The expression i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate('5+(3*2)') == 11\", \"assert evaluate('4/(2-1)') == 4\", \"assert evaluate('2 + 3 * 4') == 14\", \"assert evaluate('(1 + 2) * (3 + 4)') == 21\", \"assert evaluate('7 - (3 + 2)') == 2\", \"assert evaluate('9 + 6 / 3') == 11\", \"assert evaluate('((1 ... | {
"split": "train",
"index": 83771,
"acecode_id": "evol_678",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function called `get_supported_extensions` that returns a list of supported file extensions for a certain software. The function should not take any parameters and should return the following supported extensions: '.hip', '.hiplc', '.hipnc', '... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_supported_extensions() == ['.hip', '.hiplc', '.hipnc', '.hip*']\", \"assert isinstance(get_supported_extensions(), list)\", \"assert '.hip' in get_supported_extensions()\", \"assert '.hiplc' in get_supported_extensions()\", \"assert '.hipnc' in get_suppo... | {
"split": "train",
"index": 83772,
"acecode_id": "bigcode_python_fns_22185",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D grid representing a mesh with nodes and faces. Each node is identified by a unique integer index, and nodes can be merged together. Write a function `merge_nodes(mesh: List[List[int]], first_node: int, second_node: int) -> List[List[int]]` that takes in a 2D ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_nodes([[0, 1, 2], [3, 4, 5]], 1, 2) == [[0, 1, 1], [3, 4, 5]]\", \"assert merge_nodes([[0, 1, 2], [3, 4, 5]], 0, 3) == [[0, 1, 2], [0, 4, 5]]\", \"assert merge_nodes([[0, 1], [2, 3]], 0, 1) == [[0, 0], [2, 3]]\", \"assert merge_nodes([[0, 1, 2], [3, 4,... | {
"split": "train",
"index": 83773,
"acecode_id": "bigcode_python_fns_30799",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a program to calculate the acoustic impedance of a material, given its density and speed of sound. The acoustic impedance (Z) is defined as the product of its density (ρ, in kg/m^3) and the speed of sound (c, in m/s) in that material, and it is ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_acoustic_impedance(1000, 343) == 343000\", \"assert calculate_acoustic_impedance(2000, 1540) == 3080000\", \"assert calculate_acoustic_impedance(0, 343) == 'Error: Density and speed of sound must be positive values.'\", \"assert calculate_acoustic_... | {
"split": "train",
"index": 83774,
"acecode_id": "oss_3062",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a given bot name can be successfully imported as a module. The function should take a single string input representing the bot name, and return a boolean value indicating whether the import was successful or not. The import... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_import_bot('valid_bot') == True\", \"assert can_import_bot('bot_with_underscore') == True\", \"assert can_import_bot('bot123') == True\", \"assert can_import_bot('invalid-bot') == False\", \"assert can_import_bot('') == False\", \"assert can_import_bot('... | {
"split": "train",
"index": 83775,
"acecode_id": "bigcode_python_fns_40232",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that retrieves the value associated with a given flag from a list of command-line arguments. The function takes a list of strings `args` representing command-line arguments and a string `flag`. If the flag exists in the list and is fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_argument(['--name', 'Alice', '--age', '30'], '--name') == 'Alice'\", \"assert get_argument(['--name', 'Alice', '--age', '30'], '--age') == '30'\", \"assert get_argument(['--name', 'Alice', '--age', '30'], '--gender') == ''\", \"assert get_argument(['--na... | {
"split": "train",
"index": 83776,
"acecode_id": "bigcode_python_fns_33403",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a specific substring is present in a given string. Write a function named `is_substring_present` that takes two parameters: a string `text` and a string `substring`. The function should return `True` if `substring` is found... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_substring_present('hello world', 'world') == True\", \"assert is_substring_present('hello world', 'hello') == True\", \"assert is_substring_present('hello world', 'test') == False\", \"assert is_substring_present('python programming', 'program') == True\"... | {
"split": "train",
"index": 83777,
"acecode_id": "bigcode_python_fns_17681",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the clearing of a terminal screen represented by a 2D grid of characters. Your function should take two parameters: an integer width and an integer height, and create a screen filled with spaces. The function should ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert clear_terminal(3, 2) == [[' ', ' ', ' '], [' ', ' ', ' ']]\", \"assert clear_terminal(1, 1) == [[' ']]\", \"assert clear_terminal(5, 5) == [[' ', ' ', ' ', ' ', ' '], [' ', ' ', ' ', ' ', ' '], [' ', ' ', ' ', ' ', ' '], [' ', ' ', ' ', ' ', ' '], [' ', ' ',... | {
"split": "train",
"index": 83778,
"acecode_id": "oss_23425",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with validating project details for a company's budget management application. Specifically, you need to implement a function `validate_project_details(project)` that takes a dictionary containing the following keys: 'name', 'start_date', 'end_date', 'budget', an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_project_details({'name': 'Project Alpha', 'start_date': '01/01/2023', 'end_date': '01/31/2023', 'budget': 10000, 'category': 'Engineering'}) == True\", \"assert validate_project_details({'name': 'Project Beta', 'start_date': '02/01/2023', 'end_date'... | {
"split": "train",
"index": 83779,
"acecode_id": "oss_10875",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `sieve_of_eratosthenes(n)` that takes an integer `n` as input and returns a list of all prime numbers less than `n` using the Sieve of Eratosthenes algorithm.\nPlease reason step by step, then write a self-contained Python solution. Give your final program ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sieve_of_eratosthenes(10) == [2, 3, 5, 7]\", \"assert sieve_of_eratosthenes(20) == [2, 3, 5, 7, 11, 13, 17, 19]\", \"assert sieve_of_eratosthenes(1) == []\", \"assert sieve_of_eratosthenes(2) == []\", \"assert sieve_of_eratosthenes(3) == [2]\", \"assert siev... | {
"split": "train",
"index": 83780,
"acecode_id": "evol_30780",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two integers `n` and `w`, followed by `n` lines of input. Each line consists of a string followed by a space and an integer. Your task is to implement a function that takes the values of `n`, `w`, and a list of strings (each containing a string followed by an inte... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_input(5, 10, ['apple 5', 'banana 15', 'orange 8', 'grape 12', 'kiwi 6']) == ['banana', 'grape']\", \"assert process_input(3, 5, ['cat 6', 'dog 4', 'fish 7']) == ['cat', 'fish']\", \"assert process_input(4, 20, ['a 10', 'b 25', 'c 20', 'd 30']) == ['b... | {
"split": "train",
"index": 83781,
"acecode_id": "oss_8335",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks whether a given filename is allowed for download based on a predefined list of restricted file types. The function should take two parameters: a string `filename` which represents the name of the file, and a list of strings `r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_file_allowed('example.txt', ['.exe', '.dll', '.bat']) == True\", \"assert is_file_allowed('document.pdf', ['.exe', '.dll', '.bat']) == True\", \"assert is_file_allowed('script.js', ['.exe', '.dll', '.bat']) == True\", \"assert is_file_allowed('setup.exe',... | {
"split": "train",
"index": 83782,
"acecode_id": "oss_22282",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `sum_of_two_values(a, b)` that takes two input arguments and returns their sum. If either of the inputs is not a numerical value, the function should return the string 'Both input arguments should be numerical values.'\nPlease reason step by step, then writ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_two_values(1, 2) == 3\", \"assert sum_of_two_values(3.5, 2.5) == 6.0\", \"assert sum_of_two_values(-1, 1) == 0\", \"assert sum_of_two_values(0, 0) == 0\", \"assert sum_of_two_values(10, 20) == 30\", \"assert sum_of_two_values(100, 200) == 300\", \"ass... | {
"split": "train",
"index": 83783,
"acecode_id": "evol_5915",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a list of transformations based on a given list of transformation names. The function should accept the following parameters: a list of transformation names `tlist`, a boolean `make_tensor`, a float `flip_prob`, and two flo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_transformations(['hflip', 'augment_stain'], True, 0.5, 0.5, 0.5) == ['hflip', 'augment_stain', 'tensor']\", \"assert generate_transformations(['hflip'], False, 0.5, 0.5, 0.5) == ['hflip']\", \"assert generate_transformations(['augment_stain'], True,... | {
"split": "train",
"index": 83784,
"acecode_id": "bigcode_python_fns_31986",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates input data against a given regular expression and returns a specific error message if the input does not match the pattern. Implement a function `validate_input(input_string: str, pattern: str, error_message: str) -> str` t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_input('f', '^a', 'foo') == 'foo'\", \"assert validate_input('abc', '^a', 'Invalid input') == ''\", \"assert validate_input('1', '^[0-9]+$', 'Not a number') == ''\", \"assert validate_input('abc', '^[0-9]+$', 'Not a number') == 'Not a number'\", \"as... | {
"split": "train",
"index": 83785,
"acecode_id": "bigcode_python_fns_5948",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary representing a histogram where the keys are angles in degrees (0 to 360) and the values are frequencies, write a function `calculate_theta(histogram: Dict[int, int]) -> List[float]` that returns a list of angles converted from degrees to radians. The returned... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_theta({0: 5, 90: 10, 180: 15, 270: 20}) == [0.0, 1.5707963267948966, 3.141592653589793, 4.71238898038469]\", \"assert calculate_theta({30: 1, 150: 2, 270: 3}) == [0.5235987755982988, 2.6179938779914944, 4.71238898038469]\", \"assert calculate_theta... | {
"split": "train",
"index": 83786,
"acecode_id": "oss_1425",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a unique log file name based on a given job ID. The log file name should follow the format 'job_<JOB_ID>_log.tar.gz'. Write a function that takes an integer job ID as input and returns the corresponding log file name as a s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_log_file_name(1) == 'job_1_log.tar.gz'\", \"assert generate_log_file_name(42) == 'job_42_log.tar.gz'\", \"assert generate_log_file_name(100) == 'job_100_log.tar.gz'\", \"assert generate_log_file_name(999) == 'job_999_log.tar.gz'\", \"assert generate... | {
"split": "train",
"index": 83787,
"acecode_id": "bigcode_python_fns_28578",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of strings as input and returns a dictionary where each string is a key and its corresponding value is the count of alphabetic characters in that string. The input list will always contain non-empty strings.\nPlease reason step by step, th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_alphabets_in_strings(['apple', 'banana', 'cherry']) == {'apple': 5, 'banana': 6, 'cherry': 6}\", \"assert count_alphabets_in_strings(['hello', 'world']) == {'hello': 5, 'world': 5}\", \"assert count_alphabets_in_strings(['123', '456']) == {'123': 0, '4... | {
"split": "train",
"index": 83788,
"acecode_id": "evol_26762",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a dictionary of integers and a multiplier as input. The function should return a new dictionary where each value in the original dictionary is multiplied by the given multiplier. If the input dictionary is empty or None, the fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multiply_values({'a': 1, 'b': 2, 'c': 3}, 2) == {'a': 2, 'b': 4, 'c': 6}\", \"assert multiply_values({'x': 10, 'y': 5}, 3) == {'x': 30, 'y': 15}\", \"assert multiply_values({'apple': 4, 'banana': 5}, 0) == {'apple': 0, 'banana': 0}\", \"assert multiply_value... | {
"split": "train",
"index": 83789,
"acecode_id": "bigcode_python_fns_40359",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of strings, `list1` and `list2`, write a function `compute_pairwise_similarities` that computes the similarity score for each pair of strings from `list1` and `list2`. The similarity score between two strings is defined as the length of the longest common substr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_pairwise_similarities(['abc', 'def'], ['abc', 'xyz']) == [1.0, 0.0]\", \"assert compute_pairwise_similarities(['same', 'same'], ['same', 'same']) == [1.0, 1.0]\", \"assert compute_pairwise_similarities(['abcde', 'fghij'], ['xyz', 'pqr']) == [0.0, 0.0... | {
"split": "train",
"index": 83790,
"acecode_id": "bigcode_python_fns_49290",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a list of lists, where each inner list contains a specified number of random strings. Your function should take two arguments: `num_columns` (an integer representing the number of inner lists) and `num_strings` (an integer ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert len(generate_random_strings(5, 5)) == 5\", \"assert all(len(inner) == 5 for inner in generate_random_strings(3, 5))\", \"assert all(3 <= len(s) <= 10 for inner in generate_random_strings(4, 3) for s in inner)\", \"assert generate_random_strings(0, 0) == []\"... | {
"split": "train",
"index": 83791,
"acecode_id": "bigcode_python_fns_993",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a function that resets the position and orientation of a 3D object represented by a tuple of three floats (representing the x, y, and z coordinates) and a tuple of four floats (representing the quaternion rotation). Your task is to implement the function `reset_po... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reset_pose((1.0, 2.0, 3.0), (0.707, 0.0, 0.707, 0.0)) == ((1.0, 2.0, 3.0), (0.707, 0.0, 0.707, 0.0))\", \"assert reset_pose((0.0, 0.0, 0.0), (1.0, 0.0, 0.0, 0.0)) == ((0.0, 0.0, 0.0), (1.0, 0.0, 0.0, 0.0))\", \"assert reset_pose((-1.0, -2.0, -3.0), (0.5, 0.5... | {
"split": "train",
"index": 83792,
"acecode_id": "oss_29026",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of input strings and returns a dictionary containing specific information based on the provided inputs. The function should take a list of strings as input, where the first string is a directory name, the second stri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_input(['my_directory', 'pattern one', 'geom1', 'file1.txt,file2.txt']) == {'directory': 'my_directory', 'pattern': ['pattern', 'one'], 'initial_geometry': 'geom1', 'input_files': ['file1.txt', 'file2.txt']}\", \"assert process_input(['dir', 'pattern ... | {
"split": "train",
"index": 83793,
"acecode_id": "oss_11080",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing a list of event logs related to USB hub devices. Each event is represented as a dictionary with the following keys: `fid_USBHUB_HC`, `fid_USBHUB_Device`, and `fid_DeviceDescription`. Your goal is to create a function that takes a list of these eve... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_usbhub_events([{'fid_USBHUB_HC': 1, 'fid_USBHUB_Device': 2, 'fid_DeviceDescription': 'device1'}]) == [{'fid_USBHUB_HC': -1, 'fid_USBHUB_Device': 3, 'fid_DeviceDescription': 'DEVICE1'}]\", \"assert process_usbhub_events([{'fid_USBHUB_HC': 0, 'fid_USBH... | {
"split": "train",
"index": 83794,
"acecode_id": "oss_1115",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a version comparison function that compares two version strings and determines which one is greater. A version string is a series of numbers separated by periods, such as '1.0.3' or '2.5.1'. The comparison should follow the standard rules for versio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compare_versions('1.0.1', '1.0.2') == -1\", \"assert compare_versions('2.0', '1.9.9') == 1\", \"assert compare_versions('0.1', '0.1.0') == 0\", \"assert compare_versions('1.0.0', '1') == 0\", \"assert compare_versions('1.1', '1.0.9') == 1\", \"assert compare... | {
"split": "train",
"index": 83795,
"acecode_id": "oss_36032",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function `create_book(title: str, author: str, genre: str, description: str) -> dict` that takes in details of a book and returns a dictionary representation of the book with the fields: title, author, genre, and description.\nPlease reason step by step, then write a s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_book('The Great Gatsby', 'F. Scott Fitzgerald', 'Fiction', 'A novel set in the Roaring Twenties.') == {'title': 'The Great Gatsby', 'author': 'F. Scott Fitzgerald', 'genre': 'Fiction', 'description': 'A novel set in the Roaring Twenties.'}\", \"assert... | {
"split": "train",
"index": 83796,
"acecode_id": "evol_4485",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `are_lexical_anagrams(s1: str, s2: str) -> bool` that checks if two given alpha-numeric sequences are lexical anagrams. The function should ignore case sensitivity, punctuation, and whitespace in the input strings. Return True if the two sequences are anagr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert are_lexical_anagrams('listen', 'silent') == True\", \"assert are_lexical_anagrams('Triangle', 'Integral') == True\", \"assert are_lexical_anagrams('A gentleman', 'Elegant man') == True\", \"assert are_lexical_anagrams('School master', 'The classroom') == Tru... | {
"split": "train",
"index": 83797,
"acecode_id": "evol_34128",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with analyzing a collection of XML strings that represent object detection annotations. Each XML string contains multiple `<object>` tags, each with a corresponding `<name>` tag that specifies the label of the detected object. Your goal is to implement a function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_objects(['<annotation><object><name>cat</name></object><object><name>dog</name></object></annotation>']) == {'cat': 1, 'dog': 1}\", \"assert count_objects(['<annotation><object><name>cat</name></object></annotation>', '<annotation><object><name>cat</na... | {
"split": "train",
"index": 83798,
"acecode_id": "oss_23611",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary that maps device error codes to their corresponding cloud error codes. Implement a function `translate_error_code(error_code: str) -> str` that takes a string representing a device error code and returns the corresponding cloud error code if it exists... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert translate_error_code('ERR001') == 'CLOUD_ERR_A'\", \"assert translate_error_code('ERR002') == 'CLOUD_ERR_B'\", \"assert translate_error_code('ERR003') == 'CLOUD_ERR_C'\", \"assert translate_error_code('ERR004') == 'ERR004'\", \"assert translate_error_code('E... | {
"split": "train",
"index": 83799,
"acecode_id": "bigcode_python_fns_23707",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.