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 to handle agent requests in a covert agency's security system. The function, `handle_agent_request(player, agent, agent_id)`, should take three parameters: a 'player' object, an 'agent' object, and an 'agent_id' string. The function m... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert handle_agent_request(Player('Charlie'), Agent('Alpha', 1, 10, 20, []), '1') == {'id': 1, 'x': 10, 'y': 20, 'packages': 0}\", \"assert handle_agent_request(Player('Charlie'), Agent('Alpha', 1, 10, 20, [1, 2]), '1') == {'id': 1, 'x': 10, 'y': 20, 'packages': 2... | {
"split": "train",
"index": 61600,
"acecode_id": "oss_8199",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Write a function `find_phoenix(text: str) -> str` that checks if the word \"phoenix\" appears at the beginning of any paragraph in the given text. A paragraph is defined as a line of text that is separated by newline characters. The function should return a message indicating w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_phoenix(\\\"phoenix is a mythical bird.\\\\nIt represents a new start, rebirth and longevity.\\\") == 'The lexeme \\\"phoenix\\\" is found at the inception of a paragraph.'\", \"assert find_phoenix(\\\"This is a test paragraph.\\\\nphoenix rises from as... | {
"split": "train",
"index": 61601,
"acecode_id": "evol_9017",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a list of motifs and a dictionary that maps cluster regions to their sizes. Your task is to calculate the distances of each motif from its respective cluster regions. Each motif corresponds to a distance value that is calculated based on the given cluster regions ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_motif_distances({'regionA': 10, 'regionB': 20}, ['regionA', 'regionB', 'regionC']) == [10, 20, 0]\", \"assert calculate_motif_distances({'regionX': 5, 'regionY': 15}, ['regionY', 'regionZ']) == [15, 0]\", \"assert calculate_motif_distances({}, ['mo... | {
"split": "train",
"index": 61602,
"acecode_id": "bigcode_python_fns_14970",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a 2D list of numerical values representing a grid, implement a function that expands the grid in both the vertical and horizontal directions by a specified factor. The expansion should create additional rows and columns between existing rows and columns, filling them with... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert expand_grid([[1, 2], [3, 4]], 1) == [[1, 1.5, 2], [2, 2.5, 3], [3, 3.5, 4]]\", \"assert expand_grid([[1]], 1) == [[1]]\", \"assert expand_grid([[1, 1], [1, 1]], 1) == [[1, 1, 1], [1, 1, 1], [1, 1, 1]]\", \"assert expand_grid([[0, 1], [1, 0]], 1) == [[0, 0.5,... | {
"split": "train",
"index": 61603,
"acecode_id": "bigcode_python_fns_23689",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a list of the first n Fibonacci numbers. The function, `generate_fibonacci`, takes a single integer parameter n, which represents the number of Fibonacci numbers to generate. The Fibonacci sequence is defined as follows: th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_fibonacci(0) == []\", \"assert generate_fibonacci(1) == [0]\", \"assert generate_fibonacci(2) == [0, 1]\", \"assert generate_fibonacci(3) == [0, 1, 1]\", \"assert generate_fibonacci(4) == [0, 1, 1, 2]\", \"assert generate_fibonacci(5) == [0, 1, 1, 2... | {
"split": "train",
"index": 61604,
"acecode_id": "oss_14868",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of 3D mesh dimensions and collects information about their bounding boxes. The function should take in a list of mesh dimensions, where each dimension is represented as a tuple of three floats (length, width, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_bounding_boxes([(1.0, 2.0, 3.0)], False) == [{'min': (0.0, 0.0, 0.0), 'max': (1.0, 2.0, 3.0)}]\", \"assert compute_bounding_boxes([(1.0, 2.0, 3.0)], True) == [{'min': (0.0, 0.0, 0.0), 'max': (1.0, 2.0, 3.0)}]\", \"assert compute_bounding_boxes([(5.0,... | {
"split": "train",
"index": 61605,
"acecode_id": "oss_27346",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes an array of integers and sorts it in ascending order, ensuring that all negative numbers are placed before non-negative numbers. The negative numbers should be sorted in ascending order and should be located at the beginning of the array, followe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert modified_merge_sort([34, 19, 42, -9, 2018, 0, 105]) == [-9, 0, 19, 34, 42, 105, 2018]\", \"assert modified_merge_sort([-1, -2, -3, 0, 1, 2, 3]) == [-3, -2, -1, 0, 1, 2, 3]\", \"assert modified_merge_sort([0, 0, 0, 0]) == [0, 0, 0, 0]\", \"assert modified_mer... | {
"split": "train",
"index": 61606,
"acecode_id": "evol_8037",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string containing multiple sentences. Your task is to implement a function `detect_emotion(S)` that returns a tuple of two integers. The first integer should represent the total number of sentences that begin with the word 'He', indicating a dull emotion. The se... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert detect_emotion('Wow, that is amazing!') == (0, 0)\", \"assert detect_emotion('He is going to the market.') == (1, 0)\", \"assert detect_emotion('He said nothing!') == (1, 0)\", \"assert detect_emotion('He is here. He is there. He is everywhere!') == (3, 0)\"... | {
"split": "train",
"index": 61607,
"acecode_id": "evol_8856",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a person's name and age as input and returns a formatted string containing the person's information. The function should be defined as follows: `def format_person_info(name: str, age: int) -> str:`. The output should be in the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_person_info('Alice', 30) == 'Name: Alice, Age: 30'\", \"assert format_person_info('Bob', 25) == 'Name: Bob, Age: 25'\", \"assert format_person_info('Charlie', 40) == 'Name: Charlie, Age: 40'\", \"assert format_person_info('Dave', 18) == 'Name: Dave, A... | {
"split": "train",
"index": 61608,
"acecode_id": "oss_15339",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a nested structure of types, determine if the outermost type is a 'Scalar' type or contains a 'Scalar' type nested within. The types can be a 'BaseType', 'OptionalType', or 'ListType'. The 'BaseType' has a property 'name', and we are only interested in those with the name... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isWrappedScalarType(BaseType('Scalar')) == True\", \"assert isWrappedScalarType(BaseType('Integer')) == False\", \"assert isWrappedScalarType(OptionalType(BaseType('Scalar'))) == True\", \"assert isWrappedScalarType(OptionalType(BaseType('Integer'))) == Fals... | {
"split": "train",
"index": 61609,
"acecode_id": "bigcode_python_fns_10589",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings that represent sentences. Your task is to write a function that takes this list as input and returns a new list where each sentence is cleaned. The cleaning process involves removing any parentheses and the text within them, as well as replacing ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert clean_sentences(['This is a test (remove this)', 'Another sentence with multiple spaces']) == ['This is a test', 'Another sentence with multiple spaces']\", \"assert clean_sentences(['No parentheses here.', 'Clean this (and this) too']) == ['No paren... | {
"split": "train",
"index": 61610,
"acecode_id": "bigcode_python_fns_5044",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of bars in a histogram. Your task is to implement a function `max_area(heights: List[int]) -> int` that calculates the maximum rectangular area that can be formed within the histogram. You may assume that each bar has a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_area([]) == 0\", \"assert max_area([1]) == 1\", \"assert max_area([2,1,5,6,2,3]) == 10\", \"assert max_area([1,2,3,4,5]) == 9\", \"assert max_area([5,4,3,2,1]) == 9\", \"assert max_area([1,1,1,1,1]) == 5\", \"assert max_area([0,0,0,0]) == 0\", \"assert m... | {
"split": "train",
"index": 61611,
"acecode_id": "oss_18372",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a string username, write a function that constructs a base path for user files by appending the username to a predefined base directory 'user_files'. The function should return the complete path as a string. For this problem, assume the base directory is fixed as 'user_fi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert user_base('john_doe') == 'user_files/john_doe'\", \"assert user_base('alice123') == 'user_files/alice123'\", \"assert user_base('test_user') == 'user_files/test_user'\", \"assert user_base('admin') == 'user_files/admin'\", \"assert user_base('user_2021') == ... | {
"split": "train",
"index": 61612,
"acecode_id": "bigcode_python_fns_36671",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `Fibonacci(n: int) -> int` that returns the nth Fibonacci number. The Fibonacci sequence is defined as follows: F(0) = 0, F(1) = 1, and F(n) = F(n-1) + F(n-2) for n > 1. The function should handle cases where n is a non-negative integer (0 or greater).\nPle... | 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": 61613,
"acecode_id": "evol_21807",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given the coordinates of two foci of an ellipse represented by two tuples (x1, y1) and (x2, y2), and a width w, write a function that calculates the center coordinates, width, height, and angle of the ellipse relative to the x-axis. The function should return these values as a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert ellipse_properties(((0, 0), (4, 0)), 2) == ((2.0, 0.0), 4.0, 2.0, 0.0)\", \"assert ellipse_properties(((1, 1), (1, 5)), 3) == ((1.0, 3.0), 4.0, 3.0, 90.0)\", \"assert ellipse_properties(((3, 4), (7, 8)), 4) == ((5.0, 6.0), 5.656854249492381, 4.0, 45.0)\", \"... | {
"split": "train",
"index": 61614,
"acecode_id": "bigcode_python_fns_39191",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a function called 'count_nums' that takes a list of integers as an input. The function should return the count of integers for which the sum of their digits (considering negative integers as having their initial negative digit included in the sum) is greater than zero... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_nums([]) == 0\", \"assert count_nums([1, 1, 2]) == 0\", \"assert count_nums([3, 7, 10]) == 0\", \"assert count_nums([-16, 2, 2]) == 0\", \"assert count_nums([-1, -2, -3, -4]) == 0\", \"assert count_nums([5, 5, 5, 5]) == 0\", \"assert count_nums([-1, -1... | {
"split": "train",
"index": 61615,
"acecode_id": "evol_12801",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that checks whether there is a subsequence of these integers such that the product of the integers in the subsequence is greater than a specified threshold. The function should return True if such a subsequence exists, otherwise re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_subsequence_product_greater_than_threshold([1, 2, 3, 4], 5) == True\", \"assert has_subsequence_product_greater_than_threshold([1, 1, 1, 1], 1) == False\", \"assert has_subsequence_product_greater_than_threshold([5, 10, 15], 100) == True\", \"assert has_... | {
"split": "train",
"index": 61616,
"acecode_id": "bigcode_python_fns_46361",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a list of 2D points represented as tuples (x, y), write a function that calculates the center of the minimum enclosing ellipse around these points. The function should return the center coordinates as a tuple (cx, cy). The center of the ellipse is defined as the mean of t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_ellipse_center([(1, 2), (3, 4), (5, 6)]) == (3.0, 4.0)\", \"assert calculate_ellipse_center([(0, 0), (0, 10), (10, 10), (10, 0)]) == (5.0, 5.0)\", \"assert calculate_ellipse_center([(1, 1)]) == (1.0, 1.0)\", \"assert calculate_ellipse_center([(2, 3... | {
"split": "train",
"index": 61617,
"acecode_id": "bigcode_python_fns_41535",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of mixed data types and returns a new list containing only the numeric values from the input list. The input list may contain integers, floats, strings, and None values. Your function should filter out any non-numeric ty... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_numeric_values([1, 2, 'three', None, 4.5]) == [1, 2, 4.5]\", \"assert filter_numeric_values(['a', 'b', 100, None, 3.14]) == [100, 3.14]\", \"assert filter_numeric_values([None, None, 0, 1.1, '']) == [0, 1.1]\", \"assert filter_numeric_values([]) == []... | {
"split": "train",
"index": 61618,
"acecode_id": "bigcode_python_fns_33745",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings in dot notation, convert it into a nested dictionary structure. Each string represents a path where the last part of the string is a leaf node (set to True) and all preceding parts are nested dictionaries. Write a function `dot_to_dict(values: List[str])... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dot_to_dict(['token.pos', 'token._.xyz']) == {'token': {'pos': True, '_': {'xyz': True}}}\", \"assert dot_to_dict(['user.name', 'user.age']) == {'user': {'name': True, 'age': True}}\", \"assert dot_to_dict(['settings.volume', 'settings.brightness', 'settings... | {
"split": "train",
"index": 61619,
"acecode_id": "bigcode_python_fns_8814",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, return the maximum value that can be obtained by selecting one or more non-adjacent elements from the list. You may not select two adjacent elements. Implement the function `max_non_adjacent_sum(nums: List[int]) -> int`, where `nums` is a list of integ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_non_adjacent_sum([]) == 0\", \"assert max_non_adjacent_sum([1]) == 1\", \"assert max_non_adjacent_sum([5, 1, 1, 5]) == 10\", \"assert max_non_adjacent_sum([2, 7, 9, 3, 1]) == 12\", \"assert max_non_adjacent_sum([1, 2, 3, 1]) == 4\", \"assert max_non_adja... | {
"split": "train",
"index": 61620,
"acecode_id": "bigcode_python_fns_25830",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a six-digit password, determine if it is valid based on the following criteria: 1. The password must have at least one pair of adjacent digits that are the same. 2. The digits must not decrease from left to right (i.e., each digit must be greater than or equal to the one ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_password(111111) == True\", \"assert is_valid_password(223450) == False\", \"assert is_valid_password(123789) == False\", \"assert is_valid_password(111122) == True\", \"assert is_valid_password(112233) == True\", \"assert is_valid_password(111111) ... | {
"split": "train",
"index": 61621,
"acecode_id": "bigcode_python_fns_47053",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of paths that represent sensitive fields in a nested dictionary structure, write a function `extract_sensitive_fields(paths: List[str], data: Dict[str, Any]) -> List[Any]` that extracts the values corresponding to the provided paths from the dictionary. Each path m... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_sensitive_fields(['password', 'username'], {'password': 'secret', 'username': 'user1'}) == ['secret', 'user1']\", \"assert extract_sensitive_fields(['vmInfo.password', 'vmInfo.username'], {'vmInfo': {'password': 'pass123', 'username': 'admin'}}) == [... | {
"split": "train",
"index": 61622,
"acecode_id": "bigcode_python_fns_24804",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of bars in a histogram. Your task is to write a function that calculates the area of the largest rectangle that can be formed within the histogram. Each bar's width is 1. The function should return the maximum area of th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert largest_rectangle_area([2, 1, 5, 6, 2, 3]) == 10\", \"assert largest_rectangle_area([1, 1, 1, 1]) == 4\", \"assert largest_rectangle_area([4, 2, 0, 3, 2, 5]) == 6\", \"assert largest_rectangle_area([1, 2, 3, 4, 5]) == 9\", \"assert largest_rectangle_area([5,... | {
"split": "train",
"index": 61623,
"acecode_id": "bigcode_python_fns_17311",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of binary numbers and two binary numbers n and m, implement a function that identifies all numbers in the list that are divisible by 5 and lie within the range of n and m, inclusive. The function should return a list of these binary numbers. The input list and the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_divisible_by_five(['101', '110', '111', '1000'], '110', '10000') == []\", \"assert find_divisible_by_five(['0', '10', '110', '111'], '0', '111') == ['0']\", \"assert find_divisible_by_five(['110', '1010', '1110'], '1010', '1111') == ['1010']\", \"assert... | {
"split": "train",
"index": 61624,
"acecode_id": "evol_28839",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given a string 'password', write a function that checks if the password meets the following criteria: it must be at least 8 characters long, contain at least one uppercase letter, one lowercase letter, one digit, and one special character from the set @$!%*?&. If the password m... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert password_validate('Password1!') == True\", \"assert password_validate('password') == False\", \"assert password_validate('PASSWORD123!') == False\", \"assert password_validate('Pass1') == False\", \"assert password_validate('password1!') == False\", \"assert... | {
"split": "train",
"index": 61625,
"acecode_id": "bigcode_python_fns_40155",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `product` that calculates the product of all the elements in a given iterable (like a list or tuple) and includes an optional parameter `start` which specifies the initial value for the product calculation. The function should return the product of a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert product() == 1\", \"assert product([]) == 1\", \"assert product((), 5) == 5\", \"assert product([2, 3, 4]) == 24\", \"assert product([1, 2, 3, 4], 2) == 48\", \"assert product([10, 0, 5]) == 0\", \"assert product([1.5, 2.5]) == 3.75\", \"assert product([1, 2... | {
"split": "train",
"index": 61626,
"acecode_id": "oss_35291",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that deploys a list of applications represented by their unique identifiers (slugs). Write a function `deploy(slugs: List[str]) -> None` that takes a list of slugs as input. The function should perform the following actions: 1. If the fir... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert deploy(['app1', 'app2', 'app3']) == None\", \"assert deploy(['', 'app2', 'app3']) == None\", \"assert deploy(['app1', '', 'app3']) == None\", \"assert deploy(['app1', 'app2', '']) == None\", \"assert deploy(['app1']) == None\", \"assert deploy(['', '']) == N... | {
"split": "train",
"index": 61627,
"acecode_id": "bigcode_python_fns_30665",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a data type, either 'exomes' or 'genomes', and a string representing a version of gnomAD (formatted as 'vX.X', where X is a digit), write a function that constructs and returns a full path to the liftover gnomAD Table based on these inputs. The path ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert _liftover_data_path('exomes', 'v2.1') == 'gs://gnomad-public-requester-pays/release/v2.1/liftover_grch38/ht/exomes/gnomad.exomes.rv2.1.sites.liftover_grch38.ht'\", \"assert _liftover_data_path('genomes', 'v3.0') == 'gs://gnomad-public-requester-pays/release/... | {
"split": "train",
"index": 61628,
"acecode_id": "bigcode_python_fns_12939",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `traverse_dict(data)` that takes a multi-layered dictionary as input. The dictionary can contain nested dictionaries, arrays, integers, and strings that represent numeric values. Your task is to return the sum of all numeric values found within the structur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert traverse_dict({'a': 1, 'b': 2}) == 3\", \"assert traverse_dict({'a': '3', 'b': {'c': '4'}}) == 7\", \"assert traverse_dict({'x': [1, 2, 3], 'y': ['4', '5']}) == 15\", \"assert traverse_dict({'level1': {'level2': {'level3': 10}}}) == 10\", \"assert traverse_d... | {
"split": "train",
"index": 61629,
"acecode_id": "evol_24553",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, write a function `wrap_container` that takes four parameters: a list of strings `literal_nodes`, a string `caption`, and a list of strings `classes`. The function should create a new list that combines the `caption` and all the elements in `literal_node... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert wrap_container(['Node1'], 'Caption2', ['class1']) == [{'class': 'class1', 'content': 'Caption2'}, {'class': 'class1', 'content': 'Node1'}]\", \"assert wrap_container(['Node1', 'Node2', 'Node3', 'Node4'], 'Caption7', ['class1']) == [{'class': 'class1', 'conte... | {
"split": "train",
"index": 61630,
"acecode_id": "bigcode_python_fns_3929",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of strings, where each string consists solely of numerical digits. The function should return a list of strings, where each output string indicates the count of odd digits in the corresponding input string. If any element in the input list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert complex_sum(['1234567']) == ['the count of odd parts 4n the str4ng 4 of the 4nput.']\", \"assert complex_sum(['3', '11111111']) == ['the count of odd parts 1n the str1ng 1 of the 1nput.', 'the count of odd parts 8n the str8ng 8 of the 8nput.']\", \"assert co... | {
"split": "train",
"index": 61631,
"acecode_id": "evol_21808",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with comparing two SQL profiles by calculating the absolute difference between their values. Implement a function `calculate_sql_profile_difference(recommended_sql_profile: int, implemented_sql_profile: int) -> int` that takes in two integers representing the rec... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_sql_profile_difference(10, 7) == 3\", \"assert calculate_sql_profile_difference(5, 5) == 0\", \"assert calculate_sql_profile_difference(20, 15) == 5\", \"assert calculate_sql_profile_difference(0, 10) == 10\", \"assert calculate_sql_profile_differe... | {
"split": "train",
"index": 61632,
"acecode_id": "oss_34221",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with categorizing customers based on their total spending into different price tiers. You will receive a list of tuples as input, where each tuple contains a customer's name and their total spending amount. Your goal is to write a function called `categorize_cust... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert categorize_customers([('Customer1', 80), ('Customer2', 150), ('Customer3', 600), ('Customer4', 300), ('Customer5', 50)]) == {'Low Price Teir': ['Customer1', 'Customer5'], 'Medium Price Teir': ['Customer2', 'Customer4'], 'High Price Teir': ['Customer3']}\", \... | {
"split": "train",
"index": 61633,
"acecode_id": "oss_14654",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Write a function `find_palindrome_and_prime(n: int) -> List[int]` that identifies all numbers within the range of 1 and a given integer n that are both palindromes and prime numbers. The function should return a list of these numbers in ascending order. The input integer n can ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_palindrome_and_prime(1) == []\", \"assert find_palindrome_and_prime(2) == [2]\", \"assert find_palindrome_and_prime(10) == [2, 3, 5, 7]\", \"assert find_palindrome_and_prime(10000) == [2, 3, 5, 7, 11, 101, 131, 151, 181, 191, 313, 353, 373, 383, 727, 75... | {
"split": "train",
"index": 61634,
"acecode_id": "evol_28589",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_anagram(string1: str, string2: str) -> bool` that takes two strings as input and returns True if the two strings are anagrams of each other, and False otherwise. The comparison should be case insensitive. An anagram is defined as a word or phrase formed... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_anagram('listen', 'silent') == True\", \"assert is_anagram('Triangle', 'Integral') == True\", \"assert is_anagram('Apple', 'Papel') == True\", \"assert is_anagram('Hello', 'Olelh') == True\", \"assert is_anagram('Dormitory', 'Dirty room') == False\", \"as... | {
"split": "train",
"index": 61635,
"acecode_id": "evol_22526",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that sets up a sensitivity analysis for a specific discipline in an engineering design optimization framework. The function should take two parameters: `parameter_values` (a dictionary containing values for parameters 'dis1.y2', 'dis1... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert setup_sensitivity_analysis({'dis1.y2': 0.0, 'dis1.y1': 2.0, 'dis2.y1': 3.16}, {'dis2.y2': 'dis1.y2', 'dis2.y1': 'dis1.y1'}) == {'parameters': {'dis1.y2': 0.0, 'dis1.y1': 2.0, 'dis2.y1': 3.16}, 'constraints': {'dis2.y2': 0.0, 'dis2.y1': 2.0}}\", \"assert setu... | {
"split": "train",
"index": 61636,
"acecode_id": "oss_29837",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing temperatures in degrees Celsius. Your task is to implement a function that returns a list of integers where each element represents the number of days until a warmer temperature. If there is no future day for which this is possible,... | 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([70, 60, 50, 40, 30]) == [0, 0, 0, 0, 0]\", \"assert dailyTemperatures([50]) == [0]\... | {
"split": "train",
"index": 61637,
"acecode_id": "oss_5386",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a list of tuples representing positions on a 9x9 grid, and a corresponding list of two-letter string types, write a function that returns a dictionary containing the initial state of the grid. The keys of the dictionary should be the positions (x, y) where 1 <= x <= 9 and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_initial_configuration([(1, 1), (2, 1)], ['KY', 'KE']) == {(1, 1): 'KY', (9, 9): 'KY', (2, 1): 'KE', (8, 9): 'KE'}\", \"assert get_initial_configuration([(1, 1)], ['KY']) == {(1, 1): 'KY', (9, 9): 'KY'}\", \"assert get_initial_configuration([(4, 1)], ['KI... | {
"split": "train",
"index": 61638,
"acecode_id": "bigcode_python_fns_28369",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the creation of a user profile in a system. The function should take two parameters: a phone number and a full name, both of which are strings. The function should return a dictionary representing the user profile, containi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_user_profile('+1234567890', 'John Doe') == {'phone': '+1234567890', 'full_name': 'John Doe'}\", \"assert create_user_profile('+9876543210', 'Alice') == {'phone': '+9876543210', 'full_name': 'Alice'}\", \"assert create_user_profile('+1112223333', 'Bob ... | {
"split": "train",
"index": 61639,
"acecode_id": "bigcode_python_fns_19958",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that constructs a protein interaction network graph. Given a list of pairs representing interactions between proteins, your goal is to create a function that generates a network graph representing these interactions. Each interaction ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_protein_network_graph([('A', 'B'), ('B', 'C')]).number_of_edges() == 2\", \"assert generate_protein_network_graph([('X', 'Y'), ('Y', 'Z'), ('X', 'Z')]).number_of_nodes() == 3\", \"assert generate_protein_network_graph([]).number_of_edges() == 0\", \... | {
"split": "train",
"index": 61640,
"acecode_id": "oss_6685",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of news articles, where each article is represented as a dictionary containing the keys 'title', 'description', and 'publishedAt'. Write a function that takes this list of articles and returns a list of titles of articles that were published after a given d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_articles_by_date([{'title': 'Article 1', 'description': 'Desc 1', 'publishedAt': '2023-10-01'}, {'title': 'Article 2', 'description': 'Desc 2', 'publishedAt': '2023-09-30'}, {'title': 'Article 3', 'description': 'Desc 3', 'publishedAt': '2023-10-05'}]... | {
"split": "train",
"index": 61641,
"acecode_id": "bigcode_python_fns_39310",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given the root of a binary search tree (BST) and two integer values, write a function to find and return the lowest common ancestor (LCA) of the two values in the BST. It is guaranteed that both values exist in the tree.\nPlease reason step by step, then write a self-contained ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert LCA(root, 4, 10).key == 5\", \"assert LCA(root, 1, 0).key == 1\", \"assert LCA(root, 0, 1).key == 1\", \"assert LCA(root, 4, 7).key == 5\", \"assert LCA(root, 1, 10).key == 5\", \"assert LCA(root, 5, 10).key == 5\", \"assert LCA(root, 5, 4).key == 5\", \"ass... | {
"split": "train",
"index": 61642,
"acecode_id": "evol_16018",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates validating an API response by checking if the constructed URL returns the expected response. Your function should take the following parameters: a string `url_base` representing the base URL of the API, a string `con... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_api_response('https://example.com', 'api', 'munge_tag', 2, {'name': 'Test subject'}, '\\\"test-subject\\\"') == True\", \"assert validate_api_response('https://example.com', 'api', 'munge_tag', 1, {'name': 'Another subject'}, '\\\"another-subject\\\... | {
"split": "train",
"index": 61643,
"acecode_id": "oss_17308",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that takes a dictionary as input and converts it into a specific format. The function should transform the input dictionary such that all keys are converted to uppercase and all values are converted to their string representati... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert converter({'name': 'Alice', 'age': 30}) == {'NAME': 'Alice', 'AGE': '30'}\", \"assert converter({'city': 'New York', 'population': 8419600}) == {'CITY': 'New York', 'POPULATION': '8419600'}\", \"assert converter({'product': 'Laptop', 'price': 999.99}) == {'P... | {
"split": "train",
"index": 61644,
"acecode_id": "oss_35922",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a list `ls` of integers representing the heights of walls at different positions. Your task is to find the maximum volume of water that can be trapped between the walls. The width of each wall is 1 unit. Write a function `max_trapped_water(ls)` that takes in the l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_trapped_water([1, 0, 1]) == 1\", \"assert max_trapped_water([4, 2, 0, 3, 2, 5]) == 9\", \"assert max_trapped_water([0, 1, 0, 2, 1, 0, 1, 3, 2, 1, 2, 1]) == 6\", \"assert max_trapped_water([0, 0, 0, 0]) == 0\", \"assert max_trapped_water([1, 2, 3, 4]) == ... | {
"split": "train",
"index": 61645,
"acecode_id": "oss_33049",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a string `text`, write a function `get_sentiment(text)` that analyzes the sentiment of the text and returns the prevailing sentiment as a string. The possible sentiments are 'positive', 'neutral', 'mixed', or 'negative'. Your function should determine the sentiment based ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_sentiment('I am so happy today!') == 'positive'\", \"assert get_sentiment('This is a terrible mistake.') == 'negative'\", \"assert get_sentiment('It was a day like any other.') == 'neutral'\", \"assert get_sentiment('I feel both good and bad about this.'... | {
"split": "train",
"index": 61646,
"acecode_id": "oss_1146",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function named 'vowels_count' that accepts a string input representing a lexeme and returns the cumulative count of present vowels. The vowels to be counted include 'a', 'e', 'i', 'o', 'u', and 'y', but only if 'y' is at the end of the string. The function should be... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert vowels_count('hello') == 2\", \"assert vowels_count('syzygy') == 1\", \"assert vowels_count('unusual!') == 4\", \"assert vowels_count('aBCdE') == 2\", \"assert vowels_count('XYZ') == 0\", \"assert vowels_count('a!b@c#d$e%f^g') == 2\", \"assert vowels_count('... | {
"split": "train",
"index": 61647,
"acecode_id": "evol_17215",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a binary tree, implement a function `depth_first_search(root: Node) -> List[int]` that performs a depth-first traversal of the tree and returns a list of values in the order they were visited. The tree is defined by the `Node` class, where each node has a `value`, a `left... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert depth_first_search(Node(1)) == [1]\", \"assert depth_first_search(Node(1, Node(2))) == [1, 2]\", \"assert depth_first_search(Node(1, None, Node(3))) == [1, 3]\", \"assert depth_first_search(Node(1, Node(2), Node(3))) == [1, 2, 3]\", \"assert depth_first_sear... | {
"split": "train",
"index": 61648,
"acecode_id": "evol_16010",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a transaction validation system for a digital artifact management platform. Your goal is to validate user actions with respect to artifacts. You need to implement a function `validate_transaction` that takes two parameters: `action` (string) and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_transaction('create', '123') == True\", \"assert validate_transaction('update', '456') == True\", \"assert validate_transaction('delete', '789') == True\", \"assert validate_transaction('create', 'artifact_1') == True\", \"assert validate_transactio... | {
"split": "train",
"index": 61649,
"acecode_id": "oss_24311",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given two integer arrays, create a function that returns two lists containing unique elements from each array. Unique elements are defined as those that do not appear in the other array, and all duplicates within each individual array should be removed. Implement a function `un... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_elements([1, 2, 3], [3, 4, 5]) == ([1, 2], [4, 5])\", \"assert unique_elements([10, 20, 30, 20], [30, 40, 50]) == ([10, 20], [40, 50])\", \"assert unique_elements([], [1, 2, 3]) == ([], [1, 2, 3])\", \"assert unique_elements([1, 2, 2, 1], []) == ([1, ... | {
"split": "train",
"index": 61650,
"acecode_id": "evol_13381",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given two dates, return the number of days that fall within leap years and common years between the two dates, inclusive. The function should accept two date strings in the format 'YYYY-MM-DD'. A leap year is defined as a year that is divisible by 4, but not divisible by 100, u... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert days_in_leap_and_common_years('2020-01-01', '2020-12-31') == (366, 0)\", \"assert days_in_leap_and_common_years('2019-01-01', '2019-12-31') == (0, 365)\", \"assert days_in_leap_and_common_years('1900-01-01', '1900-12-31') == (0, 365)\", \"assert days_in_leap... | {
"split": "train",
"index": 61651,
"acecode_id": "bigcode_python_fns_11536",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the average value of a list of numerical data. The function should take a list of integers or floats as input and return the average value. If the input list is empty, the function should raise a ValueError. Additional... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average([1, 2, 3, 4, 5]) == 3.0\", \"assert calculate_average([10.5, 20.5, 30.5]) == 20.5\", \"assert calculate_average([-1, -2, -3]) == -2.0\", \"assert calculate_average([1.5, 2.5, 3.5, 4.5]) == 3.0\", \"assert calculate_average([100, 200, 300]) ... | {
"split": "train",
"index": 61652,
"acecode_id": "oss_32692",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that returns a tuple containing the second smallest odd number and the second largest even number from the list. If there are not enough odd or even numbers, return None for that position in the tuple. The function signature should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert second_smallest_odd_and_second_largest_even([1, 2, 2, 3, 4, 4, 5]) == (3, 4)\", \"assert second_smallest_odd_and_second_largest_even([5, 1, 6, 3, 8, 7]) == (3, 6)\", \"assert second_smallest_odd_and_second_largest_even([1, 2]) == (None, None)\", \"assert sec... | {
"split": "train",
"index": 61653,
"acecode_id": "evol_2464",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a list of coefficients and a result, implement a function that checks if the given equation represented by the coefficients equals the result. The function should take two parameters, 'coefficients' (a list of integers or floats) and 'result' (an integer or float), and re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_equation([1, 2, 3], 6) == True\", \"assert check_equation([0, 0, 0], 0) == True\", \"assert check_equation([-1, -2, -3], -6) == True\", \"assert check_equation([1, 1, 1], 3) == True\", \"assert check_equation([1.5, 2.5], 4) == True\", \"assert check_eq... | {
"split": "train",
"index": 61654,
"acecode_id": "evol_12288",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `check_id(id: str) -> bool` that verifies the legitimacy of an individual's exclusive identification number. The ID is considered valid if it meets the following criteria: 1) The length of the ID is odd. 2) There are at least two different numerical digits pres... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_id('12345') == False\", \"assert check_id('151') == True\", \"assert check_id('123') == False\", \"assert check_id('1123') == False\", \"assert check_id('111') == False\", \"assert check_id('2468') == False\", \"assert check_id('1234567') == False\", \... | {
"split": "train",
"index": 61655,
"acecode_id": "evol_33338",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to convert RGB color values (red, green, blue) to their corresponding hexadecimal representation. The function should take a tuple of three integers, each ranging from 0 to 255, representing the red, green, and blue components of a co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert colour_to_hex((0, 0, 0)) == '#000000'\", \"assert colour_to_hex((255, 255, 255)) == '#FFFFFF'\", \"assert colour_to_hex((255, 0, 0)) == '#FF0000'\", \"assert colour_to_hex((0, 255, 0)) == '#00FF00'\", \"assert colour_to_hex((0, 0, 255)) == '#0000FF'\", \"ass... | {
"split": "train",
"index": 61656,
"acecode_id": "oss_17336",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string, implement a function that reverses each word in the string while maintaining the original order of the words. The function should handle edge cases such as special characters, capitalization in the middle of words, and punctuation marks within and outside the wo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_in_place('Python is fun!') == 'nohtyP si !nuf'\", \"assert reverse_in_place('123 abc!') == '321 !cba'\", \"assert reverse_in_place('A B C') == 'A B C'\", \"assert reverse_in_place('Good morning! How are you?') == 'dooG !gninrom woH era ?uoy'\", \"ass... | {
"split": "train",
"index": 61657,
"acecode_id": "evol_22237",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a class `Plot` that allows you to create and filter plots based on certain parameters. Implement a function `validate_plot_parameters(lowpass: float, highpass: float, filtorder: int, clipping: str) -> None` that validates the parameters for creating a plot. The fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_plot_parameters(1, 2, 1, 'transparent') is None\", \"assert validate_plot_parameters(1, 2, 1, 'clamp') is None\", \"assert validate_plot_parameters(1, 2, 1, 'none') is None\", \"assert validate_plot_parameters(0.5, 1.5, 1, 'transparent') is None\", ... | {
"split": "train",
"index": 61658,
"acecode_id": "bigcode_python_fns_26034",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of payment statuses and returns a dictionary containing the count of each unique status. The payment statuses are represented as strings and can be one of the following: 'pending', 'succeeded', 'done', 'refund... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_payment_statuses(['pending', 'succeeded', 'done', 'succeeded', 'refunded', 'pending', 'succeeded']) == {'pending': 2, 'succeeded': 3, 'done': 1, 'refunded': 1}\", \"assert count_payment_statuses(['succeeded', 'succeeded', 'succeeded']) == {'succeeded':... | {
"split": "train",
"index": 61659,
"acecode_id": "oss_8678",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a decorator function `do_not_track` in Python that modifies the behavior of a given view function. The decorator should take a single argument, which is a view function, and return a new function that disables tracking for the original view function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert do_not_track(lambda x: x)(5) == 5\", \"assert do_not_track(lambda x, y: x + y)(3, 4) == 7\", \"assert do_not_track(lambda: 'Hello World!')() == 'Hello World!'\", \"assert do_not_track(lambda a, b=10: a + b)(5) == 15\", \"assert do_not_track(lambda *args: sum... | {
"split": "train",
"index": 61660,
"acecode_id": "oss_11965",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating a random date within a specified range. Implement a function `generate_random_date(start_date: str, end_date: str) -> str` that returns a random date between `start_date` and `end_date`, inclusive. The dates are provided in the format 'YYYY-MM-DD'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_random_date('2020-01-01', '2020-01-01') in ['2020-01-01']\", \"assert generate_random_date('2020-01-01', '2020-01-05') in ['2020-01-01', '2020-01-02', '2020-01-03', '2020-01-04', '2020-01-05']\", \"assert generate_random_date('2019-12-31', '2020-01-... | {
"split": "train",
"index": 61661,
"acecode_id": "oss_27042",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of integers. Write a function called `process_integers` that takes in a list of integers `numbers`. The function should return a new list containing only the even integers from the input list, sorted in ascend... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_integers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert process_integers([10, 15, 20, 25]) == [10, 20]\", \"assert process_integers([7, 9, 11]) == []\", \"assert process_integers([2, 4, 6, 8]) == [2, 4, 6, 8]\", \"assert process_integers([5, 3, 1]) == []\", ... | {
"split": "train",
"index": 61662,
"acecode_id": "oss_31593",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a simple thermostat control system. Your goal is to implement a function that takes the current HVAC mode, the target HVAC mode, the current temperature, and the desired temperature, and returns the target HVAC mode based on the given conditions. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert determine_target_hvac_mode(0, 0, 18.0, 23.0) == 1\", \"assert determine_target_hvac_mode(1, 1, 20.0, 23.0) == 1\", \"assert determine_target_hvac_mode(2, 2, 25.0, 23.0) == 2\", \"assert determine_target_hvac_mode(0, 1, 18.0, 23.0) == 1\", \"assert determine_... | {
"split": "train",
"index": 61663,
"acecode_id": "bigcode_python_fns_35848",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a YouTube video URL as input and returns the video ID extracted from the URL. The input URL can either be in the format 'https://www.youtube.com/watch?v=VIDEO_ID' or 'https://youtu.be/VIDEO_ID'. Your function should handle ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_video_id('https://www.youtube.com/watch?v=dQw4w9WgXcQ') == 'dQw4w9WgXcQ'\", \"assert extract_video_id('https://youtu.be/dQw4w9WgXcQ') == 'dQw4w9WgXcQ'\", \"assert extract_video_id('https://www.youtube.com/watch?v=abcd1234') == 'abcd1234'\", \"assert ... | {
"split": "train",
"index": 61664,
"acecode_id": "oss_13986",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates loading a model based on specified parameters. The function should take the following keyword arguments: 'pretrained' (a boolean indicating whether to load pretrained weights) and 'root' (a string representing the locat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert load_model(pretrained=False, root='~/.chainer/models') == 'Loading model with pretrained=False from ~/.chainer/models'\", \"assert load_model(pretrained=True, root='~/models') == 'Loading model with pretrained=True from ~/models'\", \"assert load_model(pretr... | {
"split": "train",
"index": 61665,
"acecode_id": "bigcode_python_fns_11879",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given two integers x and y, implement a function f(x, y) that computes the value of the mathematical expression defined as: f(x, y) = x^3 + 2y^2. You need to evaluate this function for the provided values of x and y.\nPlease reason step by step, then write a self-contained Pyth... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert f(0, 0) == 0\", \"assert f(1, 1) == 3\", \"assert f(3, 2) == 35\", \"assert f(-3, 0) == -27\", \"assert f(8, 2) == 520\", \"assert f(0, 5) == 50\", \"assert f(2, -3) == 26\", \"assert f(-4, 1) == -62\", \"assert f(3, 0) == 27\"]}"
} | {
"split": "train",
"index": 61666,
"acecode_id": "evol_26341",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a list of astronomical observations, where each observation is represented as a dictionary containing the keys 'telescope', 'type', and 'program_id'. Write a function that filters the observations based on the given telescope name and type of observation, returnin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_observations([{'telescope': 'GMOS-N', 'type': 'BIAS', 'program_id': 'GN-CAL20191122'}, {'telescope': 'GMOS-N', 'type': 'FLAT', 'program_id': 'GN-CAL20191122'}], 'GMOS-N', 'BIAS') == [{'telescope': 'GMOS-N', 'type': 'BIAS', 'program_id': 'GN-CAL2019112... | {
"split": "train",
"index": 61667,
"acecode_id": "bigcode_python_fns_31397",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a non-negative integer n, implement a function `draw_polygons(n: int) -> int` that recursively calculates the number of polygons drawn when starting from layer n. Each recursive call reduces the layer by 1 until it reaches 0, which stops the recursion. The function should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert draw_polygons(3) == 0\", \"assert draw_polygons(0) == 0\", \"assert draw_polygons(1) == 0\", \"assert draw_polygons(2) == 0\", \"assert draw_polygons(5) == 0\", \"assert draw_polygons(10) == 0\", \"assert draw_polygons(4) == 0\", \"assert draw_polygons(6) ==... | {
"split": "train",
"index": 61668,
"acecode_id": "bigcode_python_fns_20382",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, implement a function `generate_embeddings(strings: List[str]) -> List[List[float]]` that simulates the generation of embeddings for each string in the input list. Each string is processed to produce a fixed number of embeddings (for example, 128). The f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_embeddings(['hello', 'world']) == [[0.0] * 128, [0.1] * 128]\", \"assert generate_embeddings(['single']) == [[0.0] * 128]\", \"assert generate_embeddings(['test1', 'test2', 'test3']) == [[0.0] * 128, [0.1] * 128, [0.2] * 128]\", \"assert generate_em... | {
"split": "train",
"index": 61669,
"acecode_id": "bigcode_python_fns_47437",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a function `getMainWindow()` that simulates retrieving a main window object from a GUI application. Your task is to implement a function `getMainWindowObject()` that returns the main window object. The main window object is represented as a string that describes i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert getMainWindowObject() == 'No GUI available'\", \"assert getMainWindowObject() == 'No GUI available'\", \"assert getMainWindowObject() == 'No GUI available'\", \"assert getMainWindowObject() == 'No GUI available'\", \"assert getMainWindowObject() == 'No GUI a... | {
"split": "train",
"index": 61670,
"acecode_id": "bigcode_python_fns_44832",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes two integers, 'a' and 'b', as input and returns their sum.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block."
}
] | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_and_print_sum(1, 2) == 3\", \"assert compute_and_print_sum(0, 0) == 0\", \"assert compute_and_print_sum(-1, -1) == -2\", \"assert compute_and_print_sum(5, 10) == 15\", \"assert compute_and_print_sum(100, 200) == 300\", \"assert compute_and_print_sum(... | {
"split": "train",
"index": 61671,
"acecode_id": "evol_16904",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that checks if a list of digits contains perfect square pairs. A perfect square pair consists of two consecutive numbers in the list that are the same and both are perfect squares. The function should return True if all pairs meet these conditions, otherwis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert perfectSquarePairs([1, 2, 4, 8, 9, 27]) == False\", \"assert perfectSquarePairs([1, 1, 4, 5]) == False\", \"assert perfectSquarePairs([0, 0, 1, 1]) == False\", \"assert perfectSquarePairs([4, 4, 8, 8]) == False\", \"assert perfectSquarePairs([1, 1, 4, 4, 9, ... | {
"split": "train",
"index": 61672,
"acecode_id": "evol_17806",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers, write a function `find_min` that takes two lists as input and returns a tuple containing the smallest unique integer from each list. If all integers in a list are identical or if the list is empty, the function should return None for that list. The ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_min([1, 1, 1], [1, 1, 1]) == (None, None)\", \"assert find_min([], [3, 2, 1]) == (None, 1)\", \"assert find_min([5, 5, 5], []) == (None, None)\", \"assert find_min([10, 9, 9, 8], [2, 2, 2, 1]) == (8, 1)\", \"assert find_min([1, 2, 3, 4], [10, 11, 12]) =... | {
"split": "train",
"index": 61673,
"acecode_id": "evol_5085",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `bitwise_operations(a: int, b: int) -> Tuple[int, int, int, int]` that takes two integers `a` and `b` and returns a tuple containing the results of the following bitwise operations: the Bitwise AND of `a` and `b`, the Bitwise OR of `a` and `b`, the Bitwise ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bitwise_operations(5, 3) == (1, 7, 6, 10)\", \"assert bitwise_operations(0, 0) == (0, 0, 0, 0)\", \"assert bitwise_operations(15, 5) == (5, 15, 10, 30)\", \"assert bitwise_operations(10, 3) == (2, 11, 9, 20)\", \"assert bitwise_operations(8, 9) == (8, 9, 1, ... | {
"split": "train",
"index": 61674,
"acecode_id": "evol_22542",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple namespace system. Your function should take a list of tuples, where each tuple consists of a string attribute name and its corresponding value. The function should return a dictionary representing the namespace... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_namespace([('E', 2.718), ('BitInst', True), ('Ext', 'Extension')]) == {'E': 2.718, 'BitInst': True, 'Ext': 'Extension'}\", \"assert create_namespace([('E', 2.718), ('BitInst', True), ('Ext', 'Extension'), ('E', 3.14)]) == {'E': 3.14, 'BitInst': True, ... | {
"split": "train",
"index": 61675,
"acecode_id": "oss_22174",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers and arranges them into a grid layout. The grid layout is defined by the number of rows and columns provided as input. Each integer should be placed in the grid according to its index in the list, starting... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert grid_integers([1, 2, 3, 4], 2, 2) == [[1, 2], [3, 4]]\", \"assert grid_integers([1, 2, 3, 4, 5], 3, 2) == [[1, 2], [3, 4], [5, -1]]\", \"assert grid_integers([], 3, 3) == [[-1, -1, -1], [-1, -1, -1], [-1, -1, -1]]\", \"assert grid_integers([1], 1, 3) == [[1,... | {
"split": "train",
"index": 61676,
"acecode_id": "oss_1571",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates loading a dataset of hobbies. The function should accept two parameters: a string `path` that represents the directory path where the dataset would be saved (defaulting to 'data'), and a boolean `extract` indicating whether... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert load_hobbies() == {'name': 'hobbies', 'path': 'data', 'extracted': True}\", \"assert load_hobbies('custom/path') == {'name': 'hobbies', 'path': 'custom/path', 'extracted': True}\", \"assert load_hobbies('custom/path', False) == {'name': 'hobbies', 'path': 'c... | {
"split": "train",
"index": 61677,
"acecode_id": "bigcode_python_fns_41595",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that initializes a worker application by starting a reactor with specified configuration parameters. The function should take in the name of the application as a string and a dictionary that contains various configuration settings. The fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_worker('App1', {'soft_file_limit': 1024, 'gc_thresholds': [100, 200], 'worker_pid_file': 'pidfile1', 'worker_daemonize': True, 'worker_cpu_affinity': [0, 1]}) is None\", \"assert initialize_worker('App2', {'soft_file_limit': 2048, 'gc_thresholds':... | {
"split": "train",
"index": 61678,
"acecode_id": "bigcode_python_fns_49525",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of time intervals representing the start and end times of sensor data recordings. Your task is to merge overlapping intervals and return a list of non-overlapping intervals. Each interval is represented by a tuple (start, end), where both start and end are ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_intervals([(1, 3), (2, 4)]) == [(1, 4)]\", \"assert merge_intervals([(1, 2), (3, 4), (5, 6)]) == [(1, 2), (3, 4), (5, 6)]\", \"assert merge_intervals([(1, 5), (2, 3), (4, 6)]) == [(1, 6)]\", \"assert merge_intervals([(1, 10), (2, 6), (8, 10)]) == [(1, ... | {
"split": "train",
"index": 61679,
"acecode_id": "bigcode_python_fns_7017",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that determines whether a given node should be formatted in its parent context based on specific configuration options. The function takes two parameters: `state`, which is a dictionary representing the current state of the node (incl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert should_format_in_parent_context({'parent': 'some_parent_node'}, {'options': {'output.format': True}}) == True\", \"assert should_format_in_parent_context({'parent': 'another_node'}, {'options': {'output.format': False}}) == False\", \"assert should_format_in... | {
"split": "train",
"index": 61680,
"acecode_id": "oss_15359",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of a set of buildings. Your task is to implement a function that returns a list of integers where each integer at index i represents the number of buildings that are taller than the building at index i, to its right. If ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_taller_buildings([5, 4, 3, 2, 1]) == [0, 0, 0, 0, 0]\", \"assert count_taller_buildings([]) == []\", \"assert count_taller_buildings([7]) == [0]\", \"assert count_taller_buildings([1, 1, 1, 1]) == [0, 0, 0, 0]\", \"assert count_taller_buildings([2, 3, ... | {
"split": "train",
"index": 61681,
"acecode_id": "bigcode_python_fns_46074",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with analyzing a list of comments to determine if the top comment exhibits high toxicity or attack levels. You are given a list of tuples called `toxicity_scores`, where each tuple contains a comment ID and a dictionary with the toxicity and attack scores of that... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_fields([('comment1', {'attributeScores': {'TOXICITY': {'summaryScore': {'value': 0.6}}, 'ATTACK_ON_COMMENTER': {'summaryScore': {'value': 0.4}}}})], {}) == {'Top_comment_untuned_toxicity': 1}\", \"assert update_fields([('comment1', {'attributeScores':... | {
"split": "train",
"index": 61682,
"acecode_id": "oss_34108",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are working on a treasure hunting game where players need to determine if the treasure location matches the environment they are in. You have two strings: one representing the decrypted treasure location and another representing the environment-specific treasure location. Y... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compare_treasure_locations('X marks the spot', 'X marks the spot') == 'Treasure found!'\", \"assert compare_treasure_locations('X marks the spot', 'Y marks the spot') == 'No treasure here!'\", \"assert compare_treasure_locations('Treasure is hidden', 'Treasu... | {
"split": "train",
"index": 61683,
"acecode_id": "oss_7720",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function called 'highest_prime' that takes a tuple of integers as input and returns the highest prime number from that tuple. The function should handle possible errors, such as if the tuple is empty or contains non-integer types.\nPlease reason step by step, then writ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert highest_prime((2, 3, 5)) == 5\", \"assert highest_prime((7, 11, 13)) == 13\", \"assert highest_prime((2, 2, 2)) == 2\", \"assert highest_prime((5, 3, 2, 7, 11)) == 11\", \"assert highest_prime((29, 17, 19)) == 29\", \"assert highest_prime((0, -1, -2, 3)) == ... | {
"split": "train",
"index": 61684,
"acecode_id": "evol_817",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that handles error responses for a web application. The function should take an error message string and return a formatted response string indicating that the request was forbidden. The response should include the error message and the s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert handle_forbidden('Access Denied') == 'Error: Access Denied, Status Code: 403 Forbidden'\", \"assert handle_forbidden('Unauthorized Access') == 'Error: Unauthorized Access, Status Code: 403 Forbidden'\", \"assert handle_forbidden('Permission Denied') == 'Erro... | {
"split": "train",
"index": 61685,
"acecode_id": "bigcode_python_fns_36302",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a Python dictionary containing color codes for different shades of red. Your task is to write a function that takes a color code as input and returns the corresponding key from the dictionary. If the input color code is not found in the dictionary, the function sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_red_shade({'B60': '#E24232', 'B70': '#E74C3C', 'B80': '#F66657', 'B90': '#F88478', 'B100': '#FFACA4', 'B110': '#FFC3BD'}, '#E24232') == 'B60'\", \"assert get_red_shade({'B60': '#E24232', 'B70': '#E74C3C', 'B80': '#F66657', 'B90': '#F88478', 'B100': '#FFA... | {
"split": "train",
"index": 61686,
"acecode_id": "oss_35973",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are working on a geographic information system (GIS) project that involves processing and organizing spatial data. Your task is to write a Python function named `generate_gis_output` that takes in various input parameters and generates a specific data structure as output. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_gis_output('/output', '/path/shapefile.shp', '/path/raster.tif', '/path/transmission_lines.shp', 'Project Alpha', {'total_heat_demand': 150}) == {'raster_layers': [{'name': 'district heating coherent areas', 'path': '/path/raster.tif', 'type': 'cust... | {
"split": "train",
"index": 61687,
"acecode_id": "oss_16345",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a namespace, return a list containing the associated Gene Ontology (GO) ID for the root of that namespace. The possible namespaces are 'biological_process', 'cellular_component', and 'molecular_function'. If the provided namespace matches one of thes... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_namespace_root('biological_process') == ['GO:0008150']\", \"assert set_namespace_root('cellular_component') == ['GO:0005575']\", \"assert set_namespace_root('molecular_function') == ['GO:0003674']\", \"assert set_namespace_root('invalid_namespace') == ['... | {
"split": "train",
"index": 61688,
"acecode_id": "bigcode_python_fns_15129",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that determines the congratulatory message for a game show winner based on a list of contestant names and a boolean variable indicating whether the game is won or not. Write a function `congratulate_winner(names: list, is_won: bool) -> st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert congratulate_winner(['Alice', 'Bob', 'Charlie'], True) == 'Congratulations, Alice, you won!'\", \"assert congratulate_winner(['Alice'], True) == 'Congratulations, Alice, you won!'\", \"assert congratulate_winner([], True) == ''\", \"assert congratulate_winne... | {
"split": "train",
"index": 61689,
"acecode_id": "oss_4763",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `invert_values(v_str: str, v_int: int, v_float: float) -> Tuple[str, int, float]` that accepts three parameters: a string, an integer, and a float. The function should return a tuple containing the inversely transformed values: the string reversed, the nega... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert invert_values('hello', 5, 0.5) == ('olleh', -5, 2.0)\", \"assert invert_values('test', -3, 2.0) == ('tset', 3, 0.5)\", \"assert invert_values('abc', 0, 1.0) == ('cba', 0, 1.0)\", \"assert invert_values('123', 10, 0.1) == ('321', -10, 10.0)\", \"assert invert... | {
"split": "train",
"index": 61690,
"acecode_id": "evol_12367",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of configuration strings, transform each configuration according to the following rules: If a configuration string starts with the '@' character, replace it with 'default_scope/' followed by the substring that comes after the '@' character. If it does not start wit... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_configs(['@config1', 'config2', '@config3']) == ['default_scope/config1', 'default_scope/config2', 'default_scope/config3']\", \"assert transform_configs(['@a', 'b', 'c']) == ['default_scope/a', 'default_scope/b', 'default_scope/c']\", \"assert tra... | {
"split": "train",
"index": 61691,
"acecode_id": "bigcode_python_fns_35",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that initializes a web application with specific configurations. The function should take a variable number of arguments and keyword arguments, but for the purposes of this task, we will ignore them. The function should return a dictionar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_app() is not None\", \"assert create_app()['name'] == 'MyApp'\", \"assert create_app()['auto_reload'] is True\", \"assert create_app()['secret_key'] == 'No_good_key'\", \"assert isinstance(create_app()['server'], Server)\", \"assert 'server' in create... | {
"split": "train",
"index": 61692,
"acecode_id": "bigcode_python_fns_47170",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to calculate the average score and percentage for a series of assessments. The function takes in a list of tuples, where each tuple contains the score and percentage for a single assessment. Your goal is to process this data and retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_scores([(80, 75), (90, 85), (70, 65)]) == (80.0, 75.0)\", \"assert calculate_average_scores([(100, 100), (90, 90)]) == (95.0, 95.0)\", \"assert calculate_average_scores([(50, 50), (50, 50), (50, 50)]) == (50.0, 50.0)\", \"assert calculate_a... | {
"split": "train",
"index": 61693,
"acecode_id": "oss_27190",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that calculates the average value of a specified numeric feature from a given list of patient records. Each record is represented as a dictionary containing information about diabetes patients, including a target group indicator an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_feature_value([{'age': 30, 'target': 1}, {'age': 40, 'target': 1}, {'age': 50, 'target': 0}], 'age', 1) == 35.0\", \"assert calculate_average_feature_value([{'age': 30, 'target': 0}, {'age': 25, 'target': 0}, {'age': 35, 'target': 0}], 'age... | {
"split": "train",
"index": 61694,
"acecode_id": "oss_22799",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of HTTP request parameters, write a function `remove_default_params(params: List[str], default_params: List[str]) -> List[str]` that removes all occurrences of default parameters from the list of request parameters. The function should return the modified list of p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_default_params(['Authorization', 'UserID', 'AccountID', 'LastTransactionID', 'Accept-Datetime-Format'], ['Authorization', 'LastTransactionID', 'Accept-Datetime-Format']) == ['UserID', 'AccountID']\", \"assert remove_default_params(['Param1', 'Param2',... | {
"split": "train",
"index": 61695,
"acecode_id": "bigcode_python_fns_47321",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a Python function that connects to a database and executes a SQL query to retrieve all records from the 'customers' table. The function should handle any exceptions that may occur during the connection or execution process and return an empty list in case of an error.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fetch_customers() == []\", \"assert fetch_customers() == []\", \"assert fetch_customers() == []\", \"assert fetch_customers() == []\", \"assert fetch_customers() == []\", \"assert fetch_customers() == []\", \"assert fetch_customers() == []\", \"assert fetch_... | {
"split": "train",
"index": 61696,
"acecode_id": "evol_25306",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `tic_tac_toe_game` that simulates a traditional two-player board game of Tic-Tac-Toe. The function should allow players 'X' and 'O' to take turns making moves on a 3x3 board. The function should take a sequence of moves as input and return the result of the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert tic_tac_toe_game([(1, 1), (1, 2), (2, 1), (2, 2), (3, 1)]) == 'X'\", \"assert tic_tac_toe_game([(1, 1), (2, 1), (1, 2), (2, 2), (1, 3)]) == 'X'\", \"assert tic_tac_toe_game([(1, 1), (1, 2), (1, 3), (1, 4)]) == 'Invalid'\", \"assert tic_tac_toe_game([(1, 1), ... | {
"split": "train",
"index": 61697,
"acecode_id": "evol_9205",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that toggles the availability state of a dropdown control based on its current status. The dropdown can have two states: available (True) or unavailable (False). Your goal is to create a function `toggle_status_state(current_state: bo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert toggle_status_state(True) == False\", \"assert toggle_status_state(False) == True\", \"assert toggle_status_state(True) == False\", \"assert toggle_status_state(False) == True\", \"assert toggle_status_state(True) == False\", \"assert toggle_status_state(Fal... | {
"split": "train",
"index": 61698,
"acecode_id": "oss_27238",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, implement a function that finds the most frequent odd number in the array. If there are no odd numbers, return 'No odd numbers in array'.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ``... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_most_frequent_odd([3, 7, 5, 3, 7, 3, 1, 9]) == 3\", \"assert find_most_frequent_odd([2, 4, 6, 8]) == 'No odd numbers in array'\", \"assert find_most_frequent_odd([1, 1, 1, 2, 2, 3]) == 1\", \"assert find_most_frequent_odd([5, 5, 2, 2, 5, 3]) == 5\", \"a... | {
"split": "train",
"index": 61699,
"acecode_id": "evol_30292",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.