data_source
large_stringclasses
1 value
prompt
listlengths
1
1
ability
large_stringclasses
1 value
reward_model
dict
extra_info
dict
acecode
[ { "role": "user", "content": "You are given a canvas where a user can click to create shapes. The first click creates a circle at the clicked position, and the second click will create a line that connects the center of the circle to the position of the second click. Your task is to implement a function `dr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert draw_shapes((10, 20), (30, 40)) == ['Circle', 'Line']\", \"assert draw_shapes((5, 5), (15, 15)) == ['Circle', 'Line']\", \"assert draw_shapes((0, 0), (0, 10)) == ['Circle', 'Line']\", \"assert draw_shapes((-1, -1), (1, 1)) == ['Circle', 'Line']\", \"assert d...
{ "split": "train", "index": 78300, "acecode_id": "bigcode_python_fns_21315", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `word`, implement a function `calculate_additive_value(word: str) -> int` that calculates the additive value of the string. The additive value is defined as the sum of the ASCII values of all the characters in the string. The function should return this sum as an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_additive_value('word') == 444\", \"assert calculate_additive_value('hello') == 532\", \"assert calculate_additive_value('') == 0\", \"assert calculate_additive_value('a') == 97\", \"assert calculate_additive_value('A') == 65\", \"assert calculate_a...
{ "split": "train", "index": 78301, "acecode_id": "bigcode_python_fns_31410", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing file contents. Write a function `group_lines_by_header(lines: List[str]) -> Dict[str, List[str]]` that groups the lines by their headers. The header is defined as the first word of each line, and the lines that share the same header ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert group_lines_by_header(['A line 1', 'A line 2', 'B line 1', 'C line 1', 'B line 2']) == {'A': ['A line 1', 'A line 2'], 'B': ['B line 1', 'B line 2'], 'C': ['C line 1']}\", \"assert group_lines_by_header(['A line 1']) == {'A': ['A line 1']}\", \"assert group_...
{ "split": "train", "index": 78302, "acecode_id": "bigcode_python_fns_2494", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a UTC datetime string and a timezone string, write a function that converts the UTC datetime to the corresponding local datetime in the specified timezone. The function should return the local datetime as a string in the format 'YYYY-MM-DD HH:MM:SS'. If the provided timez...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_utc_to_local('2023-10-01 12:00:00', 'America/New_York') == '2023-10-01 08:00:00'\", \"assert convert_utc_to_local('2023-10-01 12:00:00', 'Europe/London') == '2023-10-01 13:00:00'\", \"assert convert_utc_to_local('2023-10-01 12:00:00', 'Asia/Tokyo') =...
{ "split": "train", "index": 78303, "acecode_id": "bigcode_python_fns_46104", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to find the next set of waypoints for a vehicle navigation system. The function should take a list of waypoints, a starting waypoint index, and an ending waypoint index as input, and return the next set of waypoints based on a lookahe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert next_waypoints_set([{'x': 1.0, 'y': 2.0, 'z': 3.0}, {'x': 4.0, 'y': 5.0, 'z': 6.0}, {'x': 7.0, 'y': 8.0, 'z': 9.0}, {'x': 10.0, 'y': 11.0, 'z': 12.0}, {'x': 13.0, 'y': 14.0, 'z': 15.0}, {'x': 16.0, 'y': 17.0, 'z': 18.0}], 0, 6) == [{'x': 1.0, 'y': 2.0, 'z': ...
{ "split": "train", "index": 78304, "acecode_id": "oss_19382", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that calculates the learning rate for a neural network based on its size. The learning rate is determined by the formula: `lr = 9e-4 / sqrt(hid2_size)`, where `hid2_size` is the size of the neural network. Your function should take...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert abs(calculate_learning_rate(1) - 0.0009) < 1e-9\", \"assert abs(calculate_learning_rate(4) - 0.00045) < 1e-9\", \"assert abs(calculate_learning_rate(16) - 0.000225) < 1e-9\", \"assert abs(calculate_learning_rate(64) - 0.0001125) < 1e-9\", \"assert abs(calcul...
{ "split": "train", "index": 78305, "acecode_id": "oss_16637", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Implement a function `get_binary_context()` that returns a string representing the context for binary functions. The context should be described simply as 'Binary Function Context'. This function does not take any parameters and should return the specified string.\nPlease reaso...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_binary_context() == 'Binary Function Context'\", \"assert get_binary_context() == 'Binary Function Context'\", \"assert get_binary_context() == 'Binary Function Context'\", \"assert get_binary_context() == 'Binary Function Context'\", \"assert get_binary...
{ "split": "train", "index": 78306, "acecode_id": "bigcode_python_fns_330", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a non-negative integer n, implement a function that computes the nth Fibonacci number using an efficient approach. 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 handle large inputs and 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": 78307, "acecode_id": "evol_26211", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a file processing algorithm for a job scheduling system. The algorithm should distribute a given number of files evenly across a specified number of jobs. Each job should receive an equal or nearly equal number of files, and any remaining files ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert distribute_files(10, 3) == [4, 3, 3]\", \"assert distribute_files(10, 4) == [3, 3, 2, 2]\", \"assert distribute_files(0, 5) == [0, 0, 0, 0, 0]\", \"assert distribute_files(5, 5) == [1, 1, 1, 1, 1]\", \"assert distribute_files(7, 3) == [3, 2, 2]\", \"assert d...
{ "split": "train", "index": 78308, "acecode_id": "oss_32817", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a web server's CGI response handling. Your function should be able to construct a response with a given status code, file path, and command to execute. The function should return a dictionary containing the response status ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_cgi_response(200, '/data/file.md', 'python -c \\\"print(\\\\\\\"Hello\\\\\\\")\\\"') == {'status_code': 200, 'content': b'CONTENT\\\\n'}\", \"assert simulate_cgi_response(404, '/data/notfound.md', 'python -c \\\"print(\\\\\\\"Not found\\\\\\\")\\\"'...
{ "split": "train", "index": 78309, "acecode_id": "oss_12992", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of paths, implement a function `change_directory` that takes a list of strings `paths` and a string `current_directory`. The function should simulate changing the current directory to each path in the list sequentially, starting from `current_directory`. For each p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert change_directory(['/home/user', 'invalid_path', '/etc', '/usr/local'], '/home') == '/usr/local'\", \"assert change_directory(['invalid_path', 'invalid_path'], '/home') == '/home'\", \"assert change_directory(['/var/log', '/tmp'], '/home') == '/tmp'\", \"asse...
{ "split": "train", "index": 78310, "acecode_id": "bigcode_python_fns_6595", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two integers x and y, implement a function get_sum(x, y) that returns the sum of all integers between x and y (inclusive). The function should handle both positive and negative integers and should be efficient in terms of time complexity.\nPlease reason step by step, then...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_sum(1, 5) == 15\", \"assert get_sum(5, 1) == 15\", \"assert get_sum(-1, 1) == 0\", \"assert get_sum(0, 0) == 0\", \"assert get_sum(-5, -1) == -15\", \"assert get_sum(-3, 3) == 0\", \"assert get_sum(10, 10) == 10\", \"assert get_sum(-10, -5) == -45\", \"a...
{ "split": "train", "index": 78311, "acecode_id": "evol_14275", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simplified database connection manager. The function, `manage_database_connection`, takes a database URL as input and returns a string indicating whether the connection was successfully established or if there was an ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_database_connection('valid_database_url') == 'Connection established successfully.'\", \"assert manage_database_connection('') == 'Error: Invalid database URL.'\", \"assert manage_database_connection('invalid') == 'Error: Connection failed.'\", \"asse...
{ "split": "train", "index": 78312, "acecode_id": "oss_23547", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `is_ncname(value: str) -> bool` that determines if the given string `value` is a valid NCName according to the following rules: An NCName must start with a letter (A-Z or a-z) and can be followed by any combination of letters and digits (A-Z, a-z, 0-9). The...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_ncname('') == False\", \"assert is_ncname('999') == False\", \"assert is_ncname('x') == True\", \"assert is_ncname('A1') == True\", \"assert is_ncname('abc') == True\", \"assert is_ncname('Xyz123') == True\", \"assert is_ncname('1abc') == False\", \"asser...
{ "split": "train", "index": 78313, "acecode_id": "bigcode_python_fns_1944", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two points in a 2D space represented by their coordinates. Write a function `calculate_distance(point_a: Tuple[int, int], point_b: Tuple[int, int]) -> float` that calculates the Euclidean distance between these two points. The Euclidean distance is defined as the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_distance((0, 0), (3, 4)) == 5.0\", \"assert calculate_distance((1, 1), (1, 1)) == 0.0\", \"assert calculate_distance((-1, -1), (1, 1)) == 2.8284271247461903\", \"assert calculate_distance((2, 3), (5, 7)) == 5.0\", \"assert calculate_distance((-3, -...
{ "split": "train", "index": 78314, "acecode_id": "bigcode_python_fns_3265", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a unique action identifier for a test action based on given parameters. The function should take a context string and additional keyword arguments that represent attributes of the action. The function should combine the con...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_action_id('test_context') == 'test_context'\", \"assert generate_action_id('test_context', action_type='create') == 'test_context: action_type=create'\", \"assert generate_action_id('test_context', action_type='create', status='pending') == 'test_co...
{ "split": "train", "index": 78315, "acecode_id": "bigcode_python_fns_36601", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `check_login(user: Optional[str], method: str) -> str` that simulates a simple authentication check based on the user's login status and the HTTP method. The function takes two parameters: `user`, which is a string representing the curren...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_login('Alice', 'GET') == 'Access granted, proceed with GET request.'\", \"assert check_login('Alice', 'POST') == 'Access granted, proceed with POST request.'\", \"assert check_login(None, 'GET') == 'Redirect to login page with next URL.'\", \"assert ch...
{ "split": "train", "index": 78316, "acecode_id": "bigcode_python_fns_33141", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to find the shortest path between two nodes in a directed graph represented as an adjacency list. Each edge has an associated weight. Your function should take the graph, the starting node, and the target node as input and return the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert shortest_path({'A': [('B', 5), ('C', 3)], 'B': [('C', 2), ('D', 6)], 'C': [('D', 7)], 'D': [('A', 2)]}, 'A', 'D') == (['A', 'C', 'D'], 10)\", \"assert shortest_path({'A': [('B', 1)], 'B': [('C', 2), ('D', 6)], 'C': [('D', 3)], 'D': []}, 'A', 'D') == (['A', '...
{ "split": "train", "index": 78317, "acecode_id": "oss_7788", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function that checks if two given strings are anagrams of each other, considering case insensitivity and ignoring whitespace and special characters. An anagram is defined as a word or phrase formed by rearranging the letters of another. The function should return Tr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert areAnagrams('Listen', 'Silent') == True\", \"assert areAnagrams('Hello, World!', 'dlrow olleh') == True\", \"assert areAnagrams('Astronomer', 'Moon starer') == True\", \"assert areAnagrams('The Morse Code', 'Here come dots') == True\", \"assert areAnagrams('...
{ "split": "train", "index": 78318, "acecode_id": "evol_17645", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `trigger_caching(transactionId: str, logIndex: int) -> Union[Dict[str, Any], str]` that simulates the triggering of caching for a specific transaction based on its ID and a log index. The function will take two parameters, `transactio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert trigger_caching('tx123', 0) == {'status': 'success'}\", \"assert trigger_caching('tx123', 1) == {'status': 'success'}\", \"assert trigger_caching('tx123', 5) == {'status': 'success'}\", \"assert trigger_caching('tx123', 9) == {'status': 'success'}\", \"asser...
{ "split": "train", "index": 78319, "acecode_id": "bigcode_python_fns_47225", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a positive integer `n`. Your task is to write a function that takes `n` as input and returns the minimum number of operations required to make `n` equal to 1. The allowed operations are as follows: 1. If `n` is odd, you can subtract 1 from it. 2. If `n` is even, y...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert min_operations_to_one(1) == 0\", \"assert min_operations_to_one(2) == 1\", \"assert min_operations_to_one(3) == 2\", \"assert min_operations_to_one(4) == 2\", \"assert min_operations_to_one(5) == 3\", \"assert min_operations_to_one(6) == 3\", \"assert min_op...
{ "split": "train", "index": 78320, "acecode_id": "oss_16069", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `generate_password(length: int, complexity: int) -> str` that generates a secure, random password of a specified length and complexity. The complexity determines the types of characters to include in the password. The complexity levels are defined as follow...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_password(8, 4) != ''\", \"assert len(generate_password(10, 3)) == 10\", \"assert any(c.islower() for c in generate_password(12, 1))\", \"assert any(c.isupper() for c in generate_password(12, 2))\", \"assert any(c.isdigit() for c in generate_password...
{ "split": "train", "index": 78321, "acecode_id": "evol_27511", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that checks if a given string contains only alphanumeric characters (i.e., letters and digits) and returns True if it does; otherwise, it returns False. The input string can include spaces and special characters, which should be considered invalid. For exam...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_alpha_num('Welcome123') == True\", \"assert is_alpha_num('HelloWorld') == True\", \"assert is_alpha_num('12345') == True\", \"assert is_alpha_num('A1B2C3') == True\", \"assert is_alpha_num('Welcome 123') == False\", \"assert is_alpha_num('Hello World!') =...
{ "split": "train", "index": 78322, "acecode_id": "evol_5631", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves the content of a blog post from a predefined dictionary. The function should take a string parameter representing the name of the blog post. If the blog post exists in the dictionary, the function should return the content ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_blog_post_content('post1') == 'This is the content of post 1.'\", \"assert get_blog_post_content('post2') == 'Welcome to post 2. Enjoy reading!'\", \"assert get_blog_post_content('post3') == 'Post 3 content goes here.'\", \"assert get_blog_post_content('...
{ "split": "train", "index": 78323, "acecode_id": "oss_26682", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a Gaussian random walk process. In this process, the initial position is at 0. At each time step, the position changes by a random amount drawn from a Gaussian (normal) distribution with mean 0 and standard deviation 1. Your job is to implement a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert len(simulate_random_walk(0)) == 1\", \"assert len(simulate_random_walk(1)) == 2\", \"assert len(simulate_random_walk(2)) == 3\", \"assert len(simulate_random_walk(5)) == 6\", \"assert len(simulate_random_walk(10)) == 11\", \"assert len(simulate_random_walk(1...
{ "split": "train", "index": 78324, "acecode_id": "oss_20194", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that represents a property with a specific type and value. The function should take two parameters: `value` (which can be of any type) and `_type` (which is a string that represents the type of the property and can be one of 'string', 'in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_property('Hello', 'string') == {'property_type': 'string', 'property_value': 'Hello'}\", \"assert create_property(10, 'integer') == {'property_type': 'integer', 'property_value': 10}\", \"assert create_property(True, 'boolean') == {'property_type': 'b...
{ "split": "train", "index": 78325, "acecode_id": "oss_35760", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of objects, where each object is a dictionary that contains the following keys: 'invId', 'dsId', and 'dfId'. Write a function `extract_ids(objects: List[Dict[str, Any]]) -> Tuple[List[int], List[int], List[int]]` that takes this list of objects as input and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_ids([{'invId': 1, 'dsId': 10, 'dfId': 100}, {'invId': 2, 'dsId': 20, 'dfId': 200}]) == ([1, 2], [10, 20], [100, 200])\", \"assert extract_ids([{'invId': 1}, {'dsId': 20, 'dfId': 200}, {'invId': 3, 'dsId': 30}]) == ([1, 3], [20, 30], [200])\", \"asser...
{ "split": "train", "index": 78326, "acecode_id": "bigcode_python_fns_21727", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given the attributes of a podcast episode, implement a function `create_episode(title: str, description: str, length: int, host: str, release_date: str) -> dict` that creates a dictionary representation of a podcast episode. The dictionary should contain the following keys: 'ti...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_episode('Episode 1', 'Description of episode 1', 45, 'Host A', '01/01/2023') == {'title': 'Episode 1', 'description': 'Description of episode 1', 'length': 45, 'host': 'Host A', 'release_date': '01/01/2023', 'isPlaying': False, 'current_play_time': 0}...
{ "split": "train", "index": 78327, "acecode_id": "evol_20164", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of services, each represented as a dictionary with the keys 'name' (a string), 'status' (a string), and 'config' (a dictionary). Your task is to create a function called `get_service_details(services: List[Dict[str, Any]], name: str, is_admin: bool) -> Dict...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_service_details([{'name': 'ServiceA', 'status': 'available', 'config': {'option1': 'value1', 'option2': 'value2', 'public_option': 'public_value'}}, {'name': 'ServiceB', 'status': 'unavailable', 'config': {'option1': 'value1'}}, {'name': 'ServiceC', 'sta...
{ "split": "train", "index": 78328, "acecode_id": "bigcode_python_fns_4569", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given a 2D list representing an image and a 2D list representing a smoothing block. Your task is to implement a function `smooth_image` that applies a smoothing operation to the input image using the smoothing block. For each pixel in the input image, replace it with th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert smooth_image([[0, 0], [0, 0]], [[1]]) == [[0, 0], [0, 0]]\", \"assert smooth_image([[255, 255], [255, 255]], [[1]]) == [[255, 255], [255, 255]]\", \"assert smooth_image([[100]], [[1]]) == [[100]]\", \"assert smooth_image([[1]], [[0]]) == [[0]]\", \"assert sm...
{ "split": "train", "index": 78329, "acecode_id": "oss_12042", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Design a function to extract and return only the numeric values (both negative and positive) from a given string. The function should also be able to handle decimal numbers. The output should be a list of floats representing the extracted numbers.\nPlease reason step by step, t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_numbers('The temperatures today are -10.5, 0, and 25 degrees.') == [-10.5, 0.0, 25.0]\", \"assert extract_numbers('No numbers here!') == []\", \"assert extract_numbers('The bank gave me a loan of -1500.75 dollars.') == [-1500.75]\", \"assert extract_...
{ "split": "train", "index": 78330, "acecode_id": "evol_34532", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `get_database_uri` that constructs a SQLAlchemy database URI given the database connection parameters. The function should take the following parameters: `server` (str), `user` (str), `password` (str), `db` (str). The function should return the constructed ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_database_uri('localhost', 'user', 'password', 'mydb') == 'postgresql://user:password@localhost/mydb'\", \"assert get_database_uri('127.0.0.1', 'admin', 'secret', 'testdb') == 'postgresql://admin:secret@127.0.0.1/testdb'\", \"assert get_database_uri('my.s...
{ "split": "train", "index": 78331, "acecode_id": "evol_15480", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with checking whether certain Python modules are available in the current environment. Create a function `check_modules(modules: List[str]) -> List[str]` that takes a list of module names as input and returns a list of strings indicating which modules are missing...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_modules(['os', 'nonexistent_module']) == ['WARNING: nonexistent_module is necessary. Please install nonexistent_module']\", \"assert check_modules(['json', 'math', 'random']) == []\", \"assert check_modules(['random', 'nonexistent_module', 'math']) == ...
{ "split": "train", "index": 78332, "acecode_id": "bigcode_python_fns_45546", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a board with a specified width and a starting position of a player on that board. The player can take a certain number of steps to the right. However, the board wraps around when the player reaches the end of it. Implement a function that calculates the player's n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert move_player(0, 3, 5) == 3\", \"assert move_player(2, 5, 5) == 2\", \"assert move_player(1, 7, 5) == 3\", \"assert move_player(4, 1, 5) == 0\", \"assert move_player(3, 6, 5) == 4\", \"assert move_player(0, 0, 5) == 0\", \"assert move_player(2, 10, 5) == 2\", ...
{ "split": "train", "index": 78333, "acecode_id": "bigcode_python_fns_1926", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing a JSON object. Your task is to extract the value of a specified key from this JSON object. The input will be a string containing valid JSON and a key for which you need to find the corresponding value. If the key does not exist in the JSON ob...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_value('{\\\"name\\\":\\\"John\\\", \\\"age\\\":30}', 'name') == 'John'\", \"assert extract_value('{\\\"name\\\":\\\"John\\\", \\\"age\\\":30}', 'age') == '30'\", \"assert extract_value('{\\\"city\\\":\\\"New York\\\", \\\"country\\\":\\\"USA\\\"}', '...
{ "split": "train", "index": 78334, "acecode_id": "bigcode_python_fns_23824", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function `trapezoid_area(base1: float, base2: float, height: float) -> float` that calculates the area of a trapezoid given the lengths of its two bases and its height. The formula for the area of a trapezoid is: \\( Area = \\frac{(base1 + base2)}{2} \\times height ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert trapezoid_area(5, 10, 4) == 30.0\", \"assert trapezoid_area(3, 7, 5) == 25.0\", \"assert trapezoid_area(1, 1, 1) == 1.0\", \"assert trapezoid_area(0, 0, 0) == 0.0\", \"assert trapezoid_area(2, 8, 3) == 15.0\", \"assert trapezoid_area(6, 4, 2) == 10.0\", \"as...
{ "split": "train", "index": 78335, "acecode_id": "evol_10233", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a positive integer n, write a function that returns a list of all distinct prime factors of n in ascending order. The function should only return the prime factors without their multiplicities. If n is 1, the function should return an empty list. For example, if n = 28, t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert prime_factors(1) == []\", \"assert prime_factors(2) == [2]\", \"assert prime_factors(3) == [3]\", \"assert prime_factors(4) == [2]\", \"assert prime_factors(5) == [5]\", \"assert prime_factors(6) == [2, 3]\", \"assert prime_factors(7) == [7]\", \"assert prim...
{ "split": "train", "index": 78336, "acecode_id": "bigcode_python_fns_5625", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of EMG values and returns the average EMG value. Write a function called `average_emg` that takes in one parameter: `emg_values` (list of floats) - representing the EMG values. The function should return a flo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_emg([1.0, 2.0, 3.0]) == 2.0\", \"assert average_emg([0.0]) == 0.0\", \"assert average_emg([2.5, 3.5, 4.5]) == 3.5\", \"assert average_emg([-1.0, 1.0]) == 0.0\", \"assert average_emg([]) == 0.0\", \"assert average_emg([5.0, 5.0, 5.0, 5.0]) == 5.0\", \...
{ "split": "train", "index": 78337, "acecode_id": "oss_9299", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings of the same length `words`, a string `target`, and an integer `n`. Your task is to form `target` using the given `words` under the following rules: `target` should be formed from right to left. To form the `ith` character (0-indexed) of `target`,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert numOfWays(['abcd'], 'abcd', 4) == 1\", \"assert numOfWays(['aaaa', 'bbbb', 'cccc'], 'abcd', 4) == 0\", \"assert numOfWays(['aaa', 'aaa', 'aaa'], 'aaa', 3) == 27\", \"assert numOfWays(['a', 'b', 'c'], 'abc', 2) == 0\", \"assert numOfWays(['zzzz', 'zzzz'], 'zz...
{ "split": "train", "index": 78338, "acecode_id": "evol_2312", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a simple message retrieval system. Write a function `runReader(readerId, sleep, concurrent_mode)` that retrieves messages based on the given parameters. The function takes three parameters: \n- `readerId`: an integer representing the unique identi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert runReader(1, 2, False) == 'Reader 1 is running in non-concurrent mode with a sleep duration of 2 seconds.'\", \"assert runReader(2, 3.5, True) == 'Reader 2 is running in concurrent mode with a sleep duration of 3.5 seconds.'\", \"assert runReader(3, 1, False...
{ "split": "train", "index": 78339, "acecode_id": "oss_9301", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers and a number. Your task is to implement a function `calculate(numbers: List[int], number: int) -> Union[int, None]`. If the number is even, the function should return the sum of all even numbers in the list. If the number is odd, the function sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate([1, 2, 3, 4, 5, 6], 2) == 12\", \"assert calculate([1, 3, 5, 7, 9], 1) == 945\", \"assert calculate([-2, 0, 2, 4], 2) == 4\", \"assert calculate([-1, -3, -5], 3) == -15\", \"assert calculate([1, 2, 3, 4], 3) == 3\", \"assert calculate([2, 4, 6, 8],...
{ "split": "train", "index": 78340, "acecode_id": "oss_9776", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that generates a formatted log string based on the provided information. Your function should take in three parameters: `content` (a string representing the content to be logged), `filename` (a string representing the name of the l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_log_entry('Test content', 'my_log', '2023-10-01 12:00:00') == '[2023-10-01 12:00:00] my_log.log: Test content'\", \"assert generate_log_entry('Another log entry', 'event_log', '2023-10-02 15:30:45') == '[2023-10-02 15:30:45] event_log.log: Another l...
{ "split": "train", "index": 78341, "acecode_id": "oss_22603", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers representing node values in a directed graph, and a list of tuples representing directed edges between these nodes, implement a function that returns a list of the node values in topologically sorted order. The input nodes and edges represent a directed...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert topological_sort([], []) == []\", \"assert topological_sort([1], []) == [1]\", \"assert topological_sort([1, 2], [(1, 2)]) == [1, 2]\", \"assert topological_sort([1, 2], [(2, 1)]) == [2, 1]\", \"assert topological_sort([1, 2, 3], [(1, 2), (1, 3)]) == [1, 2, ...
{ "split": "train", "index": 78342, "acecode_id": "bigcode_python_fns_39494", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Write a function that evaluates if two given strings contain the same unique words, where uppercase and non-alphanumeric characters are disregarded. Additionally, compare the frequency of each unique word within the phrases. The function should return True if both strings conta...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compare_word_sets('Hello world!', 'world hello') == True\", \"assert compare_word_sets('dog cat', 'cat dog dog') == False\", \"assert compare_word_sets('Test case', 'case test') == True\", \"assert compare_word_sets('Same words', 'Same Words') == True\", \"a...
{ "split": "train", "index": 78343, "acecode_id": "evol_26826", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to implement a function that simulates the creation of a migration based on a given name. The function should take a string input representing the name of the migration and return a JSON-like dictionary with a success message if the migration name is valid (i.e., it is...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_migration('valid_name') == {'message': 'Migration valid_name created successfully.', 'status': 'success'}\", \"assert create_migration('') == {'message': 'Invalid migration name.', 'status': 'error'}\", \"assert create_migration('123_migration') == {'...
{ "split": "train", "index": 78344, "acecode_id": "bigcode_python_fns_21029", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a phrase as a string, reorganize the words in the phrase into a new phrase sorted in alphabetical order. The input phrase will be a valid sentence containing words separated by spaces. Write a function that takes this phrase as input and returns the newly composed phrase....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reorganize_phrase('The quick brown fox jumps over the lazy dog') == 'The brown dog fox jumps lazy over quick the'\", \"assert reorganize_phrase('Hello world this is a test') == 'Hello a is test this world'\", \"assert reorganize_phrase('Python is awesome and...
{ "split": "train", "index": 78345, "acecode_id": "evol_4364", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a function that performs five distinct operations on a provided nested list, where each inner list is composed of string elements. The first operation requires the removal of any duplicate string elements within each unique inner list. After duplicates are removed, the s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_nested_list([['apple', 'banana', 'apple'], ['cat', 'dog', 'cat']]) == [['apple', 'banana'], ['cat', 'dog']]\", \"assert process_nested_list([['abc', 'def', 'ghi'], ['jkl', 'mno']]) == [['abc', 'def', 'ghi'], ['jkl', 'mno']]\", \"assert process_nested...
{ "split": "train", "index": 78346, "acecode_id": "evol_6846", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are given a list of file names and a prefix string. Your task is to implement a function that filters the file names and returns a list of those that start with the given prefix and end with a specified file extension. If no extension is provided, return all files that star...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_files(['file1.txt', 'file2.txt', 'file3.pdf', 'file4.txt'], 'file', 'txt') == ['file1.txt', 'file2.txt', 'file4.txt']\", \"assert filter_files(['image1.png', 'image2.png', 'document.docx'], 'image', 'png') == ['image1.png', 'image2.png']\", \"assert f...
{ "split": "train", "index": 78347, "acecode_id": "bigcode_python_fns_5935", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of file names, each representing a header file (without extensions), write a function that checks if a corresponding '.h' file exists in a predefined directory structure (simulated as a list of strings representing file paths). If the file exists, return a formatte...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_include_statements(['foo', 'bar'], ['./webrtc/foo.h', './webrtc/baz.h']) == ['#include \\\"./webrtc/foo.h\\\"', '#include \\\"bar.h\\\"']\", \"assert add_include_statements(['baz', 'qux'], ['./webrtc/foo.h', './webrtc/baz.h']) == ['#include \\\"./webrtc/...
{ "split": "train", "index": 78348, "acecode_id": "bigcode_python_fns_18544", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Develop a function that performs a circular shift of a given string by a specified number of characters. The function should be able to handle both positive and negative shift values, where a positive value indicates a rightward shift and a negative value indicates a leftward s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert circular_shift('hello', 2) == 'lohel'\", \"assert circular_shift('hello', -2) == 'llohe'\", \"assert circular_shift('abcdef', 3) == 'defabc'\", \"assert circular_shift('abcdef', 6) == 'abcdef'\", \"assert circular_shift('abcdef', -6) == 'abcdef'\", \"assert ...
{ "split": "train", "index": 78349, "acecode_id": "evol_27874", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that generates a random sequence of 5 alphabetic characters, which can include both uppercase and lowercase letters. The function should return this sequence as a string.\nPlease reason step by step, then write a self-contained Python solution. Give your fi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert len(generate_sequence()) == 5\", \"assert all(c.isalpha() for c in generate_sequence())\", \"assert all(c.islower() or c.isupper() for c in generate_sequence())\", \"assert generate_sequence() != generate_sequence()\", \"assert generate_sequence() != generat...
{ "split": "train", "index": 78350, "acecode_id": "evol_15240", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two arrays, an array of non-negative integers and an array of boolean values, return a copy of the integer array sorted according to the following conditions: \n\n1. Form groups of elements according to the start and end index values' parity in relation to the correspondi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert custom_sort([], []) == []\", \"assert custom_sort([1], [True]) == [1]\", \"assert custom_sort([2], [False]) == [2]\", \"assert custom_sort([2, 3], [True, False]) == [2, 3]\", \"assert custom_sort([2, 3, 6, 1, 4], [True, False, True, False, True]) == [2, 4, 6...
{ "split": "train", "index": 78351, "acecode_id": "evol_2214", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a string representing a directory path (root) and a set of directory paths to avoid (dirsToAvoid). Write a function that returns True if any of the directories in the root path are present in the dirsToAvoid set, and False otherwise. The directory paths are repres...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert shouldAvoidDirectory('a/b/c', {'a', 'a/b'}) == True\", \"assert shouldAvoidDirectory('a/b/c', {'b', 'c'}) == False\", \"assert shouldAvoidDirectory('home/user/documents', {'home/user', 'home'}) == True\", \"assert shouldAvoidDirectory('var/log/sys', {'var/lo...
{ "split": "train", "index": 78352, "acecode_id": "bigcode_python_fns_5187", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function that takes in a number represented as a string, 'value', and two integers, 'low' and 'high', establishing range parameters. This function should yield the nearest integer to the input number without falling back on standard functions such as round(). Additiona...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert complex_rounding('3.4', 1, 5) == 3\", \"assert complex_rounding('3.6', 1, 5) == 4\", \"assert complex_rounding('4.5', 1, 5) == 4\", \"assert complex_rounding('-3.4', -5, -1) == -3\", \"assert complex_rounding('-3.6', -5, -1) == -4\", \"assert complex_roundin...
{ "split": "train", "index": 78353, "acecode_id": "evol_27339", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a list of time intervals represented as tuples of (days, seconds), write a function that converts each time interval into hours. The function should return a list of floats representing the total hours for each interval. The input list will contain at least one interval a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_intervals_to_hours([(1, 0)]) == [24.0]\", \"assert convert_intervals_to_hours([(0, 3600)]) == [1.0]\", \"assert convert_intervals_to_hours([(0, 7200), (1, 0)]) == [2.0, 24.0]\", \"assert convert_intervals_to_hours([(0, 0)]) == [0.0]\", \"assert conve...
{ "split": "train", "index": 78354, "acecode_id": "bigcode_python_fns_30278", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a string `sequence` and a list of `subsequences`, implement a function `find_occurrences(sequence: str, subsequences: List[str]) -> Dict[str, int]` that returns a dictionary where the keys are the subsequences and the values are their respective counts of occurrences in t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_occurrences('Please find the number of occurrences of this string', ['string', 'find', 'Please', 'non-existing']) == {'string': 1, 'find': 1, 'Please': 1, 'non-existing': 0}\", \"assert find_occurrences('abcabcabc', ['abc', 'a', 'b', 'c', 'd']) == {'abc...
{ "split": "train", "index": 78355, "acecode_id": "evol_718", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of health check types, where each type is represented by a dictionary containing an 'id' (integer) and a 'name' (string). Your task is to implement a function that takes this list as input and returns a sorted list of tuples. Each tuple should contain the '...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_health_check_types([{'id': 2, 'name': 'HTTP'}, {'id': 1, 'name': 'TCP'}, {'id': 3, 'name': 'ICMP'}]) == [(1, 'TCP'), (2, 'HTTP'), (3, 'ICMP')]\", \"assert sort_health_check_types([{'id': 5, 'name': 'DNS'}, {'id': 3, 'name': 'TCP'}, {'id': 4, 'name': 'HT...
{ "split": "train", "index": 78356, "acecode_id": "bigcode_python_fns_28488", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dataset of points and their corresponding labels. Implement a function `classify_kNN(test_point: List[int], dataset: List[List[int]], labels: List[str], k: int) -> str` that classifies a given test point using the k-Nearest Neighbors (kNN) algorithm. The functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert classify_kNN([1, 1], [[1, 1], [1, 2], [2, 1]], ['A', 'A', 'A'], 1) == 'A'\", \"assert classify_kNN([1, 1], [[1, 1], [1, 2], [2, 1]], ['A', 'A', 'A'], 2) == 'A'\", \"assert classify_kNN([4, 4], [[1, 1], [1, 2], [4, 4]], ['A', 'A', 'B'], 1) == 'B'\", \"assert ...
{ "split": "train", "index": 78357, "acecode_id": "oss_31212", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with converting a given temperature in degrees Celsius to degrees Fahrenheit. Implement a function called `celsius_to_fahrenheit` that takes a single parameter `celsius_temp` (a float representing the temperature in degrees Celsius) and returns a string represent...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert celsius_to_fahrenheit(0) == 'Fahrenheit equivalent: 32.0'\", \"assert celsius_to_fahrenheit(100) == 'Fahrenheit equivalent: 212.0'\", \"assert celsius_to_fahrenheit(-40) == 'Fahrenheit equivalent: -40.0'\", \"assert celsius_to_fahrenheit(25) == 'Fahrenheit e...
{ "split": "train", "index": 78358, "acecode_id": "oss_11144", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing song lyrics, and you need to implement a function that counts the number of unique words in the lyrics. A word is defined as a sequence of alphabetic characters (a-z, A-Z) and is case insensitive. Implement the function `count_unique...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_unique_words(['Hello world', 'world of Python']) == 4\", \"assert count_unique_words(['Hello', 'Hello']) == 1\", \"assert count_unique_words(['A B C', 'A b c', 'a B C']) == 3\", \"assert count_unique_words(['']) == 0\", \"assert count_unique_words(['Th...
{ "split": "train", "index": 78359, "acecode_id": "bigcode_python_fns_9970", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `extract_and_preprocess_data(data: List[List[float]]) -> List[float]` that takes a 2D list of floating-point numbers as input, representing a dataset with multiple features. The function should return a 1D list containing the mean of each feature (column) a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_and_preprocess_data([[1.0, 2.0], [3.0, 4.0]]) == [2.0, 3.0]\", \"assert extract_and_preprocess_data([[5.0, 15.0], [10.0, 25.0], [20.0, 30.0]]) == [11.666666666666666, 23.333333333333332]\", \"assert extract_and_preprocess_data([[1.5, 2.5, 3.5], [2.5,...
{ "split": "train", "index": 78360, "acecode_id": "evol_22180", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string that represents a file path in a Unix-like file system. Your task is to implement a function that compresses the contents of this path into a .tar.gz file name derived from the path and then returns a message indicating that the compression was successful...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compress_and_report('/home/user/documents') == 'Compressed /home/user/documents to /home/user/documents.tar.gz'\", \"assert compress_and_report('/var/log') == 'Compressed /var/log to /var/log.tar.gz'\", \"assert compress_and_report('/tmp/test') == 'Compresse...
{ "split": "train", "index": 78361, "acecode_id": "bigcode_python_fns_33803", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to implement a function that simulates a guessing game where a player guesses a number between 1 and 100. The player can also place a bet. The function takes two parameters: the guessed number (an integer) and the bet amount (an integer or the string 'allin'). The func...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert guess(50, 1000) == -1000\", \"assert guess(50, 0) == -0\", \"assert guess(44, 1000) == 1000\", \"assert guess(30, 1000) == -1000\", \"assert guess(70, 1000) == -1000\", \"assert guess(10, 1000) == -1000\", \"assert guess(1, 1000) == -1000\", \"assert guess(1...
{ "split": "train", "index": 78362, "acecode_id": "bigcode_python_fns_10685", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a dictionary `versions` where the keys are application names (strings) and the values are their current versions (also strings). You also have a list of previous versions for each application represented as a list of strings. Your task is to implement a function `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_previous_version({'app1': '1.1.0'}, 'app1', {'app1': ['1.1.0', '1.0.0']}) == ''\", \"assert get_previous_version({'app1': '1.2.0'}, 'app2', {'app2': ['1.1.0', '1.0.0']}) == ''\", \"assert get_previous_version({'app1': '1.2.0'}, 'app1', {'app1': ['1.2.0']...
{ "split": "train", "index": 78363, "acecode_id": "bigcode_python_fns_19299", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the execution of a payment based on a payment request. The payment request is represented as a dictionary containing the following keys: 'paymentId' (a string representing the unique identifier of the payment) and 'PayerID'...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert execute_payment({'paymentId': '12345', 'PayerID': '67890'}) == True\", \"assert execute_payment({'paymentId': 'abcde', 'PayerID': 'xyz'}) == True\", \"assert execute_payment({'paymentId': 'payment01', 'PayerID': 'payer01'}) == True\", \"assert execute_paymen...
{ "split": "train", "index": 78364, "acecode_id": "bigcode_python_fns_36847", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that determines the intersection of two lists without using built-in set functions. The function should return the intersection elements in sorted order without duplication, supporting lists that may contain negative numbers and mixed data types. The functi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list_intersection(['apple', 'banana', 'cherry'], ['banana', 'cherry', 'date']) == ['banana', 'cherry']\", \"assert list_intersection([1, 2, 3], [4, 5, 6]) == []\", \"assert list_intersection([], [1, 2, 3]) == []\", \"assert list_intersection([1, 2, 2, 3], [2...
{ "split": "train", "index": 78365, "acecode_id": "evol_19240", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that calculates the total cost of items in a shopping cart. The function will take a list of item costs as input and return the total cost. The function should handle an empty shopping cart by returning 0. Implement the function `calculat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_total_cost([10.99, 5.49, 3.00]) == 19.48\", \"assert calculate_total_cost([0.99, 1.50, 2.99]) == 5.48\", \"assert calculate_total_cost([15.00]) == 15.00\", \"assert calculate_total_cost([]) == 0.0\", \"assert calculate_total_cost([5.75, 2.25, 3.00,...
{ "split": "train", "index": 78366, "acecode_id": "bigcode_python_fns_13948", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of 3D vertices (each represented as a tuple of three floats) and an optional list of four color values (each represented as a float between 0 and 1), write a function that generates a list of line segments connecting each pair of consecutive vertices. Each line seg...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_line_segments([(0.0, 0.0, 0.0), (1.0, 1.0, 1.0)], [1.0, 0.0, 0.0, 1.0]) == [{'start': (0.0, 0.0, 0.0), 'end': (1.0, 1.0, 1.0)}]\", \"assert generate_line_segments([(0.0, 0.0, 0.0), (1.0, 1.0, 1.0), (2.0, 2.0, 2.0)]) == [{'start': (0.0, 0.0, 0.0), 'e...
{ "split": "train", "index": 78367, "acecode_id": "bigcode_python_fns_30722", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of job statuses and returns a sorted list of job IDs that are currently pending or suspended. A job status can be either 'PD' (pending) or 'S' (suspended). Your function should take in two parameters: a list of strings r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_pending_jobs(['1 PD', '2 S', '3 R', '4 PD'], True) == ['1', '2', '4']\", \"assert get_pending_jobs(['1 PD', '2 S', '3 R', '4 PD'], False) == ['1', '2', '4']\", \"assert get_pending_jobs(['1 R', '2 R', '3 R'], True) == []\", \"assert get_pending_jobs(['1 ...
{ "split": "train", "index": 78368, "acecode_id": "bigcode_python_fns_40357", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of actions, where each action is represented by a tuple containing its name and a boolean indicating whether the action is active. Your task is to create a function that takes this list and returns a formatted string listing all the actions and their active...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_actions([('bar', False), ('foo', True), ('baz', False)]) == 'bar: Inactive\\\\nfoo: Active\\\\nbaz: Inactive'\", \"assert format_actions([('action1', True), ('action2', True), ('action3', False)]) == 'action1: Active\\\\naction2: Active\\\\naction3: I...
{ "split": "train", "index": 78369, "acecode_id": "bigcode_python_fns_48907", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two lists of integers, eye_x and eye_y, representing the x and y coordinates of eye movements, and a list of integers fixxation_classifier, where each value indicates whether the corresponding move is a fixation (1) or a saccade (0), implement a function `create_fixxation...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_fixxation_map([1, 2, 3], [1, 1, 1], [1, 0, 0]) == [((1, 1), 0), ((2, 1), 0), ((3, 1), 0)]\", \"assert create_fixxation_map([], [], []) == []\", \"assert create_fixxation_map([0], [0], [1]) == [((0, 0), 0)]\", \"assert create_fixxation_map([1, 2, 3], [...
{ "split": "train", "index": 78370, "acecode_id": "bigcode_python_fns_17961", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given two strings s1 and s2 representing DNA sequences consisting of the characters 'A', 'C', 'G', and 'T', write a function `hamming_distance(s1: str, s2: str) -> int` that calculates the Hamming distance between the two sequences. The Hamming distance is defined as the number...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert hamming_distance('ACGT', 'ACGT') == 0\", \"assert hamming_distance('ACGT', 'AGCT') == 2\", \"assert hamming_distance('ACGT', 'ACG') == 1\", \"assert hamming_distance('A', 'A') == 0\", \"assert hamming_distance('A', 'G') == 1\", \"assert hamming_distance('A',...
{ "split": "train", "index": 78371, "acecode_id": "bigcode_python_fns_12328", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that returns the maximum sum of any contiguous subarray. A contiguous subarray is defined as a subarray that consists of one or more adjacent elements. You need to implement a function called `max_subarray_sum(arr: List[int]) -> int` w...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_subarray_sum([-2, -3, -1]) == -1\", \"assert max_subarray_sum([5, 4, -1, 7, 8]) == 23\", \"assert max_subarray_sum([1]) == 1\", \"assert max_subarray_sum([-1, -2, -3, -4]) == -1\", \"assert max_subarray_sum([2, 1, -3, 4, -1, 2, 1, -5, 4]) == 6\", \"asser...
{ "split": "train", "index": 78372, "acecode_id": "bigcode_python_fns_46944", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `is_prime(n: int) -> bool` that determines whether a given integer `n` is a prime number. A prime number is a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. Your function should return `True` if `n` is prime,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_prime(17) == True\", \"assert is_prime(1) == False\", \"assert is_prime(2) == True\", \"assert is_prime(3) == True\", \"assert is_prime(4) == False\", \"assert is_prime(5) == True\", \"assert is_prime(6) == False\", \"assert is_prime(7) == True\", \"asser...
{ "split": "train", "index": 78373, "acecode_id": "evol_33983", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with finding all occurrences of a specific substring within a given string. Write a function `find_substring_indices(text: str, substring: str) -> List[List[int]]` that takes in two parameters: a string `text` and a string `substring`. The function should search ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_substring_indices('hello world', 'lo') == [[3, 4]]\", \"assert find_substring_indices('abababab', 'ab') == [[0, 1], [2, 3], [4, 5], [6, 7]]\", \"assert find_substring_indices('testcases', 'test') == [[0, 3]]\", \"assert find_substring_indices('pythonpyt...
{ "split": "train", "index": 78374, "acecode_id": "oss_1259", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of UNIX timestamps in microseconds, which represent specific moments in time. Your task is to convert these timestamps into a list of human-readable date-time strings formatted as 'YYYY-MM-DD HH:MM:SS'. Implement a function `convert_unix_to_datetime(timesta...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_unix_to_datetime([1609459200000000]) == ['2021-01-01 00:00:00']\", \"assert convert_unix_to_datetime([0]) == ['1970-01-01 00:00:00']\", \"assert convert_unix_to_datetime([1596240000000000]) == ['2020-08-01 00:00:00']\", \"assert convert_unix_to_datet...
{ "split": "train", "index": 78375, "acecode_id": "bigcode_python_fns_9859", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Write a function that converts a non-negative integer to its equivalent binary representation as a string. The function should take an integer n (0 <= n <= 10^9) and return the binary representation of n without any leading zeros.\nPlease reason step by step, then write a self-...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_binary(0) == '0'\", \"assert convert_to_binary(1) == '1'\", \"assert convert_to_binary(2) == '10'\", \"assert convert_to_binary(3) == '11'\", \"assert convert_to_binary(4) == '100'\", \"assert convert_to_binary(5) == '101'\", \"assert convert_to_b...
{ "split": "train", "index": 78376, "acecode_id": "evol_11298", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of software tool names used in various fields. Your task is to write a Python function that takes this list as input and returns a new list containing only the names of the tools that start with the letter 'p'. The function should be case insensitive, meani...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_tools(['Python', 'Java', 'C++', 'Perl', 'PHP']) == ['Python', 'Perl', 'PHP']\", \"assert filter_tools(['tool', 'PICK', 'paddle', 'spade']) == ['PICK', 'paddle']\", \"assert filter_tools(['apple', 'banana', 'cherry']) == []\", \"assert filter_tools(['P...
{ "split": "train", "index": 78377, "acecode_id": "oss_33368", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that generates a weather report speech based on the given city, weather condition, and maximum temperature. The function should take in the city name, weather condition, and maximum temperature as input and return the formatted wea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_weather_report('Tokyo', 'sunny', '28') == \\\"Tokyo, today's weather is 'sunny'. The maximum temperature is 28\\u00b0C.\\\"\", \"assert generate_weather_report('New York', 'rainy', '') == \\\"New York, today's weather is 'rainy'.\\\"\", \"assert gen...
{ "split": "train", "index": 78378, "acecode_id": "oss_30072", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that generates the Fibonacci sequence until it reaches a specified numerical limit, but ensure that the function returns exactly the first 10 elements of the Fibonacci sequence, even if the limit is exceeded. If the limit is not reached within the first 10 ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_fibonacci(8) == [0, 1, 1, 2, 3, 5, 8]\", \"assert generate_fibonacci(9) == [0, 1, 1, 2, 3, 5, 8]\", \"assert generate_fibonacci(10) == [0, 1, 1, 2, 3, 5, 8]\", \"assert generate_fibonacci(11) == [0, 1, 1, 2, 3, 5, 8]\", \"assert generate_fibonacci(1...
{ "split": "train", "index": 78379, "acecode_id": "evol_21037", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Create a function named `check_parity` that takes a single integer parameter `x` and returns a boolean value. The function should determine if the integer is even or odd by checking the remainder when `x` is divided by 2. It should return True if `x` is even (remainder is 0) an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_parity(0) == True\", \"assert check_parity(1) == False\", \"assert check_parity(2) == True\", \"assert check_parity(3) == False\", \"assert check_parity(4) == True\", \"assert check_parity(5) == False\", \"assert check_parity(6) == True\", \"assert che...
{ "split": "train", "index": 78380, "acecode_id": "evol_35540", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that creates a 3-dimensional list (not using NumPy) with all the elements set to 0 given the shape of the array. Additionally, this function should traverse the list and count the number of zero elements in the array using only basic loop structures and con...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_zeros(3, 3, 3) == 27\", \"assert count_zeros(2, 2, 2) == 8\", \"assert count_zeros(1, 1, 1) == 1\", \"assert count_zeros(4, 4, 4) == 64\", \"assert count_zeros(3, 2, 2) == 12\", \"assert count_zeros(2, 3, 3) == 18\", \"assert count_zeros(5, 1, 1) == 5\...
{ "split": "train", "index": 78381, "acecode_id": "evol_15514", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a random timestamp within a specified range. The function should take two datetime objects, `start` and `end`, as input parameters, and return a random timestamp that falls between these two datetime values. The `start` dat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert random_timestamp(datetime(2023, 1, 1), datetime(2023, 1, 2)) is not None\", \"assert random_timestamp(datetime(2023, 1, 1), datetime(2023, 1, 1)) is None\", \"assert random_timestamp(datetime(2022, 12, 31, 23, 59), datetime(2023, 1, 1, 0, 1)) is not None\", ...
{ "split": "train", "index": 78382, "acecode_id": "bigcode_python_fns_10967", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer x, determine which class interval it belongs to based on a predefined distribution list. The distribution list is defined as [0, 2000, 4000, 6000, 8000, 10000]. The function should return the index of the class interval that x falls into. If x is less than or e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_class(2000) == 1\", \"assert get_class(4000) == 2\", \"assert get_class(6000) == 3\", \"assert get_class(8000) == 4\", \"assert get_class(10000) == 5\", \"assert get_class(10001) == 6\", \"assert get_class(0) == 0\", \"assert get_class(-100) == 0\", \"as...
{ "split": "train", "index": 78383, "acecode_id": "bigcode_python_fns_27672", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given a string 'name' and a string 'namespace', create a function that generates a formatted string which represents a delete operation for a Kubernetes Persistent Volume Claim. The formatted string should follow the pattern: 'Delete operation: vol-{name} in namespace {namespac...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert delete_volume_operation('myVolume', 'default') == 'Delete operation: vol-myVolume in namespace default'\", \"assert delete_volume_operation('testVolume', 'kube-system') == 'Delete operation: vol-testVolume in namespace kube-system'\", \"assert delete_volume_...
{ "split": "train", "index": 78384, "acecode_id": "bigcode_python_fns_25102", "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, a dictionary containing the count of each individual character, and the total number of vowels in the string. You should optimize the countin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_letters('hello') == (5, {'h': 1, 'e': 1, 'l': 2, 'o': 1}, 2)\", \"assert count_letters('') == (0, {}, 0)\", \"assert count_letters('aaaaa') == (5, {'a': 5}, 5)\", \"assert count_letters('12345') == (5, {'1': 1, '2': 1, '3': 1, '4': 1, '5': 1}, 0)\", \"...
{ "split": "train", "index": 78385, "acecode_id": "evol_26672", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of integers and returns a new list that contains only the unique elements of the original list, preserving the order of their first appearance. Write a function `unique_elements(arr: List[int]) -> List[int]` that takes i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_elements([1, 2, 2, 3, 4, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert unique_elements([5, 5, 5, 5]) == [5]\", \"assert unique_elements([]) == []\", \"assert unique_elements([10, 20, 10, 30, 20, 40]) == [10, 20, 30, 40]\", \"assert unique_elements([1, 2, 3, 1...
{ "split": "train", "index": 78386, "acecode_id": "bigcode_python_fns_34283", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with measuring the response time of a server for different amounts of requests. Write a function `measure_response_time(request_amount: List[int]) -> Dict[str, List[float]]` that takes a list of integers representing the number of requests and simulates measuring...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert measure_response_time([10]) == {'JSON': [1.0], 'XML': [5.0]}\", \"assert measure_response_time([100]) == {'JSON': [10.0], 'XML': [500.0]}\", \"assert measure_response_time([200]) == {'JSON': [20.0], 'XML': [2000.0]}\", \"assert measure_response_time([500]) =...
{ "split": "train", "index": 78387, "acecode_id": "bigcode_python_fns_27477", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a list of integers to perform specific operations based on a given command. The function should take in a list of integers and a command string. The command can either be 'sum' or 'product'. If the command is 'sum', the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_data([1, 2, 3, 4], 'sum') == 10\", \"assert process_data([1, 2, 3, 4], 'product') == 24\", \"assert process_data([0, 0, 0], 'sum') == 0\", \"assert process_data([1, 2, 3, 4], 'invalid') == -1\", \"assert process_data([-1, -2, -3], 'sum') == -6\", \"a...
{ "split": "train", "index": 78388, "acecode_id": "oss_28747", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two points in a 2D plane represented by their coordinates (x1, y1) and (x2, y2), write a function `calculate_distance(x1: float, y1: float, x2: float, y2: float) -> float` that calculates the Euclidean distance between the two points. The Euclidean distance is defined as ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_distance(0, 0, 3, 4) == 5.0\", \"assert calculate_distance(1, 1, 1, 1) == 0.0\", \"assert calculate_distance(-1, -1, 1, 1) == 2.83\", \"assert calculate_distance(2, 3, 5, 7) == 5.0\", \"assert calculate_distance(0, 0, 1, 1) == 1.41\", \"assert calc...
{ "split": "train", "index": 78389, "acecode_id": "bigcode_python_fns_203", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of buildings in a city skyline. Your task is to find the maximum height of the buildings that can be observed from a given viewpoint. The viewpoint is defined as any position along the skyline, and the maximum height is ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_observable_height([1, 3, 2, 5, 4]) == 5\", \"assert max_observable_height([6, 2, 5, 4, 1, 3]) == 6\", \"assert max_observable_height([3, 1, 4, 1, 5]) == 5\", \"assert max_observable_height([1]) == 1\", \"assert max_observable_height([2, 2, 2, 2]) == 2\",...
{ "split": "train", "index": 78390, "acecode_id": "bigcode_python_fns_49885", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that checks whether the equation x^2 + y^2 = z^2 holds true for the given inputs x, y, and z. The function should accept both integer and complex number inputs. If the inputs cannot satisfy the equation, the function should raise a ValueError. If the inputs...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert solve_equation(3, 4, 5) == True\", \"assert solve_equation(0, 0, 0) == True\", \"assert solve_equation(0, 1, 1) == True\", \"assert solve_equation(3, 4, 5+0j) == True\", \"assert solve_equation(5, 12, 13) == True\", \"assert solve_equation(-3, 4, 5) == True\...
{ "split": "train", "index": 78391, "acecode_id": "evol_11481", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with managing a library system. The library contains books, each of which has a unique identifier. You need to implement a function that takes a list of book operations and returns a list of titles of the books that are currently available in the library after pe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_library([('add', 1, 'The Great Gatsby', 'F. Scott Fitzgerald'), ('add', 2, '1984', 'George Orwell'), ('add', 3, 'To Kill a Mockingbird', 'Harper Lee')]) == ['The Great Gatsby', '1984', 'To Kill a Mockingbird']\", \"assert manage_library([('add', 1, 'T...
{ "split": "train", "index": 78392, "acecode_id": "oss_32458", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a string `s` containing only parentheses '(', ')', brackets '[', ']', and braces '{', '}', write a function `isBalanced` that checks if the input string has balanced parentheses. A string is considered balanced if every opening symbol has a corresponding closing symbol an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert isBalanced('((()))') == True\", \"assert isBalanced('{[()]}') == True\", \"assert isBalanced('([]{})') == True\", \"assert isBalanced('()()') == True\", \"assert isBalanced('') == True\", \"assert isBalanced('(') == False\", \"assert isBalanced(')') == False...
{ "split": "train", "index": 78393, "acecode_id": "oss_32185", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the local influence coefficient based on a given x-coordinate. The local influence coefficient is computed using the formula: `lambda_0 = k0 * x_coord`, where `k0` is a constant value provided as input to the function....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_local_influence_coefficient(1.0, 0.0) == 0.0\", \"assert get_local_influence_coefficient(2.0, 5.0) == 10.0\", \"assert get_local_influence_coefficient(3.5, 2.0) == 7.0\", \"assert get_local_influence_coefficient(0.0, 10.0) == 0.0\", \"assert get_local_in...
{ "split": "train", "index": 78394, "acecode_id": "oss_16659", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a dataset represented as a list of lists, where each inner list contains integer values, write a function `calc_feature_effect(dataSet: List[List[int]], feature_idx: int) -> float` that calculates the effect of a specified feature (given by `feature_idx`) on the dataset. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calc_feature_effect([[0, 0], [0, 1], [1, 0], [1, 1]], 0) == 0.5\", \"assert calc_feature_effect([[1, 2], [2, 3], [2, 2], [1, 3]], 0) == 0.5\", \"assert calc_feature_effect([[0, 0], [1, 1], [0, 0], [1, 1]], 1) == 0.5\", \"assert calc_feature_effect([[3, 2], [...
{ "split": "train", "index": 78395, "acecode_id": "bigcode_python_fns_29029", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a list of variable names that are prefixed with a method's scope, implement a function that returns a dictionary mapping the variable names to their original names, either keeping the prefix or stripping it based on a boolean parameter. The function should take two argume...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert restore_variables(['method1_var1', 'method1_var2'], strip_scope=False) == {'method1_var1': 'method1_var1', 'method1_var2': 'method1_var2'}\", \"assert restore_variables(['method2_var1', 'method2_var2'], strip_scope=True) == {'var1': 'method2_var1', 'var2': '...
{ "split": "train", "index": 78396, "acecode_id": "bigcode_python_fns_20228", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function in Python that calculates the median of a single input array. The function should take in a list of numbers, calculate the median, and return that value. The input list is not guaranteed to be sorted.\nPlease reason step by step, then write a self-contained...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_median([5, 2, 6, 8, 10]) == 6\", \"assert find_median([7, 9, 1]) == 7\", \"assert find_median([1, 2, 3, 4, 5]) == 3\", \"assert find_median([10, 20, 30]) == 20\", \"assert find_median([1]) == 1\", \"assert find_median([1, 5, 3]) == 3\", \"assert find_me...
{ "split": "train", "index": 78397, "acecode_id": "evol_3507", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a list of topics, implement a function that filters out any topics that start with an underscore ('_') and returns the filtered list. The function signature is: `def filter_topics(topics: List[str]) -> List[str]:` where `topics` is a list of strings representing the topic...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_topics(['_hidden', 'visible', 'another_visible']) == ['visible', 'another_visible']\", \"assert filter_topics(['_private', '_secret', 'public']) == ['public']\", \"assert filter_topics(['one', 'two', 'three']) == ['one', 'two', 'three']\", \"assert fi...
{ "split": "train", "index": 78398, "acecode_id": "bigcode_python_fns_33664", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that predicts the sentiment of a movie review based on its numerical representation. The function should take a list of integers representing a pre-processed movie review and return 'positive' if the sentiment score is greater than 0....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert predict_sentiment([1, 2, 3, 4, 5]) == 'positive'\", \"assert predict_sentiment([0, 0, 0]) == 'negative'\", \"assert predict_sentiment([1, 1, 1, 1, 1, 1, 1]) == 'positive'\", \"assert predict_sentiment([0, 1, 0, 0]) == 'negative'\", \"assert predict_sentiment...
{ "split": "train", "index": 78399, "acecode_id": "oss_5500", "num_tests": 16 }