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 given a function that simulates a play widget which generates a sequence of numbers based on a given range and step. Your task is to implement a function `generate_sequence(min_value: int, max_value: int, step: int) -> List[int]` that generates a list of integers starti...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_sequence(0, 10, 2) == [0, 2, 4, 6, 8, 10]\", \"assert generate_sequence(1, 5, 1) == [1, 2, 3, 4, 5]\", \"assert generate_sequence(5, 5, 1) == [5]\", \"assert generate_sequence(-5, 5, 5) == [-5, 0, 5]\", \"assert generate_sequence(0, 0, 1) == [0]\", ...
{ "split": "train", "index": 62100, "acecode_id": "bigcode_python_fns_33062", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given an integer n, write a function that determines if n is a power of three. A power of three is a number that can be expressed as 3^k where k is a non-negative integer (k >= 0). Return True if n is a power of three, otherwise return False.\nPlease reason step by step, then w...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_power_of_three(1) == True\", \"assert is_power_of_three(3) == True\", \"assert is_power_of_three(9) == True\", \"assert is_power_of_three(27) == True\", \"assert is_power_of_three(81) == True\", \"assert is_power_of_three(2) == False\", \"assert is_power_...
{ "split": "train", "index": 62101, "acecode_id": "evol_12128", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python program to manage a list of delegates attending a conference. Each delegate has a name and belongs to a specific category. Write a Python function `get_delegates_by_category(delegates, category_name)` that takes a list of delegates (where e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_delegates_by_category([{'name': 'Alice', 'category': 'Speaker'}, {'name': 'Bob', 'category': 'Attendee'}, {'name': 'Charlie', 'category': 'Speaker'}], 'Speaker') == ['Alice', 'Charlie']\", \"assert get_delegates_by_category([{'name': 'Alice', 'category':...
{ "split": "train", "index": 62102, "acecode_id": "oss_23230", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a list of Python file names along with their respective line counts in a directory structure. The function should output a string that lists each Python file with its line count, followed by a total line count for all the l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list_python_files_and_count_lines([('file1.py', 50), ('subdirectory1/file2.py', 70), ('subdirectory1/file3.py', 60), ('subdirectory2/file4.py', 40)]) == 'file1.py: 50 lines\\\\nsubdirectory1/file2.py: 70 lines\\\\nsubdirectory1/file3.py: 60 lines\\\\nsubdire...
{ "split": "train", "index": 62103, "acecode_id": "oss_37219", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with converting geographic coordinates (latitude and longitude) into a Maidenhead grid locator format. The Maidenhead format is defined by a series of letters and numbers that represent the specific location. Implement a function `maidenhead(dec_lat: float, dec_l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert maidenhead(45.0, 200.0) == ''\", \"assert maidenhead(95.0, 0) == ''\", \"assert maidenhead(-91.0, 0) == ''\", \"assert maidenhead(float('inf'), 0) == ''\", \"assert maidenhead(0, float('inf')) == ''\"]}" }
{ "split": "train", "index": 62104, "acecode_id": "bigcode_python_fns_30613", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with simulating the behavior of a robot's drivetrain control system. Your goal is to implement a function `drive_robot(leftSpeed: int, rightSpeed: int, duration: int) -> Tuple[int, int]` that simulates the setting of left and right drive speeds for a specified du...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert drive_robot(10, 10, 5) == (10, 10)\", \"assert drive_robot(0, 0, 0) == (0, 0)\", \"assert drive_robot(-5, -5, 10) == (-5, -5)\", \"assert drive_robot(15, 20, 3) == (15, 20)\", \"assert drive_robot(100, 100, -1) == (0, 0)\", \"assert drive_robot(30, -30, -5) ...
{ "split": "train", "index": 62105, "acecode_id": "oss_428", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an object, determine if it is versioned by checking its attributes. An object is considered versioned if it has an attribute 'versioned' that evaluates to True, or if it has an attribute 'VersionedEpoch' that exists. If neither condition is met, check if it has a 'version...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_versioned({'versioned': False}) == False\", \"assert is_versioned({'version_id': None}) == False\", \"assert is_versioned({'version_id': None, 'versioned': False}) == False\", \"assert is_versioned({'some_other_attr': 123}) == False\", \"assert is_version...
{ "split": "train", "index": 62106, "acecode_id": "bigcode_python_fns_29128", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are given a list of points represented as tuples, where each point is defined by its x and y coordinates. Your task is to scale these points to their original image size by a given scale factor. The scale factor is a positive float value that represents the factor by which ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert scale_points([(1, 1), (2, 2)], 0.5) == [(2.0, 2.0), (4.0, 4.0)]\", \"assert scale_points([(0, 0), (1, 1), (2, 3)], 1) == [(0.0, 0.0), (1.0, 1.0), (2.0, 3.0)]\", \"assert scale_points([(1, 2)], 0.25) == [(4.0, 8.0)]\", \"assert scale_points([(3, 5), (6, 8)], ...
{ "split": "train", "index": 62107, "acecode_id": "bigcode_python_fns_42926", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a list of tickets and returns a list of strings representing the title and ID of each ticket in the format '#<id> <title>'. Each ticket is represented as a dictionary containing 'id' and 'title' keys. Your function shou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_tickets([]) == []\", \"assert format_tickets([{'id': 1, 'title': 'Bug Fix'}, {'id': 2, 'title': 'Feature Request'}]) == ['#1 Bug Fix', '#2 Feature Request']\", \"assert format_tickets([{'id': 3, 'title': 'UI Improvement'}, {'id': 4, 'title': 'Performa...
{ "split": "train", "index": 62108, "acecode_id": "oss_9774", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with processing a list of command-line arguments. Create a function called `process_arguments` that takes a list of strings as input and returns a single string that concatenates all the arguments into one, separated by a space. The function should ignore any emp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_arguments(['arg1', '', 'arg2', 'arg3']) == 'arg1 arg2 arg3'\", \"assert process_arguments(['', '', '']) == ''\", \"assert process_arguments(['hello', 'world']) == 'hello world'\", \"assert process_arguments(['foo', 'bar', '']) == 'foo bar'\", \"asser...
{ "split": "train", "index": 62109, "acecode_id": "bigcode_python_fns_9237", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a logging function called `log_message` that accepts a variable number of string arguments. The function should concatenate all the input strings into a single string, separated by spaces, and return the concatenated string. Your function should ign...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert log_message('Hello', 'World') == 'Hello World'\", \"assert log_message('Python', '', 'is', 'awesome') == 'Python is awesome'\", \"assert log_message('', 'Test', 'case') == 'Test case'\", \"assert log_message('Log', 'this', 'message') == 'Log this message'\",...
{ "split": "train", "index": 62110, "acecode_id": "bigcode_python_fns_11220", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers and a non-negative integer d, implement a function that rotates the array to the right by d steps. The rotation is performed such that the elements that are shifted out from the end of the array come back to the beginning. For example, if we rotate th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rotate_array([1, 2, 3, 4, 5], 2) == [4, 5, 1, 2, 3]\", \"assert rotate_array([1, 2, 3, 4, 5], 0) == [1, 2, 3, 4, 5]\", \"assert rotate_array([1, 2, 3, 4, 5], 5) == [1, 2, 3, 4, 5]\", \"assert rotate_array([1, 2, 3, 4, 5], 1) == [5, 1, 2, 3, 4]\", \"assert ro...
{ "split": "train", "index": 62111, "acecode_id": "evol_22080", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of file paths, implement a function `file_sort_key(file: str) -> tuple` that takes a single file path as input and returns a sort key as a tuple. The sort key should consist of tuples where each tuple contains two elements: the first element is 1 for all parts of t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert file_sort_key('home/user/document.txt') == ((1, 'home'), (1, 'user'), (0, 'document.txt'))\", \"assert file_sort_key('var/log/syslog') == ((1, 'var'), (1, 'log'), (0, 'syslog'))\", \"assert file_sort_key('usr/bin/python3') == ((1, 'usr'), (1, 'bin'), (0, 'py...
{ "split": "train", "index": 62112, "acecode_id": "bigcode_python_fns_21260", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You need to implement a function that returns a JSON object containing a message. The function should simply generate a JSON object with a single key 'test' and its corresponding value as the string 'this is a test message'. Your function should have the following signature: `d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_test() == {'test': 'this is a test message'}\", \"assert isinstance(get_test(), dict)\", \"assert 'test' in get_test()\", \"assert get_test()['test'] == 'this is a test message'\", \"assert len(get_test()) == 1\", \"assert type(get_test()['test']) == str...
{ "split": "train", "index": 62113, "acecode_id": "bigcode_python_fns_20429", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given the parameters for a digital filter design, implement a function `synthesize_ntf_minmax` that takes the following inputs: `order` (an integer representing the filter order), `osr` (an integer representing the oversampling ratio), `H_inf` (a float representing the infinity...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert synthesize_ntf_minmax(32, 32, 1.5, 0, False) == {'order': 32, 'osr': 32, 'H_inf': 1.5, 'f0': 0, 'zf': False}\", \"assert synthesize_ntf_minmax(64, 16, 2.0, 1000, True) == {'order': 64, 'osr': 16, 'H_inf': 2.0, 'f0': 1000, 'zf': True}\", \"assert synthesize_n...
{ "split": "train", "index": 62114, "acecode_id": "bigcode_python_fns_5357", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string, implement a function that finds the top 5 most common words while treating words with different cases as the same. Punctuation should be considered part of the word, meaning 'Hello,' and 'Hello' should be counted as different words. Return a list of tuples conta...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert most_common_words('apple banana apple cherry banana apple') == [('apple', 3), ('banana', 2), ('cherry', 1)]\", \"assert most_common_words('Test. Test. Test. Test.') == [('Test.', 4)]\", \"assert most_common_words('Hello, hello, HELLO!') == [('Hello,', 1), ('...
{ "split": "train", "index": 62115, "acecode_id": "evol_31726", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with determining if a given recipe component contains a 'Core Recipe' preparation. A recipe component is represented as a dictionary with a key named 'recipeItem', which is itself a dictionary containing a key called 'preparations'. The value of 'preparations' is...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_core_recipe({'recipeItem': {'preparations': [{'id': 1}, {'id': 2}, {'id': 3}]}}) == False\", \"assert is_core_recipe({'recipeItem': {'preparations': [{'id': 1}, {'id': 2}, {'id': 0}]}}) == True\", \"assert is_core_recipe({'recipeItem': {'preparations': [{...
{ "split": "train", "index": 62116, "acecode_id": "bigcode_python_fns_5451", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that sorts an array of integers in ascending order without using any built-in sorting functions. The function should return the sorted array. Additionally, implement a validation check that ensures the sorted array is correctly ordered. If the array is sort...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_and_validate([15, 23, 9, 10, 55, 3, 76, 8]) == ([3, 8, 9, 10, 15, 23, 55, 76], True)\", \"assert sort_and_validate([10, 2, 3, 1]) == ([1, 2, 3, 10], True)\", \"assert sort_and_validate([5, 3, 8, 6, 2]) == ([2, 3, 5, 6, 8], True)\", \"assert sort_and_val...
{ "split": "train", "index": 62117, "acecode_id": "evol_27702", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary that contains an expression in string format and a set of variables to evaluate that expression. Your task is to implement a function that evaluates the given expression using the provided variables and returns a dictionary with the result of the eval...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert evaluate_expression({'expression': '1 + 1', 'data': {}, 'key': 'test1'}) == {'result': 2, 'expression': '1 + 1', 'key': 'test1'}\", \"assert evaluate_expression({'expression': 'x + 1', 'data': {'x': 1}, 'key': 'test2'}) == {'result': 2, 'expression': 'x + 1'...
{ "split": "train", "index": 62118, "acecode_id": "bigcode_python_fns_26765", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function to manage different types of commands for a gaming assistant bot. The function should allow for executing commands based on their names and additional arguments. You are given a predefined list of command modules, each represented ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert execute_command('help_command') == 'Displaying game rules'\", \"assert execute_command('start_command') == 'Game started'\", \"assert execute_command('stop_command') == 'Game stopped'\", \"assert execute_command('unknown_command') == 'Command not found'\", \...
{ "split": "train", "index": 62119, "acecode_id": "oss_5914", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a JSON response object that contains the HTTP status code, a body, and optional headers. Your task is to implement a function that validates whether the JSON response meets the expected criteria: it should have the correct status code, the correct body content, an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_json_response({'status_code': 200, 'body': {'key': 'value'}, 'headers': {'Content-Type': 'application/json'}}, 200, {'key': 'value'}) == True\", \"assert validate_json_response({'status_code': 404, 'body': {'error': 'Not Found'}, 'headers': {'Conten...
{ "split": "train", "index": 62120, "acecode_id": "bigcode_python_fns_32472", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that validates a configuration setting for a plugin. The configuration setting is defined as 'plugins.md009.br_spaces', which is expected to be a non-negative integer. Your function should take a string value representing the configuratio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_br_spaces('5') == (True, '')\", \"assert validate_br_spaces('0') == (True, '')\", \"assert validate_br_spaces('10') == (True, '')\", \"assert validate_br_spaces('-1') == (False, 'The value for property \\\"plugins.md009.br_spaces\\\" is not valid: A...
{ "split": "train", "index": 62121, "acecode_id": "bigcode_python_fns_4915", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a simple message handling functionality. Your goal is to implement a function `handle_message` that takes a string `message` as an argument. The function should print 'Mensagem recebida: ' followed by the received message, and return the response ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert handle_message('Hello') == 'Resposta do servidor'\", \"assert handle_message('Test message') == 'Resposta do servidor'\", \"assert handle_message('12345') == 'Resposta do servidor'\", \"assert handle_message('') == 'Resposta do servidor'\", \"assert handle_m...
{ "split": "train", "index": 62122, "acecode_id": "oss_21797", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a string representation of a uniform distribution prior. The function should take two parameters, `a` and `b`, which represent the lower and upper bounds of the uniform distribution, respectively. The output should be in th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert uniform_prior(0, 10) == 'uniform(0, 10)'\", \"assert uniform_prior(1, 5) == 'uniform(1, 5)'\", \"assert uniform_prior(-5, 5) == 'uniform(-5, 5)'\", \"assert uniform_prior(0, 1) == 'uniform(0, 1)'\", \"assert uniform_prior(-10, 0) == 'uniform(-10, 0)'\", \"as...
{ "split": "train", "index": 62123, "acecode_id": "bigcode_python_fns_24510", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string `text` consisting of a sentence. Your task is to write a Python function that counts the number of occurrences of the word 'curso' in the given string and returns the count. The search for 'curso' should be case-sensitive and should not count occurrences ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_curso('curso curso curso') == 3\", \"assert count_curso('Curso is not the same as curso') == 1\", \"assert count_curso('No occurrences here') == 0\", \"assert count_curso('curso') == 1\", \"assert count_curso('CURSO') == 0\", \"assert count_curso('curs...
{ "split": "train", "index": 62124, "acecode_id": "oss_2571", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a starting date and two intervals, generate two lists of timestamps. The first list should contain timestamps at regular intervals of 2 hours starting from the given date, and the second list should contain timestamps at intervals of 59 minutes, also starting from the sam...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_timestamps('2000-01-01 00:00:00', 2, 11, 59, 10) == (['2000-01-01 00:00:00', '2000-01-01 02:00:00', '2000-01-01 04:00:00', '2000-01-01 06:00:00', '2000-01-01 08:00:00', '2000-01-01 10:00:00', '2000-01-01 12:00:00', '2000-01-01 14:00:00', '2000-01-01...
{ "split": "train", "index": 62125, "acecode_id": "bigcode_python_fns_35676", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a 2D array of shape (m, n) where each element is a floating-point number. Your task is to implement a function `sparsemax(z: List[List[float]]) -> List[List[float]]` that computes the sparsemax of the input array. Sparsemax is defined as the projection of a vector...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sparsemax([[1.0, 1.0], [2.0, 2.0]]) == [[1.0, 1.0], [1.0, 1.0]]\", \"assert sparsemax([[5.0, 5.0, 1.0]]) == [[1.0, 1.0, 0.0]]\", \"assert sparsemax([[3.0, 0.0], [0.0, 3.0]]) == [[1.0, 0.0], [0.0, 1.0]]\", \"assert sparsemax([[1.0, 2.0, 3.0], [3.0, 2.0, 1.0]]...
{ "split": "train", "index": 62126, "acecode_id": "bigcode_python_fns_46696", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that generates a YAML-like structure based on a set of preferences. The function should take a list of preference names and a dictionary representing the default preferences. For each preference name, if the preference exists in the defaul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_preferences(['pref_one', 'pref_two', 'pref_three'], {'pref_one': 'value1', 'pref_two': 'value2'}) == 'pref-one: value1\\\\npref-two: value2\\\\npref-three: Standard Preference'\", \"assert generate_preferences(['alpha', 'beta'], {'alpha': '1', 'gamm...
{ "split": "train", "index": 62127, "acecode_id": "bigcode_python_fns_20680", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of shapes represented by their IDs, along with a dictionary that maps each shape ID to a list of route IDs it belongs to. Your task is to create a function `get_shape_route_info(shape_ids: List[str], shape_route_map: Dict[str, List[str]]) -> Dict[str, Dict[...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_shape_route_info(['shape1', 'shape2'], {'shape1': ['routeA', 'routeB'], 'shape2': ['routeC']}) == {'shape1': {'route_count': 2, 'first_route': 'routeA'}, 'shape2': {'route_count': 1, 'first_route': 'routeC'}}\", \"assert get_shape_route_info(['shape3', '...
{ "split": "train", "index": 62128, "acecode_id": "bigcode_python_fns_35080", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes in a positive integer as an argument and returns a list of all odd numbers from 1 up to that integer (exclusive). The function should raise a ValueError if the input is not a positive integer.\nPlease reason step by step, then write a self-contai...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_odds(10) == [1, 3, 5, 7, 9]\", \"assert get_odds(1) == []\", \"assert get_odds(5) == [1, 3]\", \"assert get_odds(100) == [1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 6...
{ "split": "train", "index": 62129, "acecode_id": "evol_29287", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a global settings registration mechanism for various components in a Python application. Your goal is to create a function `manage_global_settings` that takes two arguments: a list of tuples `settings_list` and a string `component_name`. Each tu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_global_settings([('component1', {'setting1': 'value1', 'setting2': 'value2'}), ('component2', {'setting3': 'value3'})], 'component1') == {'setting1': 'value1', 'setting2': 'value2'}\", \"assert manage_global_settings([('component1', {'setting1': 'valu...
{ "split": "train", "index": 62130, "acecode_id": "oss_1348", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Write a Python function `fibonacci_primes(n)` that calculates the Fibonacci sequence up to a given integer n (where 1 <= n <= 10000). The function should filter out the prime Fibonacci numbers and return them in a sorted list without duplicates. If the input is invalid (not an ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci_primes(4) == [2, 3]\", \"assert fibonacci_primes(5) == [2, 3, 5]\", \"assert fibonacci_primes(6) == [2, 3, 5]\", \"assert fibonacci_primes(7) == [2, 3, 5]\", \"assert fibonacci_primes(8) == [2, 3, 5]\", \"assert fibonacci_primes(9) == [2, 3, 5]\", ...
{ "split": "train", "index": 62131, "acecode_id": "evol_31255", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with generating an MPI command for launching a Python script that acts as a ZMQ Connector. Write a function `build_mpi_command` that accepts the following parameters: `num_cores` (int), `script_name` (str), `host` (str), `port` (int), `last_stage` (str), `verbose...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert build_mpi_command(10, 'connector.py', 'bl121proc00', 8121, 'spotfinding', True) == 'mpirun --map-by core --bind-to core -np 10 python connector.py --host bl121proc00 --port 8121 --last_stage spotfinding --verbose'\", \"assert build_mpi_command(5, 'connector....
{ "split": "train", "index": 62132, "acecode_id": "oss_6219", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that takes a list of index sequences for different lanes in a sequencing run and extracts the lengths of these index sequences. Your function should return a dictionary where the keys are the lane numbers (starting from 1) and the values a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_index_lengths_by_lane([[\\\"AAGT\\\", \\\"CCGT\\\", \\\"TTAA\\\"], [\\\"CGTA\\\", \\\"ACGT\\\"], [\\\"GCTA\\\"]]) == {1: [4, 4, 4], 2: [4, 4], 3: [4]}\", \"assert get_index_lengths_by_lane([[\\\"AT\\\", \\\"GC\\\"], [\\\"CGAT\\\", \\\"TAGC\\\", \\\"CTAG\...
{ "split": "train", "index": 62133, "acecode_id": "oss_37704", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a directed acyclic graph (DAG) represented as a list of edges, where each edge is a tuple (u, v) indicating a directed edge from node u to node v. Your task is to implement a function `get_default_callbacks(dag: List[Tuple[int, int]]) -> Dict[int, Dict[str, str]]`...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_default_callbacks([(1, 2), (1, 3), (2, 4)]) == {1: {'on_success_callback': 'default_success', 'on_failure_callback': 'default_failure', 'on_retry_callback': 'default_retry'}, 2: {'on_success_callback': 'default_success', 'on_failure_callback': 'default_f...
{ "split": "train", "index": 62134, "acecode_id": "bigcode_python_fns_42821", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks if a given integer is a prime number. A prime number is defined as a natural number greater than 1 that has no positive divisors other than 1 and itself. Your function should take a single integer as input and return a boo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_prime(2) == True\", \"assert is_prime(3) == True\", \"assert is_prime(4) == False\", \"assert is_prime(5) == True\", \"assert is_prime(6) == False\", \"assert is_prime(7) == True\", \"assert is_prime(8) == False\", \"assert is_prime(9) == False\", \"asser...
{ "split": "train", "index": 62135, "acecode_id": "oss_31958", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists of tuples, where each tuple represents a gold annotation and a predicted annotation in the format (document_id, mention_id, token_from, token_to). Your task is to implement a function that merges these two lists based on the optimal 1:1 span matching per...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_annotations([('doc1', 'gold1', 0, 1), ('doc1', 'gold2', 2, 3)], [('doc1', 'pred1', 0, 1), ('doc1', 'pred2', 2, 3)]) == [('doc1', 'gold1', 'pred1'), ('doc1', 'gold2', 'pred2')]\", \"assert merge_annotations([('doc1', 'gold1', 0, 1), ('doc1', 'gold2', 2,...
{ "split": "train", "index": 62136, "acecode_id": "bigcode_python_fns_9360", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to create a build task for a container registry. You need to write a function `create_build_task` that takes the following parameters: `cmd` (a string representing the command to be executed), `client` (a string representing the clien...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_build_task('build', 'client1', 'task1', 'myRegistry', 'https://repo.url', ['image1', 'image2'], 'token123') == {'cmd': 'build', 'client': 'client1', 'build_task_name': 'task1', 'registry_name': 'myRegistry', 'repository_url': 'https://repo.url', 'imag...
{ "split": "train", "index": 62137, "acecode_id": "oss_10286", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function called 'transform_list' that takes a list called 'input_list' as an argument. The function should perform a map operation on the list and create a new transformed list which only includes values if they meet two key criteria: 1. The value is an integer. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transform_list([2, 3, 4, 5, 6, 7, 8]) == ([2, 3, 4, 5, 6, 7, 8], [])\", \"assert transform_list([]) == ([], [])\", \"assert transform_list([2, 4, 6, 8]) == ([2, 4, 6, 8], [])\", \"assert transform_list([10, 15, 20, 25]) == ([10, 20], [])\", \"assert transfor...
{ "split": "train", "index": 62138, "acecode_id": "evol_17497", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Write a function that takes a positive integer n and returns a list of all prime numbers less than n. Implement error handling to raise a ValueError if the input is a non-positive integer. A prime number is defined as a natural number greater than 1 that cannot be formed by mul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list_primes(10) == [2, 3, 5, 7]\", \"assert list_primes(1) == []\", \"assert list_primes(2) == []\", \"assert list_primes(3) == [2]\", \"assert list_primes(4) == [2, 3]\", \"assert list_primes(5) == [2, 3]\", \"assert list_primes(20) == [2, 3, 5, 7, 11, 13, ...
{ "split": "train", "index": 62139, "acecode_id": "evol_21345", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists of dictionaries: `regions` and `departments`. Each dictionary in `regions` contains a `code` and a `name`, while each dictionary in `departments` contains a `region_code`, `code`, and `name`. Your task is to write a function `merge_regions_and_department...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_regions_and_departments([{'code': 'R1', 'name': 'Region 1'}, {'code': 'R2', 'name': 'Region 2'}], [{'region_code': 'R1', 'code': 'D1', 'name': 'Department 1'}, {'region_code': 'R1', 'code': 'D2', 'name': 'Department 2'}, {'region_code': 'R2', 'code': '...
{ "split": "train", "index": 62140, "acecode_id": "bigcode_python_fns_42259", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given an integer representing a CPU instruction, determine if it is a valid instruction for the M68000 CPU. You are provided with a function `is_valid_instruction(instr: int) -> bool`. The function should return True if the instruction is valid, and False otherwise. Assume that...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_instruction(1) == True\", \"assert is_valid_instruction(255) == True\", \"assert is_valid_instruction(0) == False\", \"assert is_valid_instruction(256) == False\", \"assert is_valid_instruction(-1) == False\", \"assert is_valid_instruction(100) == T...
{ "split": "train", "index": 62141, "acecode_id": "bigcode_python_fns_25274", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `analyze_css_stylesheet(stylesheet: str) -> Tuple[bool, bool]` that takes a CSS stylesheet as a string and returns a tuple with two boolean values. The first boolean should indicate whether the stylesheet contains the selector rule '.h1 { color: blue; }' an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert analyze_css_stylesheet('.h1 { color: blue; }') == (True, False)\", \"assert analyze_css_stylesheet('body { margin: 0; }') == (False, False)\", \"assert analyze_css_stylesheet('.h1 { color: blue; } @media (max-width: 500px) { .h1 { color: blue; } }') == (True...
{ "split": "train", "index": 62142, "acecode_id": "evol_25648", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python decorator that logs the execution time of a function. The decorator should take a function as input, measure the execution time of the function, and return the function's result without printing anything. Your task is to complete the im...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert log_execution_time(lambda: 1 + 1)() == 2\", \"assert log_execution_time(lambda: 'Hello' + ' World')() == 'Hello World'\", \"assert log_execution_time(lambda x: x * 2)(5) == 10\", \"assert log_execution_time(lambda x, y: x + y)(3, 4) == 7\", \"assert log_exec...
{ "split": "train", "index": 62143, "acecode_id": "oss_36633", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a logging configuration function. This function, `configure_logging`, takes in three parameters: `log_filename` (a string representing the name of the log file), `log_format` (a string defining the format of the log messages), and `log_level` (an in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert configure_logging('application', '%(asctime)s - %(message)s', 20) == {'filename': 'application.log', 'format': '%(asctime)s - %(message)s', 'level': 20}\", \"assert configure_logging('error_log', '%(levelname)s: %(message)s', 40) == {'filename': 'error_log.l...
{ "split": "train", "index": 62144, "acecode_id": "bigcode_python_fns_41702", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a weighted directed graph represented as an adjacency list `alst` and a starting node represented by its coordinates `(h, w)`. Each node in the graph is represented by a tuple `(x, y)` where `x` and `y` are the coordinates of the node. The weight of an edge from n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert shortest_distance({(0, 0): {(0, 1): 1, (1, 0): 4}, (0, 1): {(1, 1): 2}, (1, 0): {(1, 1): 1}, (1, 1): {}}, 0, 0, 1, 1) == 3\", \"assert shortest_distance({(0, 0): {(1, 0): 2}, (1, 0): {(1, 1): 2}, (1, 1): {}}, 0, 0, 1, 1) == 4\", \"assert shortest_distance({(...
{ "split": "train", "index": 62145, "acecode_id": "oss_22358", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given two lists of integers, `server_fsic` and `client_fsic`, representing the instance counters of two systems, write a function `fsic_difference(server_fsic: List[int], client_fsic: List[int]) -> List[int]` that returns a list of integers representing the instance counters th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fsic_difference([1, 2, 3], [2, 3, 4]) == [4]\", \"assert fsic_difference([1, 2, 3], [1, 2, 3]) == []\", \"assert fsic_difference([], [1, 2, 3]) == [1, 2, 3]\", \"assert fsic_difference([4, 5, 6], [1, 2, 3]) == [1, 2, 3]\", \"assert fsic_difference([1, 3, 5],...
{ "split": "train", "index": 62146, "acecode_id": "bigcode_python_fns_13083", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 2D array of integers representing radar data, implement a function `plot_radar(data: List[List[int]]) -> str` that returns a string indicating whether the radar data contains any values above a certain threshold. The function should check if any integer in the 2D array ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert plot_radar([[10, 20], [30, 40]]) == 'Values are Normal'\", \"assert plot_radar([[100, 150], [30, 40]]) == 'Alert: High Value Detected'\", \"assert plot_radar([[0, 0], [0, 0]]) == 'Values are Normal'\", \"assert plot_radar([[50, 60], [70, 80]]) == 'Values are...
{ "split": "train", "index": 62147, "acecode_id": "bigcode_python_fns_3298", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that sets the logging level for multiple logger names. The function should take a list of logger names and an integer representing the logging level. It should return a list of tuples, where each tuple contains a logger name and the level...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_loggers_level(['logger1', 'logger2'], 30) == [('logger1', 30), ('logger2', 30)]\", \"assert set_loggers_level(['loggerA'], 10) == [('loggerA', 10)]\", \"assert set_loggers_level(['logger1'], 50) == [('logger1', 50)]\", \"assert set_loggers_level(['logger...
{ "split": "train", "index": 62148, "acecode_id": "bigcode_python_fns_831", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a list of integers and returns a dictionary that summarizes the count of even and odd numbers in the list. The function should take a single parameter, which is a list of integers, and return a dictionary with two keys: 'ev...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_even_odd([1, 2, 3, 4, 5]) == {'even': 2, 'odd': 3}\", \"assert count_even_odd([0, 1, 2, 3, 4]) == {'even': 3, 'odd': 2}\", \"assert count_even_odd([]) == {'even': 0, 'odd': 0}\", \"assert count_even_odd([2, 4, 6, 8]) == {'even': 4, 'odd': 0}\", \"asser...
{ "split": "train", "index": 62149, "acecode_id": "bigcode_python_fns_20922", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple calculator that can perform basic arithmetic operations: addition and subtraction. Your task is to create a function `perform_calculation` that takes three parameters: two integers `a` and `b`, and a string `operation`. The `operation` ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert perform_calculation(5, 3, 'add') == 8\", \"assert perform_calculation(10, 4, 'subtract') == 6\", \"assert perform_calculation(0, 0, 'add') == 0\", \"assert perform_calculation(7, 2, 'subtract') == 5\", \"assert perform_calculation(-1, -1, 'add') == -2\", \"a...
{ "split": "train", "index": 62150, "acecode_id": "oss_4092", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of output tensors and their corresponding types. Write a function `infer_outputs(outs: List[Value], types: List[Type]) -> Tuple[List[Value], List[Type]]` that infers the output tensors and their types. If the `outs` list is not empty, the function should re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert infer_outputs(['out1', 'out2'], ['type1', 'type2']) == (['out1', 'out2'], ['type1', 'type2'])\", \"assert infer_outputs(['tensorA'], ['float32']) == (['tensorA'], ['float32'])\", \"assert infer_outputs(['result'], ['int32']) == (['result'], ['int32'])\", \"a...
{ "split": "train", "index": 62151, "acecode_id": "bigcode_python_fns_22720", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the deletion of a group identified by a unique group_id. The function should accept two parameters: 'group_id' (a string representing the unique identifier of the group) and 'tasks' (a boolean indicating whether to dele...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert delete_group('group1', False) == 'Group deleted'\", \"assert delete_group('group1', True) == 'Group and tasks deleted'\", \"assert delete_group('group2', False) == 'Group deleted'\", \"assert delete_group('group2', True) == 'Group and tasks deleted'\", \"ass...
{ "split": "train", "index": 62152, "acecode_id": "bigcode_python_fns_31189", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of a set of buildings in a city. Your task is to write a function `max_building_height(buildings: List[int]) -> int` that returns the maximum height among the buildings. If the list is empty, return 0. The function shoul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_building_height([3, 6, 2, 8, 4]) == 8\", \"assert max_building_height([1]) == 1\", \"assert max_building_height([5, 5, 5]) == 5\", \"assert max_building_height([10, 20, 30]) == 30\", \"assert max_building_height([-3, -1, -4]) == -1\", \"assert max_buildi...
{ "split": "train", "index": 62153, "acecode_id": "bigcode_python_fns_8396", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a Python function that takes a list of dictionaries, each containing a 'name' and a 'count', and sorts the list in ascending order by 'count'. In case of a tie in 'count', sort by 'name' in alphabetical order. The function should return the sorted list of dictionaries.\n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_and_summarize([{'name': 'Alice', 'count': 5}, {'name': 'Bob', 'count': 3}, {'name': 'John', 'count': 7}, {'name': 'David', 'count': 4}, {'name': 'Chris', 'count': 5}]) == [{'name': 'Bob', 'count': 3}, {'name': 'David', 'count': 4}, {'name': 'Alice', 'co...
{ "split": "train", "index": 62154, "acecode_id": "evol_9504", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `parse_indices` that takes a string `idx_str` as input and returns a list of integers representing the indices specified in the string. The input string can contain single digits, ranges of digits separated by a hyphen, and should handle leading and trailin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_indices('2-5') == [2, 3, 4, 5]\", \"assert parse_indices('7') == [7]\", \"assert parse_indices(' 3-6 ') == [3, 4, 5, 6]\", \"assert parse_indices('10-12') == [10, 11, 12]\", \"assert parse_indices('1-1') == [1]\", \"assert parse_indices('') == []\", \"...
{ "split": "train", "index": 62155, "acecode_id": "bigcode_python_fns_22433", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that filters error codes based on a keyword present in their corresponding error messages. Write a function called `filter_error_codes` that takes two parameters: 1. `error_dict` (dict): A dictionary where the keys are error co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_error_codes({'CODE_1': 'This is okay', 'CODE_2': 'Error occurred'}, 'Error') == {'CODE_2': 'Error occurred'}\", \"assert filter_error_codes({'CODE_A': 'All good', 'CODE_B': 'Invalid input'}, 'Invalid') == {'CODE_B': 'Invalid input'}\", \"assert filter...
{ "split": "train", "index": 62156, "acecode_id": "oss_462", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that returns a specific data structure representation based on a given integer input. Your function should take an integer input called `addr_header_value` and return the corresponding string representation of the data structure. The ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_structure(4) == 'Dwarf_uint32'\", \"assert get_structure(0) == 'Unknown structure'\", \"assert get_structure(1) == 'Unknown structure'\", \"assert get_structure(2) == 'Unknown structure'\", \"assert get_structure(3) == 'Unknown structure'\", \"assert get...
{ "split": "train", "index": 62157, "acecode_id": "oss_36790", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a data structure that can be a dictionary or an object. Your task is to retrieve a property or method from it based on a given key. If the key exists in the dictionary, return the corresponding value. If the key is not found in the dictionary but exists as an attr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_attribute({'name': 'Alice', 'age': 30}, 'name') == 'Alice'\", \"assert get_attribute({'name': 'Alice', 'age': 30}, 'age') == 30\", \"assert get_attribute({'name': 'Alice'}, 'height') == None\", \"assert get_attribute({'key': 'value'}, 'key') == 'value'\"...
{ "split": "train", "index": 62158, "acecode_id": "bigcode_python_fns_46146", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a property filter specification for a given set of property specifications and object specifications. Implement a function `build_property_filter_spec(property_specs: List[str], object_specs: List[str]) -> Dict[str, List[str]]` that takes two lists ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert build_property_filter_spec(['property1', 'property2'], ['object1', 'object2']) == {'propSet': ['property1', 'property2'], 'objectSet': ['object1', 'object2']}\", \"assert build_property_filter_spec(['propA', 'propB', 'propC'], ['objX', 'objY']) == {'propSet'...
{ "split": "train", "index": 62159, "acecode_id": "bigcode_python_fns_28033", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two integers, a and b, implement a function `subtract_and_format(a: int, b: int) -> str` that subtracts b from a and returns a formatted string in the format '{b} {a} ?+1'.\nPlease reason step by step, then write a self-contained Python solution. Give your final program i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert subtract_and_format(5, 3) == '3 5 ?+1'\", \"assert subtract_and_format(10, 2) == '2 10 ?+1'\", \"assert subtract_and_format(0, 0) == '0 0 ?+1'\", \"assert subtract_and_format(-1, -1) == '-1 -1 ?+1'\", \"assert subtract_and_format(7, 4) == '4 7 ?+1'\", \"asse...
{ "split": "train", "index": 62160, "acecode_id": "bigcode_python_fns_3775", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the deployment process of a software project. The function, `deploy_project`, should take in three boolean parameters: `update`, `build`, and `restart`. Each parameter represents a step in the deployment process: `update` i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert deploy_project(True, True, True) == ['update', 'build', 'restart']\", \"assert deploy_project(True, False, True) == ['update', 'restart']\", \"assert deploy_project(False, True, True) == ['build', 'restart']\", \"assert deploy_project(True, True, False) == [...
{ "split": "train", "index": 62161, "acecode_id": "bigcode_python_fns_47912", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of records for multiple people, where each record contains a name, age, city, and profession. Implement a function `sort_people(people: List[Tuple[str, int, str, str]], sort_by: str) -> List[str]` that takes in a list of people records and a string indicati...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_people([('John', 23, 'New York', 'Engineer'), ('Crystal', 32, 'London', 'Doctor')], 'age') == ['John, 23, New York, Engineer', 'Crystal, 32, London, Doctor']\", \"assert sort_people([('Alice', 30, 'Paris', 'Artist'), ('Bob', 25, 'Berlin', 'Chef'), ('Cha...
{ "split": "train", "index": 62162, "acecode_id": "evol_32663", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string containing a series of items separated by spaces. Your task is to write a function that takes this string as input and returns a formatted string that lists the items in alphabetical order, prefixed with 'You are going to buy' and suffixed with a period. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_shopping_list('apple orange banana') == 'You are going to buy apple, banana, and orange.'\", \"assert format_shopping_list('car bike airplane') == 'You are going to buy airplane, bike, and car.'\", \"assert format_shopping_list('zebra giraffe lion') =...
{ "split": "train", "index": 62163, "acecode_id": "bigcode_python_fns_37199", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with categorizing a list of software licenses based on their type. Each license is represented as a string, and your program should identify whether the license is an OSI Approved license, a Proprietary license, or an Unknown license. Your task is to implement a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert categorize_licenses(['License :: OSI Approved :: Apache Software License', 'License :: Proprietary :: Company X License']) == {'OSI Approved': ['Apache Software License'], 'Proprietary': ['Company X License'], 'Unknown': []}\", \"assert categorize_licenses([...
{ "split": "train", "index": 62164, "acecode_id": "oss_16598", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that generates a database connection URL based on specific configuration parameters. The function should take in three parameters: `DEBUG` (a boolean indicating whether to use debug mode), `ALLOWED_HOSTS` (a list of allowed hosts),...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert configure_database(True, ['example.com'], False) == 'sqlite:///path/to/db.sqlite3'\", \"assert configure_database(False, ['example.com'], True) == 'mysql://user:password@host/db_name'\", \"assert configure_database(False, ['example.com'], False) == 'postgres...
{ "split": "train", "index": 62165, "acecode_id": "oss_22727", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple environment management function in Python. Your task is to implement a function `manage_environment` that takes three parameters: `action`, `env_dict`, and `clear`. The `action` parameter can be one of three strings: 'set', 'get', or 'c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_environment('set', {'key1': 'value1', 'key2': 'value2'}, False) is None\", \"assert manage_environment('clear', None, False) is None\", \"assert manage_environment('get', None, False) == None\", \"assert manage_environment('set', {'key3': 'value3'}, F...
{ "split": "train", "index": 62166, "acecode_id": "oss_15248", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python setup script for a statistical analysis package named 'weibull'. The setup script should include the necessary metadata for packaging the Weibull package for distribution via PyPI. You need to define a function `create_setup_script()` which...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_setup_script() == {'name': 'weibull', 'version': '1.0.0', 'description': 'Weibull analysis and test design for reliability and life applications', 'long_description': 'Weibull analysis and test design for reliability and life applications', 'author': ...
{ "split": "train", "index": 62167, "acecode_id": "oss_22283", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the compilation process of a given LLVM assembly file into JavaScript code. The function should take a string representing the input LLVM assembly code and return a string representing the compiled JavaScript output. The fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compile_llvm_to_js('define void @main() { return; }') == 'function void @main() { return; }'\", \"assert compile_llvm_to_js('global i32 @x') == 'var i32 @x'\", \"assert compile_llvm_to_js('declare void @foo()') == 'let void @foo()'\", \"assert compile_llvm_t...
{ "split": "train", "index": 62168, "acecode_id": "bigcode_python_fns_40491", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that takes a string of space-separated integers and returns a sorted list of those integers. The integers in the input string will always be valid and can be positive or negative. Implement the function `load_numbers_sorted(txt: str) -> Li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert load_numbers_sorted('3 1 2') == [1, 2, 3]\", \"assert load_numbers_sorted('5 -1 2 0') == [-1, 0, 2, 5]\", \"assert load_numbers_sorted('10 20 30') == [10, 20, 30]\", \"assert load_numbers_sorted('-5 -10 -1') == [-10, -5, -1]\", \"assert load_numbers_sorted('...
{ "split": "train", "index": 62169, "acecode_id": "bigcode_python_fns_18661", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a square matrix of integers. Your task is to rotate the matrix 90 degrees clockwise. Implement a function `rotate_matrix(matrix)` that takes a square matrix as input and returns a new matrix that is rotated 90 degrees clockwise. The input matrix will have dimensio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rotate_matrix([[1]]) == [[1]]\", \"assert rotate_matrix([[1, 2], [3, 4]]) == [[3, 1], [4, 2]]\", \"assert rotate_matrix([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == [[7, 4, 1], [8, 5, 2], [9, 6, 3]]\", \"assert rotate_matrix([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11,...
{ "split": "train", "index": 62170, "acecode_id": "oss_29719", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that removes all occurrences of a specified value from a given list of integers. Your function should take two parameters: a list of integers and an integer value to be removed. The function should return a new list that contains all ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_value([1, 2, 3, 4, 5], 3) == [1, 2, 4, 5]\", \"assert remove_value([1, 2, 2, 2, 3], 2) == [1, 3]\", \"assert remove_value([5, 5, 5], 5) == []\", \"assert remove_value([], 1) == []\", \"assert remove_value([1, 2, 3], 4) == [1, 2, 3]\", \"assert remove_...
{ "split": "train", "index": 62171, "acecode_id": "oss_11555", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `first_n_primes(n: int) -> List[int]` that returns the first `n` prime numbers. A prime number is a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. If `n` is less than or equal to 0, return an empty list.\nPlease ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert first_n_primes(0) == []\", \"assert first_n_primes(1) == [2]\", \"assert first_n_primes(2) == [2, 3]\", \"assert first_n_primes(3) == [2, 3, 5]\", \"assert first_n_primes(4) == [2, 3, 5, 7]\", \"assert first_n_primes(5) == [2, 3, 5, 7, 11]\", \"assert first_...
{ "split": "train", "index": 62172, "acecode_id": "evol_34616", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `create_user(username: str, password: str) -> User` that creates a new user in the system with the given username and password. The username must be unique and at least 3 characters long. If the username is already taken or is less than 3 characters long, r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_user('testuser', 'testpassword').username == 'testuser'\", \"assert isinstance(create_user('newuser', 'mypassword'), User)\", \"assert create_user('anotheruser', 'anotherpassword').password == 'anotherpassword'\", \"assert create_user('anotheruser', '...
{ "split": "train", "index": 62173, "acecode_id": "evol_26045", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Design a Python function that takes in a list of JSON strings representing messages from a data stream, processes and filters the data based on predefined conditions, and returns a list of filtered JSON strings. The filtering conditions should be specified as a function that wi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_data(['{\\\"value\\\": 10}', '{\\\"value\\\": 20}', '{\\\"value\\\": 30}'], lambda x: x['value'] > 15) == ['{\\\"value\\\": 20}', '{\\\"value\\\": 30}']\", \"assert filter_data(['{\\\"value\\\": 5}', '{\\\"value\\\": 15}', '{\\\"value\\\": 25}'], lamb...
{ "split": "train", "index": 62174, "acecode_id": "evol_15264", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 2D list of integers representing a grayscale image, where each integer value corresponds to the brightness level of a pixel (0 for black and 255 for white), write a function `adjust_brightness(image: List[List[int]], magnitude: float) -> List[List[int]]` that increases ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert adjust_brightness([[0]], 50.0) == [[50]]\", \"assert adjust_brightness([[200]], 100.0) == [[255]]\", \"assert adjust_brightness([[0, 0], [0, 0]], 20.0) == [[20, 20], [20, 20]]\", \"assert adjust_brightness([[255]], 10.0) == [[255]]\", \"assert adjust_brightn...
{ "split": "train", "index": 62175, "acecode_id": "bigcode_python_fns_28676", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a mask for a given list of images. The function should accept the following parameters: a list of images (input), a static signal value (static_sig), a group identifier (group), and a boolean indicating whether to edit para...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_mask(['image1.png', 'image2.png'], 4.0, 'group1', False) == {'static_sig': 4.0, 'group': 'group1', 'input': ['image1.png', 'image2.png'], 'updatewcs': False}\", \"assert create_mask(['image3.jpg'], 5.0, 'group2', True) == {'static_sig': 5.0, 'group': ...
{ "split": "train", "index": 62176, "acecode_id": "bigcode_python_fns_1055", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to calculate the adjusted reward for a list of vehicles based on their lane changing behavior. You are given the following inputs: a list of vehicle IDs, a list representing the last time each vehicle changed lanes, and the current ti...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_adjusted_reward([1, 2, 3], [0, 1, 2], 1, 5) == 4\", \"assert calculate_adjusted_reward([1, 2], [2, 2], 1, 7) == 7\", \"assert calculate_adjusted_reward([1, 2, 3], [2, 3, 4], 5, 5) == 5\", \"assert calculate_adjusted_reward([], [], 0, 10) == 10\", \...
{ "split": "train", "index": 62177, "acecode_id": "oss_30486", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a list of tuples representing experiment results, where each tuple contains a data point and a dictionary of scores. Your task is to create a function that generates a list of alpha values based on a specified range and denominator. The alpha values should be calc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_alpha_values([], 0, 10, 1) == [0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0]\", \"assert generate_alpha_values([], 0, 0, 1) == []\", \"assert generate_alpha_values([], 5, 10, 1) == [5.0, 6.0, 7.0, 8.0, 9.0]\", \"assert generate_alpha_values([], ...
{ "split": "train", "index": 62178, "acecode_id": "bigcode_python_fns_2153", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Write a function `replicate_sentence(sentence: str, number: int) -> str` that takes a sentence as a string and a numerical digit. The function should return a new string where each word in the original sentence is repeated `number` times, preserving the original order of the wo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert replicate_sentence('Hello world', 2) == 'Hello Hello world world'\", \"assert replicate_sentence('This is a test', 3) == 'This This This is is is a a a test test test'\", \"assert replicate_sentence('LeetCode is fun', 1) == 'LeetCode is fun'\", \"assert repl...
{ "split": "train", "index": 62179, "acecode_id": "evol_26928", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `convert_megabytes_to_bytes(megabytes: float, is_binary: bool) -> int` that takes two parameters: `megabytes`, a floating-point number representing the amount of megabytes, and `is_binary`, a boolean indicating whether to use binary (True) or decimal (False...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_megabytes_to_bytes(1, False) == 1000000\", \"assert convert_megabytes_to_bytes(1, True) == 1048576\", \"assert convert_megabytes_to_bytes(0, False) == 0\", \"assert convert_megabytes_to_bytes(0, True) == 0\", \"assert convert_megabytes_to_bytes(500, ...
{ "split": "train", "index": 62180, "acecode_id": "evol_26024", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a file upload process. The function should accept a file name and a list of errors. If the file upload fails (indicated by an error), the function should return a string that summarizes the failure status and the errors...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert upload_status('mycharm.charm', [('missing-stuff', 'text 1'), ('broken', 'other long error text')]) == 'Upload failed with status 400:\\\\n- missing-stuff: text 1\\\\n- broken: other long error text'\", \"assert upload_status('testfile.txt', [('invalid-format...
{ "split": "train", "index": 62181, "acecode_id": "bigcode_python_fns_35992", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that generates full search URLs based on a given base search URL and a list of search queries. The function should take a list of search queries as input and return a list of complete search URLs by appending each search query to the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_search_urls(['python programming', 'data science', 'machine learning']) == ['https://www.example.com/search?q=python%20programming', 'https://www.example.com/search?q=data%20science', 'https://www.example.com/search?q=machine%20learning']\", \"asser...
{ "split": "train", "index": 62182, "acecode_id": "oss_28244", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a vote counting program for a local election. The program should take a list of tuples, where each tuple contains a voter ID, county, and candidate name. Your goal is to calculate the total number of votes cast, as well as the number of votes each c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_votes([('1', 'County1', 'Khan'), ('2', 'County1', 'Correy'), ('3', 'County2', 'Li')]) == (3, 1, 1, 1)\", \"assert count_votes([('1', 'County1', 'Khan'), ('2', 'County1', 'Khan'), ('3', 'County2', 'Li'), ('4', 'County3', 'Correy'), ('5', 'County1', 'Kha...
{ "split": "train", "index": 62183, "acecode_id": "oss_36227", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of words in a vocabulary and a string of text, your task is to implement a function that encodes the text into a weighted representation based on the vocabulary. The function should return a list of integers representing the counts of each word from the vocabulary ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert encode_text_to_counts(['apple', 'banana', 'orange'], 'I like apple and banana') == [1, 1, 0]\", \"assert encode_text_to_counts(['dog', 'cat', 'mouse'], 'The dog chased the cat') == [1, 1, 0]\", \"assert encode_text_to_counts(['car', 'bike', 'bus'], 'I prefer...
{ "split": "train", "index": 62184, "acecode_id": "bigcode_python_fns_841", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given an integer list 'l'. Write a function `median(l)` that calculates the median of the list. If the list is empty, the function should raise a ValueError indicating that the input list must contain at least one element. The median is defined as follows: if the list h...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert median([3, 1, 2, 4, 5]) == 3\", \"assert median([1]) == 1\", \"assert median([1, 2]) == 1.5\", \"assert median([1, 3, 5]) == 3\", \"assert median([1, 2, 3, 4]) == 2.5\", \"assert median([7, 8, 9, 10, 11]) == 9\", \"assert median([1, 2, 3, 4, 5, 6]) == 3.5\",...
{ "split": "train", "index": 62185, "acecode_id": "evol_17676", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that validates a Digital Object Identifier (DOI). A DOI is a unique alphanumeric string assigned to identify digital objects such as academic papers, datasets, and other research materials. The function should take a string as inpu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_doi('10.1234/abc.5678') == True\", \"assert validate_doi('10.5678/def.1234') == True\", \"assert validate_doi('10.0000/ghi.jklm') == True\", \"assert validate_doi('10.12345/abc_1234') == True\", \"assert validate_doi('10.1234567/xyz-7890') == True\"...
{ "split": "train", "index": 62186, "acecode_id": "oss_34764", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a rational number represented as a fraction \\( x = \\frac{p}{q} \\) where \\( 0 < x < \\frac{1}{100} \\) and the denominator \\( q \\) does not exceed \\( 10^8 \\), determine if the number is ambiguous. A rational number is considered ambiguous if there exists at least o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_ambiguous(1, 10) == False\", \"assert is_ambiguous(1, 20) == False\", \"assert is_ambiguous(2, 7) == False\", \"assert is_ambiguous(1, 25) == False\", \"assert is_ambiguous(7, 50) == False\", \"assert is_ambiguous(3, 20) == False\", \"assert is_ambiguous(...
{ "split": "train", "index": 62187, "acecode_id": "evol_130", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates sending a simple email message. The function should take the following parameters: `from_address` (a string representing the sender's email address), `to_address` (a string representing the recipient's email address)...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert send_email('from@example.com', 'to@example.com', 'Hello, this is a test email!') == 'Email sent from from@example.com to to@example.com with message: Hello, this is a test email!'\", \"assert send_email('alice@example.com', 'bob@example.com', 'Meeting at 10 ...
{ "split": "train", "index": 62188, "acecode_id": "oss_10282", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two ranges defined by their start and end values, determine the overlapping range between the two. A range is defined as a list or tuple of two float values, where the first value is the start of the range and the second value is the end of the range. If the two ranges do...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert getOverlapRange((1.0, 5.0), (4.0, 6.0)) == [4.0, 5.0]\", \"assert getOverlapRange((1.0, 5.0), (5.0, 10.0)) == []\", \"assert getOverlapRange((1.0, 10.0), (3.0, 7.0)) == [3.0, 7.0]\", \"assert getOverlapRange((0.0, 2.0), (1.0, 3.0)) == [1.0, 2.0]\", \"assert ...
{ "split": "train", "index": 62189, "acecode_id": "bigcode_python_fns_40358", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to simulate a simple animation effect by returning the sequence of positions where an image would be blitted on the screen. The function should take a scale factor and a list of coordinates as input, and return a list of tuples repres...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert animate_positions(2, [(0, 0), (10, 10), (20, 20)]) == [(0, 0), (20, 20), (40, 40)]\", \"assert animate_positions(1, [(5, 5), (15, 15)]) == [(5, 5), (15, 15)]\", \"assert animate_positions(0, [(1, 1), (2, 2)]) == [(0, 0), (0, 0)]\", \"assert animate_positions...
{ "split": "train", "index": 62190, "acecode_id": "oss_35657", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `feature_list_pattern_features(pattern_name: str, file: str = '', type_: str = '') -> List[str]` that returns a list of features associated with a given pattern name. The function should take three parameters: `pattern_name` (a string representing the name ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert feature_list_pattern_features('pattern1', 'file1', 'type1') == ['feature1', 'feature2']\", \"assert feature_list_pattern_features('pattern1', 'file2', 'type1') == ['feature3']\", \"assert feature_list_pattern_features('pattern2', 'file1', 'type2') == []\", \...
{ "split": "train", "index": 62191, "acecode_id": "bigcode_python_fns_19947", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks if a circular queue is full based on its current size and maximum size. A circular queue follows the FIFO (First In First Out) principle and has a fixed size. The function should take two parameters: 'size', which indicate...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_full(0, 5) == False\", \"assert is_full(3, 5) == False\", \"assert is_full(5, 5) == True\", \"assert is_full(5, 10) == False\", \"assert is_full(7, 7) == True\", \"assert is_full(1, 1) == True\", \"assert is_full(0, 0) == True\", \"assert is_full(2, 2) ==...
{ "split": "train", "index": 62192, "acecode_id": "oss_469", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that returns the length of the longest increasing subsequence within the list. The subsequence must consist of elements from the original list and should maintain their relative order. For example, in the list [10, 22, 9, 33, 21, 5...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longest_increasing_subsequence([10, 22, 9, 33, 21, 50, 41, 60]) == 5\", \"assert longest_increasing_subsequence([3, 10, 2, 1, 20]) == 3\", \"assert longest_increasing_subsequence([10, 9, 8, 7]) == 1\", \"assert longest_increasing_subsequence([1, 3, 6, 7, 9, ...
{ "split": "train", "index": 62193, "acecode_id": "evol_239", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a distance matrix representing the distances between several cities, where the entry at (i, j) indicates the distance from city i to city j. Your task is to implement a function that finds a permutation of the cities that produces the least total distance for a ro...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert solve_tsp_local_search([[0, 10, 15, 20], [10, 0, 35, 25], [15, 35, 0, 30], [20, 25, 30, 0]]) == ([0, 1, 3, 2], 80)\", \"assert solve_tsp_local_search([[0, 1, 2], [1, 0, 1], [2, 1, 0]]) == ([0, 1, 2], 4)\", \"assert solve_tsp_local_search([[0, 2], [2, 0]]) ==...
{ "split": "train", "index": 62194, "acecode_id": "bigcode_python_fns_12085", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a list of decimal numbers, write a function `validate_decimal_length` that checks if the length of the list is exactly 6. The function should return True if the length is 6, otherwise return False. You may assume that the input list contains only decimal numbers.\nPlease ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_decimal_length([1.1, 2.2, 3.3, 4.4, 5.5, 6.6]) == True\", \"assert validate_decimal_length([1.1, 2.2, 3.3, 4.4, 5.5]) == False\", \"assert validate_decimal_length([1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7]) == False\", \"assert validate_decimal_length([]) ...
{ "split": "train", "index": 62195, "acecode_id": "bigcode_python_fns_5345", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that determines if a given list of integers contains any duplicate values. Your function should take a list of integers as input and return a boolean value. Return `True` if there are any duplicates in the list, and return `False` oth...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert contains_duplicates([1, 2, 3, 4]) == False\", \"assert contains_duplicates([1, 2, 3, 4, 1]) == True\", \"assert contains_duplicates([0, 0, 0, 0]) == True\", \"assert contains_duplicates([]) == False\", \"assert contains_duplicates([-1, -2, -3, -4]) == False\...
{ "split": "train", "index": 62196, "acecode_id": "oss_33426", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings, where each string represents a document. Your task is to concatenate these documents into a single string, but with a restriction: you must insert a newline character before every document. Additionally, after concatenating the documents, if the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert concatenate_documents(['doc1', 'doc2', 'doc3'], 50) == '\\\\ndoc1\\\\ndoc2\\\\ndoc3'\", \"assert concatenate_documents(['Hello', 'World'], 15) == '\\\\nHello\\\\nWorld'\", \"assert concatenate_documents(['first', 'second', 'third'], 25) == '\\\\nfirst\\\\nse...
{ "split": "train", "index": 62197, "acecode_id": "bigcode_python_fns_19634", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks the status of a game response from a server. The function should take two inputs: a game ID (a string) and a response (a dictionary). The response dictionary contains a 'result' key that maps to another dictionary. If the '@c'...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_response('game1', {'result': {'@c': 'ultshared.rpc.UltSwitchServerException', 'newHostName': 'gamehost.com'}}) == 'Updating Host'\", \"assert check_response('game2', {'result': {'@c': 'ultshared.rpc.UltSwitchServerException'}}) == 'Game Ended'\", \"ass...
{ "split": "train", "index": 62198, "acecode_id": "bigcode_python_fns_35044", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a dictionary containing latitude and longitude values as strings, write a function that checks if the latitude and longitude are valid floating-point numbers. The function should return a new dictionary with the latitude and longitude converted to floats if they are valid...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_input({'lat': '34.0522', 'lng': '-118.2437'}) == {'lat': 34.0522, 'lng': -118.2437}\", \"assert check_input({'lat': '40.7128', 'lng': '-74.0060'}) == {'lat': 40.7128, 'lng': -74.006}\", \"assert check_input({'lat': '51.5074', 'lng': '-0.1278'}) == {'la...
{ "split": "train", "index": 62199, "acecode_id": "bigcode_python_fns_31509", "num_tests": 12 }