data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that sets the default configuration for a system resource. Implement a function called `setDefaultConfiguration` that accepts two parameters: `defaultMode`, a string indicating the new default mode for the resource, and `initialSize`, an ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert setDefaultConfiguration('AUTO', 10) == {'mode': 'AUTO', 'size': 10}\", \"assert setDefaultConfiguration('MANUAL', 5) == {'mode': 'MANUAL', 'size': 5}\", \"assert setDefaultConfiguration('DEFAULT', 0) == {'mode': 'DEFAULT', 'size': 0}\", \"assert setDefaultCo... | {
"split": "train",
"index": 62900,
"acecode_id": "bigcode_python_fns_20957",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to implement a function named `populate_with_default` that takes a list of integers and populates any missing values in the list with a default value of your choice. The function should return a new list where any integer that is n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert populate_with_default([1, 2, 3], 0) == [1, 2, 3]\", \"assert populate_with_default([], 5) == [5]\", \"assert populate_with_default([1, 2, 3], 4) == [1, 2, 3]\", \"assert populate_with_default([1, 1, 2, 2], 3) == [1, 1, 2, 2]\", \"assert populate_with_default... | {
"split": "train",
"index": 62901,
"acecode_id": "oss_10202",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of dictionaries representing configuration options for a software application. Each dictionary contains key-value pairs representing a specific configuration option. Your task is to write a function that takes th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert preserve_default_values([{ 'option1': 'value1', 'preserve_default': True }, { 'option2': 'value2', 'preserve_default': False }, { 'option3': 'value3' }, { 'option4': 'value4', 'preserve_default': True }]) == [{'option1': 'value1'}, {'option3': 'value3'}, {'o... | {
"split": "train",
"index": 62902,
"acecode_id": "oss_33079",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `is_valid_password(password: str, min_digits: int, min_special: int) -> bool` that checks if a given password meets specific criteria for validity. The criteria are as follows: the password must contain at least a specified minimum nu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_password('abc', 0, 0) == True\", \"assert is_valid_password('abc1', 1, 0) == True\", \"assert is_valid_password('abc1!', 1, 1) == True\", \"assert is_valid_password('abc1!', 2, 1) == False\", \"assert is_valid_password('12345', 5, 0) == True\", \"as... | {
"split": "train",
"index": 62903,
"acecode_id": "oss_15538",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are required to create a Python function that generates a list of dictionaries representing API endpoint data for a given list of endpoint strings. Each dictionary should contain the following keys: 'endpoint' and 'handler'. Your task is to implement the function `generate_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_api_endpoints(['home/']) == [{'endpoint': 'home/', 'handler': 'handlers.home'}]\", \"assert generate_api_endpoints(['about/', 'contact/']) == [{'endpoint': 'about/', 'handler': 'handlers.about'}, {'endpoint': 'contact/', 'handler': 'handlers.contact... | {
"split": "train",
"index": 62904,
"acecode_id": "oss_6817",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a new function that simulates a Bash command execution. Write a function `execute_bash_command(command: str) -> str` that takes a string `command` as input, which represents a Bash command, and returns the output of the command as a string. The func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert execute_bash_command('echo \\\"Hello World from Task 5\\\"') == 'Hello World from Task 5'\", \"assert execute_bash_command('echo \\\"Hello World from Task 3\\\"') == 'Command not recognized'\", \"assert execute_bash_command('ls') == 'Command not recognized'\... | {
"split": "train",
"index": 62905,
"acecode_id": "oss_2540",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple point-of-sale (POS) system for managing inventory. The function `manage_inventory(operations)` takes a list of operations, where each operation is a tuple. The first element of the tuple is a string that repres... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_inventory([('add', ('apple', 10)), ('sale', ('apple', 5))]) == {'apple': 5}\", \"assert manage_inventory([('add', ('grape', 5)), ('sale', ('grape', 3)), ('sale', ('grape', 3))]) == {'grape': 2}\", \"assert manage_inventory([('add', ('peach', 7)), ('sa... | {
"split": "train",
"index": 62906,
"acecode_id": "oss_7296",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `run(command: str) -> subprocess.CompletedProcess` that simulates the execution of a shell command. The function should take a single string `command` as input, which contains the command to be executed. The function must return a `su... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert run('echo 111').returncode == 0 and run('echo 111').stdout == '111' and run('echo 111').stderr == ''\", \"assert run('echo 222').returncode == 0 and run('echo 222').stdout == '222' and run('echo 222').stderr == ''\", \"assert run('echo error').returncode == ... | {
"split": "train",
"index": 62907,
"acecode_id": "bigcode_python_fns_29257",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes user information from a dictionary input and saves the user's details into a list of user records. The function should take a dictionary containing the user's first name, last name, email, username, user ID, and user... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert save_user_info({'FirstName': 'John', 'LastName': 'Doe', 'Email': 'john.doe@example.com', 'Username': 'johndoe', 'UserId': '1', 'UserRole': 'admin'}) == [{'full_name': 'John Doe', 'username': 'johndoe', 'user_id': '1', 'email': 'john.doe@example.com', 'role':... | {
"split": "train",
"index": 62908,
"acecode_id": "oss_7348",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers, return the Euclidean inner product of the two lists. The inner product is calculated as the sum of the products of corresponding elements in the two lists. You need to ensure that both lists are of the same length. If the lengths are not the same, r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert list_dot([1, 2, 3], [4, 5, 6]) == 32\", \"assert list_dot([-1, -2, -3], [1, 2, 3]) == -14\", \"assert list_dot([0, 0, 0], [1, 2, 3]) == 0\", \"assert list_dot([1], [1]) == 1\", \"assert list_dot([1, 0], [0, 1]) == 0\", \"assert list_dot([], []) == 0\", \"ass... | {
"split": "train",
"index": 62909,
"acecode_id": "bigcode_python_fns_48583",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Write a function to calculate the Least Common Multiple (LCM) of a list of unique integers. The function should efficiently handle lists with up to 1000 elements, where each integer can range from 1 to 1 billion, and all integers in the list are guaranteed to be unique. Your ta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lcm([1]) == 1\", \"assert lcm([2, 3]) == 6\", \"assert lcm([4, 5]) == 20\", \"assert lcm([6, 8]) == 24\", \"assert lcm([7, 3]) == 21\", \"assert lcm([10, 20, 30]) == 60\", \"assert lcm([12, 15, 25]) == 300\", \"assert lcm([9, 6, 3]) == 18\", \"assert lcm([5,... | {
"split": "train",
"index": 62910,
"acecode_id": "evol_22641",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes an alphanumeric string as input and returns a list of integers corresponding to the ASCII values of each character in the string. The function should handle both letters and digits, as well as special characters. The function should be defined as... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert string_to_ascii_values('Hello123!') == [72, 101, 108, 108, 111, 49, 50, 51, 33]\", \"assert string_to_ascii_values('abc') == [97, 98, 99]\", \"assert string_to_ascii_values('') == []\", \"assert string_to_ascii_values('1A2bC') == [49, 65, 50, 98, 67]\", \"as... | {
"split": "train",
"index": 62911,
"acecode_id": "evol_5410",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function to analyze a set of bike rides. Each ride is represented by a dictionary with the following keys: 'distance' (in kilometers), 'elevation_gain' (in meters), and 'moving_time' (in seconds). Your function should calculate and return t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_rides([]) == (0, 0.0, 0, 0)\", \"assert analyze_rides([{ 'distance': 10, 'elevation_gain': 100, 'moving_time': 1800 }]) == (1, 0.5, 10, 100)\", \"assert analyze_rides([{ 'distance': 12, 'elevation_gain': 120, 'moving_time': 2400 }, { 'distance': 18, ... | {
"split": "train",
"index": 62912,
"acecode_id": "oss_10542",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a Python function that monitors a bank account's balance based on a list of deposits and withdrawals. The function takes two parameters: a list of integers and/or floating-point numbers representing either deposits (positive numbers) or withdrawals (negative numbers),... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert below_zero([100, 50, -200], handle_float=False) == True\", \"assert below_zero([100, -50, -60], handle_float=False) == True\", \"assert below_zero([100, 50, 25, -150], handle_float=False) == False\", \"assert below_zero([-1], handle_float=False) == True\", \... | {
"split": "train",
"index": 62913,
"acecode_id": "evol_18774",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You need to create a function `format_feature_names(feat_names: List[str]) -> List[str]` that transforms a list of feature names into a specific string format. The transformation rules are as follows: If a feature name starts with 'count' or 'pos_of', it should be formatted as ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_feature_names(['countA', 'pos_ofB', 'featureC']) == [\\\"('countA', SimpleTransform(config.count_feat_transform))\\\", \\\"('pos_ofB', SimpleTransform(config.count_feat_transform))\\\", \\\"('featureC', SimpleTransform())\\\"]\", \"assert format_featu... | {
"split": "train",
"index": 62914,
"acecode_id": "bigcode_python_fns_24603",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the average loss for a list of loss values that are grouped into multiple parts. Write a function `calculate_average_loss(loss_list: List[List[float]]) -> List[float]` that takes a list of lists, where each inner list represents a part of losses.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_loss([[1.0, 2.0], [3.0], []]) == [1.5, 3.0, 0.0]\", \"assert calculate_average_loss([[5.0, 10.0], [0.0, 0.0], [2.5]]) == [7.5, 0.0, 2.5]\", \"assert calculate_average_loss([[1.0, 3.0, 5.0], [2.0, 4.0], [1.0]]) == [3.0, 3.0, 1.0]\", \"assert... | {
"split": "train",
"index": 62915,
"acecode_id": "oss_11240",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries, where each dictionary contains information about a legal code. Each dictionary has a key called 'unit' which represents a unit associated with that legal code. Your task is to implement a function that extracts all unique units from the lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_units([{'unit': 'A'}, {'unit': 'B'}, {'unit': 'A'}, {'unit': 'C'}]) == ['A', 'B', 'C']\", \"assert unique_units([{'unit': 'X'}, {'unit': 'Y'}, {'unit': 'X'}, {'unit': 'Z'}, {'unit': 'Y'}]) == ['X', 'Y', 'Z']\", \"assert unique_units([]) == []\", \"ass... | {
"split": "train",
"index": 62916,
"acecode_id": "bigcode_python_fns_15370",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an object and a list of strings representing possible method names. Your task is to implement a function `try_run` that attempts to call the first callable method found on the object from the list of names. If the method takes parameters, you should call it withou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert try_run(5, ['real', 'imag']) == None\", \"assert try_run(None, ['foo', 'bar']) == None\", \"assert try_run({'not_callable': 10}, ['not_callable']) == None\", \"assert try_run({}, ['method']) == None\", \"assert try_run({'do_nothing': lambda: None}, ['do_noth... | {
"split": "train",
"index": 62917,
"acecode_id": "bigcode_python_fns_28770",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with developing a function that predicts the classification of a DNA sequence using a simplified model. The function `predict` takes in a DNA sequence represented as a string of characters 'A', 'C', 'G', and 'T'. It also takes a list of model layers, which repres... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert predict('A', []) == 1\", \"assert predict('C', []) == 1\", \"assert predict('G', []) == 1\", \"assert predict('T', []) == 1\", \"assert predict('ACGT', []) == 1\", \"assert predict('AAAA', []) == 1\", \"assert predict('CCCC', []) == 1\", \"assert predict('GG... | {
"split": "train",
"index": 62918,
"acecode_id": "oss_34140",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `query_first_found` that takes a list of datastores and a piece of data to query. Each datastore is a dictionary that maps keys to values. Your function should iterate through the list of datastores in order and return the value of th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert query_first_found([{'a': 1}, {'b': 2}], 'a') == 1\", \"assert query_first_found([{'a': 1}, {'b': 2}], 'b') == 2\", \"assert query_first_found([{'a': 1}, {'b': 2}, {'a': 3}], 'a') == 1\", \"assert query_first_found([{'a': 1}, {'b': 2}, {'c': 3}], 'c') == 3\",... | {
"split": "train",
"index": 62919,
"acecode_id": "oss_24105",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement the selection sort algorithm to sort a given list of integers in ascending order. The function should take a list of integers as input and return a new list that contains the same integers sorted in ascending order. For example, given the input [8, 3, 6, 7, 1], the ou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert selection_sort([8, 3, 6, 7, 1]) == [1, 3, 6, 7, 8]\", \"assert selection_sort([5, 4, 3, 2, 1]) == [1, 2, 3, 4, 5]\", \"assert selection_sort([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert selection_sort([2, 1]) == [1, 2]\", \"assert selection_sort([3]) == [... | {
"split": "train",
"index": 62920,
"acecode_id": "evol_7020",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of predicted labels and a list of true labels. Your task is to calculate the True Positives (TP), False Positives (FP), False Negatives (FN), and True Negatives (TN) based on these two lists. The True Positive is the count of instances where the predicted l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_confusion_matrix([0, 0, 0, 0], [0, 0, 0, 0]) == (0, 0, 0, 4)\", \"assert calculate_confusion_matrix([1, 1, 1, 1], [1, 1, 1, 1]) == (4, 0, 0, 0)\", \"assert calculate_confusion_matrix([0, 1, 0, 1], [1, 0, 1, 0]) == (0, 2, 2, 0)\", \"assert calculate... | {
"split": "train",
"index": 62921,
"acecode_id": "bigcode_python_fns_12076",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers and a target integer as input. The function should return a list of pairs of integers from the input list that sum up to the target integer. Each pair should be represented as a tuple. If no such pairs ex... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_pairs_with_sum([1, 1, 1, 1], 2) == [(1, 1)]\", \"assert find_pairs_with_sum([1, 2, 3, 4, 5], 10) == []\", \"assert find_pairs_with_sum([1, 2, 3, 4, 4], 8) == [(4, 4)]\", \"assert find_pairs_with_sum([], 5) == []\", \"assert find_pairs_with_sum([5, 5, 5,... | {
"split": "train",
"index": 62922,
"acecode_id": "oss_12054",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You have to implement a function `calculate_fitness(input_data: List[int], parameters: List[float]) -> float` that calculates a fitness value based on the provided input data and parameters. The fitness value is a floating-point number that is computed based on a specific formu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_fitness([1, 2, 3], [0.5, 0.8, 1.2]) == calculate_fitness([1, 2, 3], [0.5, 0.8, 1.2])\", \"assert calculate_fitness([1, 2, 3], [0.5, 0.8, 1.2]) != calculate_fitness([2, 3, 4], [0.5, 0.8, 1.2])\", \"assert calculate_fitness([1, 2, 3], [0.5, 0.8, 1.2]... | {
"split": "train",
"index": 62923,
"acecode_id": "oss_16540",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two strings, `a` and `b`, write a function `cycpattern_check(a, b)` that determines if any rotational alteration of the string `b` exists as a continuous subsequence in the string `a`. The comparison should be case insensitive and ignore all special characters (non-alphab... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cycpattern_check('AbcD', 'aBd') == False\", \"assert cycpattern_check('Hello', 'ELl') == True\", \"assert cycpattern_check('Whas$sup', 'pSUs') == False\", \"assert cycpattern_check('aB!ab', 'BAa') == True\", \"assert cycpattern_check('EfEF', 'EeFf') == False... | {
"split": "train",
"index": 62924,
"acecode_id": "evol_26142",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists, `list1` and `predefined_list`, implement a function `common_element_processing(list1, predefined_list)` that returns a new list containing elements that are present in both lists. For each common element, if it's an integer, multiply it by 2, and if it's a stri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert common_element_processing(['apple', 3, 6], [3, 6, 'banana']) == [6, 12]\", \"assert common_element_processing([1, 2, 3], [4, 5, 6]) == []\", \"assert common_element_processing(['x', 'y', 'z'], ['a', 'b', 'x']) == ['x_modified']\", \"assert common_element_pro... | {
"split": "train",
"index": 62925,
"acecode_id": "evol_14216",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function `id_generator(size: int = 15) -> str` that generates a random identifier consisting of alphanumeric characters and special characters. The identifier should be of a specified length (default is 15) and should include upper and lower case letters, digits, an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert id_generator(15) != id_generator(15)\", \"assert len(id_generator(10)) == 10\", \"assert len(id_generator(20)) == 20\", \"assert all(c in string.ascii_letters + string.digits + string.punctuation for c in id_generator(15))\", \"assert id_generator(0) == ''\"... | {
"split": "train",
"index": 62926,
"acecode_id": "evol_3981",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `linkify_only_full_urls(attrs: dict, new: bool) -> dict or None` that processes a dictionary representing an HTML anchor tag. The function should only return the dictionary as is if the `new` parameter is `False`. If `new` is `True`, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert linkify_only_full_urls({'_text': 'http://example.com'}, True) == {'_text': 'http://example.com'}\", \"assert linkify_only_full_urls({'_text': 'https://example.com'}, True) == {'_text': 'https://example.com'}\", \"assert linkify_only_full_urls({'_text': 'ftp:... | {
"split": "train",
"index": 62927,
"acecode_id": "bigcode_python_fns_27337",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a given JSON response represented as a dictionary and extracts the schema reference for the 'ErrorResponse' schema. The schema reference is nested within the 'content' key and the 'application/json' key. Your fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_schema_reference({'content': {'application/json': {'schema': {'$ref': '#/components/schemas/ErrorResponse'}}}}) == '#/components/schemas/ErrorResponse'\", \"assert extract_schema_reference({'content': {'application/json': {'schema': {}}}}) == 'Schema... | {
"split": "train",
"index": 62928,
"acecode_id": "oss_27911",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that transcribes speech from a given string input simulating audio. The function should take two parameters: the audio input as a string and the language for transcription. Your function should return the transcription of the audio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transcribe_audio('Hello, how are you?', 'en-US') == 'Hello, how are you?'\", \"assert transcribe_audio('Hola, \\u00bfc\\u00f3mo est\\u00e1s?', 'es-ES') == 'Hola, \\u00bfc\\u00f3mo est\\u00e1s?'\", \"assert transcribe_audio('Bonjour, comment \\u00e7a va?', 'f... | {
"split": "train",
"index": 62929,
"acecode_id": "oss_31511",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers `nums`, write a function that returns the maximum product of any two distinct elements in the list. The function should take in a list of integers and return a single integer representing the maximum product. If the list has fewer than two elements, ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_product([1, 2, 3, 4]) == 12\", \"assert max_product([0, 0, 0]) == 0\", \"assert max_product([5]) == 0\", \"assert max_product([1, 5]) == 5\", \"assert max_product([-1, 1, 0]) == 0\", \"assert max_product([10, 20, 30]) == 600\", \"assert max_product([1, 2... | {
"split": "train",
"index": 62930,
"acecode_id": "bigcode_python_fns_9051",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple message processing system. Your goal is to create a Python function that processes a list of messages. Each message is a string, and you need to implement the processing logic inside the function. The function should receive a list of m... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_messages(['Hello', 'World']) == ['Processed: Hello', 'Processed: World']\", \"assert process_messages(['Test', 'Message']) == ['Processed: Test', 'Processed: Message']\", \"assert process_messages(['One', 'Two', 'Three']) == ['Processed: One', 'Proce... | {
"split": "train",
"index": 62931,
"acecode_id": "oss_8803",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple stock trading simulation that calculates the maximum profit that can be achieved given a list of stock prices. The input to your function will be a list of stock prices, and you need to determine the maximum profit that can be made by b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_profit_from_prices([100.0, 90.0, 80.0, 85.0, 95.0]) == 15.0\", \"assert max_profit_from_prices([70.0, 60.0, 50.0, 40.0]) == 0.0\", \"assert max_profit_from_prices([10.0, 20.0, 30.0, 40.0]) == 30.0\", \"assert max_profit_from_prices([5.0, 5.0, 5.0, 5.0]) ... | {
"split": "train",
"index": 62932,
"acecode_id": "oss_5086",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_max(words: List[str], case_sensitive: bool = False) -> str` that takes a list of unique strings and returns the string with the highest number of unique characters. If there's a tie, the function should return the word that comes first lexicographical... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max(['name', 'of', 'String'], True) == 'String'\", \"assert find_max(['name', 'enam', 'Game']) == 'enam'\", \"assert find_max(['aaaaaaa', 'BB', 'cc']) == 'aaaaaaa'\", \"assert find_max(['unique', 'characters', 'here']) == 'characters'\", \"assert find_m... | {
"split": "train",
"index": 62933,
"acecode_id": "evol_24523",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Write a function `debug` that takes a string as input and returns a formatted debug message. The formatted message should start with a newline character followed by '>>> ' and then the original input string. For example, if the input string is 'Error occurred', the function sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert debug('Error occurred') == '\\\\n>>> Error occurred'\", \"assert debug('Warning: low memory') == '\\\\n>>> Warning: low memory'\", \"assert debug('Connection lost') == '\\\\n>>> Connection lost'\", \"assert debug('File not found') == '\\\\n>>> File not found... | {
"split": "train",
"index": 62934,
"acecode_id": "oss_12561",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `sort_tuples_by_second_element(arr: List[Tuple[int, int]]) -> List[Tuple[int, int]]` that sorts a list of tuples based on their second element. The function should handle None values correctly, placing them at the end of the sorted list, and should be able ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_tuples_by_second_element([]) == []\", \"assert sort_tuples_by_second_element([(1, 2), (3, 1), (2, 3)]) == [(3, 1), (1, 2), (2, 3)]\", \"assert sort_tuples_by_second_element([(1, None), (2, 2), (3, None)]) == [(2, 2), (1, None), (3, None)]\", \"assert so... | {
"split": "train",
"index": 62935,
"acecode_id": "evol_30475",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks whether two given values meet certain criteria. The function `are_values_correct` takes in two parameters, `value1` and `value2`, and should return `True` if both values meet the specified conditions, and `False` otherwise... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert are_values_correct(0, 10) == True\", \"assert are_values_correct(-10, 0) == True\", \"assert are_values_correct(5, 5) == True\", \"assert are_values_correct(10, 5) == True\", \"assert are_values_correct(7, 3) == True\", \"assert are_values_correct(1, 1) == T... | {
"split": "train",
"index": 62936,
"acecode_id": "oss_6954",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that generates a migration file for a Django application. In Django, migrations are used to propagate changes you make to your models into your database schema. Your task is to complete the migration file by adding the necessary op... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_migration_file('Product', {'name': 'models.CharField(max_length=100)', 'price': 'models.DecimalField(max_digits=10, decimal_places=2)'}) == \\\"\\\\nclass Migration(migrations.Migration):\\\\n\\\\n dependencies = [\\\\n migrations.swappabl... | {
"split": "train",
"index": 62937,
"acecode_id": "oss_24643",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of database connection objects, implement a function `close_connections(connections: List[Connection]) -> None` that closes all open database connections provided in the list. Each connection object has a method `close()` that should be called to close the connecti... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert close_connections([MockConnection(True), MockConnection(True)]) == None\", \"assert close_connections([MockConnection(True), MockConnection(False)]) == None\", \"assert close_connections([]) == None\", \"assert close_connections([MockConnection(True), MockCo... | {
"split": "train",
"index": 62938,
"acecode_id": "bigcode_python_fns_22431",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with designing a function that simulates the creation of a delete integration response for a hypothetical API. The function `create_integration_response` takes in four parameters: `restApiId`, `resourceId`, `httpMethod`, and `statusCode`, all of which are strings... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_integration_response('api123', 'resource456', 'DELETE', '204') == {'apiId': 'api123', 'resourceId': 'resource456', 'method': 'DELETE', 'status': '204'}\", \"assert create_integration_response('apiABC', 'resourceXYZ', 'POST', '200') == {'apiId': 'apiAB... | {
"split": "train",
"index": 62939,
"acecode_id": "bigcode_python_fns_49090",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of user roles and a list of short links. Implement a function that checks whether each user role has permission to delete a given short link. A logged-in user role cannot delete any short link, and the function should return a list of boolean values indicat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_delete(['admin', 'logged_in', 'guest'], ['link1', 'link2']) == [True, False, True]\", \"assert can_delete(['user', 'logged_in', 'admin'], ['short1', 'short2']) == [True, False, True]\", \"assert can_delete(['logged_in', 'validator'], ['linkA', 'linkB']) ... | {
"split": "train",
"index": 62940,
"acecode_id": "bigcode_python_fns_13135",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that calculates the total cost of a customer's order from an online store. The function should consider the base price of the items, any applicable discounts, and shipping costs. The function will handle two types of discounts: per... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_cost(100, 'percentage', 20, 10) == 90\", \"assert calculate_total_cost(200, 'fixed', 30, 15) == 185\", \"assert calculate_total_cost(150, 'percentage', 10, 5) == 140\", \"assert calculate_total_cost(80, 'fixed', 10, 5) == 75\", \"assert calcu... | {
"split": "train",
"index": 62941,
"acecode_id": "oss_22077",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that generates a sequence of events based on a given frequency and batch size. The function should take two parameters: `every_nth` (the frequency of events) and `n` (the batch size). The function should return a 2D list representi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_events(1, 1) == [[0]]\", \"assert generate_events(2, 1) == [[0], [0]]\", \"assert generate_events(3, 2) == [[0, 1], [0, 1], [0, 1]]\", \"assert generate_events(1, 4) == [[0, 1, 2, 3]]\", \"assert generate_events(4, 4) == [[0, 1, 2, 3], [0, 1, 2, 3],... | {
"split": "train",
"index": 62942,
"acecode_id": "oss_32329",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a simple banking system where users can create accounts, deposit funds, withdraw funds, and check their balance. Write a function `bank_operations(operations: List[Tuple[str, int]]) -> List[int]` that takes a list of operations and returns a list ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bank_operations([('create', 12345), ('deposit', 1000), ('withdraw', 500)]) == [500]\", \"assert bank_operations([('create', 54321), ('deposit', 2000), ('withdraw', 1000)]) == [1000]\", \"assert bank_operations([('create', 11111), ('deposit', 500), ('withdraw... | {
"split": "train",
"index": 62943,
"acecode_id": "oss_27618",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function that extracts all occurrences of a given pattern from a given string and returns both the count of occurrences and the new string after removing all instances of the pattern. The pattern can be a substring of any length and the function should consider spac... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_pattern('Hello, World!', 'llo') == (1, 'He, World!')\", \"assert extract_pattern('Python programming', 'g') == (2, 'Python prorammin')\", \"assert extract_pattern('abcdefg', 'h') == (0, 'abcdefg')\", \"assert extract_pattern('abcabcabc', 'abc') == (3... | {
"split": "train",
"index": 62944,
"acecode_id": "evol_6525",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `process_numbers(nums: List[int], threshold: int) -> List[int]` that processes the list of integers by filtering out numbers greater than a specified threshold. The function should return a new list containing only the numbers that are... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_numbers([1, 2, 3, 4, 5], 3) == [1, 2, 3]\", \"assert process_numbers([10, 20, 30, 40], 25) == [10, 20]\", \"assert process_numbers([0, 1, 2, 3], 0) == [0]\", \"assert process_numbers([], 5) == []\", \"assert process_numbers([5, 10, 15, 20, 25], 15) =... | {
"split": "train",
"index": 62945,
"acecode_id": "bigcode_python_fns_32657",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the construction of a packet for transmission over a network. The function should take the following inputs: a destination IPv6 address, a source port, a destination port, and a message payload. The function will return a d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert construct_packet('2001:db8::1', 1234, 80, 'Hello') == {'IPv6': {'dst': '2001:db8::1'}, 'TCP': {'dport': 80, 'sport': 1234}, 'payload': 'Hello'}\", \"assert construct_packet('::1', 5000, 8080, 'Test message') == {'IPv6': {'dst': '::1'}, 'TCP': {'dport': 8080,... | {
"split": "train",
"index": 62946,
"acecode_id": "oss_37553",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that performs an in-order traversal of a binary tree using an iterative approach. Given the root of a binary tree, return a list of the values of the nodes in the in-order sequence.\nPlease reason step by step, then write a self-contained Python solution. G... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert in_order_traversal(Node(1, Node(2, Node(3), None), Node(4))) == [3, 2, 1, 4]\", \"assert in_order_traversal(Node(2, Node(1), Node(3))) == [1, 2, 3]\", \"assert in_order_traversal(Node(1)) == [1]\", \"assert in_order_traversal(None) == []\", \"assert in_order... | {
"split": "train",
"index": 62947,
"acecode_id": "evol_21966",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string and a specified character, implement a function that returns a list of all indices where the character occurs in the string. If the character does not occur in the string, return an empty list.\nPlease reason step by step, then write a self-contained Python solut... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_positions('python programming', 'p') == [0, 7]\", \"assert find_positions('abcdefg', 'z') == []\", \"assert find_positions('mississippi', 's') == [2, 3, 5, 6]\", \"assert find_positions('openai', 'n') == [3]\", \"assert find_positions('aaaaa', 'a') == [... | {
"split": "train",
"index": 62948,
"acecode_id": "evol_3263",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that categorizes the status of a pipeline run based on its progress. You need to create a function named `categorize_pipeline_run_status` that takes a string representing the status of a pipeline run and returns a string indica... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert categorize_pipeline_run_status('QUEUED') == 'In Progress'\", \"assert categorize_pipeline_run_status('RUNNING') == 'In Progress'\", \"assert categorize_pipeline_run_status('SUCCESS') == 'Non In Progress'\", \"assert categorize_pipeline_run_status('FAILURE') ... | {
"split": "train",
"index": 62949,
"acecode_id": "oss_14443",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing fret positions on a guitar, implement a function `repeat_fret_positions(fret_positions: List[int], repeats: int) -> List[int]` that returns a new list where each fret position is repeated a specified number of times. The input list can be o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert repeat_fret_positions([1, 2, 3], 2) == [1, 1, 2, 2, 3, 3]\", \"assert repeat_fret_positions([1, 2, 3], 3) == [1, 1, 1, 2, 2, 2, 3, 3, 3]\", \"assert repeat_fret_positions([5, 6], 1) == [5, 6]\", \"assert repeat_fret_positions([], 5) == []\", \"assert repeat_... | {
"split": "train",
"index": 62950,
"acecode_id": "bigcode_python_fns_2643",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the dynamic import of modules based on a list of module names provided as input. Your function should take a list of module names as input and return a list of tuples. Each tuple should contain the module name and a boo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_module_import(['ModuleValid', 'AnotherModuleValid']) == [('ModuleValid', True), ('AnotherModuleValid', True)]\", \"assert simulate_module_import(['ModuleInvalid', 'AnotherModuleInvalid']) == [('ModuleInvalid', False), ('AnotherModuleInvalid', False)... | {
"split": "train",
"index": 62951,
"acecode_id": "oss_5238",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of statements represented as tuples where each statement can be an expression, a label, a let statement, or an import statement, implement a function `process_statements(statements: List[Tuple]) -> None` that processes each statement according to the following rule... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_statements([('label', 'myLabel'), ('let', 'x', 10), ('expr', 'x + 2')]) is None\", \"assert process_statements([('label', 'anotherLabel'), ('let', 'y', 20), ('expr', 'y * 2')]) is None\", \"assert process_statements([('import', 'math'), ('expr', 'mat... | {
"split": "train",
"index": 62952,
"acecode_id": "bigcode_python_fns_5137",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing a dataset. Your task is to write a Python function that calculates the average of the numbers in the list and returns it. The function should handle empty lists by returning 0. Write a function `calculate_average` that takes no argu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average([1, 2, 3, 4, 5]) == 3.0\", \"assert calculate_average([10, 20, 30]) == 20.0\", \"assert calculate_average([5]) == 5.0\", \"assert calculate_average([]) == 0\", \"assert calculate_average([-1, -2, -3]) == -2.0\", \"assert calculate_average([... | {
"split": "train",
"index": 62953,
"acecode_id": "oss_28224",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a basic operation of a residual block from a neural network. The function will take an input tensor represented by a 2D list of integers, a specified number of filters (an integer), a kernel size (an integer), a stride ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert residual_block([[1, 2], [3, 4]], 2, 3, 1, True) == [[8, 16], [24, 32]]\", \"assert residual_block([[1, 2]], 1, 3, 1, False) == [[1, 2]]\", \"assert residual_block([[1, 1], [1, 1]], 1, 3, 1, False) == [[1, 1], [1, 1]]\", \"assert residual_block([[1], [2], [3]... | {
"split": "train",
"index": 62954,
"acecode_id": "bigcode_python_fns_43013",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of strings and returns a new list containing only the unique strings from the input list, preserving the order of their first occurrences. Implement the function `unique_strings(input_list: List[str]) -> List[str]` where... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_strings(['apple', 'banana', 'apple', 'orange', 'banana']) == ['apple', 'banana', 'orange']\", \"assert unique_strings(['cat', 'dog', 'cat', 'mouse', 'dog']) == ['cat', 'dog', 'mouse']\", \"assert unique_strings(['hello', 'world', 'hello', 'hello']) ==... | {
"split": "train",
"index": 62955,
"acecode_id": "bigcode_python_fns_28814",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of tuples where each tuple contains a string, a string, and a numerical value, write a function that sorts the list of tuples in ascending order based on the numerical value in the third element of each tuple and returns the sorted list.\nPlease reason step by step... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_tuples_based_on_third_elem([('Red', 'Flower', 1), ('Blue', 'Sky', 3), ('Green', 'Grass', 2), ('Yellow', 'Sun', 4)]) == [('Red', 'Flower', 1), ('Green', 'Grass', 2), ('Blue', 'Sky', 3), ('Yellow', 'Sun', 4)]\", \"assert reverse_tuples_based_on_third_e... | {
"split": "train",
"index": 62956,
"acecode_id": "evol_27763",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of attributes, where each attribute is represented as a dictionary containing its name and properties. Your task is to implement a function that initializes a model class by collecting all indexed attributes from its parent classes and its own attributes. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_indices([], []) == []\", \"assert initialize_indices([{'name': 'a', 'indexed': True, 'index_value': False}], []) == ['a']\", \"assert initialize_indices([], [{'name': 'b', 'indexed': False, 'index_value': True}]) == ['b']\", \"assert initialize_in... | {
"split": "train",
"index": 62957,
"acecode_id": "bigcode_python_fns_35702",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates a list of video file sizes to ensure they do not exceed a specified maximum size. The function should take in a list of integers representing the sizes of the video files in megabytes and an integer representing the maximum... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_video_sizes([10, 20, 30], 30) == [True, True, True]\", \"assert validate_video_sizes([10, 20, 40], 30) == [True, True, False]\", \"assert validate_video_sizes([50, 60, 70], 40) == [False, False, False]\", \"assert validate_video_sizes([], 30) == []\... | {
"split": "train",
"index": 62958,
"acecode_id": "oss_1042",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a positive integer N (N >= 1). Write a function `calculate_odd_product(n)` that returns the product of all odd numbers between 1 and N, inclusive. If there are no odd numbers, return 1. The function should ensure that the number N is included in the calculation if... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_odd_product(1) == 1\", \"assert calculate_odd_product(2) == 1\", \"assert calculate_odd_product(3) == 3\", \"assert calculate_odd_product(4) == 3\", \"assert calculate_odd_product(5) == 15\", \"assert calculate_odd_product(6) == 15\", \"assert calc... | {
"split": "train",
"index": 62959,
"acecode_id": "evol_17583",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of bars in a histogram. Write a function `max_histogram_area(heights: List[int]) -> int` that calculates the area of the largest rectangle that can be formed within the histogram. The area is defined as the width of the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_histogram_area([2,1,5,6,2,3]) == 10\", \"assert max_histogram_area([1,1,1,1]) == 4\", \"assert max_histogram_area([6,2,5,4,5,1,6]) == 12\", \"assert max_histogram_area([1,2,3,4,5]) == 9\", \"assert max_histogram_area([5,4,3,2,1]) == 9\", \"assert max_his... | {
"split": "train",
"index": 62960,
"acecode_id": "bigcode_python_fns_29019",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `value`, implement a function `slugify` that transforms the string into a slug format. The function should convert spaces to hyphens, remove any characters that are not alphanumeric characters, spaces, underscores, or hyphens, convert all characters to lowercase,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert slugify('Hello World!') == 'hello-world'\", \"assert slugify(' Leading and Trailing Spaces ') == 'leading-and-trailing-spaces'\", \"assert slugify('This_is_a_test') == 'this_is_a_test'\", \"assert slugify('Multiple Spaces') == 'multiple-spaces'\", \"ass... | {
"split": "train",
"index": 62961,
"acecode_id": "bigcode_python_fns_41195",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string 'source' that contains text, and two delimiter strings 'begin_re' and 'end_re'. Your task is to replace the text in 'source' that is located between the first occurrence of 'begin_re' and the first occurrence of 'end_re' (inclusive) with a new string 'dat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_within('<<', '>>', 'Hello <<world>>!', 'Python') == 'Hello Python!'\", \"assert replace_within('<<', '>>', 'No delimiters here!', 'Python') == 'No delimiters here!'\", \"assert replace_within('<<', '>>', 'Start <<replace this>> end.', 'Python') == 'S... | {
"split": "train",
"index": 62962,
"acecode_id": "bigcode_python_fns_11039",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a simple user authentication system that allows users to register and authenticate themselves. Implement a function `authenticate_user(username, password)` that checks if the provided username and password match any existing user records. The function should return `True... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert authenticate_user('user1', 'password123') == True\", \"assert authenticate_user('user2', 'password321') == True\", \"assert authenticate_user('user1', 'wrongpassword') == False\", \"assert authenticate_user('nonexistentuser', 'password123') == False\", \"ass... | {
"split": "train",
"index": 62963,
"acecode_id": "oss_21839",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given two dictionaries, `target` and `source`. Your task is to extend the `target` dictionary with key-value pairs from the `source` dictionary. The extension should follow these rules: 1) If a key from `source` does not exist in `target`, add it to `target`. 2) If a ke... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extends_dict({'a': 1}, {'b': 2}) == {'a': 1, 'b': 2}\", \"assert extends_dict({}, {'b': 2}) == {'b': 2}\", \"assert extends_dict({'a': {'x': 1}}, {'a': {'y': 2}}) == {'a': {'x': 1, 'y': 2}}\", \"assert extends_dict({'a': [1]}, {'a': [2]}) == {'a': [1, 2]}\",... | {
"split": "train",
"index": 62964,
"acecode_id": "bigcode_python_fns_11662",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing age categories of individuals in a household. Each category is mapped to a specific age value as follows: 1 -> 2.0, 2 -> 8.0, 3 -> 13.5, 4 -> 16.5, 5 -> 21.0, 6 -> 29.5, 7 -> 39.5, 8 -> 49.5, 9 -> 59.5, 10 -> 69.5, 11 -> 79.5, 12 ->... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert preprocess_ages([1, 2, 3]) == [2.0, 8.0, 13.5]\", \"assert preprocess_ages([4, 5, 6]) == [16.5, 21.0, 29.5]\", \"assert preprocess_ages([7, 8, 9]) == [39.5, 49.5, 59.5]\", \"assert preprocess_ages([10, 11, 12]) == [69.5, 79.5, 89.5]\", \"assert preprocess_ag... | {
"split": "train",
"index": 62965,
"acecode_id": "bigcode_python_fns_49811",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `print_diamond(n: int) -> str` that returns a string representation of a diamond structure with `n` rows in the top half and `n-1` rows in the bottom half. Each row should be centered, using spaces for alignment and asterisks '*' for the diamond shape. If `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert print_diamond(1) == '*\\\\n'\", \"assert print_diamond(2) == ' *\\\\n***\\\\n *\\\\n'\", \"assert print_diamond(3) == ' *\\\\n ***\\\\n*****\\\\n ***\\\\n *\\\\n'\", \"assert print_diamond(4) == ' *\\\\n ***\\\\n *****\\\\n*******\\\\n *****\\\\n ***\\... | {
"split": "train",
"index": 62966,
"acecode_id": "evol_29363",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, implement a function that arranges the elements in ascending order. The function should take a list of integers as input and return a new list with the integers sorted in non-decreasing order.\nPlease reason step by step, then write a self-contained ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sequential_organization([3, 2, 1]) == [1, 2, 3]\", \"assert sequential_organization([5, 3, 8, 1, 4]) == [1, 3, 4, 5, 8]\", \"assert sequential_organization([]) == []\", \"assert sequential_organization([7]) == [7]\", \"assert sequential_organization([2, 2, 2... | {
"split": "train",
"index": 62967,
"acecode_id": "evol_28392",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of strings, write a function that returns the longest string in the array. If there are multiple strings of the longest length, return the first one encountered. The input array can contain an assortment of word elements, varying in their nature.\nPlease reason s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_longest_word(['Hello', 'World', 'I', 'Am', 'Here']) == 'Hello'\", \"assert find_longest_word(['apple', 'banana', 'cherry', 'date']) == 'banana'\", \"assert find_longest_word(['short', 'longer', 'longest']) == 'longest'\", \"assert find_longest_word(['a'... | {
"split": "train",
"index": 62968,
"acecode_id": "evol_6288",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple multilabel classifier. Implement a function `multilabel_classifier(train_data: List[Tuple[List[int], List[str]]], data_point: List[int]) -> List[str]` that takes in two parameters: a list of tuples `train_data`, where each tuple consist... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multilabel_classifier([], [1, 2, 3]) == []\", \"assert multilabel_classifier([([1, 2], ['label1'])], [1, 2]) == ['label1']\", \"assert multilabel_classifier([([1, 2], ['label1']), ([1, 3], ['label1', 'label2'])], [1, 2]) == ['label1', 'label2']\", \"assert m... | {
"split": "train",
"index": 62969,
"acecode_id": "oss_18888",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that determines whether a given URL is valid for a specific streaming service. The streaming service in question is Live Russia TV, and the function should be able to identify valid URLs for this service based on a specific pattern... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_live_russia_tv_url('https://live.russia.tv/index/index/channel_id/1') == True\", \"assert is_valid_live_russia_tv_url('https://live.russia.tv/index/index/channel_id/999') == True\", \"assert is_valid_live_russia_tv_url('https://live.russia.tv/index/... | {
"split": "train",
"index": 62970,
"acecode_id": "oss_6299",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of user groups, each with a list of identities associated with them. Each identity has a provider attribute. Your task is to implement a function that returns the first identity associated with the user from their groups that matches the specified provider.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_default_identity('alice', [{'name': 'group1', 'identities': [{'provider': 'google', 'id': 'google_alice'}]}, {'name': 'group2', 'identities': [{'provider': 'facebook', 'id': 'facebook_alice'}]}], 'google') == 'google_alice'\", \"assert get_default_identi... | {
"split": "train",
"index": 62971,
"acecode_id": "bigcode_python_fns_11020",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a categorical covariable transformation pipeline. Implement a function `create_categorical_covariable_pipeline` that constructs and returns a pipeline object based on the given inputs. The function should take in the following parameters: \n- `step... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_categorical_covariable_pipeline(['step1', 'step2'], [], 1) == Pipeline(['step1', 'step2'], [], 'categorical_covariable_transform_pipeline_1')\", \"assert create_categorical_covariable_pipeline(['step1'], ['col1'], 2) == Pipeline(['step1'], tcs.column_... | {
"split": "train",
"index": 62972,
"acecode_id": "oss_16865",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing a deal with various attributes. Your task is to implement a function that validates the deal dictionary based on specific criteria. The criteria for a valid deal dictionary are as follows: The dictionary must contain the keys 'title' (a n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_deal({'title': 'New Deal', 'amount': 100, 'currency': 'USD'}) == True\", \"assert is_valid_deal({'title': 'Summer Sale', 'amount': 50, 'currency': 'EUR'}) == True\", \"assert is_valid_deal({'title': 'Year End Offer', 'amount': 200, 'currency': 'GBP'... | {
"split": "train",
"index": 62973,
"acecode_id": "bigcode_python_fns_9619",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a user object and returns a dictionary representation of the user's information. The user object will have the following attributes: 'id', 'name', and 'email'. If the user object is None, the function should return an empty dic... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_user_info({'id': 1, 'name': 'Alice', 'email': 'alice@example.com'}) == {'id': 1, 'name': 'Alice', 'email': 'alice@example.com'}\", \"assert get_user_info({'id': 2, 'name': 'Bob', 'email': 'bob@example.com'}) == {'id': 2, 'name': 'Bob', 'email': 'bob@exam... | {
"split": "train",
"index": 62974,
"acecode_id": "bigcode_python_fns_5787",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that converts a time duration string into seconds. The time duration string will be in the format of a number followed by a unit specifier, where the unit specifier can be one of the following: 's' for seconds, 'm' for minutes, 'h'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_seconds('5s') == 5\", \"assert convert_to_seconds('3m') == 180\", \"assert convert_to_seconds('2h') == 7200\", \"assert convert_to_seconds('1d') == 86400\", \"assert convert_to_seconds('2w') == 1209600\", \"assert convert_to_seconds('1y') == 31536... | {
"split": "train",
"index": 62975,
"acecode_id": "oss_33283",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer n, write a function that calculates the sum of the factorial of its digits. For example, for n = 145, the function should return 145 since 1! + 4! + 5! = 1 + 24 + 120. Implement the function sum_of_factorial_digits(n) that takes a non-negative integer n and ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_factorial_digits(145) == 145\", \"assert sum_of_factorial_digits(169) == 363601\", \"assert sum_of_factorial_digits(0) == 1\", \"assert sum_of_factorial_digits(9) == 362880\", \"assert sum_of_factorial_digits(11) == 2\", \"assert sum_of_factorial_digi... | {
"split": "train",
"index": 62976,
"acecode_id": "evol_15599",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with splitting a query string into two parts: a 'cached' part and a 'remainder' part. Given a query string, your goal is to find the longest prefix of the query string that is present in a predefined list of cached keys. If a prefix is found, return the prefix as... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert split_query('abcde', ['ab', 'abc']) == ('abc', 'de')\", \"assert split_query('abcdef', ['xyz', 'abc']) == ('abc', 'def')\", \"assert split_query('hello world', ['hello', 'hell']) == ('hello', ' world')\", \"assert split_query('testcase', ['test', 'case']) ==... | {
"split": "train",
"index": 62977,
"acecode_id": "bigcode_python_fns_22900",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of employee records, where each record is represented as a dictionary containing 'empid', 'firstname', 'lastname', 'gender', and 'hiring_date', write a function `get_male_employee_count(records: List[Dict[str, Union[int, str]]], start_date: str, end_date: str) -> i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_male_employee_count([{'empid': 1, 'firstname': 'John', 'lastname': 'Doe', 'gender': 'Male', 'hiring_date': '2001-05-10'}, {'empid': 2, 'firstname': 'Jane', 'lastname': 'Smith', 'gender': 'Female', 'hiring_date': '2000-03-15'}], '2000-01-01', '2021-12-31'... | {
"split": "train",
"index": 62978,
"acecode_id": "evol_29077",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string that represents a JSON object, your task is to remove all comments from the string. The comments can be in the form of single-line comments starting with '//' and multi-line comments enclosed within '/* ... */'. Note that comments should only be removed if they a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_comments_from_json('{/* this is a comment */\\\"key\\\": \\\"value\\\"}') == '{\\\"key\\\": \\\"value\\\"}'\", \"assert remove_comments_from_json('{\\\"key\\\": \\\"value\\\" /* comment */}') == '{\\\"key\\\": \\\"value\\\" }'\", \"assert remove_comme... | {
"split": "train",
"index": 62979,
"acecode_id": "bigcode_python_fns_7452",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Write a function `sort_string_exclude_chars(s1, s2)` that takes two strings `s1` and `s2` as input and returns a new string that consists of the characters from `s1` sorted in ascending order, excluding any characters that are present in `s2`. The function should not modify the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_string_exclude_chars('abcde', 'xyz') == 'abcde'\", \"assert sort_string_exclude_chars('hello', 'h') == 'ello'\", \"assert sort_string_exclude_chars('leetcode', 'let') == 'cdo'\", \"assert sort_string_exclude_chars('openai', 'n') == 'aeiop'\", \"assert s... | {
"split": "train",
"index": 62980,
"acecode_id": "evol_8296",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a binary tree represented as a nested dictionary, implement a function `search_tree(tree, value)` that recursively searches for a given value in the tree. The function should return `True` if the value is found, and `False` otherwise. The tree is defined such that each no... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert search_tree({'value': 5, 'left': {'value': 4, 'left': {'value': 11, 'left': None, 'right': None}, 'right': {'value': 1, 'left': None, 'right': None}}, 'right': {'value': 8, 'left': {'value': 13, 'left': None, 'right': None}, 'right': {'value': 4, 'left': Non... | {
"split": "train",
"index": 62981,
"acecode_id": "evol_34596",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function called `process_columns` that takes a list of numerical feature names as input and returns a sorted list of these names in ascending order. You should ensure that the returned list contains only unique feature names, removing any dupl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_columns(['feature2', 'feature1', 'feature2']) == ['feature1', 'feature2']\", \"assert process_columns(['feature3', 'feature1', 'feature3', 'feature2']) == ['feature1', 'feature2', 'feature3']\", \"assert process_columns(['feature5', 'feature4']) == [... | {
"split": "train",
"index": 62982,
"acecode_id": "oss_18169",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates a command list based on the specified command type and argument. The function `generate_command` should accept two parameters: 1. `command_type` (string) - representing the type of command to generate, which can be eith... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_command('sleep', 5) == ['sleep', '5']\", \"assert generate_command('sleep', 10) == ['sleep', '10']\", \"assert generate_command('echo', 'Hello') == ['echo', 'Hello']\", \"assert generate_command('echo', 'Goodbye') == ['echo', 'Goodbye']\", \"assert ... | {
"split": "train",
"index": 62983,
"acecode_id": "oss_29250",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of temperatures in Celsius as a space-separated string. Your task is to determine whether the temperatures are 'COMFY' or 'NOT COMFY' based on their standard deviation. If the standard deviation of the temperatures is less than or equal to 1.0, the temperat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert comfy_or_not('15 15 15 15 15') == 'COMFY'\", \"assert comfy_or_not('10 20 10 20 10') == 'NOT COMFY'\", \"assert comfy_or_not('5 6 5 4 5') == 'COMFY'\", \"assert comfy_or_not('1 1 1 2 1') == 'COMFY'\", \"assert comfy_or_not('100 101 102 100 99') == 'NOT COMFY... | {
"split": "train",
"index": 62984,
"acecode_id": "oss_14188",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a python function to calculate the sum of the per-digit XOR operation between two hexadecimal numbers. The function should take two strings representing hexadecimal numbers as input and return an integer that represents the total sum of the XOR of each corresponding dig... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert xor_hex('1', '1') == 0\", \"assert xor_hex('0', '0') == 0\", \"assert xor_hex('abcd', 'abcd') == 0\", \"assert xor_hex('0', 'f') == 15\", \"assert xor_hex('1', '2') == 3\", \"assert xor_hex('2a', '2b') == 1\", \"assert xor_hex('1', '0') == 1\"]}"
} | {
"split": "train",
"index": 62985,
"acecode_id": "evol_25456",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are required to create a function that simulates the process of submitting form data asynchronously. The function should take three parameters: 'name' (a string), 'email' (a string), and 'message' (a string). It should validate that all fields are filled, and if they are, r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert submit_form_data('John Doe', 'john@example.com', 'Hello!') == 'Data received successfully!'\", \"assert submit_form_data('Jane Smith', 'jane@example.com', '') == 'Error: Message field is required.'\", \"assert submit_form_data('', 'test@example.com', 'Hi the... | {
"split": "train",
"index": 62986,
"acecode_id": "evol_12763",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of buildings in a skyline. Your task is to implement a function that takes this list as input and returns a list of integers representing the maximum height of the skyline at each building's position. If a building has a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_skyline_heights([3, 0, 2, 5, 0]) == [3, 3, 3, 5, 5]\", \"assert max_skyline_heights([1, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert max_skyline_heights([0, 0, 0]) == [0, 0, 0]\", \"assert max_skyline_heights([5, 4, 3, 2, 1]) == [5, 5, 5, 5, 5]\", \"assert max_... | {
"split": "train",
"index": 62987,
"acecode_id": "bigcode_python_fns_36284",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a Python function that takes a dictionary as input, implement a function `convert_to_json` that converts the input dictionary into a JSON string. If the input is not a valid dictionary, the function should return the string 'Invalid input'. The function should handle case... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_json({'key': 'value'}) == '{\\\"key\\\": \\\"value\\\"}'\", \"assert convert_to_json({'a': 1, 'b': [1, 2, 3], 'c': {'d': 4}}) == '{\\\"a\\\": 1, \\\"b\\\": [1, 2, 3], \\\"c\\\": {\\\"d\\\": 4}}'\", \"assert convert_to_json({'name': 'Alice', 'age':... | {
"split": "train",
"index": 62988,
"acecode_id": "bigcode_python_fns_21910",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `product_of_first_n_primes(N: int) -> int` that returns the product of the first N prime numbers. If N is less than or equal to 0, the function should return 1.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert product_of_first_n_primes(0) == 1\", \"assert product_of_first_n_primes(1) == 2\", \"assert product_of_first_n_primes(2) == 6\", \"assert product_of_first_n_primes(3) == 30\", \"assert product_of_first_n_primes(4) == 210\", \"assert product_of_first_n_primes... | {
"split": "train",
"index": 62989,
"acecode_id": "evol_31141",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the arithmetic average of a given list of non-negative integers. The function should return None if the list is empty. Write a function named `arithmetic_average` that takes a list of integers as its parameter.\nPlease reason step by step, t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert arithmetic_average([1, 2, 3, 4, 5]) == 3.0\", \"assert arithmetic_average([10, 20, 30]) == 20.0\", \"assert arithmetic_average([0, 0, 0]) == 0.0\", \"assert arithmetic_average([]) == None\", \"assert arithmetic_average([5]) == 5.0\", \"assert arithmetic_aver... | {
"split": "train",
"index": 62990,
"acecode_id": "evol_10382",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that locates the nth prime number in a given list of integers. The function should return the nth prime found in the list, or None if there are fewer than n primes. The input list can contain arbitrary integers, and you should not use any library functions ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_nth_prime([3, 4, 5, 6, 7], 2) == 5\", \"assert find_nth_prime([10, 15, 21, 22, 23, 29], 1) == 23\", \"assert find_nth_prime([1, 4, 6, 8, 10], 1) == None\", \"assert find_nth_prime([2, 3, 5, 7, 11], 4) == 7\", \"assert find_nth_prime([4, 6, 8, 10], 1) ==... | {
"split": "train",
"index": 62991,
"acecode_id": "evol_9605",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a custom property decorator in Python that enforces specific constraints on the assigned value. The property decorator should be able to handle data validation and default value assignment. Your task is to create a `UserProperty` decorator that ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_user('Doe') == 'Doe'\", \"assert create_user('Smith') == 'Smith'\", \"assert create_user('') == ''\", \"assert create_user('Johnson') == 'Johnson'\", \"assert create_user(last_name='') == ''\", \"assert create_user('A') == 'A'\", \"assert create_user(... | {
"split": "train",
"index": 62992,
"acecode_id": "oss_8338",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are working on a game development project, and you need to implement a checkpoint system. The game has a variable `SAVED_CHECKPOINTS` that stores the progress points at which the game should save the player's progress. The checkpoints are defined as multiples of 25,000, sta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_checkpoint(100000, [25000, 50000, 75000]) == [25000, 50000, 75000, 100000]\", \"assert add_checkpoint(25000, [25000, 50000, 75000]) == [25000, 50000, 75000]\", \"assert add_checkpoint(50000, [25000, 50000, 75000]) == [25000, 50000, 75000]\", \"assert add... | {
"split": "train",
"index": 62993,
"acecode_id": "oss_20128",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a set of coordinate names as input, return the names of the x and y coordinates based on specific criteria. If 'XC' is present in the coordinate names, return 'XC' as the x coordinate; otherwise, return 'XG'. Similarly, if 'YC' is present in the coordinate names, return '... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_xy_coords(['XC', 'YC']) == ('XC', 'YC')\", \"assert get_xy_coords(['XG', 'YC']) == ('XG', 'YC')\", \"assert get_xy_coords(['XC', 'YG']) == ('XC', 'YG')\", \"assert get_xy_coords(['XG', 'YG']) == ('XG', 'YG')\", \"assert get_xy_coords(['XC']) == ('XC', 'Y... | {
"split": "train",
"index": 62994,
"acecode_id": "bigcode_python_fns_49648",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of floating point numbers, determine if the elements in the first list are close to the corresponding elements in the second list according to a specified tolerance. Two numbers a and b are considered close if the absolute difference between them is less than or... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isclose([1e10, 1e-8], [1e10, 1e-8], 1e-5) == [True, True]\", \"assert isclose([1e10, 1e-7], [1e10 + 1e-6, 1e-7], 1e-5) == [True, True]\", \"assert isclose([0, 0], [0, 0], 1e-5) == [True, True]\", \"assert isclose([1, 2], [1.0001, 2.0001], 1e-5) == [False, Fa... | {
"split": "train",
"index": 62995,
"acecode_id": "bigcode_python_fns_22353",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a list of `queries` and a `pattern`, write a function that returns a list of booleans where each boolean indicates if the corresponding query matches the pattern according to camelcase matching rules. A query word matches the pattern if we can insert lowercase letters int... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert camelMatch(['FooBar', 'FooBarTest', 'FootBall', 'FrameBuffer', 'ForceFeedBack'], 'FB') == [True, False, True, True, False]\", \"assert camelMatch(['AlphaBeta', 'AlphaBETA', 'alphabeta'], 'AB') == [True, False, False]\", \"assert camelMatch(['AaaBbbCc', 'AaBb... | {
"split": "train",
"index": 62996,
"acecode_id": "evol_5527",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that reads a given string input, which represents the contents of a file, and returns it in uppercase. Your function should be named `convert_to_uppercase`. The function should take a single parameter: a string `file_content` that con... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_uppercase('Hello World') == 'HELLO WORLD'\", \"assert convert_to_uppercase('python programming') == 'PYTHON PROGRAMMING'\", \"assert convert_to_uppercase('LeetCode Challenges') == 'LEETCODE CHALLENGES'\", \"assert convert_to_uppercase('test case')... | {
"split": "train",
"index": 62997,
"acecode_id": "bigcode_python_fns_1562",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary `chip` that may contain information about a chip, return a string in the format 'make_model'. The 'make' and 'model' are extracted from the dictionary using the keys 'make' and 'model'. If either key is missing, the corresponding value in the output should be... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert key_make_model({'make': 'Intel', 'model': 'i7'}) == 'Intel_i7'\", \"assert key_make_model({'make': None, 'model': None}) == 'None_None'\", \"assert key_make_model({}) == 'None_None'\", \"assert key_make_model({'make': 'NVIDIA', 'model': None}) == 'NVIDIA_Non... | {
"split": "train",
"index": 62998,
"acecode_id": "bigcode_python_fns_163",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a list of user IDs, implement a function `is_enterprise_learner(user_ids: List[int]) -> List[bool]` that checks for each user ID if the user belongs to an enterprise. Assume you have access to a predefined function `is_enterprise(user_id: int) -> bool` that returns True i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_enterprise_learner([1, 2, 3]) == [True, False, True]\", \"assert is_enterprise_learner([4, 5]) == [False, False]\", \"assert is_enterprise_learner([17]) == [False]\", \"assert is_enterprise_learner([20]) == [False]\", \"assert is_enterprise_learner([24]) ... | {
"split": "train",
"index": 62999,
"acecode_id": "bigcode_python_fns_2503",
"num_tests": 7
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.