data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "Given a string containing a sequence of space-separated floating-point numbers, implement a function `array_of_floats(s: str) -> List[float]` that parses the string and returns a list of these floating-point numbers. The input string may contain positive and negative numbers, a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert array_of_floats('3.14 2.71 -1.0 0.0 5e3') == [3.14, 2.71, -1.0, 0.0, 5000.0]\", \"assert array_of_floats('1.5 2.5 abc 3.5') == [1.5, 2.5, 3.5]\", \"assert array_of_floats('') == []\", \"assert array_of_floats('not a number') == []\", \"assert array_of_floats... | {
"split": "train",
"index": 75400,
"acecode_id": "bigcode_python_fns_12951",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function that accepts four distinct positive integers, including at least two odd numbers, and outputs the second smallest value without using sorting algorithms.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a sin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert second_smallest(5, 3, 9, 1) == 3\", \"assert second_smallest(10, 20, 30, 40) == 20\", \"assert second_smallest(15, 7, 25, 19) == 15\", \"assert second_smallest(8, 12, 6, 14) == 8\", \"assert second_smallest(1, 3, 2, 4) == 2\", \"assert second_smallest(21, 35... | {
"split": "train",
"index": 75401,
"acecode_id": "evol_11799",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing actions. Your task is to implement a function that returns a list of unique actions sorted in alphabetical order. The input will be a list of strings, and the output should be a list of unique strings. For example, if the input is ['... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_sorted_actions(['run', 'jump', 'run', 'walk']) == ['jump', 'run', 'walk']\", \"assert unique_sorted_actions(['swim', 'dance', 'dance', 'sing']) == ['dance', 'sing', 'swim']\", \"assert unique_sorted_actions(['a', 'b', 'c', 'a', 'b']) == ['a', 'b', 'c'... | {
"split": "train",
"index": 75402,
"acecode_id": "bigcode_python_fns_44153",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that manages a list of absence records for employees in a human resources system. Each absence record is represented by a dictionary containing the employee's ID and the reason for the absence. Your function should take a list of abse... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_absence_reasons([{'employee_id': 1, 'reason': 'Sick Leave'}, {'employee_id': 2, 'reason': 'Vacation'}, {'employee_id': 1, 'reason': 'Personal Leave'}], 1) == ['Sick Leave', 'Personal Leave']\", \"assert get_absence_reasons([{'employee_id': 1, 'reason': '... | {
"split": "train",
"index": 75403,
"acecode_id": "oss_29468",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the aspect ratio of a given shape based on its dimensions. The aspect ratio is defined as the ratio of the width to the height of the shape. Implement a function `calculate_aspect_ratio(width: float, height: float) -> float` that takes the width ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_aspect_ratio(4.0, 2.0) == 2.0\", \"assert calculate_aspect_ratio(1.0, 1.0) == 1.0\", \"assert calculate_aspect_ratio(5.0, 10.0) == 0.5\", \"assert calculate_aspect_ratio(10.0, 5.0) == 2.0\", \"assert calculate_aspect_ratio(6.5, 3.25) == 2.0\", \"as... | {
"split": "train",
"index": 75404,
"acecode_id": "bigcode_python_fns_10060",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two version strings representing software versions in the format 'major.minor', such as '1.0' or '2.5'. Your task is to determine if the two versions represent a major or minor version change. A major version change occurs when the major number increases (e.g., fr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_version_change('1.0', '2.0') == True\", \"assert has_version_change('1.0', '1.1') == True\", \"assert has_version_change('2.3', '3.0') == True\", \"assert has_version_change('2.5', '2.6') == True\", \"assert has_version_change('3.0', '3.0') == False\", \... | {
"split": "train",
"index": 75405,
"acecode_id": "bigcode_python_fns_12606",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are provided with a user profile represented as a dictionary. Your task is to implement a function called `get_employer_jobpost(profile)` that takes in a profile dictionary. The profile will contain the boolean key `is_employer` and a nested dictionary `user` with the user'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_employer_jobpost({'is_employer': True, 'user': {}}) == []\", \"assert get_employer_jobpost({'is_employer': False, 'user': {}}) == []\", \"assert get_employer_jobpost({'is_employer': False, 'user': {'id': 4}, 'jobs': [{'title': 'Web Developer', 'employmen... | {
"split": "train",
"index": 75406,
"acecode_id": "bigcode_python_fns_35825",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of integers and returns a new list containing only the even integers from the original list. Implement the function `filter_even_numbers(nums: List[int]) -> List[int]:` where `nums` is a list of integers. The function sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 15, 20, 25]) == [10, 20]\", \"assert filter_even_numbers([1, 3, 5, 7]) == []\", \"assert filter_even_numbers([2, 4, 6, 8]) == [2, 4, 6, 8]\", \"assert filter_even_numbers([-1... | {
"split": "train",
"index": 75407,
"acecode_id": "bigcode_python_fns_1490",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of cluster version strings and returns the count of unique versions present in that list. The function should be named `count_unique_versions`. Each version string is assumed to be well-formed. For example, given the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_versions(['1.0', '1.1', '1.0', '2.0']) == 3\", \"assert count_unique_versions(['3.1', '3.1', '3.1']) == 1\", \"assert count_unique_versions(['1.0', '1.1', '2.0', '2.1', '2.0']) == 4\", \"assert count_unique_versions(['1.0', '1.0', '1.0', '1.0'])... | {
"split": "train",
"index": 75408,
"acecode_id": "oss_1435",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that sorts an array of words by the length of their second syllable. If a word has no second syllable, it should be placed at the end of the sorted list. If multiple words have the same second syllable length, sort them by their total word length. Implement the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_by_second_syllable_length(['dog', 'cat', 'fish']) == ['dog', 'cat', 'fish']\", \"assert sort_by_second_syllable_length(['a', 'b', 'c', 'd']) == ['a', 'b', 'c', 'd']\", \"assert sort_by_second_syllable_length(['giraffe', 'lion', 'tiger']) == ['giraffe', ... | {
"split": "train",
"index": 75409,
"acecode_id": "evol_20653",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple budget tracker. The function should allow users to add transactions to a budget and calculate the total balance for a specified category. Implement the function `calculate_balance(transactions: List[Tuple[str, int]... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_balance([('Groceries', 50), ('Groceries', 30), ('Entertainment', 100)], 'Groceries') == 80\", \"assert calculate_balance([('Groceries', 50), ('Groceries', -20), ('Entertainment', 100)], 'Groceries') == 30\", \"assert calculate_balance([('Rent', 120... | {
"split": "train",
"index": 75410,
"acecode_id": "oss_37227",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that checks whether a given version number is less than or equal to a specified maximum version. The version numbers are represented as strings in the format \"x.y\" where x and y are non-negative integers. The function should retu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_version('2.5', '3.0') == True\", \"assert check_version('3.38', '3.38') == True\", \"assert check_version('1.0', '1.0') == True\", \"assert check_version('3.0', '2.5') == False\", \"assert check_version('2.6', '2.6') == True\", \"assert check_version('... | {
"split": "train",
"index": 75411,
"acecode_id": "oss_30276",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that initializes a data structure to hold multiple datasets with specified shapes and data types. Create a function `initialize_datasets(datasets)` that takes a dictionary called `datasets`, where each key is a string representing the dat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_datasets({'scalar': ((100,), 'f4'), 'vect': ((100, 3), 'f4')}) == {'scalar': 'Dataset scalar: shape=(100,), dtype=f4', 'vect': 'Dataset vect: shape=(100, 3), dtype=f4'}\", \"assert initialize_datasets({'image': ((64, 64, 3), 'uint8')}) == {'image'... | {
"split": "train",
"index": 75412,
"acecode_id": "bigcode_python_fns_49242",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `create_new_project(request)` that simulates the initiation of a new project. The function receives a request (which can be of any type, as this is a placeholder for context) and returns the result of calling another function `crud_projec... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_new_project('project_request') == crud_project('project_request', slug=None, action='New')\", \"assert create_new_project('another_request') == crud_project('another_request', slug=None, action='New')\", \"assert create_new_project(123) == crud_projec... | {
"split": "train",
"index": 75413,
"acecode_id": "bigcode_python_fns_21481",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the Hamming distance between the bitmaps of two glyphs represented as binary data. Each glyph is characterized by a binary bitmap stored as a byte array. The Hamming distance is defined as the number of positions at which the corresponding bits a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_hamming_distance(b'101010', b'100110') == 0.3333333333333333\", \"assert calculate_hamming_distance(b'1111', b'1111') == 0.0\", \"assert calculate_hamming_distance(b'1100', b'0011') == 1.0\", \"assert calculate_hamming_distance(b'1', b'0') == 1.0\"... | {
"split": "train",
"index": 75414,
"acecode_id": "oss_25401",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to identify any duplicate keys within a mapping structure represented as a list of tuples. Each tuple consists of a key (a string) and a value (which can be any object). Your function should take this list of tuples as input and retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert construct_mapping([('color', 'red'), ('color', 'blue'), ('size', 'large'), ('size', 'small')]) == {'color': [0, 1], 'size': [2, 3]}\", \"assert construct_mapping([('a', 1), ('b', 2), ('c', 3), ('a', 4)]) == {'a': [0, 3]}\", \"assert construct_mapping([('key1... | {
"split": "train",
"index": 75415,
"acecode_id": "oss_22228",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `enqueue(queue: List[int], item: int) -> List[int]` that takes a queue represented as a list and an integer item to add to the end of the queue. The function should return the updated queue after adding the item. The queue can contain any integer values and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert enqueue([], 1) == [1]\", \"assert enqueue([1], 2) == [1, 2]\", \"assert enqueue([1, 2], 3) == [1, 2, 3]\", \"assert enqueue([5, 10], 15) == [5, 10, 15]\", \"assert enqueue([0], -1) == [0, -1]\", \"assert enqueue([99, 100, 101], 102) == [99, 100, 101, 102]\",... | {
"split": "train",
"index": 75416,
"acecode_id": "evol_19577",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings where each string represents a key-value pair in the format '<key>=<value>'. Your task is to implement a function that parses this list and returns a dictionary mapping each key to its corresponding value. If a key appears multiple times, the las... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_key_value_pairs(['a=1', 'b=2', 'c=3']) == {'a': '1', 'b': '2', 'c': '3'}\", \"assert parse_key_value_pairs(['x=10', 'y=20', 'x=30']) == {'x': '30', 'y': '20'}\", \"assert parse_key_value_pairs(['key1=value1', 'key2=value2', 'key1=value3']) == {'key1': ... | {
"split": "train",
"index": 75417,
"acecode_id": "bigcode_python_fns_28241",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `config_prime_args(index_first_dynamic_arg: int, num_dynamic_args: int, spec_only_globals: bool) -> List[str]` that generates a list of command line arguments based on the inputs provided. The function should construct the arguments as fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert config_prime_args(1, 0, True) == ['-O1', '-Pconfig-prime', '-Pconfig-prime-index-first-unknown-arg=1', '-Pconfig-prime-unknown-args=0', '-Pconfig-prime-specialize-only-globals=true']\", \"assert config_prime_args(2, 5, False) == ['-O1', '-Pconfig-prime', '-P... | {
"split": "train",
"index": 75418,
"acecode_id": "bigcode_python_fns_2450",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks whether a given string is a valid URL. A valid URL must start with either 'http://' or 'https://', followed by a domain name, which can include letters, digits, and special characters such as '-', '.', and '_'. The URL can... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_url('http://example.com') == True\", \"assert is_valid_url('https://example.com') == True\", \"assert is_valid_url('http://example.com/path') == True\", \"assert is_valid_url('https://example.com/path/to/resource') == True\", \"assert is_valid_url('... | {
"split": "train",
"index": 75419,
"acecode_id": "bigcode_python_fns_22589",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_substrings(string: str) -> List[str]` that takes a single string input and returns a list of all substrings that start with the lowercase letter 'a', contain at least one digit, end with the uppercase letter 'Z', and have at least one lowercase letter... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_substrings('a1bZ') == ['a1bZ']\", \"assert find_substrings('a2c3dZ') == ['a2c3dZ']\", \"assert find_substrings('xyz') == []\", \"assert find_substrings('a1bcd2Z') == ['a1bcd2Z']\", \"assert find_substrings('a1Z') == []\", \"assert find_substrings('a1b2c... | {
"split": "train",
"index": 75420,
"acecode_id": "evol_8427",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of strings. The function should take a list of strings as input and perform the following operations: 1. Print each string from the list on a new line. 2. Return the length of the list of strings. 3. Return the first... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_strings(['apple', 'banana', 'cherry']) == (3, 'apple')\", \"assert process_strings(['hello', 'world']) == (2, 'hello')\", \"assert process_strings(['']) == (1, '')\", \"assert process_strings([]) == (0, None)\", \"assert process_strings(['one']) == (... | {
"split": "train",
"index": 75421,
"acecode_id": "oss_10667",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the factorial of a given non-negative integer using recursion. The function should take a single integer argument n and return the factorial of n. You can assume that the input will always be a non-negative integer.\nPlease reason step by st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert factorial(0) == 1\", \"assert factorial(1) == 1\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", \"assert factorial(5) == 120\", \"assert factorial(6) == 720\", \"assert factorial(7) == 5040\", \"assert factorial(... | {
"split": "train",
"index": 75422,
"acecode_id": "evol_33298",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of weather data records, where each record is a dictionary containing the following keys: 'Date/Time', 'Year', 'Month', 'Day', 'Max Temp (°C)', 'Min Temp (°C)', 'Mean Temp (°C)', and 'Total Precip (mm)'. Your task is to implement a function that takes this ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_weather_data([{'Date/Time': '2023-01-01', 'Year': '2023', 'Month': '01', 'Day': '01', 'Max Temp (\\u00b0C)': '5.0', 'Min Temp (\\u00b0C)': '1.0', 'Mean Temp (\\u00b0C)': '3.0', 'Total Precip (mm)': '0.0'}, {'Date/Time': '2023-01-02', 'Year': '2023', '... | {
"split": "train",
"index": 75423,
"acecode_id": "bigcode_python_fns_29216",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given an integer `num1`, you need to implement a function `calculate_sum(num1)` that returns the sum of `num1` and a constant integer value `num2`, where `num2` is defined as 20. Your function should take `num1` as input and return the computed sum. For example, if `num1` is 10... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_sum(0) == 20\", \"assert calculate_sum(1) == 21\", \"assert calculate_sum(-1) == 19\", \"assert calculate_sum(10) == 30\", \"assert calculate_sum(15) == 35\", \"assert calculate_sum(100) == 120\", \"assert calculate_sum(-100) == -80\", \"assert cal... | {
"split": "train",
"index": 75424,
"acecode_id": "oss_30597",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates adding a document to a database collection. The function should take three parameters: a string representing the database name, a string representing the collection name, and a dictionary representing the document to be... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_document_simulation('test_db', 'test_collection', {'name': 'doc1'}) == 'test_db_test_collection_1'\", \"assert add_document_simulation('example_db', 'example_collection', {'field': 'value'}) == 'example_db_example_collection_1'\", \"assert add_document_s... | {
"split": "train",
"index": 75425,
"acecode_id": "bigcode_python_fns_30390",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings where each string represents a DNA sequence. Your task is to implement a function `count_unique_sequences(sequences: List[str]) -> int` that counts the number of unique DNA sequences in the list. A DNA sequence is considered unique if it has not ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_sequences(['ATCG', 'GCTA', 'ATCG', 'TTAG']) == 3\", \"assert count_unique_sequences(['A', 'A', 'A', 'A']) == 1\", \"assert count_unique_sequences(['GATTACA', 'GATTA', 'ATACA', 'GATTACA']) == 3\", \"assert count_unique_sequences(['AAAA', 'AA', 'A... | {
"split": "train",
"index": 75426,
"acecode_id": "bigcode_python_fns_35679",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a string as input and determines if it is a valid IPv4 address. A valid IPv4 address consists of four decimal numbers separated by dots (.), where each number ranges from 0 to 255, and cannot contain leading zeros unless the number is exactly '0'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_ip('192.168.1.1') == True\", \"assert is_valid_ip('255.255.255.255') == True\", \"assert is_valid_ip('0.0.0.0') == True\", \"assert is_valid_ip('123.45.67.89') == True\", \"assert is_valid_ip('256.100.50.25') == False\", \"assert is_valid_ip('192.16... | {
"split": "train",
"index": 75427,
"acecode_id": "evol_29547",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function to search for a person's details based on their face ID from a predefined list of people. Each person has a name, face ID, age, and gender. Your function should take a face ID as input and return the details of the person with that... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert retrieve_details_from_id('12345') == {'name': 'John', 'faceId': '12345', 'age': 25, 'gender': 'male'}\", \"assert retrieve_details_from_id('67890') == {'name': 'Alice', 'faceId': '67890', 'age': 30, 'gender': 'female'}\", \"assert retrieve_details_from_id('9... | {
"split": "train",
"index": 75428,
"acecode_id": "oss_12348",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that tracks the best score from a list of scores recorded during multiple iterations. The function should take a list of scores as input and return the lowest score encountered, which represents the best performance. If the list is em... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert best_score([5.0, 7.0, 6.0, 3.0]) == 3.0\", \"assert best_score([10.0, 20.0, 5.0, 0.0]) == 0.0\", \"assert best_score([100.0, 50.0, 75.0]) == 50.0\", \"assert best_score([1.0, 2.0, 3.0]) == 1.0\", \"assert best_score([5.5, 3.2, 3.2, 5.5]) == 3.2\", \"assert b... | {
"split": "train",
"index": 75429,
"acecode_id": "bigcode_python_fns_17270",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that validates a cancellation request for a task based on its task ID. The function should check if the provided task ID is valid. A valid task ID is one that is not empty or None. If the task ID is invalid, the function should return... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_cancel_task_request('1234') == (True, [])\", \"assert validate_cancel_task_request('') == (False, [{'parameter': 'task_id', 'message': 'is required'}])\", \"assert validate_cancel_task_request(None) == (False, [{'parameter': 'task_id', 'message': 'i... | {
"split": "train",
"index": 75430,
"acecode_id": "oss_36424",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of numerical predictions and actual labels, implement a function that calculates the Median Absolute Error (MdAE). The Median Absolute Error is defined as the median of the absolute differences between the predictions and the actual labels. Your function should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert MdAE([1, 2, 3], [1, 2, 3]) == 0.0\", \"assert MdAE([1, 2, 3, 4], [1, 2, 3]) == 0.0\", \"assert MdAE([0], [0]) == 0.0\", \"assert MdAE([], []) == 0.0\", \"assert MdAE([1, 2, 3], []) == 0.0\", \"assert MdAE([], [1, 2, 3]) == 0.0\", \"assert MdAE([100, 200, 300... | {
"split": "train",
"index": 75431,
"acecode_id": "bigcode_python_fns_11353",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that selects a specific configuration template based on the type of board provided as a string. The function should take a single string parameter `board` which can represent different types of boards. If the board name contains 'arty', '... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert select_template('arty_board') == 'fpga.cfg'\", \"assert select_template('vc707') == 'fpga.cfg'\", \"assert select_template('vcu118_board') == 'fpga.cfg'\", \"assert select_template('hifive_board') == 'hifive.cfg'\", \"assert select_template('some_other_board... | {
"split": "train",
"index": 75432,
"acecode_id": "bigcode_python_fns_14438",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists: `participant` and `completion`. The `participant` list contains the names of participants in a race, while the `completion` list contains the names of participants who have completed the race. Your task is to write a function `solution(participant, comp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert solution(['leo', 'kiki', 'eden'], ['eden', 'kiki']) == 'leo'\", \"assert solution(['alice', 'bob', 'charlie'], ['bob', 'charlie']) == 'alice'\", \"assert solution(['john', 'paul', 'george', 'ringo'], ['john', 'paul', 'george']) == 'ringo'\", \"assert solutio... | {
"split": "train",
"index": 75433,
"acecode_id": "oss_32651",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that replaces specified lexical tokens in a given text with asterisks of the same length. The function should take in a string 'text' and a list of strings 'lexemes' to mask. The output should be a new string where all occurrences of the specified lexemes a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert veil_lexemes('The quick brown fox jumped over the lazy dog.', ['fox', 'dog']) == 'The quick brown *** jumped over the lazy ***.'\", \"assert veil_lexemes('Hello world!', ['world']) == 'Hello *****!'\", \"assert veil_lexemes('', ['any']) == ''\", \"assert vei... | {
"split": "train",
"index": 75434,
"acecode_id": "evol_31808",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given two sets of axes representing defined axes and used axes in a project. Your task is to implement a function that checks if all defined axes are used and if all used axes are defined. Additionally, you need to ensure that all axis values in the used axes are within... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_axes([1, 2, 3], [1, 2]) == False\", \"assert check_axes([1, 2, 3], [1, 2, 4]) == False\", \"assert check_axes([1, 2, 3], [1, 2, 3]) == True\", \"assert check_axes([1, 1, 2, 3], [1, 2, 3]) == True\", \"assert check_axes([1, 2, 3], [3, 2, 1]) == True\", ... | {
"split": "train",
"index": 75435,
"acecode_id": "bigcode_python_fns_21678",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that reads a configuration file formatted in a specific way. The file will contain sections and key-value pairs representing different settings. Your function should take a string representing the content of the configuration file and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_config('[section1]\\\\nkey1=value1\\\\nkey2=value2\\\\n[section2]\\\\nkeyA=valueA') == {'section1': {'key1': 'value1', 'key2': 'value2'}, 'section2': {'keyA': 'valueA'}}\", \"assert parse_config('[empty_section]\\\\n') == {'empty_section': {}}\", \"ass... | {
"split": "train",
"index": 75436,
"acecode_id": "bigcode_python_fns_29356",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a date in one of two formats: 'yyyy-mm-dd' or 'yyyy-mm', where 'yyyy' is a four-digit year, 'mm' is a two-digit month (01 to 12), and 'dd' is a two-digit day (01 to 31). Your task is to implement a function that converts any date in 'yyyy-mm-... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_date_format('2023-01-15') == '2023M1'\", \"assert convert_date_format('2022-12-01') == '2022M12'\", \"assert convert_date_format('1999-05-20') == '1999M5'\", \"assert convert_date_format('1990-07-30') == '1990M7'\", \"assert convert_date_format('2022... | {
"split": "train",
"index": 75437,
"acecode_id": "bigcode_python_fns_48521",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to merge a list of dictionaries into a single dictionary. Each dictionary in the list contains a mapping of category names to another dictionary, which represents ID to name mappings. Your function should combine these mappings into o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_dicts([]) == {}\", \"assert merge_dicts([{'a': {1: 'A'}}]) == {'a': {1: 'A'}}\", \"assert merge_dicts([{'a': {1: 'A'}}, {'b': {2: 'B'}}]) == {'a': {1: 'A'}, 'b': {2: 'B'}}\", \"assert merge_dicts([{'a': {1: 'A'}}, {'a': {2: 'B'}}]) == {'a': {1: 'A', 2:... | {
"split": "train",
"index": 75438,
"acecode_id": "oss_24415",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a list of positive integers, write a function `max_product_pair(nums)` that returns a tuple containing the two distinct numbers from the list that form the pair with the maximum product. If there are multiple pairs with the same maximum product, return the pair with the s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_product_pair([1, 2, 3, 4, 5]) == (4, 5)\", \"assert max_product_pair([10, 2, 3, 5]) == (5, 10)\", \"assert max_product_pair([5, 4, 3, 2, 1]) == (4, 5)\", \"assert max_product_pair([1, 1, 1, 1]) == (1, 1)\", \"assert max_product_pair([1, 2]) == (1, 2)\", ... | {
"split": "train",
"index": 75439,
"acecode_id": "oss_663",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of two strings composed only of open '(' , open '[' or closed ')' , closed ']' parentheses and brackets respectively. Implement a function that checks if combining the strings in any sequence results in a properly nested parentheses and brackets string. For... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert match_parens_brackets([')', ')']) == 'No'\", \"assert match_parens_brackets(['[(', '])']) == 'No'\", \"assert match_parens_brackets(['[[', ']]']) == 'Yes'\", \"assert match_parens_brackets(['[', ']']) == 'Yes'\", \"assert match_parens_brackets(['[(', '([']) ... | {
"split": "train",
"index": 75440,
"acecode_id": "evol_22014",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Alice wants to send a secret message to Bob in a way that only Bob can decode it. However, to add a layer of security, she decides to obfuscate the message by generating a cover text based on the ranks of certain characters in the message. Write a function `generate_cover_text`... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_cover_text([0, 1, 2], True) == ('Message: 0 1 2', [0, 1, 2])\", \"assert generate_cover_text([1, 2, 3], False) == ('Message: 1 2 3', [1, 2, 3])\", \"assert generate_cover_text([2, 1, 0], True) == ('Message: 2 1 0', [2, 1, 0])\", \"assert generate_co... | {
"split": "train",
"index": 75441,
"acecode_id": "bigcode_python_fns_25864",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a shape for a blob representing a batch of two-dimensional multi-channel images. The function should take the following parameters: `batch_len` (the number of images in a batch), `batch_width` (the width of the batch), `hei... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_blob_shape(1, 1, 1, 1, 1) == [1, 1, 1, 1, 1, 1, 1]\", \"assert create_blob_shape(2, 3, 4, 5, 6) == [2, 3, 1, 4, 5, 1, 6]\", \"assert create_blob_shape(10, 8, 6, 4, 3) == [10, 8, 1, 6, 4, 1, 3]\", \"assert create_blob_shape(5, 5, 5, 5, 5, 'int32') == [... | {
"split": "train",
"index": 75442,
"acecode_id": "bigcode_python_fns_18795",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a logging system for a software application. Your goal is to create a function `log_message` that takes a message string as input and logs it to a predefined common logger. The logging function should ensure that the message is logged in a speci... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_message('Test message 1') == 'Message logged successfully.'\", \"assert log_message('Error occurred in module 3.') == 'Message logged successfully.'\", \"assert log_message('User logged in.') == 'Message logged successfully.'\", \"assert log_message('Dat... | {
"split": "train",
"index": 75443,
"acecode_id": "oss_2172",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates a formatted string of user details from a list of user dictionaries. Each user dictionary contains the keys 'user_id', 'username', and 'email'. Your function should take a list of users and return a single string where ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert user_details([]) == ''\", \"assert user_details([{'user_id': 1, 'username': 'Alice', 'email': 'alice@example.com'}]) == 'User ID: 1, Username: Alice, Email: alice@example.com'\", \"assert user_details([{'user_id': 2, 'username': 'Bob', 'email': 'bob@example.... | {
"split": "train",
"index": 75444,
"acecode_id": "oss_13474",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a string representation of a podcast episode in a specific format. Your task is to parse this string and extract the following information: the title of the episode, the publication date, the URL of the episode, the duration in seconds, and the tags associated wit... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_podcast_episode('Title: Episode 1; URL: http://example.com/1; Date: 2023-01-01; Duration: 3600s; Tags: tech, education') == {'name': 'Episode 1', 'date': '2023-01-01', 'loc': 'http://example.com/1', 'duration': 3600, 'orig_tags': ['education', 'tech']}... | {
"split": "train",
"index": 75445,
"acecode_id": "bigcode_python_fns_17307",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that converts a list of balances represented in atto units to one units. Each balance is provided as a dictionary containing the keys 'balance' and 'shard_id'. Your function should take a list of such dictionaries, convert the 'balanc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_balances([{'balance': '1000000000000000000', 'shard_id': 1}, {'balance': '2000000000000000000', 'shard_id': 2}]) == [{'balance': 1.0, 'shard_id': 1}, {'balance': 2.0, 'shard_id': 2}]\", \"assert convert_balances([{'balance': '0', 'shard_id': 1}]) == ... | {
"split": "train",
"index": 75446,
"acecode_id": "bigcode_python_fns_26012",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a string consisting of lowercase alphabets, find the least frequent letter. If two or more letters have the same frequency, return the one which occurs last in the string. Ignore spaces and special characters.\nPlease reason step by step, then write a self-contained Pytho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert least_frequent_last('aabbcc') == 'c'\", \"assert least_frequent_last('abcdabcd') == 'd'\", \"assert least_frequent_last('abcdefg') == 'g'\", \"assert least_frequent_last('zzzyyyxxxwww') == 'w'\", \"assert least_frequent_last('abcd efgh ijkl mnop') == 'p'\", ... | {
"split": "train",
"index": 75447,
"acecode_id": "evol_25814",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function that sorts a list of integers in ascending order using the quick sort algorithm. The function should take a list of integers as input and return a new list that contains the same integers sorted in ascending order. The input list may contain duplicates and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert quick_sort([]) == []\", \"assert quick_sort([1]) == [1]\", \"assert quick_sort([3, 2]) == [2, 3]\", \"assert quick_sort([2, 3]) == [2, 3]\", \"assert quick_sort([3, 2, 1]) == [1, 2, 3]\", \"assert quick_sort([5, 5, 5]) == [5, 5, 5]\", \"assert quick_sort([2,... | {
"split": "train",
"index": 75448,
"acecode_id": "evol_21934",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that can decode a given query string into a dictionary. The query string consists of key-value pairs separated by '&', with keys and values being URL encoded. For example, a query string like 'key1=value1&key2=value2&key3=value3' shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decode_query_string('key1=value1&key2=value2') == {'key1': 'value1', 'key2': 'value2'}\", \"assert decode_query_string('key1=value1&key1=value2', flat=False) == {'key1': ['value1', 'value2']}\", \"assert decode_query_string('key=value') == {'key': 'value'}\"... | {
"split": "train",
"index": 75449,
"acecode_id": "oss_18342",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a command execution function that restricts the commands users can execute to a predefined whitelist. You will write a function `execute_command(user_cmd: str) -> str` that takes a string input `user_cmd`, which represents the command a user wis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert execute_command('ls') == 'Command executed: ls'\", \"assert execute_command('pwd') == 'Command executed: pwd'\", \"assert execute_command('rm -rf /') == 'Error: Command not allowed'\", \"assert execute_command('mkdir new_folder') == 'Error: Command not allow... | {
"split": "train",
"index": 75450,
"acecode_id": "oss_31364",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a ranking survey description for a specific reader. Write a function `generate_survey_description(readername: str, candidates: List[str], binsize: int) -> str` that generates a survey description based on the parameters provided. The survey descript... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_survey_description('Alice', ['Bob', 'Charlie', 'David'], 2) == 'This survey is for: Alice.\\\\n\\\\nRank students into the top 50%-ile bins. Put exactly 2 students in each bin. All uncategorized students will automatically be placed in the bottom ... | {
"split": "train",
"index": 75451,
"acecode_id": "bigcode_python_fns_25038",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a shopping cart for a grocery store. You are given a list of available products, each represented as a dictionary containing the product name, price, and available stock. Your task is to implement a function that takes a list of products and a list ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_cart([{'Produto': 'Cerveja', 'Preco': 3.0, 'Em estoque': 10}, {'Produto': 'Chocolate', 'Preco': 7.5, 'Em estoque': 10}], [{'Produto': 'Cerveja', 'quantity': 5}, {'Produto': 'Chocolate', 'quantity': 3}]) == [{'Produto': 'Cerveja', 'Preco': 3.0, 'Carrin... | {
"split": "train",
"index": 75452,
"acecode_id": "oss_2902",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of elements and a filtering function as arguments. The function will apply the filtering criteria to each element in the list and return a new list containing only the elements that satisfy the criteria. The function should handle multiple... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_elements([1, 2, 3, 4], lambda x: isinstance(x, int) and x % 2 == 0) == [2, 4]\", \"assert filter_elements(['a', 'b', 'c'], lambda x: isinstance(x, str)) == ['a', 'b', 'c']\", \"assert filter_elements([1.1, 2.2, 3.3], lambda x: isinstance(x, int)) == [... | {
"split": "train",
"index": 75453,
"acecode_id": "evol_28285",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that updates a dictionary with a new key-value pair. The function should take a dictionary, a key, and a value as input. If the key already exists in the dictionary, its value should be updated with the new value; if the key does not ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_dictionary({}, 'a', 1) == {'a': 1}\", \"assert update_dictionary({'a': 1}, 'b', 2) == {'a': 1, 'b': 2}\", \"assert update_dictionary({'a': 1, 'b': 2}, 'a', 3) == {'a': 3, 'b': 2}\", \"assert update_dictionary({'x': 10}, 'y', 20) == {'x': 10, 'y': 20}\... | {
"split": "train",
"index": 75454,
"acecode_id": "oss_5684",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a propositional logical expression represented as a string, your task is to convert this expression into its conjunctive normal form (CNF). The CNF is defined as a conjunction of one or more disjunctions of one or more literals. A literal is either a variable or its negat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_cnf('A | B') == 'A | B'\", \"assert convert_to_cnf('A & B') == 'A & B'\", \"assert convert_to_cnf('A | ~B') == 'A | ~B'\", \"assert convert_to_cnf('A | B | C') == 'A | B | C'\", \"assert convert_to_cnf('~A & ~B') == '~A & ~B'\", \"assert convert_t... | {
"split": "train",
"index": 75455,
"acecode_id": "bigcode_python_fns_28040",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with renaming a given folder name to match a specific format for media organization. The required format for the folder name is '{ Title (year) }', where 'Title' and 'year' are derived from the input folder name. Your function should take in the folder name as in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rename_folder_name('Inception (2010)') == 'Inception (2010)'\", \"assert rename_folder_name('Avengers: Endgame (2019)') == 'Avengers: Endgame (2019)'\", \"assert rename_folder_name('The Matrix (1999)') == 'The Matrix (1999)'\", \"assert rename_folder_name('I... | {
"split": "train",
"index": 75456,
"acecode_id": "bigcode_python_fns_28528",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that prompts a user to input a number representing a person they trust in case of an emergency. The function should return a string message indicating that the user should insert a number. Implement the function `set_emergency_number()` w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_emergency_number() == 'Please insert the number of a person you trust. It can be your life saver!'\", \"assert set_emergency_number() == 'Please insert the number of a person you trust. It can be your life saver!'\", \"assert set_emergency_number() == 'P... | {
"split": "train",
"index": 75457,
"acecode_id": "bigcode_python_fns_26182",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that represents the head of a snake on a 2D grid. The function should return the coordinates of the snake's head given its body coordinates as input. The snake is represented as a list of dictionaries, where each dictionary contains 'x' a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_snake_head([{'x': 7, 'y': 4}]) == {'x': 7, 'y': 4}\", \"assert get_snake_head([{'x': 1, 'y': 2}, {'x': 1, 'y': 3}]) == {'x': 1, 'y': 2}\", \"assert get_snake_head([{'x': 0, 'y': 0}, {'x': 0, 'y': 1}, {'x': 0, 'y': 2}]) == {'x': 0, 'y': 0}\", \"assert get... | {
"split": "train",
"index": 75458,
"acecode_id": "bigcode_python_fns_24933",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function called `cpphello` that returns a specific greeting message. The function does not take any parameters and should return the string 'Greetings from C++!'. Your implementation should ensure that the output is exactly as specified, witho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cpphello() == 'Greetings from C++!'\", \"assert cpphello() == 'Greetings from C++!'\", \"assert cpphello() == 'Greetings from C++!'\", \"assert cpphello() == 'Greetings from C++!'\", \"assert cpphello() == 'Greetings from C++!'\", \"assert cpphello() == 'Gre... | {
"split": "train",
"index": 75459,
"acecode_id": "bigcode_python_fns_36045",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the registration and unregistration of resources in a resource tracking system. The function should take two parameters: a string 'name' representing the name of the resource, and a string 'rtype' representing the type ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unregister_resource('Resource1', 'TypeA', True) == 'No action taken for shared memory resource.'\", \"assert unregister_resource('Resource2', 'TypeB', False) == 'Resource Resource2 of type TypeB unregistered successfully.'\", \"assert unregister_resource('Re... | {
"split": "train",
"index": 75460,
"acecode_id": "oss_21031",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `hex_to_binary(hex_val: str) -> str` that converts a given hexadecimal string into its binary string equivalent. The function should raise a custom exception `InvalidHexValueError` if the input string is not a valid hexadecimal value. Additionally, ensure t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hex_to_binary('1A') == '11010'\", \"assert hex_to_binary('FF') == '11111111'\", \"assert hex_to_binary('0') == '0'\", \"assert hex_to_binary('10') == '10000'\", \"assert hex_to_binary('0x1') == '1'\", \"assert hex_to_binary('0X2A') == '101010'\", \"assert he... | {
"split": "train",
"index": 75461,
"acecode_id": "evol_18363",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function in Python that reverses the order of a given string and checks whether it is a palindrome. The function should ignore case sensitivity, punctuation, and white spaces when determining if the string is a palindrome. The function should return a tuple where th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_palindrome('Python') == ('nohtyP', False)\", \"assert check_palindrome('Was it a car or a cat I saw?') == ('?was I tac a ro rac a ti saW', True)\", \"assert check_palindrome('Hello, World!') == ('!dlroW ,olleH', False)\", \"assert check_palindrome('') ... | {
"split": "train",
"index": 75462,
"acecode_id": "evol_13412",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that retrieves the tap numbers for a list of regulators in a distribution system. Each regulator has a unique name and is associated with a tap number. You will receive a list of regulator names and you need to return a list of tuples. Eac... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_tap_numbers(['RegA', 'RegB', 'RegC']) == [('RegA', 3), ('RegB', 5), ('RegC', 2)]\", \"assert get_tap_numbers(['RegX', 'RegY']) == [('RegX', -1), ('RegY', -1)]\", \"assert get_tap_numbers(['RegA', 'RegB']) == [('RegA', 3), ('RegB', 5)]\", \"assert get_tap... | {
"split": "train",
"index": 75463,
"acecode_id": "bigcode_python_fns_28669",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `bubble_sort(arr)` that takes a list of integers `arr` as input and sorts it in ascending order using the bubble sort algorithm. Do not use any external libraries or Python's built-in sorting functions. The function should return the sorted list.\nPlease re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bubble_sort([3, 5, 1, 9, 7, 2]) == [1, 2, 3, 5, 7, 9]\", \"assert bubble_sort([8, 4, 1, 5, 3, 10, 7]) == [1, 3, 4, 5, 7, 8, 10]\", \"assert bubble_sort([5]) == [5]\", \"assert bubble_sort([]) == []\", \"assert bubble_sort([2, 2, 2]) == [2, 2, 2]\", \"assert ... | {
"split": "train",
"index": 75464,
"acecode_id": "evol_27745",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of dictionaries, where each dictionary contains a person's details with keys 'name' and 'age', implement a function that converts this list into a formatted HTML table. The table should include a header row with 'Name' and 'Age' and should have rows for each person... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_html_table([{'name': 'John', 'age': 26}, {'name': 'Sarah', 'age': 30}, {'name': 'Joe', 'age': 27}]) == '<table><tr><th>Name</th><th>Age</th></tr><tr><td>John</td><td>26</td></tr><tr><td>Sarah</td><td>30</td></tr><tr><td>Joe</td><td>27</td></tr></tab... | {
"split": "train",
"index": 75465,
"acecode_id": "evol_2299",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Write a function that generates a unique integer ID given a string input, ensuring that the string contains only alphanumeric characters. The generated integer ID must be within the range of 1 to 10^7. If the input string is invalid (contains non-alphanumeric characters), the f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_unique_id('abc@123') == -1\", \"assert generate_unique_id('hello!') == -1\", \"assert generate_unique_id('Test#123') == -1\", \"assert generate_unique_id('java!') == -1\", \"assert generate_unique_id('abc def') == -1\", \"assert generate_unique_id('... | {
"split": "train",
"index": 75466,
"acecode_id": "evol_19512",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function `calculate_square_root(value: float) -> complex` that takes a numerical value as input and returns its square root. If the input value is negative, the function should return a complex number representing the square root. The input will be a float, and you ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_square_root(4.0) == 2.0\", \"assert calculate_square_root(9.0) == 3.0\", \"assert calculate_square_root(0.0) == 0.0\", \"assert calculate_square_root(2.25) == 1.5\", \"assert calculate_square_root(-1.0) == 1j\", \"assert calculate_square_root(-4.0)... | {
"split": "train",
"index": 75467,
"acecode_id": "evol_22611",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of file names and returns their status based on a specified removal flag. The function should take in a list of file names and a boolean flag indicating whether the files should be permanently marked as delete... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_files(['file1.txt', 'file2.txt'], True) == [('file1.txt', 'Deleted'), ('file2.txt', 'Deleted')]\", \"assert process_files(['file1.txt', 'file2.txt'], False) == [('file1.txt', 'Marked for deletion'), ('file2.txt', 'Marked for deletion')]\", \"assert p... | {
"split": "train",
"index": 75468,
"acecode_id": "oss_25957",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary where each key is a string and the value is a list of integers. Your task is to implement a function that returns the number of integers in the list corresponding to the first key in the dictionary. If the dictionary is empty, the function should retu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_entries({'a': [1, 2, 3], 'b': [4, 5]}) == 3\", \"assert count_entries({'first': [10, 20, 30, 40], 'second': [50, 60]}) == 4\", \"assert count_entries({'key1': [], 'key2': [1, 2]}) == 0\", \"assert count_entries({'only_key': [7]}) == 1\", \"assert count... | {
"split": "train",
"index": 75469,
"acecode_id": "bigcode_python_fns_39851",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a binary tree represented by its root node, implement a function `DFS_preorder(root)` that returns a list of values representing the pre-order traversal of the tree. In pre-order traversal, you first visit the root node, then recursively visit the left subtree, followed b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert DFS_preorder(None) == []\", \"assert DFS_preorder(Node(1)) == [1]\", \"assert DFS_preorder(Node(1, Node(2))) == [1, 2]\", \"assert DFS_preorder(Node(1, None, Node(3))) == [1, 3]\", \"assert DFS_preorder(Node(1, Node(2), Node(3))) == [1, 2, 3]\", \"assert DFS... | {
"split": "train",
"index": 75470,
"acecode_id": "evol_5067",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string, implement a recursive function that reverses the string without using built-in reverse functions or methods. The function should take a single parameter, the input string, and return the reversed string.\nPlease reason step by step, then write a self-contained P... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_string('hello') == 'olleh'\", \"assert reverse_string('world') == 'dlrow'\", \"assert reverse_string('') == ''\", \"assert reverse_string('a') == 'a'\", \"assert reverse_string('python') == 'nohtyp'\", \"assert reverse_string('12345') == '54321'\", \... | {
"split": "train",
"index": 75471,
"acecode_id": "evol_4924",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `cryptotext` that has been encoded using a simple XOR cipher with the key `1`, write a function `decipher(cryptotext)` that decodes the message back to its original plaintext. The function should return the decoded plaintext string. The input string will consist ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decipher('c') == 'b'\", \"assert decipher('a') == '`'\", \"assert decipher('e') == 'd'\", \"assert decipher('g') == 'f'\", \"assert decipher('i') == 'h'\", \"assert decipher('k') == 'j'\", \"assert decipher('m') == 'l'\", \"assert decipher('o') == 'n'\", \"a... | {
"split": "train",
"index": 75472,
"acecode_id": "bigcode_python_fns_49036",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that returns a new list containing only the negative numbers from the input list, sorted in ascending order. The function should use list comprehension for its implementation. If there are no negative numbers, return an empty list.\nPl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert negative_list([1, 2, -3, -1, 4]) == [-3, -1]\", \"assert negative_list([-1, -2, -3, -4]) == [-4, -3, -2, -1]\", \"assert negative_list([0, 1, 2, 3]) == []\", \"assert negative_list([-5, 0, 5]) == [-5]\", \"assert negative_list([-10, -20, 15, 5]) == [-20, -10... | {
"split": "train",
"index": 75473,
"acecode_id": "evol_5026",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of repositories, each represented by a string. Your task is to implement a function that takes a list of repositories and a source repository string, and returns a list containing the names of all the repositories except the source repository. The output li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert spread(['repo1', 'repo2', 'repo3'], 'repo2') == ['repo1', 'repo3']\", \"assert spread(['repoA', 'repoB', 'repoC'], 'repoA') == ['repoB', 'repoC']\", \"assert spread(['my-repo', 'your-repo', 'our-repo'], 'your-repo') == ['my-repo', 'our-repo']\", \"assert spr... | {
"split": "train",
"index": 75474,
"acecode_id": "bigcode_python_fns_10650",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of a series of bars in a histogram. Write a function `max_area(heights: List[int]) -> int` that calculates the maximum rectangular area that can be formed by these bars. The width of each bar is considered to be 1. You n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_area([1, 1, 1, 1]) == 4\", \"assert max_area([2, 1, 5, 6, 2, 3]) == 10\", \"assert max_area([0, 0, 0, 0]) == 0\", \"assert max_area([3, 1, 3]) == 3\", \"assert max_area([2, 4]) == 4\", \"assert max_area([5, 2, 1, 3, 3]) == 6\", \"assert max_area([1, 2, 3... | {
"split": "train",
"index": 75475,
"acecode_id": "bigcode_python_fns_32141",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating default ASAN (AddressSanitizer) options based on several input parameters. Write a function `get_asan_options` that takes the following parameters: `redzone_size` (int), `malloc_context_size` (int), `quarantine_size_mb` (int), `bot_platform` (str)... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_asan_options(8, 5, 10, 'WINDOWS', True) == {'alloc_dealloc_mismatch': 0, 'print_scariness': 1, 'strict_memcmp': 0, 'redzone': 8, 'malloc_context_size': 5, 'quarantine_size_mb': 10, 'detect_leaks': 1, 'detect_stack_use_after_return': 1, 'max_uar_stack_siz... | {
"split": "train",
"index": 75476,
"acecode_id": "bigcode_python_fns_16060",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a list of heads and returns a modified list based on certain conditions. Write a Python function `process_heads(heads, layers)` that takes in the following parameters: - `heads`: A list of integers representing t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_heads([1, 2], 3) == [1, 1, 2]\", \"assert process_heads([3, 5], 2) == [3, 5]\", \"assert process_heads([7, 9], 5) == [7, 7, 7, 7, 9]\", \"assert process_heads([], 0) == []\", \"assert process_heads([10, 20], 4) == [10, 10, 10, 20]\", \"assert process... | {
"split": "train",
"index": 75477,
"acecode_id": "oss_3985",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a positive integer `num`. Your task is to implement a function `check_properties(num)` that checks the following properties: \n- p1: The integer formed by extracting a substring of length 3 starting at index 2 from `num` is divisible by 2. \n- p2: The integer form... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_properties(987654321012345) == False\", \"assert check_properties(123456789) == False\", \"assert check_properties(345678901) == False\", \"assert check_properties(9876543210) == False\", \"assert check_properties(654321987) == False\", \"assert check_... | {
"split": "train",
"index": 75478,
"acecode_id": "oss_28797",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to check if a specific pattern exists within a given string. The pattern is represented by a string format that includes angle brackets, such as '<NAME>'. Your function should return `True` if the pattern is found in the string, and `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert match_pattern('<NAME>', 'Hello <NAME>!') == True\", \"assert match_pattern('<NAME>', 'This is a test <NAME>.') == True\", \"assert match_pattern('<NAME>', '<NAME> is found here.') == True\", \"assert match_pattern('<NAME>', 'No pattern here.') == False\", \"... | {
"split": "train",
"index": 75479,
"acecode_id": "oss_33145",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `clean_string(s: str) -> str` that removes all whitespace characters and special characters from the input string `s`. Whitespace characters include spaces, tabs, and newlines. Special characters are defined as any character that is not an alphanumeric char... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert clean_string('Hello World!') == 'HelloWorld'\", \"assert clean_string(' Leading and trailing spaces ') == 'Leadingandtrailingspaces'\", \"assert clean_string('This is a test: 1234!') == 'Thisisatest1234'\", \"assert clean_string('') == ''\", \"assert cle... | {
"split": "train",
"index": 75480,
"acecode_id": "evol_22075",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that performs a specific type of rounding on a given decimal number. The function should take three parameters: the decimal number to be rounded (a string), the precision to which it should be rounded (a string), and the rounding m... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert custom_round('7.325', '.01', 'ROUND_DOWN') == '7.32'\", \"assert custom_round('7.325', '.01', 'ROUND_UP') == '7.33'\", \"assert custom_round('7.325', '.01', 'ROUND_HALF_UP') == '7.33'\", \"assert custom_round('7.325', '.01', 'ROUND_HALF_DOWN') == '7.32'\", \... | {
"split": "train",
"index": 75481,
"acecode_id": "oss_30600",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a singly linked list, implement a function `getRandomInRange(start, end)` that returns a random node's value from the linked list within the range from `start` to `end` (inclusive). Each node must have the same probability of being chosen. If the range is invalid or does ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert solution.getRandomInRange(2, 3) in [2, 3]\", \"assert solution.getRandomInRange(1, 3) in [1, 2, 3]\", \"assert solution.getRandomInRange(3, 1) == -1\", \"assert solution.getRandomInRange(0, 3) in [1, 2, 3]\", \"assert solution.getRandomInRange(4, 5) == -1\",... | {
"split": "train",
"index": 75482,
"acecode_id": "evol_35953",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a list of cultures for a user. Each culture is identified by a unique culture_id. Implement a function `delete_culture(user_id: int, culture_id: int, cultures: List[Tuple[int, int]]) -> str` that takes in a user_id, a culture_id, and a list of cultu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delete_culture(1, 101, [(1, 101), (1, 102), (2, 201)]) == '101 was deleted.'\", \"assert delete_culture(1, 102, [(1, 101), (1, 102), (2, 201)]) == '102 was deleted.'\", \"assert delete_culture(2, 201, [(1, 101), (1, 102), (2, 201)]) == '201 was deleted.'\", ... | {
"split": "train",
"index": 75483,
"acecode_id": "bigcode_python_fns_2250",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function 'find_most_common_sequence' that takes two sequences as input and identifies the most common contiguous subsequence that appears in both sequences. The function should return this subsequence. If no common subsequence exists, return an empty string. The fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_most_common_sequence('abcabc', 'abc') == 'abc'\", \"assert find_most_common_sequence('a', 'a') == 'a'\", \"assert find_most_common_sequence('abcdef', 'ghijkl') == ''\", \"assert find_most_common_sequence('xyz', 'xyzxyz') == 'xyz'\", \"assert find_most_c... | {
"split": "train",
"index": 75484,
"acecode_id": "evol_22435",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks whether a given error message indicates that an artifact is missing. The function should take a string input, `error_message`, and return a boolean value. Specifically, the function should return `True` if the string 'does not... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_missing_artifact_error('The requested artifact does not contain artifact') == True\", \"assert is_missing_artifact_error('Error: this artifact is not found') == False\", \"assert is_missing_artifact_error('does not contain artifact in the database') == Tr... | {
"split": "train",
"index": 75485,
"acecode_id": "bigcode_python_fns_20498",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function that accepts a list of strings and a target substring. The function should check if the target substring appears consecutively in the same sequence in every string from the list. The comparison should be case-sensitive, meaning 'A' and 'a' should be treated as... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_consecutive(['Python', 'Java', 'C++'], 'Py') == [True, False, False]\", \"assert check_consecutive(['abc', 'aBc', 'Abc'], 'aB') == [False, True, False]\", \"assert check_consecutive(['apple', 'banana', 'grape'], 'ap') == [True, False, True]\", \"assert... | {
"split": "train",
"index": 75486,
"acecode_id": "evol_9189",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a custom representation for a list of departments in a company. Each department has attributes such as name, manager, and employee count. Your goal is to implement a function that takes a list of departments and returns a list of strings. Each strin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_departments([{ 'name': 'HR', 'manager': 'Alice', 'employee_count': 10 }, { 'name': 'Engineering', 'manager': 'Bob', 'employee_count': 25 }]) == ['Department Name: HR, Manager: Alice, Employees: 10', 'Department Name: Engineering, Manager: Bob, Employe... | {
"split": "train",
"index": 75487,
"acecode_id": "oss_36641",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of elements, implement a function `to_dense_list(elements)` that converts any element in the list that has a method `to_dense()` into its dense representation. If an element does not have this method, it should remain unchanged in the output list. The function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert to_dense_list([]) == []\", \"assert to_dense_list([1, 2, 3]) == [1, 2, 3]\", \"assert to_dense_list(['a', 'b', 'c']) == ['a', 'b', 'c']\", \"assert to_dense_list([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\"]}"
} | {
"split": "train",
"index": 75488,
"acecode_id": "bigcode_python_fns_28821",
"num_tests": 4
} |
acecode | [
{
"role": "user",
"content": "Implement a function `isFull(max_size, current_size)` that checks if a stack is full based on the maximum capacity and the current number of elements in the stack. The function should return True if the current size is equal to the maximum size, and False otherwise.\nPlease rea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isFull(10, 10) == True\", \"assert isFull(10, 5) == False\", \"assert isFull(5, 5) == True\", \"assert isFull(3, 0) == False\", \"assert isFull(8, 8) == True\", \"assert isFull(20, 15) == False\", \"assert isFull(0, 0) == True\", \"assert isFull(1, 0) == Fal... | {
"split": "train",
"index": 75489,
"acecode_id": "evol_12976",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple function that extracts the username from a given URL string. The URL will be in the format '/users/{username}/' or '/users/{username}' (with or without a trailing slash). Your function should handle cases where the username is missing a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_username('/users/testuser/') == 'testuser'\", \"assert get_username('/users/johndoe/') == 'johndoe'\", \"assert get_username('/users/jane/') == 'jane'\", \"assert get_username('/users/testuser') == 'testuser'\", \"assert get_username('/users/johndoe') ==... | {
"split": "train",
"index": 75490,
"acecode_id": "oss_28780",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `conditional_selection(condition: List[bool], true_values: List[int], false_values: List[int]) -> List[int]` that takes in three parameters: a list of boolean values `condition`, a list of integers `true_values`, and a list of integer... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert conditional_selection([True, False, True], [1, 2, 3], [4, 5, 6]) == [1, 5, 3]\", \"assert conditional_selection([False, False], [10, 20], [30, 40]) == [30, 40]\", \"assert conditional_selection([True], [99], [0]) == [99]\", \"assert conditional_selection([],... | {
"split": "train",
"index": 75491,
"acecode_id": "bigcode_python_fns_34863",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of cities, each defined by its name and its geographical coordinates (latitude and longitude). Write a function `closest_city(lat1: float, lon1: float, cities: List[Tuple[str, float, float]]) -> Tuple[float, str]` that takes in the latitude and longitude of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert closest_city(34.0522, -118.2437, [('Los Angeles', 34.0522, -118.2437), ('New York', 40.7128, -74.0060), ('Chicago', 41.8781, -87.6298)]) == (0.0, 'Los Angeles')\", \"assert closest_city(40.7128, -74.0060, [('Los Angeles', 34.0522, -118.2437), ('New York', 40... | {
"split": "train",
"index": 75492,
"acecode_id": "bigcode_python_fns_15396",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of elements, write a function `sum_array(arr)` that computes the sum of all the numeric elements (both integers and floats) in the array. The function should ignore any non-numeric elements. Return the total sum as a float.\nPlease reason step by step, then write... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_array([1, 2, 3]) == 6.0\", \"assert sum_array([1.5, 2.5, 3.5]) == 7.5\", \"assert sum_array([1, 'a', 3.0, None, 4]) == 8.0\", \"assert sum_array([]) == 0.0\", \"assert sum_array([1, 2, 3, 4, 5]) == 15.0\", \"assert sum_array([1.1, 2.2, 3.3, 4.4]) == 11.0... | {
"split": "train",
"index": 75493,
"acecode_id": "evol_7050",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the area of a rectangle. The function should take two parameters: 'length' and 'width', both of which are expected to be integers. If either of the parameters is not of type integer, the function should raise a TypeErr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_area(5, 4) == 20\", \"assert calculate_area(10, 3) == 30\", \"assert calculate_area(0, 5) == 0\", \"assert calculate_area(7, 8) == 56\", \"assert calculate_area(1, 1) == 1\", \"assert calculate_area(100, 200) == 20000\", \"assert calculate_area(12,... | {
"split": "train",
"index": 75494,
"acecode_id": "oss_11378",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two strings s and t, implement a function that counts the number of occurrences of each character of t in s. The strings s and t can consist of both uppercase and lowercase letters. The function should return a dictionary where keys are characters in t and values are thei... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert char_count('HelloWorld', 'l') == {'l': 3}\", \"assert char_count('abcdefg', 'xyz') == {'x': 0, 'y': 0, 'z': 0}\", \"assert char_count('abcdefghijklmnopqrstuvwxyz', 'aeiou') == {'a': 1, 'e': 1, 'i': 1, 'o': 1, 'u': 1}\", \"assert char_count('Pythonrocks', 'py... | {
"split": "train",
"index": 75495,
"acecode_id": "evol_26570",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Implement a function `valid_pin(pin: str) -> bool` that verifies the validity of a customer's confidential pin. The pin is considered valid if it satisfies the following conditions: it must have an uneven number of digits, consist of at least two distinct non-consecutive digits... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert valid_pin('13579') == True\", \"assert valid_pin('123') == False\", \"assert valid_pin('1111') == False\", \"assert valid_pin('2345') == False\", \"assert valid_pin('135') == True\", \"assert valid_pin('12345') == False\", \"assert valid_pin('222') == False\... | {
"split": "train",
"index": 75496,
"acecode_id": "evol_17341",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Construct a function named 'find_coordinates' that accepts 'matrix' (a nested list resembling a non-uniform matrix) and an integer 'target'. The function should identify occurrences of 'target' within 'matrix' and return a list of tuples containing the coordinates (row, column)... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_coordinates([[1,2,3,4,5,6],[1,2,3,4,1,6],[1,2,3,4,5,1]], 1) == [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]\", \"assert find_coordinates([], 1) == []\", \"assert find_coordinates([[], [1], [1, 2, 3]], 3) == [(2, 2)]\", \"assert find_coordinates([[1, 2], [3,... | {
"split": "train",
"index": 75497,
"acecode_id": "evol_15623",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a data structure that can either be a tuple or a dictionary containing a key 'acc_out_ty', implement a function `get_field_from_acc_out_ty(acc_out_ty_or_dict, field)` that returns the value of the specified field from the 'acc_out_ty' tuple. The tuple is structured such t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_field_from_acc_out_ty((1, 'test', 100), 'id') == 1\", \"assert get_field_from_acc_out_ty((1, 'test', 100), 'name') == 'test'\", \"assert get_field_from_acc_out_ty((1, 'test', 100), 'value') == 100\", \"assert get_field_from_acc_out_ty((1, 'test', 100), '... | {
"split": "train",
"index": 75498,
"acecode_id": "bigcode_python_fns_39057",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, where each string represents a line of data in the following format: 'x y z r g b'. Each line contains six values separated by spaces. Your task is to implement a function that processes this list and returns six separate lists: one for each coo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_data(['1 2 3 255 0 0', '4 5 6 0 255 0', '7 8 9 0 0 255']) == (['1', '4', '7'], ['2', '5', '8'], ['3', '6', '9'], [255, 0, 0], [0, 255, 0], [0, 0, 255])\", \"assert process_data(['0 0 0 65 66 67', '1 1 1 68 69 70', 'invalid data']) == (['0', '1'], ['0... | {
"split": "train",
"index": 75499,
"acecode_id": "bigcode_python_fns_43635",
"num_tests": 14
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.