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 complex number represented as a string in the format 'x+yj' where x and y are integers, implement a function that converts this complex number into its Cartesian coordinates [x, y]. The function should return a list containing the real part x and the imaginary part y as... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert complex_to_xy('3+4j') == [3, 4]\", \"assert complex_to_xy('1-1j') == [1, -1]\", \"assert complex_to_xy('0+0j') == [0, 0]\", \"assert complex_to_xy('-5+2j') == [-5, 2]\", \"assert complex_to_xy('7-3j') == [7, -3]\", \"assert complex_to_xy('10+10j') == [10, 10... | {
"split": "train",
"index": 84200,
"acecode_id": "bigcode_python_fns_4226",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `array_to_dict` that takes a list of integers as input and constructs a dictionary. Each integer in the list should be a key in the dictionary, and its corresponding value should be the cube of that integer. For example, if the input list is [1, 2, 3... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert array_to_dict([1, 2, 3]) == {1: 1, 2: 8, 3: 27}\", \"assert array_to_dict([0]) == {0: 0}\", \"assert array_to_dict([-1, -2, -3]) == {-1: -1, -2: -8, -3: -27}\", \"assert array_to_dict([4, 5, 6]) == {4: 64, 5: 125, 6: 216}\", \"assert array_to_dict([10, 20]) ... | {
"split": "train",
"index": 84201,
"acecode_id": "evol_26982",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary of collaborators for a GitHub repository and a repository URL. Each collaborator has a set of attributes, including their permission level, name, and login. Your task is to transform this data into a new format where you categorize the collaborators b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_collaborators({'nodes': [{'login': 'user1', 'name': 'User One'}], 'edges': [{'permission': 'ADMIN'}]}, 'https://github.com/example/repo') == {'ADMIN': [{'login': 'user1', 'name': 'User One', 'repo_url': 'https://github.com/example/repo'}], 'MAINTAI... | {
"split": "train",
"index": 84202,
"acecode_id": "bigcode_python_fns_4139",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Develop a function that accepts a multi-dimensional dictionary as input and returns all the keys at the deepest level which have integer values. The function should raise a ValueError if the input is not a dictionary or if the dictionary is empty.\nPlease reason step by step, t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_integer_keys({'x': {'y': {'z': 5}}}) == ['z']\", \"assert find_integer_keys({'level1': {'level2': {'level3': 10, 'level4': 'string'}}}) == ['level3']\", \"assert find_integer_keys({'empty': {}}) == []\", \"assert find_integer_keys({'single_int': 42}) ==... | {
"split": "train",
"index": 84203,
"acecode_id": "evol_5045",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given `k` sorted integer arrays `nums[i]`, merge them into one sorted array. The number of elements initialized in each `nums[i]` are `n[i]` respectively. You may assume that the final array has a size equal to the sum of `n[i]` for all `i` such that it has enough space to hold... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_and_sort([[1,2,3],[2,5,6],[7,8,9]], [3,3,3]) == [1,2,2,3,5,6,7,8,9]\", \"assert merge_and_sort([[1],[2,3,4],[5,6]], [1,3,2]) == [1,2,3,4,5,6]\", \"assert merge_and_sort([[10, 20], [5, 15], [30]], [2, 2, 1]) == [5, 10, 15, 20, 30]\", \"assert merge_and_... | {
"split": "train",
"index": 84204,
"acecode_id": "evol_34714",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function that calculates the area of two-dimensional and surface area of three-dimensional figures based on the type and number of arguments provided. The function should determine which type of figure to evaluate based on the number and type of arguments: If two argum... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_area(5, 10) == 50\", \"assert calculate_area(7, 7) == 49\", \"assert calculate_area(3, 4, 5) == 94\", \"assert calculate_area(5, 7) == 35\", \"assert calculate_area(1, 1, 1) == 6\", \"assert calculate_area(10, 10) == 100\", \"assert calculate_area(... | {
"split": "train",
"index": 84205,
"acecode_id": "evol_7868",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a Pubmed ID as an integer, write a function that generates a complete Pubmed URL by concatenating the base URL 'https://pubmed.ncbi.nlm.nih.gov/' with the given Pubmed ID. The function should return this complete URL as a string. The input Pubmed ID is guaranteed to be a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert build_pubmed_url(123456) == 'https://pubmed.ncbi.nlm.nih.gov/123456'\", \"assert build_pubmed_url(789012) == 'https://pubmed.ncbi.nlm.nih.gov/789012'\", \"assert build_pubmed_url(456789) == 'https://pubmed.ncbi.nlm.nih.gov/456789'\", \"assert build_pubmed_ur... | {
"split": "train",
"index": 84206,
"acecode_id": "bigcode_python_fns_37569",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_person(name: str, age: int, role: str) -> dict` that takes three parameters: a string `name`, an integer `age`, and a string `role`. The function should return a dictionary that represents a person with the keys 'name', 'age', and 'role', and their ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_person('Alice', 30, 'Engineer') == {'name': 'Alice', 'age': 30, 'role': 'Engineer'}\", \"assert create_person('Bob', 25, 'Designer') == {'name': 'Bob', 'age': 25, 'role': 'Designer'}\", \"assert create_person('Charlie', 40, 'Manager') == {'name': 'Cha... | {
"split": "train",
"index": 84207,
"acecode_id": "evol_7052",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of plugin names and a list of target names, implement a function that filters the plugins based on the specified targets. The function should return a list of plugins that match the specified targets. If no targets are provided, the function should return all plugi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_plugins(['plugin1', 'plugin2', 'plugin3'], ['target1', 'target2']) == []\", \"assert filter_plugins(['plugin1', 'plugin2', 'plugin3'], ['target1']) == []\", \"assert filter_plugins(['plugin1', 'plugin2', 'plugin3'], ['target2']) == []\", \"assert filt... | {
"split": "train",
"index": 84208,
"acecode_id": "bigcode_python_fns_9325",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple sound management system where you need to simulate the loading and playing of sound effects using a `SoundLoader` class. The `SoundLoader` class is responsible for loading sound assets from file paths and returning them as sound objects... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert load_and_play_sound(SoundLoader(), 'valid_path.wav') == 'Sound loaded and played successfully.'\", \"assert load_and_play_sound(SoundLoader(), 'invalid_path.wav') == 'Error loading sound.'\", \"assert load_and_play_sound(SoundLoader(), 'non_existent_file.wav... | {
"split": "train",
"index": 84209,
"acecode_id": "oss_17309",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given two sentences, write a function `count_unique_common_words(sentence1: str, sentence2: str) -> int` that returns the count of unique words that are present in both sentences. The comparison should be case-insensitive and should consider words separated by spaces. Words sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_common_words('Hello world', 'hello there') == 1\", \"assert count_unique_common_words('Python is great', 'Java is also great') == 2\", \"assert count_unique_common_words('A quick brown fox', 'A lazy dog') == 1\", \"assert count_unique_common_wor... | {
"split": "train",
"index": 84210,
"acecode_id": "evol_16536",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are working on a cryptocurrency platform that deals with various coins and their associated transactions. Your task is to implement a function that calculates the number of unclaimed and claimed outputs for a specific coin. You will receive a list of nuggets, where each nug... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_outputs_per_coin([], 'coin1') == (0, 0)\", \"assert calculate_outputs_per_coin([{'coin_id': 'coin1', 'nid': 'n1', 'claimed': False}], 'coin1') == (1, 0)\", \"assert calculate_outputs_per_coin([{'coin_id': 'coin1', 'nid': 'n1', 'claimed': True}], 'c... | {
"split": "train",
"index": 84211,
"acecode_id": "oss_18202",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates playing a sound file. The function should take a string representing the filename (including the extension) and return a message indicating that the sound file is now playing. The function should not perform any actual soun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert play_sound('main.mp3') == 'Playing main.mp3'\", \"assert play_sound('background.mp3') == 'Playing background.mp3'\", \"assert play_sound('alert.wav') == 'Playing alert.wav'\", \"assert play_sound('notification.ogg') == 'Playing notification.ogg'\", \"assert ... | {
"split": "train",
"index": 84212,
"acecode_id": "bigcode_python_fns_45450",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of names, return a list of private names generated by appending a prefix 'private_' to each name. Implement the function `private_names(names: List[str]) -> List[str]`, where `names` is a list of strings representing the names. The function should return a list of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert private_names(['Alice', 'Bob']) == ['private_Alice', 'private_Bob']\", \"assert private_names(['John']) == ['private_John']\", \"assert private_names([]) == []\", \"assert private_names(['']) == ['private_']\", \"assert private_names(['Charlie', 'David', 'Ev... | {
"split": "train",
"index": 84213,
"acecode_id": "bigcode_python_fns_20486",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing cycle lengths. Write a function that returns the shortest and longest cycle lengths along with the counts of how many times they appear in the list. Additionally, return the minimum, mean, and maximum values of a separate list of du... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_cycles([1, 2, 3, 1, 2, 1], [0.1, 0.2, 0.3, 0.1, 0.2, 0.1]) == (1, 3, 3, 1, 0.1, 0.1, 0.1, 0.3, 0.3, 0.3)\", \"assert analyze_cycles([10, 10, 10], [1.0, 1.0, 1.0]) == (10, 10, 3, 3, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0)\", \"assert analyze_cycles([3, 2, 1, 2,... | {
"split": "train",
"index": 84214,
"acecode_id": "bigcode_python_fns_48607",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a logging function for web scraping activities. Your function will take a list of dictionaries, where each dictionary represents a log entry containing metadata related to web scraping activities. Each log entry will contain the keys: 'n_domains... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_log_entries([{'n_domains': 5, 'n_relevant_domains': 3, 'has_login_form': True, 'login_success': True}]) == ['Domains: 5, Relevant Domains: 3, Has Login Form: True, Login Success: True']\", \"assert format_log_entries([{'n_domains': 2, 'n_relevant_doma... | {
"split": "train",
"index": 84215,
"acecode_id": "oss_22870",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a grid representing a maze where each cell can either be a free space or a barrier. Your task is to implement a function `find_path(grid: List[List[int]], start: Tuple[int, int], end: Tuple[int, int]) -> List[Tuple[int, int]]` that returns the shortest path from t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_path([[1, 1, 1], [0, 0, 1], [1, 1, 1]], (0, 0), (2, 2)) == [(0, 0), (0, 1), (0, 2), (1, 2), (2, 2)]\", \"assert find_path([[1, 0, 1], [1, 0, 1], [1, 1, 1]], (0, 0), (2, 2)) == [(0, 0), (1, 0), (2, 0), (2, 1), (2, 2)]\", \"assert find_path([[1, 1], [1, 1... | {
"split": "train",
"index": 84216,
"acecode_id": "bigcode_python_fns_29587",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a list of properties representing different segments of an image. Each segment has various attributes such as 'id', 'xcentroid', 'ycentroid', 'segment_sum', etc. Your task is to create a function that constructs a table of these properties, including only the spec... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert properties_table([{'id': 1, 'xcentroid': 0.2, 'ycentroid': 0.8, 'segment_sum': 5.0}, {'id': 2, 'xcentroid': 2.09, 'ycentroid': 2.36, 'segment_sum': 55.0}], columns=['id', 'xcentroid']) == [{'id': 1, 'xcentroid': 0.2}, {'id': 2, 'xcentroid': 2.09}]\", \"asser... | {
"split": "train",
"index": 84217,
"acecode_id": "bigcode_python_fns_25971",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the generation of random data points for a simple data visualization system. Your function should return a list of \"n\" random floating-point numbers, where each number is between 0 and 1, inclusive. The function signa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_random_data(0) == []\", \"assert len(generate_random_data(1)) == 1\", \"assert all(0 <= x <= 1 for x in generate_random_data(5))\", \"assert len(generate_random_data(5)) == 5\", \"assert len(generate_random_data(10)) == 10\", \"assert all(isinstance... | {
"split": "train",
"index": 84218,
"acecode_id": "oss_11858",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers called 'data'. A local maximum is defined as an element that is greater than its neighbors. Your task is to write a function `first_localmax_index(data: List[int]) -> int` that returns the index of the first local maximum in the list. If the lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert first_localmax_index([1, 3, 2]) == 1\", \"assert first_localmax_index([3, 2, 1]) == 0\", \"assert first_localmax_index([0, 0, 0]) == 0\", \"assert first_localmax_index([1, 0, 1]) == 0\", \"assert first_localmax_index([5, 1, 5]) == 0\", \"assert first_localma... | {
"split": "train",
"index": 84219,
"acecode_id": "bigcode_python_fns_12230",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with finding the distance between two points in a 2D space given their coordinates. Implement a function `calculate_distance(x1: float, y1: float, x2: float, y2: float) -> float` that calculates the Euclidean distance between the points (x1, y1) and (x2, y2). The... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_distance(0, 0, 3, 4) == 5.0\", \"assert calculate_distance(1, 1, 1, 1) == 0.0\", \"assert calculate_distance(-1, -1, 1, 1) == 2.83\", \"assert calculate_distance(2, 3, 5, 7) == 5.0\", \"assert calculate_distance(0, 0, 0, 5) == 5.0\", \"assert calcu... | {
"split": "train",
"index": 84220,
"acecode_id": "bigcode_python_fns_17444",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a code snippet from a software license file. Your task is to write a program that can extract the license information from the given code snippet. The license information is contained within the comments in the code snippet. The license starts with the phrase 'Lic... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_license_info('# Licensed under the Apache License, Version 2.0\\\\n# specific language governing permissions and limitations\\\\n# under the License.') == 'specific language governing permissions and limitations'\", \"assert extract_license_info('# N... | {
"split": "train",
"index": 84221,
"acecode_id": "oss_5422",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a unique order number sequence for a shop. The function should take a shop ID (an integer), a prefix (a string), and an optional value (an integer) that represents the starting number of the sequence. If the value is not pr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_order_number_sequence(1, 'ORD', 5) == 'ORD-5'\", \"assert create_order_number_sequence(3, 'ORD', 10) == 'ORD-10'\", \"assert create_order_number_sequence(1, 'ORD', 100) == 'ORD-100'\", \"assert create_order_number_sequence(2, 'ORD', 20) == 'ORD-20'\",... | {
"split": "train",
"index": 84222,
"acecode_id": "bigcode_python_fns_7984",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a given version string is valid according to Semantic Versioning (SemVer). A valid version string follows the format 'MAJOR.MINOR.PATCH' where MAJOR, MINOR, and PATCH are non-negative integers. The function should return Tr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_version('1.0.0') == True\", \"assert is_valid_version('0.1.0') == True\", \"assert is_valid_version('1.2.3') == True\", \"assert is_valid_version('2.0.0') == True\", \"assert is_valid_version('1.0') == False\", \"assert is_valid_version('1.0.0.0') =... | {
"split": "train",
"index": 84223,
"acecode_id": "bigcode_python_fns_16181",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a URL. Your task is to implement a function that checks if the URL is valid based on the following criteria: The URL must start with 'http://' or 'https://', must contain at least one '.' character after the protocol, and must not have any sp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_url('https://www.example.com') == True\", \"assert is_valid_url('http://example.org') == True\", \"assert is_valid_url('http://example') == False\", \"assert is_valid_url('ftp://example.com') == False\", \"assert is_valid_url('https://example.com/pa... | {
"split": "train",
"index": 84224,
"acecode_id": "bigcode_python_fns_30399",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a string as input and converts it into a Python data structure. The input string can represent different types of values, including numbers, boolean values, lists of numbers, or hexadecimal strings. Your function should handle the following cases... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_from_string('true') == True\", \"assert convert_from_string('false') == False\", \"assert convert_from_string('42') == 42\", \"assert convert_from_string('3.14') == 3.14\", \"assert convert_from_string('0x1A') == 26\", \"assert convert_from_string('1... | {
"split": "train",
"index": 84225,
"acecode_id": "bigcode_python_fns_47632",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of HDUs (Header Data Units) from a FITS (Flexible Image Transport System) file and a specific HDU object. Each HDU has a header which may contain various keywords. Your task is to implement a function that returns the extension name of the BANDS HDU, if it ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_bands_hdu(['EBOUNDS', 'OTHER_HDU'], {'BANDSHDU': 'TestBand', 'NAXIS': 2}) == 'TestBand'\", \"assert find_bands_hdu(['OTHER_HDU'], {'BANDSHDU': 'Band1', 'NAXIS': 3}) == 'Band1'\", \"assert find_bands_hdu(['OTHER_HDU'], {'BANDSHDU': None, 'NAXIS': 3}) == ... | {
"split": "train",
"index": 84226,
"acecode_id": "bigcode_python_fns_24672",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating the behavior of a Samsung TV remote control. Your job is to implement a function `simulate_hold_key(key: str, duration: int) -> List[int]` that simulates holding down a remote control button for a specified duration. This function takes two parame... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_hold_key('KEY_POWER', 3) == [1, 2, 3]\", \"assert simulate_hold_key('KEY_VOLUME_UP', 2) == [1, 2]\", \"assert simulate_hold_key('KEY_MUTE', 1) == [1]\", \"assert simulate_hold_key('KEY_CHANNEL_UP', 0) == []\", \"assert simulate_hold_key('KEY_HOME', ... | {
"split": "train",
"index": 84227,
"acecode_id": "oss_26528",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two points in a 2D plane represented as tuples: `vector_start` and `vector_end`. Your task is to implement a function `is_diagonal_segment(vector_start, vector_end)` that determines whether the line segment connecting these two points is a diagonal segment. A diag... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_diagonal_segment((0, 0), (1, 1)) == True\", \"assert is_diagonal_segment((1, 1), (2, 2)) == True\", \"assert is_diagonal_segment((0, 1), (1, 0)) == True\", \"assert is_diagonal_segment((1, 0), (2, 1)) == True\", \"assert is_diagonal_segment((1, 2), (2, 1)... | {
"split": "train",
"index": 84228,
"acecode_id": "bigcode_python_fns_25969",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design an algorithm that categorizes a provided series of dates into consecutive weekly intervals. The input will be a list of date strings in 'YYYY-MM-DD' format. The algorithm should correctly categorize and sort the dates even if they are provided in a non-chronological orde... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert categorize_dates(['2021-12-25', '2022-01-01', '2022-01-02']) == [['2021-12-25'], ['2022-01-01', '2022-01-02']]\", \"assert categorize_dates(['2022-03-01', '2022-03-02', '2022-03-03']) == [['2022-03-01', '2022-03-02', '2022-03-03']]\", \"assert categorize_dat... | {
"split": "train",
"index": 84229,
"acecode_id": "evol_12993",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a JSON-like response from an API. The response contains a field called `nextPageToken`, which is either a string of the format 'number:number' or the value 'null'. Your task is to write a function that extracts the value of `nextPageToken` fr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_next_page_token('{\\\"nextPageToken\\\": \\\"123:456\\\"}') == '123:456'\", \"assert extract_next_page_token('{\\\"nextPageToken\\\": null}') == None\", \"assert extract_next_page_token('{\\\"nextPageToken\\\": \\\"789:012\\\"}') == '789:012'\", \"as... | {
"split": "train",
"index": 84230,
"acecode_id": "bigcode_python_fns_39065",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a virtual world populated by customizable characters called Toons. Each Toon is identified by a unique name and a DNA strand that determines its traits. Your job is to implement a function `create_toon(name: str, dna_strand: str) -> Toon` that takes... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_toon('Tom', 'ATGC') == Toon('Tom', 'ATGC')\", \"assert create_toon('Jerry', 'CGTA') == Toon('Jerry', 'CGTA')\", \"assert create_toon('Mickey', 'GATTACA') == Toon('Mickey', 'GATTACA')\", \"assert create_toon('Donald', 'AGCT') == Toon('Donald', 'AGCT')\... | {
"split": "train",
"index": 84231,
"acecode_id": "oss_2392",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `connect_to_database(db: str) -> sqlite3.Cursor` that attempts to connect to an SQLite database specified by the input string `db`. The function should handle potential database connection errors such as `OperationalError` or `DatabaseError`. Make sure that... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert connect_to_database('valid_database.db') is not None\", \"assert connect_to_database('another_valid_database.db') is not None\", \"assert connect_to_database('test.db') is not None\", \"assert connect_to_database('test_with_special_chars_!@#$%.db') is not No... | {
"split": "train",
"index": 84232,
"acecode_id": "evol_6232",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the application of quantum gates to a set of qubits. Implement a function `quantum_gate_simulator(num_qubits: int, operations: List[Tuple[str, List[int]]]) -> List[int]` that accepts the following parameters: \n1. `num_qubi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert quantum_gate_simulator(2, [('H', [0]), ('CNOT', [0, 1])]) == [1, 1]\", \"assert quantum_gate_simulator(1, [('X', [0])]) == [1]\", \"assert quantum_gate_simulator(2, [('H', [0]), ('H', [0])]) == [0, 0]\", \"assert quantum_gate_simulator(2, [('Z', [0])]) == [0... | {
"split": "train",
"index": 84233,
"acecode_id": "oss_28907",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple logging system for a fictional online store's inventory. Your goal is to implement a function that simulates logging transactions for the store's inventory. The function should accept a list of transactions, where each transaction is repres... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_inventory([('item1', 10, 'purchase'), ('item1', 5, 'sale')]) == {'item1': 5}\", \"assert log_inventory([('item1', 10, 'purchase'), ('item2', 5, 'sale')]) == {'item1': 10, 'item2': 0}\", \"assert log_inventory([('item1', 10, 'purchase'), ('item1', 15, 'pu... | {
"split": "train",
"index": 84234,
"acecode_id": "oss_19032",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating the distribution of molecules among multiple processes in a parallelized molecular dynamics simulation. Given a list of molecules and the total number of processes, your goal is to determine how many molecules each process will handle and which mo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert distribute_molecules(['H2O', 'CO2', 'O2', 'N2'], 2) == [['H2O', 'CO2'], ['O2', 'N2']]\", \"assert distribute_molecules(['H', 'He', 'Li', 'Be', 'B', 'C', 'N'], 3) == [['H', 'He', 'Li'], ['Be', 'B'], ['C', 'N']]\", \"assert distribute_molecules(['A', 'B', 'C']... | {
"split": "train",
"index": 84235,
"acecode_id": "oss_20546",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function that receives three input parameters - a string, a character (which can be a string of multiple characters), and a number. The function should return true if the character appears in the string exactly the specified number of times in a non-consecutive fashion... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_character('hello world', 'h', 1) == True\", \"assert check_character('abcabcabc', 'abc', 4) == False\", \"assert check_character('aaaaaa', 'a', 4) == False\", \"assert check_character('abcdefg', 'h', 0) == True\", \"assert check_character('abcdabcd', '... | {
"split": "train",
"index": 84236,
"acecode_id": "evol_10590",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the execution of a command-line tool by processing a given file path string. Your function should take a single string input which represents a file path. The function should return a string indicating whether the execution... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert execute_command('C:/path/to/file.txt') == 'Execution successful'\", \"assert execute_command('C:/path/to/file.doc') == 'Error: Invalid file path'\", \"assert execute_command('file.txt') == 'Execution successful'\", \"assert execute_command('C:/folder/file.tx... | {
"split": "train",
"index": 84237,
"acecode_id": "bigcode_python_fns_19878",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simplified version of a trade API for a cryptocurrency exchange. Your function should take the following parameters: `api_key` (a string representing the API key for authentication), `symbol` (a string representing the symbol of the cryptocurr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert trade_api('my_api_key', 'BTC', 1.5, 50000.0, 'buy', 1633046400) == {'symbol': 'btc', 'exchange': 'exchange_name', 'price': '50000.0', 'avg_execution_price': '50000.0', 'side': 'buy', 'type': 'exchange_limit', 'timestamp': '1633046400'}\", \"assert trade_api(... | {
"split": "train",
"index": 84238,
"acecode_id": "oss_15622",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_bank_account(name: str, balance: float, interest_rate: float) -> dict` that creates a bank account represented by a dictionary with attributes 'name', 'balance', and 'interest_rate'. The function should ensure that the 'interest_rate' is between 0 a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_bank_account('Alice', 1000.0, 0.05) == {'name': 'Alice', 'balance': 1000.0, 'interest_rate': 0.05}\", \"assert create_bank_account('Bob', 500.0, 0.0) == {'name': 'Bob', 'balance': 500.0, 'interest_rate': 0.0}\", \"assert create_bank_account('Charlie',... | {
"split": "train",
"index": 84239,
"acecode_id": "evol_13274",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function `even_odd_count(num)` that takes an integer `num` as input and returns a tuple containing the count of even digits and the count of odd digits in its absolute value representation. The function should handle both positive and negative integers. For example,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert even_odd_count(-12) == (1, 1)\", \"assert even_odd_count(123) == (1, 2)\", \"assert even_odd_count(0) == (1, 0)\", \"assert even_odd_count(-2468) == (4, 0)\", \"assert even_odd_count(13579) == (0, 5)\", \"assert even_odd_count(-1010) == (2, 2)\", \"assert ev... | {
"split": "train",
"index": 84240,
"acecode_id": "evol_21427",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a unique identifier for document types based on a given list of names. The function should take a list of strings, where each string represents the name of a document type. The function should return a dictionary where the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_document_type_ids(['Passport', 'ID Card', 'Driver License']) == {'Passport': 1, 'ID Card': 2, 'Driver License': 3}\", \"assert generate_document_type_ids(['Passport', 'Passport', 'ID Card']) == {'Passport': 1, 'ID Card': 2}\", \"assert generate_docu... | {
"split": "train",
"index": 84241,
"acecode_id": "oss_35196",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing daily temperatures, write a function `daily_temperature_analysis(temperatures: List[int]) -> List[float]` that returns a list of floats where each entry at index `i` represents the average temperature of the past 7 days including the temper... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert daily_temperature_analysis([50]) == [50.0]\", \"assert daily_temperature_analysis([60, 62, 64, 66, 68, 70, 72]) == [60.0, 61.0, 62.0, 63.0, 64.0, 65.0, 66.0]\", \"assert daily_temperature_analysis([100, 90, 80, 70, 60, 50]) == [100.0, 95.0, 90.0, 85.0, 80.0,... | {
"split": "train",
"index": 84242,
"acecode_id": "bigcode_python_fns_19155",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that determines the file path for serving a static file based on provided URL parameters. The function should have the following behavior: If no parameters are provided, it should return 'index.html'. If parameters are provided, it sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_static_file_path() == 'index.html'\", \"assert get_static_file_path(param1='value1') == 'param1.html'\", \"assert get_static_file_path(param2='value2') == 'param2.html'\", \"assert get_static_file_path() == 'index.html'\", \"assert get_static_file_path(p... | {
"split": "train",
"index": 84243,
"acecode_id": "oss_16975",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the percentage of a specific type of event occurring out of a total number of events. Specifically, you need to implement a function that computes the percentage of `specific_events` out of `total_events`. The function should take two integers as... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_event_percentage(100, 25) == 25.00\", \"assert calculate_event_percentage(200, 50) == 25.00\", \"assert calculate_event_percentage(0, 0) == 0.00\", \"assert calculate_event_percentage(10, 0) == 0.00\", \"assert calculate_event_percentage(5, 5) == 1... | {
"split": "train",
"index": 84244,
"acecode_id": "oss_3269",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two integers a and b, implement a function that computes a raised to the power of b (a^b) using recursion. Your function should return the result as an integer. Note that the exponent b can be zero, in which case the result should be 1, regardless of the value of a. If b ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rec_pow(2, 3) == 8\", \"assert rec_pow(5, 0) == 1\", \"assert rec_pow(7, 2) == 49\", \"assert rec_pow(10, 1) == 10\", \"assert rec_pow(3, 4) == 81\", \"assert rec_pow(2, 10) == 1024\", \"assert rec_pow(1, 100) == 1\", \"assert rec_pow(4, 0) == 1\", \"assert ... | {
"split": "train",
"index": 84245,
"acecode_id": "bigcode_python_fns_42402",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `count_primes(n)` that takes an integer `n` as input and returns the number of prime numbers less than `n`. A prime number is a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. The functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_primes(0) == 0\", \"assert count_primes(1) == 0\", \"assert count_primes(2) == 0\", \"assert count_primes(3) == 1\", \"assert count_primes(4) == 2\", \"assert count_primes(6) == 3\", \"assert count_primes(8) == 4\", \"assert count_primes(9) == 4\", \"a... | {
"split": "train",
"index": 84246,
"acecode_id": "oss_4404",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given three numerical arrays, `a`, `b`, and `c`, write a function `common_elements_in_disparity(a, b, c)` that computes the absolute differences of corresponding elements in `a` and `b`, storing the result in a new array `d`. The function should then return the elements that ar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert common_elements_in_disparity([0, 0, 0], [0, 0, 0], [0]) == [0]\", \"assert common_elements_in_disparity([10, 20], [5, 15], [5, 10, 15]) == [5]\", \"assert common_elements_in_disparity([], [], [1, 2, 3]) == []\", \"assert common_elements_in_disparity([-3], [3... | {
"split": "train",
"index": 84247,
"acecode_id": "evol_3824",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the production output of a factory over a series of days. Your task is to implement a function `max_production_days(output: List[int]) -> int` that returns the maximum number of consecutive days where the production output is greate... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_production_days([1, 2, 3, 4, 5], 0) == 5\", \"assert max_production_days([0, 0, 0, 0], 1) == 0\", \"assert max_production_days([6, 7, 8, 9, 10], 5) == 5\", \"assert max_production_days([10, 5, 10, 5, 10], 5) == 1\", \"assert max_production_days([], 5) ==... | {
"split": "train",
"index": 84248,
"acecode_id": "bigcode_python_fns_44699",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Develop a function that, given a string of multilingual Unicode text, counts the occurrence of unique palindromes. The function should ignore case sensitivity and handle special cases such as palindromic punctuation and diacritics. The function should return a dictionary where ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_palindromes('A man, a plan, a canal: Panama') == {'amanaplanacanalpanama': 1}\", \"assert find_palindromes('Was it a car or a cat I saw?') == {'wasitacaroracatisaw': 1}\", \"assert find_palindromes('') == {}\", \"assert find_palindromes('Step on no pets... | {
"split": "train",
"index": 84249,
"acecode_id": "evol_292",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple command-line argument parser for a machine learning model configuration. The function will accept a list of tuples where each tuple contains three elements: the name of the argument (string), the type of the ar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simple_arg_parser([]) == {'--log_interval': 100, '--loss_margin': 0.5, '--loss_type': 'mse', '--max_length': 128, '--num_labels': 1}\", \"assert simple_arg_parser([('--learning_rate', 'float', 0.001)]) == {'--log_interval': 100, '--loss_margin': 0.5, '--loss... | {
"split": "train",
"index": 84250,
"acecode_id": "oss_23239",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves a mapping of user IDs to their corresponding screen names from a list of user data. You will be provided with a list of user data, where each user is represented as a dictionary containing 'id' and 'screen_name'. Your funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert map_user_ids_to_screen_names([{ 'id': '1', 'screen_name': 'user1' }, { 'id': '2', 'screen_name': 'user2' }]) == {'1': 'user1', '2': 'user2'}\", \"assert map_user_ids_to_screen_names([{ 'id': '3', 'screen_name': 'user3' }, { 'id': '4', 'screen_name': 'user4' ... | {
"split": "train",
"index": 84251,
"acecode_id": "bigcode_python_fns_38319",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given the string `croakOfFrogs`, which represents a combination of the string 'croak' from different frogs, where each frog has a unique sound represented by a unique character. A valid 'croak' means a frog is producing the characters 'c', 'r', 'o', 'a', 'k' sequentially. Your ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert minNumberOfFrogs('croakcroak') == 1\", \"assert minNumberOfFrogs('crcoakroak') == 2\", \"assert minNumberOfFrogs('croakcrook') == -1\", \"assert minNumberOfFrogs('croakcroa') == -1\", \"assert minNumberOfFrogs('crrooaakk') == -1\", \"assert minNumberOfFrogs(... | {
"split": "train",
"index": 84252,
"acecode_id": "evol_32208",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function `fibonacci_up_to(limit: int) -> List[int]` that generates and returns a list of all Fibonacci numbers up to a given limit. The Fibonacci sequence is defined such that each number after the first two is the sum of the two preceding ones, starting with 0 and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci_up_to(0) == [0]\", \"assert fibonacci_up_to(4) == [0, 1, 1, 2, 3]\", \"assert fibonacci_up_to(5) == [0, 1, 1, 2, 3, 5]\", \"assert fibonacci_up_to(6) == [0, 1, 1, 2, 3, 5]\", \"assert fibonacci_up_to(7) == [0, 1, 1, 2, 3, 5]\", \"assert fibonacci_u... | {
"split": "train",
"index": 84253,
"acecode_id": "evol_22550",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a list of dictionaries representing student records. Each dictionary contains the student's name, age, and a list of their exam scores. Your function should calculate the average exam score for each student and a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_student_records([{'name': 'Alice', 'age': 20, 'exam_scores': [85, 90, 92]}]) == [{'name': 'Alice', 'age': 20, 'exam_scores': [85, 90, 92], 'avg_score': 89.0}]\", \"assert process_student_records([{'name': 'Bob', 'age': 21, 'exam_scores': [78, 85, 90]... | {
"split": "train",
"index": 84254,
"acecode_id": "oss_26136",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string consisting of uppercase English letters, convert the string to a corresponding number based on a specific encoding scheme. The encoding scheme works as follows: The rightmost character corresponds to the value of 1, the next character to the left corresponds to 2... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert char_to_num('A') == 1\", \"assert char_to_num('B') == 2\", \"assert char_to_num('C') == 3\", \"assert char_to_num('Z') == 26\", \"assert char_to_num('AA') == 27\", \"assert char_to_num('AB') == 28\", \"assert char_to_num('AZ') == 52\", \"assert char_to_num('... | {
"split": "train",
"index": 84255,
"acecode_id": "bigcode_python_fns_10097",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a collection of repositories. Each repository has a name, associated information, and a status. Your goal is to implement a function `manage_repositories` that performs the following operations based on a list of commands: \n\n1. `ADD name info stat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_repositories([\\\"ADD repo1 13 SUCCEED\\\", \\\"ADD repo2 14 FAILED\\\", \\\"GET_INFO repo1\\\", \\\"GET_ALL_NAMES\\\"]) == [{'info': '13', 'status': 'SUCCEED'}, ['repo1', 'repo2']]\", \"assert manage_repositories([\\\"ADD repo1 13 SUCCEED\\\", \\\"AD... | {
"split": "train",
"index": 84256,
"acecode_id": "oss_4651",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a custom data structure called `CustomMatrix` that represents a matrix. Your implementation should include a method `get_row` which allows accessing the rows of the matrix using integer indices. The `get_row` method should be defined as follows:... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert CustomMatrix([[1, 2], [3, 4], [5, 6]]).get_row(0) == [1, 2]\", \"assert CustomMatrix([[1], [2], [3]]).get_row(1) == [2]\", \"assert CustomMatrix([[0, 0, 0], [1, 1, 1]]).get_row(1) == [1, 1, 1]\", \"assert CustomMatrix([[1, 2], [3, 4], [5, 6]]).get_row(2) == ... | {
"split": "train",
"index": 84257,
"acecode_id": "oss_31964",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a full name as a string, write a function `abbreviate_name(name: str) -> str` that returns an abbreviated version of the name. The abbreviated version should consist of the first initial of each part of the name followed by a period, except for the last part which should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert abbreviate_name('John Smith') == 'J. Smith'\", \"assert abbreviate_name('Alice Wonderland') == 'A. Wonderland'\", \"assert abbreviate_name('Bob') == 'Bob'\", \"assert abbreviate_name('Charlie Brown') == 'C. Brown'\", \"assert abbreviate_name('Diana Prince') ... | {
"split": "train",
"index": 84258,
"acecode_id": "evol_14661",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a binary image represented as a 2D list of integers, where '1' represents an object and '0' represents the background, write a function `get_object_ratio(image: List[List[int]]) -> float` that calculates the ratio of the number of '1's (objects) in the image to the total ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_object_ratio([[1, 0], [0, 1]]) == 0.5\", \"assert get_object_ratio([[1, 1], [1, 1]]) == 1.0\", \"assert get_object_ratio([[0, 0], [0, 0]]) == 0.0\", \"assert get_object_ratio([[1, 0, 1], [0, 0, 0]]) == 0.3333333333333333\", \"assert get_object_ratio([[1]... | {
"split": "train",
"index": 84259,
"acecode_id": "bigcode_python_fns_18869",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function called `get_coverage_info` that retrieves coverage information for a given geographical point and a date since which the coverage information is required. The function will take a list of two floats representing the geographical point (lo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_coverage_info([138.59707796614592, -34.91729448760797], '2015-07-01') == 'Coverage available'\", \"assert get_coverage_info([138.59707796614592, -34.91729448760797], '2015-01-01') == 'Coverage available'\", \"assert get_coverage_info([138.59707796614592,... | {
"split": "train",
"index": 84260,
"acecode_id": "oss_22591",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `allow_ssh_access(username: str, container_id: str) -> str` that modifies the sudoers file and PAM configuration for a specific user on a given container. The function should take in a username and a container ID as parameters. The functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert allow_ssh_access('cfyuser', 'container123') == 'Access granted for cfyuser'\", \"assert allow_ssh_access('admin', 'container456') == 'Access granted for admin'\", \"assert allow_ssh_access('user1', 'container789') == 'Access granted for user1'\", \"assert al... | {
"split": "train",
"index": 84261,
"acecode_id": "bigcode_python_fns_49058",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a captcha and a cookie string. Your task is to implement a function that checks if the captcha is valid based on predefined rules. The function should return True if the captcha matches the required format and is considered valid, or False if... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_captcha('captcha1234', 'session_cookie') == True\", \"assert is_valid_captcha('CAPTCHA5678', 'session_cookie') == True\", \"assert is_valid_captcha('CAPTCHA123', 'session_cookie') == False\", \"assert is_valid_captcha('1234abcd', 'session_cookie') =... | {
"split": "train",
"index": 84262,
"acecode_id": "bigcode_python_fns_31232",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a string representing a geographical location in the format 'latitude,longitude'. The function should return a tuple with the latitude and longitude as floating-point numbers. If the input string is empty, the function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_latlong('34.0522,-118.2437') == (34.0522, -118.2437)\", \"assert parse_latlong('40.7128,-74.0060') == (40.7128, -74.006)\", \"assert parse_latlong('51.5074,0.1278') == (51.5074, 0.1278)\", \"assert parse_latlong('0.0,0.0') == (0.0, 0.0)\", \"assert par... | {
"split": "train",
"index": 84263,
"acecode_id": "bigcode_python_fns_5015",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of numerical values representing temperature changes at certain points along a 1D line, implement a function that calculates the Laplacian of these values. The Laplacian is defined as the second derivative of the values with respect to their positions. You will rec... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert laplacian([1.0, 2.0, 3.0], [0.0, 1.0, 2.0]) == [0.0, 0.0, 0.0]\", \"assert laplacian([2.0, 4.0, 6.0], [0.0, 1.0, 2.0]) == [0.0, 0.0, 0.0]\", \"assert laplacian([1.0, 3.0, 5.0, 7.0], [0.0, 1.0, 2.0, 3.0]) == [0.0, 0.0, 0.0, 0.0]\", \"assert laplacian([5.0, 10... | {
"split": "train",
"index": 84264,
"acecode_id": "bigcode_python_fns_36466",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program to manage a list of integers representing data about individuals. Your task is to implement a Python function that takes a list of integers as input, where each integer represents data for a person. The function should return a list of lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert organize_people_data([1, 2, 3, 4, 5, 6], 3) == [[1, 2, 3], [4, 5, 6]]\", \"assert organize_people_data([], 3) == []\", \"assert organize_people_data([10, 20, 30], 1) == [[10], [20], [30]]\", \"assert organize_people_data([1, 2, 3, 4], 2) == [[1, 2], [3, 4]]\... | {
"split": "train",
"index": 84265,
"acecode_id": "oss_12191",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes HTTP headers and parameters for a web request. Your function should extract specific information from the provided headers and parameters and return them in a structured format. You need to implement a function called `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_request({'User-Agent': 'Mozilla/5.0', 'content-type': 'application/json', 'Referer': 'https://example.com'}, {'x-algolia-agent': 'Algolia Agent', 'x-algolia-application-id': '12345'}) == {'user_agent': 'Mozilla/5.0', 'content_type': 'application/json... | {
"split": "train",
"index": 84266,
"acecode_id": "oss_3948",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `exponential_diff(l: list, k: int, x: int, strict: bool = False) -> bool` that checks if the difference between every two successive elements in the list is the k'th power of x. If the option 'strict' is true, no two neighboring elements can be the same; ot... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert exponential_diff([1, 2, 4, 16], 2, 2) == False\", \"assert exponential_diff([1, 3, 6, 27], 3, 2) == False\", \"assert exponential_diff([1, 5, 9], 1, 4) == False\", \"assert exponential_diff([2, 2, 2], 0, 0, strict=True) == False\", \"assert exponential_diff(... | {
"split": "train",
"index": 84267,
"acecode_id": "evol_5254",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes in a list of user dictionaries and returns a list of full names for each user. Each user dictionary contains the keys: 'name_first', 'name_last', and an optional key 'name_suffix'. Your function should concatenate the first nam... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_full_names([{'name_first': 'John', 'name_last': 'Doe'}, {'name_first': 'Jane', 'name_last': 'Smith'}]) == ['John Doe', 'Jane Smith']\", \"assert get_full_names([{'name_first': 'Alice', 'name_last': 'Wonderland', 'name_suffix': 'PhD'}, {'name_first': 'Bob... | {
"split": "train",
"index": 84268,
"acecode_id": "oss_119",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `send_alert(topic: str, msg: str) -> str` that sends an alert message to a specified channel in a mock Slack environment whenever a new message is posted to a given topic. The function should return a confirmation message in the format: 'New message posted ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert send_alert('Sports', 'Game results are in!') == \\\"New message posted on 'Sports': Game results are in!\\\"\", \"assert send_alert('Weather', 'It will rain tomorrow.') == \\\"New message posted on 'Weather': It will rain tomorrow.\\\"\", \"assert send_alert... | {
"split": "train",
"index": 84269,
"acecode_id": "evol_5906",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing levels of characters in a game. Your task is to write a function that finds the maximum light level among all the characters. You need to implement a function `max_light_level(levels: List[int]) -> int` where `levels` is a list of i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_light_level([100, 200, 300]) == 300\", \"assert max_light_level([1500, 3000, 2500, 4000, 500]) == 4000\", \"assert max_light_level([1, 2, 3, 4, 5]) == 5\", \"assert max_light_level([10000]) == 10000\", \"assert max_light_level([9999, 9998, 9997]) == 9999... | {
"split": "train",
"index": 84270,
"acecode_id": "bigcode_python_fns_39092",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary that contains popularity scores where the keys are terms related to various topics and the values are their corresponding scores. Your task is to create a function that maps these keys to more meaningful terms based on a predefined mapping. Specifical... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert map_popularity_score_keys({'cat': 5, 'dog': 10}) == {'feline': 5, 'canine': 10}\", \"assert map_popularity_score_keys({'car': 15, 'tree': 20}) == {'vehicle': 15, 'plant': 20}\", \"assert map_popularity_score_keys({'cat': 1, 'tree': 2, 'unknown': 3}) == {'fel... | {
"split": "train",
"index": 84271,
"acecode_id": "bigcode_python_fns_38361",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string `comment`, which may contain specific commands related to a keyword. Your task is to implement a function `process_comment(comment: str) -> str` that processes the comment based on the following rules:\n\n1. If the keyword 'hello' is not present in the co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_comment('This is a test comment without the keyword.') == '0000000'\", \"assert process_comment('hello http://example.com/image.bmp Invalid image format') == '//AN ERROR OCCURRED WITH THE IMAGE!'\", \"assert process_comment('hello say ') == ''\", ... | {
"split": "train",
"index": 84272,
"acecode_id": "bigcode_python_fns_31014",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Implement a function `enhanced_consonant_count(s: str) -> int` that returns the total number of consonants found in the input string, counting them in a specific order from least to most common (starting from 'z' to 'b'). Consonants are defined as all letters in the English alp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert enhanced_consonant_count('') == 0\", \"assert enhanced_consonant_count('xyz') == 3\", \"assert enhanced_consonant_count('AEIOU') == 0\", \"assert enhanced_consonant_count('Python') == 5\", \"assert enhanced_consonant_count('Jumped Over') == 6\", \"assert enh... | {
"split": "train",
"index": 84273,
"acecode_id": "evol_9708",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a version string in the format 'major.minor', where 'major' and 'minor' are non-negative integers, implement a function that converts this version string into a tuple of integers (major, minor). If the version string is not in the correct format, the function should raise... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_version_to_tuple('1.0') == (1, 0)\", \"assert convert_version_to_tuple('2.5') == (2, 5)\", \"assert convert_version_to_tuple('10.20') == (10, 20)\", \"assert convert_version_to_tuple('0.1') == (0, 1)\", \"assert convert_version_to_tuple('3.14') == (3... | {
"split": "train",
"index": 84274,
"acecode_id": "bigcode_python_fns_40677",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of joint names representing different parts of a robotic hand. Each joint name consists of a combination of words separated by underscores. Your task is to write a function that extracts the unique base names from the joint names and returns them in a sorte... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_base_names(['thumb_joint', 'index_joint', 'middle_joint', 'ring_joint', 'pinky_joint']) == ['index', 'middle', 'pinky', 'ring', 'thumb']\", \"assert extract_base_names(['left_thumb_joint', 'right_thumb_joint']) == ['left', 'right']\", \"assert extrac... | {
"split": "train",
"index": 84275,
"acecode_id": "oss_29293",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a string of phrases separated by spaces, transform the last two characters of each phrase into uppercase letters. Return the modified string. If a phrase has less than two characters, leave it unchanged. Implement the function `transform_last_two_upper(str_input: str) -> ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_last_two_upper('hello world') == 'helLO worLD'\", \"assert transform_last_two_upper('') == ''\", \"assert transform_last_two_upper('hi') == 'HI'\", \"assert transform_last_two_upper('single') == 'singLE'\", \"assert transform_last_two_upper('ab') =... | {
"split": "train",
"index": 84276,
"acecode_id": "evol_11970",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function to calculate the fare for a taxi ride based on the distance traveled. The fare is calculated at a rate of $2.50 per kilometer. Your function should take a single parameter, `distance`, which represents the distance in kilometers, and retu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_fare(0) == 0.0\", \"assert calculate_fare(1) == 2.5\", \"assert calculate_fare(2) == 5.0\", \"assert calculate_fare(5) == 12.5\", \"assert calculate_fare(10) == 25.0\", \"assert calculate_fare(15.5) == 38.75\", \"assert calculate_fare(20) == 50.0\"... | {
"split": "train",
"index": 84277,
"acecode_id": "oss_32561",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that manages user IDs for a system. The function should simulate the following operations in a sequence: 1. Initialize the user ID to a default value of 1 if no initial ID is provided. 2. Retrieve the current user ID. 3. Increment the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_user_id([('initialize', None), ('get_id', None)]) == [1]\", \"assert manage_user_id([('initialize', 10), ('get_id', None)]) == [10]\", \"assert manage_user_id([('initialize', None), ('increment_id', 3), ('get_id', None)]) == [4]\", \"assert manage_use... | {
"split": "train",
"index": 84278,
"acecode_id": "oss_25602",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that returns the nth Fibonacci number. The Fibonacci sequence is defined as follows: F(0) = 0, F(1) = 1, and F(n) = F(n-1) + F(n-2) for n > 1. Your function should take an integer n (n >= 0) as input and return the nth Fibonacci number.\nPlease reason step ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibo(0) == 0\", \"assert fibo(1) == 1\", \"assert fibo(2) == 1\", \"assert fibo(3) == 2\", \"assert fibo(4) == 3\", \"assert fibo(5) == 5\", \"assert fibo(6) == 8\", \"assert fibo(7) == 13\", \"assert fibo(8) == 21\", \"assert fibo(9) == 34\", \"assert fibo(... | {
"split": "train",
"index": 84279,
"acecode_id": "evol_12471",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that prunes a list of characters based on their probabilities. The function should take in a list of characters along with their corresponding probabilities and a cutoff number for pruning. The pruning mechanism should only consider t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert prune_top_characters([('a', 0.3), ('b', 0.2), ('c', 0.1), ('d', 0.4)], 2) == ['d', 'a']\", \"assert prune_top_characters([('x', 0.1), ('y', 0.6), ('z', 0.3)], 1) == ['y']\", \"assert prune_top_characters([('p', 0.5), ('q', 0.5), ('r', 0.1)], 3) == ['p', 'q',... | {
"split": "train",
"index": 84280,
"acecode_id": "oss_439",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of numbers, `x` and `y`, implement a function called `calculate_corr_coef` that calculates the Pearson correlation coefficient between the two lists. The Pearson correlation coefficient is a measure of the linear correlation between two sets of data, ranging fro... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_corr_coef([1, 2, 3], [4, 5, 6]) == 1.0\", \"assert calculate_corr_coef([1, 2, 3], [6, 5, 4]) == -1.0\", \"assert abs(calculate_corr_coef([1, 2, 3], [1, 2, 3]) - 1.0) < 1e-9\", \"assert abs(calculate_corr_coef([1, 3, 2], [2, 4, 3]) - 0.9999999999999... | {
"split": "train",
"index": 84281,
"acecode_id": "evol_8490",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that determines the boolean flags for two classifiers based on a given classifier input. Implement the function `set_classifier_flags(classifier: str) -> Tuple[bool, bool]` where the input is a string `classifier`. The function should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_classifier_flags('N') == (True, False)\", \"assert set_classifier_flags('D') == (False, True)\", \"assert set_classifier_flags('') == (False, False)\", \"assert set_classifier_flags('X') == (False, False)\", \"assert set_classifier_flags('N ') == (False,... | {
"split": "train",
"index": 84282,
"acecode_id": "oss_30024",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of words, where each word can be represented as an index in the list. Each index can lead to other indices, forming a directed graph where each index has a list of indices it can point to. Your task is to determine the total number of unique valid sequences... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_valid_sequences([[1, 2], [3], [3], []]) == 2\", \"assert count_valid_sequences([[1, 2], [3], [3], []]) == 2\", \"assert count_valid_sequences([[1], [2], [3], []]) == 1\", \"assert count_valid_sequences([[1], [2], [], [3]]) == 0\", \"assert count_valid_... | {
"split": "train",
"index": 84283,
"acecode_id": "bigcode_python_fns_49141",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple wallet system for a digital currency. The wallet system should allow users to deposit, withdraw, and check their balance. You need to implement a function `wallet_operations(operations: List[Tuple[str, int]]) -> List[int]` where `operat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert wallet_operations([('deposit', 100), ('withdraw', 50)]) == [100, 50]\", \"assert wallet_operations([('deposit', 200), ('withdraw', 150), ('withdraw', 100)]) == [200, 50, 50]\", \"assert wallet_operations([('withdraw', 50)]) == [0]\", \"assert wallet_operatio... | {
"split": "train",
"index": 84284,
"acecode_id": "oss_28896",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the configuration of a virtual machine (VM) for a QEMU environment. The function should take the following parameters: target_name (str), nw_name (str), mac_addr (str), ipv4_addr (str), ipv6_addr (str), disk_size (str), ram... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert configure_vm('qemu-x86-64-01', 'nwa', '02:61:00:00:00:01', '192.168.95.1', 'fc00::61:01', '30G', 2048, ['ttyS0'], '1:4:5:5', '') == {'target_name': 'qemu-x86-64-01', 'nw_name': 'nwa', 'mac_addr': '02:61:00:00:00:01', 'ipv4_addr': '192.168.95.1', 'ipv6_addr':... | {
"split": "train",
"index": 84285,
"acecode_id": "bigcode_python_fns_8667",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a string containing lines of text, where each line may contain a specification of magnetic moments in the format 'MAGMOM = x*y', where x is the number of atoms and y is the magnetic moment value for each atom. Your task is to implement a function that extracts all... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_magnetic_moments('MAGMOM = 2*1.5\\\\nMAGMOM = 3*0.5') == [1.5, 1.5, 0.5, 0.5, 0.5]\", \"assert extract_magnetic_moments('') == []\", \"assert extract_magnetic_moments('MAGMOM = 1*2.0\\\\nMAGMOM = 0*1.0') == [2.0]\", \"assert extract_magnetic_moments(... | {
"split": "train",
"index": 84286,
"acecode_id": "bigcode_python_fns_16841",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python decorator that logs the execution time of a function and returns its output. The decorator should print the function's name, the arguments it was called with, and the execution time to the console every time the function is invoked. Additio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_execution_time(lambda x, y: x + y)(1, 2) == 3\", \"assert log_execution_time(lambda a, b, c=5: a * b + c)(2, 3) == 11\", \"assert log_execution_time(lambda x, y, z=1: (x + y) * z)(3, 4, 2) == 14\", \"assert log_execution_time(lambda a, b: a - b)(10, 5) =... | {
"split": "train",
"index": 84287,
"acecode_id": "oss_4570",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a Python function that identifies the longest recurring substring in a given text string. The function should return the longest recurring substring. If there are multiple substrings of the same length, the function should return the first one that appears in the string.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longest_repeating_substring('banana') == 'ana'\", \"assert longest_repeating_substring('abcde') == ''\", \"assert longest_repeating_substring('abcdabc') == 'abc'\", \"assert longest_repeating_substring('') == ''\", \"assert longest_repeating_substring('12312... | {
"split": "train",
"index": 84288,
"acecode_id": "evol_29023",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the addition of attributes to a CSS syntax element. The function should take in the name of the CSS element and a list of tuples, where each tuple contains an attribute name and its corresponding value. The function should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert css_attributes('div', [('color', 'red'), ('font-size', '16px')]) == {'color': 'red', 'font-size': '16px'}\", \"assert css_attributes('p', [('margin', '10px'), ('padding', '5px')]) == {'margin': '10px', 'padding': '5px'}\", \"assert css_attributes('h1', [('te... | {
"split": "train",
"index": 84289,
"acecode_id": "oss_19657",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with analyzing the distribution of emails by hour of the day. You are given a list of strings, where each string represents an email timestamp in the format 'From day month time year'. The 'time' is in the format 'hour:minute:second'. Your program should read thr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert email_distribution(['From user3@example.com Tue Jan 2 12:30:30 2020', 'From user4@example.com Tue Jan 2 12:45:45 2020']) == ['12 2']\", \"assert email_distribution(['From user5@example.com Wed Jan 3 13:00:00 2020', 'From user6@example.com Wed Jan 3 14:00... | {
"split": "train",
"index": 84290,
"acecode_id": "oss_31338",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given an object `obj`, which can be a scalar value, an array, or an iterable (like a list or a tuple), implement a function `heat_type_of(obj)` that returns a string representing the type of the given object based on the following rules: If the object has a `dtype` attribute, r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert heat_type_of(5) == 'scalar'\", \"assert heat_type_of(3.14) == 'scalar'\", \"assert heat_type_of('hello') == 'scalar'\", \"assert heat_type_of('') == 'scalar'\", \"assert heat_type_of(True) == 'scalar'\", \"assert heat_type_of(b'bytes') == 'scalar'\"]}"
} | {
"split": "train",
"index": 84291,
"acecode_id": "bigcode_python_fns_39056",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Implement a function that checks if two given strings are anagrams of each other. The strings may contain numbers and special characters, which should be ignored in the comparison. The comparison should be case-insensitive. Your function should return True if the strings are an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert anagram_check('Listen!', 'Silent') == True\", \"assert anagram_check('Triangle', 'Integral') == True\", \"assert anagram_check('Apple123', 'P!le@ap') == True\", \"assert anagram_check('Astronomer', 'Moon starer') == True\", \"assert anagram_check('The Morse ... | {
"split": "train",
"index": 84292,
"acecode_id": "evol_24862",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `verify_sequence(sequence: str) -> bool` that checks if a given string contains interleaved uppercase letters and digits, following these criteria: the string must start with an uppercase letter, end with a digit, and contain at least one digit. For example, va... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert verify_sequence('A1B2') == True\", \"assert verify_sequence('A2') == True\", \"assert verify_sequence('B3C4D5') == True\", \"assert verify_sequence('A1C2D3E4') == True\", \"assert verify_sequence('Z9') == True\", \"assert verify_sequence('A1') == True\", \"a... | {
"split": "train",
"index": 84293,
"acecode_id": "evol_10408",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a function in Python called `fibonacci_prime_product` which accepts two integer parameters M and P. The function should use a recursive approach to generate Fibonacci numbers from 0 to M. It should then output the product of all Fibonacci numbers in this range that are ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci_prime_product(20, 5) == 13\", \"assert fibonacci_prime_product(13, 5) == 13\", \"assert fibonacci_prime_product(21, 8) == 13\", \"assert fibonacci_prime_product(7, 3) == 5\", \"assert fibonacci_prime_product(14, 7) == 13\", \"assert fibonacci_prime... | {
"split": "train",
"index": 84294,
"acecode_id": "evol_6497",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that constructs a simple dictionary representing a chemical entity database entry. The function should take in two optional parameters: 'name' (a string representing the name of the chemical entity) and 'identifier' (a string representing... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_chemical_entity() == {'namespace': 'CHEBI', 'name': 'Unknown', 'identifier': 'N/A'}\", \"assert create_chemical_entity('Water') == {'namespace': 'CHEBI', 'name': 'Water', 'identifier': 'N/A'}\", \"assert create_chemical_entity(identifier='CHEBI:12345'... | {
"split": "train",
"index": 84295,
"acecode_id": "bigcode_python_fns_722",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `is_increasing_sequence(nums: List[int]) -> bool` that determines whether the integers form a strictly increasing sequence. A sequence is considered strictly increasing if each element is greater than the one before it. The input will ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_increasing_sequence([1, 2, 3, 4, 5]) == True\", \"assert is_increasing_sequence([5, 4, 3, 2, 1]) == False\", \"assert is_increasing_sequence([1, 3, 2, 4]) == False\", \"assert is_increasing_sequence([1]) == True\", \"assert is_increasing_sequence([1, 2]) ... | {
"split": "train",
"index": 84296,
"acecode_id": "bigcode_python_fns_25278",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that decodes a list of tuples containing encoded key-value pairs. Each tuple consists of a key and a value. The function should take a list of tuples as input, where each tuple contains a string key and a string value. The valu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decode_key_value_pairs([('k1', 'v1')]) == [(b'k1', b'v1')]\", \"assert decode_key_value_pairs([('k1', 'v1'), ('k2', 'v2')]) == [(b'k1', b'v1'), (b'k2', b'v2')]\", \"assert decode_key_value_pairs([('key', 'value')]) == [(b'key', b'value')]\", \"assert decode_... | {
"split": "train",
"index": 84297,
"acecode_id": "oss_32558",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the listing of parts for a fictional multipart upload system. The function should take the following parameters: a string `bucket` representing the name of the bucket, a string `key` representing the name of the file being ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert list_parts('my_bucket', 'abcdefghij', 'upload123') == {'Bucket': 'my_bucket', 'Key': 'abcdefghij', 'UploadId': 'upload123', 'MaxParts': 5, 'IsTruncated': True, 'Parts': [{'PartNumber': 1, 'LastModified': datetime.date.today(), 'ETag': 'etag1', 'Size': 10}, {... | {
"split": "train",
"index": 84298,
"acecode_id": "bigcode_python_fns_13639",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_unique_sorted_3d_array(layers: int, rows: int, columns: int) -> List[List[List[int]]]` that creates a 3D array with the specified number of layers, rows, and columns. Each layer should contain unique random integers in the range from 1 to 100, and t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_unique_sorted_3d_array(4, 7, 2) is not None\", \"assert len(create_unique_sorted_3d_array(4, 7, 2)) == 4\", \"assert all(len(layer) == 7 for layer in create_unique_sorted_3d_array(4, 7, 2))\", \"assert all(len(layer[0]) == 2 for layer in create_unique... | {
"split": "train",
"index": 84299,
"acecode_id": "evol_6000",
"num_tests": 12
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.