data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a Coding Sequence (CDS) Component and its corresponding DNA Sequence. Write a function `generate_cds(identity: str, sequence: str) -> Tuple[str, str]` that takes in two parameters: `identity`, which is a string representing... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_cds('gene1', 'ATGC') == ('gene1', 'gene1_seq')\", \"assert generate_cds('gene2', 'GCTA') == ('gene2', 'gene2_seq')\", \"assert generate_cds('gene3', 'TTAGC') == ('gene3', 'gene3_seq')\", \"assert generate_cds('gene4', 'CGTAA') == ('gene4', 'gene4_se... | {
"split": "train",
"index": 77500,
"acecode_id": "bigcode_python_fns_25594",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D binary mask represented as a list of lists, where each element is either 0 or 1. Your task is to implement a function `binarise_mask(mask: List[List[int]]) -> List[List[int]]` that takes this binary mask and returns a new binary mask where all the elements ar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binarise_mask([[0, 0], [0, 0]], 1) == [[0, 0], [0, 0]]\", \"assert binarise_mask([[1, 1], [0, 0]], 1) == [[1, 1], [0, 0]]\", \"assert binarise_mask([[1, 1], [1, 1]], 2) == [[1, 1], [1, 1]]\", \"assert binarise_mask([[0, 1], [1, 1]], 2) == [[0, 1], [1, 1]]\",... | {
"split": "train",
"index": 77501,
"acecode_id": "bigcode_python_fns_46144",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating query keypoints for matching in images based on specified modes. Write a Python function `generate_query_kpts(num_pts, mode, h, w)` that generates candidate query keypoints based on the specified mode. The function should support two modes: 'rando... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_query_kpts(4, 'random', 100, 100) != []\", \"assert len(generate_query_kpts(4, 'random', 100, 100)) == 4\", \"assert len(generate_query_kpts(4, 'grid', 100, 100)) == 4\", \"assert all(0 <= pt[0] < 100 and 0 <= pt[1] < 100 for pt in generate_query_kp... | {
"split": "train",
"index": 77502,
"acecode_id": "oss_37204",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "John is evaluating a job opportunity where he can earn a total compensation of 'total_compensation' dollars for working 'total_hours' hours. Write a function `hourly_wage(total_compensation: float, total_hours: float) -> float` that calculates and returns John's hourly wage in ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hourly_wage(49, 3.5) == 14.0\", \"assert hourly_wage(0, 1) == 0.0\", \"assert hourly_wage(100, 0) == 0.0\", \"assert hourly_wage(75, 5) == 15.0\", \"assert hourly_wage(150, 10) == 15.0\", \"assert hourly_wage(200, 8) == 25.0\", \"assert hourly_wage(30, 2) ==... | {
"split": "train",
"index": 77503,
"acecode_id": "evol_1314",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the creation or updating of a DNS record in a DNS management system. The function should take the following parameters: a list of DNS records, a record name, a record type, a record value, and a hosted zone name. If a DNS r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_or_update_dns_records([], 'www.example.com.', 'A', '192.0.2.1', 'example.com.') == [{'Name': 'www.example.com.', 'Type': 'A', 'Value': '192.0.2.1'}]\", \"assert create_or_update_dns_records([{'Name': 'www.example.com.', 'Type': 'A', 'Value': '192.0.2.... | {
"split": "train",
"index": 77504,
"acecode_id": "bigcode_python_fns_7118",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing various subsystems of a system, where each key is the name of the subsystem and the value is another dictionary containing a key called 'subsystemStatus' that can either be 'OK' or 'FAILED'. Write a function `all_results_failed(subsystems... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert all_results_failed({'subsystem1': {'subsystemStatus': 'FAILED'}, 'subsystem2': {'subsystemStatus': 'FAILED'}}) == True\", \"assert all_results_failed({'subsystem1': {'subsystemStatus': 'OK'}, 'subsystem2': {'subsystemStatus': 'FAILED'}}) == False\", \"assert... | {
"split": "train",
"index": 77505,
"acecode_id": "bigcode_python_fns_27870",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_patient_record` that takes the following parameters: `name: str`, `age: int`, `gender: str`, `disease_history: str`, `current_disease: str`, `treatment_plan: str`, and `user_id: int`. The function should create a new patient record and return a dict... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_patient_record('John Doe', 30, 'Male', 'None', 'Flu', 'Rest and hydration', 1) == {'name': 'John Doe', 'age': 30, 'gender': 'Male', 'disease_history': 'None', 'current_disease': 'Flu', 'treatment_plan': 'Rest and hydration', 'user_id': 1}\", \"assert ... | {
"split": "train",
"index": 77506,
"acecode_id": "evol_34308",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the detection and tracking of hands based on a list of landmark positions. Your function should take a list of tuples, where each tuple represents the (x, y) coordinates of a hand landmark, and return the number of dete... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_detected_hands([(0, 0), (1, 1), (2, 2), (3, 3), (4, 4)]) == 1\", \"assert count_detected_hands([(0, 0), (1, 1), (2, 2)]) == 0\", \"assert count_detected_hands([(0, 0), (1, 1), (2, 2), (3, 3), (4, 4), (5, 5)]) == 1\", \"assert count_detected_hands([(0, ... | {
"split": "train",
"index": 77507,
"acecode_id": "oss_11198",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the behavior of a command-line interface (CLI) tool. Your function should accept a boolean parameter `test_mode`. When `test_mode` is set to True, the function should return the string 'Running in test mode'. When `test... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process(True) == 'Running in test mode'\", \"assert process(False) == 'Normal mode'\", \"assert process(True) == 'Running in test mode'\", \"assert process(False) == 'Normal mode'\", \"assert process(True) == 'Running in test mode'\", \"assert process(False)... | {
"split": "train",
"index": 77508,
"acecode_id": "oss_17136",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `median(l: list) -> float` that computes the median of numbers in a given list without sorting it. The list may contain negative integers, floating-point values, as well as tuples with both odd and even counts of numbers. The function should handle these ca... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert median([3, 1, 2, 4, 5]) == 3\", \"assert median([2.5, -3.7, 5.1]) == 2.5\", \"assert median([1, 3, 5, 7]) == 4.0\", \"assert median([1, 2, 3, 4, 5, 6]) == 3.5\", \"assert median([-1, -2, -3, -4]) == -2.5\", \"assert median([-5, -1, 0, 2, 5]) == 0\", \"assert... | {
"split": "train",
"index": 77509,
"acecode_id": "evol_6654",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with splitting a dataset into training, validation, and test sets based on a specified ratio. Given an array of data points and a corresponding array of labels, write a function `split_dataset(data: List[int], labels: List[int], train_ratio: float, valid_ratio: f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert split_dataset([1, 2, 3, 4, 5], [0, 1, 0, 1, 0], 0.4, 0.2) == ([1, 2], [3], [4, 5])\", \"assert split_dataset([10, 20, 30, 40, 50, 60, 70], [1, 2, 1, 2, 1, 2, 1], 0.5, 0.25) == ([10, 20, 30], [40], [50, 60, 70])\", \"assert split_dataset([5, 10, 15, 20, 25], ... | {
"split": "train",
"index": 77510,
"acecode_id": "bigcode_python_fns_19041",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Write a function `count_vowels(text: str) -> int` that takes a string `text` and returns the number of vowels present in the string. Vowels are defined as the characters 'a', 'e', 'i', 'o', 'u' (both lowercase and uppercase).\nPlease reason step by step, then write a self-conta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_vowels('Hello World') == 3\", \"assert count_vowels('Python Programming') == 4\", \"assert count_vowels('AEIOU') == 5\", \"assert count_vowels('xyz') == 0\", \"assert count_vowels('') == 0\", \"assert count_vowels('12345') == 0\", \"assert count_vowels... | {
"split": "train",
"index": 77511,
"acecode_id": "evol_22207",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a simple email sending system in Python. Your objective is to implement a function that tracks the number of emails sent. The function should take a list of email messages as input and return the total number of messages sent. The email messages c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert send_messages(['email1@example.com', 'email2@example.com', 'email3@example.com']) == 3\", \"assert send_messages([]) == 0\", \"assert send_messages(['email1@example.com']) == 1\", \"assert send_messages(['email1@example.com', 'email2@example.com']) == 2\", \... | {
"split": "train",
"index": 77512,
"acecode_id": "oss_22458",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function `generate_primes(n: int) -> List[int]` that generates the first `n` prime numbers and returns them in reverse order. A prime number is a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. Your solution should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_primes(1) == [2]\", \"assert generate_primes(2) == [3, 2]\", \"assert generate_primes(3) == [5, 3, 2]\", \"assert generate_primes(4) == [7, 5, 3, 2]\", \"assert generate_primes(5) == [11, 7, 5, 3, 2]\", \"assert generate_primes(6) == [13, 11, 7, 5, ... | {
"split": "train",
"index": 77513,
"acecode_id": "evol_8665",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `track_temperatures(operations: List[Tuple[str, Union[str, int]]]) -> List[Union[str, float]]` that processes a list of operations to track temperatures for days of the week. The operations can either be adding a temperature for a specific day (in the form ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert track_temperatures([('add_temp', 'Monday', 20), ('get_average_temp', 'Monday')]) == [20.0]\", \"assert track_temperatures([('add_temp', 'Monday', 20), ('add_temp', 'Monday', 22), ('get_average_temp', 'Monday')]) == [21.0]\", \"assert track_temperatures([('ad... | {
"split": "train",
"index": 77514,
"acecode_id": "evol_24311",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that determines the appropriate authentication method based on given input parameters. The function should take three parameters: `ssh_username`, `ssh_password`, and `ssh_key_filepath`, which represent the username for SSH, the password f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert determine_auth_method('user', 'pass', None) == 'username_password'\", \"assert determine_auth_method('user', None, '/path/to/key') == 'private_key'\", \"assert determine_auth_method(None, 'pass', '/path/to/key') == 'private_key'\", \"assert determine_auth_me... | {
"split": "train",
"index": 77515,
"acecode_id": "oss_36281",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a Python function that processes a list of strings, each representing a chapter title from a book. Your function should perform the following operations: 1. Return the first chapter title from the list. 2. Return a list of all chapter titles that sta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_chapter_titles(['The Beginning', 'Chapter One', 'The Journey']) == ('The Beginning', ['The Beginning', 'The Journey'])\", \"assert process_chapter_titles(['Introduction', 'The Overview', 'The Conclusion']) == ('Introduction', ['The Overview', 'The Co... | {
"split": "train",
"index": 77516,
"acecode_id": "oss_24385",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, implement a function `find_palindromes(input_list)` that returns a new list containing only the strings that are palindromes. A palindrome is defined as a word, phrase, number, or other sequence of characters that reads the same forward and backward, ig... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_palindromes(['level', 'Anna', 'hello', 'A man a plan a canal Panama', 'racecar', '12321']) == ['level', 'Anna', 'A man a plan a canal Panama', 'racecar', '12321']\", \"assert find_palindromes([]) == []\", \"assert find_palindromes(['']) == ['']\", \"ass... | {
"split": "train",
"index": 77517,
"acecode_id": "oss_18899",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to handle binary data storage in memory. The function should simulate writing and reading binary data without using external files. Your function will take the following parameters: \n- `n`: An integer representing the number of sampl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binary_data_handler(3, 10, 20, 30, [b'abc', b'def', b'ghi']) == [b'\\\\x03\\\\x00\\\\x00\\\\x00\\\\n\\\\x00\\\\x00\\\\x00\\\\x14\\\\x00\\\\x00\\\\x00\\\\x1e\\\\x00\\\\x00\\\\x00', b'abc', b'def', b'ghi']\", \"assert binary_data_handler(0, 1, 2, 3, []) == [b'... | {
"split": "train",
"index": 77518,
"acecode_id": "oss_9669",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates writing an array of values to a device register. The function should take in the following parameters: a string representing the register name, an integer representing the number of values to write, and a list of floating-p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert write_register_values('register1', 3, [1.0, 2.0, 3.0]) == 'Values written successfully.'\", \"assert write_register_values('register2', 2, [4.5, 5.5]) == 'Values written successfully.'\", \"assert write_register_values('my_register', 1, [10.0]) == 'Values wr... | {
"split": "train",
"index": 77519,
"acecode_id": "bigcode_python_fns_10120",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `extract_double_vowel_words(words: List[str]) -> List[str]` that takes a list of strings and returns a new list containing only the words that have at least one occurrence of a double vowel (i.e., two consecutive vowels). A vowel is defined as one of the charac... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_double_vowel_words(['sky', 'fly', 'try']) == []\", \"assert extract_double_vowel_words(['zoo', 'boo', 'do']) == ['zoo', 'boo']\", \"assert extract_double_vowel_words(['strength', 'length', 'depth']) == []\", \"assert extract_double_vowel_words(['see'... | {
"split": "train",
"index": 77520,
"acecode_id": "evol_18286",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function that checks if the given string of alphanumeric characters can be rearranged to form a palindrome. A palindrome is a word, phrase, number, or other sequence of characters that reads the same backward as forward. The function should return True if it can be ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_form_palindrome('aabb') == True\", \"assert can_form_palindrome('abc') == False\", \"assert can_form_palindrome('A man a plan a canal Panama') == True\", \"assert can_form_palindrome('aaab') == False\", \"assert can_form_palindrome('racecar') == True\", ... | {
"split": "train",
"index": 77521,
"acecode_id": "evol_35813",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to generate a configuration for batch plots based on specified parameters. The function `generate_plot_config` takes in several optional parameters, each with a default value. The parameters are as follows: \n- `ages`: A list of age g... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_plot_config() == {'ages': ['default_age'], 'causes': ['default_cause'], 'countries': ['default_country'], 'sexes': ['default_sex'], 'settings': ['default_setting'], 'types': ['default_type']}\", \"assert generate_plot_config(ages=['0-18']) == {'ages... | {
"split": "train",
"index": 77522,
"acecode_id": "oss_23756",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `max_value(n)` that calculates the highest possible numerical value that can be stored in an n-bit byte for any given n. The function should take an integer n as input and return the corresponding maximum numerical value. If the input is not a positive inte... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_value(1) == 1\", \"assert max_value(2) == 3\", \"assert max_value(3) == 7\", \"assert max_value(4) == 15\", \"assert max_value(5) == 31\", \"assert max_value(8) == 255\", \"assert max_value(16) == 65535\", \"assert max_value(32) == 4294967295\", \"assert... | {
"split": "train",
"index": 77523,
"acecode_id": "evol_22820",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a string as input and returns the reverse of that string. The function should handle all characters in the string, including spaces and punctuation.\nPlease reason step by step, then write a self-contained Python solution. Give your final program... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert mirror_image('hello') == 'olleh'\", \"assert mirror_image('world') == 'dlrow'\", \"assert mirror_image('') == ''\", \"assert mirror_image('Python') == 'nohtyP'\", \"assert mirror_image('12345') == '54321'\", \"assert mirror_image('!@#$%') == '%$#@!'\", \"ass... | {
"split": "train",
"index": 77524,
"acecode_id": "evol_22041",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a Python function that computes the factorial of a given non-negative integer using recursion. The function should raise an error if the input is a negative integer or if the input is not an integer. The function should return the factorial value for valid inputs.\nPl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert factorial(0) == 1\", \"assert factorial(1) == 1\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", \"assert factorial(5) == 120\", \"assert factorial(6) == 720\", \"assert factorial(7) == 5040\", \"assert factorial(... | {
"split": "train",
"index": 77525,
"acecode_id": "evol_25113",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of NCBI Taxonomy IDs, write a function that returns a list of their corresponding scientific names. If a Taxonomy ID does not exist in the predefined mapping, return '<UNKNOWN>' for that ID. The predefined mapping is as follows: {1: 'cellular organisms', 2: 'Eukary... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_taxnames([1, 2, 9606]) == ['cellular organisms', 'Eukaryota', 'Homo sapiens']\", \"assert get_taxnames([10090, 10116, 9999]) == ['Mus musculus', 'Rattus norvegicus', '<UNKNOWN>']\", \"assert get_taxnames([12345]) == ['<UNKNOWN>']\", \"assert get_taxnames... | {
"split": "train",
"index": 77526,
"acecode_id": "bigcode_python_fns_26009",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a Python function that takes a list of integers and returns a new list containing only the even numbers from the original list, preserving the order of their appearance. The function should be named `filter_even_numbers`.\nPlease reason step by step, then write a self... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 13, 15, 18, 20]) == [10, 18, 20]\", \"assert filter_even_numbers([0, 1, 2, 3]) == [0, 2]\", \"assert filter_even_numbers([-2, -1, 0, 1, 2]) == [-2, 0, 2]\", \"assert filter_e... | {
"split": "train",
"index": 77527,
"acecode_id": "evol_24561",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a user-defined function that calculates the factorial of a non-negative integer. However, for negative integers, interpret the factorial as the reciprocal of the factorial of the absolute value of that integer (i.e., -n! = 1/n!). Implement this function and ensure it is ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert factorial(0) == 1\", \"assert factorial(1) == 1\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", \"assert factorial(5) == 120\", \"assert factorial(10) == 3628800\", \"assert factorial(-1) == 1.0\", \"assert facto... | {
"split": "train",
"index": 77528,
"acecode_id": "evol_6830",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of layers in a neural network, where each layer is represented as a dictionary. Each dictionary contains the following keys: 'type' (string), 'in_channels' (int), 'out_channels' (int), 'kernel_size' (int), 'strid... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_layers([]) == (0, 0, 3)\", \"assert process_layers([{'type': 'conv', 'in_channels': 3, 'out_channels': 16, 'kernel_size': 3, 'stride': 1, 'padding': 1}]) == (1, 0, 16)\", \"assert process_layers([{'type': 'pool', 'kernel_size': 2, 'stride': 2}]) == (... | {
"split": "train",
"index": 77529,
"acecode_id": "oss_30030",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves a specific configuration setting from a predefined dictionary of configuration variables. The input to the function will be a string representing the key of the configuration variable you wish to retrieve. The function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert retrieve_config_value('database') == 'mysql'\", \"assert retrieve_config_value('host') == 'localhost'\", \"assert retrieve_config_value('port') == 3306\", \"assert retrieve_config_value('username') == 'admin'\", \"assert retrieve_config_value('password') == ... | {
"split": "train",
"index": 77530,
"acecode_id": "bigcode_python_fns_3088",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a string as input and returns a list of unique vowels found in the string, in the order they first appear. The vowels are 'a', 'e', 'i', 'o', and 'u'. The comparison should be case-insensitive. If no vowels are found, return an empty list.\nPleas... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_vowels('Hello World') == ['e', 'o']\", \"assert find_vowels('AEIOU') == ['a', 'e', 'i', 'o', 'u']\", \"assert find_vowels('') == []\", \"assert find_vowels('abcdefghijklmnopqrstuvwxyz') == ['a', 'e', 'i', 'o', 'u']\", \"assert find_vowels('1234!@#$') ==... | {
"split": "train",
"index": 77531,
"acecode_id": "evol_30513",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a string of text that contains various phone numbers in different formats. Write a function that extracts all valid phone numbers from the string. The phone numbers may appear in formats such as (202) 555-0123, 703-555-9876, 555.222.3456, and 1 555 333 4444. Your ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_phone_numbers('Call me at (202) 555-0123 or 703-555-9876.') == ['(202) 555-0123', '703-555-9876']\", \"assert extract_phone_numbers('My number is 555.222.3456 and my work number is 1 555 333 4444.') == ['555.222.3456', '1 555 333 4444']\", \"assert e... | {
"split": "train",
"index": 77532,
"acecode_id": "evol_8141",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary where the keys are strings and the values are single characters, write a function that reverses the dictionary such that the values become the keys and the keys are grouped in a list under their respective values. If a value appears multiple times in the orig... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_dict({'AB04a':'b', 'AB04b': 'b', 'AB04c':'b', 'CC04x': 'c'}) == {'b': ['AB04a', 'AB04b', 'AB04c'], 'c': 'CC04x'}\", \"assert reverse_dict({'key1':'a', 'key2':'a', 'key3':'b'}) == {'a': ['key1', 'key2'], 'b': 'key3'}\", \"assert reverse_dict({'x':'y',... | {
"split": "train",
"index": 77533,
"acecode_id": "bigcode_python_fns_43951",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers that represent the ages of people in a group. Your task is to implement a function that returns the average age of the group. The average age should be calculated as the sum of all ages divided by the number of people in the group. If the list i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_age([20, 30, 40]) == 30.0\", \"assert average_age([10, 20, 30, 40, 50]) == 30.0\", \"assert average_age([5]) == 5.0\", \"assert average_age([]) == 0\", \"assert average_age([1, 2, 3]) == 2.0\", \"assert average_age([100, 200, 300, 400]) == 250.0\", \... | {
"split": "train",
"index": 77534,
"acecode_id": "bigcode_python_fns_2125",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `primes_in_range(C, D)` that returns a list of all prime numbers within the inclusive range from C to D. The function should handle cases where C is greater than D by returning an empty list. A prime number is defined as a natural number greater than 1 that... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert primes_in_range(1, 30) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29]\", \"assert primes_in_range(10, 20) == [11, 13, 17, 19]\", \"assert primes_in_range(20, 30) == [23, 29]\", \"assert primes_in_range(1, 1) == []\", \"assert primes_in_range(0, 5) == [2, 3, 5]\", \... | {
"split": "train",
"index": 77535,
"acecode_id": "evol_19241",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer index i (0 ≤ i ≤ 255), write a function `get_rgb_color(i)` that returns the corresponding 24-bit color in RGB888 format. The function should determine the color based on a specific color lookup table: there are 216 web-safe colors, 36 additional colors targetin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_rgb_color(0) == 0x000000\", \"assert get_rgb_color(1) == 0x000033\", \"assert get_rgb_color(2) == 0x000066\", \"assert get_rgb_color(3) == 0x000099\", \"assert get_rgb_color(4) == 0x0000cc\", \"assert get_rgb_color(5) == 0x0000ff\", \"assert get_rgb_colo... | {
"split": "train",
"index": 77536,
"acecode_id": "bigcode_python_fns_10757",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, return a list of indices that represent the order of the original list when it is sorted in ascending order. For example, if the input list is ['c', 'a', 'b'], the output should be [1, 2, 0] because 'a' (index 1) comes first, 'b' (index 2) comes next, a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert order(['c', 'a', 'b']) == [1, 2, 0]\", \"assert order(['zebra', 'monkey', 'lion', 'apple']) == [3, 2, 1, 0]\", \"assert order(['grape', 'kiwi', 'grapefruit', 'banana']) == [3, 0, 2, 1]\", \"assert order(['one', 'two', 'three', 'four']) == [3, 0, 2, 1]\", \"a... | {
"split": "train",
"index": 77537,
"acecode_id": "bigcode_python_fns_39843",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of package names, implement a function that retrieves all nodelet names from those packages. Each package can return a fixed list of nodelets. The input will be a list of package names, and the output should be a list of all nodelet names concatenated together with... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_nodelets(['package1', 'package2']) == ['nodeletA', 'nodeletB', 'nodeletC']\", \"assert get_nodelets(['package2', 'package3']) == ['nodeletB', 'nodeletC', 'nodeletD']\", \"assert get_nodelets(['package1', 'package3']) == ['nodeletA', 'nodeletB', 'nodeletD... | {
"split": "train",
"index": 77538,
"acecode_id": "bigcode_python_fns_42387",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `data_formatter(data: dict, field_name: str) -> str` that formats data from a given dictionary and validates if a required field is provided. The function takes in two parameters: a dictionary `data` which contains various fields and thei... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert data_formatter({'name': 'John Doe', 'age': 30, 'email': None}, 'name') == 'John Doe'\", \"assert data_formatter({'name': 'Alice', 'age': None, 'email': 'alice@example.com'}, 'age') == ''\", \"assert data_formatter({'product': 'Laptop', 'price': 999.99, 'stoc... | {
"split": "train",
"index": 77539,
"acecode_id": "oss_24634",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing snapshots in a storage system. Given a cluster name and a path, implement a function that determines whether a particular snapshot should be deleted based on whether the deletion is recursive or not. The function should take three parameters: 'clust... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_snapshots_to_delete('clusterA', '/snapshots/image1', '0') == ['/snapshots/image1']\", \"assert get_snapshots_to_delete('clusterA', '/snapshots/image1', '1') == ['/snapshots/image1', '/snapshots/image1/version1', '/snapshots/image1/version2']\", \"assert ... | {
"split": "train",
"index": 77540,
"acecode_id": "bigcode_python_fns_2786",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given an array of numerical values called `obj`. Your task is to determine the outcome of a decision tree traversal based on specific conditions defined on the elements of the array. Implement a function `decision_tree_outcome(obj)` that returns True or False based on t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decision_tree_outcome([3, 1, 0, 0, 0, 0, 0, 0, 1, 1]) == True\", \"assert decision_tree_outcome([1, 1, 0, 0, 0, 0, 0, 0, -1, 1]) == True\", \"assert decision_tree_outcome([2, 2, 0, 0, 0, 0, 0, 0, 0, 2]) == True\", \"assert decision_tree_outcome([2, 2, 0, 0, ... | {
"split": "train",
"index": 77541,
"acecode_id": "oss_11147",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a URL-encoded JSON string, your task is to implement a function `decode_url_json_string(json_string: str) -> dict` that decodes the URL-encoded string and parses it into a Python dictionary. The input `json_string` is guaranteed to be a valid URL-encoded JSON string. You ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decode_url_json_string('%7B%22key%22%3A%20%22value%22%7D') == {'key': 'value'}\", \"assert decode_url_json_string('%7B%22name%22%3A%20%22Alice%22%2C%20%22age%22%3A%2030%7D') == {'name': 'Alice', 'age': 30}\", \"assert decode_url_json_string('%7B%22fruit%22%3... | {
"split": "train",
"index": 77542,
"acecode_id": "bigcode_python_fns_28924",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `optimize_swarm` that takes in an integer `n_particles` representing the number of particles in a swarm and a list of tuples `initial_positions`, where each tuple contains two integers representing the initial x and y coordinates of the particles. The funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert optimize_swarm(5, [(1, 2), (3, 4), (5, 6), (7, 8), (9, 10)]) == [(0, 0), (0, 0), (0, 0), (0, 0), (0, 0)]\", \"assert optimize_swarm(3, [(10, 10), (20, 20), (30, 30)]) == [(0, 0), (0, 0), (0, 0)]\", \"assert optimize_swarm(10, [(2, 3), (4, 5), (6, 7), (8, 9),... | {
"split": "train",
"index": 77543,
"acecode_id": "evol_5736",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing the scores of students in a class, write a function `compute_average_score(scores: List[int]) -> float` that returns the average score of the students. The average score should be calculated as the total sum of scores divided by the number ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_average_score([90, 80, 70]) == 80.0\", \"assert compute_average_score([100, 95, 85, 90]) == 92.5\", \"assert compute_average_score([0]) == 0.0\", \"assert compute_average_score([]) == 0.0\", \"assert compute_average_score([50, 60, 70, 80, 90]) == 70.... | {
"split": "train",
"index": 77544,
"acecode_id": "bigcode_python_fns_30490",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of integers, list_1 and list_2. Your task is to implement a function that combines these two lists into one and sorts the resulting list in ascending order, in place, without using any built-in sort function. The function should return the sorted combine... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert combine_and_sort([2, 4, 6], [3, 5, 7]) == [2, 3, 4, 5, 6, 7]\", \"assert combine_and_sort([9, 5, 6], [3, 11, 2]) == [2, 3, 5, 6, 9, 11]\", \"assert combine_and_sort([], []) == []\", \"assert combine_and_sort([1], []) == [1]\", \"assert combine_and_sort([], [... | {
"split": "train",
"index": 77545,
"acecode_id": "evol_17549",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `generate_first_n_primes(n: int) -> List[int]` that generates the first `n` prime numbers, where a prime number is defined as a natural number greater than 1 that has no positive divisors other than 1 and itself. Your function should return a list of these prim... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_first_n_primes(0) == []\", \"assert generate_first_n_primes(1) == [2]\", \"assert generate_first_n_primes(2) == [2, 3]\", \"assert generate_first_n_primes(3) == [2, 3, 5]\", \"assert generate_first_n_primes(4) == [2, 3, 5, 7]\", \"assert generate_fi... | {
"split": "train",
"index": 77546,
"acecode_id": "evol_10107",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to calculate the maximum accepted length of application protocol data units (APDUs) and the maximum accepted number of segments for a communication protocol. The function should take in a list of test cases, where each test case is re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_max_values([(1500, 10), (2000, 15), (1800, 12)]) == (2000, 15)\", \"assert calculate_max_values([(100, 1), (200, 2), (50, 3)]) == (200, 3)\", \"assert calculate_max_values([(0, 0), (0, 0)]) == (0, 0)\", \"assert calculate_max_values([(500, 5), (600... | {
"split": "train",
"index": 77547,
"acecode_id": "oss_22677",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `compute_square_root(value)` that takes a numerical value as input and returns the square root of that value. If the input value is a negative number, the function should raise a custom exception `NegativeNumberError` with the message 'Square roots of negat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_square_root(4) == 2.0\", \"assert compute_square_root(0) == 0.0\", \"assert compute_square_root(9) == 3.0\", \"assert compute_square_root(2.25) == 1.5\", \"assert compute_square_root(16.0) == 4.0\", \"assert compute_square_root(1) == 1.0\", \"assert ... | {
"split": "train",
"index": 77548,
"acecode_id": "evol_30448",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Design a class 'Manager' that inherits from a class 'Employee'. The 'Employee' class should have attributes 'name', 'age', and 'salary'. The 'Manager' class should inherit from 'Employee' and include an additional attribute 'experience'. Implement a method to return a summary o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert Manager('Alice', 35, 70000, 12).summary() == 'Name: Alice, Age: 35, Salary: 70000, Experience: 12 years'\", \"assert Manager('Bob', 45, 90000, 20).summary() == 'Name: Bob, Age: 45, Salary: 90000, Experience: 20 years'\", \"assert Manager('Charlie', 50, 12000... | {
"split": "train",
"index": 77549,
"acecode_id": "evol_13383",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing a sequence of client IDs. Your task is to implement a function `validate_clients(client_ids: List[int], mode: str) -> str` that validates the client IDs based on a specified mode. The function should return 'Valid' if the client IDs... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_clients([1, 2, 3], 'otp') == 'Valid'\", \"assert validate_clients([1, 2, 3, 1], 'totp') == 'Invalid'\", \"assert validate_clients([1, 2, 3], 'hotp') == 'Valid'\", \"assert validate_clients([2, 3, 5], 'pwhash') == 'Valid'\", \"assert validate_clients... | {
"split": "train",
"index": 77550,
"acecode_id": "bigcode_python_fns_17555",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a byte array as input and reverses it without utilizing any pre-existing reverse functions. The function should return the reversed byte array.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a sin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_byte_array(bytes('hello world', 'utf-8')) == bytearray(b'dlrow olleh')\", \"assert reverse_byte_array(bytes('abc', 'utf-8')) == bytearray(b'cba')\", \"assert reverse_byte_array(bytes('', 'utf-8')) == bytearray(b'')\", \"assert reverse_byte_array(byte... | {
"split": "train",
"index": 77551,
"acecode_id": "evol_34414",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates a command-line utility's flag usage information. The function should take a list of flags as input and return the corresponding usage information for each flag. The predefined usage information for the flags is as fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_usage_info(['-h']) == ['Display help information']\", \"assert get_usage_info(['--help']) == ['Display help information']\", \"assert get_usage_info(['--version']) == ['Display version information']\", \"assert get_usage_info(['-h', '--help']) == ['Displ... | {
"split": "train",
"index": 77552,
"acecode_id": "oss_24310",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, implement a function `remove_duplicates` that removes all duplicate strings from the list and returns a new list containing only unique strings. The order of the unique strings in the resulting list should be the same as their first occurrence in the or... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_duplicates(['a', 'b', 'a', 'c', 'c', 'd']) == ['a', 'b', 'c', 'd']\", \"assert remove_duplicates(['apple', 'banana', 'apple', 'orange']) == ['apple', 'banana', 'orange']\", \"assert remove_duplicates(['cat', 'dog', 'cat', 'mouse', 'dog']) == ['cat', '... | {
"split": "train",
"index": 77553,
"acecode_id": "evol_30123",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `huffman_codes(characters: List[str], frequencies: List[int]) -> Dict[str, str]` that takes a list of characters and their corresponding frequencies, and returns a dictionary mapping each character to its Huffman code. Each character appears exactly once in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert huffman_codes(['u', 'v', 'w', 'x'], [1, 1, 1, 1]) == {'u': '00', 'v': '01', 'w': '10', 'x': '11'}\", \"assert huffman_codes(['a', 'b'], [10, 1]) == {'b': '0', 'a': '1'}\", \"assert huffman_codes(['1', '2', '3', '4'], [1, 1, 1, 1]) == {'1': '00', '2': '01', '... | {
"split": "train",
"index": 77554,
"acecode_id": "evol_4639",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers where each integer represents a unique entity's ID. Your task is to implement a function that takes this list and returns the count of unique entities after setup, ensuring no duplicates are counted. The function should ignore any duplicates in ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_entities([1, 2, 3, 4, 5]) == 5\", \"assert count_unique_entities([1, 1, 1, 1, 1]) == 1\", \"assert count_unique_entities([1, 2, 2, 3]) == 3\", \"assert count_unique_entities([]) == 0\", \"assert count_unique_entities([10, 20, 30, 10, 20]) == 3\"... | {
"split": "train",
"index": 77555,
"acecode_id": "bigcode_python_fns_29789",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `create_wsgi_application()` that simulates the creation of a WSGI application. The function should not take any parameters and should return a string indicating that a WSGI application has been created. Additionally, it should registe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_wsgi_application() == 'WSGI application created and core modules registered.'\", \"assert create_wsgi_application() == 'WSGI application created and core modules registered.'\", \"assert create_wsgi_application() == 'WSGI application created and core ... | {
"split": "train",
"index": 77556,
"acecode_id": "bigcode_python_fns_20635",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks if a list of file paths is valid. A file path is considered valid if it starts with a directory (e.g., '/home/user/') and ends with a file name (e.g., 'file.txt'). The function should return a list of boolean values indica... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_file_paths(['/home/user/file.txt', '/invalid/path/', 'file.txt']) == [True, False, False]\", \"assert validate_file_paths(['/usr/local/bin/script.sh', '/tmp/', '/home/user/.bashrc']) == [True, False, True]\", \"assert validate_file_paths(['../relati... | {
"split": "train",
"index": 77557,
"acecode_id": "bigcode_python_fns_11776",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes in a month and a year as integers and returns a string describing the report for that month and year. The report should be formatted as 'Report for {month}/{year}'. Write a function named `generate_report` that will accompl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_report(1, 2023) == 'Report for 1/2023'\", \"assert generate_report(12, 2023) == 'Report for 12/2023'\", \"assert generate_report(6, 2021) == 'Report for 6/2021'\", \"assert generate_report(11, 2020) == 'Report for 11/2020'\", \"assert generate_repor... | {
"split": "train",
"index": 77558,
"acecode_id": "bigcode_python_fns_23009",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a simple banking operation. Implement a function `bank_operations` that takes a list of operations on an account, where each operation is represented as a tuple. The first element of the tuple is a string indicating the operation type: 'deposit', ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bank_operations([('deposit', 100), ('withdraw', 30), ('apply_interest', 0.05)]) == 73.5\", \"assert bank_operations([('deposit', 200), ('apply_interest', 0.1)]) == 220.0\", \"assert bank_operations([('withdraw', 50)]) == 0.0\", \"assert bank_operations([('de... | {
"split": "train",
"index": 77559,
"acecode_id": "oss_23715",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function `check_strictly_ascending_order(lst)` that validates whether a list of numerical values follows a strictly ascending sequence. The function should return True if the list is strictly ascending, and False otherwise. Additionally, the function should raise a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_strictly_ascending_order([1, 2, 3, 4, 5]) == True\", \"assert check_strictly_ascending_order([1.0, 2.0, 3.0]) == True\", \"assert check_strictly_ascending_order([-5, -3, -1, 0, 1]) == True\", \"assert check_strictly_ascending_order([1, 2, 2, 3]) == Fal... | {
"split": "train",
"index": 77560,
"acecode_id": "evol_8508",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that determines whether a given flag for asynchronous operation should be added to a command-line argument parser based on a default value. Write a function `add_async_flag(default_async: bool) -> str` that takes a boolean parameter `defa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_async_flag(True) == '--async'\", \"assert add_async_flag(False) == '--no-async'\", \"assert add_async_flag(True) == '--async'\", \"assert add_async_flag(False) == '--no-async'\", \"assert add_async_flag(True) == '--async'\", \"assert add_async_flag(False... | {
"split": "train",
"index": 77561,
"acecode_id": "bigcode_python_fns_5876",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing data points, write a function that takes this list and returns a new list where each element is a string representation of the corresponding data point. If the data point is -1, return the string 'Not given by algorithm' instead. The functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_data([3, 7, -1, 2]) == ['3', '7', 'Not given by algorithm', '2']\", \"assert process_data([-1, -1, -1]) == ['Not given by algorithm', 'Not given by algorithm', 'Not given by algorithm']\", \"assert process_data([0, 1, 2, 3]) == ['0', '1', '2', '3']\"... | {
"split": "train",
"index": 77562,
"acecode_id": "bigcode_python_fns_15054",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of numerical values representing a time series data. Your task is to implement a function that calculates the moving average of the given time series using a specified window size. The function should take the following inputs: 1. `data`: A list of numerica... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert moving_average([1, 2, 3, 4, 5], 3) == [2.0, 3.0, 4.0]\", \"assert moving_average([5, 3, 8, 4, 2], 2) == [4.0, 5.5, 6.0, 3.0]\", \"assert moving_average([1, 1, 1, 1], 1) == [1.0, 1.0, 1.0, 1.0]\", \"assert moving_average([10, 20, 30], 3) == [20.0]\", \"assert... | {
"split": "train",
"index": 77563,
"acecode_id": "oss_28929",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary or any iterable data structure, and you need to implement a function 'examine_dict' that analyzes the input. The function should return a list containing four elements: a boolean indicating if the analysis was successful, the count of empty dictionari... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert examine_dict({}) == [True, 1, 0, 0]\", \"assert examine_dict({'key': {}}) == [True, 1, 1, 0]\", \"assert examine_dict({'key1': 1, 'key2': 2}) == [True, 0, 2, 0]\", \"assert examine_dict({'key': 'value'}) == [True, 0, 1, 0]\", \"assert examine_dict([1, 2, 3])... | {
"split": "train",
"index": 77564,
"acecode_id": "evol_30992",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that retrieves a value from a dictionary based on a given key. If the key exists in the dictionary, the function should return the corresponding value. If the key does not exist, the function should return a specified default v... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_value({'a': 1, 'b': 2}, 'a', 0) == 1\", \"assert get_value({'a': 1, 'b': 2}, 'b', 0) == 2\", \"assert get_value({'a': 1, 'b': 2}, 'c', 0) == 0\", \"assert get_value({}, 'a', 10) == 10\", \"assert get_value({'x': 100}, 'x', 50) == 100\", \"assert get_valu... | {
"split": "train",
"index": 77565,
"acecode_id": "oss_8179",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a function that checks if a given IP address is within a specified IP range. The IP range will be provided in CIDR notation. Implement a function `is_ip_in_range(ip: str, ip_range: str) -> bool` that takes two parameters: an IP address (either IPv4 or IPv6) and an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_ip_in_range('192.168.0.1', '192.168.0.0/28') == True\", \"assert is_ip_in_range('192.168.0.15', '192.168.0.0/28') == True\", \"assert is_ip_in_range('192.168.0.16', '192.168.0.0/28') == False\", \"assert is_ip_in_range('192.168.0.255', '192.168.0.0/28') =... | {
"split": "train",
"index": 77566,
"acecode_id": "bigcode_python_fns_36909",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers called `signal`. Your task is to implement a function called `processSignal` that processes this signal and returns a new list based on the following rules: For each element at index `i` in the output list, calculate the sum of elements in the `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert processSignal([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert processSignal([1, 1, 1, 1, 1]) == [5, 5, 5, 5, 5]\", \"assert processSignal([2, 3, 2, 2, 4]) == [6, 3, 6, 6, 4]\", \"assert processSignal([3]) == [3]\", \"assert processSignal([]) == []\", \"asser... | {
"split": "train",
"index": 77567,
"acecode_id": "oss_22049",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that categorizes a given numerical value based on predefined intervals. The function should take a single argument, `value`, and return a string representing the category which corresponds to the following intervals: If the value i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert categorize_value(10) == 'Intervalo (0, 25]'\", \"assert categorize_value(25) == 'Intervalo (0, 25]'\", \"assert categorize_value(26) == 'Intervalo (25, 50]'\", \"assert categorize_value(30) == 'Intervalo (25, 50]'\", \"assert categorize_value(50) == 'Interva... | {
"split": "train",
"index": 77568,
"acecode_id": "oss_6973",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a guessing game. In this game, a player is asked to guess a randomly chosen integer between 1 and 100. The function `guess_number` takes a single integer input `number` which represents the player's guess. The function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert guess_number(70) == -1\", \"assert guess_number(60) == -1\", \"assert guess_number(40) == 1\", \"assert guess_number(55) == 1\", \"assert guess_number(65) == -1\", \"assert guess_number(85) == -1\"]}"
} | {
"split": "train",
"index": 77569,
"acecode_id": "bigcode_python_fns_13868",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers and a positive integer n, implement a function `chunk_list` that divides the list into chunks of size n. The last chunk may contain fewer than n elements if the list size is not divisible by n. The function should return a list of these chunks as lists.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\", \"assert chunk_list([1, 2, 3], 1) == [[1], [2], [3]]\", \"assert chunk_list([1], 1) == [[1]]\", \"assert chunk_list([1, 2, 3, 4, 5, 6, 7, 8], 3) == [[1, 2, 3], [4, 5, 6], [7, 8]]\", \"assert chunk_li... | {
"split": "train",
"index": 77570,
"acecode_id": "bigcode_python_fns_36485",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that receives a list of events, where each event is represented as a tuple containing an event name (string) and its corresponding data (any type). Your function should check if any event occurs more than once (i.e., has the same event nam... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_events([('event1', 'data1'), ('event2', 'data2')]) == {'event1': 'data1', 'event2': 'data2'}\", \"assert check_events([('eventA', 1), ('eventB', 2), ('eventC', 3)]) == {'eventA': 1, 'eventB': 2, 'eventC': 3}\", \"assert check_events([('event1', 'data1'... | {
"split": "train",
"index": 77571,
"acecode_id": "bigcode_python_fns_27721",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function `export_entity_data` that simulates the export of entity attributes to a specific format based on the version of the export. The function takes in a version number (integer) and a dictionary of entity attributes, and it returns a list of s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert export_entity_data(13, {'name': 'Entity1', 'flags': 1, 'height': 10, 'width': 5, 'oblique': 0, 'generation_flags': 2, 'last_height': 1.5, 'font': 'Arial', 'bigfont': 'Arial Bold'}) == ['SUBCLASS_MARKER: Entity1', 'SUBCLASS_MARKER: style', 'name: Entity1', 'f... | {
"split": "train",
"index": 77572,
"acecode_id": "oss_24787",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of words and counts the number of vowels (a, e, i, o, u) in each word. The function should return a dictionary where the keys are the words and the values are the corresponding counts of vowels in those words.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_vowels(['hello', 'world']) == {'hello': 2, 'world': 1}\", \"assert count_vowels(['Python', 'programming']) == {'Python': 1, 'programming': 3}\", \"assert count_vowels(['a', 'e', 'i', 'o', 'u']) == {'a': 1, 'e': 1, 'i': 1, 'o': 1, 'u': 1}\", \"assert co... | {
"split": "train",
"index": 77573,
"acecode_id": "oss_18267",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_positions(arr: List[int], x: int) -> List[int]` that returns the positions of all instances of a specific integer `x` within the provided numerical array `arr`. The function should return an empty list if `x` is not found in the array. The array is im... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_positions([2, 3, 3, 1, 5, 2], 3) == [1, 2]\", \"assert find_positions([2, 3, 3, 1, 5, 2], 2) == [0, 5]\", \"assert find_positions([2, 3, 3, 1, 5, 2], 1) == [3]\", \"assert find_positions([2, 3, 3, 1, 5, 2], 5) == [4]\", \"assert find_positions([2, 3, 3,... | {
"split": "train",
"index": 77574,
"acecode_id": "evol_15258",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the behavior of a material and its properties. Implement a function called `material_summary` that takes the following parameters: a string `name`, an integer `actual_atoms_of_bulk`, a string `mpid`, and a list of strings `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert material_summary('Sample Material', 1000, 'MPID123', ['Bulk Index: 1, Possible Bulks: 10', 'Bulk Index: 2, Possible Bulks: 15']) == 'Material Name: Sample Material, Actual Atoms of Bulk: 1000, MPID: MPID123, Bulk Sampling Strings: [Bulk Index: 1, Possible Bu... | {
"split": "train",
"index": 77575,
"acecode_id": "oss_1004",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that returns a formatted string indicating the role of users in a specified tenant. The function should take an optional parameter `tenant` which, when provided, should be included in the output string. If `tenant` is not provided, th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rbac_show_users('TenantA') == ' -tenant=TenantA '\", \"assert rbac_show_users('') == ' -tenant= '\", \"assert rbac_show_users(None) == 'No tenant specified'\", \"assert rbac_show_users('Tenant1') == ' -tenant=Tenant1 '\", \"assert rbac_show_users('TenantX') ... | {
"split": "train",
"index": 77576,
"acecode_id": "bigcode_python_fns_11",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `retrieve_and_format_data(keys: List[Dict[str, Any]]) -> str` that processes a list of dictionaries representing keys. The function should format each dictionary as a JSON string and append it to an output list. If the operation is su... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert retrieve_and_format_data([]) == 'SUCCESS'\", \"assert retrieve_and_format_data([{'key': 'value1'}, {'key': 'value2'}]) == 'SUCCESS'\", \"assert retrieve_and_format_data([{'key': 1}, {'key': 2}]) == 'SUCCESS'\", \"assert retrieve_and_format_data([{'key': None... | {
"split": "train",
"index": 77577,
"acecode_id": "oss_11725",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a given list of numerical values representing time series data. Your function should perform the following tasks:\n\n1. Preprocess the list by converting each number into a string and adding a dollar sign ('$') at the begin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_time_series([1.0, 2.5, 3.75]) == ['0: $1.0', '1: $2.5', '2: $3.75']\", \"assert process_time_series([0, 1, 2]) == ['0: $0', '1: $1', '2: $2']\", \"assert process_time_series([-1, -2.5, -3.5]) == ['0: $-1', '1: $-2.5', '2: $-3.5']\", \"assert process_... | {
"split": "train",
"index": 77578,
"acecode_id": "oss_20058",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representation of a scoring matrix, where the first line contains the amino acid types separated by spaces, and subsequent lines contain an amino acid followed by its scores against each of the amino acids from the first line, implement a function that transforms... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert matrix_str_to_dict('A B C\\\\nA 1 2 3\\\\nB 4 5 6\\\\nC 7 8 9') == {'A': {'A': 1, 'B': 2, 'C': 3}, 'B': {'A': 4, 'B': 5, 'C': 6}, 'C': {'A': 7, 'B': 8, 'C': 9}}\", \"assert matrix_str_to_dict('X Y Z\\\\nX 10 20 30\\\\nY 40 50 60\\\\nZ 70 80 90') == {'X': {'X... | {
"split": "train",
"index": 77579,
"acecode_id": "bigcode_python_fns_42405",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `fibfib(n: int) -> int` that calculates the FibFib sequence defined as follows: \n- fibfib(0) == 0 \n- fibfib(1) == 0 \n- fibfib(2) == 1 \n- fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3) for n > 2 \n- fibfib(n) == fibfib(n+3) - fibfib(n+2) - fibfib(n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibfib(0) == 0\", \"assert fibfib(1) == 0\", \"assert fibfib(2) == 1\", \"assert fibfib(3) == 1\", \"assert fibfib(4) == 2\", \"assert fibfib(5) == 4\", \"assert fibfib(6) == 7\", \"assert fibfib(7) == 13\", \"assert fibfib(8) == 24\", \"assert fibfib(9) == ... | {
"split": "train",
"index": 77580,
"acecode_id": "evol_12553",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a number, determine whether it is an even number. A number is considered even if it is divisible by 2 without any remainder. Implement a function `is_even(val)` that takes an integer or a float as input and returns `True` if the number is even, and `False` otherwise. The ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_even(0) == True\", \"assert is_even(1) == False\", \"assert is_even(2) == True\", \"assert is_even(3) == False\", \"assert is_even(4) == True\", \"assert is_even(5) == False\", \"assert is_even(-1) == False\", \"assert is_even(-2) == True\", \"assert is_e... | {
"split": "train",
"index": 77581,
"acecode_id": "bigcode_python_fns_24727",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_occurrences(num: int, matrix: List[List[int]]) -> List[Tuple[int, int]]` that takes an integer `num` and a two-dimensional list of integers `matrix`. The function should return a list of tuples, where each tuple contains the row and column indices of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_occurrences(2, [[1, 2, 3, 4], [5, 6, 2, 7], [8, 9, 10, 11]]) == [(0, 1), (1, 2)]\", \"assert find_occurrences(5, [[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == [(1, 1)]\", \"assert find_occurrences(10, [[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == []\", \"assert find_oc... | {
"split": "train",
"index": 77582,
"acecode_id": "evol_25912",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a binary tree, determine if a given string represents a valid path from the root to any leaf node. A valid path consists of nodes where each node's value is a character that matches the corresponding character in the input string. The input string will have the same lengt... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert valid_path(root, 'abcd') == False\", \"assert valid_path(root, 'abx') == False\", \"assert valid_path(root, 'aabb') == False\", \"assert valid_path(root, 'aacc') == False\", \"assert valid_path(root, 'def') == False\", \"assert valid_path(root, 'xyz') == Fal... | {
"split": "train",
"index": 77583,
"acecode_id": "bigcode_python_fns_34338",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a sentence, implement a function that returns the sentence with all the words in reverse order. For example, the input 'Hello world' should return 'world Hello'.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_words('Welcome to the world of programming!') == ['programming!', 'of', 'world', 'the', 'to', 'Welcome']\", \"assert reverse_words('Python is awesome') == ['awesome', 'is', 'Python']\", \"assert reverse_words('LeetCode problems are fun') == ['fun', '... | {
"split": "train",
"index": 77584,
"acecode_id": "evol_17882",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of elements that can be either decimal numbers or special characters (strings). Your task is to implement a function that analyzes the data and returns a dictionary with the following keys: 'total_elements', 'decimal_values', and 'special_characters'. 'tota... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_data([0.1, 0.2, '#', '$', 0.4]) == {'total_elements': 5, 'decimal_values': 3, 'special_characters': 2}\", \"assert analyze_data([1.5, 2.5, '!', '@', 3.5]) == {'total_elements': 5, 'decimal_values': 3, 'special_characters': 2}\", \"assert analyze_data... | {
"split": "train",
"index": 77585,
"acecode_id": "evol_22913",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that modifies the boundaries of a rectangular bounding box by applying an expansion factor. The function should take the original bounding box coordinates and an expansion percentage, and return the new bounding box coordinates. The e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert modify_box(0, 0, 10, 10, 0) == (0.0, 0.0, 10.0, 10.0)\", \"assert modify_box(1, 1, 5, 5, 0) == (1.0, 1.0, 5.0, 5.0)\", \"assert modify_box(0, 0, 0, 0, 0.1) == (0.0, 0.0, 0.0, 0.0)\", \"assert modify_box(0, 0, 0, 0, -0.1) == (0.0, 0.0, 0.0, 0.0)\", \"assert m... | {
"split": "train",
"index": 77586,
"acecode_id": "bigcode_python_fns_20907",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given a directed graph represented by an adjacency list, implement a function that converts this adjacency list into a directed adjacency matrix. The adjacency list is represented as a list of integers, where each integer represents a node, and the directed edges are indicated ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert toDirAdjMatrix([0, 1, 2, 4, 3], 5) == [[0, 1, 0, 0, 0], [0, 0, 1, 0, 0], [0, 0, 0, 0, 1], [0, 0, 0, 0, 0], [0, 0, 0, 1, 0]]\", \"assert toDirAdjMatrix([0, 1, 2, 3], 4) == [[0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1], [0, 0, 0, 0]]\", \"assert toDirAdjMatrix([1,... | {
"split": "train",
"index": 77587,
"acecode_id": "bigcode_python_fns_26179",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates listing installed packages in a hypothetical package management system. The function should take two parameters: a list of package names (strings) and a search pattern (also a string). It should return a list of package nam... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert list_installed_packages(['pkg1', 'pkg2', 'pkg3'], 'pkg') == ['pkg1', 'pkg2', 'pkg3']\", \"assert list_installed_packages(['abc', 'def', 'ghijkl'], 'def') == ['def']\", \"assert list_installed_packages(['test-package', 'another-package'], 'package') == ['test... | {
"split": "train",
"index": 77588,
"acecode_id": "bigcode_python_fns_25962",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a string as input and rearranges the characters in alphabetical order while removing any digits and special characters. The output should be a single string composed only of the alphabetic characters sorted in ascending order.\nPlease reason step... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert alphabetical_sort('12345@#$%^&*()') == ''\", \"assert alphabetical_sort('zxywvutsrqponmlkjihgfedcba') == 'abcdefghijklmnopqrstuvwxyz'\", \"assert alphabetical_sort('') == ''\", \"assert alphabetical_sort('123abc!@#') == 'abc'\", \"assert alphabetical_sort('!... | {
"split": "train",
"index": 77589,
"acecode_id": "evol_9414",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given two strings, `string1` and `string2`, write a function `findSubsequenceOccurrences(string1: str, string2: str) -> List[Tuple[int, int]]` that checks if `string2` is a subsequence of `string1`. If it is, return a list of tuples representing the start and end indices of eve... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert findSubsequenceOccurrences('abcd', 'efg') == []\", \"assert findSubsequenceOccurrences('abababab', 'abab') == [(0, 3), (2, 5), (4, 7)]\", \"assert findSubsequenceOccurrences('testcase', 'test') == [(0, 3)]\", \"assert findSubsequenceOccurrences('abcabcabc', ... | {
"split": "train",
"index": 77590,
"acecode_id": "evol_1850",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given the head of a singly-linked list where each node contains a binary digit (0 or 1). Write a function `getDecimalValue` that converts the linked list representation of the binary number into its decimal equivalent. The linked list is guaranteed to have at least one ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert getDecimalValue(ListNode(1, ListNode(0, ListNode(1)))) == 5\", \"assert getDecimalValue(ListNode(0)) == 0\", \"assert getDecimalValue(ListNode(1)) == 1\", \"assert getDecimalValue(ListNode(1, ListNode(0, ListNode(0, ListNode(1, ListNode(0, ListNode(0, ListNo... | {
"split": "train",
"index": 77591,
"acecode_id": "evol_29520",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the execution of a command with an optional pause before continuing. The function should take a command (as a string) and an optional pause duration (in milliseconds) as parameters. If the pause duration is provided, the fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert execute_command_with_pause('echo Hello, World!', 2000) == 'Executing command: echo Hello, World! after a pause of 2.0 seconds.'\", \"assert execute_command_with_pause('ls', 0) == 'Executing command: ls immediately.'\", \"assert execute_command_with_pause('mk... | {
"split": "train",
"index": 77592,
"acecode_id": "oss_32585",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You have been tasked with implementing a function that checks whether a given value is valid based on some predefined criteria. For simplicity, let's assume that all values are considered valid. Your function should take a single input parameter, 'value', which can be of any da... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_pass(42) == True\", \"assert check_pass('hello') == True\", \"assert check_pass([]) == True\", \"assert check_pass([1, 2, 3]) == True\", \"assert check_pass({'key': 'value'}) == True\", \"assert check_pass(None) == True\", \"assert check_pass(True) == ... | {
"split": "train",
"index": 77593,
"acecode_id": "bigcode_python_fns_28322",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary where the keys are strings and the values are integers, implement a function `reorder_dict(my_dict)` that returns a new dictionary sorted by its values in ascending order. If two keys have the same value, they should maintain their original order from the inp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reorder_dict({'A': 2, 'B': 1, 'C': 3}) == {'B': 1, 'A': 2, 'C': 3}\", \"assert reorder_dict({'Alice': 4, 'Bob': 4, 'Charlie': 2}) == {'Charlie': 2, 'Alice': 4, 'Bob': 4}\", \"assert reorder_dict({'X': 10, 'Y': 3, 'Z': 5}) == {'Y': 3, 'Z': 5, 'X': 10}\", \"as... | {
"split": "train",
"index": 77594,
"acecode_id": "evol_10360",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of elements, implement a function `get_unique_elements(table)` that returns a dictionary containing the unique elements as keys and their frequency counts as values. The function should iterate through the list and count how many times each unique element appears. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_elements([]) == {}\", \"assert get_unique_elements([1]) == {1: 1}\", \"assert get_unique_elements([1, 1, 2]) == {1: 2, 2: 1}\", \"assert get_unique_elements([3, 3, 3, 1, 1, 2]) == {3: 3, 1: 2, 2: 1}\", \"assert get_unique_elements([0, 0, 0, 0]) ==... | {
"split": "train",
"index": 77595,
"acecode_id": "evol_25800",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a name of an Access Control List (ACL). Your task is to create a function that returns a modified string indicating that this ACL has been removed. The modified string should follow the format: 'The ACL named {acl_name} has been unconfigured.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unconfigure_acl('my_acl') == 'The ACL named my_acl has been unconfigured.'\", \"assert unconfigure_acl('test_acl') == 'The ACL named test_acl has been unconfigured.'\", \"assert unconfigure_acl('default_acl') == 'The ACL named default_acl has been unconfigur... | {
"split": "train",
"index": 77596,
"acecode_id": "bigcode_python_fns_12375",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `assign_number` that assigns the integer value of `5` to a variable `my_number` and returns this variable. Your function should not take any parameters.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert assign_number() == 5\", \"assert assign_number() == 5\", \"assert assign_number() == 5\", \"assert assign_number() == 5\", \"assert assign_number() == 5\", \"assert assign_number() == 5\", \"assert assign_number() == 5\", \"assert assign_number() == 5\", \"a... | {
"split": "train",
"index": 77597,
"acecode_id": "evol_8313",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing an SQL command. Your task is to validate the SQL command based on the following rules: 1. The SQL command must end with a semicolon ';'. 2. If the command contains the word 'CREATE' or 'ALTER' (case insensitive), it is considered valid. 3. If... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_sql_command('CREATE TABLE users (id INT);') == True\", \"assert is_valid_sql_command('ALTER TABLE users ADD COLUMN name VARCHAR(100);') == True\", \"assert is_valid_sql_command('SELECT * FROM users;') == False\", \"assert is_valid_sql_command('DROP ... | {
"split": "train",
"index": 77598,
"acecode_id": "bigcode_python_fns_6056",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Implement a function `convert_temperature(scale_from: str, scale_to: str, temp: float) -> float` that converts a given temperature from one scale to another among Celsius, Fahrenheit, and Kelvin. The function should take three parameters: a string `scale_from` representing the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_temperature('Celsius', 'Fahrenheit', 0) == 32.0\", \"assert convert_temperature('Celsius', 'Kelvin', 0) == 273.15\", \"assert convert_temperature('Fahrenheit', 'Celsius', 32) == 0.0\", \"assert convert_temperature('Fahrenheit', 'Kelvin', 32) == 273.1... | {
"split": "train",
"index": 77599,
"acecode_id": "evol_9847",
"num_tests": 14
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.