data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "Given a string 'text', implement a function `build_suffix_array(text: str) -> List[int]` that builds the suffix array of the string and returns a list of integers. Each integer in the returned list should represent the starting index of the lexicographically smallest suffix of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert build_suffix_array('banana') == [5, 3, 1, 0, 4, 2]\", \"assert build_suffix_array('a') == [0]\", \"assert build_suffix_array('abc') == [0, 1, 2]\", \"assert build_suffix_array('aaa') == [2, 1, 0]\", \"assert build_suffix_array('xyz') == [0, 1, 2]\"]}"
} | {
"split": "train",
"index": 75000,
"acecode_id": "bigcode_python_fns_43448",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a configuration for setting up a Network File System (NFS) share. The function should take the following parameters: a string 'cluster' representing the cluster name, a string 'svm_name' for the Storage Virtual Machine (SVM... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_nfs_payload('cluster1', 'SVM1', 'ExportPolicy1', 'nfs', '0.0.0.0/0', 'Volume1', 1024) == {'nfs_service': {'enabled': True, 'protocol': {'v3_enabled': True}, 'svm': {'name': 'SVM1'}}, 'export_policy': {'name': 'ExportPolicy1', 'rules': [{'clients': [{'... | {
"split": "train",
"index": 75001,
"acecode_id": "bigcode_python_fns_18935",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function that generates the first n numbers in the Fibonacci sequence. The function should take a single integer input n (0-indexed) and return a list containing the first n Fibonacci numbers. The Fibonacci sequence is defined as follows: the first two numbers are 0... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fib(0) == []\", \"assert fib(1) == [0]\", \"assert fib(2) == [0, 1]\", \"assert fib(3) == [0, 1, 1]\", \"assert fib(4) == [0, 1, 1, 2]\", \"assert fib(5) == [0, 1, 1, 2, 3]\", \"assert fib(6) == [0, 1, 1, 2, 3, 5]\", \"assert fib(7) == [0, 1, 1, 2, 3, 5, 8]\... | {
"split": "train",
"index": 75002,
"acecode_id": "evol_17928",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an integer array `flowers` representing the beauty values of flowers arranged in a line. A valid garden must have at least two flowers, with the first and last flowers having the same beauty value, and no two consecutive flowers should have the same beauty value. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_beauty([100,1,1,-3,1]) == 2\", \"assert max_beauty([1,1,2,1,1]) == 2\", \"assert max_beauty([1]) == 0\", \"assert max_beauty([5,4,5]) == 10\", \"assert max_beauty([0,0,0,0]) == 0\"]}"
} | {
"split": "train",
"index": 75003,
"acecode_id": "evol_32201",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary that represents a key-value store where keys are strings and values can be either strings or JSON strings. Your task is to implement a function `fetch_value(key: str, store: Dict[str, Any]) -> Any` that retrieves the value associated with the given ke... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fetch_value('key1', {'key1': 'value1'}) == 'value1'\", \"assert fetch_value('key2', {'key1': 'value1', 'key2': '{\\\"a\\\": 1, \\\"b\\\": 2}'}) == {'a': 1, 'b': 2}\", \"assert fetch_value('key4', {}) == 'Key not found'\", \"assert fetch_value('key5', {'key5'... | {
"split": "train",
"index": 75004,
"acecode_id": "oss_25926",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a Python function that computes the sum of all integers in a given list. The function should take a list of integers as input and return the total sum. You must use a recursive approach to solve this problem. For example, given the list [1, 3, 7, 9, 11], the function ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rec_sum([]) == 0\", \"assert rec_sum([1]) == 1\", \"assert rec_sum([1, 2]) == 3\", \"assert rec_sum([1, 2, 3]) == 6\", \"assert rec_sum([1, 2, 3, 4]) == 10\", \"assert rec_sum([5, 5, 5, 5]) == 20\", \"assert rec_sum([-1, -2, -3]) == -6\", \"assert rec_sum([0... | {
"split": "train",
"index": 75005,
"acecode_id": "evol_35034",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of glyph names and their corresponding ink status, implement a function `has_ink(glyphs: List[str], ink_status: List[bool], glyph_name: str) -> bool` that checks if the specified glyph has any ink. A glyph has ink if its corresponding status in the `ink_status` lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_ink(['a', 'b', 'c'], [True, False, True], 'b') == False\", \"assert has_ink(['x', 'y', 'z'], [False, True, False], 'y') == True\", \"assert has_ink(['m', 'n', 'o'], [False, False, False], 'm') == False\", \"assert has_ink(['p', 'q', 'r'], [True, True, Fa... | {
"split": "train",
"index": 75006,
"acecode_id": "bigcode_python_fns_4821",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "In a simplified version of a prisoner's dilemma game, you need to implement a function that determines a player's choice based on the history of previous moves and the current round count. The function should take in a 2D list representing the moves of two players (where 0 repr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert make_choice([[1, 0], [1, 1]], 2) == 1\", \"assert make_choice([[1, 1], [1, 1]], 0) == 1\", \"assert make_choice([[0, 1], [0, 1]], 1) == 0\", \"assert make_choice([[1, 0], [0, 0]], 1) == 0\", \"assert make_choice([[1, 1], [1, 0]], 2) == 0\", \"assert make_cho... | {
"split": "train",
"index": 75007,
"acecode_id": "oss_1351",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a filename that starts with a letter denoting a dataset (A, Q, I, S, H, E), and an integer representing the desired sampling frequency. Your task is to return a dictionary that contains the dataset name, the processed sampling frequency, and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_data('A_data', 250) == {'dataset': 'A', 'fs_resampled': 250, 'labels': ['Label1', 'Label2']}\", \"assert process_data('Q_results', 300) == {'dataset': 'Q', 'fs_resampled': 300, 'labels': ['Label3', 'Label4']}\", \"assert process_data('I_test', 150) =... | {
"split": "train",
"index": 75008,
"acecode_id": "bigcode_python_fns_21945",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a non-negative integer `num`, write a function `bcd7(num)` that converts `num` into a Binary-Coded Decimal (BCD) representation using the least significant 4 bits of `num`. The function should return a list of 4 boolean values representing the BCD digits, where each boole... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bcd7(0) == [False, False, False, False]\", \"assert bcd7(1) == [True, False, False, False]\", \"assert bcd7(2) == [False, True, False, False]\", \"assert bcd7(3) == [True, True, False, False]\", \"assert bcd7(4) == [False, False, True, False]\", \"assert bcd... | {
"split": "train",
"index": 75009,
"acecode_id": "bigcode_python_fns_45646",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing button labels. Your task is to create a function that returns a dictionary where each button label is a key and its corresponding value is the number of times that label appears in the list. Implement the function `count_button_label... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_button_labels(['Start', 'Stop', 'Start', 'Reset']) == {'Start': 2, 'Stop': 1, 'Reset': 1}\", \"assert count_button_labels(['OK', 'Cancel', 'OK', 'OK']) == {'OK': 3, 'Cancel': 1}\", \"assert count_button_labels(['Button1', 'Button2', 'Button1', 'Button3... | {
"split": "train",
"index": 75010,
"acecode_id": "bigcode_python_fns_33483",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that manages a set of metrics for a machine learning model. The function should provide two capabilities: clearing all metrics from the set and deleting a specific metric from the set. You will implement a function named `manage_metri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_metrics([('add', 'metric1'), ('add', 'metric2'), ('clear', None)]) == set()\", \"assert manage_metrics([('add', 'metric1'), ('delete', 'metric1')]) == set()\", \"assert manage_metrics([('add', 'metric1'), ('add', 'metric2'), ('delete', 'metric1')]) ==... | {
"split": "train",
"index": 75011,
"acecode_id": "oss_31938",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `s`, write a function that determines if the string contains any of the forbidden substrings: \"ab\", \"cd\", \"pq\", or \"xy\". The function should return `True` if any of these substrings are found in the string; otherwise, return `False`. Your function should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_forbidden('abcde') == True\", \"assert has_forbidden('abcdef') == True\", \"assert has_forbidden('hello world') == False\", \"assert has_forbidden('xy') == True\", \"assert has_forbidden('pq') == True\", \"assert has_forbidden('a') == False\", \"assert h... | {
"split": "train",
"index": 75012,
"acecode_id": "bigcode_python_fns_40497",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a score submission for a course. The function should take a dictionary as input with the following keys: 'points_possible', 'points_earned', 'anonymous_user_id', 'course_id', 'item_id', and 'created_at'. The function should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_score_submission({'points_possible': 100, 'points_earned': 80, 'anonymous_user_id': 'user1', 'course_id': 'course1', 'item_id': 'item1', 'created_at': '2023-10-01'}) == {'weighted_earned': 80, 'weighted_possible': 100, 'user_id': hash('user1'), 'anon... | {
"split": "train",
"index": 75013,
"acecode_id": "bigcode_python_fns_14231",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two integers n and m, write a function that computes the binomial coefficient C(n, m), which is defined as the number of ways to choose m elements from a set of n elements. The binomial coefficient is calculated using the formula C(n, m) = n! / (m! * (n - m)!). Your funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binomial_coefficient(5, 2) == 10\", \"assert binomial_coefficient(10, 0) == 1\", \"assert binomial_coefficient(6, 3) == 20\", \"assert binomial_coefficient(0, 0) == 1\", \"assert binomial_coefficient(7, 5) == 21\", \"assert binomial_coefficient(8, 4) == 70\"... | {
"split": "train",
"index": 75014,
"acecode_id": "bigcode_python_fns_41198",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating an election by counting votes for multiple candidates. Write a function `election_results(votes: List[str]) -> Tuple[Dict[str, int], str]` that takes a list of votes where each element is a string representing the name of a candidate. The function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert election_results(['Alice', 'Bob', 'Alice']) == ({'Alice': 2, 'Bob': 1}, 'Alice')\", \"assert election_results(['Alice', 'Bob', 'Charlie', 'Bob', 'Alice']) == ({'Alice': 2, 'Bob': 2, 'Charlie': 1}, 'Tie')\", \"assert election_results(['Alice']) == ({'Alice': ... | {
"split": "train",
"index": 75015,
"acecode_id": "oss_15365",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the parsing of VT100 cursor movement commands from a string input. The function should take a string containing a series of cursor movement commands and return a list of tuples, where each tuple contains the command and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_vt100_commands('UP 3 DOWN 2 LEFT 1 RIGHT 4') == [('UP', 3), ('DOWN', 2), ('LEFT', 1), ('RIGHT', 4)]\", \"assert parse_vt100_commands('UP 5') == [('UP', 5)]\", \"assert parse_vt100_commands('DOWN') == [('DOWN', 1)]\", \"assert parse_vt100_commands('LEFT... | {
"split": "train",
"index": 75016,
"acecode_id": "bigcode_python_fns_5343",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a new OpenStack session using provided authentication information. The function should take two parameters: 'unscoped' (a string representing an unscoped token) and 'project' (a string representing the project ID). Your fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_os_session('token123', 'project456') == 'Session created successfully'\", \"assert create_os_session('tokenXYZ', '') == 'Invalid parameters'\", \"assert create_os_session('', 'project789') == 'Invalid parameters'\", \"assert create_os_session('', '') ... | {
"split": "train",
"index": 75017,
"acecode_id": "bigcode_python_fns_8042",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `same_chars(s1: str, s2: str) -> bool` that determines whether two string inputs contain exactly the same types and number of characters, ignoring case differences and punctuation. The function should return `True` if the strings are equivalent in this manner, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert same_chars('EabcD', 'DD!ddddDabc') == False\", \"assert same_chars('Abcd', 'DDDd!dddAbcE') == False\", \"assert same_chars('E!abcD!zzzz', '!dDDzzzzzZzddddd!abc!') == False\", \"assert same_chars('Hello, World!', 'world! hello') == True\", \"assert same_chars... | {
"split": "train",
"index": 75018,
"acecode_id": "evol_19751",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that formats a content mention. The function should take a dictionary or keyword arguments representing content information and return a formatted string. The content information can include a title, a URL, and an optional content ID. If ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_content_mention(title='Example Title', url='http://example.com') == 'Title: Example Title, URL: http://example.com'\", \"assert format_content_mention(title='Example Title', url='http://example.com', content_id='123') == 'Title: Example Title, URL: ht... | {
"split": "train",
"index": 75019,
"acecode_id": "bigcode_python_fns_29282",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two numbers, `input_value` and `output_value`, implement a function `get_return_nb(input_value: float, output_value: float) -> float` that calculates the return on investment based on the formula: (output_value - input_value) / input_value. If `input_value` is zero, retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_return_nb(0, 0) == 0.0\", \"assert get_return_nb(0, 5) == float('inf')\", \"assert get_return_nb(0, -5) == float('-inf')\", \"assert get_return_nb(100, 200) == 1.0\", \"assert get_return_nb(100, 0) == -1.0\", \"assert get_return_nb(100, 100) == 0.0\", \"... | {
"split": "train",
"index": 75020,
"acecode_id": "bigcode_python_fns_10160",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of song titles and a location string. Your task is to write a function that creates a CSV file containing the song titles. Each song title should be written in a new line in the CSV file. The function should ensure that the CSV file is created at the specif... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_song_csv(['song1', 'song2'], './') == 2\", \"assert create_song_csv(['song1'], './') == 1\", \"assert create_song_csv([], './') == 0\", \"assert create_song_csv(['song1', 'song2', 'song3'], './') == 3\", \"assert create_song_csv(['a', 'b', 'c'], './')... | {
"split": "train",
"index": 75021,
"acecode_id": "bigcode_python_fns_34697",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two matrices represented as lists of lists, `A` and `B`, where each matrix has dimensions `m x n`. Your task is to implement a function that calculates the matrix product of `A` and `B`. The function should return the resulting matrix as a list of lists. Note that... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert matrix_product([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\", \"assert matrix_product([[1]], [[2]]) == [[2]]\", \"assert matrix_product([[1, 2, 3]], [[4], [5], [6]]) == [[32]]\", \"assert matrix_product([[1, 0], [0, 1]], [[1, 1], [1, 1]]) == ... | {
"split": "train",
"index": 75022,
"acecode_id": "bigcode_python_fns_23326",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the ratings of a dish from various users. Your task is to implement a function that calculates the average rating of the dish. The average rating should be rounded to two decimal places. If there are no ratings, the average rating s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_rating([5, 4, 3, 2, 1]) == 3.00\", \"assert average_rating([5, 5, 5]) == 5.00\", \"assert average_rating([3]) == 3.00\", \"assert average_rating([2, 2, 2, 2]) == 2.00\", \"assert average_rating([]) == 0.00\", \"assert average_rating([1, 1, 1, 1, 1]) ... | {
"split": "train",
"index": 75023,
"acecode_id": "bigcode_python_fns_40877",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `find_max_product` that takes in this list and returns the maximum product that can be obtained by multiplying any two distinct integers from the list. If the list has fewer than two integers, the function should return 0.\nPlease reas... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max_product([1, 2, 3, 4]) == 12\", \"assert find_max_product([1, 2, -3, 4]) == 8\", \"assert find_max_product([5]) == 0\", \"assert find_max_product([-1, 2]) == -2\", \"assert find_max_product([-5, -1, 0, 2]) == 5\", \"assert find_max_product([3, 7, 1, ... | {
"split": "train",
"index": 75024,
"acecode_id": "bigcode_python_fns_28832",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves the details of a bundle product given its unique identifier. The function should take an integer parameter 'id', which represents the bundle ID. The function will return a dictionary containing the title of the bundle, the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert retrieve_bundle_details(1) == {'title': 'Sample Bundle', 'bundle_id': 1, 'bundle_products': ['Product A', 'Product B', 'Product C'], 'stocks': ['Stock A', 'Stock B', 'Stock C']}\", \"assert retrieve_bundle_details(2) == {'title': 'Sample Bundle', 'bundle_id'... | {
"split": "train",
"index": 75025,
"acecode_id": "bigcode_python_fns_18876",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes an integer n as input and returns a list of all prime numbers up to and including n. A prime number is a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. For example, the first few prime numbers are 2, 3... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_primes(2) == [2]\", \"assert generate_primes(3) == [2, 3]\", \"assert generate_primes(4) == [2, 3]\", \"assert generate_primes(5) == [2, 3, 5]\", \"assert generate_primes(10) == [2, 3, 5, 7]\", \"assert generate_primes(15) == [2, 3, 5, 7, 11, 13]\",... | {
"split": "train",
"index": 75026,
"acecode_id": "evol_402",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates writing data to a file. Your function should take three parameters: a string representing the directory path, a string representing the file name, and the data to be written, which can be of any data type. The function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert write_data_to_file('/home/user/', 'data.txt', 'Hello, World!') == 'Data written to /home/user/data.txt'\", \"assert write_data_to_file('/temp/', 'test.json', {'key': 'value'}) == 'Data written to /temp/test.json'\", \"assert write_data_to_file('/documents/',... | {
"split": "train",
"index": 75027,
"acecode_id": "bigcode_python_fns_5855",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dataset represented as a list of dictionaries, where each dictionary contains information about different variables in the dataset. Each dictionary has two keys: 'variable' which is a string representing the name of the variable, and 'value' which is a numeric v... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_dataset([{'variable': 'a', 'value': 10}, {'variable': 'b', 'value': 20}, {'variable': 'a', 'value': 5}], 'a', 10) == [{'variable': 'a', 'value': 5}]\", \"assert filter_dataset([{'variable': 'x', 'value': 1}, {'variable': 'y', 'value': 2}, {'variable':... | {
"split": "train",
"index": 75028,
"acecode_id": "bigcode_python_fns_37052",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `count_unique_keys(d: dict) -> int` that takes a dictionary `d` and returns the number of unique keys in the dictionary, including keys found in any nested dictionaries. If a key appears in multiple levels of nesting, it should only be counted once. Assume that... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_keys({'a': 1, 'b': 2, 'c': {'d': 3, 'e': 4}}) == 5\", \"assert count_unique_keys({'a': 1, 'b': 2, 'a': 3, 'c': {'d': 4, 'b': 5}}) == 4\", \"assert count_unique_keys({'key1': {'key2': {'key3': 1}}, 'key4': 2}) == 4\", \"assert count_unique_keys({... | {
"split": "train",
"index": 75029,
"acecode_id": "evol_4305",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that generates JSON data for Minecraft item textures based on a given stamp value. The function should take a string input `stamp` and return a JSON string that follows the structure: {\"parent\": \"item/generated\", \"textures\": ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_item_json('example_stamp') == '{\\\"parent\\\": \\\"item/generated\\\", \\\"textures\\\": {\\\"layer0\\\": \\\"emberstic:items/stamp_example_stamp\\\"}}'\", \"assert generate_item_json('test_stamp') == '{\\\"parent\\\": \\\"item/generated\\\", \\\"t... | {
"split": "train",
"index": 75030,
"acecode_id": "oss_26571",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two strings, implement a function that calculates the Levenshtein edit distance between them. The Levenshtein distance is defined as the minimum number of single-character edits (insertions, deletions, or substitutions) required to change one string into the other.\nPleas... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert levenshtein_distance('SUPER', 'SPHERE') == 3\", \"assert levenshtein_distance('kitten', 'sitting') == 3\", \"assert levenshtein_distance('flaw', 'lawn') == 2\", \"assert levenshtein_distance('intention', 'execution') == 5\", \"assert levenshtein_distance('ab... | {
"split": "train",
"index": 75031,
"acecode_id": "evol_27580",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary containing metadata information about a software package and a list of specific criteria. Your task is to write a function `extract_metadata` that extracts the details from the metadata based on the criteria provided. The metadata dictionary may conta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_metadata({'description': 'Library', 'url': 'http://example.com', 'license': 'MIT'}, ['description', 'url']) == {'description': 'Library', 'url': 'http://example.com'}\", \"assert extract_metadata({'description': 'Library', 'url': 'http://example.com'... | {
"split": "train",
"index": 75032,
"acecode_id": "oss_5008",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string composed solely of four distinct characters: 'Q', 'W', 'E', and 'R'. A string is considered balanced if each character appears exactly n/4 times, where n is the length of the string. Your task is to implement a function that determines the smallest possib... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert balancedString('QWER') == 0\", \"assert balancedString('QQWE') == 1\", \"assert balancedString('QQQW') == 2\", \"assert balancedString('QQQQ') == 3\", \"assert balancedString('RQQQEW') == 2\", \"assert balancedString('QQRRWWEE') == 0\", \"assert balancedStri... | {
"split": "train",
"index": 75033,
"acecode_id": "evol_28634",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing temperatures recorded over a period of time. Your task is to write a function that returns the number of days until a warmer temperature for each day in the list. If there is no future day that is warmer, return 0 for that day. The ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dailyTemperatures([73, 74, 75, 71, 69, 72, 76, 73]) == [1, 1, 4, 2, 1, 1, 0, 0]\", \"assert dailyTemperatures([30, 40, 50, 60]) == [1, 1, 1, 0]\", \"assert dailyTemperatures([30, 60, 90]) == [1, 1, 0]\", \"assert dailyTemperatures([10, 20, 30, 20, 10]) == [1... | {
"split": "train",
"index": 75034,
"acecode_id": "bigcode_python_fns_37276",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing package data containing specific fields. Your task is to implement a function `extract_pkg_info` that takes a dictionary `pkg_data` as input and retrieves the values associated with the keys 'name' and 'maintainer_email'. The function sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_pkg_info({'name': 'PackageA', 'maintainer_email': 'maintainerA@example.com'}) == ('PackageA', 'maintainerA@example.com')\", \"assert extract_pkg_info({'name': 'PackageB', 'maintainer_email': 'maintainerB@example.com'}) == ('PackageB', 'maintainerB@ex... | {
"split": "train",
"index": 75035,
"acecode_id": "oss_22967",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "A number is termed as devoid of eleven if its decimal representation lacks any subsequence that signifies a power of 11, with the exception of 1. For instance, 2404 and 13431 are devoid of eleven, whereas 911 and 4121331 are not. Your task is to implement a function `find_nth(n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_nth(1) == 1\", \"assert find_nth(2) == 2\", \"assert find_nth(3) == 3\", \"assert find_nth(4) == 4\", \"assert find_nth(5) == 5\", \"assert find_nth(6) == 6\", \"assert find_nth(7) == 7\", \"assert find_nth(8) == 8\", \"assert find_nth(9) == 9\", \"asse... | {
"split": "train",
"index": 75036,
"acecode_id": "evol_21517",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that updates storage group attributes based on a provided JSON object. The function `update_storage_group_attributes(json_data)` should take a JSON object `json_data` as input and update three attributes: `State`, `Health`, and `Healt... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_storage_group_attributes({'State': 'online', 'Health': 'OK', 'HealthRollup': 'OK'}) == ('online', 'OK', 'OK')\", \"assert update_storage_group_attributes({'State': 'offline'}) == ('offline', '', '')\", \"assert update_storage_group_attributes({'Health... | {
"split": "train",
"index": 75037,
"acecode_id": "oss_15103",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with determining whether various objects can fit inside a box based on its dimensions. The box is defined by its width and height. The longest diagonal of the box can be calculated using the Pythagorean theorem. Given the dimensions of the box and a list of objec... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fits_in_box(5, 12, [13, 10, 8, 14]) == ['DA', 'DA', 'DA', 'NE']\", \"assert fits_in_box(1, 1, [1, 2]) == ['DA', 'NE']\", \"assert fits_in_box(10, 24, [25, 20, 15, 30]) == ['DA', 'DA', 'DA', 'NE']\", \"assert fits_in_box(2, 2, [3, 2]) == ['NE', 'DA']\", \"ass... | {
"split": "train",
"index": 75038,
"acecode_id": "oss_7483",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of collections, each represented as a dictionary with the following keys: 'code', 'is_active', 'friendly_name'. You are also given a list of permissions, where each permission is represented as a dictionary with the following keys: 'user', 'collection_code'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_active_permissions('user1', [{'code': 'A1', 'is_active': True, 'friendly_name': 'Active Collection 1'}, {'code': 'A2', 'is_active': False, 'friendly_name': 'Inactive Collection 1'}], [{'user': 'user1', 'collection_code': 'A1', 'registrant': True, 'catalo... | {
"split": "train",
"index": 75039,
"acecode_id": "bigcode_python_fns_10790",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes player statistics for a game similar to Apex Legends. The function should take in a list of player statistics dictionaries and return a list of players who have achieved a rank higher than a specified threshold. The functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_high_rank_players([{'playerName': 'Player1', 'CurrentRank': 'Gold', 'CurrentRankScore': 1500}, {'playerName': 'Player2', 'CurrentRank': 'Silver', 'CurrentRankScore': 1200}, {'playerName': 'Player3', 'CurrentRank': 'Platinum', 'CurrentRankScore': 1800}... | {
"split": "train",
"index": 75040,
"acecode_id": "bigcode_python_fns_4971",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing the name of a domain table. Your task is to write a function `get_domain_id_field(domain_table: str) -> str` that generates the corresponding ID field name by appending '_id' to the provided domain table name. For example, if the input is 'us... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_domain_id_field('user') == 'user_id'\", \"assert get_domain_id_field('product') == 'product_id'\", \"assert get_domain_id_field('order') == 'order_id'\", \"assert get_domain_id_field('customer') == 'customer_id'\", \"assert get_domain_id_field('transacti... | {
"split": "train",
"index": 75041,
"acecode_id": "bigcode_python_fns_42066",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a module path and a boolean flag indicating whether to perform a dry run. Your task is to implement a function `load_and_run(module: str, dry_run: bool) -> str` that simulates loading a module by returning a message. If `dry_run` is `True`, t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert load_and_run('my_module', True) == 'Dry run: Ready to load module my_module'\", \"assert load_and_run('test_module', False) == 'Module test_module loaded successfully.'\", \"assert load_and_run('example_module', True) == 'Dry run: Ready to load module exampl... | {
"split": "train",
"index": 75042,
"acecode_id": "bigcode_python_fns_15489",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of tuples where each tuple contains a person's name and their designated unit, write a function `get_units` that returns a dictionary mapping each unit to a list of names associated with that unit. The input list will contain names and their corresponding units. If... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_units([('Sarah', 'X'), ('Tom', 'Y'), ('Lucy', 'Y')]) == {'X': ['Sarah'], 'Y': ['Tom', 'Lucy']}\", \"assert get_units([('Alice', 'A'), ('Bob', 'B'), ('Charlie', 'A')]) == {'A': ['Alice', 'Charlie'], 'B': ['Bob']}\", \"assert get_units([('David', 'C'), ('E... | {
"split": "train",
"index": 75043,
"acecode_id": "evol_5781",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given three distinct strings s1, s2, and s3, write a function `findLongestMutualSubsequence(s1: str, s2: str, s3: str) -> int` that returns the length of the longest common subsequence that can be found among these three strings.\nPlease reason step by step, then write a self-c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert findLongestMutualSubsequence('abc', 'ac', 'abc') == 2\", \"assert findLongestMutualSubsequence('hello', 'world', 'hold') == 1\", \"assert findLongestMutualSubsequence('xyz', 'xyz', 'xyz') == 3\", \"assert findLongestMutualSubsequence('a', 'b', 'c') == 0\", \... | {
"split": "train",
"index": 75044,
"acecode_id": "evol_9932",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the prices of items in a store. Write a function `find_item_pair(prices: List[int], target: int) -> List[int]` that finds two distinct indices of items such that their prices add up to a given target. If such a pair exists, return t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_item_pair([2, 7, 11, 15], 9) == [0, 1]\", \"assert find_item_pair([3, 2, 4], 6) == [1, 2]\", \"assert find_item_pair([1, 1, 1, 1], 2) == [0, 1]\", \"assert find_item_pair([5, 5, 5, 5], 10) == [0, 1]\", \"assert find_item_pair([0, 4, 3, 0], 0) == [0, 3]\... | {
"split": "train",
"index": 75045,
"acecode_id": "bigcode_python_fns_38307",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that creates a new node in a directed graph. Each node has a name, a location, and comments. The node should also maintain a list of previous nodes and next nodes that it is connected to. Your function should take the following parame... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_node('Node1', 'Location1', 'This is a comment') == {'name': 'Node1', 'location': 'Location1', 'comments': 'This is a comment', 'previous_nodes': [], 'next_nodes': []}\", \"assert create_node('Node2', 'Location2', 'Another comment') == {'name': 'Node2'... | {
"split": "train",
"index": 75046,
"acecode_id": "bigcode_python_fns_3343",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function to divide a list into n sections with equal sums. The function should take a list of integers and an integer n, and return a list of lists where each sub-list represents a section with an equal sum. If it is not possible to divide the list into n sections with... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert divide_list([1, 1, 1, 1], 2) == [[1, 1], [1, 1]]\", \"assert divide_list([5, 5, 5, 5], 4) == [[5], [5], [5], [5]]\", \"assert divide_list([3, 3, 3, 3, 3, 3], 2) == [[3, 3, 3], [3, 3, 3]]\", \"assert divide_list([12, 12, 12, 12, 12, 12], 6) == [[12], [12], [1... | {
"split": "train",
"index": 75047,
"acecode_id": "evol_9562",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given two directed graphs represented as adjacency lists. Each graph can have multiple nodes and edges. Your task is to determine if there is any path from the acceptance states in the first graph (CoreStateMachine) to the initial state in the second graph (PostConditio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert detect_forward({0: [1], 1: [2], 2: []}, {0: [1, 2], 1: []}) == False\", \"assert detect_forward({0: [1]}, {0: [2], 2: [3]}) == False\", \"assert detect_forward({0: []}, {0: [1]}) == False\", \"assert detect_forward({0: [1]}, {0: []}) == False\", \"assert det... | {
"split": "train",
"index": 75048,
"acecode_id": "bigcode_python_fns_17017",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a list of flows affecting a population in three compartments: susceptible (S), infected (I), and recovered (R). Each flow has a specific rate and affects specific compartments. Implement a function `calculate_flow_rates` that takes in the initial population distri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_flow_rates({'S': 1000, 'I': 0, 'R': 0}, [('infection', 0.1, 'S', 'I'), ('recovery', 0.1, 'I', 'R')]) == [-100, 100, 0]\", \"assert calculate_flow_rates({'S': 300, 'I': 100, 'R': 600}, [('vaccination', 0.05, 'S', 'R'), ('death', 0.15, 'I', 'I')]) ==... | {
"split": "train",
"index": 75049,
"acecode_id": "bigcode_python_fns_4605",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple decorator function that allows you to tag other functions with a specified HTTP method and path. Implement a function `create_decorator(method: str, path: str) -> Callable` that takes in a string `method` (representing the HTTP method, e.g.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_decorator('GET', '/home')(lambda: 'Hello World').__method__ == 'GET'\", \"assert create_decorator('POST', '/submit')(lambda: 'Data Submitted').__route__ == '/submit'\", \"assert create_decorator('PUT', '/update')(lambda: 'Data Updated').__method__ == ... | {
"split": "train",
"index": 75050,
"acecode_id": "bigcode_python_fns_7139",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a recursive function `calc_factorial(x)` that computes the factorial of a non-negative integer `x`. The function should handle the following conditions: if `x` is negative, it should return an error message 'Error: Cannot compute factorial for negative numbers'. If `x... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calc_factorial(0) == 1\", \"assert calc_factorial(1) == 1\", \"assert calc_factorial(2) == 2\", \"assert calc_factorial(3) == 6\", \"assert calc_factorial(4) == 24\", \"assert calc_factorial(5) == 120\", \"assert calc_factorial(6) == 720\", \"assert calc_fac... | {
"split": "train",
"index": 75051,
"acecode_id": "evol_17700",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `median(l: List[int], cmp_func: Callable[[int, int], int]) -> float` that calculates the median of a list of integers `l` using a custom comparison function `cmp_func`. The function should raise a `ValueError` if the list is empty. The comparison function s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert median([1, 2, 3], lambda x, y: x - y) == 2.0\", \"assert median([1, 2, 3, 4], lambda x, y: x - y) == 2.5\", \"assert median([5, 3, 1, 4, 2], lambda x, y: x - y) == 3.0\", \"assert median([7, 8, 9, 10, 11, 12], lambda x, y: x - y) == 9.5\", \"assert median([1... | {
"split": "train",
"index": 75052,
"acecode_id": "evol_9294",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of bars in a histogram. Your task is to implement a function that calculates the maximum area of a rectangle that can be formed by using these bars as the height. The width of each bar is 1. You need to write a function ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_histogram_area([2, 1, 5, 6, 2, 3]) == 10\", \"assert max_histogram_area([1, 1, 1, 1]) == 4\", \"assert max_histogram_area([0, 2, 0]) == 2\", \"assert max_histogram_area([1, 2, 3, 4, 5]) == 9\", \"assert max_histogram_area([5, 4, 3, 2, 1]) == 9\", \"asser... | {
"split": "train",
"index": 75053,
"acecode_id": "bigcode_python_fns_22777",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a string and a number of characters N, write a function that returns a list of strings where each string is a substring of the original string of width N. If the last substring is shorter than N, it should be included as it is. The function should handle cases where N is ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert print_n_chars_str('Hello World!', 10) == ['Hello Worl', 'd!']\", \"assert print_n_chars_str('Python Programming', 5) == ['Pytho', 'n Pro', 'gramm', 'ing']\", \"assert print_n_chars_str('LeetCode', 8) == ['LeetCode']\", \"assert print_n_chars_str('AI Assistan... | {
"split": "train",
"index": 75054,
"acecode_id": "evol_11679",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function `check_dict_case(dct)` that takes a dictionary `dct` as an argument and identifies if all keys in the dictionary are either completely lower case, completely upper case, or start with a numeric digit. The function should return 'Lower' if all keys are in lo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_dict_case({'a': 'apple', 'b': 'banana'}) == 'Lower'\", \"assert check_dict_case({'A': 'apple', 'B': 'banana'}) == 'Upper'\", \"assert check_dict_case({'1': 'apple', '2': 'banana'}) == 'Number'\", \"assert check_dict_case({'a': 'apple', 'B': 'banana'}) ... | {
"split": "train",
"index": 75055,
"acecode_id": "evol_34204",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing the heights of buildings, write a function `max_water_trapped(heights)` that calculates the maximum amount of water that can be trapped between the buildings after a rain. The function should return the total volume of water trapped. The in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_water_trapped([0,1,0,2,1,0,1,3,2,1,2,1]) == 6\", \"assert max_water_trapped([4,2,0,3,2,5]) == 9\", \"assert max_water_trapped([1,0,2]) == 1\", \"assert max_water_trapped([2,0,2]) == 2\", \"assert max_water_trapped([3,0,0,2,0,4]) == 10\", \"assert max_wat... | {
"split": "train",
"index": 75056,
"acecode_id": "bigcode_python_fns_40825",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing book titles from a list. Write a function called `process_titles` that takes a list of book titles as input and returns a new list where each title is transformed to uppercase. Your function should handle the case where the input list is empty by ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_titles(['book one', 'book two']) == ['BOOK ONE', 'BOOK TWO']\", \"assert process_titles(['harry potter', 'the hobbit']) == ['HARRY POTTER', 'THE HOBBIT']\", \"assert process_titles([]) == []\", \"assert process_titles(['']) == ['']\", \"assert proces... | {
"split": "train",
"index": 75057,
"acecode_id": "oss_791",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that modifies a given format string based on a specified size. The function should take two parameters: a format string `fmt` and an integer `size`. If the `size` is equal to 4, the function should return the format string unchanged. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert modify_format_string('i', 4) == 'i'\", \"assert modify_format_string('f', 4) == 'f'\", \"assert modify_format_string('i', 5) == 'q'\", \"assert modify_format_string('f', 5) == 'd'\", \"assert modify_format_string('if', 5) == 'qd'\", \"assert modify_format_st... | {
"split": "train",
"index": 75058,
"acecode_id": "bigcode_python_fns_40447",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that parses a given string representing a YAML configuration. Your function should handle any parsing errors that may occur. If the parsing is successful, the function should return the parsed configuration as a Python dictionary. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_yaml_string('key: value') == {'key': 'value'}\", \"assert parse_yaml_string('a: 1\\\\nb: 2') == {'a': 1, 'b': 2}\", \"assert parse_yaml_string('list:\\\\n - item1\\\\n - item2') == {'list': ['item1', 'item2']}\", \"assert parse_yaml_string('nested:\\... | {
"split": "train",
"index": 75059,
"acecode_id": "oss_6185",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a nested array that contains elements which can either be strings of alphanumeric characters or other nested arrays. Your task is to write a function that takes this nested array as input and returns the string element with the maximum length found in the entire s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max_length_word(['a', 'ab', 'abc', ['abcd', 'abcde', 'abcdef']]) == 'abcdef'\", \"assert find_max_length_word([['short', 'tiny'], 'longerthanany', ['evenlongerthanlong']]) == 'evenlongerthanlong'\", \"assert find_max_length_word(['cat', ['dog', 'elephan... | {
"split": "train",
"index": 75060,
"acecode_id": "evol_32731",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with analyzing a collection of occurrences associated with a specific image. Each occurrence is represented as a string that details an event related to the image. Your function should take an image name and a list of occurrences, and return a dictionary containi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_image_occurrences('image1', ['event1', 'event2', 'event1']) == {'event1': 2, 'event2': 1}\", \"assert analyze_image_occurrences('image2', ['error', 'warning', 'error']) == {'error': 2, 'warning': 1}\", \"assert analyze_image_occurrences('image3', ['s... | {
"split": "train",
"index": 75061,
"acecode_id": "bigcode_python_fns_49276",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a two-dimensional (2D) array of numeric elements, write a function that identifies all values that exceed 100 and occur with the highest frequency. The function should return a dictionary where each key is a number that exceeds 100, and the corresponding value is a list o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert most_frequent_over_100([[90, 95, 100], [101, 102, 103], [104, 105, 106]]) == {101: [(1, 0)], 102: [(1, 1)], 103: [(1, 2)], 104: [(2, 0)], 105: [(2, 1)], 106: [(2, 2)]}\", \"assert most_frequent_over_100([[50, 60, 70], [80, 90, 100], [200, 200, 200]]) == {200... | {
"split": "train",
"index": 75062,
"acecode_id": "evol_31303",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a function `close_resources(log_handler: Any, db: Any) -> None` that takes two parameters: `log_handler`, which represents an object responsible for logging operations, and `db`, which represents an object responsible for managing a database connection. The function s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert close_resources(MockLogHandler(), MockDBDriver()) is None\", \"assert close_resources(MockLogHandler(), MockDBDriver()) is None\", \"assert close_resources(MockLogHandler(), MockDBDriver()) is None\", \"assert close_resources(MockLogHandler(), MockDBDriver()... | {
"split": "train",
"index": 75063,
"acecode_id": "bigcode_python_fns_45010",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a directed acyclic graph represented by nodes and directed edges. Your task is to determine if a specific node is reachable from another node in the graph after optionally reversing the direction of a single edge. You need to implement a function `is_reachable_aft... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_reachable_after_reverse(5, [[1, 2], [2, 3], [3, 4], [4, 5]], (3, 4), 1, 5) == True\", \"assert is_reachable_after_reverse(4, [[1, 2], [2, 3], [3, 4]], (2, 3), 1, 4) == True\", \"assert is_reachable_after_reverse(4, [[1, 2], [2, 3], [3, 4]], (1, 2), 1, 4) ... | {
"split": "train",
"index": 75064,
"acecode_id": "oss_7995",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary that maps locking levels to lists of locks. Your task is to implement a function `find_lock_names(locks: dict) -> dict` that finds and returns a mapping of lock names to their corresponding entity names. If the list of locks for a given level is 'ALL_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_lock_names({'LEVEL_NODE': ['lock1', 'lock2']}) == {'node/uuid1': 'lock1', 'node/uuid2': 'lock2'}\", \"assert find_lock_names({'LEVEL_NODE': 'ALL_SET'}) == {'node/[lockset]': 'joint node lock'}\", \"assert find_lock_names({'LEVEL_NODE': []}) == {}\", \"a... | {
"split": "train",
"index": 75065,
"acecode_id": "bigcode_python_fns_18945",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `sort_and_transform_even_indices(l: list) -> list` that generates a new list. This new list should preserve the elements at the odd indices from the original list. At the even indices, it should take the corresponding elements from the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_and_transform_even_indices([1, 2, 3]) == [1, 2, 9]\", \"assert sort_and_transform_even_indices([5, 6, 3, 4, 8, 9, 2]) == [4, 6, 9, 4, 25, 9, 64]\", \"assert sort_and_transform_even_indices([0]) == [0]\", \"assert sort_and_transform_even_indices([1, 3, 5... | {
"split": "train",
"index": 75066,
"acecode_id": "evol_5577",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks if a user can successfully withdraw a specified amount from their wallet based on the current balance. The function should validate that the withdrawal amount is positive and does not exceed the available balance. If the w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_and_process_withdrawal(100.00, 50.00) == 50.00\", \"assert validate_and_process_withdrawal(100.00, 0) == 'Withdrawal amount must be greater than zero.'\", \"assert validate_and_process_withdrawal(100.00, -10.00) == 'Withdrawal amount must be greater... | {
"split": "train",
"index": 75067,
"acecode_id": "oss_5648",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `divide_array(arr)` that divides the list into two equal halves. If the list has an odd number of elements, the left half should contain one less element than the right half. The function should return a tuple containing the two ha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert divide_array([1, 2, 3, 4, 5]) == ([1, 2], [3, 4, 5])\", \"assert divide_array([10]) == ([], [10])\", \"assert divide_array([5, 6, 7, 8, 9, 10, 11]) == ([5, 6, 7], [8, 9, 10, 11])\", \"assert divide_array([]) == ([], [])\", \"assert divide_array([1]) == ([], ... | {
"split": "train",
"index": 75068,
"acecode_id": "evol_14014",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with converting a given integer or hexadecimal string representation into a bytes representation of a specified size. Implement a function `convert_to_bytes(value: Union[int, str], size: int) -> bytes` where: \n\n- `value`: This parameter can be either an integer... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_bytes(0, 1) == b'\\\\x00'\", \"assert convert_to_bytes(255, 2) == b'\\\\x00\\\\xff'\", \"assert convert_to_bytes('0x1f', 1) == b'\\\\x1f'\", \"assert convert_to_bytes('0x1a', 1) == b'\\\\x1a'\", \"assert convert_to_bytes(4096, 4) == b'\\\\x00\\\\x... | {
"split": "train",
"index": 75069,
"acecode_id": "bigcode_python_fns_34169",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple database table. The table will have fields with different data types, and your function should allow for adding records, retrieving all records, and filtering records based on a specific field. Implement the functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert database_operations([('name', str), ('age', int)], [{'name': 'Alice', 'age': 25}], 'name', 'Alice') == [{'name': 'Alice', 'age': 25}]\", \"assert database_operations([('name', str), ('age', int)], [{'name': 'Bob', 'age': 30}], 'age', 30) == [{'name': 'Bob', ... | {
"split": "train",
"index": 75070,
"acecode_id": "oss_3251",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the source IDs of glosses. Your task is to check if each source ID corresponds to a valid gloss ID (i.e., the ID is a positive integer). Implement a function `validate_gloss_ids(gloss_ids: List[int]) -> List[str]` that takes in a li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_gloss_ids([1, 2, 3]) == ['Valid', 'Valid', 'Valid']\", \"assert validate_gloss_ids([0, -1, -5]) == ['Invalid', 'Invalid', 'Invalid']\", \"assert validate_gloss_ids([-10, 10, 15]) == ['Invalid', 'Valid', 'Valid']\", \"assert validate_gloss_ids([5, 0,... | {
"split": "train",
"index": 75071,
"acecode_id": "bigcode_python_fns_37177",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes two strings as input and returns the longest common substring between them. If there are multiple substrings of the same maximum length, return the first one found. If there are no common substrings, return an empty string.\nPlease reason step... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longest_common_substring('abcdxyz', 'xyzabcd') == 'abcd'\", \"assert longest_common_substring('abcdefg', 'bcde') == 'bcde'\", \"assert longest_common_substring('12345', '34567') == '345'\", \"assert longest_common_substring('a', 'a') == 'a'\", \"assert longe... | {
"split": "train",
"index": 75072,
"acecode_id": "evol_17796",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the scores of a game. Your task is to write a function that calculates the average score of the game, excluding the highest and lowest scores. Write a function `calculate_average_score(scores)` that takes in a list of integers `scor... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_score([8, 6, 7, 5, 3, 0, 9]) == 6\", \"assert calculate_average_score([1, 2, 3, 4]) == 2\", \"assert calculate_average_score([10, 20, 30, 40, 50]) == 30\", \"assert calculate_average_score([5, 5, 5, 5]) == 5\", \"assert calculate_average_sc... | {
"split": "train",
"index": 75073,
"acecode_id": "oss_2945",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to aggregate markers and perform specific actions based on the aggregated data. The function takes in a list of previously processed markers and returns a tuple containing three elements: a dictionary of unique markers with their coun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_markers(['A', 'B', 'A', 'C', 'B', 'A', 'D']) == ({'A': 3, 'B': 2, 'C': 1, 'D': 1}, ['A', 'B', 'C', 'D'], {'A': 'process', 'B': 'ignore', 'C': 'ignore', 'D': 'ignore'})\", \"assert process_markers(['A', 'A', 'A']) == ({'A': 3}, ['A'], {'A': 'process'}... | {
"split": "train",
"index": 75074,
"acecode_id": "oss_16891",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of Track objects, where each Track object has a method `toDataframe()` that returns a dictionary representation of the track with keys 'frame' and 'id'. Implement the function `tracks_to_dataframe(tracks)` that takes a list of these Track objects and return... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert tracks_to_dataframe([]) == []\", \"assert tracks_to_dataframe([Track(1, 2), Track(0, 1)]) == [{'frame': 0, 'id': 1}, {'frame': 1, 'id': 2}]\", \"assert tracks_to_dataframe([Track(1, 2), Track(1, 1)]) == [{'frame': 1, 'id': 1}, {'frame': 1, 'id': 2}]\", \"ass... | {
"split": "train",
"index": 75075,
"acecode_id": "bigcode_python_fns_9314",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two dictionaries, `base_config` and `user_config`, both containing string keys and values. The problem is to determine the value associated with a given `tool_name` and `config_key` from the `user_config`, which may override the corresponding value in the `base_co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_tool_config({'pylint': '--base-flag'}, {'pylint': '--user-override'}, 'pylint', 'unknown_key') == None\", \"assert get_tool_config({'pylint': '--base-flag'}, {'pylint': '--user-override'}, 'unknown_tool', 'flags') == None\", \"assert get_tool_config({}, ... | {
"split": "train",
"index": 75076,
"acecode_id": "bigcode_python_fns_25732",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given a square matrix T representing the transition probabilities of opinions among N individuals and an initial belief vector P0 of size N, write a function that calculates the number of iterations it takes for the opinions to converge within a specified tolerance. The opinion... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert time_to_convergence([[1.0, 0.0], [0.0, 1.0]], [0.5, 0.5], 0.01) == 1\", \"assert time_to_convergence([[1.0, 0.0], [0.0, 1.0]], [1.0, 0.0], 0.01) == 1\", \"assert time_to_convergence([[0.5, 0.5], [0.5, 0.5]], [0.5, 0.5], 0.01) == 1\", \"assert time_to_converg... | {
"split": "train",
"index": 75077,
"acecode_id": "bigcode_python_fns_25929",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of log streams and returns a list of dictionaries containing log stream names and their last event timestamps. Each log stream is represented as a dictionary with the keys 'logStreamName' and 'lastEventTimestamp' (in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_log_streams_with_last_event([{'logStreamName': 'streamA', 'lastEventTimestamp': 1609459200000}]) == [{'logStreamName': 'streamA', 'lastEventTimestamp': datetime(2021, 1, 1, 0, 0)}]\", \"assert get_log_streams_with_last_event([]) == []\", \"assert get_log... | {
"split": "train",
"index": 75078,
"acecode_id": "oss_5414",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given two collections, a subset and a superset, determine if all elements in the subset are present in the superset and have the same value. The subset can be a dictionary, list, or set, and the superset can be a dictionary, list, or set as well. If the subset is a dictionary, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_equal_subset({'a': 1}, {'a': 1, 'b': 2}) == True\", \"assert is_equal_subset({'a': 1}, {'a': 2, 'b': 2}) == False\", \"assert is_equal_subset({'a': 1, 'b': 2}, {'a': 1, 'b': 2, 'c': 3}) == True\", \"assert is_equal_subset({'a': 1}, {'b': 2}) == False\", \... | {
"split": "train",
"index": 75079,
"acecode_id": "bigcode_python_fns_34402",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a collection of models. Each model has a unique identifier and a name. The function should take a list of tuples as input, where each tuple contains an identifier and a name for a model. The function should return a lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_model_names([(1, 'Model A'), (2, 'Model B'), (3, 'Model C')]) == ['Model A', 'Model B', 'Model C']\", \"assert get_model_names([(10, 'Model X'), (20, 'Model Y')]) == ['Model X', 'Model Y']\", \"assert get_model_names([(5, 'Alpha'), (6, 'Beta'), (7, 'Gamm... | {
"split": "train",
"index": 75080,
"acecode_id": "oss_32074",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a text and two words, implement a function that extracts the substring that exists between these two words. If the specified words do not exist or if there is no substring between them, return an empty string. Additionally, if the extracted substring is a palindrome, prin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_substring('function', 'sentence', 'This function extracts a sample sentence.') == 'extracts a sample'\", \"assert extract_substring('This', 'sentence', 'This function extracts a sample sentence.') == 'function extracts a sample'\", \"assert extract_s... | {
"split": "train",
"index": 75081,
"acecode_id": "evol_34355",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a linked list represented by an array where each element corresponds to the value of a node in the list. Implement a function `next_greater(node_vals)` that returns an array of integers `answer` such that `answer[i]` is the first value greater than `node_vals[i]` ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert next_greater([2,1,5]) == [5,5,0]\", \"assert next_greater([2,7,4,3,5]) == [7,0,5,5,0]\", \"assert next_greater([1,7,5,1,9,2,5,1]) == [7,9,9,9,0,5,0,0]\", \"assert next_greater([]) == []\", \"assert next_greater([3,3,3]) == [0,0,0]\", \"assert next_greater([1... | {
"split": "train",
"index": 75082,
"acecode_id": "evol_36115",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function `login_user(username: str, password: str) -> str` that simulates a login operation. The function receives a username and a password as input and checks if the provided credentials match a predefined set of valid users. If the login is successful, return a s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert login_user('user1', 'password1') == 'Login successful for user1'\", \"assert login_user('user2', 'password2') == 'Login successful for user2'\", \"assert login_user('user3', 'password3') == 'Login successful for user3'\", \"assert login_user('user1', 'wrongp... | {
"split": "train",
"index": 75083,
"acecode_id": "bigcode_python_fns_28755",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing an authentication configuration for a registry. The dictionary may contain various keys representing different registries, and each key maps to its respective authentication data. Implement a function `get_auth_data(authconfig: Dict[str, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_auth_data({'default_registry': 'auth_data'}, 'default_registry') == 'auth_data'\", \"assert get_auth_data({'default_registry': 'auth_data'}, None) == 'auth_data'\", \"assert get_auth_data({'registry1': 'data1', 'registry2': 'data2'}, 'registry1') == 'dat... | {
"split": "train",
"index": 75084,
"acecode_id": "bigcode_python_fns_32675",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary `areaDic` that contains the sales data for different areas. Each key in the dictionary represents an area name, and the corresponding value is a tuple containing two integers: the number of sales and the total amount of money spent in that area. Your ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_sales({'Area1': (10, 5000), 'Area2': (5, 2500), 'Area3': (0, 0)}) == {'Area1': 500.0, 'Area2': 500.0}\", \"assert calculate_average_sales({'AreaA': (0, 0), 'AreaB': (0, 0)}) == {}\", \"assert calculate_average_sales({'Area1': (1, 100), 'Are... | {
"split": "train",
"index": 75085,
"acecode_id": "oss_3103",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D list representing a matrix, where each inner list is a row of the matrix. Your task is to write a function `check_matrix_properties(matrix: List[List[float]]) -> bool` that checks whether the given matrix has the following properties: 1. The matrix is not emp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_matrix_properties([[1, -1], [1, 1]]) == False\", \"assert check_matrix_properties([[0.1, 0.1], [0.1, 0.1]]) == False\", \"assert check_matrix_properties([[0, 0], [0, 0]]) == False\", \"assert check_matrix_properties([[1, 0, -1], [1, -0.5, -0.5]]) == Fa... | {
"split": "train",
"index": 75086,
"acecode_id": "bigcode_python_fns_2809",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple chatbot function called `skyview_chatbot`. This function should take a list of strings as input, where each string represents a user message. The chatbot should respond to each message with a fixed response: 'Hello! How can I help you t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert skyview_chatbot(['Hi', 'How are you?']) == ['Hello! How can I help you today?', 'Hello! How can I help you today?']\", \"assert skyview_chatbot(['What is your name?']) == ['Hello! How can I help you today?']\", \"assert skyview_chatbot([]) == []\", \"assert ... | {
"split": "train",
"index": 75087,
"acecode_id": "oss_34335",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates a music recommendation system based on a given genre. Your function should take a genre as input and return a random song from a predefined list of songs that matches the specified genre. If there are no songs availa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert random_song('pop') == {'title': 'Song2', 'album': 'Album2', 'artist': 'artist2', 'genre': 'pop'}\", \"assert random_song('rock') == {'title': 'Song4', 'album': 'Album4', 'artist': 'artist4', 'genre': 'rock'}\", \"assert random_song('classical') == {'error': ... | {
"split": "train",
"index": 75088,
"acecode_id": "oss_31293",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function to decompose a music query string into its constituent parts. The query string will consist of the artist and the title of the song, potentially including additional information such as remix details. Your task is to implement the `decomp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decompose_query('tricky - forget') == {'artist': 'tricky', 'title': 'forget'}\", \"assert decompose_query('Evvy - Collide (Keljet Remix)') == {'artist': 'Evvy', 'title': 'Collide (Keljet Remix)'}\", \"assert decompose_query('Summer of 69') == {'artist': '', ... | {
"split": "train",
"index": 75089,
"acecode_id": "oss_20860",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of item prices, a list of special offers, and a list representing the number of items you need to buy. Each special offer consists of a number of items you can purchase at a discounted price, and the last number in each offer represents the sale price. Howe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shoppingOffers([2,5], [[3,0,5,2],[1,2,10,1]], [3,2]) == 14\", \"assert shoppingOffers([2,3,4], [[1,0,0,4,1],[0,1,1,5,2]], [2,1,1]) == 9\", \"assert shoppingOffers([5,10,15], [[1,0,1,10,1]], [1,0,1]) == 10\", \"assert shoppingOffers([1,2], [[2,2,3,1]], [2,2])... | {
"split": "train",
"index": 75090,
"acecode_id": "evol_11267",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of product dictionaries and serializes them into a specific format. The function should take a list of product dictionaries as input and return the serialized data. The product dictionary has the following str... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert serialize_products([{'id': 1, 'name': 'Product 1', 'price': 29.99, 'quantity': 100}]) == [{'id': 1, 'name': 'Product 1', 'price': '$29.99', 'quantity': 100}]\", \"assert serialize_products([{'id': 2, 'name': 'Product 2', 'price': 39.99, 'quantity': 50}]) == ... | {
"split": "train",
"index": 75091,
"acecode_id": "oss_28756",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer array 'arr', determine the least number of elements that need to be altered, bearing in mind a certain limit on the number of unique element modifications, to convert the array into a palindrome. Note that a single element can be altered to any other element in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert minimum_changes_to_palindrome([1, 2, 3, 4, 3, 2, 2], 2) == 1\", \"assert minimum_changes_to_palindrome([1, 2, 3, 2, 1], 1) == 0\", \"assert minimum_changes_to_palindrome([1, 1, 1, 1], 2) == 0\", \"assert minimum_changes_to_palindrome([1, 2, 2, 1], 1) == 0\",... | {
"split": "train",
"index": 75092,
"acecode_id": "evol_18573",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of model handlers, each represented by a string. Your task is to determine whether a specific model handler is valid or not. A model handler is considered valid if it exists in the provided list of valid handlers. Implement a function `is_valid_handler(vali... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_handler(['handler1', 'handler2', 'handler3'], 'handler1') == True\", \"assert is_valid_handler(['handler1', 'handler2', 'handler3'], 'handler4') == False\", \"assert is_valid_handler(['modelA', 'modelB', 'modelC'], 'modelC') == True\", \"assert is_v... | {
"split": "train",
"index": 75093,
"acecode_id": "bigcode_python_fns_31128",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of entries, each entry can be of different types: Transaction, Custom, Pad, or a general entry. Your task is to implement a function that returns a list of accounts associated with each entry, ordered by specific rules based on the type of entry. For Transactions, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_entry_accounts([Transaction([Account('A'), Account('B')])]) == [['B', 'A']]\", \"assert get_entry_accounts([Custom([Value('Account1', 'ACCOUNT_TYPE'), Value('Account2', 'OTHER_TYPE')])]) == [['Account1']]\", \"assert get_entry_accounts([Transaction([Acco... | {
"split": "train",
"index": 75094,
"acecode_id": "bigcode_python_fns_19541",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a summary report of natural language processing (NLP) progress based on a list of milestones. The function should take in a list of strings representing the milestones and return a formatted string that summarizes the progr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert nlp_summary(['Model A released', 'Model B improved', 'Model C benchmarked']) == 'NLP Progress: Model A released, Model B improved, Model C benchmarked'\", \"assert nlp_summary(['First NLP model', 'Second NLP model']) == 'NLP Progress: First NLP model, Second... | {
"split": "train",
"index": 75095,
"acecode_id": "bigcode_python_fns_38118",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes two integers as input and returns their sum. The function should follow the signature `def add_numbers(a: int, b: int) -> int:`. The inputs `a` and `b` can be any integer, and the output should be a single integer representing ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_numbers(1, 2) == 3\", \"assert add_numbers(-1, 1) == 0\", \"assert add_numbers(0, 0) == 0\", \"assert add_numbers(100, 200) == 300\", \"assert add_numbers(-50, -50) == -100\", \"assert add_numbers(123456, 654321) == 777777\", \"assert add_numbers(-123456... | {
"split": "train",
"index": 75096,
"acecode_id": "oss_36265",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that takes a list of integers and returns the sum of all even numbers in the list. If the list is empty, return 0. The function should handle cases where the list contains negative numbers and zero. Implement the function `sum_of_e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_even_numbers([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_even_numbers([0, 1, 2, 3, 4]) == 6\", \"assert sum_of_even_numbers([-1, -2, -3, -4]) == -6\", \"assert sum_of_even_numbers([2, 4, 6, 8]) == 20\", \"assert sum_of_even_numbers([-2, -4, 2, 4]) == 0\"... | {
"split": "train",
"index": 75097,
"acecode_id": "oss_9969",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function named sortEven that takes a list of integers, l, as input. The function should produce a new list, l', where the elements at even indices of l' are the sorted values of the elements at even indices of l, and the elements at odd indices of l' remain unchanged f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sortEven([1, 2, 3]) == [1, 2, 3]\", \"assert sortEven([5, 6, 3, 4]) == [3, 6, 5, 4]\", \"assert sortEven([4, 2, 7, 5, 1]) == [1, 2, 4, 5, 7]\", \"assert sortEven([]) == []\", \"assert sortEven([9]) == [9]\", \"assert sortEven([2, 4, 6, 8, 10]) == [2, 4, 6, 8... | {
"split": "train",
"index": 75098,
"acecode_id": "evol_24344",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves configuration settings for a web application based on the environment type. The function should accept a single string argument 'environment' which can take one of three values: 'development', 'testing', or 'production'. Ba... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_config('development') == {'DEBUG': True, 'DATABASE_URI': 'sqlite:///development.db', 'SECRET_KEY': 'development_secret_key'}\", \"assert get_config('testing') == {'DEBUG': False, 'DATABASE_URI': 'sqlite:///testing.db', 'SECRET_KEY': 'testing_secret_key'}... | {
"split": "train",
"index": 75099,
"acecode_id": "oss_388",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.