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 generating unique abbreviations for a list of labels. Each abbreviation must be a substring of the corresponding label and must not exceed a specified maximum length. Additionally, no two abbreviations can be the same. The abbreviations should be generated i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_abbreviations(['apple', 'banana', 'cherry'], 3) == ['app', 'ban', 'che']\", \"assert generate_abbreviations(['dog', 'cat', 'fish'], 2) == ['do', 'ca', 'fi']\", \"assert generate_abbreviations(['hello', 'world'], 1) == ['h', 'w']\", \"assert generate... | {
"split": "train",
"index": 76000,
"acecode_id": "bigcode_python_fns_33121",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function `count_five_in_primes(n: int) -> int` that calculates and returns the number of times the digit '5' appears in all prime numbers less than `n`.\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 count_five_in_primes(10) == 1\", \"assert count_five_in_primes(5) == 0\", \"assert count_five_in_primes(15) == 1\", \"assert count_five_in_primes(1) == 0\", \"assert count_five_in_primes(2) == 0\", \"assert count_five_in_primes(11) == 1\", \"assert count_fiv... | {
"split": "train",
"index": 76001,
"acecode_id": "evol_15225",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates changing the cursor style based on mouse position within a drawing canvas. The function should take two parameters: a dictionary representing the mouse position with keys 'x' and 'y', and a list representing the coordin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert change_cursor_style({'x': 150, 'y': 150}, [100, 100, 300, 300]) == 'pencil'\", \"assert change_cursor_style({'x': 50, 'y': 50}, [100, 100, 300, 300]) == 'arrow'\", \"assert change_cursor_style({'x': 250, 'y': 250}, [100, 100, 300, 300]) == 'pencil'\", \"asse... | {
"split": "train",
"index": 76002,
"acecode_id": "oss_30062",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers `nums`, return a list of all elements that appear more than `⌊n / 3⌋` times in the array. You may assume that the input array will always contain at least one predominant element. The order of the output does not matter. Your solution should operate i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert majorityElement([3, 2, 3]) == [3]\", \"assert majorityElement([1, 1, 1, 3, 3, 2, 2, 2]) == [1, 2]\", \"assert majorityElement([1, 2, 3, 4, 5]) == []\", \"assert majorityElement([1, 1, 1, 1, 2, 3, 4]) == [1]\", \"assert majorityElement([10, 10, 10, 20, 20, 30... | {
"split": "train",
"index": 76003,
"acecode_id": "evol_9004",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Write a Python function `calculate_values(a, b)` that takes two integer parameters, `a` and `b`. Inside the function, calculate the following values: `b - a`, `m = (a + b) / 2`, `m² = m * m`, and `Test m² > a`, which should be `True` if `m²` is greater than `a`, and `False` oth... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_values(3, 7) == {'a': 3, 'b': 7, 'b-a': 4, 'm': 5.0, 'm\\u00b2': 25.0, 'Test m\\u00b2 > a': True}\", \"assert calculate_values(0, 10) == {'a': 0, 'b': 10, 'b-a': 10, 'm': 5.0, 'm\\u00b2': 25.0, 'Test m\\u00b2 > a': True}\", \"assert calculate_value... | {
"split": "train",
"index": 76004,
"acecode_id": "oss_10602",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a string that represents a chemical formula, which can contain elements denoted by their symbols and their respective quantities. Your task is to implement a function that calculates the total number of atoms in the chemical formula. The formula may include elemen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_atoms('H2O') == 3\", \"assert count_atoms('C6H12O6') == 24\", \"assert count_atoms('NaCl') == 2\", \"assert count_atoms('Fe2O3') == 5\", \"assert count_atoms('H2O2') == 4\", \"assert count_atoms('H2SO4') == 7\", \"assert count_atoms('C12H22O11') == 45\... | {
"split": "train",
"index": 76005,
"acecode_id": "bigcode_python_fns_48407",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Develop a Python function that generates and returns the first N Fibonacci numbers along with their positions in the sequence as a list of tuples. Each tuple should contain the position (starting from 0) and the corresponding Fibonacci number. The function should validate that ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_fibonacci(1) == [(0, 0)]\", \"assert generate_fibonacci(2) == [(0, 0), (1, 1)]\", \"assert generate_fibonacci(3) == [(0, 0), (1, 1), (2, 1)]\", \"assert generate_fibonacci(4) == [(0, 0), (1, 1), (2, 1), (3, 2)]\", \"assert generate_fibonacci(5) == [... | {
"split": "train",
"index": 76006,
"acecode_id": "evol_33128",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to validate the International Maritime Organization (IMO) number of a ship. The IMO number is a unique identifier for ships, consisting of 7 digits. The last digit is a check digit calculated using the Luhn algorithm. The function sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate('IMO 0000000') == '0000000'\", \"assert validate('IMO 1111111') == '1111111'\", \"assert validate('IMO 2222222') == '2222222'\", \"assert validate('IMO 3333333') == '3333333'\", \"assert validate('IMO 4444444') == '4444444'\"]}"
} | {
"split": "train",
"index": 76007,
"acecode_id": "oss_30037",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with merging multiple lists of strings into a single list. Each input list contains strings of equal length. Your goal is to create a new list where each element is a concatenation of the corresponding elements from all input lists. The function should take a lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_string_lists([['a', 'b'], ['c', 'd']]) == ['ac', 'bd']\", \"assert merge_string_lists([['hello', 'world'], [' ', '!']]) == ['hello ', 'world!']\", \"assert merge_string_lists([['apple', 'banana'], ['cherry', 'date'], ['fig', 'grape']]) == ['applecherry... | {
"split": "train",
"index": 76008,
"acecode_id": "bigcode_python_fns_49856",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating a URL for authorizing access to a service using OAuth2. Given a `client_id` and an optional `scope`, write a function `generate_permission_url(client_id: str, scope: str = 'https://mail.google.com/') -> str` that returns a URL formatted for author... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_permission_url('123456789', 'https://drive.google.com/') == 'https://accounts.google.com/o/oauth2/auth?client_id=123456789&redirect_uri=https://example.com/callback&scope=https://drive.google.com/&response_type=code'\", \"assert generate_permission_... | {
"split": "train",
"index": 76009,
"acecode_id": "bigcode_python_fns_25758",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function to compute the median of ten integers without using any sort, comparison, or conditional operators, and without using any library functions. The function should take ten integer parameters and return the median value.\nPlease reason step by step, then write a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_median(1, 3, 3, 6, 7, 8, 9, 10, 12, 15) == 7\", \"assert get_median(5, 1, 8, 3, 9, 6, 2, 4, 10, 7) == 5\", \"assert get_median(-5, -9, -1, -3, -7, -4, -6, -2, -8, -10) == -5\", \"assert get_median(1, 1, 1, 2, 2, 2, 3, 3, 3, 3) == 2\", \"assert get_median... | {
"split": "train",
"index": 76010,
"acecode_id": "evol_25399",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of application names. The function should iterate through the list of application names and return a list of strings. Each string should indicate whether the application was newly created or already existed. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_applications(['app1', 'app2', 'app3']) == ['app1: New Application', 'app2: New Application', 'app3: New Application']\", \"assert process_applications(['app1', 'app1', 'app2']) == ['app1: New Application', 'app1: Application Exists', 'app2: New Appli... | {
"split": "train",
"index": 76011,
"acecode_id": "oss_15046",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string s, write a function that replaces all newline characters (both '\\n' and '\\r') with a specified replacement string. Additionally, if there are consecutive newline characters, they should be replaced by a single newline before applying the replacement. The functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_newlines('Hello\\\\nWorld', ' / ') == 'Hello / World'\", \"assert replace_newlines('First line\\\\n\\\\nSecond line', ' / ') == 'First line / Second line'\", \"assert replace_newlines('No newlines here', ' / ') == 'No newlines here'\", \"assert repla... | {
"split": "train",
"index": 76012,
"acecode_id": "bigcode_python_fns_11208",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simplified web templating system. Your function should process a list of layout names and corresponding content, and return a list of rendered outputs, where each output is a string that combines the layout name with ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert render_layouts(['main', 'sidebar'], ['Welcome to the site!', 'This is the sidebar.']) == ['main: Welcome to the site!', 'sidebar: This is the sidebar.']\", \"assert render_layouts(['header', 'footer'], ['Header content goes here.', 'Footer content here.']) =... | {
"split": "train",
"index": 76013,
"acecode_id": "oss_24158",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `line`, write a function `get_string_coords` that returns a list of tuples representing the start and end positions of all occurrences of a specific substring `target` within the string. The function should find all non-overlapping occurrences of `target` and ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_string_coords('hello world', 'o') == [(4, 5), (7, 8)]\", \"assert get_string_coords('hello world', 'l') == [(2, 3), (3, 4), (9, 10)]\", \"assert get_string_coords('hello world', 'hello') == [(0, 5)]\", \"assert get_string_coords('hello world', 'world') =... | {
"split": "train",
"index": 76014,
"acecode_id": "bigcode_python_fns_18882",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer n, calculate and return the number of structurally distinct Binary Search Trees (BSTs) that can be formed using exactly n nodes, where each node has a unique value ranging from 1 to n. The integer n will be in the range of 1 to 19 (inclusive).\nPlease reason st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert num_trees(1) == 1\", \"assert num_trees(2) == 2\", \"assert num_trees(3) == 5\", \"assert num_trees(4) == 14\", \"assert num_trees(5) == 42\", \"assert num_trees(6) == 132\", \"assert num_trees(7) == 429\", \"assert num_trees(8) == 1430\", \"assert num_trees... | {
"split": "train",
"index": 76015,
"acecode_id": "evol_21099",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes tournament data and generates a textual description and a link for the tournament. Your function should take a dictionary representing the tournament context as input and return a tuple containing the textual des... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert render_tournament({'teams': ['Team A', 'Team B', 'Team C'], 'tournament_id': '123'}) == ('Team A, Team B, Team C', 'http://example.com/tournament/123')\", \"assert render_tournament({'teams': ['Alpha', 'Beta'], 'tournament_id': '456'}) == ('Alpha, Beta', 'ht... | {
"split": "train",
"index": 76016,
"acecode_id": "oss_14087",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of tokens, `tokens_a` and `tokens_b`, and an integer `max_num_tokens`, implement a function that truncates the two lists such that the total number of tokens in both lists does not exceed `max_num_tokens`. If the total length exceeds `max_num_tokens`, truncate t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert truncate_seq_pair(['a', 'b', 'c'], ['d', 'e'], 5) == (['a', 'b', 'c'], ['d', 'e'])\", \"assert truncate_seq_pair(['a', 'b', 'c', 'd'], ['e', 'f'], 6) == (['a', 'b', 'c', 'd'], ['e', 'f'])\", \"assert truncate_seq_pair(['x', 'y'], ['z'], 3) == (['x', 'y'], ['... | {
"split": "train",
"index": 76017,
"acecode_id": "bigcode_python_fns_34835",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to parse a cookie string and return a dictionary of key-value pairs representing the cookie data. A cookie string is a semicolon-separated list of key-value pairs in the format 'key=value'. Your function should handle cases where the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_cookie('name=Dima;') == {'name': 'Dima'}\", \"assert parse_cookie('') == {}\", \"assert parse_cookie('name=Dima;age=28;') == {'name': 'Dima', 'age': '28'}\", \"assert parse_cookie('name=Dima=User;age=28;') == {'name': 'Dima=User', 'age': '28'}\", \"ass... | {
"split": "train",
"index": 76018,
"acecode_id": "oss_4378",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `is_prime(n: int) -> bool` that determines whether a given integer `n` is a prime number. A prime number is defined as a number greater than 1 that has no positive divisors other than 1 and itself. Consider edge cases such as negative numbers and numbers less t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_prime(1) == False\", \"assert is_prime(0) == False\", \"assert is_prime(-5) == False\", \"assert is_prime(2) == True\", \"assert is_prime(3) == True\", \"assert is_prime(4) == False\", \"assert is_prime(5) == True\", \"assert is_prime(6) == False\", \"ass... | {
"split": "train",
"index": 76019,
"acecode_id": "evol_1969",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of image filenames from a hypothetical image database. Your function should take a list of image filenames and return a filtered list containing only the unique filenames. Write a Python function `get_unique_filename... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_filenames(['image1.jpg', 'image2.png', 'image1.jpg', 'image3.jpeg']) == ['image1.jpg', 'image2.png', 'image3.jpeg']\", \"assert get_unique_filenames(['test.jpg', 'test.jpg', 'test.jpg']) == ['test.jpg']\", \"assert get_unique_filenames(['img1.png'... | {
"split": "train",
"index": 76020,
"acecode_id": "oss_6646",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of tags and a tag name as inputs and returns the string representation of the specified tag from the list. Each tag is represented by a dictionary with the following keys: 'name', 'children', and 'span'. The 'childre... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_tag_representation([{'name': 'tag1', 'children': [], 'span': None}], 'tag1') == 'None tag1 => '\", \"assert get_tag_representation([{'name': 'tag1', 'children': [{'name': 'tag2', 'children': [], 'span': None}], 'span': None}], 'tag1') == 'None tag1 => ta... | {
"split": "train",
"index": 76021,
"acecode_id": "oss_11635",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `age_calc` that takes a single parameter `age`. The function should check if the provided `age` is of type `int`. If it is not an integer, the function should raise a `TypeError` with the message 'The age should be an integer'. If it is an integer, the func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert age_calc(25) == 30\", \"assert age_calc(0) == 5\", \"assert age_calc(-5) == 0\", \"assert age_calc(100) == 105\", \"assert age_calc(10) == 15\", \"assert age_calc(50) == 55\", \"assert age_calc(1) == 6\", \"assert age_calc(99) == 104\", \"assert age_calc(7) ... | {
"split": "train",
"index": 76022,
"acecode_id": "evol_34498",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of URLs and a user authentication status (either authenticated or not). Write a function `check_report_links(urls: List[str], is_authenticated: bool) -> List[str]` that returns a list of URLs that an authenticated user can access to create reports. If the u... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_report_links(['http://example.com/create_report/1', 'http://example.com/view_report/1'], True) == ['http://example.com/create_report/1']\", \"assert check_report_links(['http://example.com/create_report/1', 'http://example.com/create_report/2'], False)... | {
"split": "train",
"index": 76023,
"acecode_id": "bigcode_python_fns_29652",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `input_string`, write a function `is_valid_json(input_string)` that checks whether the input string represents a valid JSON object. A valid JSON object must follow these rules: it should be enclosed in curly braces `{}`, it should consist of key-value pairs separ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_json('{\\\"name\\\": \\\"John\\\", \\\"age\\\": 30}') == True\", \"assert is_valid_json('{\\\"name\\\": \\\"John\\\", \\\"age\\\": 30, \\\"isEmployed\\\": true}') == True\", \"assert is_valid_json('{\\\"company\\\": \\\"OpenAI\\\", \\\"yearFounded\\... | {
"split": "train",
"index": 76024,
"acecode_id": "oss_11607",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are developing an interaction system for a game where players can engage in dialogues with non-player characters (NPCs). Given a list of dialogue IDs, you need to implement a function `trigger_dialogue(dialogue_id, player)` that takes a `dialogue_id` and a `player` object a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert trigger_dialogue(7500, player) == None\", \"assert trigger_dialogue(7502, player) == None\", \"assert trigger_dialogue(7504, player) == None\", \"assert trigger_dialogue(7506, player) == None\", \"assert trigger_dialogue(7508, player) == None\", \"assert tri... | {
"split": "train",
"index": 76025,
"acecode_id": "oss_10683",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dataset containing the financial details of several companies. Each row in the dataset represents a company and contains the following information: R&D spend, Administration spend, Marketing spend, and the company's location. The dataset is represented as a 2D a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert total_rd_spend([[165349.2, 136897.8, 471784.1, 'New York'], [162597.7, 151377.59, 443898.53, 'California']], 'New York') == 165349.2\", \"assert total_rd_spend([[165349.2, 136897.8, 471784.1, 'New York'], [162597.7, 151377.59, 443898.53, 'California']], 'Cal... | {
"split": "train",
"index": 76026,
"acecode_id": "oss_15007",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function `is_isomorphic(s: str, t: str) -> bool` to determine if two strings are isomorphic. The mapping for the isomorphism must be bijective, meaning that a character in the first string should not map to more than one character in the second string and vice ve... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_isomorphic('paper', 'title') == True\", \"assert is_isomorphic('foo', 'bar') == False\", \"assert is_isomorphic('egg', 'add') == True\", \"assert is_isomorphic('ab', 'aa') == False\", \"assert is_isomorphic('abcd', 'efgh') == True\", \"assert is_isomorphi... | {
"split": "train",
"index": 76027,
"acecode_id": "evol_3924",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of buildings in a city. Your task is to write a function that calculates the number of buildings that can see the sunset. A building can see the sunset if it is taller than all the buildings to its right. The function sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_sunset_buildings([4, 2, 3, 1]) == 3\", \"assert count_sunset_buildings([1, 3, 2, 5, 4]) == 2\", \"assert count_sunset_buildings([1]) == 1\", \"assert count_sunset_buildings([]) == 0\", \"assert count_sunset_buildings([1, 2, 3, 2, 1]) == 3\", \"assert c... | {
"split": "train",
"index": 76028,
"acecode_id": "bigcode_python_fns_15922",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a scroll down action on a web page represented as a list of strings, where each string represents a line of content on the page. Your function should take the current view of the page and scroll down to display the next set of lines. Given a list ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert scroll_down_page(['Line 1', 'Line 2', 'Line 3', 'Line 4', 'Line 5'], 2) == ['Line 3', 'Line 4', 'Line 5']\", \"assert scroll_down_page(['Line 1', 'Line 2', 'Line 3'], 1) == ['Line 2', 'Line 3']\", \"assert scroll_down_page(['Line 1', 'Line 2'], 2) == []\", \... | {
"split": "train",
"index": 76029,
"acecode_id": "bigcode_python_fns_38168",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string input representing a simple mathematical expression containing integers and the operators '+', '-', '*', and '/', write a function that evaluates the expression and returns the result. The input will be a valid expression without any parentheses. The expression w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate_expression('3+5*2-1') == 12\", \"assert evaluate_expression('4/2+1') == 3\", \"assert evaluate_expression('1+1+1+1+1') == 5\", \"assert evaluate_expression('2*3*4') == 24\", \"assert evaluate_expression('8/4*2') == 4\", \"assert evaluate_expression(... | {
"split": "train",
"index": 76030,
"acecode_id": "bigcode_python_fns_39300",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Design an algorithm in Python to find the number of occurrences of a given substring within a larger string. Implement a function that takes two parameters, the larger string (haystack) and the substring (needle), and returns the count of how many times the needle appears in th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_substring_occurances('Hello World', 'l') == 3\", \"assert count_substring_occurances('Hello World', 'o') == 2\", \"assert count_substring_occurances('abcabcabc', 'abc') == 3\", \"assert count_substring_occurances('mississippi', 'iss') == 2\", \"assert ... | {
"split": "train",
"index": 76031,
"acecode_id": "evol_16550",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `parse_command(command: str) -> str` that interprets a text command in a terminal-run mystery game. The function should recognize two commands: 'look' and 'use'. When the command is 'look', it should return a string indicating what the player sees based on ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_command('look lamp') == 'The lamp is currently off.'\", \"assert parse_command('look room') == 'You are in a dark room.'\", \"assert parse_command('use lamp') == 'The lamp is now on.'\", \"assert parse_command('use lamp') == 'The lamp is now on.'\", \"... | {
"split": "train",
"index": 76032,
"acecode_id": "evol_16366",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that finds and returns all unique pairs of numbers that add up to a specified target sum. The input list may contain duplicate numbers, but the pairs returned should be unique. The function should not use any additional data structures... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_pairs([1, 2, 3, 4, 5, 6], 7) == [(1, 6), (2, 5), (3, 4)]\", \"assert find_pairs([1, 1, 2, 2, 3, 3], 4) == [(1, 3), (2, 2)]\", \"assert find_pairs([], 5) == []\", \"assert find_pairs([1, 2, 3], 6) == []\", \"assert find_pairs([5, 5, 5, 5], 10) == [(5, 5)... | {
"split": "train",
"index": 76033,
"acecode_id": "evol_7135",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two vectors represented as lists of integers, return the cosine of the angle between them. The cosine is calculated using the formula: cos(theta) = (u . v) / (||u|| * ||v||), where '.' denotes the dot product and '||u||' denotes the magnitude of vector u. If either vector... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert abs(cosine_angle([1, 0], [0, 1]) - 0.0) < 1e-9\", \"assert abs(cosine_angle([1, 1], [1, 1]) - 1.0) < 1e-9\", \"assert abs(cosine_angle([1, 2], [2, 1]) - 0.8) < 1e-9\", \"assert abs(cosine_angle([-1, 0], [1, 0]) - -1.0) < 1e-9\", \"assert abs(cosine_angle([1,... | {
"split": "train",
"index": 76034,
"acecode_id": "bigcode_python_fns_11451",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that rearranges a given string into a specific pattern. Your function should group every three characters together and separate the groups with commas. If the length of the input string is not a multiple of three, the last group shoul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rearrange_string('abcdefghi') == 'abc,def,ghi'\", \"assert rearrange_string('abcdef') == 'abc,def'\", \"assert rearrange_string('a') == 'a'\", \"assert rearrange_string('abc') == 'abc'\", \"assert rearrange_string('abcd') == 'abc,d'\", \"assert rearrange_str... | {
"split": "train",
"index": 76035,
"acecode_id": "oss_21937",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two strings `s` and `t`, return `true` if `t` is an anagram of any permutation of the string `s`. Additionally, provide the frequency count of each character in the anagram as a dictionary. If `t` is not an anagram of `s`, return an empty dictionary. The frequency count s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isAnagram('anagram', 'nagaram') == (True, {'a': 3, 'n': 1, 'g': 1, 'r': 1, 'm': 1})\", \"assert isAnagram('rat', 'car') == (False, {})\", \"assert isAnagram('listen', 'silent') == (True, {'l': 1, 'i': 1, 's': 1, 't': 1, 'e': 1, 'n': 1})\", \"assert isAnagram... | {
"split": "train",
"index": 76036,
"acecode_id": "evol_32232",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `contains_float(numbers)` that takes a list of elements and returns `True` if there is at least one floating-point number in the list, and `False` otherwise. The list can contain elements of different types including integers, strings, and other data types.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert contains_float([1, 2, 3, 4]) == False\", \"assert contains_float([1.0, 2, 3, 4]) == True\", \"assert contains_float(['a', 'b', 'c']) == False\", \"assert contains_float([1, 2.5, 3]) == True\", \"assert contains_float([None, 5, 'text', 6.0]) == True\", \"asse... | {
"split": "train",
"index": 76037,
"acecode_id": "evol_19084",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with representing a scientific data record in Python. Create a function named `create_data_record` that takes the following parameters: `experiment_id` (string, maximum length 50), `sample_name_abbreviation` (string, maximum length 100), `time_point` (string, max... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_data_record('exp001', 'sample_A', 'T1', 'group_1', 'component_X', 3, 0.5, 0.1) == {'experiment_id': 'exp001', 'sample_name_abbreviation': 'sample_A', 'time_point': 'T1', 'component_group_name': 'group_1', 'component_name': 'component_X', 'n_replicates... | {
"split": "train",
"index": 76038,
"acecode_id": "oss_18855",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `process_tasks` that takes three parameters: `r_name` (a string representing the name of the resource), `r_count` (an integer representing the number of tasks to process), and `r_queue` (a list containing the tasks to be processed). T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_tasks('Resource1', 3, ['task1', 'task2', 'task3', 'task4']) == ['task1', 'task2', 'task3']\", \"assert process_tasks('Resource2', 5, ['taskA', 'taskB']) == ['taskA', 'taskB']\", \"assert process_tasks('Resource3', 0, ['taskX', 'taskY']) == []\", \"as... | {
"split": "train",
"index": 76039,
"acecode_id": "oss_20309",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that generates a configuration dictionary for a web application based on the given parameters. The function should take in the application name, version, environment, debug status, and allowed hosts, and return a dictionary represe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_app_config('MyApp', '1.0.0', 'production', False, ['example.com', 'localhost']) == { 'APP_NAME': 'MyApp', 'VERSION': '1.0.0', 'ENVIRONMENT': 'production', 'DEBUG': False, 'ALLOWED_HOSTS': ['example.com', 'localhost'] }\", \"assert generate_app_confi... | {
"split": "train",
"index": 76040,
"acecode_id": "oss_36154",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of instances and categorizes them as either running or terminated based on their uptime and end status. Write a function `process_instances` that takes in a list of instances, where each instance is represented as a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_instances({'instances': [{'uptime': 3600, 'ended_at': False}, {'uptime': 7200, 'ended_at': True}]}) == {'running_instances': [{'uptime': 3600, 'ended_at': False}], 'terminated_instances': [{'uptime': 7200, 'ended_at': True}]}\", \"assert process_inst... | {
"split": "train",
"index": 76041,
"acecode_id": "oss_13236",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of menu keys representing various sections of an application, generate a corresponding list of tuples where each tuple contains a character (representing the index of the key) and a string (the formatted name of the key). The menu keys are as follows: ['MAIN_MENU',... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_menu_elements() == [(0, 'MainMenu'), (1, 'Profile'), (2, 'CleanTime'), (3, 'Readings'), (4, 'Prayers'), (5, 'DailyReflection'), (6, 'JustForToday'), (7, 'LordsPrayer'), (8, 'SerenityPrayer'), (9, 'StJosephsPrayer'), (10, 'TenderAndCompassionateGod'), ... | {
"split": "train",
"index": 76042,
"acecode_id": "bigcode_python_fns_10407",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `array_absolute_difference(array1, array2)` that takes two arrays of integers or real numbers as input and returns an array containing the absolute differences of corresponding pairs (first value of the first array minus the corresponding value of the secon... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert array_absolute_difference([1, 2, 3], [4, 5, 6]) == [3, 3, 3]\", \"assert array_absolute_difference([10.5, 20.5], [10, 20]) == [0.5, 0.5]\", \"assert array_absolute_difference([1, 2, 3], [1, 2, 3]) == [0, 0, 0]\", \"assert array_absolute_difference([1, 2], [1... | {
"split": "train",
"index": 76043,
"acecode_id": "evol_35425",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that extracts the version information from a given module and returns it in a specific format. The module contains a version string and version-related information. Your task is to implement the function `extract_version_info` that... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_version_info(type('Module1', (), {'__version__': '1.0.0', '__version_info__': (1, 0, 0)})) == '1.0.0'\", \"assert extract_version_info(type('Module2', (), {'__version__': '2.1.5', '__version_info__': (2, 1, 5)})) == '2.1.5'\", \"assert extract_versio... | {
"split": "train",
"index": 76044,
"acecode_id": "oss_13512",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `check_strictly_descending_order(lst)` that checks if a list of numerical values is in strictly descending order. The function should return True if the list is strictly descending (i.e., each element is greater than the one that follows), and False otherwi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_strictly_descending_order([5, 3, 1]) == True\", \"assert check_strictly_descending_order([10, 5, 0]) == True\", \"assert check_strictly_descending_order([7.5, 3.2, 1.0]) == True\", \"assert check_strictly_descending_order([-1, -2, -3]) == True\", \"ass... | {
"split": "train",
"index": 76045,
"acecode_id": "evol_25016",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a 2D list of integers, apply a lambda function that adds 1 to each element in the list and return the transformed list. Your function should handle any size of the 2D list, including an empty list. Write a function `transform_matrix(matrix: List[List[int]]) -> List[List[i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_matrix([[1, 2], [3, 4]]) == [[2, 3], [4, 5]]\", \"assert transform_matrix([[0]]) == [[1]]\", \"assert transform_matrix([[5, 6, 7], [8, 9, 10]]) == [[6, 7, 8], [9, 10, 11]]\", \"assert transform_matrix([]) == []\", \"assert transform_matrix([[1, -1]... | {
"split": "train",
"index": 76046,
"acecode_id": "bigcode_python_fns_24717",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates a Discord webhook URL. The function should take a string as input and return True if the URL is valid and False otherwise. A valid Discord webhook URL must follow the format: 'https://discordapp.com/api/webhooks/{server_id}... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_webhook_url('https://discordapp.com/api/webhooks/abc/some-key') == False\", \"assert is_valid_webhook_url('https://discordapp.com/api/webhooks/1234/') == False\", \"assert is_valid_webhook_url('https://discordapp.com/api/webhooks/1234/some-key/extra... | {
"split": "train",
"index": 76047,
"acecode_id": "bigcode_python_fns_45295",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes genetic variation data represented as a list of strings, where each string represents a line from a VCF (Variant Call Format) file. Your function should extract specific information from these lines. Each line can contain v... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_vcf_lines(['##fileformat=VCFv4.2', '##INFO=<ID=DP,Number=1,Type=Integer,Description=\\\"Depth\\\">', '#CHROM\\tPOS\\tID\\tREF\\tALT\\tQUAL\\tFILTER\\tINFO', 'chr1\\t100\\t.\\tA\\tG\\t.\\t.\\tDP=10']) == [('chr1', 100)]\", \"assert process_vcf_lines([... | {
"split": "train",
"index": 76048,
"acecode_id": "oss_4742",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_minimum(values)` that takes a list of numbers (both integers and floating point numbers) which may include negative values. The function should return the minimum value from the list. If the list is empty, it should return `None`.\nPlease reason step ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_minimum([3, 1, 4, 1.5, 2.2]) == 1\", \"assert find_minimum([-1, -2, -3, -4]) == -4\", \"assert find_minimum([0, 0.1, 0.2, 0.3]) == 0\", \"assert find_minimum([-1.5, 0, 1.5]) == -1.5\", \"assert find_minimum([5, 5.5, 5.1, 5.2]) == 5\", \"assert find_mini... | {
"split": "train",
"index": 76049,
"acecode_id": "evol_6643",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a boolean value `alive` that represents whether a bot is currently running. Implement a function `amireallyalive(alive: bool) -> str` that returns a message based on the bot's status. If the bot is alive (i.e., `alive` is True), return the message 'Bot is running ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert amireallyalive(True) == 'Bot is running \\ud83e\\udd16'\", \"assert amireallyalive(False) == 'Bot is not running \\u274c'\", \"assert amireallyalive(True) == 'Bot is running \\ud83e\\udd16'\", \"assert amireallyalive(False) == 'Bot is not running \\u274c'\",... | {
"split": "train",
"index": 76050,
"acecode_id": "bigcode_python_fns_39403",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of audio files represented as paths (strings) and a model path. Your task is to generate a list of corresponding feature file paths based on a specific naming convention. Each audio file path has the following format: 'folder/filename.wav'. The feature file... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_feature_paths(['audio1.wav', 'audio2.wav'], 'Feats') == ['Feats/audio1.csv', 'Feats/audio2.csv']\", \"assert generate_feature_paths(['audio1.wav', 'audio2.wav', 'audio3.wav'], 'Feats') == ['Feats/audio1.csv', 'Feats/audio2.csv', 'Feats/audio3.csv']\... | {
"split": "train",
"index": 76051,
"acecode_id": "bigcode_python_fns_34515",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a nested list of integers, implement a function that computes the sum of all the integers contained within the nested structure, regardless of how deeply they are nested. For example, given the input [[5, 6, [7, 8]], 9, [10, 11]], the output should be 56. Write a function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert nested_list_sum([[1, 2], 3]) == 6\", \"assert nested_list_sum([[5, 6, [7, 8]], 9, [10, 11]]) == 56\", \"assert nested_list_sum([1, [2, [3, [4]]]]) == 10\", \"assert nested_list_sum([]) == 0\", \"assert nested_list_sum([[[]]]) == 0\", \"assert nested_list_sum... | {
"split": "train",
"index": 76052,
"acecode_id": "evol_13623",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a configuration for a data processing system in a particle physics experiment. Your job is to implement a function `generate_cms_config` that takes an input label as a string and returns a dictionary containing the names of the input source and proc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_cms_config('Jet') == {'input_source': 'goodJet', 'processing_module': 'goodJetPacked'}\", \"assert generate_cms_config('Muon') == {'input_source': 'goodMuon', 'processing_module': 'goodMuonPacked'}\", \"assert generate_cms_config('Electron') == {'in... | {
"split": "train",
"index": 76053,
"acecode_id": "oss_12090",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a two-dimensional array, implement a function that traverses this array in spiral order starting from the top left corner and moving clockwise. The function should return the element occupying the nth position in the spiral order. The array will not be empty, and n will a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert spiralOrder([[1]], 0) == 1\", \"assert spiralOrder([[1, 2], [3, 4]], 1) == 2\", \"assert spiralOrder([[1, 2, 3, 4], [5, 6, 7, 8]], 0) == 1\", \"assert spiralOrder([[5, 6, 7], [8, 9, 10]], 2) == 7\", \"assert spiralOrder([[1, 2, 3], [4, 5, 6]], 2) == 3\", \"a... | {
"split": "train",
"index": 76054,
"acecode_id": "evol_19700",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a class called 'MyDict' that inherits from Python's built-in 'dict' class. The 'MyDict' class should have a constructor that accepts any valid arguments that a standard dictionary can take, and it should initialize the dictionary using those arguments. Your implementa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert MyDict() == {}\", \"assert MyDict(a=1, b=2) == {'a': 1, 'b': 2}\", \"assert MyDict({'key': 'value'}) == {'key': 'value'}\", \"assert MyDict.fromkeys(['a', 'b', 'c'], 0) == {'a': 0, 'b': 0, 'c': 0}\", \"assert MyDict({'a': 1}).get('a') == 1\", \"assert MyDict... | {
"split": "train",
"index": 76055,
"acecode_id": "evol_28746",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes two integers, start and end, and returns a list of all prime numbers within the range (start, end), excluding both endpoints. The function should return an empty list if there are no prime numbers in the specified range.\nPlease reason step by step, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_primes(1, 10) == [2, 3, 5, 7]\", \"assert find_primes(10, 20) == [11, 13, 17, 19]\", \"assert find_primes(0, 5) == [2, 3]\", \"assert find_primes(5, 10) == [7]\", \"assert find_primes(20, 30) == [23, 29]\", \"assert find_primes(15, 15) == []\", \"assert... | {
"split": "train",
"index": 76056,
"acecode_id": "evol_5976",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_dict_empty(d)` that checks if a given dictionary is empty. If the input argument is not a dictionary, the function should raise a `TypeError` with the message 'Input argument is not a dictionary'. The function should return `True` if the dictionary is e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_dict_empty({}) == True\", \"assert is_dict_empty({'key': 'value'}) == False\", \"assert is_dict_empty({'a': 1, 'b': 2}) == False\", \"assert is_dict_empty({'name': 'John'}) == False\", \"assert is_dict_empty({'': ''}) == False\", \"assert is_dict_empty({'... | {
"split": "train",
"index": 76057,
"acecode_id": "evol_24296",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks if a given string is a palindrome. A palindrome is a string that reads the same forwards and backwards, ignoring non-alphanumeric characters and case sensitivity. For example, 'A man, a plan, a canal: Panama' is considered... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_palindrome('madam') == True\", \"assert is_palindrome('racecar') == True\", \"assert is_palindrome('A man, a plan, a canal: Panama') == True\", \"assert is_palindrome('No lemon, no melon') == True\", \"assert is_palindrome('Was it a car or a cat I saw?') ... | {
"split": "train",
"index": 76058,
"acecode_id": "evol_27597",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that performs a depth-first search on a balanced ternary tree to find a specific node with a given value. The function should return the path to the node if it exists; otherwise, it should return None. The tree consists of nodes that can have duplicate valu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert depth_first_search(root, 5) == [1, 2, 5]\", \"assert depth_first_search(root, 10) == [1, 3, 10]\", \"assert depth_first_search(root, 7) == [1, 2, 7]\", \"assert depth_first_search(root, 3) == [1, 3]\", \"assert depth_first_search(root, 1) == [1]\", \"assert ... | {
"split": "train",
"index": 76059,
"acecode_id": "evol_2830",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a starting integer and a difference, implement a function that generates a sequence of numbers following the rule 'Add the difference' starting from the given integer. The function should return a list containing the first `n` elements of the sequence. The sequence is def... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_sequence(10, 11, 5) == [10, 21, 32, 43, 54]\", \"assert generate_sequence(0, 1, 10) == [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\", \"assert generate_sequence(5, 5, 4) == [5, 10, 15, 20]\", \"assert generate_sequence(-5, 3, 6) == [-5, -2, 1, 4, 7, 10]\", \"ass... | {
"split": "train",
"index": 76060,
"acecode_id": "evol_2722",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function to format a given phone number from various input formats and output a string with the canonical format of '+11234567890'. The function should be able to handle formats such as '(123) 456-7890', '123-456-7890', '123.456.7890', '1234567890', and '+1 (123) 456-7... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_phone_number('+1 (123) 456-7890') == '+11234567890'\", \"assert format_phone_number('12345678901') == 'Invalid phone number'\", \"assert format_phone_number('123-45-6789') == 'Invalid phone number'\", \"assert format_phone_number('987654321') == 'Inva... | {
"split": "train",
"index": 76061,
"acecode_id": "evol_6385",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Tic-Tac-Toe game logic. Your goal is to create a function that takes a 2D list representing the Tic-Tac-Toe board and returns the winner of the game or indicates the game state. The board is represented as a list of lists, where each element i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_tic_tac_toe_winner([['X', 'X', 'X'], ['O', 'O', None], [None, None, None]]) == 'X'\", \"assert check_tic_tac_toe_winner([['O', 'O', 'O'], ['X', None, None], [None, None, None]]) == 'O'\", \"assert check_tic_tac_toe_winner([['X', 'O', 'X'], ['O', 'X', '... | {
"split": "train",
"index": 76062,
"acecode_id": "oss_6642",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a private key represented as a string. Your task is to generate a public key string in the format '<key_name> <key_base64> autogenerated by my_program'. The private key string is structured such that it contains two components separated by a space: the key name an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_public_key('RSA ABC123') == 'RSA ABC123 autogenerated by my_program'\", \"assert generate_public_key('DSA DEF456') == 'DSA DEF456 autogenerated by my_program'\", \"assert generate_public_key('ECDSA GHI789') == 'ECDSA GHI789 autogenerated by my_progr... | {
"split": "train",
"index": 76063,
"acecode_id": "bigcode_python_fns_36702",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D binary image represented by an `n x m` integer array `image`, where `image[i][j]` is `0` if the pixel at position `(i, j)` is white, and `1` if it is black. Write a function `is_black_border_pixel` that takes in the image array and a pixel position `(x, y)` a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_black_border_pixel([[1, 1, 1], [0, 1, 0], [1, 1, 1]], 0, 1) == True\", \"assert is_black_border_pixel([[1, 1, 1], [0, 1, 0], [1, 1, 1]], 1, 0) == False\", \"assert is_black_border_pixel([[1, 1, 1], [0, 1, 0], [1, 1, 1]], 1, 1) == False\", \"assert is_blac... | {
"split": "train",
"index": 76064,
"acecode_id": "oss_11737",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a special effect for LED art installations. The function `create_special_effect(led_art: str, name: str) -> dict` takes two parameters: `led_art` (a string representing the LED art installation) and `name` (a string represe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_special_effect('Starry Night', 'Twinkling Stars') == {'led_art': 'Starry Night', 'name': 'Twinkling Stars'}\", \"assert create_special_effect('Ocean Waves', 'Ripple Effect') == {'led_art': 'Ocean Waves', 'name': 'Ripple Effect'}\", \"assert create_spe... | {
"split": "train",
"index": 76065,
"acecode_id": "oss_19309",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes user registration for a chat bot. The function should take in a user's ID, username, first name, last name, and access hash as input parameters. It should store the user's information in a database if the user does not alre... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert register_user(1, 'john_doe', 'John', 'Doe', 'hash123') == 'User already registered.'\", \"assert register_user(2, 'jane_doe', 'Jane', 'Doe', 'hash456') == 'User already registered.'\", \"assert register_user(5, 'carol_white', 'Carol', 'White', 'hash111') == ... | {
"split": "train",
"index": 76066,
"acecode_id": "bigcode_python_fns_32895",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Write a function `generate_welcome_message(name: str) -> str` that takes a user's name as input and returns a customized welcome greeting. If the name is an empty string, return the greeting 'Welcome to our website!'. Otherwise, return 'Welcome, {name}, to our website!'.\nPleas... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_welcome_message('Alice') == 'Welcome, Alice, to our website!'\", \"assert generate_welcome_message('Bob') == 'Welcome, Bob, to our website!'\", \"assert generate_welcome_message('') == 'Welcome to our website!'\", \"assert generate_welcome_message('... | {
"split": "train",
"index": 76067,
"acecode_id": "evol_16920",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of numbers that may contain None values, implement a function `drop_none_values(lst: List[Optional[float]]) -> List[float]` that returns a new list with all None values removed. The input list may contain integers, floats, and None. The output list should maintain ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert drop_none_values([1.0, 2.5, None, 3.0]) == [1.0, 2.5, 3.0]\", \"assert drop_none_values([None, None, None]) == []\", \"assert drop_none_values([1, 2, 3]) == [1, 2, 3]\", \"assert drop_none_values([None, 1, 2, None, 3]) == [1, 2, 3]\", \"assert drop_none_valu... | {
"split": "train",
"index": 76068,
"acecode_id": "bigcode_python_fns_47227",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a given list of strings contains any duplicates. Your function should take a list of strings as input and return a boolean value: True if there are any duplicates in the list, and False otherwise. For example, given the inp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert contains_duplicates(['apple', 'banana', 'orange', 'apple']) == True\", \"assert contains_duplicates(['cat', 'dog', 'fish']) == False\", \"assert contains_duplicates(['a', 'b', 'c', 'd', 'a']) == True\", \"assert contains_duplicates(['1', '2', '3', '4', '5'])... | {
"split": "train",
"index": 76069,
"acecode_id": "bigcode_python_fns_46004",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple online shopping system simulation. Implement a function `get_all_orders()` that retrieves all orders placed by a client. The function will take a list of strings representing orders as input and return the list. The input list may be empty ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_all_orders(['Order1', 'Order2', 'Order3']) == ['Order1', 'Order2', 'Order3']\", \"assert get_all_orders(['OrderA']) == ['OrderA']\", \"assert get_all_orders([]) == []\", \"assert get_all_orders(['OrderX', 'OrderY']) == ['OrderX', 'OrderY']\", \"assert ge... | {
"split": "train",
"index": 76070,
"acecode_id": "oss_1722",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that extracts license information from a given string containing the license text. The license information is embedded within a multi-line comment (''' or \"\"\") and contains the following key elements:\n1. The licensing entity (e.g., Ap... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_license_info(\\\"\\\"\\\"\\nLicensed to the Apache Software Foundation (ASF) under one\\nor more contributor license agreements. See the NOTICE file\\ndistributed with this work for additional information\\nregarding copyright ownership. The ASF lice... | {
"split": "train",
"index": 76071,
"acecode_id": "oss_9190",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given two strings s1 and s2, write a function to find the minimum number of edits (insertions, deletions, and substitutions) required to convert string s1 to string s2.\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 minEdits('abc', 'bad') == 3\", \"assert minEdits('kitten', 'sitting') == 3\", \"assert minEdits('flaw', 'lawn') == 2\", \"assert minEdits('intention', 'execution') == 5\", \"assert minEdits('horse', 'ros') == 3\", \"assert minEdits('abcdef', 'azced') == 3\",... | {
"split": "train",
"index": 76072,
"acecode_id": "evol_23882",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an `m x n` `board` of characters and a list of strings `words`, return all words on the board along with the path of the cells used to form each word. Each word must be constructed from letters of sequentially adjacent cells, where adjacent cells are horizontally or verti... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert findWords([['a','b'],['c','d']], ['abcb']) == []\", \"assert findWords([['a','b','c'],['d','e','f'],['g','h','i']], []) == []\", \"assert findWords([['a','b','c'],['d','e','f'],['g','h','i']], ['abcd']) == []\", \"assert findWords([['a','b','c'],['d','e','f'... | {
"split": "train",
"index": 76073,
"acecode_id": "evol_19103",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that parses a given string and extracts specific key-value pairs from it. The key-value pairs are formatted as `key='value'` and are separated by commas. The function should return a dictionary containing these key-value pairs. The... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_key_value_pairs(\\\"version='2.0.0', description='gui and cli for control nauta connection and accounts',\\\") == {'version': '2.0.0', 'description': 'gui and cli for control nauta connection and accounts'}\", \"assert parse_key_value_pairs(\\\"key1='v... | {
"split": "train",
"index": 76074,
"acecode_id": "oss_36348",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that generates an engine string based on certain parameters. The function should take in two arguments: `style` and `aspiration`. The `style` argument is a dictionary containing style names as keys and a list of possible cylinder c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_engine_string({'sedan': [4, 6, 8], 'hatchback': [3, 4]}, 'turbo') == 'turbo sedan4'\", \"assert generate_engine_string({'suv': [6, 8], 'convertible': [4]}, 'supercharged') == 'supercharged suv6'\", \"assert generate_engine_string({'coupe': [4, 8], '... | {
"split": "train",
"index": 76075,
"acecode_id": "oss_25509",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary that represents a JSON object, where each key is a string and each value can be either a string or another dictionary. Write a function `convert_json_to_csv(json_obj)` that takes in this dictionary and converts it into a CSV format string. The CSV sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_json_to_csv({'field1': 'value', 'field2': {'key': 'val'}}) == 'field1,value\\\\nfield2.key,val'\", \"assert convert_json_to_csv({'name': 'Alice', 'age': 30}) == 'name,Alice\\\\nage,30'\", \"assert convert_json_to_csv({'a': {'b': {'c': 'd'}}, 'e': 'f'... | {
"split": "train",
"index": 76076,
"acecode_id": "bigcode_python_fns_694",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of real numbers, write a function that returns a list of three integers where the first integer is the count of numbers greater than zero, the second integer is the count of numbers less than zero, and the third integer is the count of zeros in the input list. For ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert relacao([1, -1, 0, 2, -3]) == [2, 2, 1]\", \"assert relacao([0, 0, 0]) == [0, 0, 3]\", \"assert relacao([-1, -2, -3]) == [0, 3, 0]\", \"assert relacao([1, 2, 3]) == [3, 0, 0]\", \"assert relacao([-1, 0, 1]) == [1, 1, 1]\", \"assert relacao([]) == [0, 0, 0]\"... | {
"split": "train",
"index": 76077,
"acecode_id": "bigcode_python_fns_8077",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a 2D list of integers 'data' representing samples and a list of integers 'labels' representing clustering assignments, implement a function 'get_cluster_members(data: List[List[int]], labels: List[int], cluster: int) -> List[List[int]]' that returns a list of samples belo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_cluster_members([[1, 2], [3, 4], [5, 6]], [0, 1, 0], 0) == [[1, 2], [5, 6]]\", \"assert get_cluster_members([[1, 2], [3, 4], [5, 6]], [0, 1, 0], 1) == [[3, 4]]\", \"assert get_cluster_members([[1, 2], [3, 4], [5, 6]], [0, 1, 0], 2) == []\", \"assert get_... | {
"split": "train",
"index": 76078,
"acecode_id": "bigcode_python_fns_18276",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple task queue system that supports adding tasks with arguments and executing them in a first-in-first-out (FIFO) manner. Your task is to implement a function called `execute_task_queue` that takes a list of tasks, where each task is repres... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert execute_task_queue([(lambda x: x + 1, 1), (lambda x: x * 2, 2)]) == [2, 4]\", \"assert execute_task_queue([(lambda x: x + 1, 1), (lambda x: x / 0, 2)]) == [2, 'Error']\", \"assert execute_task_queue([(lambda: 'hello',), (lambda: 'world',)]) == ['hello', 'wor... | {
"split": "train",
"index": 76079,
"acecode_id": "oss_27627",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of astronomical measurements, where each measurement is a dictionary containing the following keys: 'id', 'ximage', 'yimage', '3.5p', '3.5err', '5.0p', '5.0err', '7.0p', '7.0err', '9.0p', '9.0err', '1.0fh', '1.0err', '1.5fh', '1.5err', '2.0fh', '2.0err'. Yo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert apply_zeropoint([{'id': 1, 'ximage': 100, 'yimage': 200, '3.5p': 15.0, '3.5err': 0.1, '5.0p': 20.0, '5.0err': 0.2, '7.0p': 25.0, '7.0err': 0.3, '9.0p': 30.0, '9.0err': 0.4, '1.0fh': 5.0, '1.0err': 0.01, '1.5fh': 10.0, '1.5err': 0.02, '2.0fh': 15.0, '2.0err':... | {
"split": "train",
"index": 76080,
"acecode_id": "bigcode_python_fns_26841",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a name of a BASC dataset. The possible values for this dataset name are: 'scale007', 'scale012', 'scale036', 'scale064', 'scale122', 'scale197', 'scale325', 'scale444'. Write a function that takes this dataset name as input and returns a bool... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_basc_dataset_name('scale007') == True\", \"assert is_valid_basc_dataset_name('scale012') == True\", \"assert is_valid_basc_dataset_name('scale036') == True\", \"assert is_valid_basc_dataset_name('scale064') == True\", \"assert is_valid_basc_dataset_... | {
"split": "train",
"index": 76081,
"acecode_id": "bigcode_python_fns_219",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that simulates the progress of an operation that processes a list of numbers. The function should display the progress in a user-friendly manner using the `tqdm` library, which provides a customizable progress bar. The function should take... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_with_progress([1, 2, 3], lambda x: x * 2) == [2, 4, 6]\", \"assert process_with_progress([10, 20, 30], lambda x: x + 5) == [15, 25, 35]\", \"assert process_with_progress([0, 0, 0], lambda x: x) == [0, 0, 0]\", \"assert process_with_progress([-1, -2, ... | {
"split": "train",
"index": 76082,
"acecode_id": "oss_36903",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to determine if a player can navigate from a starting position to a goal position on a grid while avoiding obstacles. You will receive a grid represented by a 2D list, a starting position, and a goal position. The grid cell values are... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_reach_goal([['O', 'O', 'O'], ['O', 'X', 'O'], ['O', 'O', 'O']], [0, 0], [2, 2]) == True\", \"assert can_reach_goal([['O', 'X', 'O'], ['O', 'X', 'O'], ['O', 'O', 'O']], [0, 0], [2, 2]) == True\", \"assert can_reach_goal([['O', 'O'], ['X', 'O'], ['O', 'O']... | {
"split": "train",
"index": 76083,
"acecode_id": "oss_3943",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given an integer 'initial' and a variable number of additional integers. Your task is to implement a function that returns the sum of 'initial' and all additional integers provided. The additional integers can be passed as positional arguments or keyword arguments. The ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_numbers(5) == 5\", \"assert sum_numbers(3, 2, 4) == 9\", \"assert sum_numbers(0, 0, 0) == 0\", \"assert sum_numbers(10, a=5, b=10) == 25\", \"assert sum_numbers(2, 3, 4, x=1) == 10\", \"assert sum_numbers(7, y=3, z=2) == 12\", \"assert sum_numbers(1, 2, ... | {
"split": "train",
"index": 76084,
"acecode_id": "bigcode_python_fns_21861",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a 2D list of integers, implement a function that takes this list and returns a new 2D list where each element is the result of raising the mathematical constant e (approximately 2.71828) to the power of the original element. The function should handle empty lists and retu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert exp([[0]]) == [[1.0]]\", \"assert exp([[-1, -2]]) == [[0.36787944117144233, 0.1353352832366127]]\", \"assert exp([[3]]) == [[20.085536923187668]]\", \"assert exp([]) == []\", \"assert exp([[4, 0], [-3, 5]]) == [[54.598150033144236, 1.0], [0.04978706836786394... | {
"split": "train",
"index": 76085,
"acecode_id": "bigcode_python_fns_47860",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a command that includes a filename to be deleted. Your task is to determine if the command prompts for confirmation and return the appropriate response based on the filename provided. If the filename ends with '.txt', the command should promp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_command_prompt('del bootflash:/text.txt') == 'yes'\", \"assert check_command_prompt('del bootflash:/image.png') == 'no'\", \"assert check_command_prompt('del bootflash:/document.docx') == 'no'\", \"assert check_command_prompt('del bootflash:/script.sh'... | {
"split": "train",
"index": 76086,
"acecode_id": "bigcode_python_fns_4910",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function `binary_search(array, target)` that takes a list of integers and a target integer as input. The function should sort the list, perform a binary search on the sorted list to find the index of the target integer, and return the index if found. If the target i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binary_search([3, 1, 2, 5], 2) == 1\", \"assert binary_search([3, 1, 2, 5], 5) == 3\", \"assert binary_search([3, 1, 2, 5], 1) == 0\", \"assert binary_search([3, 1, 2, 5], 0) == -1\", \"assert binary_search([], 1) == -1\", \"assert binary_search([1, 2, 3, 4,... | {
"split": "train",
"index": 76087,
"acecode_id": "evol_8260",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes a string as input and returns a new string where the first character of each word is capitalized. Words are defined as sequences of characters separated by spaces. For example, given the input 'hello world', the output should be 'Hello World'.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert capitalize_words('hello world') == 'Hello World'\", \"assert capitalize_words('python programming') == 'Python Programming'\", \"assert capitalize_words('capitalize each word') == 'Capitalize Each Word'\", \"assert capitalize_words('a b c') == 'A B C'\", \"a... | {
"split": "train",
"index": 76088,
"acecode_id": "evol_21043",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Peter is part of a group composed of 'n' individuals who all embark on a fishing trip. Each boat can accommodate exactly 'k' individuals. Write a function `total_boats(n: int, k: int) -> int` that determines the total number of boats utilized by the group. The function should r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert total_boats(25, 5) == 5\", \"assert total_boats(24, 5) == 5\", \"assert total_boats(1, 1) == 1\", \"assert total_boats(5, 5) == 1\", \"assert total_boats(6, 5) == 2\", \"assert total_boats(10, 3) == 4\", \"assert total_boats(7, 4) == 2\", \"assert total_boat... | {
"split": "train",
"index": 76089,
"acecode_id": "evol_8978",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that checks if a configuration for a hypothetical component is valid. The configuration is represented as a dictionary. Your function should return `False` if the configuration is empty (i.e., an empty dictionary) and `True` if the configu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_config({}) == False\", \"assert is_valid_config({'key1': 'value1'}) == True\", \"assert is_valid_config({'key1': 'value1', 'key2': 'value2'}) == True\", \"assert is_valid_config({'setting1': True}) == True\", \"assert is_valid_config({'setting2': 12... | {
"split": "train",
"index": 76090,
"acecode_id": "bigcode_python_fns_26859",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that converts a positive integer between 1 and 5000 into its lowercase Roman numeral representation. The function should ensure the correct formation of Roman numeral patterns according to standard conventions. The function signature is: `def int_to_mini_ro... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert int_to_mini_roman(1) == 'i'\", \"assert int_to_mini_roman(2) == 'ii'\", \"assert int_to_mini_roman(3) == 'iii'\", \"assert int_to_mini_roman(4) == 'iv'\", \"assert int_to_mini_roman(5) == 'v'\", \"assert int_to_mini_roman(6) == 'vi'\", \"assert int_to_mini_r... | {
"split": "train",
"index": 76091,
"acecode_id": "evol_3660",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function to count the occurrences of each character in a given string. The function should take a single string as input and return a dictionary where the keys are the characters and the values are the counts of those characters in the stri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_characters('Hello World!') == {'h': 1, 'e': 1, 'l': 3, 'o': 2, 'w': 1, 'r': 1, 'd': 1}\", \"assert count_characters('Python 3.8') == {'p': 1, 'y': 1, 't': 1, 'h': 1, 'o': 1, 'n': 1}\", \"assert count_characters('') == {}\", \"assert count_characters('a... | {
"split": "train",
"index": 76092,
"acecode_id": "oss_32621",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes two lists of integers and returns a list of integers that are present in both lists (i.e., the intersection of the two lists). The order of the integers in the output list should match the order of their first appearance in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert intersection([1, 2, 3], [2, 3, 4]) == [2, 3]\", \"assert intersection([1, 2, 3], [4, 5, 6]) == []\", \"assert intersection([1, 2, 3, 2], [2, 2, 3]) == [2, 3]\", \"assert intersection([1, 2, 2, 3], [2]) == [2]\", \"assert intersection([5, 6, 7], [6, 7, 8, 9])... | {
"split": "train",
"index": 76093,
"acecode_id": "oss_32081",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program to manage scheduled tasks for a home automation system. You need to implement a function `schedule_quiet_times` that takes a list of `quiet_times` as input. Each `quiet_time` is represented as a tuple of two `datetime` objects: the start t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert schedule_quiet_times([(datetime(2023, 10, 10, 22, 0, 0), datetime(2023, 10, 10, 23, 0, 0))]) == ['mute at 22:00:00 on 2023-10-10', 'unmute at 23:00:00 on 2023-10-10']\", \"assert schedule_quiet_times([(datetime(2023, 10, 11, 8, 0, 0), datetime(2023, 10, 11, ... | {
"split": "train",
"index": 76094,
"acecode_id": "oss_22612",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates basic banking operations for a single bank account. The function should accept a list of operations, each represented as a tuple. The first element of the tuple is a string that specifies the operation ('deposit', 'withdraw... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bank_account_operations([('deposit', 100), ('get_balance', None)]) == [100]\", \"assert bank_account_operations([('withdraw', 50), ('get_balance', None)]) == [0]\", \"assert bank_account_operations([('deposit', 200), ('withdraw', 100), ('get_balance', None)]... | {
"split": "train",
"index": 76095,
"acecode_id": "oss_1459",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of error objects, each represented as a dictionary with details about the error. Write a function `enrich_errors(errors: List[Dict[str, Any]], tag: str, loc: Optional[Any] = None) -> List[Dict[str, Any]]` that enriches each error in the list by adding a 'ta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert enrich_errors([{'code': 404, 'message': 'Not Found'}], 'API_CALL') == [{'code': 404, 'message': 'Not Found', 'tag': 'API_CALL', 'location': 'NO_ERROR_PATH'}]\", \"assert enrich_errors([{'code': 500, 'message': 'Server Error'}, {'code': 400, 'message': 'Bad R... | {
"split": "train",
"index": 76096,
"acecode_id": "bigcode_python_fns_19680",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that calculates and returns the product of all the elements in the list. The list may contain both positive and negative integers, and the function should handle an empty list by returning 1.\nPlease reason step by step, then write a s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert product_of_array([1, 2, 3, 4]) == 24\", \"assert product_of_array([0, 1, 2, 3]) == 0\", \"assert product_of_array([-1, -2, -3]) == -6\", \"assert product_of_array([5]) == 5\", \"assert product_of_array([]) == 1\", \"assert product_of_array([2, 2, 2]) == 8\",... | {
"split": "train",
"index": 76097,
"acecode_id": "evol_35474",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of strings representing lines from a properties/ini file and parses it into a dictionary of key-value pairs. Each line in the list can either be a comment (starting with a '#'), a blank line, or a key-value pair in the f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_properties(['# Comment line', 'key1=value1', 'key2=value2', '']) == {'key1': 'value1', 'key2': 'value2'}\", \"assert parse_properties(['key1=value1', '# Comment', 'key2=value2']) == {'key1': 'value1', 'key2': 'value2'}\", \"assert parse_properties(['ke... | {
"split": "train",
"index": 76098,
"acecode_id": "oss_6875",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `sum_primes_in_range(start: int, end: int) -> int` that takes two integers, `start` and `end`, as parameters and returns the sum of all the prime numbers in the inclusive range from `start` to `end`. If there are no prime numbers in the range, the function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_primes_in_range(10, 20) == 60\", \"assert sum_primes_in_range(1, 10) == 17\", \"assert sum_primes_in_range(2, 2) == 2\", \"assert sum_primes_in_range(3, 5) == 8\", \"assert sum_primes_in_range(1, 1) == 0\", \"assert sum_primes_in_range(11, 13) == 24\", \... | {
"split": "train",
"index": 76099,
"acecode_id": "evol_15702",
"num_tests": 12
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.