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 implementing a function that takes in a user's authentication token and project ID, and returns a string indicating the successful creation of a Gnocchi client connection. The function should simulate the process of authenticating the user using the provided... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_gnocchi_client('abc123', 'project1') == 'gnocchiclient connection created using token \\\"abc123\\\" and endpoint \\\"http://keystone.example.com\\\"'\", \"assert create_gnocchi_client('xyz789', 'project2') == 'gnocchiclient connection created using t... | {
"split": "train",
"index": 3800,
"acecode_id": "bigcode_python_fns_42413",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing the odds of performing different actions. Each key in the dictionary is a string representing the name of the action, and each value is an integer representing the odds of performing that action. You need to implement a function `get_next... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_next_action({'action1': 1, 'action2': 2, 'action3': 3}) in ['action1', 'action2', 'action3']\", \"assert get_next_action({'actionA': 5, 'actionB': 5}) in ['actionA', 'actionB']\", \"assert get_next_action({'jump': 10, 'run': 20}) in ['jump', 'run']\", \"... | {
"split": "train",
"index": 3801,
"acecode_id": "bigcode_python_fns_12650",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the deletion of a temporary file. The function should take a single argument, `file_name`, which is a string representing the name of the temporary file to be deleted. If the `file_name` is not an empty string, the func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delete_temp_file('temp_file.txt') == 'File temp_file.txt has been deleted.'\", \"assert delete_temp_file('') == 'No file specified for deletion.'\", \"assert delete_temp_file('example.tmp') == 'File example.tmp has been deleted.'\", \"assert delete_temp_file... | {
"split": "train",
"index": 3802,
"acecode_id": "bigcode_python_fns_33799",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a square grid representing a maze, where 0 denotes an empty cell and 1 denotes a wall. You need to implement a function that simulates the movement of a player character within this grid. The player starts at a given position (row, col) and can move in four direct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert move_player(1, 1, 'up', [[0, 0, 0], [0, 1, 0], [0, 0, 0]]) == (0, 1)\", \"assert move_player(1, 1, 'left', [[0, 0, 0], [0, 1, 0], [0, 0, 0]]) == (1, 0)\", \"assert move_player(1, 0, 'up', [[0, 0, 0], [0, 1, 0], [0, 0, 0]]) == (0, 0)\", \"assert move_player(0... | {
"split": "train",
"index": 3803,
"acecode_id": "oss_29144",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Create a Python function that takes two lists and an optional boolean parameter as input. The function should check if the lists are of equal length. If they are of equal length, combine the elements of the lists into a single dictionary where elements from the first list are k... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert combine_lists(['a', 'b'], ['1', '2']) == {'a': '1', 'b': '2'}\", \"assert combine_lists(['a', 'b', 'c'], ['1', '2', '3']) == {'a': '1', 'b': '2', 'c': '3'}\", \"assert combine_lists(['a', 'b'], ['1', '2'], True) == {'a': '1', 'b': '2'}\", \"assert combine_li... | {
"split": "train",
"index": 3804,
"acecode_id": "evol_20482",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a string of colored text output using ANSI escape codes. ANSI escape codes are special sequences of characters that are used to control text formatting, color, and other visual aspects when printed to a terminal. Your funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert print_colored_text(['Red']) == '\\\\033[0;31mRed\\\\033[m'\", \"assert print_colored_text(['Green']) == '\\\\033[0;32mGreen\\\\033[m'\", \"assert print_colored_text(['Blue']) == '\\\\033[0;34mBlue\\\\033[m'\", \"assert print_colored_text(['Yellow']) == '\\\\... | {
"split": "train",
"index": 3805,
"acecode_id": "oss_23036",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `create_collection_data` that simulates the creation of a collection from a provided name, URL, and source type. The function should take the following parameters: a string `name`, a string `url`, a string `sourceType`, and a dictionary `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_collection_data('MyCollection', 'http://example.com/data', 'web', {'indexWithDefault': True}) == {'name': 'MyCollection', 'url': 'http://example.com/data', 'sourceType': 'web', 'indexWithDefault': True}\", \"assert create_collection_data('MyCollection... | {
"split": "train",
"index": 3806,
"acecode_id": "bigcode_python_fns_22653",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `redundancy_elimination` that takes a multidimensional numerical array (up to 3 dimensions) and returns a flattened list containing unique elements from that array. The order of the elements in the output list does not matter. For example, given the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert redundancy_elimination([[5, 4, 5], [3, 2, 3], [1]]) == [1, 2, 3, 4, 5]\", \"assert redundancy_elimination([[1, 1, 1], [1, 1, 1]]) == [1]\", \"assert redundancy_elimination([]) == []\", \"assert redundancy_elimination([[1], [2], [3]]) == [1, 2, 3]\", \"assert... | {
"split": "train",
"index": 3807,
"acecode_id": "evol_1628",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to localize the title of a collection of items based on request parameters. The function should take in a `RequestParams` object, which contains information about the location, and a dictionary of items. The function should modify the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert localize_items(RequestParams({'road_segment_name': 'Main St'}), {'data': {'text': {}}}) == {'data': {'text': {'title': 'Number of accidents by road light - Main St'}}}\", \"assert localize_items(RequestParams({'road_segment_name': '1st Ave'}), {'data': {'tex... | {
"split": "train",
"index": 3808,
"acecode_id": "oss_32279",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a ticketing system for an organization. Given a list of ticket assignments, your goal is to determine if a new office can be added to a ticket's competence based on certain conditions. Write a function `can_add_office(ticket_offices: List[str], new_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_add_office(['Office A', 'Office B'], 'Office C', ['Office A', 'Office B', 'Office C']) == 'Success'\", \"assert can_add_office(['Office A', 'Office B'], 'Office A', ['Office A', 'Office B', 'Office C']) == 'Error: Already assigned'\", \"assert can_add_of... | {
"split": "train",
"index": 3809,
"acecode_id": "bigcode_python_fns_41236",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `intersperse` that takes a list of integers and a delimiter, and optionally a boolean parameter `reverse`. If `reverse` is set to True, the function should first reverse the list before inserting the delimiter between each element. The function should retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert intersperse([], 4) == []\", \"assert intersperse([1, 2, 3], 4) == [1, 4, 2, 4, 3]\", \"assert intersperse([1, 2, 3], 4, True) == [3, 4, 2, 4, 1]\", \"assert intersperse([5, 6], 0) == [5, 0, 6]\", \"assert intersperse([5, 6], 0, True) == [6, 0, 5]\", \"assert... | {
"split": "train",
"index": 3810,
"acecode_id": "evol_29343",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of tuples where each tuple represents a passenger on the Titanic. Each tuple contains three elements: the passenger class (an integer), the age of the passenger (a float), and their survival status (a boolean, where True indicates survival and False indicat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_passengers([(1, 22.0, True), (1, 30.0, False), (1, 25.0, True)]) == {1: {'average_survived': 23.5, 'average_not_survived': 30.0}}\", \"assert analyze_passengers([(2, 30.0, True), (2, 40.0, False), (2, 35.0, True)]) == {2: {'average_survived': 32.5, '... | {
"split": "train",
"index": 3811,
"acecode_id": "evol_32619",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a configuration for a machine learning classifier. The string contains key-value pairs in the format 'key=value', separated by commas. Your task is to implement a function `parse_config` that takes this string as input and returns a dictionar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_config('n_jobs=3,random_state=1') == {'n_jobs': '3', 'random_state': '1'}\", \"assert parse_config('n_jobs=5') == {'n_jobs': '5'}\", \"assert parse_config('random_state=42,n_jobs=2') == {'random_state': '42', 'n_jobs': '2'}\", \"assert parse_config('n_... | {
"split": "train",
"index": 3812,
"acecode_id": "bigcode_python_fns_7786",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a recursive function in Python that finds the maximum value in a numeric array and also returns the index of that maximum value. The array may contain negative numbers and zeros. Your function should handle errors effectively when the input array is empty. The provided ar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max([1, -2, 3, -4, 5]) == (5, 4)\", \"assert find_max([-1, -2, -3, -4, -5]) == (-1, 0)\", \"assert find_max([0, 0, 0]) == (0, 0)\", \"assert find_max([10]) == (10, 0)\", \"assert find_max([1, 2, 3, 4, 5, 5]) == (5, 4)\", \"assert find_max([-10, -20, -5,... | {
"split": "train",
"index": 3813,
"acecode_id": "evol_3338",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple stopwatch. The stopwatch should have the following functionalities: start the stopwatch, stop the stopwatch, and get the elapsed time in seconds between the start and stop. Your function should take a list of t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert stopwatch_elapsed_time([1.0, 5.0]) == 4.0\", \"assert stopwatch_elapsed_time([2.5, 2.5]) == 0.0\", \"assert stopwatch_elapsed_time([10.0, 20.0]) == 10.0\", \"assert stopwatch_elapsed_time([3.0, 1.0]) == 0.0\", \"assert stopwatch_elapsed_time([0.0, 2.0]) == 2... | {
"split": "train",
"index": 3814,
"acecode_id": "oss_13483",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary called `word_dict` where each key is a string representing a word, and each value is a non-negative integer representing the ID associated with that word. Write a function called `validate_word_dict` that checks if the `word_dict` meets the following ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_word_dict({'apple': 1, 'banana': 2}) == True\", \"assert validate_word_dict({'cat': 0, 'dog': 3}) == True\", \"assert validate_word_dict({'word': 5}) == True\", \"assert validate_word_dict({}) == True\", \"assert validate_word_dict({'hello': -1}) ==... | {
"split": "train",
"index": 3815,
"acecode_id": "bigcode_python_fns_10862",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `convert_temperature(value: float, unit: str) -> float` that performs bi-directional temperature conversion between Celsius and Fahrenheit. The function should take two parameters: `value`, which is the temperature value to convert, and `unit`, which is either ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_temperature(0, 'C') == 32.0\", \"assert convert_temperature(100, 'C') == 212.0\", \"assert convert_temperature(-40, 'C') == -40.0\", \"assert convert_temperature(32, 'F') == 0.0\", \"assert convert_temperature(212, 'F') == 100.0\", \"assert convert_t... | {
"split": "train",
"index": 3816,
"acecode_id": "evol_29102",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function `generate_unique_string()` that generates a unique string of exactly 20 characters containing at least 3 alphabetical characters, 2 numerical characters, and 2 special symbols. The generated string must include at least one capital letter, one lowercase let... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_unique_string() != generate_unique_string()\", \"assert len(generate_unique_string()) == 20\", \"assert sum(c.isalpha() for c in generate_unique_string()) >= 3\", \"assert sum(c.isdigit() for c in generate_unique_string()) >= 2\", \"assert sum(c in ... | {
"split": "train",
"index": 3817,
"acecode_id": "evol_18496",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers `token_ids` and an integer `max_length`, implement a function that truncates the list to `max_length` if it is longer than `max_length`. If the list is shorter than `max_length`, pad it with zeros until its length equals `max_length`. The function shoul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert truncate_and_pad_token_ids([1, 2, 3, 4, 5], 3) == [1, 2, 3]\", \"assert truncate_and_pad_token_ids([1, 2], 5) == [1, 2, 0, 0, 0]\", \"assert truncate_and_pad_token_ids([1, 2, 3], 3) == [1, 2, 3]\", \"assert truncate_and_pad_token_ids([], 5) == [0, 0, 0, 0, 0... | {
"split": "train",
"index": 3818,
"acecode_id": "bigcode_python_fns_14688",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists, `y_true` and `y_score`, representing the ground truth and predicted values respectively, write a function `negative_predictive_value(y_true: List[int], y_score: List[int]) -> float` that calculates the Negative Predictive Value (NPV). The NPV is defined as the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert negative_predictive_value([0, 0, 0, 0], [0, 0, 0, 0]) == 1.0\", \"assert negative_predictive_value([1, 1, 1, 1], [0, 0, 0, 0]) == 0.0\", \"assert negative_predictive_value([1, 0, 1, 0], [1, 0, 1, 0]) == 1.0\", \"assert negative_predictive_value([1, 1, 0, 0],... | {
"split": "train",
"index": 3819,
"acecode_id": "bigcode_python_fns_15510",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that extracts specific patterns from a given input text using regular expressions. Your function should take the input text and a list of extractors, which are regular expressions, and return a list of tuples. Each tuple should contain th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert scan_patterns('Hello World! 1234 and 5678', ['\\\\d+', 'World']) == [(0, '1234'), (0, '5678'), (1, 'World')]\", \"assert scan_patterns('abc def ghi jkl', ['def', 'xyz']) == [(0, 'def')]\", \"assert scan_patterns('Test 1, Test 2, Test 3', ['Test \\\\d']) == [... | {
"split": "train",
"index": 3820,
"acecode_id": "oss_16250",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `first_non_repeating_string(stream: List[str]) -> Optional[str]` that processes a stream of strings and returns the first non-repeating string from that stream. The input is a list of strings representing the stream, and the output sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert first_non_repeating_string(['a', 'b', 'a', 'c', 'b']) == 'c'\", \"assert first_non_repeating_string(['x', 'y', 'x', 'y']) == None\", \"assert first_non_repeating_string(['hello', 'world', 'hello']) == 'world'\", \"assert first_non_repeating_string(['test', '... | {
"split": "train",
"index": 3821,
"acecode_id": "bigcode_python_fns_26329",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a function that generates a float representing the current date and time in the format YYYYMMDD.HHMMSS, implement a function that takes in a float in that format and returns a string representing the date in 'YYYY-MM-DD' format and the time in 'HH:MM:SS' format. For examp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_datetime(20110731.123456) == '2011-07-31 12:34:56'\", \"assert format_datetime(19991231.235959) == '1999-12-31 23:59:59'\", \"assert format_datetime(20201231.080909) == '2020-12-31 08:09:09'\", \"assert format_datetime(20181215.153045) == '2018-12-15 ... | {
"split": "train",
"index": 3822,
"acecode_id": "bigcode_python_fns_23",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a stock symbol. Your task is to implement a function that returns the possible expiration dates for options associated with that stock. The function should take a single parameter, 'symbol', which is a string representing the stock symbol, an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_expiration_dates('AAPL') == ['2023-09-15', '2023-09-22', '2023-09-29']\", \"assert get_expiration_dates('GOOGL') == ['2023-09-15', '2023-09-22']\", \"assert get_expiration_dates('NFLX') == []\", \"assert get_expiration_dates('INVALID') == []\", \"assert ... | {
"split": "train",
"index": 3823,
"acecode_id": "bigcode_python_fns_48612",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that caches the result of function calls based on the first argument. The function will take another function as input and return a new function. The new function should store the results of the original function calls in a dictionary... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cache(lambda x: x + 1)(1) == 2\", \"assert cache(lambda x: x + 1)(2) == 3\", \"assert cache(lambda x: x + 1)(1) == 2\", \"assert cache(lambda x: x * 2)(3) == 6\", \"assert cache(lambda x: x * 2)(4) == 8\", \"assert cache(lambda x: x * 2)(3) == 6\", \"assert ... | {
"split": "train",
"index": 3824,
"acecode_id": "bigcode_python_fns_36395",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that validates an authentication token for a hypothetical data management platform. The function `validate_token` should check if the provided token is valid. If the token is `None`, the function should raise a ValueError with ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_token('valid_token') == 'Token is valid.'\", \"assert validate_token('another_valid_token') == 'Token is valid.'\", \"assert validate_token('token123') == 'Token is valid.'\", \"assert validate_token('token_abc') == 'Token is valid.'\", \"assert val... | {
"split": "train",
"index": 3825,
"acecode_id": "oss_19211",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Write a function `count_vowels(s: str) -> int` that takes a string `s` as input and returns the total number of vowels in the string. Vowels are defined as the characters 'a', 'e', 'i', 'o', 'u' (both lowercase and uppercase).\nPlease reason step by step, then write a self-cont... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_vowels('hello') == 2\", \"assert count_vowels('HELLO') == 2\", \"assert count_vowels('Python') == 1\", \"assert count_vowels('Vowels are cool!') == 6\", \"assert count_vowels('') == 0\", \"assert count_vowels('xyz') == 0\", \"assert count_vowels('AEIOU... | {
"split": "train",
"index": 3826,
"acecode_id": "evol_12770",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a non-negative integer n, implement a function `large_sum(n)` that returns the sum of all integers from 0 to n (inclusive). Your implementation should handle large integers accurately to avoid overflow issues. Note that the sum of the first n integers can be calculated us... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert large_sum(0) == 0\", \"assert large_sum(1) == 1\", \"assert large_sum(2) == 3\", \"assert large_sum(3) == 6\", \"assert large_sum(4) == 10\", \"assert large_sum(5) == 15\", \"assert large_sum(10) == 55\", \"assert large_sum(100) == 5050\", \"assert large_sum... | {
"split": "train",
"index": 3827,
"acecode_id": "evol_12212",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `findAndRemove(type: str, attrs: dict, parent: str = None) -> List[str]`. This function will remove all the objects of a specific type that have attributes matching the given criteria under a specific parent. The function should retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert findAndRemove('car', {'color': 'red'}) == ['1', '3']\", \"assert findAndRemove('bike', {'model': 'mountain'}) == ['2']\", \"assert findAndRemove('car', {'color': 'blue'}) == []\", \"assert findAndRemove('truck', {'capacity': 'large'}, 'parent2') == []\", \"a... | {
"split": "train",
"index": 3828,
"acecode_id": "bigcode_python_fns_2538",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a string input that consists of a sequence of numerical values separated by commas, write a function `remove_max_from_sequence(sequence)` that identifies the greatest number within this numerical sequence. The function should return an alternative string output that encap... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_max_from_sequence('8, 12, 5, 2, 18') == '8, 12, 5, 2'\", \"assert remove_max_from_sequence('10, 10, 10, 10') == '10, 10, 10'\", \"assert remove_max_from_sequence('7, 2, 9, 3') == '7, 2, 3'\", \"assert remove_max_from_sequence('100, 200, 300') == '100,... | {
"split": "train",
"index": 3829,
"acecode_id": "evol_23519",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function `quickSort(arr)` that sorts a given list of integers using the quick sort algorithm. The function should take a list `arr` as input and return a new list that contains all the elements from `arr` sorted in ascending order. The input list can contain duplica... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert quickSort([3, 6, 8, 10, 1, 2, 1]) == [1, 1, 2, 3, 6, 8, 10]\", \"assert quickSort([]) == []\", \"assert quickSort([5]) == [5]\", \"assert quickSort([2, 1]) == [1, 2]\", \"assert quickSort([1, 2]) == [1, 2]\", \"assert quickSort([4, 5, 4, 3, 1, 2, 2]) == [1, ... | {
"split": "train",
"index": 3830,
"acecode_id": "evol_425",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of file paths in a directory. Your task is to implement a function `delete_files(file_paths: List[str]) -> List[str]` that takes a list of file paths as input and returns a new list containing only the file paths that are of type 'map'. A file path is consi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delete_files(['data.map', 'image.png', 'doc.txt', 'map1.map']) == ['data.map', 'map1.map']\", \"assert delete_files(['file1.txt', 'file2.txt']) == []\", \"assert delete_files(['map_a.map', 'map_b.map', 'file_c.txt']) == ['map_a.map', 'map_b.map']\", \"assert... | {
"split": "train",
"index": 3831,
"acecode_id": "bigcode_python_fns_6271",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of API endpoint patterns and builds a nested dictionary structure representing the hierarchy of those patterns. Each endpoint pattern is a string where parts are separated by slashes ('/'). Your function should handl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert build_api_tree(['api/v1', 'api/v1/users', 'api/v1/products']) == {'api': {'v1': {'users': {}, 'products': {}}}}\", \"assert build_api_tree(['api/v2', 'api/v2/orders', 'api/v2/orders/456']) == {'api': {'v2': {'orders': {'456': {}}}}}\", \"assert build_api_tre... | {
"split": "train",
"index": 3832,
"acecode_id": "oss_31770",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that initializes a statistics dictionary for music compositions. The dictionary should contain various fields related to music statistics. Specifically, the fields should include 'autocorrelation1', 'autocorrelation2', and 'autocorrelatio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_stat_dict() == {'autocorrelation1': [], 'autocorrelation2': [], 'autocorrelation3': [], 'notes_not_in_key': 0, 'notes_in_motif': 0, 'notes_in_repeated_motif': 0, 'num_starting_tonic': 0, 'num_repeated_notes': 0, 'num_octave_jumps': 0, 'num_fifths'... | {
"split": "train",
"index": 3833,
"acecode_id": "bigcode_python_fns_16603",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string and a substring, write a function to determine the frequency of the specified substring within the string, considering overlapping instances. The function should implement efficient searching techniques such as the Burrows-Wheeler transform and a trie data struct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert how_many_times('mississippi', 'issi') == 1\", \"assert how_many_times('testcase', 'case') == 1\", \"assert how_many_times('abcde', 'f') == 0\", \"assert how_many_times('a', 'a') == 1\", \"assert how_many_times('ab', 'ab') == 1\", \"assert how_many_times('', ... | {
"split": "train",
"index": 3834,
"acecode_id": "evol_17833",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that validates a folder path based on specific criteria. The function should check if the provided folder path is valid according to the following rules: \n1. The folder path must not be an empty string or just a slash ('/'). \n2. The... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_folder_path('/scripts/server1') == '/scripts/server1'\", \"assert validate_folder_path('/') == None\", \"assert validate_folder_path(' ') == None\", \"assert validate_folder_path('/valid/folder') == '/valid/folder'\", \"assert validate_folder_path(... | {
"split": "train",
"index": 3835,
"acecode_id": "bigcode_python_fns_33063",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates setting the state of a digital pin in a microcontroller. The function should take two parameters: an integer 'pin' representing the pin number and a boolean 'state' indicating whether to set the pin to high (True) or low (F... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_digital_output(1, True) == {'pin': 1, 'state': True}\", \"assert set_digital_output(2, False) == {'pin': 2, 'state': False}\", \"assert set_digital_output(10, True) == {'pin': 10, 'state': True}\", \"assert set_digital_output(5, False) == {'pin': 5, 'sta... | {
"split": "train",
"index": 3836,
"acecode_id": "bigcode_python_fns_36596",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists, `book_list` and `author_list`, where `book_list` contains dictionaries with keys 'book_id', 'title', and 'author_id', and `author_list` contains dictionaries with keys 'author_id' and 'author_name', implement a function `get_filtered_books(book_list: List[Dict[... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_filtered_books([{'book_id': 501, 'title': 'Book A', 'author_id': 1}, {'book_id': 300, 'title': 'Book B', 'author_id': 2}], [{'author_id': 1, 'author_name': 'Author Z'}, {'author_id': 2, 'author_name': 'Author Y'}]) == [{'book_id': 501, 'title': 'Book A',... | {
"split": "train",
"index": 3837,
"acecode_id": "evol_17769",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary `m` and an integer `n`, write a function that returns a new dictionary containing the first `n` key-value pairs from the original dictionary. If `n` is greater than the number of items in the dictionary, return all items in the dictionary. The order of the ke... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert first_n_items({'a': 1, 'b': 2, 'c': 3}, 2) == {'a': 1, 'b': 2}\", \"assert first_n_items({'x': 10, 'y': 20}, 3) == {'x': 10, 'y': 20}\", \"assert first_n_items({'name': 'Alice', 'age': 30, 'city': 'Wonderland'}, 1) == {'name': 'Alice'}\", \"assert first_n_it... | {
"split": "train",
"index": 3838,
"acecode_id": "bigcode_python_fns_20048",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `add_user(username: str, password: str, roles: List[str]) -> bool` that adds or updates a user in a system. The function takes in a username, a password, and an optional list of roles. If the user already exists, their password should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_user('user1', 'pass123', ['admin']) == True\", \"assert add_user('user2', 'mypassword', []) == True\", \"assert add_user('user1', 'newpass', ['editor']) == True\", \"assert add_user('user3', 'securepass', ['viewer', 'editor']) == True\", \"assert add_use... | {
"split": "train",
"index": 3839,
"acecode_id": "bigcode_python_fns_9011",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a BigQuery data type (db_dtype). Your task is to implement a function that converts this BigQuery data type into a Python equivalent data type. The conversion should return a string for scalar types (like 'STRING', 'INT64') and a dictionary f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bq_db_dtype_to_dtype('STRING') == 'string'\", \"assert bq_db_dtype_to_dtype('INT64') == 'int64'\", \"assert bq_db_dtype_to_dtype('FLOAT64') == 'float64'\", \"assert bq_db_dtype_to_dtype('DATE') == 'date'\", \"assert bq_db_dtype_to_dtype('STRUCT<name STRING, ... | {
"split": "train",
"index": 3840,
"acecode_id": "bigcode_python_fns_49067",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given an XML string representation of a dataset that contains information about namespaces, provider details, topics, concepts, slices, and tables. Your task is to parse this XML string and extract the following information into a dictionary: \n1. The target namespace f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_dataset_xml('<dataset targetNamespace=\\\"http://example.com/dataset\\\"><namespaces><namespace id=\\\"ns1\\\" url=\\\"http://example.com/ns1\\\"/></namespaces><info><name>Dataset Name</name><description>Dataset Description</description><url>http://exa... | {
"split": "train",
"index": 3841,
"acecode_id": "bigcode_python_fns_285",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a list of unique items in Python. Implement a function `manage_items` that supports three operations: 'add', 'remove', and 'get'. The function takes in two parameters: a string `operation` which can be 'add', 'remove', or 'get', and a string `item` ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_items('get', '') == []\", \"assert manage_items('add', 'apple') == True\", \"assert manage_items('add', 'banana') == True\", \"assert manage_items('remove', 'banana') == False\", \"assert manage_items('get', '') == []\", \"assert manage_items('remove'... | {
"split": "train",
"index": 3842,
"acecode_id": "oss_7003",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a nested dictionary, implement a function `to_json(nested_dict)` that transforms the key-value pairs into a structured JSON string without using any external libraries. The output should be a string formatted as a JSON object. The dictionary can contain both simple dictio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert to_json({'person': {'firstName': 'Jane', 'lastName': 'Doe'}, 'contact': {'email': 'jane.doe@example.com'}}) == '{\\\\n \\\"person\\\": {\\\\n \\\"firstName\\\": \\\"Jane\\\",\\\\n \\\"lastName\\\": \\\"Doe\\\"\\\\n },\\\\n \\\"contact\... | {
"split": "train",
"index": 3843,
"acecode_id": "evol_33960",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a list of tuples representing the margins of content boxes in a graphical user interface. Your function should take in a list of tuples, where each tuple contains four integers corresponding to the margins (left,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_margins([(10, 10, 10, 10)]) == [(20, 20, 20, 20)]\", \"assert process_margins([(5, 5, 5, 5)]) == [(10, 10, 10, 10)]\", \"assert process_margins([]) == []\", \"assert process_margins([(1, 2, 3, 4), (5, 6, 7, 8)]) == [(2, 4, 6, 8), (10, 12, 14, 16)]\",... | {
"split": "train",
"index": 3844,
"acecode_id": "oss_24547",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks whether a specific table exists in a given list of tables. The function should take two inputs: a list of strings representing the names of tables and a string representing the name of the table to check. The function should r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_table(['users', 'orders', 'products'], 'orders') == True\", \"assert has_table(['users', 'orders', 'products'], 'customers') == False\", \"assert has_table([], 'any_table') == False\", \"assert has_table(['employees', 'departments'], 'employees') == True... | {
"split": "train",
"index": 3845,
"acecode_id": "bigcode_python_fns_33513",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of words, each represented as a tuple containing a word and its part of speech, implement a function that returns a set of unique words that are categorized as nouns (denoted by 'NN'). The input is a list of tuples where each tuple consists of a word and its corres... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_nouns([('open', 'VB'), ('the', 'DT'), ('door', 'NN')]) == {'door'}\", \"assert extract_nouns([('cat', 'NN'), ('run', 'VB'), ('dog', 'NN'), ('jump', 'VB')]) == {'cat', 'dog'}\", \"assert extract_nouns([('table', 'NN'), ('chair', 'NN'), ('lamp', 'NN')]... | {
"split": "train",
"index": 3846,
"acecode_id": "bigcode_python_fns_28594",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of database migration operations and returns a dictionary containing the index together constraints for each model. The input list consists of tuples, where each tuple represents a migration operation. Each tu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_migration_operations([('user', 'index_together', {('email',)}), ('post', 'index_together', {('author_id', 'created_at')})]) == {'user': [{('email',)}], 'post': [{('author_id', 'created_at')}]}\", \"assert process_migration_operations([('task', 'index... | {
"split": "train",
"index": 3847,
"acecode_id": "oss_20356",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of buildings in a city skyline. Your task is to implement a function `max_building_height(heights: List[int]) -> int` that returns the maximum height among all the buildings in the skyline. The function should take a lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_building_height([3, 6, 1, 8, 4]) == 8\", \"assert max_building_height([1, 2, 3, 4, 5]) == 5\", \"assert max_building_height([5, 4, 3, 2, 1]) == 5\", \"assert max_building_height([7, 7, 7, 7, 7]) == 7\", \"assert max_building_height([10]) == 10\", \"asser... | {
"split": "train",
"index": 3848,
"acecode_id": "bigcode_python_fns_208",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_dice(sides: int, topFace: int) -> dict` that takes two integers, `sides` and `topFace`, representing the number of sides on a dice and the current top face of the dice, respectively. The function should return a dictionary with the keys 'sides' and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_dice(6, 3) == {'sides': 6, 'topFace': 3}\", \"assert create_dice(6, 6) == {'sides': 6, 'topFace': 6}\", \"assert create_dice(6, 0) == None\", \"assert create_dice(6, 7) == None\", \"assert create_dice(10, 5) == {'sides': 10, 'topFace': 5}\", \"assert ... | {
"split": "train",
"index": 3849,
"acecode_id": "evol_12111",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a Brazilian CPF number represented as a string of 11 digits, and two integers representing the first and second check digits of the CPF, implement a function that validates whether the provided check digits match the digits calculated from the CPF number. The function sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_cpf('12345678909', 7, 8) == 'invalid'\", \"assert validate_cpf('11144477735', 3, 5) == 'valid'\", \"assert validate_cpf('11144477735', 0, 5) == 'invalid'\", \"assert validate_cpf('22222222222', 2, 2) == 'valid'\", \"assert validate_cpf('22222222222'... | {
"split": "train",
"index": 3850,
"acecode_id": "bigcode_python_fns_33191",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating a formatted error message for unhandled HTTP requests. Write a function `generate_error_message(request, cassette)` that takes in a request object and a cassette object, then returns a formatted string that includes the URL from the request, the n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_error_message({'url': 'http://example.com/api'}, {'cassette_name': 'test_cassette', 'record_mode': 'new', 'match_options': 'all'}) == 'Unhandled Request: URL: http://example.com/api, Cassette: test_cassette, Record Mode: new, Match Options: all'\", ... | {
"split": "train",
"index": 3851,
"acecode_id": "bigcode_python_fns_33189",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a nested iterable (which may contain lists, tuples, or other nested iterables), implement a function called `flatten` that takes this nested iterable as input and returns a flat list containing all the elements, preserving the order of appearance. Your function should not... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert flatten([]) == []\", \"assert flatten([1, 2, [3, 4], 5]) == [1, 2, 3, 4, 5]\", \"assert flatten([[1, 2], [3, [4, 5]], 6]) == [1, 2, 3, 4, 5, 6]\", \"assert flatten([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\", \"assert flatten([[[]], [1, 2], 3]) == [1, 2, 3]\", \"a... | {
"split": "train",
"index": 3852,
"acecode_id": "bigcode_python_fns_16506",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that reduces a list to a maximum of N distinct elements by consistently removing the least frequent elements. If two or more elements have the same frequency, remove the one that was most recently added to the list. If N is greater than the size of the l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert consistent_reduce([5, 5, 5, 5], 1) == [5]\", \"assert consistent_reduce([1, 2, 3], 3) == [1, 2, 3]\", \"assert consistent_reduce(['apple', 'banana'], 2) == ['apple', 'banana']\", \"assert consistent_reduce(['a', 'b', 'c', 'd', 'e', 'f'], 4) == ['a', 'b', 'c'... | {
"split": "train",
"index": 3853,
"acecode_id": "evol_32182",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a generator function that produces a sequence of samples and a neural network model. Your task is to implement a function that calculates a specific parameter related to the detection of events. The function should receive the generator function, the model, and an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert detect_events(lambda: iter(range(5)), 'dummy_model', type('obj', (object,), {'alpha': 0.1, 'beta': 0.2}), lambda: iter(range(5))) == (1.0, 0.1)\", \"assert detect_events(lambda: iter(range(0)), 'dummy_model', type('obj', (object,), {'alpha': 0.2, 'beta': 0.3... | {
"split": "train",
"index": 3854,
"acecode_id": "bigcode_python_fns_45103",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a user interface for a media application. The application can display upcoming recordings in a popup. Your function should take a list of recording titles along with their scheduled times and return a formatted string that ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_recordings([('TVH Widget Test 1', '2023-11-26 18:55'), ('TVH Widget Test 2', '2023-11-26 19:05')]) == 'Upcoming recordings:\\\\nSun Nov 26 18:55: TVH Widget Test 1\\\\nSun Nov 26 19:05: TVH Widget Test 2'\", \"assert format_recordings([('Show A', '202... | {
"split": "train",
"index": 3855,
"acecode_id": "bigcode_python_fns_30593",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with visualizing the layout of a road scene given the position of an ego vehicle, agents, lanes, and crosswalks. Write a function `get_frame_visualization(ego_position: Tuple[float, float], agents: List[Dict], lanes: List[Dict], crosswalks: List[Dict]) -> Dict` t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_frame_visualization((0, 0), [{'position': (1, 1), 'type': 'car'}, {'position': (2, 2), 'type': 'pedestrian'}], [{'id': 'lane1', 'coordinates': [(0, 0), (1, 0)]}], [{'coordinates': [(0, 0), (0, 1)]}]) == {'ego': {'position': (0, 0)}, 'agents': [{'position... | {
"split": "train",
"index": 3856,
"acecode_id": "bigcode_python_fns_44077",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Write a function to calculate the area of a circle given its radius. The function should take a single parameter, 'radius', which is a non-negative float representing the radius of the circle. The function should return the area of the circle as a float.\nPlease reason step by ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert area_of_circle(0) == 0.0\", \"assert area_of_circle(1) == 3.141592653589793\", \"assert area_of_circle(2) == 12.566370614359172\", \"assert area_of_circle(3) == 28.274333882308138\", \"assert area_of_circle(4) == 50.26548245743669\", \"assert area_of_circle(... | {
"split": "train",
"index": 3857,
"acecode_id": "evol_2015",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a positive integer n, return the sum of all even Fibonacci numbers that do not exceed n. The Fibonacci sequence starts with 1 and 2, and each subsequent term is the sum of the two preceding ones. Implement a function `sum_even_fibonacci(n: int) -> int` that computes this ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_even_fibonacci(1) == 0\", \"assert sum_even_fibonacci(2) == 2\", \"assert sum_even_fibonacci(3) == 2\", \"assert sum_even_fibonacci(4) == 2\", \"assert sum_even_fibonacci(5) == 2\", \"assert sum_even_fibonacci(10) == 10\", \"assert sum_even_fibonacci(20)... | {
"split": "train",
"index": 3858,
"acecode_id": "evol_34007",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given two lists, `records` and `shapes`, write a function `are_records_matching_shapes(records: List[Any], shapes: List[Any]) -> bool` that checks whether the number of records in the `records` list matches the number of shapes in the `shapes` list. The function should return `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert are_records_matching_shapes([1, 2, 3], [4, 5, 6]) == True\", \"assert are_records_matching_shapes(['a', 'b'], ['c']) == False\", \"assert are_records_matching_shapes([], []) == True\", \"assert are_records_matching_shapes([None], [None, None]) == False\", \"... | {
"split": "train",
"index": 3859,
"acecode_id": "bigcode_python_fns_33713",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the creation of a leaf type in a project management system. The function should take three parameters: an integer `project_id`, a string `host`, and a string `token`. It should generate a unique leaf type ID based on the pr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_leaf_type(1, 'http://example.com', 'token123').startswith('leaf-1-')\", \"assert create_leaf_type(2, 'http://example.com', 'token123').startswith('leaf-2-')\", \"assert create_leaf_type(3, 'http://example.com', 'token123').startswith('leaf-3-')\", \"a... | {
"split": "train",
"index": 3860,
"acecode_id": "oss_10421",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple URL routing system for an API. Your goal is to implement a function `route_request` that takes a list of routers, each defined by a prefix and a set of tags, and a URL path. The function should determine which router handles the given URL p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert route_request([('/api/login', ['login']), ('/api/register', ['register'])], '/api/login') == ['login']\", \"assert route_request([('/api/login', ['login']), ('/api/register', ['register'])], '/api/register') == ['register']\", \"assert route_request([('/api/... | {
"split": "train",
"index": 3861,
"acecode_id": "oss_329",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary object that represents a data type, determine whether the data type is nullable. A data type is represented as a dictionary with a key 'nullable' that has a boolean value (True or False). Implement a function `is_nullable(data_type: dict) -> bool` that takes ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_nullable({'nullable': True}) == True\", \"assert is_nullable({'nullable': False}) == False\", \"assert is_nullable({'nullable': True, 'name': 'string'}) == True\", \"assert is_nullable({'nullable': False, 'name': 'integer'}) == False\", \"assert is_nullab... | {
"split": "train",
"index": 3862,
"acecode_id": "bigcode_python_fns_24256",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a directed graph represented as an adjacency list where each node is a string and each edge is associated with a positive integer cost. Your task is to implement a function that finds the least cost path from a starting node to a goal node. The function should ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert least_cost_path({'A': [('B', 1), ('C', 4)], 'B': [('C', 2), ('D', 5)], 'C': [('D', 1)], 'D': []}, 'A', 'D') == ['A', 'B', 'C', 'D']\", \"assert least_cost_path({'A': [('B', 2), ('C', 1)], 'B': [('D', 2)], 'C': [('D', 1)], 'D': []}, 'A', 'D') == ['A', 'C', 'D... | {
"split": "train",
"index": 3863,
"acecode_id": "bigcode_python_fns_44885",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers and a target integer. Your task is to determine if there are two distinct integers in the list that add up to the target integer. If such a pair exists, return True; otherwise, return False. The function should have the following signature: `def... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_pair_with_sum([1, 2, 3, 4, 5], 9) == True\", \"assert has_pair_with_sum([1, 2, 3, 4, 5], 10) == False\", \"assert has_pair_with_sum([0, 1, 2, 3], 3) == True\", \"assert has_pair_with_sum([-1, -2, -3, -4], -5) == True\", \"assert has_pair_with_sum([5, 5, ... | {
"split": "train",
"index": 3864,
"acecode_id": "bigcode_python_fns_47559",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that manages logging configuration. The function, `configure_logging`, takes a dictionary called `default_config` as input. This dictionary may contain a key 'loki' which itself is a dictionary with keys 'url', 'username', 'password', and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert configure_logging({'loki': {'url': 'http://loki.example.com', 'async': True}}) == 'Enabled Loki logging in async mode'\", \"assert configure_logging({'loki': {'url': 'http://loki.example.com', 'async': False}}) == 'Enabled Loki logging in sync mode'\", \"ass... | {
"split": "train",
"index": 3865,
"acecode_id": "bigcode_python_fns_43927",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `cube_primes_in_range(start: int, end: int) -> Dict[int, int]` that computes the cubes of all prime numbers within a specified range from `start` to `end`, inclusive. The function should return a dictionary where the keys are the prime numbers and the values ar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cube_primes_in_range(1, 10) == {2: 8, 3: 27, 5: 125, 7: 343}\", \"assert cube_primes_in_range(10, 20) == {11: 1331, 13: 2197, 17: 4913, 19: 6859}\", \"assert cube_primes_in_range(1, 1) == {}\", \"assert cube_primes_in_range(15, 15) == {}\", \"assert cube_pri... | {
"split": "train",
"index": 3866,
"acecode_id": "evol_1994",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Develop a Python function that replaces an element at a specified index in a given list with a new provided element. If the index is out of range, the function should return the original list without any modifications. The function should handle the error gracefully without rai... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_element([10, 20, 30, 40, 50], 2, 60) == [10, 20, 60, 40, 50]\", \"assert replace_element([10, 20, 30, 40, 50], 0, 100) == [100, 20, 30, 40, 50]\", \"assert replace_element([10, 20, 30, 40, 50], 4, 70) == [10, 20, 30, 40, 70]\", \"assert replace_eleme... | {
"split": "train",
"index": 3867,
"acecode_id": "evol_15969",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Write a function `find_missing_number(arr)` that takes an array of integers containing numbers from 1 to n with one number missing. Your task is to find the missing number. The function should return the missing number. It is guaranteed that th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_missing_number([3, 7, 1, 2, 8, 4, 5]) == 6\", \"assert find_missing_number([1, 2, 4, 5, 6]) == 3\", \"assert find_missing_number([2, 3, 1, 5]) == 4\", \"assert find_missing_number([5, 1, 2, 3]) == 4\", \"assert find_missing_number([1]) == 2\", \"assert ... | {
"split": "train",
"index": 3868,
"acecode_id": "bigcode_python_fns_36985",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with validating usernames based on specific criteria. Write a function `validate_username(username: str) -> bool` that checks if the provided username meets the following conditions: \n1. The username must not be empty. \n2. The username must not exceed 16 charac... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_username('john_doe123') == True\", \"assert validate_username('user123') == True\", \"assert validate_username('A_user') == True\", \"assert validate_username('user_name_1') == True\", \"assert validate_username('User') == True\", \"assert validate_... | {
"split": "train",
"index": 3869,
"acecode_id": "oss_28179",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to calculate the area of a 2D polygon given its vertices. The function should take in a list of vertices represented as (x, y) coordinates and return the total area of the polygon. The area of the polygon is calculated using the shoel... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_polygon_area([(0, 0), (4, 0), (4, 3), (0, 3)]) == 12\", \"assert calculate_polygon_area([(0, 0), (1, 2), (2, 0)]) == 2\", \"assert calculate_polygon_area([(0, 0), (5, 0), (5, 5), (0, 5)]) == 25\", \"assert calculate_polygon_area([(1, 1), (1, 4), (4... | {
"split": "train",
"index": 3870,
"acecode_id": "oss_24887",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers, and your task is to implement a function that uploads this list to a hypothetical external service. The service is simulated to always return a success status code of 200 when an upload is attempted. Implement a function `upload_list(data: List... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert upload_list([1, 2, 3]) == 200\", \"assert upload_list([]) == 200\", \"assert upload_list([10, 20, 30, 40, 50]) == 200\", \"assert upload_list([-1, -2, -3]) == 200\", \"assert upload_list([100]) == 200\", \"assert upload_list([5, 15, 25]) == 200\", \"assert u... | {
"split": "train",
"index": 3871,
"acecode_id": "bigcode_python_fns_4179",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Please write a Python function called `check_number_status` that takes an integer x as input. The function should return a string based on the following conditions: If x is greater than or equal to 0 and is even, return 'Non-negative even number'. If x is greater than or equal ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_number_status(4) == 'Non-negative even number'\", \"assert check_number_status(7) == 'Non-negative odd number'\", \"assert check_number_status(0) == 'Non-negative even number'\", \"assert check_number_status(-1) == 'Negative number'\", \"assert check_n... | {
"split": "train",
"index": 3872,
"acecode_id": "evol_30585",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of teacher data in the form of dictionaries. Each dictionary will contain 'first_name', 'last_name', and 'email' keys. Your function should take a list of these dictionaries and return a summary that consists of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bulk_create_teachers([{'first_name': 'John', 'last_name': 'Doe', 'email': 'johndoe@example.com'}, {'first_name': 'Jane', 'last_name': 'Smith', 'email': 'janesmith@example.com'}]) == {'created': ['johndoe@example.com', 'janesmith@example.com'], 'errors': []}\... | {
"split": "train",
"index": 3873,
"acecode_id": "oss_26006",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function `unique_random_char(s: str) -> str` that selects a random unique character (a character appearing only once) from the given string `s`. If there are no unique characters, the function should return the message 'No unique characters found.' The function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_random_char('Hello World') in 'Helo Wrd'\", \"assert unique_random_char('aabbcc') == 'No unique characters found.'\", \"assert unique_random_char('abcdefg') in 'abcdefg'\", \"assert unique_random_char('') == 'No unique characters found.'\", \"assert u... | {
"split": "train",
"index": 3874,
"acecode_id": "evol_28137",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that retrieves a list of unique categories from a given list of items. Each item is represented as a string, and the function should return a list of unique categories in alphabetical order. Write a function `get_unique_categories(ite... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_categories(['fruit', 'vegetable', 'fruit', 'dairy']) == ['dairy', 'fruit', 'vegetable']\", \"assert get_unique_categories(['cat', 'dog', 'fish', 'dog']) == ['cat', 'dog', 'fish']\", \"assert get_unique_categories(['apple', 'banana', 'apple', 'appl... | {
"split": "train",
"index": 3875,
"acecode_id": "bigcode_python_fns_37715",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes two parameters: an input signal represented as a string and an input value represented as a float. The function should return a dictionary where the key is the input signal and the value is a dictionary that contains the input ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_input_assign('signal1', 3.14) == {'signal1': {'value': 3.14, 'precision': 2}}\", \"assert get_input_assign('signal2', 5.0) == {'signal2': {'value': 5.0, 'precision': 1}}\", \"assert get_input_assign('signal3', 10) == {'signal3': {'value': 10, 'precision'... | {
"split": "train",
"index": 3876,
"acecode_id": "bigcode_python_fns_31372",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary where the keys can either be integers or tuples. The values are integers representing amounts. Your task is to transform this dictionary into a list of dictionaries. Each dictionary in the list should contain two or three keys: 'id' for integer keys, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_dictionary({1: 10, 2: 20}) == [{'id': 1, 'amount': 10}, {'id': 2, 'amount': 20}]\", \"assert transform_dictionary({(1, 'A'): 30, (2, 'B'): 40}) == [{'database': 1, 'code': 'A', 'amount': 30}, {'database': 2, 'code': 'B', 'amount': 40}]\", \"assert ... | {
"split": "train",
"index": 3877,
"acecode_id": "bigcode_python_fns_47006",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers, write a function `concat_applicative` that takes a list `current` and a list `acc`, both of which represent collections of integers. The function should apply a transformation to each element in `current` using a curried function that takes an integ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert concat_applicative([1, 2, 3], [4, 5], lambda x: x * 2) == [4, 5, 2, 4, 6]\", \"assert concat_applicative([], [1, 2], lambda x: x + 1) == [1, 2]\", \"assert concat_applicative([0], [], lambda x: x + 10) == [10]\", \"assert concat_applicative([5, 10], [15], la... | {
"split": "train",
"index": 3878,
"acecode_id": "bigcode_python_fns_10899",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `get_positive_and_sort(l: list) -> list` that takes a list of integers and returns a new list containing only the positive numbers from the input list, sorted in ascending order. You must not use the built-in `sort()` or `sorted()` functions. Instead, imple... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_positive_and_sort([-1, 2, -4, 5, 6]) == [2, 5, 6]\", \"assert get_positive_and_sort([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]) == [1, 2, 3, 3, 5, 9, 123]\", \"assert get_positive_and_sort([-10, -5, -1]) == []\", \"assert get_positive_and_sort([0, 0, 0, 0])... | {
"split": "train",
"index": 3879,
"acecode_id": "evol_2889",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the total number of business days between two given dates, excluding weekends but including specified holidays. The function should take in two date strings in the format 'YYYY-MM-DD' and a list of holiday strings in the same format. The fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert business_days('2021-03-01', '2021-03-31', ['2021-03-15', '2021-03-17']) == 21\", \"assert business_days('2021-05-01', '2021-05-31', ['2021-05-31']) == 20\", \"assert business_days('2021-06-01', '2021-06-30', ['2021-06-14']) == 21\", \"assert business_days('2... | {
"split": "train",
"index": 3880,
"acecode_id": "evol_652",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Create a function that filters out all integers and prime numbers from an array of mixed data types. The function should return the filtered array, excluding any integers and prime numbers, along with the sum of the removed prime numbers. Do not use any built-in functions for i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_and_sum(['test', 'example', 14, 15, 16]) == {'filteredArray': ['test', 'example', 14, 15, 16], 'sumOfPrimes': 0}\", \"assert filter_and_sum([1, 4, 6, 8]) == {'filteredArray': [1, 4, 6, 8], 'sumOfPrimes': 0}\", \"assert filter_and_sum(['A', 13, 14, 15,... | {
"split": "train",
"index": 3881,
"acecode_id": "evol_15131",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a 2D list of integers, write a function that flattens the 2D list into a 1D list. The function should not enforce any specific order for the elements in the output list. You may assume that the input list is non-empty and contains sublists of varying lengths. Implement th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert flatten_array([[1, 2], [3, 4]]) == [1, 2, 3, 4]\", \"assert flatten_array([[1, 2, 3], [4], [5, 6]]) == [1, 2, 3, 4, 5, 6]\", \"assert flatten_array([[1], [2], [3], [4], [5]]) == [1, 2, 3, 4, 5]\", \"assert flatten_array([[1, 2], [], [3, 4]]) == [1, 2, 3, 4]\... | {
"split": "train",
"index": 3882,
"acecode_id": "bigcode_python_fns_9955",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that converts a string representation of a time duration into a `timedelta` object representing that duration in days. The input string will consist of a number followed by a character indicating the time unit. The character will be 'd' fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_delta('invalid') == None\", \"assert convert_delta('5') == None\", \"assert convert_delta('2hours') == None\", \"assert convert_delta('1d2h') == None\", \"assert convert_delta('') == None\", \"assert convert_delta('d') == None\", \"assert convert_del... | {
"split": "train",
"index": 3883,
"acecode_id": "bigcode_python_fns_14483",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Write a function `calculate_average_rate` that calculates the average of the numbers in the list and returns it as a percentage. The average is calculated as the sum of all numbers in the list divided by the total count of numbers in the list, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_rate([]) == 0\", \"assert calculate_average_rate([0, 0, 0]) == 0.0\", \"assert calculate_average_rate([-10, 10]) == 0.0\", \"assert calculate_average_rate([1, 1, 1, 1]) == 100.0\", \"assert calculate_average_rate([10]) == 1000.0\", \"assert... | {
"split": "train",
"index": 3884,
"acecode_id": "oss_1088",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing the number of customers who logged in each day for a certain period, write a function that calculates the average number of customers who logged in per day. The function should take a list of integers as input and return a float representin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_customers([10, 20, 30]) == 20.0\", \"assert average_customers([5, 15, 25, 35]) == 20.0\", \"assert average_customers([1]) == 1.0\", \"assert average_customers([0]) == 0.0\", \"assert average_customers([]) == 0.0\", \"assert average_customers([100, 20... | {
"split": "train",
"index": 3885,
"acecode_id": "bigcode_python_fns_3418",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `sum_list(numbers)` that returns the sum of all the integers in the list. The function should handle an empty list by returning 0.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_list([]) == 0\", \"assert sum_list([1, 2, 3]) == 6\", \"assert sum_list([-1, -2, -3]) == -6\", \"assert sum_list([5]) == 5\", \"assert sum_list([0, 0, 0]) == 0\", \"assert sum_list([1, -1]) == 0\", \"assert sum_list([100, 200, 300]) == 600\", \"assert su... | {
"split": "train",
"index": 3886,
"acecode_id": "evol_8808",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a dictionary of command-line arguments and executes a command based on the processed arguments. Your function should take a dictionary called `arguments` where the keys are argument names (strings) and the values... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_and_execute_command({'arg1': 'value1', 'arg2': 'value2'}) == (True, '')\", \"assert process_and_execute_command({'name': 'Alice', 'age': '30'}) == (True, '')\", \"assert process_and_execute_command({'host': 'localhost', 'port': '8080'}) == (True, '')... | {
"split": "train",
"index": 3887,
"acecode_id": "oss_9023",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of strings representing public repository names and returns a serialized JSON string of the repositories. The input list may contain duplicates, and your output should include only unique repository names. The serialized... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert serialize_repositories(['repo1', 'repo2', 'repo1']) == '{\\\"repositories\\\": [\\\"repo1\\\", \\\"repo2\\\"]}'\", \"assert serialize_repositories(['repoA', 'repoB', 'repoC']) == '{\\\"repositories\\\": [\\\"repoA\\\", \\\"repoB\\\", \\\"repoC\\\"]}'\", \"as... | {
"split": "train",
"index": 3888,
"acecode_id": "bigcode_python_fns_34499",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `mark_garbage_block(token: str, block_id: str) -> Dict[str, Union[bool, str]]` that simulates marking a block as garbage in a system. The function takes in two parameters: a string `token` representing a user's authentication token, and a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert mark_garbage_block('', 'block123') == {'is_success': False, 'data': 'Token\\u65e0\\u6548'}\", \"assert mark_garbage_block('valid_token', 'block123') == {'is_success': True, 'data': '\\u6807\\u8bb0\\u6210\\u529f'}\", \"assert mark_garbage_block('valid_token',... | {
"split": "train",
"index": 3889,
"acecode_id": "bigcode_python_fns_3522",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the behavior of extracting specific timestamp fields from a date-like column. The function, `extract_timestamp_field`, takes a list of transformations and a string `field` as input. The `transformations` list contains tuple... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_timestamp_field([('Transform1', 'date')], 'year') == 'Extracted year from the date column'\", \"assert extract_timestamp_field([('Transform1', 'date')], 'month') == 'Extracted month from the date column'\", \"assert extract_timestamp_field([('Transfo... | {
"split": "train",
"index": 3890,
"acecode_id": "oss_4581",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `count_subsequences(string: str, substring: str) -> (int, List[int])` that computes the frequency and the starting indices of a specified substring within a given string as a subsequence. Ensure that overlapping instances of the substring are disregarded. F... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_subsequences('', 'a') == (0, [])\", \"assert count_subsequences('aaa', 'a') == (3, [0, 1, 2])\", \"assert count_subsequences('abcde', 'f') == (0, [])\", \"assert count_subsequences('abcdefghijklmnop', 'xyz') == (0, [])\", \"assert count_subsequences('a... | {
"split": "train",
"index": 3891,
"acecode_id": "evol_21865",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that validates user registration data for a web application. The function should take in a dictionary containing user information and perform the following validations: 1. Check if the request contains the required fields: 'usernam... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_user_registration({'username': 'user2', 'email': 'user2example.com', 'password': 'password123', 'confirm_password': 'password123'}) == {'error': 'Invalid email format'}\", \"assert validate_user_registration({'username': 'user1', 'email': 'user1@exa... | {
"split": "train",
"index": 3892,
"acecode_id": "oss_1572",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, implement a function that takes this array as input and returns a new array where each element is the result of applying a specified function to every element in the original array. The specified function is to multiply each element by 3. For example... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multiply_array([1, 2, 3]) == [3, 6, 9]\", \"assert multiply_array([0, 0, 0]) == [0, 0, 0]\", \"assert multiply_array([-1, -2, -3]) == [-3, -6, -9]\", \"assert multiply_array([4, 5, 6]) == [12, 15, 18]\", \"assert multiply_array([10]) == [30]\", \"assert mult... | {
"split": "train",
"index": 3893,
"acecode_id": "evol_12268",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that defines the choices for a survey submission method. The function should return a list of tuples, where each tuple contains a string representing the method of survey submission and its corresponding label. The available submission me... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_submission_choices() == [('automatic', 'Automatic'), ('manual', 'Manual'), ('both', 'Both')]\", \"assert len(get_submission_choices()) == 3\", \"assert get_submission_choices()[0] == ('automatic', 'Automatic')\", \"assert get_submission_choices()[1] == (... | {
"split": "train",
"index": 3894,
"acecode_id": "oss_6718",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks for naming conflicts when creating new resources in a file management system. The function will receive a string representing the name of the resource file. The goal is to determine if the resource name already exists in a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_resource_conflict('folder/file.txt', {'folder/file.txt', 'folder/file2.txt'}) == 'folder/file.txt'\", \"assert check_resource_conflict('folder/file.txt', {'folder/file.txt', 'folder/file.txt'}) == 'folder/file.txt'\", \"assert check_resource_conflict('... | {
"split": "train",
"index": 3895,
"acecode_id": "oss_6093",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, where each string represents a sequence of characters, write a function that groups consecutive sequences together into a list of lists. A new group starts whenever a string begins with the character '>'. The first string in the list should not be inclu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert group_sequences(['>header1', 'ACGT', '>header2', 'TGCA', '>header3', 'GATTACA']) == [['ACGT'], ['TGCA'], ['GATTACA']]\", \"assert group_sequences(['>header1', 'ATGC', '>header2', 'CGTA']) == [['ATGC'], ['CGTA']]\", \"assert group_sequences(['>header1', '>hea... | {
"split": "train",
"index": 3896,
"acecode_id": "bigcode_python_fns_38353",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of 3D points represented as tuples (x, y, z) inside a unit cube (where each coordinate is between 0 and 1). Your task is to implement a function that checks if all points in the provided list are isolated based on a given radius r_max. Points are considered... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert spherical_isolation([(0.1, 0.1, 0.1), (0.3, 0.3, 0.3), (0.5, 0.5, 0.5)], 0.1) == True\", \"assert spherical_isolation([(0.1, 0.1, 0.1), (0.3, 0.3, 0.3)], 0.15) == True\", \"assert spherical_isolation([(0.1, 0.1, 0.1)], 0.1) == True\", \"assert spherical_isol... | {
"split": "train",
"index": 3897,
"acecode_id": "bigcode_python_fns_20971",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a simple job queue for machine learning tasks. Implement a function `manage_job_queue(jobs: List[str], action: str) -> List[str]` that takes a list of job names and an action (either 'start' or 'stop'). If the action is 'start', the function should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_job_queue(['job1', 'job2'], 'start') == ['Job started: job1', 'Job started: job2']\", \"assert manage_job_queue(['job1', 'job1', 'job2'], 'start') == ['Job started: job1', 'Job started: job1', 'Job started: job2']\", \"assert manage_job_queue(['job1',... | {
"split": "train",
"index": 3898,
"acecode_id": "oss_24473",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that checks if a given integer value does not exceed a specified maximum limit. Implement a function called `is_within_limit(value: int, maximum: int) -> bool` that takes two parameters: an integer `value` and an integer `maximum`. The fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_within_limit(5, 10) == True\", \"assert is_within_limit(10, 10) == True\", \"assert is_within_limit(15, 10) == False\", \"assert is_within_limit(-5, 0) == True\", \"assert is_within_limit(0, -1) == False\", \"assert is_within_limit(5, None) == True\", \"a... | {
"split": "train",
"index": 3899,
"acecode_id": "bigcode_python_fns_1550",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.