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": "Given a string representing a filename, implement a function that determines the type of the file based on its extension. The function should return one of the following file types: 'CLS', 'JAVA', 'JAVASCRIPT', 'PHP', 'PYTHON', 'YAML', or 'OTHER' if the file does not match any ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert determine_file_type('example.cls') == 'CLS'\", \"assert determine_file_type('example.java') == 'JAVA'\", \"assert determine_file_type('example.js') == 'JAVASCRIPT'\", \"assert determine_file_type('example.php') == 'PHP'\", \"assert determine_file_type('examp... | {
"split": "train",
"index": 79600,
"acecode_id": "bigcode_python_fns_32459",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string, implement a function that removes all vowels, digits, punctuation marks, and whitespace characters, returning only the consonants in the final output. The function signature is: def remove_vowels_digits_punctuation_whitespace(text: str) -> str.\nPlease reason st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_vowels_digits_punctuation_whitespace('') == ''\", \"assert remove_vowels_digits_punctuation_whitespace('abcdef#&*123\\\\nghijklm789') == 'bcdfghjklm'\", \"assert remove_vowels_digits_punctuation_whitespace('abcdef456') == 'bcdf'\", \"assert remove_vow... | {
"split": "train",
"index": 79601,
"acecode_id": "evol_29013",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of encoded images represented as strings and a specific image name. Your task is to implement a function that checks if the given image name exists in the list of encoded images. If the image name exists, the function should return a success message. If it ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_encoded_image(['image1', 'image2', 'image3'], 'image1') == 'Image found!'\", \"assert check_encoded_image(['image1'], 'image1') == 'Image found!'\", \"assert check_encoded_image(['sampleImage', 'testImage'], 'sampleImage') == 'Image found!'\", \"assert... | {
"split": "train",
"index": 79602,
"acecode_id": "bigcode_python_fns_26252",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that modifies a JSON-like dictionary, which represents a message. The function should take a string input `content`, and a dictionary `data`. The function should add a new key `message` to the dictionary, with its value set to the input `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert modify_message('Hello, world!', {}) == {}\", \"assert modify_message('Test message', {'key': 'value'}) == {'key': 'value', 'message': 'Test message'}\", \"assert modify_message('Update required', {'info': 'data'}) == {'info': 'data', 'message': 'Update requi... | {
"split": "train",
"index": 79603,
"acecode_id": "bigcode_python_fns_1860",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a measurement represented by a class `Measurement` that has two attributes: `value` (a float) and `error` (a float). Write a function called `serialize_measurement` that takes an instance of `Measurement` as input and returns a dictionary with two keys: 'value' an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert serialize_measurement(Measurement(1.5, 0.1)) == {'value': 1.5, 'error': 0.1}\", \"assert serialize_measurement(Measurement(0.0, 0.0)) == {'value': 0.0, 'error': 0.0}\", \"assert serialize_measurement(Measurement(-3.5, 0.5)) == {'value': -3.5, 'error': 0.5}\"... | {
"split": "train",
"index": 79604,
"acecode_id": "bigcode_python_fns_21855",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `generate_primes(N: int) -> List[int]` that generates the first N prime numbers. The function should return a list of these prime numbers. The input N will be a positive integer.\nPlease reason step by step, then write a self-contained Python solution. Give you... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_primes(1) == [2]\", \"assert generate_primes(2) == [2, 3]\", \"assert generate_primes(3) == [2, 3, 5]\", \"assert generate_primes(4) == [2, 3, 5, 7]\", \"assert generate_primes(5) == [2, 3, 5, 7, 11]\", \"assert generate_primes(6) == [2, 3, 5, 7, 11... | {
"split": "train",
"index": 79605,
"acecode_id": "evol_1259",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a Python object (which can be a dictionary or a list) as input and returns a JSON string representation of that object. Your function should handle both lists and dictionaries, converting them into their JSON format. If the inp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert jsonify({'name': 'Alice', 'age': 30}) == '{\\\"name\\\": \\\"Alice\\\", \\\"age\\\": 30}'\", \"assert jsonify([1, 2, 3]) == '[1, 2, 3]'\", \"assert jsonify({'key': 'value'}) == '{\\\"key\\\": \\\"value\\\"}'\", \"assert jsonify([]) == '[]'\", \"assert jsonif... | {
"split": "train",
"index": 79606,
"acecode_id": "bigcode_python_fns_2664",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a nested dictionary where values can be integers, floats, or other dictionaries. Write a function `number_sum` that computes and returns two values: the sum of all numeric values in the dictionary and the sum of all numeric values within nested dictionaries. If th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert number_sum({'a': 1, 'b': 2}) == (3, 3)\", \"assert number_sum({'a': 1, 'b': {'c': 2, 'd': 3}}) == (6, 6)\", \"assert number_sum({'a': {'b': {'c': 1}}, 'd': 2}) == (3, 3)\", \"assert number_sum({'a': 1, 'b': 'text', 'c': {'d': 2.5, 'e': 3}}) == (6.5, 6.5)\", ... | {
"split": "train",
"index": 79607,
"acecode_id": "evol_30111",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an iterable of integers, return a list that contains the elements sorted in ascending order. You can assume that the input iterable is non-empty. Implement a function that takes in the iterable and returns the sorted list. The input can include any integer values, and the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sorted_list((3, 2, 1)) == [1, 2, 3]\", \"assert sorted_list((1, 2, 3, 4)) == [1, 2, 3, 4]\", \"assert sorted_list((4, 1, 3, 2)) == [1, 2, 3, 4]\", \"assert sorted_list((5, 3, 5, 2, 5)) == [2, 3, 5, 5, 5]\", \"assert sorted_list((-1, -2, -3, -4)) == [-4, -3, ... | {
"split": "train",
"index": 79608,
"acecode_id": "bigcode_python_fns_8373",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a JSON string as input and extracts the 'details' substructure from it. If the input JSON string is not properly formatted or if the 'details' key is missing, the function should raise an appropriate exception. The expected output is the 'details... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_details('{\\\"data\\\":[{\\\"name\\\":\\\"John\\\",\\\"details\\\":{\\\"address\\\":\\\"123 Main St.\\\",\\\"phone\\\":\\\"000-123-4567\\\"}}]}') == {\\\"address\\\":\\\"123 Main St.\\\", \\\"phone\\\":\\\"000-123-4567\\\"}\", \"assert extract_detail... | {
"split": "train",
"index": 79609,
"acecode_id": "evol_1896",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a python function that takes a string as input and generates a password. The password should contain a mix of letters (both uppercase and lowercase) and digits, and its length should be twice the length of the input string. The generated password must be returned as a str... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_password('Hello') != 'Hello'\", \"assert len(generate_password('abc')) == 6\", \"assert len(generate_password('')) == 0\", \"assert all(c.isalnum() for c in generate_password('Test123'))\", \"assert len(generate_password('password')) == 16\", \"asse... | {
"split": "train",
"index": 79610,
"acecode_id": "evol_317",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary where each key is associated with a list of numerical arrays, implement a function that converts this dictionary into a new dictionary where each key is associated with a list that contains the sums of consecutive elements from the original lists. For example... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dict_element_sum({'A': [1, 2, 3]}) == {'A': [3, 5]}\", \"assert dict_element_sum({'B': [10, 20, 30, 40]}) == {'B': [30, 50, 70]}\", \"assert dict_element_sum({'C': [1, 1, 1], 'D': [2, 2]}) == {'C': [2, 2], 'D': [4]}\", \"assert dict_element_sum({'E': [5]}) =... | {
"split": "train",
"index": 79611,
"acecode_id": "evol_13798",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer edge_length and an integer dimension, implement a function surface_area_hypercube(edge_length, dimension) that calculates the surface area of a hypercube in the specified dimension. The surface area of a hypercube in n dimensions with edge length l is given by ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert surface_area_hypercube(1, 5) == 32\", \"assert surface_area_hypercube(0, 2) == 0\", \"assert surface_area_hypercube(1, 2) == 4\", \"assert surface_area_hypercube(1, 1) == 2\", \"assert surface_area_hypercube(4, 4) == 1024\", \"assert surface_area_hypercube(0... | {
"split": "train",
"index": 79612,
"acecode_id": "evol_12826",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a function that processes a packet received over the network. Your task is to implement a function `process_packet(packet: bytes, source_address: str) -> str` that takes in a byte string `packet` and a string `source_address`, representing the source IP address an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_packet(b'hello', '192.0.2.1:42') == '68 65 6c 6c 6f from 192.0.2.1:42'\", \"assert process_packet(b'SNMP-packet', '10.0.0.1:8080') == '53 4e 4d 50 2d 70 61 63 6b 65 74 from 10.0.0.1:8080'\", \"assert process_packet(b'fake-packet', '172.16.0.1:3000') ... | {
"split": "train",
"index": 79613,
"acecode_id": "bigcode_python_fns_11997",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the power exerted by a mining component given the time, speed, and a fixed period. The power can be determined using the following steps: 1. First, calculate the distance covered by the miner component using the formul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_power(1, 20, 4) == 80.0\", \"assert calculate_power(3, 15, 2) == 30.0\", \"assert calculate_power(5, 0, 5) == 0.0\", \"assert calculate_power(10, 10, 1) == 10.0\", \"assert calculate_power(8, 5, 2) == 10.0\", \"assert calculate_power(1, 1, 1) == 1.... | {
"split": "train",
"index": 79614,
"acecode_id": "oss_23475",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function `split_words(txt)` that takes a string `txt` as input. If the string contains spaces or commas, the function should return a list of words split by these separators. If there are no spaces or commas, the function should return the count of lowercase letters... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert split_words('Hello world!') == ['Hello', 'world!']\", \"assert split_words('Hello,world!') == ['Hello', 'world!']\", \"assert split_words('abcdef') == 3\", \"assert split_words('abc,def') == ['abc', 'def']\", \"assert split_words('a,b,c') == ['a', 'b', 'c']\... | {
"split": "train",
"index": 79615,
"acecode_id": "evol_15955",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given an integer n, write a function `multi_particle_first_np_metafit(n)` that returns a string representing the name of the fitting function for multi-particle systems. The function should format the string as 'multi_particle_first_nnp_metafit' where n is the input integer. Th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multi_particle_first_np_metafit(1) == 'multi_particle_first_1p_metafit'\", \"assert multi_particle_first_np_metafit(2) == 'multi_particle_first_2p_metafit'\", \"assert multi_particle_first_np_metafit(3) == 'multi_particle_first_3p_metafit'\", \"assert multi_... | {
"split": "train",
"index": 79616,
"acecode_id": "bigcode_python_fns_13492",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if the input list contains at least one valid identifier for a process. A valid identifier is either a non-empty string or a non-negative integer. The function should raise a ValueError if neither a valid identifier nor a vali... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_identifiers(['valid_id']) is None\", \"assert check_identifiers([123]) is None\", \"assert check_identifiers(['', 123]) is None\", \"assert check_identifiers(['name', 0]) is None\", \"assert check_identifiers(['another_valid_id', -1]) is None\", \"asse... | {
"split": "train",
"index": 79617,
"acecode_id": "bigcode_python_fns_26090",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple server response based on the type of request made. The function should take a string input representing the request type, which can be either 'GET' or 'POST'. If the request type is 'GET', the function should retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert handle_request('GET') == 'Success'\", \"assert handle_request('POST') == 'Bad Request'\", \"assert handle_request('PUT') == 'Invalid Request'\", \"assert handle_request('DELETE') == 'Invalid Request'\", \"assert handle_request('GET') == 'Success'\", \"assert... | {
"split": "train",
"index": 79618,
"acecode_id": "bigcode_python_fns_20371",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a personalized email for a list of deputies based on their information. Each deputy is represented by a list containing their name, function, permanent commission, and gender. You need to implement a function that takes in a deputy's information and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_email(['Alice Dupont', 'D\\u00e9put\\u00e9', 'Commission des affaires sociales', 'F'], 'Bonjour @politesse@, je vous \\u00e9cris...#mot1/mot2#fin') == 'Bonjour madame, je vous \\u00e9cris...mot2fin'\", \"assert generate_email(['Jean Valjean', 'D\\u0... | {
"split": "train",
"index": 79619,
"acecode_id": "bigcode_python_fns_31342",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves a list of chapters for a specific book based on the chapter data provided. Each chapter has an ID, a title, and a foreign key to the book it belongs to. Write a function `get_chapters_by_book(book_id: int, chapters: List[Tu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_chapters_by_book(2, [(1, 'Introduction', 1), (2, 'Chapter One', 1), (3, 'Chapter Two', 2)]) == [(3, 'Chapter Two')]\", \"assert get_chapters_by_book(3, [(1, 'Introduction', 1), (2, 'Chapter One', 1)]) == []\", \"assert get_chapters_by_book(1, [(1, 'Chapt... | {
"split": "train",
"index": 79620,
"acecode_id": "oss_21691",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of geographical locations represented as strings, implement a function `get_coordinates(locations: List[str]) -> List[Tuple[float, float]]` that returns a list of tuples, where each tuple contains the latitude and longitude of the corresponding location. If a locat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_coordinates(['New York']) == [(40.7128, -74.0060)]\", \"assert get_coordinates(['Los Angeles', 'Chicago']) == [(34.0522, -118.2437), (41.8781, -87.6298)]\", \"assert get_coordinates(['Houston', 'Phoenix']) == [(29.7604, -95.3698), (33.4484, -112.0740)]\"... | {
"split": "train",
"index": 79621,
"acecode_id": "bigcode_python_fns_27895",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer array `nums`, return the number of arithmetic subarrays of `nums`. An integer array is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the same. A subarray is a contiguous subsequence of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert numberOfArithmeticSlices([1, 2, 3, 4]) == 3\", \"assert numberOfArithmeticSlices([1]) == 0\", \"assert numberOfArithmeticSlices([1, 3, 5, 7]) == 3\", \"assert numberOfArithmeticSlices([7, 7, 7]) == 1\", \"assert numberOfArithmeticSlices([3, -1, -5, -9]) == 3... | {
"split": "train",
"index": 79622,
"acecode_id": "evol_21929",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the creation of a post. The function should take in a dictionary representing a user's request and determine if the user is authenticated. If the user is authenticated, it should create a new post with the provided title an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_post({'user': {'is_authenticated': False, 'username': ''}, 'post_data': {'title': 'Second Post', 'content': 'Another post'}}) == {'error': 'User is not authenticated'}\", \"assert create_post({'user': {'is_authenticated': False, 'username': ''}, 'post... | {
"split": "train",
"index": 79623,
"acecode_id": "oss_17820",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a function `generate_password(length: int) -> str` that generates a secure password of a specified length. The password must include at least one uppercase letter, one lowercase letter, one numeral, and one special character. The remaining characters can be any combin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_password(10) != ''\", \"assert len(generate_password(10)) == 10\", \"assert any(c.isupper() for c in generate_password(10))\", \"assert any(c.islower() for c in generate_password(10))\", \"assert any(c.isdigit() for c in generate_password(10))\", \"... | {
"split": "train",
"index": 79624,
"acecode_id": "evol_9354",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `print_powers_of_2(n)` that prints all powers of 2 from 2^0 up to 2^n. The function should first validate the input to ensure it is an integer greater than or equal to zero; if it is not, it should throw a ValueError. The function should not return any valu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert print_powers_of_2(0) == None, 'Expected output: 1'\", \"assert print_powers_of_2(1) == None, 'Expected output: 1 2'\", \"assert print_powers_of_2(2) == None, 'Expected output: 1 2 4'\", \"assert print_powers_of_2(3) == None, 'Expected output: 1 2 4 8'\", \"a... | {
"split": "train",
"index": 79625,
"acecode_id": "evol_24931",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of a group of people. Your task is to write a function that determines the number of pairs of people (i, j) where the height of person i is less than the height of person j and i is located before j in the list. The func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_pairs([1, 2, 3, 4]) == 6\", \"assert count_pairs([4, 3, 2, 1]) == 0\", \"assert count_pairs([1, 1, 1, 1]) == 0\", \"assert count_pairs([5, 3, 4, 2, 1]) == 1\", \"assert count_pairs([]) == 0\", \"assert count_pairs([10]) == 0\", \"assert count_pairs([1,... | {
"split": "train",
"index": 79626,
"acecode_id": "bigcode_python_fns_23369",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a binary tree, implement a function that returns the elements of the tree printed in a zigzag level order traversal. The first level should be printed from left to right, the second level from right to left, and so on. The root of the binary tree is considered the first l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert printZigZag(Node(1)) == [[1]]\", \"assert printZigZag(Node(1, Node(2), Node(3))) == [[1], [3, 2]]\", \"assert printZigZag(Node(1, Node(2, Node(4), Node(5)), Node(3))) == [[1], [3, 2], [4, 5]]\", \"assert printZigZag(Node(1, Node(2, Node(4), Node(5)), Node(3,... | {
"split": "train",
"index": 79627,
"acecode_id": "evol_10863",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers and returns a new list containing only the unique elements from the original list, maintaining their original order. The input list may contain duplicates. Your function should be named `get_unique_elemen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_elements([1, 2, 3, 1, 2, 3]) == [1, 2, 3]\", \"assert get_unique_elements([5, 5, 5, 5]) == [5]\", \"assert get_unique_elements([]) == []\", \"assert get_unique_elements([0, -1, 1, -1, 0]) == [0, -1, 1]\", \"assert get_unique_elements([10, 20, 10, ... | {
"split": "train",
"index": 79628,
"acecode_id": "oss_30330",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_tree(string: str) -> Node` that constructs a binary tree from a given string. Each unique character in the string should be represented as a node in the tree, and each node should store the character and its frequency in the string. The tree should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_tree('abc') is not None\", \"assert create_tree('aaa') is not None\", \"assert create_tree('') is None\", \"assert create_tree('ab') is not None\", \"assert create_tree('aabbcc') is not None\", \"assert create_tree('character') is not None\", \"assert... | {
"split": "train",
"index": 79629,
"acecode_id": "evol_25941",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves user credentials from a configuration dictionary. The function should take a configuration dictionary as input and return a tuple containing the username and password for the user. The configuration dictionary will have a s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_credentials({'auth': {'username': 'user1', 'password': 'pass1'}}) == ('user1', 'pass1')\", \"assert get_credentials({'auth': {'username': 'user2'}}) == ('user2', None)\", \"assert get_credentials({'auth': {'password': 'pass2'}}) == (None, 'pass2')\", \"a... | {
"split": "train",
"index": 79630,
"acecode_id": "bigcode_python_fns_19172",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary `statDict` that contains a key `wordcount`, which is a list of tuples. Each tuple contains a word (string) and its occurrence count (integer). Write a function `displayStat(statDict)` that calculates the total number of occurrences of all words in `wo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert displayStat({'wordcount': [('hello', 3), ('world', 2), ('python', 5)]}) == 10\", \"assert displayStat({'wordcount': [('test', 1), ('case', 1)]}) == 2\", \"assert displayStat({'wordcount': [('apple', 4), ('banana', 6), ('orange', 2)]}) == 12\", \"assert displ... | {
"split": "train",
"index": 79631,
"acecode_id": "bigcode_python_fns_3387",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `fibonacci(n)` that returns a list of all Fibonacci numbers that are less than or equal to a given integer `n`. The Fibonacci sequence is defined as follows: the first two numbers are 0 and 1, and each subsequent number is the sum of the previous two. The o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(0) == [0]\", \"assert fibonacci(4) == [0, 1, 1, 2, 3]\", \"assert fibonacci(5) == [0, 1, 1, 2, 3, 5]\", \"assert fibonacci(6) == [0, 1, 1, 2, 3, 5]\", \"assert fibonacci(7) == [0, 1, 1, 2, 3, 5]\", \"assert fibonacci(8) == [0, 1, 1, 2, 3, 5, 8]\", ... | {
"split": "train",
"index": 79632,
"acecode_id": "evol_26395",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a message object with a boolean property 'banned', write a function that checks if the user associated with the message is banned. The function should return True if the user is banned and False if the user is not banned. The 'message' object is provided as input to the f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_user_banned({'banned': False}) == False\", \"assert is_user_banned({'banned': True}) == True\", \"assert is_user_banned({'banned': False}) == False\", \"assert is_user_banned({'banned': True}) == True\", \"assert is_user_banned({'banned': False}) == False... | {
"split": "train",
"index": 79633,
"acecode_id": "bigcode_python_fns_35500",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the total number of occurrences of a given word in a list of strings. The function should be case-insensitive and should consider only whole word matches. A word is defined as a sequence of alphanumeric characters, del... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_word_occurrences('dog', ['The quick brown fox jumps over the lazy dog', 'The dog barks loudly, but the fox remains silent', 'Foxes are cunning animals, unlike dogs']) == 2\", \"assert count_word_occurrences('the', ['The quick brown fox jumps over the l... | {
"split": "train",
"index": 79634,
"acecode_id": "oss_26215",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating a data structure for a tree widget based on a given set of options. Implement a function `create_tree_data(codepage: str, options: List[Dict[str, str]], target_node: str, pos: int) -> Dict[str, Any]` that takes in a codepage string, a list of opti... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_tree_data('CP1_', [{'code': 'A', 'label': 'Option A'}, {'code': 'B', 'label': 'Option B'}], 'A-Option A', 1) == {'node_name': 'TREE_NODE_NAME', 'node_obj': [{'node_name': 'A-Option A', 'node_code': 'CP1_A'}, {'node_name': 'B-Option B', 'node_code': 'C... | {
"split": "train",
"index": 79635,
"acecode_id": "bigcode_python_fns_45490",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dataset containing information about various individuals, represented as a list of dictionaries. Each dictionary contains the following keys: 'name', 'age', 'income', and 'poor'. The 'poor' key indicates whether the individual is considered poor or not, but it m... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert mark_poor([{ 'name': 'Alice', 'age': 25, 'income': 30000, 'poor': '' }, { 'name': 'Bob', 'age': 30, 'income': 20000, 'poor': '' }], 25000) == [{ 'name': 'Alice', 'age': 25, 'income': 30000, 'poor': 'not poor' }, { 'name': 'Bob', 'age': 30, 'income': 20000, '... | {
"split": "train",
"index": 79636,
"acecode_id": "oss_37740",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `encode_ucs2(text: str) -> bytearray` that takes a string `text` and encodes it into UCS2 format. The UCS2 encoding represents each character as two bytes. Your function should return a `bytearray` containing the UCS2-encoded bytes of the input string. For ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert encode_ucs2('A') == bytearray([0x00, 0x41])\", \"assert encode_ucs2('Hello') == bytearray([0x00, 0x48, 0x00, 0x65, 0x00, 0x6C, 0x00, 0x6C, 0x00, 0x6F])\", \"assert encode_ucs2('!') == bytearray([0x00, 0x21])\", \"assert encode_ucs2(' ') == bytearray([0x00, 0... | {
"split": "train",
"index": 79637,
"acecode_id": "bigcode_python_fns_39030",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function `recognize_digit(image: List[List[int]]) -> int` that takes a 28x28 pixel grayscale image represented as a list of lists (where each inner list contains 28 integers ranging from 0 to 255) and returns the digit (0-9) recognized by the artificial neural netwo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert recognize_digit([[0]*28]*28) == 0\", \"assert recognize_digit([[255]*28]*28) == 1\", \"assert recognize_digit([[0]*27 + [255]]*28) == 2\", \"assert recognize_digit([[0]*28]*28) == 0\", \"assert recognize_digit([[0]*28]*3 + [[255]*28]*25) == 2\"]}"
} | {
"split": "train",
"index": 79638,
"acecode_id": "evol_16743",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Write a python function `xor_sum(arr: List[int], start: int = 0, end: int = None) -> int` that calculates the sum of the XOR of all pairs of numbers within a specified range of a given list. The function should return the sum of XOR results of all unique pairs (i, j) such that ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert xor_sum([0, 0, 0], 0, 3) == 0\", \"assert xor_sum([3, 3, 3], 0, 3) == 0\", \"assert xor_sum([1], 0, 1) == 0\", \"assert xor_sum([2, 2, 2, 2], 0, 4) == 0\", \"assert xor_sum([1, 2, 3], 1, 2) == 0\", \"assert xor_sum([1, 1, 1, 1], 0, 4) == 0\"]}"
} | {
"split": "train",
"index": 79639,
"acecode_id": "evol_14421",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a model and a boolean flag as input. If the model is None and the flag is True, the function should initialize the model by calling a helper function called load_model. Afterwards, the function should return the initialized... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_model(None, True) == 'Model Loaded'\", \"assert initialize_model('Existing Model', False) == 'Existing Model'\", \"assert initialize_model(None, False) == None\", \"assert initialize_model('Another Model', True) == 'Another Model'\", \"assert init... | {
"split": "train",
"index": 79640,
"acecode_id": "bigcode_python_fns_23875",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of configuration file names and a list of dataset file names, write a function `generate_commands` that takes the following parameters: `configs` (a list of strings representing configuration file names), `datasets` (a list of strings representing dataset file name... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_commands(['config1', 'config2'], ['dataset1'], 1) == ['run config1 on dataset1 0', 'run config2 on dataset1 0']\", \"assert generate_commands(['config1'], ['dataset1', 'dataset2'], 2) == ['run config1 on dataset1 0', 'run config1 on dataset1 1', 'ru... | {
"split": "train",
"index": 79641,
"acecode_id": "bigcode_python_fns_21946",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that processes a list of node IDs and determines which nodes should be rebooted based on their states. You need to implement a function `reboot_nodes(node_ids: List[str], all_start_task_failed: bool) -> List[str]`. The function takes the f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reboot_nodes(['node1', 'node2', 'failed_node1', 'failed_node2'], True) == ['failed_node1', 'failed_node2']\", \"assert reboot_nodes(['node1', 'node2', 'node3'], False) == ['node1', 'node2', 'node3']\", \"assert reboot_nodes(['failed_node1', 'failed_node2'], ... | {
"split": "train",
"index": 79642,
"acecode_id": "bigcode_python_fns_28758",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers and a target length. Your task is to implement a function that modifies the list according to the following rules: If the list has more elements than the target length, return a new list containing only the first 'target_length' elements from th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pad_list([1, 2, 3], 5) == [1, 2, 3, 0, 0]\", \"assert pad_list([4, 5, 6, 7, 8, 9], 4) == [4, 5, 6, 7]\", \"assert pad_list([], 3) == [0, 0, 0]\", \"assert pad_list([1, 2], 2) == [1, 2]\", \"assert pad_list([10, 20, 30, 40], 6) == [10, 20, 30, 40, 0, 0]\", \"... | {
"split": "train",
"index": 79643,
"acecode_id": "oss_11697",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a rectangular board of dimensions `m x n` and a vertical piece of dimensions `a x b`. Your task is to write a function `fitsIntoBoard(m, n, a, b)` that determines whether the vertical piece can fit into the board without overlapping or extending beyond the boundar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fitsIntoBoard(6, 4, 3, 2) == True\", \"assert fitsIntoBoard(10, 8, 4, 6) == True\", \"assert fitsIntoBoard(8, 5, 5, 4) == True\", \"assert fitsIntoBoard(12, 10, 12, 10) == True\", \"assert fitsIntoBoard(3, 3, 4, 4) == False\", \"assert fitsIntoBoard(1, 1, 1,... | {
"split": "train",
"index": 79644,
"acecode_id": "oss_6043",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `factorial(n: int) -> int` that calculates the factorial of a non-negative integer `n`. The function should use recursion and a ternary operator to return the factorial value. The factorial of a number `n` is defined as the product of all positive integers ... | 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": 79645,
"acecode_id": "evol_11358",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing time series data and a list of dictionaries where each dictionary contains a 'center' key with an integer value, your task is to prune the list of dictionaries by removing those whose 'center' values are within a specified distance 'r' from... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert prune_motifs([10, 20, 30, 40], [{'center': 10}, {'center': 15}, {'center': 25}, {'center': 30}], 5) == [{'center': 10}, {'center': 25}]\", \"assert prune_motifs([1, 1, 1, 1], [{'center': 1}, {'center': 1}, {'center': 1}], 0) == [{'center': 1}]\", \"assert pr... | {
"split": "train",
"index": 79646,
"acecode_id": "bigcode_python_fns_8140",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that returns a fixed string representing the path to a specific executable file. The function should be named `get_executable_path`. Given no parameters, it should always return the string 'a/path/to/loqusdb'. Implement this function.\nPl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_executable_path() == 'a/path/to/loqusdb'\", \"assert get_executable_path() == 'a/path/to/loqusdb'\", \"assert get_executable_path() == 'a/path/to/loqusdb'\", \"assert get_executable_path() == 'a/path/to/loqusdb'\", \"assert get_executable_path() == 'a/pa... | {
"split": "train",
"index": 79647,
"acecode_id": "bigcode_python_fns_7216",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates the attributes for an image represented by a dictionary. The dictionary should contain the following keys: 'category', 'order', 'annotation', and 'image_file'. Your goal is to implement a function named `validate_image` tha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_image({'category': 'Nature', 'order': 1, 'annotation': 'Beautiful scene', 'image_file': 'image1.jpg'}) == True\", \"assert validate_image({'category': 'Animals', 'order': 0, 'annotation': '', 'image_file': None}) == True\", \"assert validate_image({... | {
"split": "train",
"index": 79648,
"acecode_id": "oss_24330",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a string as input and returns a new string with the letters sorted in alphabetical order. The function should handle both uppercase and lowercase letters, treating them as equivalent when sorting (i.e., 'A' and 'a' are considered the same). Do no... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_string('') == ''\", \"assert sort_string('a') == 'a'\", \"assert sort_string('A') == 'A'\", \"assert sort_string('AaBbCc') == 'AaBbCc'\", \"assert sort_string('hello') == 'ehllo'\", \"assert sort_string('WORLD') == 'DLORW'\"]}"
} | {
"split": "train",
"index": 79649,
"acecode_id": "evol_6959",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Implement a function that checks if a given email address is valid based on the following criteria: The local part (username) should allow alphanumeric characters along with dots, hyphens, and underscores but not consecutively or at the beginning or the end. The domain name sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_email('john.doe@example.com') == True\", \"assert is_valid_email('john.doe@example.co.uk') == True\", \"assert is_valid_email('johndoe@example.com') == True\", \"assert is_valid_email('john_doe@example.com') == True\", \"assert is_valid_email('john-... | {
"split": "train",
"index": 79650,
"acecode_id": "evol_1615",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to consolidate permission settings for different user groups. Each group is represented as a dictionary with keys 'group', 'read', 'write', 'delete', and 'change_config'. Write a function `consolidate_permissions(groups)` that process... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert consolidate_permissions([{'group': 'group1', 'read': True, 'write': False, 'delete': True, 'change_config': False}, {'group': 'group2', 'read': True, 'write': False, 'delete': False, 'change_config': False}, {'group': 'group1', 'read': False, 'write': True, ... | {
"split": "train",
"index": 79651,
"acecode_id": "oss_5217",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings that represent sorting parameters, implement a function `parse_ordering_params(param: List[str]) -> List[str]`. The function should process the input list as follows: If the list contains the string 'ord', return an empty list. If the list contains the s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_ordering_params(['ord']) == []\", \"assert parse_ordering_params(['title']) == ['coursepage__course__readable_id']\", \"assert parse_ordering_params(['-title', 'location', 'ord']) == []\", \"assert parse_ordering_params(['-age', 'name']) == ['-age', 'n... | {
"split": "train",
"index": 79652,
"acecode_id": "bigcode_python_fns_7654",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that decodes a base64-encoded string and returns the decoded text. Write a function `decode_base64` that takes a single argument `input_data`. The function should behave as follows: - If `input_data` is a valid base64-encoded s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decode_base64('SGVsbG8gd29ybGQ=') == 'Hello world'\", \"assert decode_base64('U29tZSBlbmNvZGVkIHN0cmluZw==') == 'Some encoded string'\", \"assert decode_base64('SW52YWxpZCBpbnB1dA==') == 'Invalid input'\", \"assert decode_base64('Z29vZCBtb3JuaW5n') == 'good ... | {
"split": "train",
"index": 79653,
"acecode_id": "oss_5916",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with completing a Python function that implements the merge sort algorithm. The function takes an unsorted list of integers as input and recursively sorts it using the merge sort technique. Your goal is to implement the merging step of the merge sort algorithm, w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_sort([3, 2, 1]) == [1, 2, 3]\", \"assert merge_sort([5, 4, 3, 2, 1]) == [1, 2, 3, 4, 5]\", \"assert merge_sort([1, 2, 3]) == [1, 2, 3]\", \"assert merge_sort([10, 9, 8, 7, 6]) == [6, 7, 8, 9, 10]\", \"assert merge_sort([]) == []\", \"assert merge_sort(... | {
"split": "train",
"index": 79654,
"acecode_id": "oss_9135",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function named 'calculate_tax' that takes two parameters, 'income' (a float) and 'tax_rate' (a float) and returns the product of the two, representing the amount of tax owed. The function should handle cases where income or tax_rate might be zero. Make sure to retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_tax(50000, 0.2) == 10000.0\", \"assert calculate_tax(0, 0.15) == 0\", \"assert calculate_tax(75000, 0) == 0\", \"assert calculate_tax(0, 0) == 0\", \"assert calculate_tax(100000, 0.25) == 25000.0\", \"assert calculate_tax(120000, 0.3) == 36000.0\",... | {
"split": "train",
"index": 79655,
"acecode_id": "evol_10211",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of filenames as input and returns the filename with the longest length. If there are multiple filenames with the same longest length, the function should return the first one encountered in the list. If the input lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longest_filename(['file1.txt', 'document.docx', 'picture.jpg', 'notes.txt']) == 'document.docx'\", \"assert longest_filename(['short.txt', 'longerfilename.pdf', 'evenlongerfilename.docx']) == 'evenlongerfilename.docx'\", \"assert longest_filename(['a.txt', '... | {
"split": "train",
"index": 79656,
"acecode_id": "oss_27146",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a list of rules and returns a modified list based on specific criteria. Each rule is represented as a dictionary with the following keys: 'name', 'condition', and 'action'. The 'name' key holds a string represent... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_rules([{'name': 'rule1', 'condition': True, 'action': 'action1'}, {'name': 'rule2', 'condition': False, 'action': 'action2'}, {'name': 'rule3', 'condition': True, 'action': 'action3'}]) == ['action1_rule1', 'action3_rule3']\", \"assert process_rules(... | {
"split": "train",
"index": 79657,
"acecode_id": "oss_27154",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a single round of the game rock-paper-scissors between a user and a computer. The function should take two inputs: the user's choice (a string: 'rock', 'paper', or 'scissors') and the computer's choice (a string: 'rock'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert play_round('rock', 'scissors') == 'You win!'\", \"assert play_round('rock', 'paper') == 'Computer wins!'\", \"assert play_round('rock', 'rock') == \\\"It's a tie!\\\"\", \"assert play_round('paper', 'rock') == 'You win!'\", \"assert play_round('paper', 'scis... | {
"split": "train",
"index": 79658,
"acecode_id": "oss_15412",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string that represents a sequence of characters. Your task is to implement a function that takes this string and returns a dictionary containing the count of each unique character in the string. The dictionary should have characters as keys and their respective ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert character_count('hello') == {'h': 1, 'e': 1, 'l': 2, 'o': 1}\", \"assert character_count('') == {}\", \"assert character_count('aabbcc') == {'a': 2, 'b': 2, 'c': 2}\", \"assert character_count('abc') == {'a': 1, 'b': 1, 'c': 1}\", \"assert character_count('a... | {
"split": "train",
"index": 79659,
"acecode_id": "bigcode_python_fns_47333",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a target numerical value and an array of integers, implement a function that returns a list of all unique index combinations from the array such that the sum of the elements at those indices equals the target value. The function should take in two parameters: an integer '... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_combinations(0, [1, -1, 2, -2, 3]) == [(0, 1), (2, 3)]\", \"assert find_combinations(4, []) == []\", \"assert find_combinations(9, [1, 2, 3, 4]) == []\", \"assert find_combinations(6, [3, 3, 3]) == [(0, 1), (0, 2), (1, 2)]\", \"assert find_combinations(... | {
"split": "train",
"index": 79660,
"acecode_id": "evol_30054",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of strings representing file paths and returns a dictionary containing the count of unique file extensions present in the list. A file extension is defined as the part of the file name after the last occurrenc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_file_extensions(['document.doc', 'presentation.DOC', 'image.jpeg', 'image.JPEG']) == {'doc': 2, 'jpeg': 2}\", \"assert count_file_extensions(['index.html', 'style.css', 'script.js', 'index.HTML', 'style.CSS', 'script.JS']) == {'html': 2, 'css': 2, 'js'... | {
"split": "train",
"index": 79661,
"acecode_id": "oss_36192",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a data structure that represents a graph with nodes. Each node has a name and may point to multiple output nodes. Your task is to implement a function that takes a graph object as input and returns a list of names of all the output nodes in the graph. The graph ob... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_output_nodes([{'name': 'A', 'outputs': ['B', 'C']}, {'name': 'B', 'outputs': []}, {'name': 'C', 'outputs': []}]) == ['B', 'C']\", \"assert get_output_nodes([{'name': 'A', 'outputs': ['B']}, {'name': 'B', 'outputs': ['C']}, {'name': 'C', 'outputs': []}]) ... | {
"split": "train",
"index": 79662,
"acecode_id": "bigcode_python_fns_41378",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing item IDs and a character representing a dataset split ('E', 'V', or 'R'). Write a function, `filter_item_ids_by_split`, that returns a list of item IDs that belong to the specified dataset split. The dataset split can be determined ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_item_ids_by_split([1, 2, 3, 4, 5], 'E') == [2, 4]\", \"assert filter_item_ids_by_split([1, 2, 3, 4, 5], 'R') == [1, 3, 5]\", \"assert filter_item_ids_by_split([1, 2, 3, 4, 5], 'V') == []\", \"assert filter_item_ids_by_split([10, 11, 12, 13, 14, 15, 16... | {
"split": "train",
"index": 79663,
"acecode_id": "bigcode_python_fns_8193",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a collection of points in a 3D space. Each point is represented as a dictionary containing its coordinates (x, y, z) and its color. Your goal is to implement a function called `manage_points` that takes a list of points and a color, and performs the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_points([], 'red') == []\", \"assert manage_points([{'x': 1, 'y': 2, 'z': 3}], 'blue') == [{'x': 1, 'y': 2, 'z': 3, 'color': 'blue'}]\", \"assert manage_points([{'x': 0, 'y': 0, 'z': 0}, {'x': 1, 'y': 1, 'z': 1}], 'green') == [{'x': 0, 'y': 0, 'z': 0, ... | {
"split": "train",
"index": 79664,
"acecode_id": "oss_33403",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a number of bounding boxes in an image, each represented by its coordinates and dimensions. Additionally, you have a list of strings that represent the text content within each bounding box. Your task is to implement a function that returns a list of rectangles co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert draw_text_rectangles(3, ['','Hello','World'], [10,20,30], [20,30,40], [50,60,70], [30,40,50]) == [(20, 30, 60, 40), (30, 40, 70, 50)]\", \"assert draw_text_rectangles(2, ['Text', ''], [0, 50], [0, 50], [100, 100], [50, 50]) == [(0, 0, 100, 50)]\", \"assert d... | {
"split": "train",
"index": 79665,
"acecode_id": "oss_27695",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given an unsorted array arr[] consisting of n elements, where 0 < arr[i] < 10^9 and 0 < n < 10^9. There may be some elements appearing more than once. Write a function to remove duplicates from the array while maintaining the original order of elements. The function should retu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_duplicates([1, 2, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert remove_duplicates([5, 5, 5, 5, 5]) == [5]\", \"assert remove_duplicates([1, 2, 3, 1, 2, 3]) == [1, 2, 3]\", \"assert remove_duplicates([10, 20, 10, 30, 40, 20]) == [10, 20, 30, 40]\", \"assert re... | {
"split": "train",
"index": 79666,
"acecode_id": "evol_2459",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a string as input and returns the number of distinct substrings that can be formed from the input string. A substring is a contiguous sequence of characters within a string. For example, the substrings of 'abc' are 'a', 'b'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert countDistinctSubstrings('abc') == 6\", \"assert countDistinctSubstrings('aaaa') == 4\", \"assert countDistinctSubstrings('') == 0\", \"assert countDistinctSubstrings('a') == 1\", \"assert countDistinctSubstrings('ab') == 3\", \"assert countDistinctSubstrings... | {
"split": "train",
"index": 79667,
"acecode_id": "oss_27367",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that manages academic publications. The function, named `manage_publications`, should take a list of publications and a title of a publication as input. Each publication is represented as a dictionary containing the title, author, and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_publications([{'title': 'AI in Healthcare', 'author': 'Alice Smith', 'abstract': 'A study on AI applications in healthcare.'}, {'title': 'Quantum Computing', 'author': 'Bob Johnson'}], 'AI in Healthcare') == 'Publication: AI in Healthcare - Author: Al... | {
"split": "train",
"index": 79668,
"acecode_id": "oss_26300",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function `increment_number(x, n=1)` that takes an integer `x` and an optional integer `n` (default value 1). The function should return the result of adding `n` to `x`. If either `x` or `n` is not an integer, or if `n` is zero, the function should return an error me... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert increment_number(5, 3) == 8\", \"assert increment_number(10) == 11\", \"assert increment_number(0, 5) == 5\", \"assert increment_number(-2, 2) == 0\", \"assert increment_number(100, -50) == 50\", \"assert increment_number(3.5, 2) == 'Error: both the original... | {
"split": "train",
"index": 79669,
"acecode_id": "evol_34283",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary of students' data where the keys are student names and the values are tuples containing the following six elements: height (float), weight (float), age (int), GPA (float), attendance (float), and test_scores (list of floats). Write a function `filter_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_students({}, None, None, None, None, None, None) == 'No student data provided'\", \"assert filter_students({'Alice': (160.5, 55.0, 20, 3.5, 95.0, [85.0, 90.0, 78.0]), 'Bob': (170.0, 70.0, 22, 3.8, 90.0, [88.0, 92.0, 91.0])}, None, None, None, None, No... | {
"split": "train",
"index": 79670,
"acecode_id": "evol_25041",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates a context menu item for displaying information about a selected GUI element. The function `create_context_menu_info` should take two parameters: `gui_element` (a string representing the name of the GUI element) and `out... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_context_menu_info('Button', {}) == {'Info': 'Information about Button: ...'}\", \"assert create_context_menu_info('Label', {}) == {'Info': 'Information about Label: ...'}\", \"assert create_context_menu_info('TextBox', {}) == {'Info': 'Information abo... | {
"split": "train",
"index": 79671,
"acecode_id": "oss_36570",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves a tag by its ID from a predefined list of tags. Each tag is represented as a dictionary with two keys: 'id' and 'name'. Your function should take an integer 'tag_id' as input and return the corresponding tag as a dictionary... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_tag_by_id(1) == {'id': 1, 'name': 'Python'}\", \"assert get_tag_by_id(2) == {'id': 2, 'name': 'Java'}\", \"assert get_tag_by_id(3) == {'id': 3, 'name': 'JavaScript'}\", \"assert get_tag_by_id(4) == {'id': 4, 'name': 'C++'}\", \"assert get_tag_by_id(5) ==... | {
"split": "train",
"index": 79672,
"acecode_id": "bigcode_python_fns_3293",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a queue using two stacks. A queue is a data structure that follows the First-In-First-Out (FIFO) principle, where elements are inserted at the back and removed from the front. Your goal is to implement a queue using two stacks and perform enqueu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert queue_operations([('enqueue', 1), ('enqueue', 2), ('dequeue',)]) == [1]\", \"assert queue_operations([('enqueue', 5), ('enqueue', 10), ('dequeue',), ('dequeue',)]) == [5, 10]\", \"assert queue_operations([('enqueue', 1), ('dequeue',), ('dequeue',)]) == [1, N... | {
"split": "train",
"index": 79673,
"acecode_id": "oss_13771",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function `get_prime_factors(n: int) -> List[int]` that takes an integer `n` (where 2 <= n <= 1,000,000) and returns a list of all factors for the prime number `n`. If `n` is not a prime number, return an empty list. The factors should always include 1 and `n` itself.\n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_prime_factors(2) == [1, 2]\", \"assert get_prime_factors(3) == [1, 3]\", \"assert get_prime_factors(5) == [1, 5]\", \"assert get_prime_factors(7) == [1, 7]\", \"assert get_prime_factors(11) == [1, 11]\", \"assert get_prime_factors(13) == [1, 13]\", \"ass... | {
"split": "train",
"index": 79674,
"acecode_id": "evol_21318",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the positioning of a 3D option item in a graphical user interface. The function should take three parameters: x, y, and z, which represent the coordinates of the item in a 3D space. The function should return a string indic... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert position_item(1, 2, 3) == 'Positioned at (1, 2, 3)'\", \"assert position_item(-1, -2, -3) == 'Positioned at (-1, -2, -3)'\", \"assert position_item(0, 0, 0) == 'Positioned at (0, 0, 0)'\", \"assert position_item(5, 5, 5) == 'Positioned at (5, 5, 5)'\", \"ass... | {
"split": "train",
"index": 79675,
"acecode_id": "oss_6950",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of authors, where each author is represented by a dictionary containing their name and the date of their last update. The date is formatted as 'Month Year' (e.g., 'Apr. 2020'). Your task is to implement a function `sort_authors_by_update_date(authors)` that... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_authors_by_update_date([{'name': 'John Doe', 'update_date': 'May. 2020'}, {'name': 'Jane Smith', 'update_date': 'Apr. 2020'}, {'name': 'Rocket Romero', 'update_date': 'Jun. 2020'}]) == [{'name': 'Jane Smith', 'update_date': 'Apr. 2020'}, {'name': 'John ... | {
"split": "train",
"index": 79676,
"acecode_id": "oss_29853",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function `advanced_binary_to_hexadecimal(y: str) -> str` that converts a binary string to its hexadecimal representation. The binary string will always be a valid string of '0's and '1's with a length that is a multiple of 4. The function should raise a ValueError i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert advanced_binary_to_hexadecimal('0000') == '0'\", \"assert advanced_binary_to_hexadecimal('0001') == '1'\", \"assert advanced_binary_to_hexadecimal('0010') == '2'\", \"assert advanced_binary_to_hexadecimal('0011') == '3'\", \"assert advanced_binary_to_hexadec... | {
"split": "train",
"index": 79677,
"acecode_id": "evol_24647",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing an email body that may contain both plain text and HTML content. Your task is to update the email body by adding a disclaimer and a footer to the content. The disclaimer and footer can be provided as separate strings. You need to implement a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_email_body('<p>Hello World!</p>', 'Disclaimer: Test', 'Footer: Test') == '<p>Hello World!</p>Disclaimer: TestFooter: Test'\", \"assert update_email_body('Hello World!', 'Disclaimer: Test', 'Footer: Test') == 'Hello World!Disclaimer: TestFooter: Test'\... | {
"split": "train",
"index": 79678,
"acecode_id": "bigcode_python_fns_27674",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a list of revision numbers, your task is to implement a function that determines if the list is in strictly increasing order. A list is considered strictly increasing if each element is greater than the previous one. You need to write a function `is_strictly_increasing(re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_strictly_increasing([1, 2, 3, 4, 5]) == True\", \"assert is_strictly_increasing([5, 4, 3, 2, 1]) == False\", \"assert is_strictly_increasing([1, 1, 2, 3]) == False\", \"assert is_strictly_increasing([10, 20, 30]) == True\", \"assert is_strictly_increasing... | {
"split": "train",
"index": 79679,
"acecode_id": "bigcode_python_fns_44138",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `exit_program` that simulates exiting a program. The function takes no parameters and prints 'Exiting program...' to indicate that the program is terminating. After printing the message, it should return a value of `None`. Your functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert exit_program() is None\", \"assert exit_program() == None\", \"assert exit_program() is None\", \"assert exit_program() == None\", \"assert exit_program() is None\", \"assert exit_program() == None\", \"assert exit_program() is None\", \"assert exit_program(... | {
"split": "train",
"index": 79680,
"acecode_id": "bigcode_python_fns_36462",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing a list of strings that represent numeric data. Each string may contain either a single numeric value or two numeric values separated by a space or a tab. Your goal is to extract the last numeric value from each string, multiply it by 10000, and re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_data(['10', '20', '30']) == [100000.0, 200000.0, 300000.0]\", \"assert process_data(['1.5', '3.2', '4.0']) == [15000.0, 32000.0, 40000.0]\", \"assert process_data(['10 20', '30 40', '50 60']) == [200000.0, 400000.0, 600000.0]\", \"assert process_data... | {
"split": "train",
"index": 79681,
"acecode_id": "bigcode_python_fns_46147",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates updating configuration options for a system. Your function should accept a dictionary representing the current configuration options and an integer representing the new scan interval. The function should return a new dictio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_options({'scan_interval': 5}, 10) == {'scan_interval': 10}\", \"assert update_options({'scan_interval': 5}, 0) == 'Invalid scan interval'\", \"assert update_options({'scan_interval': 5}, -1) == 'Invalid scan interval'\", \"assert update_options({'scan... | {
"split": "train",
"index": 79682,
"acecode_id": "bigcode_python_fns_21043",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates a list of unique observables for a player in a card game based on their current hand of cards. The function should take a list of strings representing the player's hand and return a list of unique observables related to... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_task_observables(['card1', 'card2', 'card3']) == ['task1', 'task2', 'task3']\", \"assert get_task_observables(['card1']) == ['task1']\", \"assert get_task_observables([]) == []\", \"assert get_task_observables(['card2', 'card2', 'card3']) == ['task1', 't... | {
"split": "train",
"index": 79683,
"acecode_id": "oss_36315",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a command-line argument parser for a machine learning training script. The function `parse_arguments()` should take a list of argument strings (simulating command-line inputs) and return a dictionary where the keys are the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_arguments(['--num_steps', '30']) == {'num_steps': 30, 'num_eval_steps': None, 'num_buckets': 10, 'dtype': 'float16', 'batch_size': 8, 'accumulate': 1, 'use_avg_len': False, 'batch_size_eval': 8, 'dataset_name': 'book_corpus_wiki_en_uncased', 'pretraine... | {
"split": "train",
"index": 79684,
"acecode_id": "bigcode_python_fns_23658",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `tag_elements` that takes a string `ctx` and a list of strings `elements`. The function should concatenate the `ctx` string with each element in the `elements` list, separated by a space, and return a new string containing all these conca... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert tag_elements('tag', ['a', 'b', 'c']) == 'tag a tag b tag c'\", \"assert tag_elements('label', ['1', '2']) == 'label 1 label 2'\", \"assert tag_elements('item', ['apple']) == 'item apple'\", \"assert tag_elements('prefix', []) == ''\", \"assert tag_elements('... | {
"split": "train",
"index": 79685,
"acecode_id": "bigcode_python_fns_38699",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `multiply_abs_values_v3(lst)` that takes a list of floating-point numbers. The function should return the product of the absolute values of the numbers, rounded down to their nearest integers. Any negative numbers with a decimal part of 0.5 and above should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multiply_abs_values_v3([3.2, -2.7, 0, -0]) == 0\", \"assert multiply_abs_values_v3([-0.5, -1.5, -2.5]) == 2\", \"assert multiply_abs_values_v3([-0.5, 0.5, 1.5]) == 1\", \"assert multiply_abs_values_v3([1.1, 1.2, 1.3, -1.4]) == 1\", \"assert multiply_abs_valu... | {
"split": "train",
"index": 79686,
"acecode_id": "evol_29318",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple command-line argument parser. Your goal is to create a function that allows adding command-line argument names and retrieving their values. Implement a function `argument_parser` that takes in a list of argument names to add and a list ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert argument_parser(['arg1', 'arg2'], ['arg1', 'arg2', 'arg3']) == [None, None, None]\", \"assert argument_parser(['arg1'], ['arg1']) == [None]\", \"assert argument_parser([], ['arg1']) == [None]\", \"assert argument_parser(['argA', 'argB', 'argC'], ['argA', 'ar... | {
"split": "train",
"index": 79687,
"acecode_id": "oss_15767",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that determines if a given string can be rearranged to form a palindrome. A palindrome is a word, phrase, or sequence that reads the same backward as forward. Your function should take a string as input and return a boolean value i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_form_palindrome('civic') == True\", \"assert can_form_palindrome('ivicc') == True\", \"assert can_form_palindrome('hello') == False\", \"assert can_form_palindrome('racecar') == True\", \"assert can_form_palindrome('123321') == True\", \"assert can_form_... | {
"split": "train",
"index": 79688,
"acecode_id": "oss_33782",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing memory addresses and a list of bytes to be written to those addresses. Your task is to implement a function that takes two parameters: an integer list 'addresses' and a list of bytes 'data'. The function should return a dictionary w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert write_to_memory([0x1000, 0x1001, 0x1002], [b'\\\\x12', b'\\\\x34', b'\\\\x56']) == {0x1000: b'\\\\x12', 0x1001: b'\\\\x34', 0x1002: b'\\\\x56'}\", \"assert write_to_memory([0x2000, 0x2001], [b'\\\\x12', b'\\\\x34', b'\\\\x56']) == {0x2000: b'\\\\x12', 0x2001... | {
"split": "train",
"index": 79689,
"acecode_id": "oss_33347",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of header fields from a CSV file containing mobility data. The function should extract and return the indices of specific fields: 'date', 'country_region', 'sub_region_1', and 'workplaces_percent_change_from_base... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_header(['date', 'country_region', 'sub_region_1', 'workplaces_percent_change_from_baseline'], False) == {'date': 0, 'country_region': 1, 'sub_region_1': 2, 'workplaces_percent_change': 3}\", \"assert process_header(['date', 'country_region', 'sub_reg... | {
"split": "train",
"index": 79690,
"acecode_id": "oss_27653",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function that accepts two pieces of poetry and returns a dictionary containing the combined frequency of each unique word across both poems. The words should be counted in a case-insensitive manner and should ignore punctuation. The function signature should be: def... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert combined_word_frequencies('Two roads diverged in a yellow wood,', 'The woods are lovely, dark and deep, But I have promises to keep.') == {'two': 1, 'roads': 1, 'diverged': 1, 'in': 1, 'a': 1, 'yellow': 1, 'wood': 1, 'the': 1, 'woods': 1, 'are': 1, 'lovely':... | {
"split": "train",
"index": 79691,
"acecode_id": "evol_2217",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with maintaining a score record for a baseball game with specific rules. You begin with an empty score record and receive a list of operations, `ops`, where each operation can be either an integer score or one of the following commands: '+' (sum of the last two s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calPoints(['5', '2', 'C', 'D', '+']) == 30\", \"assert calPoints(['3', '5', 'C', 'D', '+']) == 18\", \"assert calPoints(['0', '0', 'D', 'C', 'C', 'D']) == 0\", \"assert calPoints(['-5', 'D', 'C', 'C']) == 0\", \"assert calPoints(['5', '5', '+', 'D', 'C', 'C'... | {
"split": "train",
"index": 79692,
"acecode_id": "evol_24363",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Implement a function that counts the number of consonant letters in a given string. A consonant is defined as any alphabetic character that is not a vowel (a, e, i, o, u) and can be either uppercase or lowercase. The function should ignore non-alphabetic characters. \n\nFor exa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert consonant_count('') == 0\", \"assert consonant_count('Hello, World!') == 7\", \"assert consonant_count('1234!@#$%^&*()') == 0\", \"assert consonant_count('aeiou') == 0\", \"assert consonant_count('AEIOU') == 0\", \"assert consonant_count('') == 0\", \"assert... | {
"split": "train",
"index": 79693,
"acecode_id": "evol_9674",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to convert a grid of colors into a simplified cross-stitch pattern. The function should take a 2D list of colors (each color represented as a string) and return a new 2D list that represents the cross-stitch pattern. Each color in the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cross_stitch_to_pattern([['red', 'blue'], ['blue', 'red']]) == [['red']]\", \"assert cross_stitch_to_pattern([['yellow', 'yellow', 'blue', 'blue'], ['yellow', 'blue', 'blue', 'yellow'], ['blue', 'yellow', 'yellow', 'yellow']]) == [['yellow', 'blue']]\", \"as... | {
"split": "train",
"index": 79694,
"acecode_id": "oss_6389",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Write a function `draw_squares(n)` that takes an integer `n` (1 <= n <= 100) as input and returns a list of strings representing a grid of squares. Each square is represented by the character 'X' and should be displayed in a single line. For example, if n = 3, the output should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert draw_squares(1) == ['X']\", \"assert draw_squares(2) == ['XX']\", \"assert draw_squares(3) == ['XXX']\", \"assert draw_squares(4) == ['XXXX']\", \"assert draw_squares(5) == ['XXXXX']\", \"assert draw_squares(6) == ['XXXXXX']\", \"assert draw_squares(7) == ['... | {
"split": "train",
"index": 79695,
"acecode_id": "evol_17996",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string s representing a mathematical expression with non-negative integers, '+', '-', '*', '/', '(', and ')', implement a function `calculate(s)` that computes the value of the expression. The expression is guaranteed to be valid and follows the standard order of operat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate('3+2*2') == 7\", \"assert calculate(' 3/2 ') == 1\", \"assert calculate(' 3+5 / 2 ') == 5\", \"assert calculate('(1+(4+5+2)-3)+(6+8)') == 23\", \"assert calculate('2*(5+5*2)/3+(6/2+8)') == 21\", \"assert calculate('1-1+1') == 1\", \"assert calculat... | {
"split": "train",
"index": 79696,
"acecode_id": "evol_30332",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string of characters and a prime number, implement a function that counts how many words in the input string have lengths that are multiples of the given prime number. The input string will be a sequence of characters separated by spaces, and you must verify that the pr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_words_with_prime_length('Python is amazing', 2) == 2\", \"assert count_words_with_prime_length('LeetCode rocks', 5) == 1\", \"assert count_words_with_prime_length('Test this function', 7) == 0\", \"assert count_words_with_prime_length('Check', 13) == 0... | {
"split": "train",
"index": 79697,
"acecode_id": "evol_34941",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given three integers i, j, and k, where i < j < k, write a function get_coordinates(i, j, k) that returns two lists: the first list contains all integers from i to j (inclusive), and the second list contains all integers from j+1 to k (inclusive). The lists should be sorted in ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_coordinates(1, 3, 5) == ([1, 2, 3], [4, 5])\", \"assert get_coordinates(0, 2, 4) == ([0, 1, 2], [3, 4])\", \"assert get_coordinates(2, 4, 6) == ([2, 3, 4], [5, 6])\", \"assert get_coordinates(5, 7, 9) == ([5, 6, 7], [8, 9])\", \"assert get_coordinates(1,... | {
"split": "train",
"index": 79698,
"acecode_id": "bigcode_python_fns_14272",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of vertices representing a polygon, where each vertex is a tuple of (x, y) coordinates, write a function called `calculate_zone_area` that calculates the area of a zone defined by a list of indices specifying which vertices form the zone within the polygon. The are... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_zone_area([(0, 0), (0, 4), (4, 4), (4, 0)], [0, 1, 2, 3]) == 16.0\", \"assert calculate_zone_area([(0, 0), (6, 0), (6, 8), (0, 8)], [1, 2, 3, 0]) == 48.0\", \"assert calculate_zone_area([(0, 0), (1, 1), (2, 0)], [0, 1, 2]) == 1.0\", \"assert calcul... | {
"split": "train",
"index": 79699,
"acecode_id": "oss_546",
"num_tests": 9
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.