data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function named `add_numbers` that takes two parameters, `a` and `b`. The function should return the sum of `a` and `b`. If either `a` or `b` is not a number (int or float), the function should raise a TypeError. If the sum of `a` and `b` resul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_numbers(1, 2) == 3\", \"assert add_numbers(-1, 1) == 0\", \"assert add_numbers(0, 0) == 0\", \"assert add_numbers(3.5, 2.5) == 6.0\", \"assert add_numbers(100, 200) == 300\", \"assert add_numbers(-100, -200) == -300\", \"assert add_numbers(1.5, 2.5) == 4... | {
"split": "train",
"index": 65500,
"acecode_id": "evol_20461",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a list of objects, where each object is represented as a dictionary containing its properties such as 'type', 'color', and 'size'. Your task is to implement a function `filter_objects(objects: List[Dict[str, Union[str, int]]], criteria: Dict[str, Union[str, int]])... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_objects([{'type': 'circle', 'color': 'red', 'size': 10}, {'type': 'square', 'color': 'blue', 'size': 20}], {'color': 'red'}) == [{'type': 'circle', 'color': 'red', 'size': 10}]\", \"assert filter_objects([{'type': 'circle', 'color': 'red', 'size': 10}... | {
"split": "train",
"index": 65501,
"acecode_id": "bigcode_python_fns_47943",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of tuples where each tuple contains two strings, representing topics. Your task is to implement a function `count_unique_topics(topics: List[Tuple[str, str]]) -> int` that returns the number of unique topics that do not have any duplicates in the list. A to... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_topics([('A', 'B'), ('C', 'D'), ('A', 'B')]) == 1\", \"assert count_unique_topics([('A', 'B'), ('C', 'D'), ('E', 'F'), ('C', 'D')]) == 2\", \"assert count_unique_topics([('A', 'B'), ('A', 'B'), ('A', 'B')]) == 0\", \"assert count_unique_topics([... | {
"split": "train",
"index": 65502,
"acecode_id": "bigcode_python_fns_12495",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers `numbers` and a target integer `target`. Your task is to determine whether there are two distinct indices `i` and `j` in the list such that `numbers[i] + numbers[j] == target`. Implement a function `find_pair(numbers: List[int], target: int) -> ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_pair([1, 2, 3, 4, 5], 9) == True\", \"assert find_pair([1, 2, 3, 4, 5], 10) == False\", \"assert find_pair([0, 1, 2, 0], 0) == True\", \"assert find_pair([-1, -2, -3, -4, -5], -8) == True\", \"assert find_pair([10, 15, 3, 7], 17) == True\", \"assert fin... | {
"split": "train",
"index": 65503,
"acecode_id": "bigcode_python_fns_46954",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a datetime in the format 'YYYY-MM-DD HH:MM:SS' or 'YYYY-MM-DD HH:MM:SS.sss', write a function that converts this datetime string into a Unix timestamp (the number of seconds since January 1, 1970). If the datetime string is '1969-12-31 23:59:59' or c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert datetime_to_unix_timestamp('1969-12-31 23:59:59') == None\", \"assert datetime_to_unix_timestamp('2022-01-01 00:00:00') == 1640995200\", \"assert datetime_to_unix_timestamp('2020-07-20 15:30:45') == 1595259045\", \"assert datetime_to_unix_timestamp('1969-12-... | {
"split": "train",
"index": 65504,
"acecode_id": "bigcode_python_fns_13596",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of buildings in a city skyline. Your task is to implement a function `calculate_skyline(heights: List[int]) -> List[Tuple[int, int]]` that returns a list of tuples, where each tuple contains the starting position and the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_skyline([3, 1, 4, 1, 5]) == [(0, 3), (2, 4), (4, 5)]\", \"assert calculate_skyline([1, 2, 3, 4, 5]) == [(0, 1), (1, 2), (2, 3), (3, 4), (4, 5)]\", \"assert calculate_skyline([5, 5, 5, 5]) == [(0, 5)]\", \"assert calculate_skyline([0, 0, 0, 0]) == [... | {
"split": "train",
"index": 65505,
"acecode_id": "bigcode_python_fns_44624",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a random unique identifier (UUID) for a server. The function should be named `generate_server_id` and it should return a UUID object. Your implementation should generate a new UUID each time the function is called. Use the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_server_id() != generate_server_id()\", \"assert str(generate_server_id()).count('-') == 4\", \"assert len(str(generate_server_id())) == 36\", \"assert generate_server_id() != generate_server_id()\", \"assert str(generate_server_id()).endswith('0') o... | {
"split": "train",
"index": 65506,
"acecode_id": "oss_380",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given two lists of dictionaries, write a function `compareDicts(a: List[Dict[str, Any]], b: List[Dict[str, Any]]) -> bool` that compares both lists after removing any key named 'Id' from the dictionaries. The function should return `True` if the modified lists are equal (same d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compareDicts([{'Id': 1, 'name': 'Alice'}, {'Id': 2, 'name': 'Bob'}], [{'name': 'Alice'}, {'name': 'Bob'}]) == True\", \"assert compareDicts([{'Id': 1, 'name': 'Charlie'}], [{'name': 'Charlie'}]) == True\", \"assert compareDicts([{'Id': 1, 'name': 'Alice'}], ... | {
"split": "train",
"index": 65507,
"acecode_id": "bigcode_python_fns_20210",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers and two indices n and m, implement a function that calculates the cumulative product of the elements in the list from index n to index m (exclusive). The function should handle cases where n or m are out of the bounds of the list by returning 1. The fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert loopList([1, 2, 3, 4], 1, 3) == 6\", \"assert loopList([1, 2, 3, 4], 0, 4) == 24\", \"assert loopList([1, 2, 3, 4], 2, 2) == 1\", \"assert loopList([5, 10, 2], 0, 3) == 100\", \"assert loopList([], 0, 1) == 1\", \"assert loopList([9, 3, 6], 1, 3) == 18\", \"... | {
"split": "train",
"index": 65508,
"acecode_id": "evol_34185",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, implement a function `encode_strings(strings: List[str]) -> List[str]` that encodes each string in the list to UTF-8 format. The function should take a list of strings as input and return a new list containing the UTF-8 encoded versions of each string. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert encode_strings(['hello', 'world']) == [b'hello', b'world']\", \"assert encode_strings(['Python', 'is', 'fun']) == [b'Python', b'is', b'fun']\", \"assert encode_strings(['abc', 'def', 'ghi']) == [b'abc', b'def', b'ghi']\", \"assert encode_strings(['', 'single... | {
"split": "train",
"index": 65509,
"acecode_id": "bigcode_python_fns_27743",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given two strings, `word1` and `word2`, and a third string `word3` consisting of '1's and '2's. Your task is to create a string, referred to as `merge`, by following these rules: For each character in `word3`, if it is '1', append the first character of `word1` to `merg... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_lexico('z', 'y', '1') == 'z'\", \"assert max_lexico('abc', 'xyz', '222') == 'xyz'\", \"assert max_lexico('abc', 'abc', '111') == 'abc'\", \"assert max_lexico('abc', '', '1') == 'a'\", \"assert max_lexico('zzzz', 'aaaa', '1111') == 'zzzz'\", \"assert max_... | {
"split": "train",
"index": 65510,
"acecode_id": "evol_2031",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates sending heartbeat messages at a specified frequency. The function should take in a message string and an integer frequency as parameters. The function should print the message at the specified frequency (in Hz) for a gi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert send_heartbeat('Hello', 0, 5) == None\", \"assert send_heartbeat('Message', 1, 0) == None\", \"assert send_heartbeat('Heartbeat', 0, 1) == None\", \"assert send_heartbeat('Status', 2, 0) == None\", \"assert send_heartbeat('SendOnce', 0, 1) == None\"]}"
} | {
"split": "train",
"index": 65511,
"acecode_id": "oss_37733",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to detect indicators of compromise (IOCs) related to the Sunburst malware based on SHA256 hashes. You will receive an event represented as a dictionary containing a key 'p_any_sha256_hashes', which is a list of SHA256 hashes. Your goa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rule({'p_any_sha256_hashes': ['hash1', 'some_other_hash']}) == True\", \"assert rule({'p_any_sha256_hashes': ['some_other_hash', 'hash2']}) == True\", \"assert rule({'p_any_sha256_hashes': ['some_hash', 'another_hash']}) == False\", \"assert rule({'p_any_sha... | {
"split": "train",
"index": 65512,
"acecode_id": "oss_4186",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates updating the version of a software project. Given a dictionary representing the project repository information, a new version string, a working directory path, and a boolean indicating if the operation should be read-on... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_version({'versioning_strategy': 'semver', 'has_python': True, 'has_js': False, 'has_version_file': True}, '1.0.0', '/tmp/project', False) == {'updated_python': True, 'updated_js': False, 'updated_version_file': True}\", \"assert update_version({'versi... | {
"split": "train",
"index": 65513,
"acecode_id": "bigcode_python_fns_39436",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of SQL statements and a schema owner string. The function should add each SQL statement to a database interface associated with the given schema owner and log each addition. The input parameters are as follows: 1. `o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_schema_owner_sql('owner1', ['CREATE TABLE test1;', 'CREATE TABLE test2;']) == ['Added schema owner owner1 with SQL: CREATE TABLE test1;', 'Added schema owner owner1 with SQL: CREATE TABLE test2;']\", \"assert add_schema_owner_sql('owner2', ['INSERT INTO ... | {
"split": "train",
"index": 65514,
"acecode_id": "oss_28767",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple command line interface. This function should take a list of commands, which may include a sequence of command line arguments or separators representing pipes (|). Each command can be thought of as a string or a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert run_commands([['ls'], '|', ['grep', 'wakka']]) == ['ls', 'grep', 'wakka']\", \"assert run_commands([['date'], '|', ['cut', '-d', ' ', '-f', '1']]) == ['date', 'cut', '-d', ' ', '-f', '1']\", \"assert run_commands([['pwd'], '|', ['xargs', 'echo']]) == ['pwd',... | {
"split": "train",
"index": 65515,
"acecode_id": "bigcode_python_fns_47246",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `toggle_switch(initial: bool, toggles: int) -> bool` that simulates a toggle switch behavior. The function takes two parameters: an initial boolean state `initial` (where `True` represents 'on' and `False` represents 'off') and an int... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert toggle_switch(True, 0) == True\", \"assert toggle_switch(True, 1) == False\", \"assert toggle_switch(True, 2) == True\", \"assert toggle_switch(True, 3) == False\", \"assert toggle_switch(True, 4) == True\", \"assert toggle_switch(False, 0) == False\", \"ass... | {
"split": "train",
"index": 65516,
"acecode_id": "oss_25742",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a year represented as an integer, write a function `is_leap_year(year)` that determines whether the given year is a leap year. A leap year is defined as follows: it is a year that is evenly divisible by 4, except for end-of-century years, which must be evenly divisible by... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_leap_year(2000) == True\", \"assert is_leap_year(1900) == False\", \"assert is_leap_year(1600) == True\", \"assert is_leap_year(2020) == True\", \"assert is_leap_year(2021) == False\", \"assert is_leap_year(1996) == True\", \"assert is_leap_year(1995) == ... | {
"split": "train",
"index": 65517,
"acecode_id": "oss_377",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Please write a Python function that takes a nested array as input, where each subarray contains a pair of keys and associated values. This function should convert this data structure into a nested dictionary. The function should also handle conflicts, where the same key might a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_dict([[('a', 1), ('b', 2)], [('a', 3), ('c', 4)]]) == {'a': [1, 3], 'b': 2, 'c': 4}\", \"assert convert_to_dict([[('x', 5)], [('y', 6)], [('x', 7)]]) == {'x': [5, 7], 'y': 6}\", \"assert convert_to_dict([[('key1', 'value1'), ('key2', 'value2')], [... | {
"split": "train",
"index": 65518,
"acecode_id": "evol_19472",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple password generator function that generates a random password of a specified length. The function should take two parameters: an integer 'length' (1 <= length <= 100) which specifies the length of the password, and an optional string 'chars'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert password_generator(8, None) is not None\", \"assert len(password_generator(5, None)) == 5\", \"assert len(password_generator(12, 'abc')) == 12\", \"assert all(c in 'abc' for c in password_generator(6, 'abc'))\", \"assert password_generator(10, '12345') is no... | {
"split": "train",
"index": 65519,
"acecode_id": "bigcode_python_fns_42628",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a user login process for a web application. Given a username and a password, your function should return a response message indicating whether the login was successful or not. The function should follow these rules: If ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert login_user('admin', '1234') == 'Login successful'\", \"assert login_user('admin', 'wrongpassword') == 'Login failed'\", \"assert login_user('user', '1234') == 'Login failed'\", \"assert login_user('user', 'password') == 'Login failed'\", \"assert login_user(... | {
"split": "train",
"index": 65520,
"acecode_id": "bigcode_python_fns_10307",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a positive integer n. Your task is to implement a function that calculates the sum of the first n positive integers for three different sequences: arithmetic progression, geometric progression, and the Fibonacci sequence. The function should return a dictionary wi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_sums(1) == {'arithmetic': 1, 'geometric': 1, 'fibonacci': 1}\", \"assert calculate_sums(2) == {'arithmetic': 3, 'geometric': 3, 'fibonacci': 2}\", \"assert calculate_sums(3) == {'arithmetic': 6, 'geometric': 7, 'fibonacci': 4}\", \"assert calculate... | {
"split": "train",
"index": 65521,
"acecode_id": "bigcode_python_fns_1241",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function `get_prime_square_roots(n: int) -> Dict[int, float]` that returns a dictionary containing the square roots of all prime numbers from 1 to n (inclusive). The keys of the dictionary should be the prime numbers, and the values should be their corresponding squ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_prime_square_roots(10) == {2: 1.4142135623730951, 3: 1.7320508075688772, 5: 2.23606797749979, 7: 2.6457513110645907}\", \"assert get_prime_square_roots(1) == {}\", \"assert get_prime_square_roots(2) == {2: 1.4142135623730951}\", \"assert get_prime_square... | {
"split": "train",
"index": 65522,
"acecode_id": "evol_20088",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary where both keys and values are strings, implement a function `iterdict(reference: dict) -> Iterator[Tuple[str, str]]` that returns an iterator that yields tuples of each key-value pair in the dictionary. Each key and value should be returned as strings. The f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert list(iterdict({'a': '1', 'b': '2'})) == [('a', '1'), ('b', '2')]\", \"assert list(iterdict({'x': '10', 'y': '20', 'z': '30'})) == [('x', '10'), ('y', '20'), ('z', '30')]\", \"assert list(iterdict({'one': '1', 'two': '2', 'three': '3', 'four': '4'})) == [('on... | {
"split": "train",
"index": 65523,
"acecode_id": "bigcode_python_fns_32984",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that returns a list of files from three specified directories: 'home_launch_agents', 'system_launch_agents', and 'library_launch_agents'. Each directory contains a list of file names represented as strings. Your function should combine al... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert list_launch_agents(['file1', 'file2'], ['file3'], ['file4', 'file5']) == ['file1', 'file2', 'file3', 'file4', 'file5']\", \"assert list_launch_agents([], ['file3'], ['file4', 'file5']) == ['file3', 'file4', 'file5']\", \"assert list_launch_agents(['file1'], ... | {
"split": "train",
"index": 65524,
"acecode_id": "bigcode_python_fns_47209",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of coordinates representing the vertices of a polygon and a single coordinate representing a point. Your task is to write a function that computes the shortest distance between the polygon and the point. The polygon is defined by a list of tuples, where eac... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_polygon_point_distance([(0, 0), (1, 0), (1, 1), (0, 1)], (2, 0.5)) == 1.0\", \"assert get_polygon_point_distance([(0, 0), (1, 0), (1, 1), (0, 1)], (0.5, 0.5)) == 0.0\", \"assert get_polygon_point_distance([(0, 0), (2, 0), (2, 2), (0, 2)], (3, 1)) == 1.0\... | {
"split": "train",
"index": 65525,
"acecode_id": "bigcode_python_fns_202",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of activity records, each represented as a dictionary containing information about events, timestamps, and additional data. Your task is to implement a function that counts the number of unique event types present in the activity records. An event type is r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_events([{'event': 'Event1'}, {'event': 'Event2'}, {'event': 'Event1'}]) == 2\", \"assert count_unique_events([{'event': 'A'}, {'event': 'B'}, {'event': 'C'}, {'event': 'A'}, {'event': 'B'}]) == 3\", \"assert count_unique_events([{'event': 'Singl... | {
"split": "train",
"index": 65526,
"acecode_id": "bigcode_python_fns_17050",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with formatting product prices for a store display. You have three lists: `xval`, `products`, and `price`, where `xval` contains product identifiers (integers), `products` contains product names (strings), and `price` contains product prices in cents (integers). ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert formatProductPrices([1, 2, 3], ['Apple', 'Banana', 'Orange'], [150, 200, 175]) == ['1 of Apple: $1.50', '2 of Banana: $2.00', '3 of Orange: $1.75']\", \"assert formatProductPrices([4, 5], ['Grapes', 'Cherry'], [300, 125]) == ['4 of Grapes: $3.00', '5 of Cher... | {
"split": "train",
"index": 65527,
"acecode_id": "oss_1170",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `euclidean_distance(point1, point2)` that calculates the Euclidean distance between two points in a multi-dimensional space. The points are represented as lists or tuples of numbers. The function should raise a ValueError if the two points do not have the s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert euclidean_distance((1, 2), (4, 6)) == 5.0\", \"assert euclidean_distance((0, 0), (3, 4)) == 5.0\", \"assert euclidean_distance((1, 1, 1), (2, 2, 2)) == 1.7320508075688772\", \"assert euclidean_distance((1, 2, 3), (4, 5, 6)) == 5.196152422706632\", \"assert e... | {
"split": "train",
"index": 65528,
"acecode_id": "evol_5970",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of integers and a threshold value. The function should return a new list containing only the integers from the original list that are greater than the given threshold value. If no integers are greater than the threshold,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_greater_than_threshold([1, 2, 3, 4, 5], 3) == [4, 5]\", \"assert filter_greater_than_threshold([-1, -2, -3, -4, -5], -3) == [-1, -2]\", \"assert filter_greater_than_threshold([10, 20, 30, 40, 50], 60) == []\", \"assert filter_greater_than_threshold([5... | {
"split": "train",
"index": 65529,
"acecode_id": "bigcode_python_fns_19193",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of complex numbers, implement a function `divide_complex_numbers(numbers: List[complex]) -> List[complex]` that returns a new list containing the result of dividing each complex number in the input list by every other complex number (excluding division by zero). If... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert divide_complex_numbers([1+2j, 3+4j]) == [((1+2j)/(3+4j)), ((3+4j)/(1+2j))]\", \"assert divide_complex_numbers([1+1j, 1-1j]) == [((1+1j)/(1-1j)), ((1-1j)/(1+1j))]\", \"assert divide_complex_numbers([2+2j, 2+2j]) == [((2+2j)/(2+2j)), ((2+2j)/(2+2j))]\", \"asse... | {
"split": "train",
"index": 65530,
"acecode_id": "bigcode_python_fns_4747",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_lexemes(sentence: str, start: str) -> List[str]` that takes a sentence and a starting character set as input. The function should return a list of words from the sentence that start with the specified character set, ignoring any standalone punctuation... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_lexemes('The sizable feline consumed the tiny rodent.', 'th') == ['the']\", \"assert find_lexemes('The quick brown fox jumps over the lazy dog.', 'th') == ['the']\", \"assert find_lexemes('A thought can change everything.', 'th') == ['thought']\", \"ass... | {
"split": "train",
"index": 65531,
"acecode_id": "evol_34938",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Create a function that takes an array of integers as input and returns a tuple containing the maximum element in the array, the index of its first occurrence, and the total count of its occurrences. If the array is empty, return (None, -1, 0).\nPlease reason step by step, then ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max_element_info([3, 12, 2, 12, 6, -9, 3]) == (12, 1, 2)\", \"assert find_max_element_info([1, 2, 3, 4, 5]) == (5, 4, 1)\", \"assert find_max_element_info([-1, -2, -3, -4]) == (-1, 0, 1)\", \"assert find_max_element_info([5, 5, 5, 5]) == (5, 0, 4)\", \"... | {
"split": "train",
"index": 65532,
"acecode_id": "evol_17052",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a caching mechanism for retrieving the details of an object A based on its ID. Write a function `get_object_details(id: str) -> str` that retrieves the details from a cache (a dictionary to simulate Redis) first. If the details are not found in ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_object_details('1') == 'Details of object A with ID 1'\", \"assert get_object_details('2') == 'Details of object A with ID 2'\", \"assert get_object_details('3') == 'Details of object A with ID 3'\", \"assert get_object_details('4') == 'Details of object... | {
"split": "train",
"index": 65533,
"acecode_id": "evol_12087",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_valid_string(s: str) -> bool` that checks if a given string `s` contains only even digits (0, 2, 4, 6, 8) in sequence. The string should not contain any non-digit characters or odd digits. Return True if the string is valid, otherwise return False.\nPle... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_string('02468') == True\", \"assert is_valid_string('2468') == False\", \"assert is_valid_string('246') == False\", \"assert is_valid_string('') == False\", \"assert is_valid_string('484') == False\", \"assert is_valid_string('248') == False\", \"as... | {
"split": "train",
"index": 65534,
"acecode_id": "evol_29594",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function that translates English-word numerals into their digital representation. The function should take a string input consisting of words that represent a number, and return its numeric representation as a string. The input can include words for numbers from 'on... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert words_to_numbers('two hundred') == '200'\", \"assert words_to_numbers('fourteen') == '14'\", \"assert words_to_numbers('nineteen') == '19'\", \"assert words_to_numbers('one') == '1'\", \"assert words_to_numbers('twenty three') == '23'\", \"assert words_to_nu... | {
"split": "train",
"index": 65535,
"acecode_id": "evol_22830",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple register allocation algorithm for a hypothetical assembly language. In this language, registers are denoted by their symbolic names, such as `$v0`, `$v1`, `$a0`, `$a1`, etc. Your task is to write a function `allocate_registers(variables... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert allocate_registers(['x'], ['a']) == {'x': '$v0', 'a': '$a0'}\", \"assert allocate_registers([], []) == {}\", \"assert allocate_registers(['var1'], ['param1', 'param2']) == {'var1': '$v0', 'param1': '$a0', 'param2': '$a1'}\", \"assert allocate_registers(['x']... | {
"split": "train",
"index": 65536,
"acecode_id": "oss_29073",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the logout process for a user session in an online application. The function should remove the user from the active session by deleting their user ID from the session data. You will receive a dictionary representing the cur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert logout({'user_id': 1, 'other_data': 'data'}) == {'other_data': 'data'}\", \"assert logout({'user_id': 2}) == {}\", \"assert logout({'other_data': 'data'}) == {'other_data': 'data'}\", \"assert logout({'user_id': 3, 'user_role': 'admin'}) == {'user_role': 'ad... | {
"split": "train",
"index": 65537,
"acecode_id": "bigcode_python_fns_47803",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function `enable_ip_forwarding()` that simulates the enabling of IP forwarding in a network system. This function should return a string indicating whether IP forwarding has been successfully enabled or if it was already enabled. The function does not ta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert enable_ip_forwarding() == 'IP forwarding is now enabled.'\", \"assert enable_ip_forwarding() == 'IP forwarding is now enabled.'\", \"assert enable_ip_forwarding() == 'IP forwarding is now enabled.'\", \"assert enable_ip_forwarding() == 'IP forwarding is now ... | {
"split": "train",
"index": 65538,
"acecode_id": "bigcode_python_fns_7217",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Develop a Python function that processes a list of numbers and returns a dictionary where each key is a number from the input list. For each number, the value should be a tuple containing five elements: a boolean indicating if the number of divisors is odd, the list of divisors... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_numbers([10]) == {10: (False, [1, 2, 5, 10], 100, 10, (1, 10))}\", \"assert process_numbers([1]) == {1: (True, [1], 1, None, (1, 1))}\", \"assert process_numbers([49]) == {49: (True, [1, 7, 49], 343, 49, (1, 49))}\", \"assert process_numbers([121]) =... | {
"split": "train",
"index": 65539,
"acecode_id": "evol_3584",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Develop a function that generates a sequence of N dictionaries, each distinguished by a unique identifier serving as a key, and the corresponding value manifesting as another empty dictionary. The function should also handle a second parameter, a list of keys. If this list is p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_dict_seq(3) == [{0: {}}, {1: {}}, {2: {}}]\", \"assert generate_dict_seq(2, keys=['a', 'b']) == [{'a': {}}, {'b': {}}]\", \"assert generate_dict_seq(5, keys=['x', 'y', 'z']) == [{'x': {}}, {'y': {}}, {'z': {}}, {3: {}}, {4: {}}]\", \"assert generate... | {
"split": "train",
"index": 65540,
"acecode_id": "evol_682",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a query string for a database based on specific parameters. The function should accept the following parameters: right ascension (ra), declination (dec), radius, columns, offset, limit, and orderby. Each parameter can be No... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_query(10.684, 41.403, 0.1, 'name, age', 0, 10, 'name ASC') == 'SELECT name, age FROM table WHERE 1=1 AND ra=10.684 AND dec=41.403 AND radius=0.1 LIMIT 10 OFFSET 0 ORDER BY name ASC'\", \"assert create_query(None, None, None, None, None, None, None) ==... | {
"split": "train",
"index": 65541,
"acecode_id": "bigcode_python_fns_30830",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that determines if one set is a subset of another set without using any built-in set methods or libraries. Your function should take two lists as input, treating them as sets, and return 'True' if the first list is a subset of the second list, and 'False... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert subset_check([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]) == False\", \"assert subset_check([5, 3, 2, 8], [3, 2]) == False\", \"assert subset_check([], [1, 2, 3]) == True\", \"assert subset_check([1, 2], [1, 2, 3]) == True\", \"assert subset_check([1... | {
"split": "train",
"index": 65542,
"acecode_id": "evol_16568",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a configuration setting system. The function `set_global_option(option_name: str, option_value: str) -> None` takes two parameters: `option_name`, a string representing the name of the configuration option, and `option_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_global_option('autofill.user.email', 'user@example.com') is None\", \"assert set_global_option('autofill.user.email', 'another@example.com') is None\", \"assert set_global_option('theme', 'dark') is None\", \"assert set_global_option('theme', 'light') is... | {
"split": "train",
"index": 65543,
"acecode_id": "bigcode_python_fns_41826",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that determines whether a given city name starts with the word \"Santo\". The function should take a string representing the city name as input and return a boolean value indicating whether the city name starts with \"Santo\" (case... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert starts_with_santo('Santo Domingo') == True\", \"assert starts_with_santo('santo') == True\", \"assert starts_with_santo('Santo') == True\", \"assert starts_with_santo('Los Santos') == False\", \"assert starts_with_santo('sAnto de las Torres') == True\", \"as... | {
"split": "train",
"index": 65544,
"acecode_id": "oss_834",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `count_upper(s)` that calculates the frequency of uppercase vowel symbols present solely within even indices of a supplied string. The function should return the count of uppercase vowels ('A', 'E', 'I', 'O', 'U') found at indices 0, 2, 4, etc. of th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_upper('aBCdEf') == 1\", \"assert count_upper('abcdefg') == 0\", \"assert count_upper('dBBE') == 0\", \"assert count_upper('AEIOU') == 3\", \"assert count_upper('aeiou') == 0\", \"assert count_upper('A1b2C3D4E5') == 2\", \"assert count_upper('') == 0\",... | {
"split": "train",
"index": 65545,
"acecode_id": "evol_20393",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the behavior of an authentication system. The function `denied(request: str) -> str` takes a single argument, `request`, which is a string representing a user request. If the user authentication fails, the function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert denied('user_request_1') == 'Authentication failed and user was denied.'\", \"assert denied('user_request_2') == 'Authentication failed and user was denied.'\", \"assert denied('user_request_3') == 'Authentication failed and user was denied.'\", \"assert den... | {
"split": "train",
"index": 65546,
"acecode_id": "bigcode_python_fns_7766",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `get_top_three_latest_news(news_list: List[str]) -> List[str]` that takes a list of news headlines (strings) and returns the top three latest news headlines. The input list is sorted in chronological order with the most recent news at the beginning of the list.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_top_three_latest_news(['News 1', 'News 2', 'News 3', 'News 4']) == ['News 1', 'News 2', 'News 3']\", \"assert get_top_three_latest_news(['Breaking News 1']) == ['Breaking News 1']\", \"assert get_top_three_latest_news(['Latest News 1', 'Latest News 2']) ... | {
"split": "train",
"index": 65547,
"acecode_id": "evol_18498",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of publication information in XML format, where each XML string contains the title, author, and publication year of a publication. Your task is to create a function that extracts and returns a list of dictionaries, where each dictionary represents a publica... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_publication_info(['<publication><title>Title1</title><author>Author1</author><year>2020</year></publication>']) == [{'title': 'Title1', 'author': 'Author1', 'year': 2020}]\", \"assert extract_publication_info(['<publication><title>Title2</title><auth... | {
"split": "train",
"index": 65548,
"acecode_id": "bigcode_python_fns_25545",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function that finds the position of the first character in a given string that is not a space. Additionally, determine if this character is a digit or an alphabet. The function should return a tuple containing the index of the character and a string indicating wheth... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert first_non_space_char(' Hello world! 123') == (4, 'Alphabet')\", \"assert first_non_space_char(' 123abc') == (4, 'Digit')\", \"assert first_non_space_char(' ') == (-1, -1)\", \"assert first_non_space_char(' a') == (2, 'Alphabet')\", \"assert first_n... | {
"split": "train",
"index": 65549,
"acecode_id": "evol_13198",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the creation of a logging context for a given service. The function `create_log_context` should accept the following parameters: `service_name` (a string representing the name of the service), `request_type` (a string repre... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_log_context('TestService', 'GetTest', 10, datetime(2021, 4, 3, 0, 0, 0, tzinfo=timezone.utc), datetime(2021, 4, 3, 0, 1, 0, tzinfo=timezone.utc)) == {'service_name': 'TestService', 'request_type': 'GetTest', 'response_size': 10, 'start_time': datetime... | {
"split": "train",
"index": 65550,
"acecode_id": "bigcode_python_fns_9945",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given two lists: one containing time values in seconds and another containing corresponding displacement values in square meters. Write a Python function `calculate_average_displacement` that calculates the average displacement over the given time period. The average di... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_displacement([0, 1, 2, 3, 4, 5], [0, 1, 4, 9, 16, 25]) == 9.166666666666666\", \"assert calculate_average_displacement([0, 1, 2], [0, 2, 4]) == 2.0\", \"assert calculate_average_displacement([1, 2, 3], [10, 20, 30]) == 20.0\", \"assert calc... | {
"split": "train",
"index": 65551,
"acecode_id": "oss_4617",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers and returns a new list containing only the unique integers from the original list, in the order of their first appearance. Write a function `unique_integers(nums: List[int]) -> List[int]` that accomplishe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_integers([1, 2, 2, 3, 4, 1]) == [1, 2, 3, 4]\", \"assert unique_integers([5, 5, 5, 5]) == [5]\", \"assert unique_integers([]) == []\", \"assert unique_integers([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert unique_integers([1, 2, 1, 3, 2, 4]) == [1, ... | {
"split": "train",
"index": 65552,
"acecode_id": "oss_22033",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates an interactive map representation based on the provided bounds. The function, named `generate_map`, should take the following input: a list of four integers representing the bounds of the map in the order [south, west, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_map([10, -20, 20, 30]) == '<html><body><map bounds=\\\"10,-20,20,30\\\"></map></body></html>'\", \"assert generate_map([0, 0, 0, 0]) == '<html><body><map bounds=\\\"0,0,0,0\\\"></map></body></html>'\", \"assert generate_map([-10, -10, 10, 10]) == '<... | {
"split": "train",
"index": 65553,
"acecode_id": "oss_13993",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that accepts a list of unique numerical inputs and returns the number with the most unique digits. If multiple numbers have the same unique digit count, return the number that appears first in the list.\nPlease reason step by step, then write a self-cont... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max([1234, 456, 789]) == 1234\", \"assert find_max([1112, 2223, 3334]) == 1112\", \"assert find_max([111111, 22, 33]) == 111111\", \"assert find_max([1, 22, 333]) == 1\", \"assert find_max([12, 23, 34, 45]) == 12\", \"assert find_max([987, 123, 456, 789... | {
"split": "train",
"index": 65554,
"acecode_id": "evol_14954",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `fibonacci(n: int) -> int` that returns the nth Fibonacci number using a tabulation 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 use an iterative approach 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": 65555,
"acecode_id": "evol_29833",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a command-line interface for a text processing tool. The tool should accept a list of commands as input and execute them in sequence. Each command is represented as a string and may consist of one or more words. If no commands are provided, the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_commands(['start process', 'execute task', 'finish process']) == 'Start process. Execute task. Finish process.'\", \"assert process_commands([]) == 'No commands provided.'\", \"assert process_commands(['check status']) == 'Check status.'\", \"assert ... | {
"split": "train",
"index": 65556,
"acecode_id": "oss_12333",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a configuration dictionary that contains a list of supported file types under the key 'filetypes'. Your task is to implement a function `should_parse(config: dict, file: str) -> bool` that checks whether a given file, represented as a string (including its extensi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert should_parse({'filetypes': ['txt', 'csv', 'json']}, 'document.txt') == True\", \"assert should_parse({'filetypes': ['txt', 'csv', 'json']}, 'data.CSV') == True\", \"assert should_parse({'filetypes': ['txt', 'csv', 'json']}, 'image.jpeg') == False\", \"assert... | {
"split": "train",
"index": 65557,
"acecode_id": "bigcode_python_fns_20863",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that maps unique identifiers (ubids) to their corresponding specifications. You are given a list of ubids and a list of specifications, where each specification is represented as a dictionary with a 'key' and 'ubid'. Your goal is to i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert map_ubids_to_specs(['u1', 'u2'], [{'key': 'spec1', 'ubid': 'u1'}, {'key': 'spec2', 'ubid': 'u2'}]) == {'u1': {'key': 'spec1', 'ubid': 'u1'}, 'u2': {'key': 'spec2', 'ubid': 'u2'}}\", \"assert map_ubids_to_specs(['u1'], [{'key': 'spec1', 'ubid': 'u1'}, {'key':... | {
"split": "train",
"index": 65558,
"acecode_id": "oss_13820",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing the daily temperatures, implement a function that calculates the number of days until a warmer temperature for each day. If there is no future day for which this is possible, put 0 for that day. Return a list of integers representing the re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dailyTemperatures([73, 74, 75, 71, 69, 72, 76, 73]) == [1, 1, 4, 2, 1, 1, 0, 0]\", \"assert dailyTemperatures([30, 40, 50, 60]) == [1, 1, 1, 0]\", \"assert dailyTemperatures([30, 60, 90]) == [1, 1, 0]\", \"assert dailyTemperatures([50, 40, 30, 20]) == [0, 0,... | {
"split": "train",
"index": 65559,
"acecode_id": "bigcode_python_fns_7577",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of books and returns a list of unique authors. Each book is represented by a dictionary containing the title, author, and ISBN. Your function should accept a list of these book dictionaries and return a sorted list o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_authors([]) == []\", \"assert get_unique_authors([{'title': 'Book 1', 'author': 'Author A', 'isbn': '123'}]) == ['Author A']\", \"assert get_unique_authors([{'title': 'Book 1', 'author': 'Author A', 'isbn': '123'}, {'title': 'Book 2', 'author': 'A... | {
"split": "train",
"index": 65560,
"acecode_id": "oss_35123",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Write a function `fibonacci(n: int) -> List[int]` that returns the first 'n' components of the Fibonacci series. The Fibonacci series is defined as follows: the first two numbers are 0 and 1, and each subsequent number is the sum of the two preceding ones. The function should r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(0) == []\", \"assert fibonacci(1) == [0]\", \"assert fibonacci(2) == [0, 1]\", \"assert fibonacci(3) == [0, 1, 1]\", \"assert fibonacci(4) == [0, 1, 1, 2]\", \"assert fibonacci(5) == [0, 1, 1, 2, 3]\", \"assert fibonacci(6) == [0, 1, 1, 2, 3, 5]\",... | {
"split": "train",
"index": 65561,
"acecode_id": "evol_32560",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a custom user model for a web application. The user model should contain three fields: 'email', 'first_name', and 'last_name'. You need to implement a method `__str__` that returns a string representation of the user in the format 'Current user is: ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert custom_user_model('test@example.com', 'John', 'Doe', True) == ('Current user is: test@example.com: John Doe', True, True)\", \"assert custom_user_model('admin@example.com', 'Admin', 'User', True) == ('Current user is: admin@example.com: Admin User', True, Tr... | {
"split": "train",
"index": 65562,
"acecode_id": "oss_13544",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that returns a list of all schools based on a given list of school names. If the input list is empty, the function should return an empty list. Implement the function `get_school_list(schools: List[str]) -> List[str]` where `schools` is a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_school_list(['School A', 'School B', 'School C']) == ['School A', 'School B', 'School C']\", \"assert get_school_list(['High School', 'Elementary School']) == ['High School', 'Elementary School']\", \"assert get_school_list([]) == []\", \"assert get_scho... | {
"split": "train",
"index": 65563,
"acecode_id": "bigcode_python_fns_15162",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with analyzing a list of crime types represented as words in a string. Your goal is to implement a function `identify_crimes(lst: List[str]) -> List[Tuple[str, int]]` that takes a list of strings `lst` as input, identifies occurrences of specific crime types, and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert identify_crimes(['ASSAULT', 'ROBBERY', 'THEFT OF VEHICLE', 'ASSAULT']) == [('ASSAULT', 2), ('ROBBERY', 1), ('THEFT OF VEHICLE', 1)]\", \"assert identify_crimes(['BREAK AND ENTER', 'BREAK AND ENTER', 'ASSAULT', 'THEFT OF VEHICLE']) == [('ASSAULT', 1), ('BREAK... | {
"split": "train",
"index": 65564,
"acecode_id": "oss_17765",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a given module version dependency is valid. A module of version V2 should not depend on a module of version V1. Your function should accept two strings: `v2_module` which represents the name of a V2 module, and `v1_module` ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_module_dependency('v2_module_a', 'mod2') == True\", \"assert check_module_dependency('v2_module_b', 'mod3') == True\", \"assert check_module_dependency('v2_module_d', 'mod4') == True\", \"assert check_module_dependency('v2_module_e', 'mod5') == True\",... | {
"split": "train",
"index": 65565,
"acecode_id": "bigcode_python_fns_16748",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the mean Average Precision (mAP) for a set of detection results. The function should take a list of dictionaries where each dictionary represents the results for a particular split of data. Each dictionary contains the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_map([{'split': 'train', 'collections': [0.9, 0.8, 0.75], 'iou_threshold': 0.5}]) == {'train': 0.82}\", \"assert compute_map([{'split': 'val', 'collections': [0.7, 0.6], 'iou_threshold': 0.5}, {'split': 'test', 'collections': [], 'iou_threshold': 0.5}... | {
"split": "train",
"index": 65566,
"acecode_id": "bigcode_python_fns_47164",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a recursive function that takes a string as input and returns the string reversed without using any native reverse functions. The string can contain letters, numbers, spaces, and special characters. Ensure that your function handles edge cases such as empty strings co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_string('') == ''\", \"assert reverse_string('abc') == 'cba'\", \"assert reverse_string('a b c') == 'c b a'\", \"assert reverse_string('12345') == '54321'\", \"assert reverse_string('!@#$%') == '%$#@!'\", \"assert reverse_string('Hello, World!') == '!... | {
"split": "train",
"index": 65567,
"acecode_id": "evol_14032",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes an integer `n` and a string `format_str`, and returns a formatted string based on the given format. The format string can contain the following placeholders: `%d` for decimal integers and `%x` for hexadecimal integers. For ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_number(255, 'The number is %d and in hex it is %x') == 'The number is 255 and in hex it is ff'\", \"assert format_number(0, 'Value: %d, Hex: %x') == 'Value: 0, Hex: 0'\", \"assert format_number(4095, 'Decimal: %d, Hex: %x') == 'Decimal: 4095, Hex: fff... | {
"split": "train",
"index": 65568,
"acecode_id": "bigcode_python_fns_37389",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes two dictionaries, each containing key-value pairs where keys are single lowercase letters and values are integers. Merge the two dictionaries into a single dictionary. If there are overlapping keys between the two dictionaries, sum the values cor... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_dicts({'a': 1, 'b': 2}, {'c': 3, 'd': 4}) == {'a': 1, 'b': 2, 'c': 3, 'd': 4}\", \"assert merge_dicts({'a': 1, 'b': 2}, {'a': 3, 'd': 4}) == {'a': 4, 'b': 2, 'd': 4}\", \"assert merge_dicts({'x': 5}, {'y': 10}) == {'x': 5, 'y': 10}\", \"assert merge_di... | {
"split": "train",
"index": 65569,
"acecode_id": "evol_5870",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `validate_blockchain` that takes a list of blocks as input and validates the integrity of the blockchain. Each block is represented as a dictionary with the following keys: 'index', 'timestamp', 'data', 'previous_hash', and 'hash'. Yo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_blockchain([{'index': 0, 'timestamp': 1632000000, 'data': 'Genesis Block', 'previous_hash': '', 'hash': '0' * 64}, {'index': 1, 'timestamp': 1632001000, 'data': 'Transaction Data', 'previous_hash': '0' * 64, 'hash': '1' * 64}]) == True\", \"assert v... | {
"split": "train",
"index": 65570,
"acecode_id": "oss_11833",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python decorator named `measure_time` that measures the execution time of a function. When the decorated function is executed, the decorator should print the function name along with the elapsed time in milliseconds. Implement the `measure_time` d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert measure_time(add_stuff)(1, 2) == 3\", \"assert measure_time(add_stuff)(5, 10) == 15\", \"assert measure_time(add_stuff)(10, 20) == 30\", \"assert measure_time(add_stuff)(0, 0) == 0\", \"assert measure_time(add_stuff)(-1, 1) == 0\", \"assert measure_time(add_... | {
"split": "train",
"index": 65571,
"acecode_id": "oss_1557",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two strings representing sequence records, determine if they belong to the same fragment based on specific naming conventions. Each string can either end with '/1' or '/2', or can contain a space followed by '1:' or '2:'. Your task is to implement a function `check_is_pai... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_is_pair('seq/1', 'seq/2') == True\", \"assert check_is_pair('seq::test/1', 'seq::test/2') == True\", \"assert check_is_pair('test/1', 'test/2') == True\", \"assert check_is_pair('sample/1', 'sample/1') == False\", \"assert check_is_pair('record/1', 're... | {
"split": "train",
"index": 65572,
"acecode_id": "bigcode_python_fns_13333",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a string representation of an ETag based on a given value and a weakness indicator. An ETag is a unique identifier assigned by a web server to a particular version of a resource. The function should take a string value and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_etag('abc123', False) == 'abc123'\", \"assert generate_etag('abc123', True) == 'W/abc123'\", \"assert generate_etag('etag_value', False) == 'etag_value'\", \"assert generate_etag('etag_value', True) == 'W/etag_value'\", \"assert generate_etag('versi... | {
"split": "train",
"index": 65573,
"acecode_id": "bigcode_python_fns_37779",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a filename as input and determines the file format based on its extension. The function should return a string indicating the file type: 'CSV', 'JSON', 'OFF', or 'Unknown Format' if the extension is not recognized. The supp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_file_type('data.csv') == 'CSV'\", \"assert get_file_type('config.json') == 'JSON'\", \"assert get_file_type('model.off') == 'OFF'\", \"assert get_file_type('report.txt') == 'Unknown Format'\", \"assert get_file_type('image.png') == 'Unknown Format'\", \"... | {
"split": "train",
"index": 65574,
"acecode_id": "oss_35320",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given the confusion matrix for a binary classification task, represented as a 2x2 matrix. The matrix contains the counts of true positive (TP), false positive (FP), true negative (TN), and false negative (FN) predictions. Your task is to calculate the precision, recall,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_metrics([[10, 2], [1, 7]]) == {'precision': 0.8333333333333334, 'recall': 0.9090909090909091, 'f1_score': 0.8695652173913043}\", \"assert calculate_metrics([[0, 0], [0, 0]]) == {'precision': 'undefined', 'recall': 'undefined', 'f1_score': 'undefine... | {
"split": "train",
"index": 65575,
"acecode_id": "oss_12291",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a 2D list (matrix) of integers, write a function `shuffle_rows(matrix)` that randomly shuffles the order of the rows in the matrix. The input matrix will have at least one row and can have varying numbers of columns. The function should modify the input matrix in place an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shuffle_rows([[1, 2], [3, 4]]) is None\", \"assert shuffle_rows([[1], [2], [3]]) is None\", \"assert shuffle_rows([[1, 2, 3], [4, 5, 6]]) is None\", \"assert shuffle_rows([[1, 2], [3, 4], [5, 6]]) is None\", \"assert shuffle_rows([[1]]) is None\", \"assert s... | {
"split": "train",
"index": 65576,
"acecode_id": "bigcode_python_fns_4561",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a square matrix of integers, return a list containing the sums of the two main diagonals of the matrix. The first element of the list should be the sum of the top-left to bottom-right diagonal, and the second element should be the sum of the top-right to bottom-left diago... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_diagonal_sums([[1]]) == [1, 1]\", \"assert get_diagonal_sums([[1, 2], [3, 4]]) == [5, 5]\", \"assert get_diagonal_sums([[1, 0, 0], [0, 1, 0], [0, 0, 1]]) == [3, 1]\", \"assert get_diagonal_sums([[0, 0, 0], [0, 0, 0], [0, 0, 0]]) == [0, 0]\", \"assert get... | {
"split": "train",
"index": 65577,
"acecode_id": "bigcode_python_fns_23839",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function named 'cipher' that takes a single string as input and returns an encrypted version of that string. The encryption mechanism should shift all alphabetical characters (both uppercase and lowercase) by three positions to the right in the alphabet, while numer... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cipher('Hi') == 'Kl'\", \"assert cipher('ABCxyz') == 'DEFabc'\", \"assert cipher('1234') == '4567'\", \"assert cipher('!@#') == '!@#'\", \"assert cipher('Hello World!') == 'Khoor Zruog!'\", \"assert cipher('Python3.9') == 'Sbwkrq6.2'\", \"assert cipher('XYZ1... | {
"split": "train",
"index": 65578,
"acecode_id": "evol_20451",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing the status of power zones in a smart home system. Each power zone has a name, a running status, and a manual running status. Your goal is to implement a function named `update_power_status` that takes in a zone name (string), a running status (boole... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_power_status('kitchen', True, False) == {'zone_name': 'kitchen', 'running': True, 'running_manually': False}\", \"assert update_power_status('living_room', False, True) == {'zone_name': 'living_room', 'running': False, 'running_manually': True}\", \"a... | {
"split": "train",
"index": 65579,
"acecode_id": "oss_9011",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that takes in a list of tuples representing points drawn on a 2D canvas. Each tuple contains the x and y coordinates of a point. Your goal is to determine the bounding box of the drawn points. The bounding box is defined as the smallest re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bounding_box([(1, 2), (3, 4), (5, 6)]) == (1, 2, 5, 6)\", \"assert bounding_box([(0, 0), (0, 0), (0, 0)]) == (0, 0, 0, 0)\", \"assert bounding_box([]) == (0, 0, 0, 0)\", \"assert bounding_box([(2, 3)]) == (2, 3, 2, 3)\", \"assert bounding_box([(-1, -2), (-3,... | {
"split": "train",
"index": 65580,
"acecode_id": "oss_2145",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer x, return the integer that satisfies the equation 3 * x + 11 = 2 * x + 17. Implement a function named `find_integer` that returns this integer.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```pyth... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_integer() == 6\", \"assert find_integer() == 6\", \"assert find_integer() == 6\", \"assert find_integer() == 6\", \"assert find_integer() == 6\", \"assert find_integer() == 6\", \"assert find_integer() == 6\", \"assert find_integer() == 6\", \"assert fi... | {
"split": "train",
"index": 65581,
"acecode_id": "evol_7031",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of time series data, where each time series is represented as a list of floats. Your task is to create a function that computes the average of each time series across all dimensions and returns a tuple containing two elements: the first element is a 2D list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert random_policy([[1.0, 2.0], [3.0, 4.0]]) == ([[0.5, 0.5], [0.5, 0.5]], [2.0, 3.0])\", \"assert random_policy([[1.0, 1.0], [1.0, 1.0]]) == ([[0.5, 0.5], [0.5, 0.5]], [1.0, 1.0])\", \"assert random_policy([[0.0, 0.0], [0.0, 0.0]]) == ([[0.5, 0.5], [0.5, 0.5]], ... | {
"split": "train",
"index": 65582,
"acecode_id": "bigcode_python_fns_15067",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Implement a function `XNOR(a: bool, b: bool) -> bool` that takes two boolean values as input and returns True if both inputs are equal, and False otherwise. The function should implement the logic for an XNOR gate using basic boolean operations.\nPlease reason step by step, the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert XNOR(True, True) == True\", \"assert XNOR(True, False) == False\", \"assert XNOR(False, True) == False\", \"assert XNOR(False, False) == True\", \"assert XNOR(True, True) == True\", \"assert XNOR(False, False) == True\", \"assert XNOR(True, False) == False\"... | {
"split": "train",
"index": 65583,
"acecode_id": "evol_30060",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `push(queue: List[Tuple[int, str]], priority: int, data: str) -> List[Tuple[int, str]]` that simulates adding an element with a given priority to a priority queue represented as a list of tuples, where each tuple contains a priority and the associated data.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert push([(0, 'task0'), (1, 'task1'), (2, 'task2')], 3, 'task3') == [(0, 'task0'), (1, 'task1'), (2, 'task2'), (3, 'task3')]\", \"assert push([], 5, 'task5') == [(5, 'task5')]\", \"assert push([(1, 'task1')], 1, 'task1') == [(1, 'task1'), (1, 'task1')]\", \"asse... | {
"split": "train",
"index": 65584,
"acecode_id": "evol_10143",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a given board name for a Trello board is valid based on specific criteria. The function should take a single string argument `board_name` and return a boolean value. A valid board name must meet the following criteria: \n\n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_board_name('My Board') == True\", \"assert is_valid_board_name('') == False\", \"assert is_valid_board_name('AB') == False\", \"assert is_valid_board_name('A valid board name') == True\", \"assert is_valid_board_name('A') == False\", \"assert is_val... | {
"split": "train",
"index": 65585,
"acecode_id": "oss_31015",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representation of a GYP (Generate Your Projects) file snippet, which defines build targets and their dependencies. Your task is to implement a function that extracts the target names and their corresponding dependencies from this GYP file snippet. The fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_targets_and_dependencies(\\\"\\\"\\\"\\n {\\n 'target_name': 'libfoo',\\n 'dependencies': []\\n }\\n\\\"\\\"\\\") == {'libfoo': []}\", \"assert extract_targets_and_dependencies(\\\"\\\"\\\"\\n {\\n 'target_name': 'libbar',\\n ... | {
"split": "train",
"index": 65586,
"acecode_id": "oss_27563",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the positions of fixations on a line of text and a tuple representing the start and end indices of an interest area within that line. Your task is to implement a function that calculates the distance from the left edge of the intere... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initial_landing_distance([1, 2, 5, 7], (2, 6)) == 0\", \"assert initial_landing_distance([2, 3, 5, 8], (5, 10)) == 0\", \"assert initial_landing_distance([10, 15, 20], (5, 25)) == 5\", \"assert initial_landing_distance([6, 7, 8, 9], (10, 15)) == None\", \"as... | {
"split": "train",
"index": 65587,
"acecode_id": "bigcode_python_fns_23033",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing an IP address and a dictionary containing penalties for three types of IP classifications: 'tor', 'vpn', and 'blacklist'. Your task is to implement a function that calculates the maximum penalty based on whether the IP address exists in the r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_max_penalty('192.168.1.1', {'tor_penalty': 5, 'vpn_penalty': 10, 'ip_blacklist_penalty': 15}) == 15\", \"assert calculate_max_penalty('10.0.0.5', {'tor_penalty': 0, 'vpn_penalty': 20, 'ip_blacklist_penalty': 0}) == 20\", \"assert calculate_max_pena... | {
"split": "train",
"index": 65588,
"acecode_id": "bigcode_python_fns_11570",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given a list of URLs, your task is to create a function that returns a list of icons corresponding to each URL. The function should attempt to find an icon based on specific rules: first, check if the URL contains any known partial strings that map to predefined icon URLs; if n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_icons(['http://unknown.com', 'https://anotherunknown.com'], {}, {}) == [None, None]\", \"assert get_icons(['https://example.com'], {'example': 'http://example.com/icon.png'}, {'default': 'http://example.com/default.png'}) == ['http://example.com/icon.png... | {
"split": "train",
"index": 65589,
"acecode_id": "bigcode_python_fns_40004",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a string 'name' that represents a variable name in camelCase format. Your task is to write a function that converts this camelCase string into snake_case format. The conversion should follow these rules: 1. All letters should be in lowercase. 2. Each uppercase let... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert snake_case('myVariable') == 'my_variable'\", \"assert snake_case('MyVariable') == 'my_variable'\", \"assert snake_case('myVariableName') == 'my_variable_name'\", \"assert snake_case('myVariableX') == 'my_variable_x'\", \"assert snake_case('my.variable') == '... | {
"split": "train",
"index": 65590,
"acecode_id": "bigcode_python_fns_19350",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that calculates the maximum power consumption of a specific appliance based on given specifications. The function will take a string representing the appliance type (`'fridge'`, `'washing machine'`, `'dishwasher'`, `'Electric_Vehicle'`, o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_power_consumption('fridge', 400) == 400\", \"assert max_power_consumption('washing machine', 4500) == 4500\", \"assert max_power_consumption('dishwasher', 600) == 600\", \"assert max_power_consumption('Electric_Vehicle', 7000) == 7000\", \"assert max_pow... | {
"split": "train",
"index": 65591,
"acecode_id": "bigcode_python_fns_28141",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of configuration strings and extracts specific information based on the provided format. Each configuration string contains a key-value pair, where the key corresponds to a token name and the value represents ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_tokens(['token1: value1', 'token2: value2']) == ['token1: value1', 'token2: value2']\", \"assert extract_tokens(['tokenA: #ffffff', 'tokenB: #000000', 'tokenC: #ff0000']) == ['tokenA: #ffffff', 'tokenB: #000000', 'tokenC: #ff0000']\", \"assert extrac... | {
"split": "train",
"index": 65592,
"acecode_id": "oss_34626",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a positive integer n, implement a function `cumulative_sum(n)` that calculates the cumulative total of all positive integers from 1 to n. The function should be efficient enough to handle large inputs in the range (0 < n < 10^7).\nPlease reason step by step, then write a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cumulative_sum(1) == 1\", \"assert cumulative_sum(2) == 3\", \"assert cumulative_sum(3) == 6\", \"assert cumulative_sum(4) == 10\", \"assert cumulative_sum(5) == 15\", \"assert cumulative_sum(6) == 21\", \"assert cumulative_sum(7) == 28\", \"assert cumulativ... | {
"split": "train",
"index": 65593,
"acecode_id": "evol_8915",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function called `multiply` that takes two integers as parameters and returns their product. For example, if the input is (3, 7), the output should be 21.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```pyt... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multiply(3, 7) == 21\", \"assert multiply(0, 5) == 0\", \"assert multiply(-3, 7) == -21\", \"assert multiply(-3, -7) == 21\", \"assert multiply(10, 0) == 0\", \"assert multiply(1, 1) == 1\", \"assert multiply(2, 3) == 6\", \"assert multiply(4, 5) == 20\", \"... | {
"split": "train",
"index": 65594,
"acecode_id": "evol_20029",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the retrieval of a graph based on certain parameters. The function should take in parameters that define the characteristics of the graph such as whether it is directed, whether to load nodes, and which version of the graph... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert retrieve_graph() == {'directed': False, 'nodes': [1, 2, 3, 4, 5], 'version': '2021-08-30'}\", \"assert retrieve_graph(directed=True) == {'directed': True, 'nodes': [1, 2, 3, 4, 5], 'version': '2021-08-30'}\", \"assert retrieve_graph(load_nodes=False) == {'di... | {
"split": "train",
"index": 65595,
"acecode_id": "bigcode_python_fns_41245",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given an array `routes`, where `routes[i] = [cityAi, cityBi]` means there exists a direct route going from `cityAi` to `cityBi`. Write a function `getSourceCity(routes)` that returns the source city, which is defined as the city that has no incoming routes from any othe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert getSourceCity([['London', 'New York'], ['New York', 'Lima'], ['Lima', 'Sao Paulo']]) == 'London'\", \"assert getSourceCity([['B', 'C'], ['D', 'B'], ['C', 'A']]) == 'D'\", \"assert getSourceCity([['A', 'Z']]) == 'A'\", \"assert getSourceCity([['Tokyo', 'Seoul... | {
"split": "train",
"index": 65596,
"acecode_id": "evol_34869",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes user input for a chatbot managing addresses and statistics. The function should return predefined responses based on the user's input as a string. If the input matches any of the predefined strings, return the corresponding... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert processInput('stats1') == 'Where do you want to consult the statistics?'\", \"assert processInput('statsaddr') == 'My Addresses'\", \"assert processInput('statsp2m') == 'EqualHash'\", \"assert processInput('statsReturn') == '<< Back to Stats'\", \"assert pro... | {
"split": "train",
"index": 65597,
"acecode_id": "oss_17585",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of integers and returns a new list containing only the prime numbers from the input list. The input list may contain both prime and non-prime integers.\nPlease reason step by step, then write a self-contained Python solution. Give your fin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert segregate_prime_numbers([10, 13, 15, 17, 19, 22, 25]) == [13, 17, 19]\", \"assert segregate_prime_numbers([2, 3, 4, 5, 6, 7, 8]) == [2, 3, 5, 7]\", \"assert segregate_prime_numbers([1, 4, 6, 8, 9, 10]) == []\", \"assert segregate_prime_numbers([]) == []\", \... | {
"split": "train",
"index": 65598,
"acecode_id": "evol_14921",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of datetime stamps and a list of views, where each view corresponds to a directory containing image files. Your task is to create a function `reorganize_images(datetime_stamps: List[str], views: List[str]) -> List[str]` that reorganizes the image files in e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reorganize_images(['2023-01-01', '2023-01-02'], ['view1', 'view2']) == ['2023-01-01_0.hdr', '2023-01-01_1.hdr', '2023-01-02_0.hdr', '2023-01-02_1.hdr']\", \"assert reorganize_images(['2023-01-01'], ['view1']) == ['2023-01-01_0.hdr', '2023-01-01_1.hdr']\", \"... | {
"split": "train",
"index": 65599,
"acecode_id": "bigcode_python_fns_36627",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.