data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of strings representing command-line arguments in the format 'key=value'. Your function should parse these arguments and return a dictionary where the keys are the parts before the '=' and the values are the parts after ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_arguments(['name=John', 'age=30', 'city=NewYork']) == {'name': 'John', 'age': '30', 'city': 'NewYork'}\", \"assert parse_arguments(['key1=value1', 'key2=value2']) == {'key1': 'value1', 'key2': 'value2'}\", \"assert parse_arguments(['singleArgument']) =... | {
"split": "train",
"index": 76100,
"acecode_id": "oss_34555",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that creates a shallow copy of a custom object containing nested lists and dictionaries as its attributes. The custom object has a list of integers and a dictionary with a string attribute. After creating the shallow copy, modify the original object's attri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert 'age' not in shallow_copy.info\", \"assert shallow_copy.numbers[1] == 2\", \"assert 'details' not in shallow_copy.info\"]}"
} | {
"split": "train",
"index": 76101,
"acecode_id": "evol_34144",
"num_tests": 3
} |
acecode | [
{
"role": "user",
"content": "Implement a function `encode_base64(data: str) -> str` that takes a string as input and returns its Base64 encoded representation. The input string can contain any printable ASCII characters. You must ensure that the output is a valid Base64 encoded string. For example, if the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert encode_base64('Hello World') == 'SGVsbG8gV29ybGQ='\", \"assert encode_base64('OpenAI') == 'T3BlbkFJ'\", \"assert encode_base64('Python') == 'UHl0aG9u'\", \"assert encode_base64('Base64 Encoding') == 'QmFzZTY0IEVuY29kaW5n'\", \"assert encode_base64('!@#$%^&*(... | {
"split": "train",
"index": 76102,
"acecode_id": "bigcode_python_fns_1635",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary that maps strings to lists of integers. Implement a function `add_to_dict(d: Dict[str, List[int]], k: str, v: int) -> None` that takes three parameters: a dictionary `d`, a string `k`, and an integer `v`. If the key `k` already exists in the dictionar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_to_dict({'a': [1]}, 'b', 2) == None and {'a': [1], 'b': [2]} == {'a': [1], 'b': [2]}\", \"assert add_to_dict({'a': [1]}, 'a', 3) == None and {'a': [1, 3]} == {'a': [1, 3]}\", \"assert add_to_dict({'key1': [5]}, 'key1', 10) == None and {'key1': [5, 10]} =... | {
"split": "train",
"index": 76103,
"acecode_id": "bigcode_python_fns_1769",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string that contains a sequence of numbers separated by tabs. Your task is to implement a function that parses this string and returns two lists: one containing the numbers as floats, and another containing the last number from each sequence as labels. The last ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_data('1.0\\\\t2.0\\\\t3.0\\\\t4.0\\\\n5.0\\\\t6.0\\\\t7.0\\\\t8.0\\\\n') == ([[1.0, 2.0, 3.0], [5.0, 6.0, 7.0]], [4.0, 8.0])\", \"assert parse_data('10.0\\\\t20.0\\\\t30.0\\\\t40.0\\\\n50.0\\\\t60.0\\\\t70.0\\\\t80.0\\\\n') == ([[10.0, 20.0, 30.0], [50... | {
"split": "train",
"index": 76104,
"acecode_id": "bigcode_python_fns_39930",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function `get_time_in_millisecs()` that returns the current time in milliseconds since the Unix epoch (January 1, 1970). The function should return an integer value representing the number of milliseconds that have passed since this epoch. You should not use any ext... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_time_in_millisecs() >= 0\", \"assert isinstance(get_time_in_millisecs(), int)\", \"assert get_time_in_millisecs() - get_time_in_millisecs() == 0\", \"assert get_time_in_millisecs() > get_time_in_millisecs() - 1000\", \"assert get_time_in_millisecs() < ge... | {
"split": "train",
"index": 76105,
"acecode_id": "bigcode_python_fns_36657",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of integers as input and returns a list containing only the unique elements from the input list, preserving the order of their first occurrence. Implement the function `get_unique_elements(arr: List[int]) -> List[int]` w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_elements([1, 2, 3, 2, 1, 4]) == [1, 2, 3, 4]\", \"assert get_unique_elements([5, 5, 5, 5]) == [5]\", \"assert get_unique_elements([]) == []\", \"assert get_unique_elements([1, 2, 3]) == [1, 2, 3]\", \"assert get_unique_elements([4, 5, 4, 6, 7, 6])... | {
"split": "train",
"index": 76106,
"acecode_id": "bigcode_python_fns_32776",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a method in a class named `Query` that finds all subclasses of `Query` that are instances of a specified subclass. The method, `children_like(cls)`, should take a parameter `cls` representing a class and return a list of all subclasses of `Query... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert Query().children_like(Query) == [FieldReference]\", \"assert Query().children_like(str) == []\", \"assert Query().children_like(int) == []\", \"assert Query().children_like(list) == []\", \"assert Query().children_like(type) == []\", \"assert Query().childre... | {
"split": "train",
"index": 76107,
"acecode_id": "oss_13674",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given two elections represented as lists of lists. Each sublist corresponds to the preferences of voters in the election. Your task is to calculate a cost table where each entry at position (i, j) represents the number of pairs of candidates whose relative ordering is d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_matching_cost([[1]], [[1]]) == [[0]]\", \"assert get_matching_cost([[1, 2, 3]], [[1, 3, 2]]) == [[2]]\", \"assert get_matching_cost([[1, 2]], [[1, 2]]) == [[0]]\", \"assert get_matching_cost([[1, 2]], [[1, 2]]) == [[0]]\", \"assert get_matching_cost([[1]... | {
"split": "train",
"index": 76108,
"acecode_id": "bigcode_python_fns_42400",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function named `handle_intent` that takes in a dictionary representing an intent request and a session object. The intent request contains a key 'intent' which itself is a dictionary with a key 'name' representing the name of the intent. Your func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert handle_intent({'intent': {'name': 'StartIntent'}}, {}) == 'Starting feedback'\", \"assert handle_intent({'intent': {'name': 'AnswerIntent'}}, {}) == 'Answering question'\", \"assert handle_intent({'intent': {'name': 'AMAZON.ResumeIntent'}}, {}) == 'Resuming ... | {
"split": "train",
"index": 76109,
"acecode_id": "bigcode_python_fns_6135",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks if a given integer is non-negative. The function should take an integer as an input and return a boolean value indicating whether the integer is greater than or equal to zero. If the integer is negative, the function shoul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_non_negative(0) == True\", \"assert is_non_negative(5) == True\", \"assert is_non_negative(100) == True\", \"assert is_non_negative(1) == True\", \"assert is_non_negative(2) == True\", \"assert is_non_negative(10) == True\", \"assert is_non_negative(0) ==... | {
"split": "train",
"index": 76110,
"acecode_id": "bigcode_python_fns_8241",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a list of directories represented as strings, where each directory may contain files. Your task is to implement a function that extracts the names of directories that contain a specific file named 'extract_me.flag'. The function should return a list of directory p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_directories_with_flag(['root/folder1', 'root/folder2/extract_me.flag', 'root/folder3']) == ['root/folder2']\", \"assert extract_directories_with_flag(['dir1', 'dir2/extract_me.flag', 'dir3/extract_me.flag', 'dir4']) == ['dir2', 'dir3']\", \"assert ex... | {
"split": "train",
"index": 76111,
"acecode_id": "bigcode_python_fns_34463",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes in a string and returns the number of unique characters in that string. The function should ignore spaces and consider case-insensitive characters as the same. For example, 'a' and 'A' should be counted as one unique character.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_characters('OpenAI') == 6\", \"assert count_unique_characters('aaaaaa') == 1\", \"assert count_unique_characters('') == 0\", \"assert count_unique_characters(' ') == 0\", \"assert count_unique_characters('abcdABCD') == 4\", \"assert count_uniqu... | {
"split": "train",
"index": 76112,
"acecode_id": "bigcode_python_fns_43750",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that determines whether a result file is the main file in a distributed result set. The function should take two integers as input: the global number of nodes (global_nodes) and the number of nodes in the file (file_nodes). The functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_main_file(5, 3) == True\", \"assert is_main_file(10, 10) == False\", \"assert is_main_file(0, 1) == True\", \"assert is_main_file(1, 0) == True\", \"assert is_main_file(2, 2) == False\", \"assert is_main_file(100, 50) == True\", \"assert is_main_file(300,... | {
"split": "train",
"index": 76113,
"acecode_id": "oss_36777",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary containing wind speed values in meters per second, convert each wind speed value into its corresponding Beaufort scale level. The Beaufort scale is a qualitative measure of wind force based on the observed conditions and is represented as follows: \n\n- 0.0 t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert metric_wind_dict_to_beaufort({'speed': 0.0}) == {'speed': 0}\", \"assert metric_wind_dict_to_beaufort({'speed': 0.2}) == {'speed': 0}\", \"assert metric_wind_dict_to_beaufort({'speed': 0.3}) == {'speed': 1}\", \"assert metric_wind_dict_to_beaufort({'speed': ... | {
"split": "train",
"index": 76114,
"acecode_id": "bigcode_python_fns_45341",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of floating-point numbers, implement a function `find_all_furthest_pairs(numbers: List[float]) -> List[Tuple[float, float]]` that returns a list of tuples containing all pairs of the minimum and maximum values in the list. Each tuple should contain the minimum valu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_all_furthest_pairs([1.0, 2.0, 3.0, 4.0, 5.0, 2.2, 5.0]) == [(1.0, 5.0), (1.0, 5.0)]\", \"assert find_all_furthest_pairs([1.0, 2.0, 2.0, 2.0, 5.0, 1.0]) == [(1.0, 5.0), (1.0, 5.0)]\", \"assert find_all_furthest_pairs([5.5]) == [(5.5, 5.5)]\", \"assert fi... | {
"split": "train",
"index": 76115,
"acecode_id": "evol_2609",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function `extract_music_data(data: List[Dict[str, Any]]) -> List[Dict[str, Any]]` that processes a list of user interaction instances from a music streaming application. Each instance is represented as a dictionary with keys: 'username', 'song', 'listenCount', and '... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_music_data([{'username': 'user1', 'song': 'songA', 'listenCount': 5, 'lastListened': '2023-10-01T12:00:00Z'}]) == [{'username': 'user1', 'song': 'songA', 'listenCount': 5, 'lastListened': '2023-10-01 12:00:00'}]\", \"assert extract_music_data([{'user... | {
"split": "train",
"index": 76116,
"acecode_id": "evol_12512",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of database migration operations represented as strings. Each operation can either be a 'CREATE UNIQUE' operation that creates a unique index or a 'DROP INDEX' operation that drops an existing index. Implement a function `remove_field(operations: List[str])... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_field(['CREATE UNIQUE', 'DROP INDEX']) == {'CREATE UNIQUE': [], 'DROP INDEX': ['DROP INDEX']}\", \"assert remove_field(['CREATE UNIQUE', 'CREATE UNIQUE']) == {'CREATE UNIQUE': [], 'DROP INDEX': []}\", \"assert remove_field(['DROP INDEX']) == {'CREATE ... | {
"split": "train",
"index": 76117,
"acecode_id": "bigcode_python_fns_23311",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes an array of integers as input and returns the number of elements in the array. The function should handle both empty and non-empty arrays appropriately.\nPlease reason step by step, then write a self-contained Python solution. Give your final pro... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert array_length([]) == 0\", \"assert array_length([1]) == 1\", \"assert array_length([1, 2, 3]) == 3\", \"assert array_length([5, 10, 15, 20]) == 4\", \"assert array_length([1, 3, 5, 6]) == 4\", \"assert array_length([0]) == 1\", \"assert array_length([-1, -2, ... | {
"split": "train",
"index": 76118,
"acecode_id": "evol_925",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with merging data from two lists into a single list. Write a function `merge_lists(list1: List[str], list2: List[str]) -> List[str]` that takes the following parameters: \n- `list1` (List[str]): A list of strings representing the first set of data. \n- `list2` (L... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_lists(['a', 'b', 'c'], ['d', 'e', 'f']) == ['a', 'b', 'c', 'd', 'e', 'f']\", \"assert merge_lists(['1', '2'], ['3', '4', '5']) == ['1', '2', '3', '4', '5']\", \"assert merge_lists([], ['a', 'b']) == ['a', 'b']\", \"assert merge_lists(['x', 'y', 'z'], [... | {
"split": "train",
"index": 76119,
"acecode_id": "oss_28221",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes an authentication token and a log resource ID as input. The function should simulate the action of deleting a log resource by constructing the URL for the resource using the provided log ID and returning a success message i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delete_log('valid_token', 1) == 'Log deleted successfully'\", \"assert delete_log('valid_token', 10) == 'Log deleted successfully'\", \"assert delete_log('valid_token', 100) == 'Log deleted successfully'\", \"assert delete_log('valid_token', 5) == 'Log delet... | {
"split": "train",
"index": 76120,
"acecode_id": "oss_28553",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a file path. Your task is to implement a function that checks if the provided file path is valid. A valid file path must start with a forward slash ('/') and contain at least one character after the slash. If the path is valid, return 'Valid ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_file_path('/valid/path/to/file') == 'Valid Path'\", \"assert check_file_path('/another/valid/path') == 'Valid Path'\", \"assert check_file_path('/single') == 'Valid Path'\", \"assert check_file_path('/') == 'Invalid Path'\", \"assert check_file_path('i... | {
"split": "train",
"index": 76121,
"acecode_id": "bigcode_python_fns_31312",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a non-negative integer n, return the nth Fibonacci number. The Fibonacci sequence is defined as follows: fib_0 = 0, fib_1 = 1, and fib_n = fib_(n-1) + fib_(n-2) for n >= 2. Implement a function that takes an integer n and returns the nth Fibonacci number.\nPlease reason s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(0) == 0\", \"assert fibonacci(1) == 1\", \"assert fibonacci(2) == 1\", \"assert fibonacci(3) == 2\", \"assert fibonacci(4) == 3\", \"assert fibonacci(5) == 5\", \"assert fibonacci(6) == 8\", \"assert fibonacci(7) == 13\", \"assert fibonacci(8) == 2... | {
"split": "train",
"index": 76122,
"acecode_id": "bigcode_python_fns_15986",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the length and slope of a line defined by two points in a 2D Cartesian coordinate system. The function should take two tuples, `point1` and `point2`, each containing two integers representing the coordinates of the poi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_line_properties((0, 0), (3, 4)) == (5.0, 1.3333333333333333)\", \"assert calculate_line_properties((1, 2), (1, 5)) == (3.0, None)\", \"assert calculate_line_properties((-1, -1), (1, 1)) == (2.8284271247461903, 1.0)\", \"assert calculate_line_proper... | {
"split": "train",
"index": 76123,
"acecode_id": "oss_27679",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that parses a list of command-line arguments that represent options for monitoring TCP/IP addresses. The function should take a list of strings as input, where each string is a command-line argument. Your function should return a dict... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_options(['--tcp', 'google.com:80', '--tcp', 'example.com:80']) == {'tcp': ['google.com:80', 'example.com:80'], 'logfile': 'connection.log', 'interval': 30.0, 'timeout': 3.0, 'quiet': False}\", \"assert parse_options(['--tcp', '192.168.1.1', '--logfile'... | {
"split": "train",
"index": 76124,
"acecode_id": "bigcode_python_fns_12843",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that calculates the average of a list of numbers. The function, `calculate_average`, takes a list of numbers as input and returns the average of those numbers. If the input list is empty, the function should return 0.0. You need to implem... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average([1, 2, 3, 4, 5]) == 3.0\", \"assert calculate_average([-1, -2, -3, -4, -5]) == -3.0\", \"assert calculate_average([1, -2, 3, -4, 5]) == 0.6\", \"assert calculate_average([]) == 0.0\", \"assert calculate_average([10]) == 10.0\", \"assert cal... | {
"split": "train",
"index": 76125,
"acecode_id": "oss_12874",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that returns the largest prime factor of a given integer 'n'. The input can be a positive integer, a negative integer, or zero. If 'n' is zero, the function should raise a ValueError indicating that the prime factor of zero is undefined. If 'n' is a prime n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert largest_prime_factor(15) == 5\", \"assert largest_prime_factor(-15) == 5\", \"assert largest_prime_factor(28) == 7\", \"assert largest_prime_factor(2048) == 2\", \"assert largest_prime_factor(-2048) == 2\", \"assert largest_prime_factor(13195) == 29\", \"ass... | {
"split": "train",
"index": 76126,
"acecode_id": "evol_16934",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function named `validate_and_return` that takes a parameter `id`. The function should validate that `id` is a positive integer. If the validation fails, the function should return an error message string 'Invalid or missing id parameter'. I... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_and_return(1) == 1\", \"assert validate_and_return(10) == 10\", \"assert validate_and_return(100) == 100\", \"assert validate_and_return(500) == 500\", \"assert validate_and_return(999) == 999\", \"assert validate_and_return(0) == 'Invalid or missin... | {
"split": "train",
"index": 76127,
"acecode_id": "oss_22086",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Construct a function that checks if the nested brackets in a string are properly opened and closed. The brackets to consider are the curly brackets '{', '}' and the square brackets '[', ']'. The function should return True if all opened brackets are properly closed, and False o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert json_bracket_checker('{}') == True\", \"assert json_bracket_checker('[]') == True\", \"assert json_bracket_checker('{[()]}') == True\", \"assert json_bracket_checker('{[}') == False\", \"assert json_bracket_checker('}') == False\", \"assert json_bracket_chec... | {
"split": "train",
"index": 76128,
"acecode_id": "evol_26255",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a service that handles requests for a machine learning model. Your goal is to implement a function called `handle_model_request` that takes in a request string and a request type, processes the request based on the type, and returns a correspondin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert handle_model_request('image_data', 'infer') == 'Inference response for: image_data'\", \"assert handle_model_request('config_data', 'config') == 'Configuration response for: config_data'\", \"assert handle_model_request('stats_data', 'statistics') == 'Statis... | {
"split": "train",
"index": 76129,
"acecode_id": "oss_31495",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a date and time in ISO 8601 format, convert it to the number of seconds since the UNIX epoch (January 1, 1970). The input string will be in the format 'YYYY-MM-DDTHH:MM:SSZ'. Implement a function `convert_iso_to_unix(isoTime: str) -> int` that takes ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_iso_to_unix('1970-01-01T00:00:00Z') == 0\", \"assert convert_iso_to_unix('2000-01-01T00:00:00Z') == 946684800\", \"assert convert_iso_to_unix('2010-01-01T00:00:00Z') == 1262304000\", \"assert convert_iso_to_unix('2020-01-01T00:00:00Z') == 1577836800\... | {
"split": "train",
"index": 76130,
"acecode_id": "bigcode_python_fns_23873",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a dataset represented as a 2D list where each sublist contains three numerical values. Your task is to write a function that calculates the number of sublists (rows) in the dataset. Implement the function `count_rows(data: List[List[float]]) -> int` that takes a 2... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_rows([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0], [7.0, 8.0, 9.0]]) == 3\", \"assert count_rows([[1.1, 2.2, 3.3], [4.4, 5.5, 6.6]]) == 2\", \"assert count_rows([[1, 2, 3]]) == 1\", \"assert count_rows([]) == 0\", \"assert count_rows([[0, 0, 0], [1, 1, 1], [2, 2,... | {
"split": "train",
"index": 76131,
"acecode_id": "bigcode_python_fns_21285",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple banking system that allows users to manage their accounts. Your task is to write a function `bank_operations(operations: List[Tuple[str, Union[str, float]]]) -> List[Union[str, None]]` that simulates a series of banking operations based... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bank_operations([('create_account', 'Alice', 1000.0)]) == [None]\", \"assert bank_operations([('create_account', 'Charlie', 200.0), ('get_account_info', '2')]) == [None, None]\", \"assert bank_operations([('create_account', 'David', 1500.0), ('process_transa... | {
"split": "train",
"index": 76132,
"acecode_id": "oss_18297",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing a sequence of numbers. Your task is to write a function to delete all occurrences of a specific value from the list while maintaining the relative order of the remaining elements. Write a function `delete_occurrences(lst, value)` wh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delete_occurrences([1, 3, 5, 3, 7, 3, 9], 3) == [1, 5, 7, 9]\", \"assert delete_occurrences([1, 1, 1, 1, 1], 1) == []\", \"assert delete_occurrences([2, 3, 4, 5, 3, 2], 2) == [3, 4, 5, 3]\", \"assert delete_occurrences([10, 20, 30, 10, 40], 10) == [20, 30, 4... | {
"split": "train",
"index": 76133,
"acecode_id": "oss_24346",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes license information for a software product. The license information is provided as a dictionary containing various data types. Your function should extract specific information from the license dictionary and perform... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_license_info({'license_key': 'ABC123', 'expiration_date': '2023-10-20', 'allowed_features': ['feature1', 'feature2'], 'license_type': 'standard', 'max_users': 100, 'usage_statistics': {'total_usage': 50, 'average_usage': 40.0}}) == 'Normal usage'\", ... | {
"split": "train",
"index": 76134,
"acecode_id": "oss_35303",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a list or tuple called `colorVector` that represents the RGB color values of a material, implement a function that validates the `colorVector`. The function should return the `colorVector` if it meets the following criteria: 1) It is not `None`; 2) It is either a list or ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_color_vector([0.1, 0.2, 0.3]) == [0.1, 0.2, 0.3]\", \"assert validate_color_vector((1, 0, 0)) == (1, 0, 0)\", \"assert validate_color_vector([0, 1, 0]) == [0, 1, 0]\", \"assert validate_color_vector((0.5, 0.5, 0.5)) == (0.5, 0.5, 0.5)\", \"assert va... | {
"split": "train",
"index": 76135,
"acecode_id": "bigcode_python_fns_48340",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer n, return a list of all Fibonacci numbers that are less than n.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block."
}
] | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fib(10) == [0, 1, 1, 2, 3, 5, 8]\", \"assert fib(0) == []\", \"assert fib(5) == [0, 1, 1, 2, 3]\", \"assert fib(15) == [0, 1, 1, 2, 3, 5, 8, 13]\", \"assert fib(21) == [0, 1, 1, 2, 3, 5, 8, 13]\", \"assert fib(50) == [0, 1, 1, 2, 3, 5, 8, 13, 21, 34]\", \"as... | {
"split": "train",
"index": 76136,
"acecode_id": "evol_26258",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to implement a function that returns the sum of all even numbers in the list. If the list is empty, return 0. The function should be defined as follows: def sum_of_evens(nums: List[int]) -> int.\nPlease reason step by step, then wr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([10, 21, 32, 43]) == 42\", \"assert sum_of_evens([]) == 0\", \"assert sum_of_evens([2, 4, 6, 8]) == 20\", \"assert sum_of_evens([1, 3, 5]) == 0\", \"assert sum_of_evens([2, -2, 4]) == 4\", \"assert ... | {
"split": "train",
"index": 76137,
"acecode_id": "oss_5494",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that searches for a specific service by its name from a list of services. Each service is represented by a dictionary containing its 'name' and 'uuid'. Your function should take a list of services and a target name as input and return the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert search_service([{'name': 'ServiceA', 'uuid': '123'}, {'name': 'ServiceB', 'uuid': '456'}], 'ServiceA') == '123'\", \"assert search_service([{'name': 'ServiceA', 'uuid': '123'}, {'name': 'ServiceB', 'uuid': '456'}], 'ServiceB') == '456'\", \"assert search_ser... | {
"split": "train",
"index": 76138,
"acecode_id": "bigcode_python_fns_6855",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string `text` that contains words, numbers, and punctuation, and a string `delimiters` that specifies which characters should be used to split the `text`. Your task is to write a function `split_text` that takes `text` and `delimiters` as parameters and returns ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert split_text('1.2.3.4', '.') == ['1', '2', '3', '4']\", \"assert split_text('A quick brown fox', ' ') == ['A', 'quick', 'brown', 'fox']\", \"assert split_text('Mixing numbers 1234 and words', ' ') == ['Mixing', 'numbers', '1234', 'and', 'words']\", \"assert sp... | {
"split": "train",
"index": 76139,
"acecode_id": "oss_23909",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary that contains a key 'response' with a string value. Your task is to implement a function that modifies the 'response' string by appending the suffix '_modified' to it and returns the modified dictionary. Write a function called `modify_response` that ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert modify_response({'response': 'Hello'}) == {'response': 'Hello_modified'}\", \"assert modify_response({'response': '12345'}) == {'response': '12345_modified'}\", \"assert modify_response({'response': 'Test'}) == {'response': 'Test_modified'}\", \"assert modif... | {
"split": "train",
"index": 76140,
"acecode_id": "oss_28656",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given the parameters to create an arc defined by its color, start angle, stop angle, width, height, and optional parameters for position, thickness, and anchor point. Write a function `create_arc` that takes the following parameters: `color` (str), `start_angle` (int), ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_arc('red', 0, 90, 100, 50) == {'color': 'red', 'start_angle': 0, 'stop_angle': 90, 'width': 100, 'height': 50, 'position': (0, 0), 'thickness': 1, 'anchor': 'center'}\", \"assert create_arc('blue', 30, 150, 200, 100, 10, 20) == {'color': 'blue', 'star... | {
"split": "train",
"index": 76141,
"acecode_id": "bigcode_python_fns_41585",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of server parameters, a topic string, and a message string. Your task is to implement a function `send_message_to_server(server_params: List[str], topic: str, msg: str) -> None` that simulates sending a message to a server. The function should not return an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert send_message_to_server(['param1', 'param2'], 'updates', 'Hello World') is None\", \"assert send_message_to_server(['server1', 'server2'], 'alerts', 'Warning!') is None\", \"assert send_message_to_server(['configA'], 'notifications', 'New message received.') ... | {
"split": "train",
"index": 76142,
"acecode_id": "bigcode_python_fns_44343",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `check_api_key(api_key: str, api_keys: Dict[str, int]) -> str` that verifies the validity of an API key based on a dictionary of API keys and their expiry timestamps. The function should return 'Valid request' if the API key is valid and not expired, 'Expir... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_api_key('expired_key', {'valid_key': 1700000000, 'expired_key': 1699999990}) == 'Expired API Key'\", \"assert check_api_key('invalid_key', {'valid_key': 1700000000, 'expired_key': 1699999990}) == 'Invalid or missing API key'\", \"assert check_api_key('... | {
"split": "train",
"index": 76143,
"acecode_id": "evol_18765",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function `next_element(sequence: List[int], index: int) -> int` that takes a list of integers `sequence` and an integer `index` as input. The function should return the element at the specified `index` in the `sequence` list. If the `index` is out of bounds (i.e., l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert next_element([1, 2, 3, 4, 5], 0) == 1\", \"assert next_element([10, 20, 30, 40], 2) == 30\", \"assert next_element([-5, -10, -15], 1) == -10\", \"assert next_element([0], 0) == 0\", \"assert next_element([100], 0) == 100\", \"assert next_element([7, 8, 9], 1... | {
"split": "train",
"index": 76144,
"acecode_id": "oss_2474",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a string representing an XML document, implement a function `extract_emails(xml_str: str) -> List[str]` that extracts all valid email addresses from the text content of the XML elements. The email addresses should match the standard format of an email, which consists of a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_emails('<root><email>test@example.com</email><email>user@domain.com</email></root>') == ['test@example.com', 'user@domain.com']\", \"assert extract_emails('<data><info>Contact: support@service.org</info></data>') == ['support@service.org']\", \"asser... | {
"split": "train",
"index": 76145,
"acecode_id": "evol_24061",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries representing articles, where each article has the following keys: 'item_id', 'resolved_id', 'given_title', 'resolved_url', 'given_url', 'resolved_title', 'time_added', 'time_read', 'time_updated', 'status', and 'word_count'. Your task is to ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_articles([]) == []\", \"assert process_articles([{ 'item_id': 1, 'resolved_id': 'r1', 'given_title': 'Title 1', 'resolved_url': None, 'given_url': 'http://example.com/1', 'resolved_title': 'Resolved Title 1', 'time_added': 1609459200, 'time_read': 16... | {
"split": "train",
"index": 76146,
"acecode_id": "bigcode_python_fns_28390",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a year and a month in the format 'YYYY-MM', write a function that checks whether the given year and month is greater than or equal to the minimum inclusive value of '2012-02'. The function should return True if it is greater than or equal to this minimum value, and False ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_date('2012-02') == True\", \"assert check_date('2012-03') == True\", \"assert check_date('2013-01') == True\", \"assert check_date('2011-12') == False\", \"assert check_date('2011-11') == False\", \"assert check_date('2012-01') == False\", \"assert che... | {
"split": "train",
"index": 76147,
"acecode_id": "bigcode_python_fns_34701",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a simple combat encounter between a player and an enemy in a text-based adventure game. Your goal is to implement a function called `combat_simulation` that takes two parameters: `player_health` (an integer representing the player's health points)... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert combat_simulation(100, 50) == 'PLAYER_WINS'\", \"assert combat_simulation(30, 100) == 'ENEMY_WINS'\", \"assert combat_simulation(100, 10) == 'PLAYER_WINS'\", \"assert combat_simulation(20, 10) == 'PLAYER_WINS'\", \"assert combat_simulation(15, 12) == 'PLAYER... | {
"split": "train",
"index": 76148,
"acecode_id": "oss_3448",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given two rotation matrices R_src and R_delta represented as 2D lists of size 3x3, and a rotation coordinate system specified as a string (either 'model' or 'camera'), implement a function that transforms the source rotation matrix R_src using the rotation delta R_delta based o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert R_transform_th([[1, 0, 0], [0, 1, 0], [0, 0, 1]], [[0, -1, 0], [1, 0, 0], [0, 0, 1]], 'model') == [[0, -1, 0], [1, 0, 0], [0, 0, 1]]\", \"assert R_transform_th([[1, 0, 0], [0, 1, 0], [0, 0, 1]], [[0, 0, 1], [0, 1, 0], [-1, 0, 0]], 'model') == [[0, 0, 1], [0,... | {
"split": "train",
"index": 76149,
"acecode_id": "bigcode_python_fns_39077",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a list of elements, implement a function that adds 5 to every integer in the list while preserving the non-integer elements unchanged. The function should return a new list with the modified values.\nPlease reason step by step, then write a self-contained Python solution.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert example_func([1, 2, 3]) == [6, 7, 8]\", \"assert example_func([10, 'hello', 5, 3.5]) == [15, 'hello', 10, 3.5]\", \"assert example_func(['apple', 4, 6.7]) == ['apple', 9, 6.7]\", \"assert example_func([]) == []\", \"assert example_func([0, -1, -5]) == [5, 4,... | {
"split": "train",
"index": 76150,
"acecode_id": "evol_34553",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, your task is to modify each string in the list by appending an exclamation mark ('!') to it a specified number of times. The first string should have the exclamation mark appended a certain number of times, and each subsequent string should not have any... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert modify_strings(['abc', 'def', 'ghi', 'jkl'], 2) == ['abc!!', 'def', 'ghi', 'jkl']\", \"assert modify_strings(['hello', 'world'], 0) == ['hello', 'world']\", \"assert modify_strings(['test'], 3) == ['test!!!']\", \"assert modify_strings([], 5) == []\", \"asse... | {
"split": "train",
"index": 76151,
"acecode_id": "oss_11929",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of integers and returns a new list containing only the unique elements from the input list. The original order of the elements should be preserved in the output list. Write a function `get_unique_elements(arr: List[int])... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_elements([]) == []\", \"assert get_unique_elements([1, 2, 3]) == [1, 2, 3]\", \"assert get_unique_elements([1, 1, 1]) == [1]\", \"assert get_unique_elements([1, 2, 2, 3, 3, 4]) == [1, 2, 3, 4]\", \"assert get_unique_elements([5, 5, 5, 5, 5]) == [5... | {
"split": "train",
"index": 76152,
"acecode_id": "bigcode_python_fns_15430",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that performs a matrix operation called subsampling. You are given a matrix and a list of indices. The function should return a new matrix that consists of only the rows from the original matrix specified by the given indices. If only one index is provided,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert subsample_matrix([[1, 2, 3], [4, 5, 6], [7, 8, 9]], [0, 2]) == [[1, 2, 3], [7, 8, 9]]\", \"assert subsample_matrix([[1, 2, 3]], [0]) == [[1, 2, 3]]\", \"assert subsample_matrix([[5, 6], [7, 8], [9, 10]], [1]) == [[7, 8]]\", \"assert subsample_matrix([[1, 1, ... | {
"split": "train",
"index": 76153,
"acecode_id": "oss_1237",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function named 'is_last_digit_zero_in_binary' that accepts an integer input and returns true if the last digit of its binary representation is '0'. The function should determine this based solely on the binary representation of the number, not the decimal representa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_last_digit_zero_in_binary(0) == True\", \"assert is_last_digit_zero_in_binary(1) == False\", \"assert is_last_digit_zero_in_binary(2) == True\", \"assert is_last_digit_zero_in_binary(3) == False\", \"assert is_last_digit_zero_in_binary(4) == True\", \"ass... | {
"split": "train",
"index": 76154,
"acecode_id": "evol_19537",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that retrieves the domain name for a given IP address using a simulated reverse DNS lookup. The function should return a predefined domain name based on the input IP address. If the IP address does not have a corresponding domain n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_domain_name('8.8.8.8') == 'dns.google'\", \"assert get_domain_name('172.16.17.32') == '32.17.16.172.in-addr.arpa'\", \"assert get_domain_name('8.8.4.4') == 'dns.google'\", \"assert get_domain_name('172.16.58.3') == '3.58.16.172.in-addr.arpa'\", \"assert ... | {
"split": "train",
"index": 76155,
"acecode_id": "oss_33381",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with extracting pixel color information from a video frame based on mouse event data. Implement a function called `extract_pixel_color` that takes two parameters: `mouseEventData`, which is a dictionary containing the coordinates `x` and `y` of the mouse event, a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_pixel_color({'x': 1, 'y': 1}, [[0, 1, 2], [3, 4, 5], [6, 7, 8]]) == (1, 1, 4)\", \"assert extract_pixel_color({'x': 0, 'y': 0}, [[255, 0, 0], [0, 255, 0]]) == (0, 0, 255)\", \"assert extract_pixel_color({'x': -1, 'y': 0}, [[1, 2], [3, 4]]) == None\",... | {
"split": "train",
"index": 76156,
"acecode_id": "oss_12004",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers and a target integer, write a function that returns the index of the last occurrence of the target integer in the list. If the target integer is not present in the list, return -1. Your function should be able to handle lists of any length, including em... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_index([1, 2, 3, 4, 5], 3) == 2\", \"assert reverse_index([1, 2, 3, 4, 5], 5) == 4\", \"assert reverse_index([1, 2, 3, 4, 5], 1) == 0\", \"assert reverse_index([1, 2, 3, 4, 5], 6) == -1\", \"assert reverse_index([5, 5, 5, 5, 5], 5) == 4\", \"assert re... | {
"split": "train",
"index": 76157,
"acecode_id": "bigcode_python_fns_16077",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a scene represented as a dictionary with a key 'objects' that contains a list of strings representing object names, implement a function `pretty_print_scene_objects(scene: dict) -> str` that returns a formatted string displaying each object in the scene along with its ind... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pretty_print_scene_objects({'objects': ['tree', 'car', 'house']}) == '0: tree\\\\n1: car\\\\n2: house'\", \"assert pretty_print_scene_objects({'objects': []}) == 'No objects in the scene.'\", \"assert pretty_print_scene_objects({'objects': ['cat', 'dog']}) =... | {
"split": "train",
"index": 76158,
"acecode_id": "bigcode_python_fns_9713",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a dictionary representing machine metadata and returns a modified version of that dictionary. The function should accept the following parameters: a dictionary `data` which contains metadata keys (such as 'application_uuid', 'a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_machine_metadata({'application_uuid': '1234', 'application_name': ['app1', 'app2'], 'machine_version': 'v1'}) == {'application_uuid': '1234', 'application_name': 'app1,app2', 'machine_version': 'v1'}\", \"assert update_machine_metadata({'application_u... | {
"split": "train",
"index": 76159,
"acecode_id": "bigcode_python_fns_6123",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with building a function that takes a string representing a type of predictor, a dictionary of parameters, and an integer representing the batch size. Your function should return a formatted string that describes the prediction process using the provided inputs. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_prediction('udify_predictor', {'learning_rate': 0.01, 'epochs': 10}, 1) == \\\"Predictor: udify_predictor, Parameters: learning_rate=0.01, epochs=10, Batch Size: 1\\\"\", \"assert format_prediction('simple_predictor', {'num_layers': 2, 'dropout': 0.5}... | {
"split": "train",
"index": 76160,
"acecode_id": "bigcode_python_fns_31616",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a given byte string and removes any non-decodable characters. The function should take a byte string as input and return a new string with non-decodable characters removed. You will utilize the `decode` method with t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_non_decodable(b'\\\\x80\\\\x81\\\\x82') == ''\", \"assert remove_non_decodable(b'Valid text') == 'Valid text'\", \"assert remove_non_decodable(b'\\\\x41\\\\x42\\\\x43') == 'ABC'\", \"assert remove_non_decodable(b'Hello, World!') == 'Hello, World!'\", ... | {
"split": "train",
"index": 76161,
"acecode_id": "oss_12786",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary where keys are items (strings) and values are their corresponding frequencies (integers), implement a function `create_mapping(dico)` that returns two mappings: `item_to_id` and `id_to_item`. The `item_to_id` mapping should map each item to a unique ID based ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_mapping({'apple': 3, 'banana': 2, 'orange': 1}) == ({'apple': 0, 'banana': 1, 'orange': 2}, {0: 'apple', 1: 'banana', 2: 'orange'})\", \"assert create_mapping({'cat': 5, 'bat': 5, 'rat': 2}) == ({'bat': 0, 'cat': 1, 'rat': 2}, {0: 'bat', 1: 'cat', 2: ... | {
"split": "train",
"index": 76162,
"acecode_id": "bigcode_python_fns_32793",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with determining if a given string label represents a large cave. A cave is considered large if its label consists entirely of uppercase letters. Write a function `is_big(label: str) -> bool` that takes in a string label and returns True if the label is comprised... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_big('CAVE') == True\", \"assert is_big('cave') == False\", \"assert is_big('CAVE') == True\", \"assert is_big('LARGE') == True\", \"assert is_big('large') == False\", \"assert is_big('') == False\", \"assert is_big('A') == True\", \"assert is_big('Z') == ... | {
"split": "train",
"index": 76163,
"acecode_id": "bigcode_python_fns_12297",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, return the maximum difference between any two elements such that the larger element comes after the smaller element in the array. If no such difference exists, return -1. Write a function `max_difference(arr: List[int]) -> int` where `arr` is the inp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_difference([7, 1, 5, 3, 6, 4]) == 5\", \"assert max_difference([9, 7, 5, 3, 1]) == -1\", \"assert max_difference([1, 2, 3, 4, 5]) == 4\", \"assert max_difference([1]) == -1\", \"assert max_difference([5, 4, 3, 2, 1]) == -1\", \"assert max_difference([2, ... | {
"split": "train",
"index": 76164,
"acecode_id": "bigcode_python_fns_28217",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a collection of case studies and their associated trading bloc tags. Implement a function `get_case_studies_by_trading_bloc(tag_id)` that takes an integer `tag_id` as input and returns a list of case studies associated with that trading bloc tag. Ea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_case_studies_by_trading_bloc(1) == [{'id': 1, 'title': 'Case Study A'}, {'id': 2, 'title': 'Case Study B'}]\", \"assert get_case_studies_by_trading_bloc(2) == [{'id': 3, 'title': 'Case Study C'}, {'id': 4, 'title': 'Case Study D'}]\", \"assert get_case_s... | {
"split": "train",
"index": 76165,
"acecode_id": "oss_30941",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes two lists as input parameters. The function should check if the lengths of the two lists are equal. If they are equal, the function should return a dictionary where each element of the first list is a key and the corresponding element of the s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert combine_lists(['a', 'b', 'c'], [1, 2, 3]) == {'a': 1, 'b': 2, 'c': 3}\", \"assert combine_lists(['name', 'age'], ['Alice', 30]) == {'name': 'Alice', 'age': 30}\", \"assert combine_lists(['key1', 'key2'], ['value1', 'value2']) == {'key1': 'value1', 'key2': 'v... | {
"split": "train",
"index": 76166,
"acecode_id": "evol_2938",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing audio data in a Python program. Your goal is to create a function that takes a string representing a stereo audio file name and outputs the names of the left and right mono audio files that would result from splitting that stereo audio file. The f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_mono_filenames('input_audio.wav') == ('left_channel.wav', 'right_channel.wav')\", \"assert get_mono_filenames('example_song.wav') == ('left_channel.wav', 'right_channel.wav')\", \"assert get_mono_filenames('music_track.wav') == ('left_channel.wav', 'righ... | {
"split": "train",
"index": 76167,
"acecode_id": "oss_31630",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a bank account that starts with a balance of zero. You will receive a list of transactions which can be deposits (positive numbers) or withdrawals (negative numbers). Your goal is to determine if at any point the balance goes below a specified limit... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert below_zero([1, 2, 3]) == False\", \"assert below_zero([1, 2, -4]) == True\", \"assert below_zero([1, 2, -3.5], True) == True\", \"assert below_zero([5, -6]) == True\", \"assert below_zero([-1, -1, -1]) == True\", \"assert below_zero([10, -5, -6]) == True\", ... | {
"split": "train",
"index": 76168,
"acecode_id": "evol_30133",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates basic operations of a bank account system. Your function should take a list of operations, where each operation is represented as a tuple. Each tuple contains a string indicating the operation type ('deposit' or 'withdr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_bank_operations([('deposit', 1000), ('withdraw', 500)]) == 500\", \"assert simulate_bank_operations([('deposit', 1500), ('withdraw', 200), ('withdraw', 1900)]) == 1300\", \"assert simulate_bank_operations([('withdraw', 100)]) == 0\", \"assert simula... | {
"split": "train",
"index": 76169,
"acecode_id": "oss_36795",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the blending of two images using a mask. The function should take three arguments: a source image represented as a 2D list of integers (where each integer represents a pixel value), a target image also represented as a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert blend_images([[255, 0], [0, 255]], [[0, 0], [0, 0]], [[1, 0], [0, 0]]) == [[255, 0], [0, 0]]\", \"assert blend_images([[100, 150], [200, 250]], [[0, 0], [0, 0]], [[1, 1], [0, 0]]) == [[100, 150], [0, 0]]\", \"assert blend_images([[1, 2], [3, 4]], [[5, 6], [7... | {
"split": "train",
"index": 76170,
"acecode_id": "oss_9375",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes a list of integers as input and returns a list of integers from the input where the sum of squares of their digits is divisible by 17. The function should only return the numbers that meet this criteria.\nPlease reason step by step, then write... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_divisible_by_17([1, 2, 3, 4, 5]) == []\", \"assert filter_divisible_by_17([100, 200, 300]) == []\", \"assert filter_divisible_by_17([99999, 88888]) == []\", \"assert filter_divisible_by_17([500, 600, 700]) == []\", \"assert filter_divisible_by_17([123... | {
"split": "train",
"index": 76171,
"acecode_id": "evol_12381",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a binary tree, find the length of the longest consecutive sequence path. The longest consecutive sequence path is defined as a path where each node's value is either one more or one less than its parent node's value. The path can start or end at any node in the tree. Impl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert Solution().longestConsecutive(TreeNode(1)) == 1\", \"assert Solution().longestConsecutive(TreeNode(1, TreeNode(2), TreeNode(3))) == 2\", \"assert Solution().longestConsecutive(TreeNode(1, TreeNode(3, TreeNode(4), TreeNode(2)))) == 2\", \"assert Solution().lo... | {
"split": "train",
"index": 76172,
"acecode_id": "evol_11465",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that manages a simple database of states and cities represented as nested dictionaries. The function should take a list of states, where each state is represented by a dictionary containing a 'name' key and a 'cities' key (which is a list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_states([]) == [{'name': 'California', 'cities': ['San Francisco']}]\", \"assert manage_states([{'name': 'Texas', 'cities': ['Austin', 'Dallas']}]) == [{'name': 'Texas', 'cities': ['Austin', 'Dallas']}, {'name': 'California', 'cities': ['San Francisco'... | {
"split": "train",
"index": 76173,
"acecode_id": "oss_23689",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with computing similarity scores between a given query embedding and a list of pre-trained embeddings. Implement a function `compute_similarity_scores(query_embedding: List[float], embeddings: List[List[float]]) -> List[float]` that takes a query embedding and a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_similarity_scores([1, 0, 0], [[1, 0, 0], [0, 1, 0], [0, 0, 1]]) == [1.0, 0.0, 0.0]\", \"assert compute_similarity_scores([0, 0, 0], [[1, 0, 0], [0, 1, 0]]) == [0.0, 0.0]\", \"assert compute_similarity_scores([], [[1, 2], [3, 4]]) == []\", \"assert co... | {
"split": "train",
"index": 76174,
"acecode_id": "oss_32371",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a list of image URLs and their corresponding alternative texts, write a function that downloads each image and saves it locally using the alternative text as the file name. If the alternative text is not provided, use 'image' as the default file name. The function should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert download_images([('http://example.com/image1.jpg', 'cat'), ('http://example.com/image2.jpg', 'dog')]) == ['cat.jpg', 'dog.jpg']\", \"assert download_images([('http://example.com/image3.jpg', 'sunset'), ('http://example.com/image4.jpg', None)]) == ['sunset.jp... | {
"split": "train",
"index": 76175,
"acecode_id": "oss_32159",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function called `make_lazy_string` that creates a lazy string object. The lazy string should retrieve a value from a provided function the first time it is accessed, and subsequent accesses should return the already retrieved value. If the val... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert str(make_lazy_string(lambda: 'Hello World')) == 'Hello World'\", \"assert str(make_lazy_string(lambda: 42)) == '42'\", \"assert str(make_lazy_string(lambda: None)) == 'None'\", \"assert str(make_lazy_string(lambda: 'value')) == 'value'\", \"assert str(make_l... | {
"split": "train",
"index": 76176,
"acecode_id": "oss_35993",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that extracts module names and their corresponding details from a list of dictionaries. Each dictionary represents a module with its name and details. Your function should take a list of modules as input and return a dictionary con... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_module_details([{'module': 'module1', 'details': {'key1': 'value1', 'key2': 'value2'}}, {'module': 'module2', 'details': {'key3': 'value3', 'key4': 'value4'}}]) == {'module1': {'key1': 'value1', 'key2': 'value2'}, 'module2': {'key3': 'value3', 'key4'... | {
"split": "train",
"index": 76177,
"acecode_id": "oss_3689",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers `xs`. Your task is to implement a function `find_duplicates(xs)` that returns a list of all the duplicate elements in the input list `xs`. The duplicates should be returned in the order of their first appearance in the list. If there are no dupl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_duplicates([1, 2, 3, 4, 2, 5, 6, 3]) == [2, 3]\", \"assert find_duplicates([1, 1, 1, 1]) == [1]\", \"assert find_duplicates([5, 5, 5, 5, 6, 6, 7, 8]) == [5, 6]\", \"assert find_duplicates([1, 2, 3, 4, 5]) == []\", \"assert find_duplicates([]) == []\", \... | {
"split": "train",
"index": 76178,
"acecode_id": "oss_12555",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function named `retrieve_historical_data` that takes two parameters: `content_type_id` (an integer representing the ID of the content type) and `device_id` (an integer representing the ID of the device). The function should simulate the retrie... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert retrieve_historical_data(1, 1) == [{'timestamp': '2023-01-01T00:00:00Z', 'value': 10.5}, {'timestamp': '2023-01-02T00:00:00Z', 'value': 12.0}]\", \"assert retrieve_historical_data(1, 2) == [{'timestamp': '2023-01-01T00:00:00Z', 'value': 9.0}]\", \"assert ret... | {
"split": "train",
"index": 76179,
"acecode_id": "oss_30595",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function `getbit` that takes an integer `num` and a bit position `pos`, and returns the value of the bit at that position. The bit positions are zero-indexed, meaning that `pos = 0` refers to the least significant bit. If the position is out of bounds (greater than ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert getbit(1, 0) == 1\", \"assert getbit(1, 1) == 0\", \"assert getbit(2, 0) == 0\", \"assert getbit(2, 1) == 1\", \"assert getbit(3, 0) == 1\", \"assert getbit(3, 1) == 1\", \"assert getbit(4, 0) == 0\", \"assert getbit(4, 1) == 0\", \"assert getbit(4, 2) == 1\... | {
"split": "train",
"index": 76180,
"acecode_id": "evol_12483",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating the launch of a rocket. Create a function `launch_service(fuel_levels: int) -> str` that initiates the launch sequence based on the provided fuel levels. The function should perform the following steps: \n1. Check the fuel levels: If the fuel leve... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert launch_service(100) == 'Fuel levels checked. All systems are go.\\\\nRocket engine ignited. Stand by for countdown.\\\\n10... 9... 8... 7... 6... 5... 4... 3... 2... 1...\\\\nLiftoff! The rocket has launched successfully.'\", \"assert launch_service(90) == '... | {
"split": "train",
"index": 76181,
"acecode_id": "oss_30546",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating the movement of a turtle based on a sequence of commands. Each command corresponds to a specific movement or action for the turtle. The turtle starts at the center of a grid and moves in a specific pattern based on the commands: 'F' to move forwar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert execute_commands('F') == (0, 50)\", \"assert execute_commands('FF') == (0, 100)\", \"assert execute_commands('F') == (0, 50)\", \"assert execute_commands('FFLF') == (-50, 100)\", \"assert execute_commands('L') == (0, 0)\", \"assert execute_commands('R') == (... | {
"split": "train",
"index": 76182,
"acecode_id": "oss_878",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that modifies a list of URL parts by appending width and height information based on the provided options. The function should take a list of strings (url_parts) and a dictionary (options) as input. The 'options' dictionary may contain th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert (lambda x: (calculate_width_and_height(x, {'width': 100, 'height': 200}), x) == (None, ['100x200']))([])\", \"assert (lambda x: (calculate_width_and_height(x, {'width': 0, 'height': 0}), x) == (None, []))([])\", \"assert (lambda x: (calculate_width_and_heigh... | {
"split": "train",
"index": 76183,
"acecode_id": "bigcode_python_fns_20516",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string 'Python for Data Analysis' and a second string provided by the user, implement a function that counts the frequency of each character in the combined string, and returns a list of characters from the second string that are not present in the first string.\nPlease... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert char_frequency('Python for Data Analysis', 'Python') == []\", \"assert char_frequency('Python for Data Analysis', ' ') == []\", \"assert char_frequency('Python for Data Analysis', 'Data') == []\", \"assert char_frequency('Python for Data Analysis', 'Pyt') ==... | {
"split": "train",
"index": 76184,
"acecode_id": "evol_16886",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of required package dependencies and generates a formatted string representing the dependencies in a specific format. The function should take a list of package names as input and return a string in the format... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_dependencies(['appdirs', 'colorama', 'sh', 'jinja2']) == \\\"install_requires=['appdirs', 'colorama', 'sh', 'jinja2'],\\\"\", \"assert format_dependencies([]) == \\\"install_requires=[],\\\"\", \"assert format_dependencies(['requests']) == \\\"install... | {
"split": "train",
"index": 76185,
"acecode_id": "oss_24498",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that counts the frequency of each character in a given list of strings (tokens) while treating them as case-insensitive. Your function should return a dictionary with a single key 'characters', which maps to another dictionary where t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_character_vocab_count(['Hello', 'hello']) == {'characters': {'h': 2, 'e': 2, 'l': 4, 'o': 2}}\", \"assert get_character_vocab_count(['Python', 'programming']) == {'characters': {'p': 2, 'y': 1, 't': 1, 'h': 1, 'o': 2, 'n': 2, 'r': 2, 'g': 2, 'a': 1, 'm':... | {
"split": "train",
"index": 76186,
"acecode_id": "oss_13084",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a CMake command to set a variable. The function should take three parameters: a string `variable_name` representing the name of the variable, a string `value` representing the value to be assigned to the variable, and a fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_cmake_set_command('MY_VAR', 'Hello World', lambda x: x) == 'set(MY_VAR \\\"Hello World\\\")\\\\n'\", \"assert generate_cmake_set_command('MY_VAR', 'Special $Characters!', lambda x: x.replace('$', '\\\\$')) == 'set(MY_VAR \\\"Special \\\\$Characters!... | {
"split": "train",
"index": 76187,
"acecode_id": "bigcode_python_fns_18227",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of mixed data types, implement a function that sorts the elements in the list based on the frequency of their data types. The elements should be organized such that data types that appear more frequently come first. If two data types have the same frequency, mainta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_by_type_frequency(['apple', 1, 2, 3, 'banana', 'grape', 4]) == [1, 2, 3, 4, 'apple', 'banana', 'grape']\", \"assert sort_by_type_frequency([1, 2, 3, '1', '2', '3']) == [1, 2, 3, '1', '2', '3']\", \"assert sort_by_type_frequency(['one', 'two', 3, 4, 5, '... | {
"split": "train",
"index": 76188,
"acecode_id": "evol_29302",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a JSON object containing information about various companies, each with a name, revenue, and years in business, write a Python function that finds the name of the company with the highest average revenue. The function should handle cases where revenue is negative, unknown... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_highest_avg_revenue({'companies': [{'name': 'Company A', 'revenue': 10000000, 'years_in_business': 0}, {'name': 'Company B', 'revenue': 30000000, 'years_in_business': 5}]}) == 'Company B'\", \"assert find_highest_avg_revenue({'companies': [{'name': 'Com... | {
"split": "train",
"index": 76189,
"acecode_id": "evol_1370",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the scores of students in an exam. Your task is to write a function `compute_average_and_above_threshold` that calculates the average score of the students and counts how many students scored above a given threshold. The function sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_average_and_above_threshold([90, 80, 70, 60], 75) == {'average_score': 75.0, 'above_threshold_count': 2}\", \"assert compute_average_and_above_threshold([], 50) == {'average_score': 0.0, 'above_threshold_count': 0}\", \"assert compute_average_and_abo... | {
"split": "train",
"index": 76190,
"acecode_id": "bigcode_python_fns_20729",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string containing a list of package names separated by commas. Each package name may be followed by a version number in the format 'package_name-version'. Your task is to write a function that takes this string as input and returns a list of package names that n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_packages('pkgA-1.0,pkgB-2.0,pkgC') == ['pkgA', 'pkgB', 'pkgC']\", \"assert update_packages('pkgX-3.0,pkgY-1.2') == ['pkgX', 'pkgY']\", \"assert update_packages('pkg1-0.1,pkg2-0.2,pkg3-0.3') == ['pkg1', 'pkg2', 'pkg3']\", \"assert update_packages('pkgA... | {
"split": "train",
"index": 76191,
"acecode_id": "bigcode_python_fns_48094",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D list 'landscape' representing a synthetic image where each element denotes the height of the terrain at that pixel location. You also have a function 'updated_model' that takes a tuple of coordinates and transforms them into new coordinates. Your task is to c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_landstat([[1, 2], [3, 4]], lambda x, y: (x + 1, y + 1), (0, 0)) == -4\", \"assert compute_landstat([[5]], lambda x, y: (0, 0), (0, 0)) == -5\", \"assert compute_landstat([[1, 3], [2, 4]], lambda x, y: (x, y), (1, 1)) == -4\", \"assert compute_landsta... | {
"split": "train",
"index": 76192,
"acecode_id": "bigcode_python_fns_33384",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a unique identifier for a wallet based on the wallet type, dispatch type, and key management mode. The unique identifier should be a string that concatenates the wallet type, dispatch type, and key management mode, separate... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_wallet_identifier('basic', 'immediate', 'managed') == 'basic-immediate-managed'\", \"assert generate_wallet_identifier('premium', 'scheduled', 'self-managed') == 'premium-scheduled-self-managed'\", \"assert generate_wallet_identifier('standard', 'im... | {
"split": "train",
"index": 76193,
"acecode_id": "oss_635",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple registry to manage a collection of web application instances. Your goal is to create a function `manage_registry` that takes a list of strings representing application names, registers them, and returns the total count of registered app... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_registry(['App1', 'App2', 'App3']) == (3, ['App1', 'App2', 'App3'])\", \"assert manage_registry(['App1', 'App1', 'App2']) == (2, ['App1', 'App2'])\", \"assert manage_registry(['App1', 'App2', 'App2', 'App3']) == (3, ['App1', 'App2', 'App3'])\", \"asse... | {
"split": "train",
"index": 76194,
"acecode_id": "oss_13977",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary where keys are strings and values are lists of integers, write a function that calculates the average of the values for each key and returns a new dictionary containing the keys and their corresponding averages. The function should handle empty lists by retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_averages({'A': [10, 20], 'B': [30, 40, 50], 'C': []}) == {'A': 15.0, 'B': 40.0, 'C': 0}\", \"assert calculate_averages({'X': [1, 2, 3], 'Y': [4, 5], 'Z': [6]}) == {'X': 2.0, 'Y': 4.5, 'Z': 6.0}\", \"assert calculate_averages({'M': [], 'N': [100, 20... | {
"split": "train",
"index": 76195,
"acecode_id": "evol_19874",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers where each integer represents the score of a player in a game. Your task is to implement a function that calculates the average score of all players. The function should return the average score rounded to two decimal places. If the list is empt... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_score([10, 20, 30]) == 20.00\", \"assert calculate_average_score([100, 200, 300, 400]) == 250.00\", \"assert calculate_average_score([1, 2, 3, 4, 5]) == 3.00\", \"assert calculate_average_score([0, 0, 0]) == 0.00\", \"assert calculate_avera... | {
"split": "train",
"index": 76196,
"acecode_id": "bigcode_python_fns_39850",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `get_nth_fibonacci(n: int) -> int` that returns the nth Fibonacci number. The Fibonacci sequence is defined as follows: F(0) = 0, F(1) = 1, and F(n) = F(n-1) + F(n-2) for n >= 2. Your implementation should not use any built-in functions or libraries for han... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_nth_fibonacci(0) == 0\", \"assert get_nth_fibonacci(1) == 1\", \"assert get_nth_fibonacci(2) == 1\", \"assert get_nth_fibonacci(3) == 2\", \"assert get_nth_fibonacci(4) == 3\", \"assert get_nth_fibonacci(5) == 5\", \"assert get_nth_fibonacci(6) == 8\", \... | {
"split": "train",
"index": 76197,
"acecode_id": "evol_9384",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates the behavior of a package utility and a task submission system. Your function should take in a source directory name, a destination directory name, a configuration dictionary, a boolean indicating if the task is inte... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_task('src_dir1', 'dest_dir1', {'key': 'value1'}, True, ['file1.txt']) == 'Task submitted successfully.'\", \"assert process_task('src_dir2', 'dest_dir2', {'key': 'value2'}, False, ['file2.txt', 'file3.txt']) == 'Task submitted successfully.'\", \"ass... | {
"split": "train",
"index": 76198,
"acecode_id": "oss_8131",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function 'count_letters(string_name)' that takes a string as input and returns the total number of characters in the string. The function should be efficient and concise. Do not use any external libraries.\nPlease reason step by step, then write a self-contained Pyt... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_letters('hello') == 5\", \"assert count_letters('') == 0\", \"assert count_letters('Python') == 6\", \"assert count_letters('12345') == 5\", \"assert count_letters('!@#$%') == 5\", \"assert count_letters('SingleWord') == 10\", \"assert count_letters('M... | {
"split": "train",
"index": 76199,
"acecode_id": "evol_34317",
"num_tests": 13
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.