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 Python function that processes a list of migration operations and returns a dictionary containing the model names as keys and a list of field names as values. Each migration operation is represented as a tuple containing the model name, field name... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_fields_from_migrations([('bill', 'sunlight_id', 'CharField'), ('bill', 'url', 'CharField')]) == {'bill': ['sunlight_id', 'url']}\", \"assert extract_fields_from_migrations([('invoice', 'amount', 'DecimalField'), ('invoice', 'date', 'DateField')]) == ... | {
"split": "train",
"index": 69600,
"acecode_id": "oss_14250",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `check_all_unique_chars(s: str) -> bool` that takes a string `s` as input and returns `True` if all characters in the string are unique (ignoring spaces and case sensitivity), and `False` otherwise. For example, the string 'Hello' would return `False`, whil... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_all_unique_chars('Im so excited to learn GPT') == False\", \"assert check_all_unique_chars('abcdefg') == True\", \"assert check_all_unique_chars('12345') == True\", \"assert check_all_unique_chars('Hello') == False\", \"assert check_all_unique_chars('w... | {
"split": "train",
"index": 69601,
"acecode_id": "evol_24805",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a given JSON object and returns a list of all the paths to boolean values within the object. A path to a boolean value is defined as a sequence of keys leading to a boolean value in the JSON object. You are given... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_boolean_paths({}) == []\", \"assert find_boolean_paths({'a': True}) == ['a']\", \"assert find_boolean_paths({'a': False}) == ['a']\", \"assert find_boolean_paths({'a': {'b': True}}) == ['a/b']\", \"assert find_boolean_paths({'a': {'b': False}}) == ['a/b... | {
"split": "train",
"index": 69602,
"acecode_id": "oss_36988",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a dictionary of monthly data and a base directory path. The function should simulate the creation of a backup archive by returning a string that represents the path to the created archive. The archive file should be named 'snap... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_backup_archive('/backups', {'January.txt': 'data1', 'February.txt': 'data2'}) == '/backups/snapshot.tgz'\", \"assert create_backup_archive('/data', {'March.txt': 'data3'}) == '/data/snapshot.tgz'\", \"assert create_backup_archive('/archive', {}) == '/... | {
"split": "train",
"index": 69603,
"acecode_id": "bigcode_python_fns_21958",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that converts a single hexadecimal numeral (0-9, A-F) into its corresponding binary representation. If the input is not a valid hexadecimal numeral, the function should return an error message indicating the input is invalid. The function should accept a string... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hex_to_binary('0') == '0000'\", \"assert hex_to_binary('1') == '0001'\", \"assert hex_to_binary('2') == '0010'\", \"assert hex_to_binary('3') == '0011'\", \"assert hex_to_binary('4') == '0100'\", \"assert hex_to_binary('5') == '0101'\", \"assert hex_to_binar... | {
"split": "train",
"index": 69604,
"acecode_id": "evol_12614",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `max_product_subarray(arr: List[int]) -> int` that returns the maximum product that can be obtained from any contiguous subarray of the input list. The function should handle both positive and negative integers, as well as zero. The in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_product_subarray([2, 3, -2, 4]) == 6\", \"assert max_product_subarray([-2, 0, -1]) == 0\", \"assert max_product_subarray([-2, 3, -4]) == 24\", \"assert max_product_subarray([1, -1, -1, 1]) == 1\", \"assert max_product_subarray([0, 0, 0]) == 0\", \"assert... | {
"split": "train",
"index": 69605,
"acecode_id": "bigcode_python_fns_32192",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of probabilities, implement a function `round_flight_probabilities(flight_probs: List[float]) -> List[int]` that rounds each probability to either 0 or 1 based on its value. Each probability is rounded to 1 if a random number generated is less than the probability;... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert round_flight_probabilities([0.0, 0.5, 1.0]) == [0, 0, 1]\", \"assert round_flight_probabilities([0.1, 0.9]) == [0, 1]\", \"assert round_flight_probabilities([0.2, 0.4, 0.6, 0.8]) == [0, 0, 1, 1]\", \"assert round_flight_probabilities([0.15]) == [0]\", \"asse... | {
"split": "train",
"index": 69606,
"acecode_id": "bigcode_python_fns_21959",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a dependency resolution algorithm for a software package management system. The system maintains a list of dependencies in the form of tuples, where each tuple consists of two elements: the name of the dependency and its version. The version is ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_dependencies([('a', '0002_initial'), ('b', '0001_initial')]) == [('b', '0001_initial'), ('a', '0002_initial')]\", \"assert sort_dependencies([('x', '0003_initial'), ('y', '0003_initial')]) == [('x', '0003_initial'), ('y', '0003_initial')]\", \"assert so... | {
"split": "train",
"index": 69607,
"acecode_id": "oss_32842",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function that takes a string input representing an integer and returns the equivalent integer value. The input string can contain leading or trailing whitespace, and may optionally start with a '+' or '-' sign. If the input string is valid, return the in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_int(' 42') == 42\", \"assert convert_to_int(' -42') == -42\", \"assert convert_to_int(' +42 ') == 42\", \"assert convert_to_int('0') == 0\", \"assert convert_to_int(' 1234567890') == 1234567890\", \"assert convert_to_int(' +0') == 0\", \"as... | {
"split": "train",
"index": 69608,
"acecode_id": "bigcode_python_fns_36184",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list called `obj`. Your task is to implement a function that processes this list and returns a specific string based on its length and the value of an element at a certain index. The function should follow these rules: 1. If the length of the list `obj` is less ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_list([1, 2, 3, 4, 5]) == 'False'\", \"assert process_list([1, 2, 3, 4, 5, 6, 5]) == 'False'\", \"assert process_list([1, 2, 3, 4, 5, 6, 7]) == 'True'\", \"assert process_list([1, 2, 3, 4, 5, 6, 8]) == 'True'\", \"assert process_list([1, 2, 3, 4, 5, 6... | {
"split": "train",
"index": 69609,
"acecode_id": "oss_34915",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a Python function called 'isSubsequence' that takes in two string arguments, 'source' and 'target'. The function should determine if 'target' is a subsequence of 'source'. If 'target' is a subsequence of 'source', return True; otherwise, return False.\nPlease reason s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isSubsequence('abcde', 'ace') == True\", \"assert isSubsequence('hello', 'hlo') == True\", \"assert isSubsequence('abcdef', 'ace') == True\", \"assert isSubsequence('python', 'pyton') == True\", \"assert isSubsequence('substring', 'str') == True\", \"assert ... | {
"split": "train",
"index": 69610,
"acecode_id": "evol_18915",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `get_random_fact` that retrieves a random cat fact from a predefined list of cat facts. The function should return a random fact as a string. The predefined list of cat facts is as follows: ['Cats have five toes on their front paws, b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_random_fact() in ['Cats have five toes on their front paws, but only four toes on their back paws.', 'A group of cats is called a clowder.', 'Cats can rotate their ears 180 degrees.', 'A cat\\u2019s nose print is unique, much like a human\\u2019s fingerp... | {
"split": "train",
"index": 69611,
"acecode_id": "evol_35748",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a recursive binary search function that takes a sorted list of integers and a target integer as input. The function should return the index of the target if it exists in the list. If the target is not found, the function should raise a ValueError with the message 'Tar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binary_search([1, 2, 3, 4, 5], 3) == 2\", \"assert binary_search([10, 20, 30, 40, 50], 10) == 0\", \"assert binary_search([5, 10, 15, 20, 25], 25) == 4\", \"assert binary_search([7, 14, 21, 28, 35], 14) == 1\", \"assert binary_search([100, 200, 300, 400, 500... | {
"split": "train",
"index": 69612,
"acecode_id": "evol_23137",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates retrieving a cloud storage bucket name. The function should accept a string representing the bucket name and return it. Your function should be named `get_bucket_name`. The input should be a single string, and the output sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_bucket_name('my-awesome-bucket') == 'my-awesome-bucket'\", \"assert get_bucket_name('test-bucket-123') == 'test-bucket-123'\", \"assert get_bucket_name('production-bucket') == 'production-bucket'\", \"assert get_bucket_name('dev-bucket') == 'dev-bucket'\... | {
"split": "train",
"index": 69613,
"acecode_id": "oss_17965",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of numerical values, write a function that calculates and returns the number of elements in the list (N), the sum of all elements, the mean (average) of the elements, and the sum of squares of the elements. The function should take a list of floats or integers as i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert minimaldescriptives([]) == (0, 0.0, 0.0, 0.0)\", \"assert minimaldescriptives([1, 2, 3]) == (3, 6.0, 2.0, 14.0)\", \"assert minimaldescriptives([0, 0, 0]) == (3, 0.0, 0.0, 0.0)\", \"assert minimaldescriptives([-1, -2, -3]) == (3, -6.0, -2.0, 14.0)\", \"asser... | {
"split": "train",
"index": 69614,
"acecode_id": "bigcode_python_fns_27117",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function `process_jenkins_runs(runs: List[int]) -> List[int]` that takes a list of integers representing Jenkins run IDs and returns a list of unique run IDs that have been processed in the order they were received. If a run ID appears multiple times in the input li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_jenkins_runs([1, 2, 2, 3, 1, 4]) == [1, 2, 3, 4]\", \"assert process_jenkins_runs([5, 5, 5, 5, 5]) == [5]\", \"assert process_jenkins_runs([10, 20, 10, 30, 20, 10]) == [10, 20, 30]\", \"assert process_jenkins_runs([]) == []\", \"assert process_jenkin... | {
"split": "train",
"index": 69615,
"acecode_id": "bigcode_python_fns_16296",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates opening a specific URL in a web browser. Your function should take a string representing a URL as input and return a message indicating that the URL has been opened successfully. Implement the function `open_url(url: str) -... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert open_url('https://github.com/Dadangdut33/Osu-Extractor') == 'Opened: https://github.com/Dadangdut33/Osu-Extractor'\", \"assert open_url('http://example.com') == 'Opened: http://example.com'\", \"assert open_url('ftp://example.com') == 'Invalid URL'\", \"asse... | {
"split": "train",
"index": 69616,
"acecode_id": "oss_10775",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a line of code in C++, you need to implement a function that removes all occurrences of tabs, newlines, and semicolons from the string. The function should return the processed string. Write a function `pre_process(cpp_line: str) -> str` where `cpp_l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pre_process('int main();') == 'int main()'\", \"assert pre_process('\\\\t\\\\t\\\\t return 0;\\\\n') == ' return 0'\", \"assert pre_process('cout << \\\"Hello, World!\\\";') == 'cout << \\\"Hello, World!\\\"'\", \"assert pre_process(' x = 10;\\\\n y ... | {
"split": "train",
"index": 69617,
"acecode_id": "bigcode_python_fns_39838",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates a simple employee database in memory. Define a function called `query_employees_by_salary(threshold_salary, employees)` that accepts a threshold salary and a list of employee records. Each employee record is represen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert query_employees_by_salary(50000.0, [{'id': 1, 'name': 'Alice', 'department': 'HR', 'salary': 60000.0}, {'id': 2, 'name': 'Bob', 'department': 'IT', 'salary': 30000.0}]) == [{'id': 1, 'name': 'Alice', 'department': 'HR', 'salary': 60000.0}]\", \"assert query_... | {
"split": "train",
"index": 69618,
"acecode_id": "oss_6039",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function to process a list of dictionaries, where each dictionary represents a single record with various attributes. Your function should extract specific fields from each record based on two predefined lists: ORDERED_VAR and TEXTTT_VAR. The func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_records([{'table': 'A', 'name': 'Item1', 'description': 'Desc1', 'type': 'Type1', 'extra': 'data'}, {'table': 'B', 'name': 'Item2', 'description': 'Desc2', 'type': 'Type2'}]) == [{'table': 'A', 'name': 'Item1', 'description': 'Desc1', 'type': 'Type1'... | {
"split": "train",
"index": 69619,
"acecode_id": "oss_2970",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a string that represents an import statement in Python's module system. Your task is to create a function called `extract_file_extension` that takes this string as input and returns the file extension of the imported module. The import statement will always follow... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_file_extension('from .utils.helper import HelperFunction # noqa: 401') == 'helper'\", \"assert extract_file_extension('from .config.settings import AppConfig # noqa: 401') == 'settings'\", \"assert extract_file_extension('from .network.models impor... | {
"split": "train",
"index": 69620,
"acecode_id": "oss_23939",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given an XML string representing a list of people, each with a name and age, write a function that parses this XML string into a list of dictionaries. Each dictionary should contain the name and age of a person. After creating the list, sort this list in descending order based ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_people('<people><person><name>Alice</name><age>30</age></person><person><name>Bob</name><age>25</age></person><person><name>Charlie</name><age>30</age></person></people>') == [{'name': 'Alice', 'age': '30'}, {'name': 'Charlie', 'age': '30'}, {'name': 'B... | {
"split": "train",
"index": 69621,
"acecode_id": "evol_30251",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a directed graph represented as an adjacency list, implement a function that takes the graph and a maximum distance rb as input. The function should return a dictionary where each key is a node in the graph and the value is a list of nodes that can be reached from that no... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reachable_nodes({1: [2, 3], 2: [4], 3: [], 4: []}, 1) == {1: [2, 3], 2: [4], 3: [], 4: []}\", \"assert reachable_nodes({1: [2], 2: [3], 3: [], 4: []}, 2) == {1: [2, 3], 2: [3], 3: [], 4: []}\", \"assert reachable_nodes({1: [], 2: [], 3: []}, 1) == {1: [], 2:... | {
"split": "train",
"index": 69622,
"acecode_id": "bigcode_python_fns_13292",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with parsing configuration data from various sources and consolidating the information into a single dictionary format. Given three dictionaries: 'code_config', 'field_config', and 'time_config', your goal is to merge the 'code_config' and 'field_config' into a s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_configs({'key1': 'value1'}, {'key2': 'value2'}, {'time_key': 'time_value'}) == {'field_config': {'key1': 'value1', 'key2': 'value2'}, 'time_config': {'time_key': 'time_value'}}\", \"assert parse_configs({}, {'key2': 'value2'}, {'time_key': 'time_value'... | {
"split": "train",
"index": 69623,
"acecode_id": "bigcode_python_fns_14909",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a function-like object that represents a partial function. Write a function `get_signature(part: Callable) -> Tuple[Callable, Tuple, Dict, Dict]` that returns the signature of the given partial function object. The signature should consist of four components: the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_signature(partial(func, 1, 2, key='value')) == (func, (1, 2), {'key': 'value'}, {})\", \"assert get_signature(partial(func, 42)) == (func, (42,), {}, {})\", \"assert get_signature(partial(func)) == (func, (), {}, {})\", \"assert get_signature(partial(fun... | {
"split": "train",
"index": 69624,
"acecode_id": "bigcode_python_fns_12801",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a directory path as a string, implement a function `read_metadata(image_dir_path: str) -> Dict[str, Any]` that simulates reading image metadata from that directory. The function should return a dictionary representing the metadata of images, where the keys are the image f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert read_metadata('path/to/images') == {'image1': {'width': 1920, 'height': 1080, 'format': 'JPEG'}, 'image2': {'width': 1280, 'height': 720, 'format': 'PNG'}, 'image3': {'width': 640, 'height': 480, 'format': 'GIF'}}\", \"assert read_metadata('dummy/path') == {... | {
"split": "train",
"index": 69625,
"acecode_id": "bigcode_python_fns_29149",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the process of sending an email. The function should take the following parameters: sender's email address, recipient's email address, subject, and content of the email. The function should validate the email addresses ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert send_email('test@example.com', 'recipient@example.com', 'Subject', 'Content') == 'Email sent successfully!'\", \"assert send_email('invalid-email', 'recipient@example.com', 'Subject', 'Content') == 'Invalid email address(es)!'\", \"assert send_email('test@ex... | {
"split": "train",
"index": 69626,
"acecode_id": "oss_14680",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing names. Your task is to write a function that counts the number of names that start with a vowel (a, e, i, o, u, both uppercase and lowercase) and returns this count. The input will be a list of names (strings) and the output should b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_names_starting_with_vowel(['Alice', 'Bob', 'Eve']) == 2\", \"assert count_names_starting_with_vowel(['Oscar', 'Uma', 'Charlie']) == 2\", \"assert count_names_starting_with_vowel(['Daniel', 'Ethan', 'Igor']) == 2\", \"assert count_names_starting_with_vo... | {
"split": "train",
"index": 69627,
"acecode_id": "oss_15739",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that simulates signing out a user from a session by returning a boolean value. The function should take an integer input representing the session ID and should return True if the session ID is a valid integer greater than zero,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sign_out(1) == True\", \"assert sign_out(5) == True\", \"assert sign_out(10) == True\", \"assert sign_out(100) == True\", \"assert sign_out(50) == True\", \"assert sign_out(0) == False\", \"assert sign_out(-1) == False\", \"assert sign_out(-10) == False\", \... | {
"split": "train",
"index": 69628,
"acecode_id": "oss_19680",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a string as input and splits it into words. For each word, check a predefined dictionary that associates specific words with their corresponding meanings. If a word exists in the dictionary, return its meaning; otherwise, return 'Not Defined'. Th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert switch_case('Felis catus') == ['Species', 'Genus']\", \"assert switch_case('Felis') == ['Species']\", \"assert switch_case('catus') == ['Genus']\", \"assert switch_case('Felis felis') == ['Species', 'Not Defined']\", \"assert switch_case('dog cat') == ['Not ... | {
"split": "train",
"index": 69629,
"acecode_id": "evol_24385",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string consisting solely of lowercase English letters. Your task is to determine the minimum number of print operations required to replicate the string. The printer can print a continuous sequence of identical characters in one operation, and it can start and s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert print_operations('aaabbb') == 2\", \"assert print_operations('a') == 1\", \"assert print_operations('ab') == 2\", \"assert print_operations('aaa') == 1\", \"assert print_operations('aabbcc') == 3\", \"assert print_operations('abcde') == 5\", \"assert print_o... | {
"split": "train",
"index": 69630,
"acecode_id": "evol_4839",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates retrieving a connection string for an Azure Storage Account. Your function will take in a storage account name and a list of resource group arguments. The connection string will be returned in a predefined format. The conne... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_connection_string('mystorageaccount', ['--resource-group', 'myResourceGroup']) == 'DefaultEndpointsProtocol=https;AccountName=mystorageaccount;EndpointSuffix=core.windows.net;--resource-group;myResourceGroup'\", \"assert get_connection_string('testaccoun... | {
"split": "train",
"index": 69631,
"acecode_id": "bigcode_python_fns_48962",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that concatenates a given list of strings according to specific rules. The function should interleave characters from the input strings, reverse the characters, and handle strings of varying lengths by appending any remaining characters at the end. Addition... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert custom_concatenate([]) == ''\", \"assert custom_concatenate(['a', 'b', 'c']) == 'cba'\", \"assert custom_concatenate(['single']) == 'elgnis'\", \"assert custom_concatenate(['a', 1, 'b', None, 'c']) == 'cba'\", \"assert custom_concatenate(['a', 'b', 'c', 'd',... | {
"split": "train",
"index": 69632,
"acecode_id": "evol_27080",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple configuration manager for a software application. The configuration manager is responsible for managing the settings of the application. Your task is to implement a function `manage_config` that takes two parameters: a string `theme` re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_config('light') == {'theme': 'light', 'show_variables': True}\", \"assert manage_config('dark') == {'theme': 'dark', 'show_variables': True}\", \"assert manage_config('blue') == {'theme': 'light', 'show_variables': True}\", \"assert manage_config('lig... | {
"split": "train",
"index": 69633,
"acecode_id": "oss_3851",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that reads a configuration from a predefined set of key-value pairs and returns a dictionary representation of that configuration. The configuration will contain the following keys: 'host', 'port', 'username', and 'password'. Implement a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_config() == {'host': 'localhost', 'port': 8080, 'username': 'admin', 'password': 'admin123'}\", \"assert get_config()['host'] == 'localhost'\", \"assert get_config()['port'] == 8080\", \"assert get_config()['username'] == 'admin'\", \"assert get_config()... | {
"split": "train",
"index": 69634,
"acecode_id": "bigcode_python_fns_11399",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of words and a maximum line width, implement a function `pack_words(words: List[str], width: int) -> List[str]` that packs the words into lines such that each line does not exceed the specified width. Each line should consist of as many words as possible, separated... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pack_words(['Python', 'is', 'awesome'], 10) == ['Python is', 'awesome']\", \"assert pack_words(['Lorem', 'ipsum', 'dolor', 'sit', 'amet'], 20) == ['Lorem ipsum dolor', 'sit amet']\", \"assert pack_words(['A', 'B', 'C'], 1) == ['A', 'B', 'C']\", \"assert pack... | {
"split": "train",
"index": 69635,
"acecode_id": "bigcode_python_fns_500",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple parser for a custom programming language called LHYMicro-GL. This parser should handle different commands that affect its state, including setting the position and updating parameters like speed and power. Your task is to implement a fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_commands(['SET_POSITION 10.5']) == {'position': 10.5, 'board': 'M2', 'speed': 20.0, 'power': 1000.0}\", \"assert parse_commands(['SET_BOARD A1']) == {'position': None, 'board': 'A1', 'speed': 20.0, 'power': 1000.0}\", \"assert parse_commands(['SET_SPEE... | {
"split": "train",
"index": 69636,
"acecode_id": "oss_4835",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D array representing an RGB image, where each pixel is represented by three integer values corresponding to the Red, Green, and Blue channels (in that order). You are also given a dictionary that maps RGB values (as a string of a list) to a corresponding graysc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_rgb_to_gray([[[255, 0, 0], [0, 255, 0]], [[0, 0, 255], [255, 255, 0]]], {'[255, 0, 0]': 76, '[0, 255, 0]': 150, '[0, 0, 255]': 29, '[255, 255, 0]': 226}) == [[76, 150], [29, 226]]\", \"assert convert_rgb_to_gray([[[0, 0, 0], [255, 255, 255]]], {'[0, ... | {
"split": "train",
"index": 69637,
"acecode_id": "bigcode_python_fns_3656",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `safe_format(formatter: Callable[[Any], str], o: Any) -> str` that safely formats an object `o` using the provided `formatter` function. If an exception occurs during formatting, the function should return a string that contains the class name of the object, it... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert safe_format(str, 123) == '123'\", \"assert safe_format(str, 'Hello') == 'Hello'\", \"assert safe_format(str, [1, 2, 3]) == '[1, 2, 3]'\", \"assert 'error' in safe_format(lambda x: 1/0, 123)\", \"assert safe_format(lambda x: x.non_existent_method(), 123).star... | {
"split": "train",
"index": 69638,
"acecode_id": "bigcode_python_fns_42823",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given a string `url`, write a function `get_html_content(url: str) -> str` that simulates fetching HTML content from a provided URL. The function should return a simulated HTML response based on the following conditions: 1. If the URL contains the word 'error', return 'An error... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_html_content('http://example.com') == '<html><body>This is a generic page.</body></html>'\", \"assert get_html_content('http://google.com') == '<html><body>This is a page from Google.</body></html>'\", \"assert get_html_content('http://example.com/error'... | {
"split": "train",
"index": 69639,
"acecode_id": "bigcode_python_fns_31564",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the transport of data through a stream. The function should take in a stream-like object that supports reading and writing, as well as the data to send and the size of data to receive. The function should return the dat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert stream_transport(MockStream(), b'Hello, World!', 5) == b'Hello'\", \"assert stream_transport(MockStream(), b'LeetCode', 8) == b'LeetCode'\", \"assert stream_transport(MockStream(), b'Transport', 4) == b'Tran'\", \"assert stream_transport(MockStream(), b'Data... | {
"split": "train",
"index": 69640,
"acecode_id": "oss_2504",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function that validates a given value against a specific node type 'Procedure'. The function should take a single parameter `value`, which represents the value to be validated. You will use a predefined set of valid values for the 'Procedure' node type. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_procedure('valid_procedure_1') == True\", \"assert validate_procedure('valid_procedure_2') == True\", \"assert validate_procedure('invalid_procedure_1') == False\", \"assert validate_procedure('invalid_procedure_2') == False\", \"assert validate_pro... | {
"split": "train",
"index": 69641,
"acecode_id": "oss_32025",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks whether a given username and password are valid against a predefined list of users. The function should take two parameters: a string `username` and a string `password`. The password should be checked against its MD5 hash. You... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_login('user1', 'wrongpassword', [{'username': 'user1', 'password': '5f4dcc3b5aa765d61d8327deb882cf99'}]) == False\", \"assert check_login('nonexistent_user', 'password', [{'username': 'user1', 'password': '5f4dcc3b5aa765d61d8327deb882cf99'}]) == False\... | {
"split": "train",
"index": 69642,
"acecode_id": "bigcode_python_fns_9720",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a simple robot that moves in a straight line. The robot has light sensors that detect changes in light intensity. Your goal is to implement a function `detect_light_intensity()` that simulates the robot's light sensors and returns the detected lig... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert detect_light_intensity([0, 0, 0, 0, 15, 0]) == 15\", \"assert detect_light_intensity([5, 6, 7, 8, 9]) == -1\", \"assert detect_light_intensity([0, 0, 0, 20]) == 20\", \"assert detect_light_intensity([30, 30, 30]) == -1\", \"assert detect_light_intensity([5, ... | {
"split": "train",
"index": 69643,
"acecode_id": "oss_32061",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function that returns the Fibonacci number at the nth position in the Fibonacci sequence, where the sequence starts with 0 and 1. The function should take an integer n (0-indexed) as input and return the nth Fibonacci number.\nPlease reason step by step, then write ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(0) == 0\", \"assert fibonacci(1) == 1\", \"assert fibonacci(2) == 1\", \"assert fibonacci(3) == 2\", \"assert fibonacci(4) == 3\", \"assert fibonacci(5) == 5\", \"assert fibonacci(6) == 8\", \"assert fibonacci(7) == 13\", \"assert fibonacci(8) == 2... | {
"split": "train",
"index": 69644,
"acecode_id": "evol_7510",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the total number of graded papers by a teacher. The teacher has a certain number of uninterrupted planning periods (x), and spends a specific number of half-hour increments (y) at home grading papers. Each planning period allows the teacher to gr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert graded_papers(3, 4, 10, 5) == 50\", \"assert graded_papers(0, 0, 10, 5) == 0\", \"assert graded_papers(10, 5, 2, 3) == 35\", \"assert graded_papers(5, 10, 0, 0) == 0\", \"assert graded_papers(4, 2, 5, 5) == 30\", \"assert graded_papers(1, 6, 10, 1) == 16\", ... | {
"split": "train",
"index": 69645,
"acecode_id": "evol_22704",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a nested dictionary `content` that contains data organized into families, source files, and training coefficients. The structure of `content` is as follows: the first level keys represent different families of data, the second level keys are integers (which will b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_medians({'family1': {1: {'file1': {'coeff1': [1, 2, 3], 'coeff2': [4, 5, 6]}, 'file2': {'coeff1': [7, 8, 9], 'coeff2': [10, 11, 12]}}}}) == {'file1': {'coeff1': 2.0, 'coeff2': 5.0}, 'file2': {'coeff1': 8.0, 'coeff2': 11.0}}\", \"assert calculate_me... | {
"split": "train",
"index": 69646,
"acecode_id": "oss_19187",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple game of rock-paper-scissors between a human player and the computer. The function takes the human player's move as input, which can be 'rock', 'paper', or 'scissors'. The computer's move will be randomly selected f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert play_rps('rock') in ['You win!', 'Computer wins!', \\\"It's a tie!\\\"]\", \"assert play_rps('paper') in ['You win!', 'Computer wins!', \\\"It's a tie!\\\"]\", \"assert play_rps('scissors') in ['You win!', 'Computer wins!', \\\"It's a tie!\\\"]\", \"assert p... | {
"split": "train",
"index": 69647,
"acecode_id": "oss_23361",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates a hash index from a given occupancy bitboard using a magic number. The occupancy bitboard is represented as a non-negative integer, where each bit corresponds to a square on the chessboard. The magic number is a precom... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_hash_index(0b11111111, 0x00000001) == 0\", \"assert extract_hash_index(0b0, 0xFFFFFFFF) == 0\", \"assert extract_hash_index(0b1100, 0x0F0F0F0F) == 0\", \"assert extract_hash_index(0b0001, 0x00000010) == 0\", \"assert extract_hash_index(0b0011, 0x0000... | {
"split": "train",
"index": 69648,
"acecode_id": "oss_16546",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `store_credentials(api: str, key: str, secret: str) -> dict` that processes an API string and generates a dictionary containing the API, key, secret, a derived ID, and a bucket value. The ID is derived by taking the first 5 characters of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert store_credentials('abcdef', 'sample_key', 'sample_secret') == {'api': 'abcdef', 'key': 'sample_key', 'secret': 'sample_secret', 'bucket': 'even_bucket', 'id': 'abcde'}\", \"assert store_credentials('a', 'key1', 'secret1') == {'api': 'a', 'key': 'key1', 'secr... | {
"split": "train",
"index": 69649,
"acecode_id": "bigcode_python_fns_24144",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing datasets for a data processing application. Implement a function `manage_dataset` that takes the following parameters: `unique_name`, `dataset_format`, `content`, and `tags`. The function should create a dataset using the provided parameters and the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_dataset('dataset1', 'ini', 'SGVsbG8gV29ybGQ=', ['tag1', 'tag2']) == {'dataset': {'unique_name': 'dataset1', 'format': 'ini', 'content': 'SGVsbG8gV29ybGQ=', 'tags': ['tag1', 'tag2']}, 'message': 'Dataset deleted successfully'}\", \"assert manage_datase... | {
"split": "train",
"index": 69650,
"acecode_id": "oss_23268",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates sending a configuration request to set up an LDAP server. The function should accept a host name or IP address, a dictionary of arguments that contain the URI, bindDN, baseDN, bindPassword, scope, and serverType. The fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert send_ldap_config('192.168.0.1', {'uri': 'ldap://example.com', 'bindDN': 'cn=admin', 'baseDN': 'dc=example,dc=com', 'bindPassword': 'password', 'scope': 'sub', 'serverType': 'ActiveDirectory'}) == 'Configuration sent successfully.'\", \"assert send_ldap_confi... | {
"split": "train",
"index": 69651,
"acecode_id": "bigcode_python_fns_14983",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing metadata for a file. Your task is to implement a function called `update_metadata` that takes two parameters: the current metadata dictionary and a dictionary of new metadata values. The function should update the current metadata with th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_metadata({'author': 'Alice', 'version': 1}, {'author': 'Bob'}) == {'author': 'Bob', 'version': 1}\", \"assert update_metadata({'author': 'Alice', 'version': 1}, {'version': 2}) == {'author': 'Alice', 'version': 2}\", \"assert update_metadata({}, {'key... | {
"split": "train",
"index": 69652,
"acecode_id": "oss_21723",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a function that calculates the median value from two sorted arrays of dissimilar lengths. The arrays may include both positive and negative integers, as well as floating point numbers. The function should handle situations where one or both arrays are empty and also man... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert findMedianOfTwoSortedArrays([1, 3], [2]) == 2.0\", \"assert findMedianOfTwoSortedArrays([1, 2], [3, 4]) == 2.5\", \"assert findMedianOfTwoSortedArrays([], [1]) == 1.0\", \"assert findMedianOfTwoSortedArrays([1], []) == 1.0\", \"assert findMedianOfTwoSortedAr... | {
"split": "train",
"index": 69653,
"acecode_id": "evol_34953",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function `fib_hex_check(num: str) -> bool` that takes a hexadecimal string `num` as input and determines if the decimal equivalent of the hexadecimal number is a Fibonacci number. The function should handle invalid hexadecimal inputs gracefully, returning False in s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fib_hex_check('0x0') == True\", \"assert fib_hex_check('0x1') == True\", \"assert fib_hex_check('0x2') == True\", \"assert fib_hex_check('0x3') == True\", \"assert fib_hex_check('0x5') == True\", \"assert fib_hex_check('0x8') == True\", \"assert fib_hex_chec... | {
"split": "train",
"index": 69654,
"acecode_id": "evol_27453",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing log file data. Implement a function `process_data` that performs the following operations:\n\n1. Construct the path to a log file by concatenating the value of `LOG_DIR_NAME` from the given `config` dictionary with the provided `log_filename`.\n2.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_data({'LOG_DIR_NAME': '/var/logs'}, 'app.log', 'public') is None\", \"assert process_data({'LOG_DIR_NAME': '/tmp/logs'}, 'error.log', 'private') is None\", \"assert process_data({'LOG_DIR_NAME': '/home/user/logs'}, 'access.log', 'test_schema') is Non... | {
"split": "train",
"index": 69655,
"acecode_id": "oss_33885",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `logout()` that simulates the logout process of a user in a web application. The function should perform the following actions: 1. Display a message 'You Have Been Logged Out'. 2. Clear the user session by removing the 'user' key from... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert logout() == 'Redirect to login page'\", \"assert logout() == 'Redirect to login page'\", \"assert logout() == 'Redirect to login page'\", \"assert logout() == 'Redirect to login page'\", \"assert logout() == 'Redirect to login page'\", \"assert logout() == '... | {
"split": "train",
"index": 69656,
"acecode_id": "bigcode_python_fns_47653",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that returns a list of all prime numbers from the given list. A prime number is defined as a number greater than 1 that has no positive divisors other than 1 and itself. You should check divisibility only by numbers up to the squar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_primes([2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]) == [2, 3, 5, 7, 11]\", \"assert find_primes([1, 4, 6, 8, 9, 10]) == []\", \"assert find_primes([13, 15, 17, 19, 21]) == [13, 17, 19]\", \"assert find_primes([22, 23, 24, 25, 26]) == [23]\", \"assert find_prim... | {
"split": "train",
"index": 69657,
"acecode_id": "evol_7966",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `field`, which may contain a leading '-' sign, and a dictionary `aliases` that maps field names to their corresponding aliases (which may be comma-separated), your task is to implement a function `get_field_names(field: str, aliases: dict) -> List[str]`. This fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_field_names('name', {'name': 'first_name,last_name'}) == ['name']\", \"assert get_field_names('age', {'age': 'years,months'}) == ['age']\", \"assert get_field_names('gender', {'gender': 'male,female'}) == ['gender']\", \"assert get_field_names('status', ... | {
"split": "train",
"index": 69658,
"acecode_id": "bigcode_python_fns_28854",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to calculate the profit and profit ratio from stock transactions. The function takes the following parameters: a stock code (string), cost price (float), market price (float), number of stocks (int), and a date (string). The function ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_stock_profit('AAPL', 150.0, 175.0, 100, '2022-01-01') == {'market_value': 17500.0, 'profit': 2500.0, 'profit_ratio': 16.67}\", \"assert calculate_stock_profit('TSLA', 600.0, 700.0, 10, '2022-03-01') == {'market_value': 7000.0, 'profit': 1000.0, 'pr... | {
"split": "train",
"index": 69659,
"acecode_id": "oss_16297",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function `manage_inventory(actions: List[Tuple[str, str]]) -> List[str]` where `actions` is a list of tuples. Each tuple contains an action and an item. The action can be one of the following: 'add', 'remove', or 'consume'. The function should maintain an inventory ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_inventory([('add', 'food1'), ('add', 'food2'), ('add', 'weapon1')]) == ['food1, food2, weapon1']\", \"assert manage_inventory([('add', 'food1'), ('remove', 'food1'), ('add', 'weapon1')]) == ['weapon1']\", \"assert manage_inventory([('add', 'food1'), (... | {
"split": "train",
"index": 69660,
"acecode_id": "oss_6145",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a dropout regularization technique in a neural network. Dropout is a technique used to prevent overfitting in neural networks by randomly setting a fraction of input units to 0 at each update during training. Your task is to implement a function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert apply_dropout([1.0, 2.0, 3.0], 0.0) == [1.0, 2.0, 3.0]\", \"assert apply_dropout([0.0, 0.0, 0.0], 0.5) == [0.0, 0.0, 0.0]\", \"assert apply_dropout([4.0, 5.0, 6.0], 0.2) == [5.0, 6.25, 7.5]\", \"assert apply_dropout([10.0], 0.1) == [11.11111111111111]\", \"a... | {
"split": "train",
"index": 69661,
"acecode_id": "oss_15177",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a function `calculate(p: Union[int, float], q: Union[int, float], r: Union[int, float]) -> Tuple[float, float, float]` that performs the following operations: 1) Calculate `n` as the result of `p - q - r`, 2) Calculate `m` as `p % q % r` if both `q` and `r` are non-ze... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate(10, 2, 1) == (7, 0, 0)\", \"assert calculate(5, 3, 2) == (0, 0, 0)\", \"assert calculate(100, 1, 99) == (0, 0, 0)\", \"assert calculate(-10, -5, -2) == (-3, 0, 0)\", \"assert calculate(50, 10, 5) == (35, 0, 0)\", \"assert calculate(1000, 500, 250) ... | {
"split": "train",
"index": 69662,
"acecode_id": "evol_35932",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a file path and an optional suffix. Your task is to implement a function that normalizes the file path by ensuring that it starts with a forward slash ('/') and appends the suffix to the path if it is provided and not already present at the e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert normalize_path('documents', 'images/') == '/documents/images'\", \"assert normalize_path('documents/', 'images') == '/documents/images'\", \"assert normalize_path('documents', None) == '/documents'\", \"assert normalize_path('documents', 'images/') == '/docu... | {
"split": "train",
"index": 69663,
"acecode_id": "bigcode_python_fns_11622",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function called `insert_null_after_batches` that takes a list of integers as input and inserts a null value (None) after every batch of exactly four integers in the list. The function should return the modified list. For example, given the input list [1, 2, 3, 4, 5, 6,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert insert_null_after_batches([1,2,3,4]) == [1, 2, 3, 4, None]\", \"assert insert_null_after_batches([1,2,3]) == [1, 2, 3]\", \"assert insert_null_after_batches([]) == []\", \"assert insert_null_after_batches([1,2,3,4,5]) == [1, 2, 3, 4, None, 5]\", \"assert ins... | {
"split": "train",
"index": 69664,
"acecode_id": "evol_12985",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a list of lists of integers, implement a function `sum_of_lists(lists)` that returns the sum of all integers across all the sublists. Each sublist contains integers. You should return the total sum of all integers in a single integer value.\nPlease reason step by step, th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_lists([[1, 2], [3, 4]]) == 10\", \"assert sum_of_lists([[5, 5], [5]]) == 15\", \"assert sum_of_lists([[], [], []]) == 0\", \"assert sum_of_lists([[10], [20], [30]]) == 60\", \"assert sum_of_lists([[1, -1], [2, -2], [3, -3]]) == 0\", \"assert sum_of_li... | {
"split": "train",
"index": 69665,
"acecode_id": "evol_2361",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a non-empty string `s` and a subsequence `sub`, determine if the string `s` contains the provided subsequence `sub`. A subsequence is derived from the string by deleting some or no elements without changing the order of the remaining elements. Write a function `is_subsequ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_subsequence('programming', 'prg') == True\", \"assert is_subsequence('hello', 'hello') == True\", \"assert is_subsequence('abcd', 'ace') == False\", \"assert is_subsequence('abcdef', 'ace') == True\", \"assert is_subsequence('xyz', 'x') == True\", \"asser... | {
"split": "train",
"index": 69666,
"acecode_id": "evol_19518",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that converts values between different units of measurement for length. The function should take a value, its current unit, and a target unit as inputs, and return the converted value. The supported units are 'meters' and 'feet'. If t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unit_convert(1, 'meters', 'feet') == 3.28084\", \"assert unit_convert(1, 'feet', 'meters') == 1 / 3.28084\", \"assert unit_convert(0, 'meters', 'feet') == 0\", \"assert unit_convert(0, 'feet', 'meters') == 0\", \"assert unit_convert(10, 'meters', 'feet') == ... | {
"split": "train",
"index": 69667,
"acecode_id": "oss_8896",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `generate_password` that generates a secure password based on specific rules. The password must be a string of a specified length (minimum length of 8) and must contain at least one digit, one uppercase letter, one lowercase letter, and one special c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_password(8) != ''\", \"assert len(generate_password(10)) == 10\", \"assert len(generate_password(12)) == 12\", \"assert generate_password(8).isalpha() == False\", \"assert any(c.isdigit() for c in generate_password(10))\", \"assert any(c.isupper() f... | {
"split": "train",
"index": 69668,
"acecode_id": "evol_7223",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that determines if two strings are anagrams of each other. Two strings are considered anagrams if they can be rearranged to form each other, meaning both strings contain the same characters in the same frequency. The function should take two strings as inpu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_if_anagram('listen', 'silent') == True\", \"assert check_if_anagram('triangle', 'integral') == True\", \"assert check_if_anagram('apple', 'pale') == False\", \"assert check_if_anagram('rat', 'car') == False\", \"assert check_if_anagram('evil', 'vile') ... | {
"split": "train",
"index": 69669,
"acecode_id": "evol_32085",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the movement of a character in a 2D space based on arrow key inputs. The character can move in four directions: up, down, left, and right, with a specified speed. Your function should take in the initial position of the cha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert move_character(0, 0, 5, ['UP', 'UP', 'RIGHT']) == (5, 10)\", \"assert move_character(10, 10, 3, ['LEFT', 'DOWN', 'RIGHT', 'UP']) == (10, 10)\", \"assert move_character(500, 500, 10, ['UP', 'DOWN', 'LEFT', 'RIGHT']) == (500, 500)\", \"assert move_character(10... | {
"split": "train",
"index": 69670,
"acecode_id": "oss_16352",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with analyzing the frequency of words in a given string and outputting the top N most frequent words along with their counts. The analysis should ignore common stop words (e.g., 'the', 'and', 'is') and should be case-insensitive (i.e., 'The' and 'the' should be c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert top_n_words('Word word word test test example example test.', 3) == [('test', 3), ('word', 3), ('example', 2)]\", \"assert top_n_words('One two three one two ONE.', 2) == [('one', 3), ('two', 2)]\", \"assert top_n_words('The quick brown fox jumps over the la... | {
"split": "train",
"index": 69671,
"acecode_id": "oss_36993",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the total value of products in a store. Each product has a name, price, and quantity available. Write a function `calculate_total_value(products: List[Tuple[str, float, int]]) -> float` that takes a list of products, where each product is represe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_value([('watermelon', 3.0, 5), ('kiwi', 2.0, 0)]) == 15.0\", \"assert calculate_total_value([('coconut', 4.0, 1), ('avocado', 2.5, 3)]) == 11.5\", \"assert calculate_total_value([('lemon', 0.75, 20), ('lime', 0.5, 15)]) == 22.5\", \"assert ca... | {
"split": "train",
"index": 69672,
"acecode_id": "oss_35256",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes any number of arguments and returns a tuple containing those arguments in the order they were provided. The function should accept both positional and keyword arguments. For keyword arguments, include their values in the tuple but disregard their... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert construct_tuple(1, 2, 3) == (1, 2, 3)\", \"assert construct_tuple('A', 'B', 'C') == ('A', 'B', 'C')\", \"assert construct_tuple(1.1, 2.2, 3.3) == (1.1, 2.2, 3.3)\", \"assert construct_tuple() == ()\", \"assert construct_tuple('Hello', 42) == ('Hello', 42)\",... | {
"split": "train",
"index": 69673,
"acecode_id": "evol_30468",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Koko loves to eat bananas. There are `n` piles of bananas, where the `ith` pile contains `piles[i]` bananas. Koko can decide on her eating speed of `k` bananas per hour. Each hour, she can choose a pile and eat `k` bananas from it. If the pile has less than `k` bananas, she eat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert minEatingSpeed([3,6,7,11], 8, 2, 2) == 4\", \"assert minEatingSpeed([30,11,23,4,20], 5, 10, 1) == 30\", \"assert minEatingSpeed([30,11,23,4,20], 6, 5, 2) == 23\", \"assert minEatingSpeed([10,10,10], 3, 5, 1) == 10\", \"assert minEatingSpeed([1,1,1,1,1], 5, 1... | {
"split": "train",
"index": 69674,
"acecode_id": "evol_8622",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, implement a function `count_greetings(strings: List[str]) -> int` that counts the number of times the words 'hello', 'hi', 'greet', or 'greetings' appear in the list, regardless of their case. The function should return the total count of these greeting... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_greetings(['Hello', 'hi', 'Goodbye', 'greet', 'greetings', 'HELLO']) == 5\", \"assert count_greetings(['hello', 'world', 'greet']) == 2\", \"assert count_greetings(['nothing', 'here']) == 0\", \"assert count_greetings(['greetings', 'greet', 'greet']) =... | {
"split": "train",
"index": 69675,
"acecode_id": "bigcode_python_fns_49641",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `generate_ecommerce_specifications` that returns a list of essential specifications for the development of an e-commerce website project. The specifications should include advanced features such as personalized user experience, complex tracking systems, and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_ecommerce_specifications() == [\\\"Design and implementation of UI/UX for personalized user experience.\\\", \\\"Development of complex tracking systems for monitoring user activity and behavior.\\\", \\\"Integration with multiple payment gateways s... | {
"split": "train",
"index": 69676,
"acecode_id": "evol_6088",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function that computes the surface area of an octahedron for a given side length x. The surface area of an octahedron can be calculated using the formula: 2 * sqrt(3) * x^2. Your function should handle incorrect types of inputs by returning a specific error message:... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert octahedron_surface_area(1) == 3.4641016151377544\", \"assert octahedron_surface_area(0) == 'Invalid input! Please enter a positive number'\", \"assert octahedron_surface_area(-1) == 'Invalid input! Please enter a positive number'\", \"assert octahedron_surfa... | {
"split": "train",
"index": 69677,
"acecode_id": "evol_19596",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that compares two objects based on the result of a specified function applied to each object. Your goal is to create a function `compare_objects(function: Callable[[Any], Any], a: Any, b: Any) -> bool` that takes a callable `function`... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compare_objects(lambda x: x * x, 3, 4) == False\", \"assert compare_objects(lambda x: x * x, 5, 2) == True\", \"assert compare_objects(lambda x: len(x), 'hello', 'world') == False\", \"assert compare_objects(lambda x: len(x), 'python', 'java') == True\", \"a... | {
"split": "train",
"index": 69678,
"acecode_id": "oss_21956",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Imagine you are tasked with creating a function that retrieves a list of active users from a database. The database is represented as a list of dictionaries, where each dictionary contains user details including 'id', 'name', and 'is_active'. Your function should take this list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_active_users([{'id': 1, 'name': 'Alice', 'is_active': True}, {'id': 2, 'name': 'Bob', 'is_active': False}]) == {'items': [{'id': 1, 'name': 'Alice'}]}\", \"assert get_active_users([{'id': 3, 'name': 'Charlie', 'is_active': True}, {'id': 4, 'name': 'David... | {
"split": "train",
"index": 69679,
"acecode_id": "bigcode_python_fns_39209",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `change_directory(path: str) -> str` that simulates changing the current working directory to a specified path. The function should take a string `path` as input, which represents the directory to change to. If the `path` is valid, the fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert change_directory('/valid/path') == 'Changed to directory: /valid/path'\", \"assert change_directory('/home/user/docs') == 'Changed to directory: /home/user/docs'\", \"assert change_directory('relative/path') == 'Changed to directory: relative/path'\", \"asse... | {
"split": "train",
"index": 69680,
"acecode_id": "bigcode_python_fns_7378",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are building a blogging platform and need to implement a function that retrieves the next blog post based on the modification date of a given post. Write a function `get_next_post(posts: List[Tuple[str, datetime]], current_modify_date: datetime) -> Optional[Tuple[str, datet... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_next_post([('Post 1', datetime.datetime(2022, 1, 1)), ('Post 2', datetime.datetime(2022, 2, 1)), ('Post 3', datetime.datetime(2022, 3, 1))], datetime.datetime(2022, 1, 1)) == ('Post 2', datetime.datetime(2022, 2, 1))\", \"assert get_next_post([('Post 1',... | {
"split": "train",
"index": 69681,
"acecode_id": "oss_25418",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function called `vm_sanity_check` that simulates a periodic sanity check for virtual machines (VMs). The function should log the start and end of the check process. If a sanity check fails, it should handle the exception and log that an except... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert vm_sanity_check() == 'VM Sanity Check Passed'\", \"assert vm_sanity_check() == 'VM Sanity Check Passed'\", \"assert vm_sanity_check() == 'VM Sanity Check Passed'\", \"assert vm_sanity_check() == 'VM Sanity Check Passed'\", \"assert vm_sanity_check() == 'VM S... | {
"split": "train",
"index": 69682,
"acecode_id": "bigcode_python_fns_8834",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `check_even_odd` that takes an integer `number` as input and returns the string 'Even' if the number is even, and 'Odd' if the number is odd.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```py... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_even_odd(0) == 'Even'\", \"assert check_even_odd(1) == 'Odd'\", \"assert check_even_odd(2) == 'Even'\", \"assert check_even_odd(3) == 'Odd'\", \"assert check_even_odd(4) == 'Even'\", \"assert check_even_odd(5) == 'Odd'\", \"assert check_even_odd(6) == ... | {
"split": "train",
"index": 69683,
"acecode_id": "evol_18928",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `compare_strings(string1: str, string2: str, threshold: float) -> str` that compares two strings and returns one of three possible results: 'equal' if the strings are identical, 'different' if the strings are completely different, and 'similar' if the strin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compare_strings('hello', 'hello', 0.75) == 'equal'\", \"assert compare_strings('hello', 'world', 0.75) == 'different'\", \"assert compare_strings('hello', 'healo', 0.75) == 'similar'\", \"assert compare_strings('abc', 'abc', 0.5) == 'equal'\", \"assert compa... | {
"split": "train",
"index": 69684,
"acecode_id": "evol_6209",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the behavior of a simple task scheduler. The function should accept a list of tasks and a time interval, and it should return a new list containing the tasks scheduled at the specified intervals. Each task is represented as... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert schedule_tasks(['A', 'B', 'C'], 0) == []\", \"assert schedule_tasks([], 1) == []\", \"assert schedule_tasks(['Task1'], 3) == ['Task1']\", \"assert schedule_tasks(['SingleTask'], 1) == ['SingleTask']\", \"assert schedule_tasks(['TaskA', 'TaskB'], 2) == ['Task... | {
"split": "train",
"index": 69685,
"acecode_id": "bigcode_python_fns_7676",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple representation of a person. Write a function `get_person_name(name: str) -> str` that takes a string `name` as input and returns the name as it is. Your function should simply return the input name without any modifications. If the input na... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_person_name('Alice') == 'Alice'\", \"assert get_person_name('Bob') == 'Bob'\", \"assert get_person_name('Charlie') == 'Charlie'\", \"assert get_person_name('') == 'Unnamed'\", \"assert get_person_name('David') == 'David'\", \"assert get_person_name('Eve'... | {
"split": "train",
"index": 69686,
"acecode_id": "oss_321",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a dictionary representing information about a drone category. The function should extract specific fields from the dictionary: 'anfp', 'dfp', 'bnfp', 'pds', 'pde', 'jds', 'jde', 'bbd', 'pc', 'pl', 'rmn', and 'pon'. The func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_drone_info({'anfp': '18505100', 'dfp': 'Description here', 'bnfp': '448528', 'pds': '2020-02-12', 'pde': '2020-02-20', 'jds': '43', 'jde': '51', 'bbd': '2020-05-20', 'pc': 'DE', 'pl': 'Herrath', 'rmn': '11200100520', 'pon': '3895814603'}) == {'anfp':... | {
"split": "train",
"index": 69687,
"acecode_id": "bigcode_python_fns_48791",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of tuples, where each tuple contains three integers (range_start, range_end, limit), create a function that generates an acceleration table of size 1001. The table should be initialized with zeros, and for each tuple in the list, set all indices from range_start to... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert gen_accel_table([(0, 2, 5)]) == [5, 5, 5] + [0] * 998\", \"assert gen_accel_table([(0, 100, 10)]) == [10] * 101 + [0] * 900\", \"assert gen_accel_table([(0, 0, 1)]) == [1] + [0] * 1000\", \"assert gen_accel_table([(900, 999, 4)]) == [0] * 900 + [4] * 100 + [... | {
"split": "train",
"index": 69688,
"acecode_id": "bigcode_python_fns_17823",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes user location data based on certain parameters. The function will take in two dictionaries, `params` and `query`, as input. The `params` dictionary contains a key `location_id` representing the location identifie... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_location_data({'location_id': 'loc_123'}, {'user_id': 'user_456'}) == ('loc_123', 'user_456', '')\", \"assert process_location_data({'location_id': 'loc_789'}, {'user_id': 'user_101', 'uuid_filter': 'uuid_202'}) == ('loc_789', 'user_101', 'uuid_202')... | {
"split": "train",
"index": 69689,
"acecode_id": "oss_9931",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes an array and an integer N as input, and returns the first N elements of the array in reverse order without using any built-in functions or methods. If N is greater than the length of the array, return the entire array in reverse order.\nPlease reason... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_first_n_elements([1], 1) == [1]\", \"assert reverse_first_n_elements([1, 2, 3, 4, 5], 10) == [5, 4, 3, 2, 1]\", \"assert reverse_first_n_elements([], 3) == []\", \"assert reverse_first_n_elements([5, 3, 8, 6], 4) == [6, 8, 3, 5]\", \"assert reverse_f... | {
"split": "train",
"index": 69690,
"acecode_id": "evol_418",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to train a part-of-speech tagger using a simplified version of the TnT (Trigrams'n'Tags) statistical method. The function should take a list of tagged sentences, where each sentence is represented as a list of tuples, and each tuple c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert train_tnt_pos_tagger([[('The', 'DT'), ('cat', 'NN'), ('is', 'VBZ'), ('on', 'IN'), ('the', 'DT'), ('mat', 'NN')]]) == 'Model trained successfully.'\", \"assert train_tnt_pos_tagger([[('She', 'PRP'), ('sells', 'VBZ'), ('seashells', 'NNS'), ('by', 'IN'), ('the'... | {
"split": "train",
"index": 69691,
"acecode_id": "oss_8809",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with categorizing job listings based on their availability for an 'express apply' option. You are given a list of job titles and a corresponding list of boolean values indicating whether each job offers an 'express apply' option. Your goal is to implement a funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert categorize_express_apply(['Software Engineer', 'Data Scientist', 'Web Developer'], [True, False, True]) == ['Software Engineer', 'Web Developer']\", \"assert categorize_express_apply(['Project Manager', 'Product Owner', 'UX Designer'], [False, False, False])... | {
"split": "train",
"index": 69692,
"acecode_id": "oss_28467",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that calculates the total duration of video clips. The function should take a list of integers representing the durations of different video clips in seconds and return the total duration. If the list is empty, the function should return ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_duration([]) == 0\", \"assert calculate_total_duration([60]) == 60\", \"assert calculate_total_duration([60, 120]) == 180\", \"assert calculate_total_duration([90, 30, 15]) == 135\", \"assert calculate_total_duration([0, 0, 0]) == 0\", \"asse... | {
"split": "train",
"index": 69693,
"acecode_id": "oss_1607",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the volume and surface area of a solid based on its type and dimensions. The function should accept two parameters: a string `solid_type` representing the type of the solid (e.g., 'cube', 'sphere', 'cylinder'), and a t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_solid_properties('cube', (3,)) == {'volume': 27, 'surface_area': 54}\", \"assert calculate_solid_properties('sphere', (2,)) == {'volume': 33.510321638291124, 'surface_area': 50.26548245743669}\", \"assert calculate_solid_properties('cube', (1,)) ==... | {
"split": "train",
"index": 69694,
"acecode_id": "oss_10512",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a dictionary structure to define custom fields for a sales invoice. The function should return a dictionary containing three keys: 'Sales Invoice', 'Address', and 'Company'. Each key should map to a list of dictionaries, wh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert make_custom_fields() == {'Sales Invoice': [{'fieldname': 'qr_code', 'label': 'QR Code', 'fieldtype': 'Attach Image', 'read_only': 1, 'no_copy': 1, 'hidden': 1}], 'Address': [{'fieldname': 'address_in_arabic', 'label': 'Address in Arabic', 'fieldtype': 'Data'... | {
"split": "train",
"index": 69695,
"acecode_id": "bigcode_python_fns_47349",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `s`, write a function `char_frequency` that returns a dictionary containing the frequency of each character in the string. The keys of the dictionary should be the characters, and the values should be their corresponding frequencies. The function should be case-s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert char_frequency('Hello World!') == {'H': 1, 'e': 1, 'l': 3, 'o': 2, 'W': 1, 'r': 1, 'd': 1}\", \"assert char_frequency('123abcABC') == {'1': 1, '2': 1, '3': 1, 'a': 1, 'b': 1, 'c': 1, 'A': 1, 'B': 1, 'C': 1}\", \"assert char_frequency('') == {}\", \"assert ch... | {
"split": "train",
"index": 69696,
"acecode_id": "evol_21571",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D list of integers `grid` representing a grid of numbers, and an integer `k`. Your task is to implement a function `minPathSumSequence(grid, k)` that returns a list containing the smallest `k` numbers from the grid when traversed in a path that only moves right... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert minPathSumSequence([[1]], 1) == [1]\", \"assert minPathSumSequence([[9, 8], [7, 6]], 2) == [6, 7]\", \"assert minPathSumSequence([[15, 10], [20, 25]], 2) == [10, 15]\", \"assert minPathSumSequence([[1, 3], [2, 4]], 1) == [1]\", \"assert minPathSumSequence([[... | {
"split": "train",
"index": 69697,
"acecode_id": "evol_27355",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing various categories. Your task is to implement a function that takes this list as input and returns a dictionary where the keys are the first letters of the categories (case insensitive) and the values are lists of categories starting... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert categorize_by_first_letter(['Apple', 'Banana', 'Apricot', 'blueberry', 'Cherry']) == {'A': ['Apple', 'Apricot'], 'B': ['Banana', 'blueberry'], 'C': ['Cherry']}\", \"assert categorize_by_first_letter(['dog', 'cat', 'Dolphin', 'elephant', 'Cat']) == {'D': ['do... | {
"split": "train",
"index": 69698,
"acecode_id": "oss_11271",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that manages the stock of fruits in an inventory. The function should take a list of tuples where each tuple contains a fruit name and the quantity to add to the stock. The function should return a dictionary representing the updated inve... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_inventory([('apples', 5), ('oranges', 10)]) == {'apples': 5, 'oranges': 10}\", \"assert update_inventory([('apples', 3), ('bananas', 2)]) == {'apples': 3, 'bananas': 2}\", \"assert update_inventory([('apples', 5), ('apples', 3)]) == {'apples': 8}\", \... | {
"split": "train",
"index": 69699,
"acecode_id": "evol_20488",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.