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": "Given an array of non-zero integers, implement a function that computes the product of the signs of the unique integers and multiplies it by the sum of the absolute values of these unique integers. If the input array is empty or contains only zeros, the function should return N... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert prod_signs([]) == None\", \"assert prod_signs([-1, -2, -3]) == -6\", \"assert prod_signs([1, 3, 5]) == 9\", \"assert prod_signs([0, 0, 0]) == None\", \"assert prod_signs([10, -10, 10]) == -20\", \"assert prod_signs([-7, -7, -7]) == -7\", \"assert prod_signs(... | {
"split": "train",
"index": 79500,
"acecode_id": "evol_27990",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple JSON-like structure. The function should accept a list of operations to be performed on the structure. The operations will be in the form of strings that specify an action and its parameters. The supported oper... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert json_operations(['add color blue', 'add size large', 'delete size', 'get color']) == '{\\\"color\\\": \\\"blue\\\"}'\", \"assert json_operations(['add fruit apple', 'update fruit orange', 'get fruit']) == '{\\\"fruit\\\": \\\"orange\\\"}'\", \"assert json_op... | {
"split": "train",
"index": 79501,
"acecode_id": "oss_4139",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with developing a function that checks if a specified file exists at a given path. Implement the function `check_file_exists(file_path: str) -> bool` which takes a string `file_path` as input and returns `True` if the file exists at that path, and `False` otherwi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_file_exists('/path/to/existing/file.txt') == True\", \"assert check_file_exists('/path/to/nonexistent/file.txt') == False\", \"assert check_file_exists('/yet/another/path/to/file.docx') == False\", \"assert check_file_exists('/random/directory/random_f... | {
"split": "train",
"index": 79502,
"acecode_id": "bigcode_python_fns_14117",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a string 'label', implement a function `remove_stopwords(label: str) -> str` that removes leading stopwords from the string. A stopword is defined as any word in the predefined list of STOPWORDS. The function should return the modified string without any leading stopwords... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_stopwords('the cat on the mat') == 'cat on the mat'\", \"assert remove_stopwords('a quick brown fox') == 'quick brown fox'\", \"assert remove_stopwords('the quick brown fox jumps over the lazy dog') == 'quick brown fox jumps over the lazy dog'\", \"as... | {
"split": "train",
"index": 79503,
"acecode_id": "bigcode_python_fns_42702",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of trees in a line. Your task is to determine the number of times a tree can be considered 'chopped' based on the following criteria: a tree is 'chopped' if its height is greater than the heights of both its immediate ne... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_chopped_trees([3, 3, 3]) == 0\", \"assert count_chopped_trees([1, 2, 3, 4, 5]) == 0\", \"assert count_chopped_trees([5, 4, 3, 2, 1]) == 0\", \"assert count_chopped_trees([2, 1, 3, 1, 2]) == 1\", \"assert count_chopped_trees([1, 3, 1, 3, 1]) == 2\", \"a... | {
"split": "train",
"index": 79504,
"acecode_id": "oss_9780",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that returns a dictionary containing information about a software library. The function should return the following information: the name of the library as 'pyasdf', the version as a string '1.0.0', the homepage as 'http://github.com/spac... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_software_info() == {'name': 'pyasdf', 'version': '1.0.0', 'homepage': 'http://github.com/spacetelescope/pyasdf', 'author': 'Space Telescope Science Institute'}\", \"assert get_software_info()['name'] == 'pyasdf'\", \"assert get_software_info()['version']... | {
"split": "train",
"index": 79505,
"acecode_id": "bigcode_python_fns_33342",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a plagiarism detection algorithm using the Longest Common Subsequence (LCS) approach. Your goal is to compare two lists of sentence tokens and determine if the similarity between the two lists exceeds a given plagiarism threshold. Implement the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_lcs_length_optimized(['this', 'is', 'a', 'test'], ['this', 'is', 'another', 'test'], 0.5) == True\", \"assert find_lcs_length_optimized(['apple', 'banana', 'cherry'], ['banana', 'kiwi'], 0.3) == True\", \"assert find_lcs_length_optimized(['one', 'two', ... | {
"split": "train",
"index": 79506,
"acecode_id": "oss_6477",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that can validate a given string based on a set of rules. The function should return True if the string meets all the specified criteria, and False otherwise. The rules for validating the string are as follows: 1. The string must c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_string('Abcdefg1') == True\", \"assert validate_string('12345678') == False\", \"assert validate_string('AbCdEfG1') == True\", \"assert validate_string('abc123') == False\", \"assert validate_string('A1b2c3d4') == True\", \"assert validate_string('a... | {
"split": "train",
"index": 79507,
"acecode_id": "oss_22300",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing documents and a query string. Your task is to implement a function that returns a list of indexes of the documents that match the query based on a specified boolean operator. The matching criteria are as follows: if the boolean opera... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert search_documents(['apple pie', 'apple tart', 'cherry pie'], 'apple', 'OR') == [0, 1]\", \"assert search_documents(['the quick brown fox', 'jumps over', 'the lazy dog'], 'quick fox', 'AND') == [0]\", \"assert search_documents(['dog cat', 'dog', 'cat', 'bird']... | {
"split": "train",
"index": 79508,
"acecode_id": "bigcode_python_fns_21047",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a string as input and returns a new string that is the reverse of the input string. You must not use any built-in methods or functions for reversing the string, nor any looping constructs. The function should handle empty strings as well.\nPlease... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_string('Hello World') == 'dlroW olleH'\", \"assert reverse_string('Python') == 'nohtyP'\", \"assert reverse_string('OpenAI') == 'IAnepO'\", \"assert reverse_string('12345') == '54321'\", \"assert reverse_string('') == ''\", \"assert reverse_string('A... | {
"split": "train",
"index": 79509,
"acecode_id": "evol_25275",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with improving a food delivery service's recommendation system. Given two lists, `historical_orders` and `new_orders`, your goal is to create a function that predicts food preferences based on historical customer orders. Each order is represented as a dictionary ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert predict_food_preferences([{'customer_id': 1, 'order_id': 101, 'food': 'Pizza'}, {'customer_id': 1, 'order_id': 102, 'food': 'Burger'}, {'customer_id': 2, 'order_id': 201, 'food': 'Sushi'}, {'customer_id': 2, 'order_id': 202, 'food': 'Sushi'}, {'customer_id':... | {
"split": "train",
"index": 79510,
"acecode_id": "oss_32941",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function `greet_user(name: str, date: str) -> str` that takes a user's name and the current date as input in the format 'MM/DD/YYYY'. The function should return a personalized greeting in the format 'Hello, 'name'! Today is 'date'. If the name contains any non-alpha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert greet_user('Alice', '11/15/2023') == 'Hello, Alice! Today is 11/15/2023.'\", \"assert greet_user('Bob', '01/01/2022') == 'Hello, Bob! Today is 01/01/2022.'\", \"assert greet_user('Charlie', '02/29/2020') == 'Hello, Charlie! Today is 02/29/2020.'\", \"assert ... | {
"split": "train",
"index": 79511,
"acecode_id": "evol_24337",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of incident field values where each field is represented as a dictionary with a 'name' and a 'value', create a function that parses this list and returns a dictionary. The keys of the dictionary should be the field names with spaces replaced by underscores, and the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_incident_field_context([{ 'name': 'Field One', 'value': 'Value 1' }, { 'name': 'Field Two', 'value': 'Value 2' }]) == {'Field_One': 'Value 1', 'Field_Two': 'Value 2'}\", \"assert create_incident_field_context([{ 'name': 'First Field', 'value': 'First ... | {
"split": "train",
"index": 79512,
"acecode_id": "bigcode_python_fns_32597",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with validating data types in a given list of data type names. Implement a function `validate_data_types(data_types: List[str]) -> List[bool]` that receives a list of strings representing data type names and returns a list of boolean values indicating whether eac... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_data_types(['int', 'float', 'str', 'bool', 'list', 'dict', '']) == [True, True, True, True, True, True, False]\", \"assert validate_data_types(['', 'complex', 'float', '']) == [False, True, True, False]\", \"assert validate_data_types(['int', 'foo',... | {
"split": "train",
"index": 79513,
"acecode_id": "bigcode_python_fns_32526",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of strings as input and returns a single string, where each element of the list is separated by a comma followed by a space. The function should handle cases where the input is not a list or contains non-string elements by returning an app... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_string(['Hello', 'world']) == 'Hello, world'\", \"assert generate_string(['Python', 'is', 'fun']) == 'Python, is, fun'\", \"assert generate_string(['This', 'is', 'a', 'test']) == 'This, is, a, test'\", \"assert generate_string([]) == ''\", \"assert ... | {
"split": "train",
"index": 79514,
"acecode_id": "evol_32765",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of boundary conditions each represented as a dictionary containing parameters for zone usage, lighting, room climate, internal gains, and air handling unit (AHU) properties. Your task is to create a function that takes a zone usage code and a list of bounda... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert load_boundary_conditions('office', [{'usage': 'office', 'typical_length': 10, 'typical_width': 5, 'usage_time': 8, 'daily_usage_hours': 10, 'yearly_usage_days': 250, 'maintained_illuminance': 300, 'set_temp_heat': 22, 'set_temp_cool': 24, 'persons': 5, 'ligh... | {
"split": "train",
"index": 79515,
"acecode_id": "bigcode_python_fns_3189",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that manages the state and commands of a simple device. The device has a default state, which is initially set to `False`. You need to implement a function `device_info(author: str, commands: List[str]) -> Tuple[str, List[str]]` that ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert device_info('Alice', ['start', 'stop', 'reset']) == ('Alice', ['start', 'stop', 'reset'])\", \"assert device_info('Bob', ['turn on', 'turn off']) == ('Bob', ['turn on', 'turn off'])\", \"assert device_info('Charlie', []) == ('Charlie', [])\", \"assert device... | {
"split": "train",
"index": 79516,
"acecode_id": "oss_37242",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that takes in a string parameter `url` which specifies the type of reward to retrieve. The `url` parameter can take one of the following values: 'prize', 'points', 'knowledge', or 'all'. Your function should return a dictionary con... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert retrieve_challenge_rewards('prize') == {'prize': 'Gold Trophy'}\", \"assert retrieve_challenge_rewards('points') == {'points': '1000'}\", \"assert retrieve_challenge_rewards('prize') == {'prize': 'Gold Trophy'}\", \"assert retrieve_challenge_rewards('points'... | {
"split": "train",
"index": 79517,
"acecode_id": "oss_14843",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a given string is a valid number. A valid number can be an integer or a floating-point number. The following conditions must be met for a number to be considered valid: It may have a '+' or '-' sign in front of it, it may c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_number('123') == True\", \"assert is_valid_number('-123') == True\", \"assert is_valid_number('+123.45') == True\", \"assert is_valid_number('0.001') == True\", \"assert is_valid_number('-0.001') == True\", \"assert is_valid_number('1.0') == True\",... | {
"split": "train",
"index": 79518,
"acecode_id": "bigcode_python_fns_44226",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a directory path. Your task is to implement a function that ensures the directory path ends with a slash ('/'). If the path already ends with a slash, you should return it as is. If it does not, you should append a slash at the end of the pat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_ending_slash('./data') == './data/'\", \"assert add_ending_slash('./folder/') == './folder/'\", \"assert add_ending_slash('/home/user') == '/home/user/'\", \"assert add_ending_slash('/usr/bin/') == '/usr/bin/'\", \"assert add_ending_slash('C:\\\\Program ... | {
"split": "train",
"index": 79519,
"acecode_id": "bigcode_python_fns_19124",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D list called `fractal_portrait` representing a grid of dimensions `width x height`, where each element can either be an integer representing a fractal type or a special placeholder `0` indicating an empty place. Your task is to implement a function `get_fracta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_fractal_patterns([[0, 0], [0, 0], [0, 0]], 2, 3) == []\", \"assert get_fractal_patterns([[1, 2], [1, 2], [1, 3]], 2, 3) == [{1: 3}, {2: 2, 3: 1}]\", \"assert get_fractal_patterns([[0, 1], [0, 1], [0, 1]], 2, 3) == [{1: 3}]\", \"assert get_fractal_pattern... | {
"split": "train",
"index": 79520,
"acecode_id": "bigcode_python_fns_20904",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of subnets represented as strings and returns a summary of the subnets. The function should return a dictionary containing the following keys: 'total_subnets' which represents the number of subnets, and 'subnets' which i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert summarize_subnets(['192.168.1.0/24']) == {'total_subnets': 1, 'subnets': ['192.168.1.0/24']}\", \"assert summarize_subnets(['10.0.0.0/8', '172.16.0.0/12']) == {'total_subnets': 2, 'subnets': ['10.0.0.0/8', '172.16.0.0/12']}\", \"assert summarize_subnets(['19... | {
"split": "train",
"index": 79521,
"acecode_id": "bigcode_python_fns_32417",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a new migration script for a database whenever a change is made to the database schema. The function should take in two parameters: the current application context and the database instance. Your goal is to simulate the gen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_migration_script('app_context', 'db') == 'Version: 001\\\\nDescription: Initial migration'\", \"assert generate_migration_script('app_context_1', 'db_instance_1') == 'Version: 001\\\\nDescription: Initial migration'\", \"assert generate_migration_sc... | {
"split": "train",
"index": 79522,
"acecode_id": "oss_13606",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a binary string of length 32 representing an unsigned integer and returns a list containing the number of '1' bits (also known as the Hamming weight) and the number of '0' bits in the binary string.\nPlease reason step by step, then write a self-cont... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hammingWeight('00000000000000000000000000001011') == [3, 29]\", \"assert hammingWeight('00000000000000000000000010000000') == [1, 31]\", \"assert hammingWeight('11111111111111111111111111111101') == [31, 1]\", \"assert hammingWeight('000000000000000000000000... | {
"split": "train",
"index": 79523,
"acecode_id": "evol_30853",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a bijective function f(x) such that f(2) = 4 and its inverse f^{-1}(x) exists, implement a function that evaluates the expression f(f^{-1}(f(2))). The function should be defined as f(x) = 2 * x and its inverse f^{-1}(x) = x / 2. Return the result of the expression.\nPleas... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert f(2) == 4\", \"assert f(4) == 8\", \"assert f(0) == 0\", \"assert f(-1) == -2\", \"assert f(1) == 2\", \"assert f(3) == 6\", \"assert f(5) == 10\", \"assert f(10) == 20\", \"assert f(8) == 16\", \"assert f(-2) == -4\", \"assert f(6) == 12\", \"assert f(12) =... | {
"split": "train",
"index": 79524,
"acecode_id": "evol_10887",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a date in the format 'YYYY-MM-DD', write a function `str_to_date(date: str) -> str` that converts this date string into a more human-readable format 'Month Day, Year'. For example, '2023-10-05' should be converted to 'October 5, 2023'. You may assume... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert str_to_date('2022-02-14') == 'February 14, 2022'\", \"assert str_to_date('2021-03-28') == 'March 28, 2021'\", \"assert str_to_date('2020-04-15') == 'April 15, 2020'\", \"assert str_to_date('2019-05-30') == 'May 30, 2019'\", \"assert str_to_date('2018-06-19')... | {
"split": "train",
"index": 79525,
"acecode_id": "bigcode_python_fns_43691",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `get_singleton_instance()` that returns a singleton instance of a class. The class should be created using a metaclass that ensures that only one instance of the class can be created. The function should return the same instance every time it is called.\nPl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_singleton_instance() is get_singleton_instance()\", \"assert get_singleton_instance() is not None\", \"assert isinstance(get_singleton_instance(), Singleton)\", \"assert isinstance(get_singleton_instance(), Singleton)\", \"assert get_singleton_instance()... | {
"split": "train",
"index": 79526,
"acecode_id": "evol_4535",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that converts a list of floating-point numbers representing temperature readings into a specific data format. The function should take in a list of floating-point numbers and return a new list where each number is converted to an inte... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_temperature_readings([1.5, 2.7, 3.8]) == [2, 3, 4]\", \"assert convert_temperature_readings([0.1, 0.6, 0.9]) == [0, 1, 1]\", \"assert convert_temperature_readings([-1.5, -2.7, -3.3]) == [-2, -3, -3]\", \"assert convert_temperature_readings([2.2, 3.3,... | {
"split": "train",
"index": 79527,
"acecode_id": "oss_12128",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function `shell_sort` that takes an unsorted list of integers as input and returns the list sorted in ascending order using the shell sort algorithm. Shell sort is a highly efficient sorting algorithm that is a variation of insertion sort. The algorithm starts by so... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shell_sort([3, 2, 1, 0, 7, 11, 56, 23]) == [0, 1, 2, 3, 7, 11, 23, 56]\", \"assert shell_sort([8, 4, 1, 8, 4, 9, 3, 2]) == [1, 2, 3, 4, 4, 8, 8, 9]\", \"assert shell_sort([5, 4, 3, 2, 1]) == [1, 2, 3, 4, 5]\", \"assert shell_sort([1, 2, 3, 4, 5]) == [1, 2, 3... | {
"split": "train",
"index": 79528,
"acecode_id": "oss_37484",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a tree structure represented as a dictionary, where each key is a node ID and its value is another dictionary containing attributes of that node, including a 'font_size' key. Your task is to implement a function `update_font_size(tree, condition)` that updates the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_font_size({'1': {'font_size': 15}, '2': {'font_size': 10}}, lambda attrs: attrs['font_size'] < 15) == {'1': {'font_size': 15}, '2': {'font_size': 15}}\", \"assert update_font_size({'1': {'font_size': 10}, '2': {'font_size': 15}}, lambda attrs: attrs['... | {
"split": "train",
"index": 79529,
"acecode_id": "oss_26709",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes in two lists of integers and returns a new list containing the elements that are present in both lists. The resulting list should not contain any duplicates and should be sorted in ascending order. Your function should have the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert intersection([1, 2, 3], [2, 3, 4]) == [2, 3]\", \"assert intersection([1, 1, 2], [2, 2, 3]) == [2]\", \"assert intersection([], [1, 2, 3]) == []\", \"assert intersection([1, 2, 3], []) == []\", \"assert intersection([5, 6, 7], [7, 8, 9]) == [7]\", \"assert i... | {
"split": "train",
"index": 79530,
"acecode_id": "bigcode_python_fns_13927",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of records where each record is represented as a dictionary containing the following keys: 'point_date' (a string representing the date), 'geom' (a string representing some geometric data), and 'hash' (a unique identifier string). Your task is to implement ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_records([]) == (None, 'Bounding Box', {})\", \"assert process_records([{'point_date': '2022-01-01', 'geom': 'point1', 'hash': 'abc123'}, {'point_date': '2022-01-05', 'geom': 'point2', 'hash': 'abc124'}]) == (('2022-01-01', '2022-01-05'), 'Bounding Bo... | {
"split": "train",
"index": 79531,
"acecode_id": "bigcode_python_fns_33429",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing 'eps' and a list of integers representing 'minPts', implement a function that pairs each value in 'eps' with a corresponding value in 'minPts'. If the lengths of the two lists are unequal, the function should return an error message indicat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pair_eps_minPts([2000, 5000], [5, 10]) == [(2000, 5), (5000, 10)]\", \"assert pair_eps_minPts([1000], [3]) == [(1000, 3)]\", \"assert pair_eps_minPts([], []) == []\", \"assert pair_eps_minPts([10, 20, 30], [15, 25, 35]) == [(10, 15), (20, 25), (30, 35)]\", \... | {
"split": "train",
"index": 79532,
"acecode_id": "bigcode_python_fns_1586",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that configures the date and time on a device using a specific format. The function should accept a string representing the date and return a confirmation message. The date is provided in the format 'YYYY-MM-DD HH:MM:SS'. Implement a func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert config_date('2023-10-05 14:30:00') == 'Date configured to: 2023-10-05 14:30:00'\", \"assert config_date('2023-01-01 00:00:00') == 'Date configured to: 2023-01-01 00:00:00'\", \"assert config_date('2022-12-31 23:59:59') == 'Date configured to: 2022-12-31 23:5... | {
"split": "train",
"index": 79533,
"acecode_id": "bigcode_python_fns_18609",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that accepts a 2D list representing a grayscale image and a threshold value. Your function should apply the threshold to the image, converting all pixel values above the threshold to 255 (representing white) and all pixel values below or ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert threshold_image([[0, 100, 200], [255, 50, 0]], 100) == [[0, 0, 255], [255, 0, 0]]\", \"assert threshold_image([[125, 130], [80, 90]], 100) == [[255, 255], [0, 0]]\", \"assert threshold_image([[255, 255], [255, 255]], 200) == [[255, 255], [255, 255]]\", \"ass... | {
"split": "train",
"index": 79534,
"acecode_id": "bigcode_python_fns_35955",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a positive floating-point number `n`, implement a function that calculates its square root using the Newton-Raphson method, starting from an initial guess `a`. The function should return the calculated square root with a precision of 5 decimal places. You may assume that ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert abs(newton_sqrt(4.0, 2.0) - 2.0) < 0.00001\", \"assert abs(newton_sqrt(9.0, 3.0) - 3.0) < 0.00001\", \"assert abs(newton_sqrt(16.0, 4.0) - 4.0) < 0.00001\", \"assert abs(newton_sqrt(25.0, 5.0) - 5.0) < 0.00001\", \"assert abs(newton_sqrt(0.25, 0.5) - 0.5) < ... | {
"split": "train",
"index": 79535,
"acecode_id": "bigcode_python_fns_18846",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string, implement a function `make_palindrome(string: str) -> str` that constructs the shortest palindrome which starts with the input string. The approach should be as follows: Find the longest palindromic suffix in the input string and attach the reverse of the non-pa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert make_palindrome('') == ''\", \"assert make_palindrome('a') == 'a'\", \"assert make_palindrome('ab') == 'aba'\", \"assert make_palindrome('race') == 'racecar'\", \"assert make_palindrome('madam') == 'madam'\", \"assert make_palindrome('hello') == 'hellolleh'\... | {
"split": "train",
"index": 79536,
"acecode_id": "evol_32451",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `max_tree_depth` that calculates the maximum depth of a binary tree represented by the list. Each element in the list represents a node in the tree, where the value `None` indicates the absence of a node. The tree is built such that fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_tree_depth([1, 2, 3, 4, 5]) == 3\", \"assert max_tree_depth([1, None, 3]) == 2\", \"assert max_tree_depth([1]) == 1\", \"assert max_tree_depth([]) == 0\", \"assert max_tree_depth([1, 2, 3, 4, None, None, 5]) == 3\", \"assert max_tree_depth([1, 2, None, 4... | {
"split": "train",
"index": 79537,
"acecode_id": "bigcode_python_fns_7107",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a directed acyclic graph (DAG) represented as a list of edges, where each edge is a tuple (u, v) indicating a directed edge from node u to node v. Your task is to find all the maximal strongly connected components in the DAG. A strongly connected component (SCC) i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert strongly_connected_components([(1, 2), (2, 3), (3, 4)]) == [[1], [2], [3], [4]]\", \"assert strongly_connected_components([(1, 2), (2, 3), (3, 4), (4, 5), (5, 1)]) == [[1, 2, 3, 4, 5]]\", \"assert strongly_connected_components([(1, 2), (1, 3), (2, 3), (3, 1)... | {
"split": "train",
"index": 79538,
"acecode_id": "bigcode_python_fns_862",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of integers, 'csv_actions' and 'file_actions'. Your task is to write a function that determines if the 'csv_actions' list has been updated more recently than the 'file_actions' list. You should assume that the 'csv_actions' list is considered more update... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert was_csv_updated([1, 2, 3], [4, 5]) == True\", \"assert was_csv_updated([1], [1, 2, 3]) == False\", \"assert was_csv_updated([], [1, 2, 3]) == False\", \"assert was_csv_updated([1, 2, 3, 4], [5, 6, 7]) == True\", \"assert was_csv_updated([1, 2], [1, 2]) == Tr... | {
"split": "train",
"index": 79539,
"acecode_id": "bigcode_python_fns_2666",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a single step of Conway's Game of Life, a classic cellular automaton. Your function should implement the rules for the evolution of the grid configuration. Write a function `next_generation(grid)` that takes a 2D list `grid` of 0s and 1s, where 0 ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert next_generation([[0, 0, 0], [0, 1, 0], [0, 0, 0]]) == [[0, 0, 0], [0, 0, 0], [0, 0, 0]]\", \"assert next_generation([[1, 1], [1, 0]]) == [[1, 1], [1, 1]]\", \"assert next_generation([[1, 0], [0, 1]]) == [[0, 0], [0, 0]]\", \"assert next_generation([[0, 0, 0]... | {
"split": "train",
"index": 79540,
"acecode_id": "oss_8342",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the deletion of a comment from an article in a web application. You are provided with an `article` object that contains a list of `comments`, each represented by a dictionary with `id` and `author`. Your function should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delete_comment({'comments': [{'id': 1, 'author': 'user1'}, {'id': 2, 'author': 'user2'}]}, 1, 'user1') == ('', 200)\", \"assert delete_comment({'comments': [{'id': 1, 'author': 'user1'}, {'id': 2, 'author': 'user2'}]}, 2, 'user2') == ('', 200)\", \"assert de... | {
"split": "train",
"index": 79541,
"acecode_id": "oss_29147",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a sequence of steps, your task is to parse the string and extract the first step into a list. A step is defined as a sentence that ends with a period ('.'). Implement a function `parse_steps(steps_string: str) -> List[str]` that takes the input strin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_steps('I HAVE TASTY BEVERAGES. This is a second step.') == ['I HAVE TASTY BEVERAGES']\", \"assert parse_steps('Step one is done. Step two is also done.') == ['Step one is done']\", \"assert parse_steps('First step. Second step. Third step.') == ['First... | {
"split": "train",
"index": 79542,
"acecode_id": "bigcode_python_fns_29708",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a nested list of integers `a`. Write a function `modify_list(a)` that modifies the list in place according to the following rules: for each element at position (i, j), if both i and j are greater than 0, replace the element with the value of the element at positio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert modify_list([[5]]) == [[5]]\", \"assert modify_list([[1, 2], [3, 4]]) == [[1, 2], [3, 1]]\", \"assert modify_list([[1, 2], [3, 4], [5, 6]]) == [[1, 2], [3, 1], [5, 3]]\", \"assert modify_list([[10, 20], [30, 40], [50, 60]]) == [[10, 20], [30, 10], [50, 30]]\... | {
"split": "train",
"index": 79543,
"acecode_id": "evol_32160",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a binary string, implement a function that concatenates the string to itself |n| times. If n is negative, the string should be reversed before concatenation. If n is zero, the function should return an empty string. Your function should handle positive, negative, and zero... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert concatenate_bitstring('1101', 3) == '110111011101'\", \"assert concatenate_bitstring('1101', 0) == ''\", \"assert concatenate_bitstring('101010', 2) == '101010101010'\", \"assert concatenate_bitstring('101010', -2) == '010101010101'\", \"assert concatenate_b... | {
"split": "train",
"index": 79544,
"acecode_id": "bigcode_python_fns_369",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are working on a project that involves designing a Vernier mask for a microfabrication process. The Vernier mask consists of a series of fingers on the top and bottom layers, and you need to calculate the total width of the mask based on the design parameters. You are given... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_mask_width(1, 10, 30) == 600\", \"assert calculate_mask_width(1, 0, 30) == 0\", \"assert calculate_mask_width(1, 1, 50) == 100\", \"assert calculate_mask_width(1, 20, 2) == 80\", \"assert calculate_mask_width(1, 12, 25) == 600\", \"assert calculate... | {
"split": "train",
"index": 79545,
"acecode_id": "oss_32716",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that validates the license number and regulation status of a healthcare facility. The function should take two parameters: a license number (string) and a regulation status (string). The license number must be a string with a maximum ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_facility_info(None, 'Compliant') == True\", \"assert validate_facility_info('', 'Compliant') == True\", \"assert validate_facility_info('ABC123', 'Compliant') == True\", \"assert validate_facility_info('ABCD1234EFGH5678IJ', 'Compliant') == True\", \... | {
"split": "train",
"index": 79546,
"acecode_id": "oss_23767",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string, return the character that appears most frequently. If there are multiple characters with the same highest frequency, return the one that appears first in the string. If the string is empty, return an empty string.\nPlease reason step by step, then write a self-c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert most_repeated_character('hello') == 'l'\", \"assert most_repeated_character('banana') == 'a'\", \"assert most_repeated_character('abcd') == 'a'\", \"assert most_repeated_character('aabbcc') == 'a'\", \"assert most_repeated_character('abccba') == 'a'\", \"ass... | {
"split": "train",
"index": 79547,
"acecode_id": "bigcode_python_fns_9188",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `delete_note` that simulates deleting a note by confirming the user's intention. The function takes two parameters: `note_name` (a string representing the name of the note) and `confirmation` (a string that can either be 'y' or 'n'). ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delete_note('MyNote.txt', 'y') == 'Note MyNote.txt has been deleted.'\", \"assert delete_note('MyNote.txt', 'Y') == 'Note MyNote.txt has been deleted.'\", \"assert delete_note('', 'y') == 'Note does not exist.'\", \"assert delete_note('', 'n') == 'Note does ... | {
"split": "train",
"index": 79548,
"acecode_id": "bigcode_python_fns_13731",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program that simulates a simple game of rock-paper-scissors. The game allows a user to input their choice (rock, paper, or scissors), and the program should randomly generate a choice for the computer. Your task is to write a Python function `rock... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rock_paper_scissors('rock') == 'Computer wins!'\", \"assert rock_paper_scissors('scissors') == 'You win!'\", \"assert rock_paper_scissors('scissors') == 'You win!'\", \"assert rock_paper_scissors('rock') == 'Computer wins!'\", \"assert rock_paper_scissors('r... | {
"split": "train",
"index": 79549,
"acecode_id": "oss_17341",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function to calculate the best-fit slope and intercept for a given set of x and y values. The best-fit slope and intercept are used in linear regression to find the line that best fits the given data points. Implement a function `best_f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert best_fit_slope_and_intercept([1, 2, 3, 4, 5], [5, 4, 3, 2, 1]) == (-1.0, 6.0)\", \"assert best_fit_slope_and_intercept([10, 20, 30], [10, 20, 30]) == (1.0, 0.0)\", \"assert best_fit_slope_and_intercept([10, 20, 30], [30, 20, 10]) == (-1.0, 40.0)\", \"assert ... | {
"split": "train",
"index": 79550,
"acecode_id": "oss_11688",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a list of tuples where each tuple contains two integers, write a function that calculates the sum of the products of the integers in each tuple. The function should take a single parameter, which is the list of tuples, and return the total sum of these products.\nPlease r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multiply_list([(0, 0), (0, 1), (1, 1)]) == 1\", \"assert multiply_list([(1, 1), (1, 1), (1, 1)]) == 3\", \"assert multiply_list([(2, 3), (4, 5)]) == 26\", \"assert multiply_list([(7, 3), (1, 5)]) == 26\", \"assert multiply_list([(5, 5), (5, 5), (5, 5)]) == 7... | {
"split": "train",
"index": 79551,
"acecode_id": "evol_1536",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of plans and a corresponding availability status for each plan. Your task is to determine which plans are currently available based on the provided availability data. Each plan can either be available (represented as `True`) or not available (represented as... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_plan_availability(['plan1', 'plan2', 'plan3'], {'plan1': True, 'plan2': False, 'plan3': True}) == ['plan1', 'plan3']\", \"assert check_plan_availability(['planA', 'planB', 'planC'], {'planA': False, 'planB': False, 'planC': False}) == []\", \"assert ch... | {
"split": "train",
"index": 79552,
"acecode_id": "bigcode_python_fns_11866",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_fruit_array()` that constructs and returns an array of five distinct fruits. Each fruit should be represented as a dictionary containing the keys: 'name', 'presentation', 'characteristics', and 'comparison'. Ensure that each fruit has unique values ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_fruit_array() == [{'name': 'Apple', 'presentation': 'Round and red', 'characteristics': 'Sweet and crunchy', 'comparison': 1}, {'name': 'Banana', 'presentation': 'Long and yellow', 'characteristics': 'Sweet and soft', 'comparison': 2}, {'name': 'Orang... | {
"split": "train",
"index": 79553,
"acecode_id": "evol_18042",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of buildings in a skyline. Your task is to determine the maximum height of the skyline after removing at most one building. The skyline height is defined as the maximum height among the remaining buildings. Write a funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_skyline_height([3, 1, 4, 1, 5, 9]) == 9\", \"assert max_skyline_height([1, 2, 3, 4, 5]) == 5\", \"assert max_skyline_height([7, 1, 3, 4, 1, 5]) == 7\", \"assert max_skyline_height([1, 2, 1, 2]) == 2\", \"assert max_skyline_height([]) == 0\", \"assert max... | {
"split": "train",
"index": 79554,
"acecode_id": "bigcode_python_fns_34035",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a queue of blocks represented as a deque. Each block is defined by three integers: t (type), y (y-coordinate), and x (x-coordinate). The type of block can be: 1 (single block), 2 (horizontal block), or 3 (vertical block). Implement a function that takes this queue... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert integrate(deque([(1, 0, 0)])) == [[0, 0]]\", \"assert integrate(deque([(2, 1, 1)])) == [[1, 1], [1, 2]]\", \"assert integrate(deque([(3, 2, 2)])) == [[2, 2], [3, 2]]\", \"assert integrate(deque([(1, 5, 5), (2, 5, 6)])) == [[5, 5]]\", \"assert integrate(deque... | {
"split": "train",
"index": 79555,
"acecode_id": "bigcode_python_fns_16579",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `is_sorted_and_unique(arr)` that checks if the list is sorted in strictly increasing order and contains no duplicates. The function should return `True` if the list meets both conditions and `False` otherwise. The input list, `arr`, ca... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_sorted_and_unique([]) == True\", \"assert is_sorted_and_unique([1]) == True\", \"assert is_sorted_and_unique([1, 2, 3]) == True\", \"assert is_sorted_and_unique([1, 2, 2]) == False\", \"assert is_sorted_and_unique([3, 2, 1]) == False\", \"assert is_sorted... | {
"split": "train",
"index": 79556,
"acecode_id": "bigcode_python_fns_18459",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a collection of temporary files in Python. Your goal is to implement a single function, `manage_temp_files`, that accepts a list of commands and returns the result of each command. Each command is represented as a tuple: ('add', content), ('remove',... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_temp_files([('add', 'Hello World')]) == ['temp_file_0']\", \"assert manage_temp_files([('add', 'Hello World'), ('add', 'Another file')]) == ['temp_file_0', 'temp_file_1']\", \"assert manage_temp_files([('add', 'Hello World'), ('get', 'temp_file_0')]) ... | {
"split": "train",
"index": 79557,
"acecode_id": "oss_13407",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a list of tuples representing genetic mutations. Each tuple contains a mutation type (a string that can be 'cpg', 'transition', or 'transversion') and a mutation rate (a float). Write a function `mutation_summary(mutations)` that takes this list of tuples as input... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert mutation_summary([('cpg', 0.1), ('transition', 0.1), ('transversion', 0.1)]) == {'total_mutations': 3, 'average_mutation_rate': {'cpg': 0.1, 'transition': 0.1, 'transversion': 0.1}, 'highest_mutation_rate_type': 'cpg'}\", \"assert mutation_summary([('cpg', 0... | {
"split": "train",
"index": 79558,
"acecode_id": "oss_7504",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a list of words and a target string. Your task is to return a new list that includes only the words that contain the target string as a substring. The search for the target string should be case-insensitive. Write a function `filter_words(words: List[str], target:... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_words(['apple', 'banana', 'cherry', 'date'], 'an') == ['banana']\", \"assert filter_words(['Hello', 'world', 'HELLO', 'hello'], 'hello') == ['Hello', 'HELLO', 'hello']\", \"assert filter_words(['Python', 'java', 'C++', 'JavaScript'], 'Java') == ['java... | {
"split": "train",
"index": 79559,
"acecode_id": "bigcode_python_fns_11504",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a list of files in a directory. Your goal is to implement a function `file_manager(commands: List[str]) -> List[str]` that processes a series of commands to add, delete, or list files. The commands will be provided as a list of strings. The function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert file_manager(['add file1.txt']) == ['Adding file: file1.txt']\", \"assert file_manager(['add file2.txt', 'list']) == ['Adding file: file2.txt', ['file2.txt']]\", \"assert file_manager(['add file1.txt', 'add file2.txt', 'delete file1.txt', 'list']) == ['Addin... | {
"split": "train",
"index": 79560,
"acecode_id": "oss_31674",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers `arr`, determine if the elements can be rearranged to form an Arithmetic Progression (AP). An array can be classified as an AP if the difference between any two successive elements remains constant. The function should return `true` if such a rearrang... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert canMakeArithmeticProgression([1, 2, 4, 2]) == False\", \"assert canMakeArithmeticProgression([1, 3, 5]) == True\", \"assert canMakeArithmeticProgression([7, 5, 3, 1]) == True\", \"assert canMakeArithmeticProgression([10, 20, 30, 40]) == True\", \"assert canM... | {
"split": "train",
"index": 79561,
"acecode_id": "evol_25893",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function that sets up a logger to capture warning messages in a Python application. The function should return a logger instance that captures all warnings. The logger should be named 'py.warnings' and should not have any existing handlers before it is r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_warning_logger().name == 'py.warnings'\", \"assert isinstance(get_warning_logger(), logging.Logger)\", \"assert get_warning_logger().propagate is True\", \"assert get_warning_logger().filters == []\", \"assert get_warning_logger().disabled is False\", \"... | {
"split": "train",
"index": 79562,
"acecode_id": "bigcode_python_fns_49330",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Create a function `to_iterable(x)` that takes an input `x` and returns an iterable. If `x` is already an iterable (like a list, tuple, or string), the function should return it as it is. If `x` is not iterable (like an integer or a float), the function should return a list cont... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert to_iterable(5) == [5]\", \"assert to_iterable(3.14) == [3.14]\", \"assert to_iterable('hello') == 'hello'\", \"assert to_iterable([1, 2, 3]) == [1, 2, 3]\", \"assert to_iterable((4, 5)) == (4, 5)\", \"assert to_iterable({1: 'a', 2: 'b'}) == {1: 'a', 2: 'b'}\... | {
"split": "train",
"index": 79563,
"acecode_id": "bigcode_python_fns_2016",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries, where each dictionary represents a node with its metadata and status information. Each node has a 'name' under 'metadata' and a list of addresses under 'status'. Each address has a 'type' and an 'address'. Your task is to implement a functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_node_ip_addresses('ExternalIP', [{'metadata': {'name': 'node1'}, 'status': {'addresses': [{'type': 'ExternalIP', 'address': '192.168.1.1'}, {'type': 'InternalIP', 'address': '10.0.0.1'}]}}, {'metadata': {'name': 'node2'}, 'status': {'addresses': [{'type'... | {
"split": "train",
"index": 79564,
"acecode_id": "bigcode_python_fns_16804",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given two lists, find the indices of the first common element between the two lists. If there is no common element, return None. The function should return a tuple containing the index of the common element from the first list and the index of the common element from the second... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_first_common_element([1, 2, 3], [4, 5, 3]) == (2, 2)\", \"assert find_first_common_element([1, 2, 3], [4, 5, 6]) == None\", \"assert find_first_common_element([1, 2, 3, 4, 5], [5, 6, 7]) == (4, 0)\", \"assert find_first_common_element([10, 20, 30], [30,... | {
"split": "train",
"index": 79565,
"acecode_id": "bigcode_python_fns_25775",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a binary search tree with the ability to add nodes, search for a node, and delete a node. Your implementation should include a method to add a new value to the tree, a method to search for a value, and a method to delete a value from the tree. The tree should maintain... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert final_tree_state('A', [('add', 'B'), ('add', 'C'), ('search', 'B'), ('delete', 'A')]) == ['B', 'C']\", \"assert final_tree_state('M', [('add', 'L'), ('add', 'N'), ('add', 'K'), ('search', 'N'), ('delete', 'M')]) == ['K', 'L', 'N']\", \"assert final_tree_stat... | {
"split": "train",
"index": 79566,
"acecode_id": "evol_19149",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of images represented as dictionaries containing the following keys: 'ImageId', 'Name', 'OwnerId', 'Description', 'CreationDate', and 'Instances' (a list of instance ids using the image). Write a function that filters and returns a list of images that are e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_images([{'ImageId': 'img1', 'Name': 'Image A', 'OwnerId': '12345', 'Description': 'Sample Image A', 'CreationDate': '2023-01-01', 'Instances': ['inst1', 'inst2']}, {'ImageId': 'img2', 'Name': 'Image B', 'OwnerId': '12345', 'Description': 'Sample Image... | {
"split": "train",
"index": 79567,
"acecode_id": "bigcode_python_fns_14604",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a date, determine the closing time of the New York Stock Exchange (NYSE) for that date. The NYSE closes at 1:00 PM on early closing days and at 4:00 PM on all other days. You are provided with a function that determines if a given date is an early closing day. Implement a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert closing_time('2023-01-01') == '04:00 PM'\", \"assert closing_time('2023-07-04') == '01:00 PM'\", \"assert closing_time('2023-11-23') == '04:00 PM'\", \"assert closing_time('2023-01-02') == '04:00 PM'\", \"assert closing_time('2023-09-04') == '04:00 PM'\", \"... | {
"split": "train",
"index": 79568,
"acecode_id": "bigcode_python_fns_37037",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_anagram(s1: str, s2: str) -> bool` that checks if two given strings are anagrams of each other. The function should verify that both strings contain only alphabetic characters and are case-insensitive. It should return True if they are anagrams, and Fal... | 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('Dormitory', 'Dirty room') == False\", \"assert is_anagram('School master', 'The classroom')... | {
"split": "train",
"index": 79569,
"acecode_id": "evol_34725",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the complementary error function (erfc) for a given floating-point number. The complementary error function is defined as 1 minus the error function (erf). Your function should take a single floating-point number as in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert abs(erfc(0.0) - 1.0) < 1e-9\", \"assert abs(erfc(1.0) - 0.1572992070502851) < 1e-9\", \"assert abs(erfc(-1.0) - 1.8427007929497149) < 1e-9\", \"assert abs(erfc(2.0) - 0.004677734981047008) < 1e-9\", \"assert abs(erfc(-2.0) - 1.995322265018953) < 1e-9\", \"as... | {
"split": "train",
"index": 79570,
"acecode_id": "oss_32324",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a string consisting of alphabetic characters and an integer 'K', write a function that removes the first set of recurring, successive characters of length 'K' from the string. If there are no such characters, return the original string. For example, if the input string is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_substring_iterative('AABBBCC', 3) == 'AACC'\", \"assert remove_substring_iterative('ABABABAB', 2) == 'ABABABAB'\", \"assert remove_substring_iterative('AA', 2) == ''\", \"assert remove_substring_iterative('ABCD', 2) == 'ABCD'\", \"assert remove_substr... | {
"split": "train",
"index": 79571,
"acecode_id": "evol_12102",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with building a function that simulates the training process of a machine learning model. The function, `train_model`, accepts two parameters: `data` (a list of integers representing features) and `duration` (an integer representing the duration of the training p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert train_model([1, 2, 3], 5) == 'Model trained successfully'\", \"assert train_model([1, 2, 3], 0) == 'Model training failed'\", \"assert train_model([], 5) == 'Model training failed'\", \"assert train_model([1, 2, 3], -3) == 'Model training failed'\", \"assert... | {
"split": "train",
"index": 79572,
"acecode_id": "bigcode_python_fns_30069",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a m by n grid with a ball, a target, and some obstacles, write a function `findPaths(m, n, N, i, j, x, y, grid)` that returns the number of distinct paths to move the ball from the starting position (i, j) to the target position (x, y) using at most N moves. The grid is r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert findPaths(3, 3, 1, 0, 0, 2, 2, [[0,0,0],[0,1,0],[0,0,2]]) == 0\", \"assert findPaths(3, 3, 2, 0, 0, 2, 2, [[0,0,0],[1,1,0],[0,0,2]]) == 0\", \"assert findPaths(4, 4, 1, 0, 0, 3, 3, [[0,0,0,0],[0,1,0,0],[0,0,0,0],[0,0,0,2]]) == 0\", \"assert findPaths(3, 3, 3... | {
"split": "train",
"index": 79573,
"acecode_id": "evol_27081",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes annotations for object detection in images. The function should take in two lists of annotations: `coco_dts` representing detected objects and `coco_gts` representing ground truth objects. Each annotation is a dictionar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_annotations([], [{'bbox': [0, 0, 10, 10], 'image_id': 1, 'id': 1, 'num_keypoints': 5}]) == ([{'x': 0, 'y': 0, 'width': 10, 'height': 10}], '[1][1][5]')\", \"assert process_annotations([], [{'bbox': [5, 5, 20, 20], 'image_id': 2, 'id': 2, 'num_keypoin... | {
"split": "train",
"index": 79574,
"acecode_id": "oss_15868",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers, `list1` and `list2`, and two weights `alpha` and `beta`, create a function `weighted_multiplicative(list1: List[int], list2: List[int], alpha: int = 1, beta: int = 1) -> List[int]` that performs a weighted element-wise multiplication of the two list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert weighted_multiplicative([1, 2, 3], [4, 5, 6], 1, 1) == [4, 10, 18]\", \"assert weighted_multiplicative([0, 0, 0], [1, 1, 1], 2, 3) == [0, 0, 0]\", \"assert weighted_multiplicative([], [], 1, 1) == []\", \"assert weighted_multiplicative([-1, -2], [-3, -4], 1,... | {
"split": "train",
"index": 79575,
"acecode_id": "bigcode_python_fns_271",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of stock prices for a series of days and a limit on the number of trades allowed, implement a function that calculates the maximum possible profit obtainable from trading. You can only buy before you sell, and you must adhere to the trade limit. The function should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert maximumProfit([100, 180, 260, 310, 40, 535, 695], 3) == 865\", \"assert maximumProfit([10, 22, 5, 75, 65, 80], 2) == 87\", \"assert maximumProfit([90, 80, 70, 60, 50], 1) == 0\", \"assert maximumProfit([1, 2, 3, 4, 5], 5) == 4\", \"assert maximumProfit([5, 4... | {
"split": "train",
"index": 79576,
"acecode_id": "evol_9783",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks the status of a volume group (VG) based on its name. The function should take in a list of active volume groups and a list of all volume groups, and return a tuple. The first element of the tuple should be a boolean indicating... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_volume_group_status(['vg1', 'vg2'], ['vg1', 'vg2', 'vg3'], 'vg1') == (True, 'Volume group vg1 is in varyon state.')\", \"assert check_volume_group_status(['vg1'], ['vg1', 'vg2', 'vg3'], 'vg2') == (False, 'Volume group vg2 is in varyoff state.')\", \"as... | {
"split": "train",
"index": 79577,
"acecode_id": "bigcode_python_fns_44396",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a single function that calculates the mean squared error (MSE) loss between predicted values and target values for a simple neural network training scenario. The function should take two lists of floating-point numbers: 'predictions', which repr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_mse([1.0, 2.0, 3.0], [1.0, 2.0, 3.0]) == 0.0\", \"assert calculate_mse([1.0, 2.0, 3.0], [1.0, 2.0, 4.0]) == 0.3333333333333333\", \"assert calculate_mse([0.0, 0.0, 0.0], [0.0, 0.0, 0.0]) == 0.0\", \"assert calculate_mse([1.0, 3.0, 5.0], [1.0, 3.0, ... | {
"split": "train",
"index": 79578,
"acecode_id": "oss_32980",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the creation of a volume group snapshot with specific options. The function should return two lists: the first list should contain the column names `['column1', 'column2']`, and the second list should contain the data `['da... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert volume_group_snapshot_create_with_options() == (['column1', 'column2'], ['data1', 'data2'])\", \"assert volume_group_snapshot_create_with_options()[0] == ['column1', 'column2']\", \"assert volume_group_snapshot_create_with_options()[1] == ['data1', 'data2']\... | {
"split": "train",
"index": 79579,
"acecode_id": "oss_18519",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a schedule in a simplified format and generates two SQL queries for inserting the full schedule and schedule information into a database. The schedule format contains information about events, including their names, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_schedule('Event 1|2022-01-01|09:00|Conference Room A|Description for Event 1|Speaker A, Attendee X\\\\nEvent 2|2022-01-02|14:00|Auditorium B|Description for Event 2|Panelists: Y, Z') == (\\\"INSERT INTO full_schedule (event_id, event_name, date, time... | {
"split": "train",
"index": 79580,
"acecode_id": "oss_26733",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, return the index of the first occurrence of the integer value 7. If 7 is not present in the list, return -1. The list may contain negative numbers, zero values, and can be of any length.\nPlease reason step by step, then write a self-contained Python s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_seven([1, 2, 3, 5, 4, 7, 9, 8, 7, -7, 0]) == 5\", \"assert find_seven([1, 2, 3, 5, 4, 9, 8, -7, 0]) == -1\", \"assert find_seven([7]) == 0\", \"assert find_seven([0, 0, 0, 0, 7]) == 4\", \"assert find_seven([5, 6, 8, 9, 10]) == -1\", \"assert find_seven... | {
"split": "train",
"index": 79581,
"acecode_id": "evol_729",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to analyze a dataset of numerical values. Your function should compute the mean, median, and mode of the given list of numbers. The function should return the results as a dictionary containing the mean, median, and mode. The input wi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_data([1, 2, 3, 4, 5]) == {'mean': 3.0, 'median': 3, 'mode': 1}\", \"assert analyze_data([1, 2, 2, 3, 4]) == {'mean': 2.4, 'median': 2, 'mode': 2}\", \"assert analyze_data([5, 5, 5, 1, 2]) == {'mean': 3.6, 'median': 5, 'mode': 5}\", \"assert analyze_d... | {
"split": "train",
"index": 79582,
"acecode_id": "oss_29741",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `clean_all_files(file_list: List[str]) -> List[str]` that takes a list of file names as input and returns a list of file names that were successfully removed. The function simulates the cleaning of files such that it will remove files... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert clean_all_files(['file1.txt', 'file2.txt', 'file3.txt']) == ['file1.txt', 'file2.txt', 'file3.txt']\", \"assert clean_all_files(['file1.txt', '', 'file2.txt', 'invalid/file.txt']) == ['file1.txt', 'file2.txt']\", \"assert clean_all_files(['file1.txt', 'file1... | {
"split": "train",
"index": 79583,
"acecode_id": "bigcode_python_fns_2148",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of strings representing error messages and extracts specific information from them. Each error message is in the format \"Error description\" or \"P1: Error description\", where \"P1\" indicates a priority level.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extractErrorInfo(['P1: Enable Fog Layer parameter was not enabled']) == [('Enable Fog Layer parameter was not enabled', 'P1')]\", \"assert extractErrorInfo(['P3: Network timeout occurred', 'P3: Connection failed']) == [('Network timeout occurred', 'P3'), ('C... | {
"split": "train",
"index": 79584,
"acecode_id": "oss_5487",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that converts a given pressure value from Pascal to Bar. The function should take two parameters: the pressure in Pascal and the desired decimal precision for the output. The conversion formula is that 1 Bar equals 100,000 Pascals. The function should re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pascal_to_bar(1000000, 5) == 10.00000\", \"assert pascal_to_bar(0, 2) == 0.00\", \"assert pascal_to_bar(101325, 3) == 1.013\", \"assert pascal_to_bar(500000, 1) == 5.0\", \"assert pascal_to_bar(250000, 4) == 2.5000\", \"assert pascal_to_bar(1500000, 0) == 15... | {
"split": "train",
"index": 79585,
"acecode_id": "evol_7284",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string and a pattern, write a function that checks if the string follows the pattern. The function should return a dictionary that maps each character in the pattern to the corresponding substring in the input string. If the string does not follow the pattern, return an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_pattern('AAABBB', 'AB') == {'A': 'AAA', 'B': 'BBB'}\", \"assert check_pattern('AABBCC', 'ABC') == {'A': 'AA', 'B': 'BB', 'C': 'CC'}\", \"assert check_pattern('AAAA', 'A') == {'A': 'AAAA'}\", \"assert check_pattern('ABABABC', 'AB') == {}\", \"assert che... | {
"split": "train",
"index": 79586,
"acecode_id": "evol_34121",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the retrieval of an authentication token. The function will take a single parameter, `current_refresh_token`, which may be a string representing a refresh token or `None`. If `current_refresh_token` is `None`, the funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_auth_token(None) == ('access_token_1', 'refresh_token_1', 3600)\", \"assert get_auth_token('valid_refresh_token') == ('access_token_2', 'refresh_token_2', 3600)\", \"assert get_auth_token('invalid_token') == (None, None, None)\", \"assert get_auth_token(... | {
"split": "train",
"index": 79587,
"acecode_id": "bigcode_python_fns_10275",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that returns the sum of all the even integers in the list. If there are no even integers, the function should return 0. The input list can contain both positive and negative integers, as well as zeros. Your function should have the fol... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([2, 4, 6, 8]) == 20\", \"assert sum_of_evens([1, 3, 5]) == 0\", \"assert sum_of_evens([-1, -2, -3, -4]) == -6\", \"assert sum_of_evens([0, 1, 2, 3]) == 2\", \"assert sum_of_evens([]) == 0\", \"asser... | {
"split": "train",
"index": 79588,
"acecode_id": "bigcode_python_fns_11440",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves user credentials for a given machine name from a predefined set of credentials stored in a dictionary. The function should accept a string parameter, `machine`, and return a tuple containing the username and password associ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_credentials('desi.lbl.gov') == ('user1', 'pass1')\", \"assert get_credentials('example.com') == ('user2', 'pass2')\", \"assert get_credentials('test.org') == ('user3', 'pass3')\", \"assert get_credentials('desi.lbl.gov') == ('user1', 'pass1')\", \"assert... | {
"split": "train",
"index": 79589,
"acecode_id": "bigcode_python_fns_11665",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the features of a dataset, and a list of integers representing the corresponding labels. Your task is to implement a function `load_training_batch(features: List[int], labels: List[int], batch_size: int) -> List[Tuple[List[int], Lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert load_training_batch([1, 2, 3, 4, 5], [0, 1, 0, 1, 0], 2) == [([1, 2], [0, 1]), ([3, 4], [0, 1]), ([5], [0])]\", \"assert load_training_batch([], [], 2) == []\", \"assert load_training_batch([1, 2], [0, 1], 3) == [([1, 2], [0, 1])]\", \"assert load_training_b... | {
"split": "train",
"index": 79590,
"acecode_id": "bigcode_python_fns_46585",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of times in EDT (Eastern Daylight Time) in 24-hour format, write a function `convert_edt_to_jst` that converts each time to JST (Japan Standard Time). The function should take a single string representing the time in EDT and return the corresponding time in JST. No... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_edt_to_jst('22:30') == '11:30'\", \"assert convert_edt_to_jst('03:15') == '16:15'\", \"assert convert_edt_to_jst('14:45') == '03:45'\", \"assert convert_edt_to_jst('09:00') == '22:00'\", \"assert convert_edt_to_jst('00:00') == '13:00'\", \"assert con... | {
"split": "train",
"index": 79591,
"acecode_id": "evol_12010",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to represent the addition of two histograms' values and return their content in binary format. A histogram is represented by a list of integer values. Implement a function `combine_histograms(hist1: List[int], hist2: List[int]) -> Lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert combine_histograms([1, 2, 3], [4, 5]) == ['0b101', '0b111', '0b11']\", \"assert combine_histograms([], []) == []\", \"assert combine_histograms([1], [1]) == ['0b10']\", \"assert combine_histograms([5, 10], [3]) == ['0b1000', '0b1010']\", \"assert combine_his... | {
"split": "train",
"index": 79592,
"acecode_id": "oss_26544",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function `calculate(expression: str) -> float` that evaluates a mathematical expression represented as a string. The function should support exponentiation, modulo operations, root calculations, and handle parentheses for order of operations. It should also support ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert math.isclose(calculate('10%3'), 1)\", \"assert math.isclose(calculate('(1+2)*3'), 9)\", \"assert math.isclose(calculate('5 + 3 * 2'), 11)\", \"assert math.isclose(calculate('(4 + 4) / 2'), 4)\", \"assert math.isclose(calculate('9 % 4 + 2'), 3)\", \"assert ma... | {
"split": "train",
"index": 79593,
"acecode_id": "evol_24652",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a string S consisting of lowercase letters 'a', 'b', 'c', and 'd', and an integer K, write a function that counts the number of distinct palindromic subsequences of S that can be formed using exactly K characters. The function should take the string S and the integer K as... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert countPalindromicSubsequences('a', 1) == 1\", \"assert countPalindromicSubsequences('aa', 1) == 1\", \"assert countPalindromicSubsequences('abc', 1) == 3\", \"assert countPalindromicSubsequences('abcd', 1) == 4\", \"assert countPalindromicSubsequences('a', 2)... | {
"split": "train",
"index": 79594,
"acecode_id": "evol_34459",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a custom metaclass in Python that modifies the `__init__` method of any class using it to include exception handling. Specifically, the metaclass should wrap the original `__init__` method in a try-except block, ensuring that any exceptions rais... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert DocumentBase is not None\", \"assert callable(DocumentBase)\", \"assert hasattr(DocumentBase, '__new__')\", \"assert hasattr(SampleClass, '__init__')\", \"assert SampleClass.__init__ == SampleClass.__init__\", \"assert SampleClass.__init__.__code__.co_varnam... | {
"split": "train",
"index": 79595,
"acecode_id": "oss_20355",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with identifying the positions of non-zero elements in a list of integers. Write a function `non_zero_indices(vector)` that takes a list of integers `vector` as input and returns a list of indices where the elements of the vector are non-zero. The indices should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert non_zero_indices([0, 3, 0, 5, 0, 0, 8]) == [1, 3, 6]\", \"assert non_zero_indices([1, 0, 2, 0, 3]) == [0, 2, 4]\", \"assert non_zero_indices([0, 0, 0]) == []\", \"assert non_zero_indices([5, 6, 0, 0, 7]) == [0, 1, 4]\", \"assert non_zero_indices([-1, 0, -2, ... | {
"split": "train",
"index": 79596,
"acecode_id": "oss_5847",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings representing lines from a PDB(TQ) file, write a function `get_receptor_residues(data: List[str]) -> Dict[str, Dict[str, List[str]]]` that processes these lines and returns a nested dictionary structure. The nested dictionary should be organized as follow... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_receptor_residues(['ATOM 1 N MET A 1 20.154 34.298 27.579 1.00 20.00 N', 'ATOM 2 CA MET A 1 21.154 35.298 28.579 1.00 20.00 C']) == {'A': {'MET1': ['N', 'CA']}}\", \"assert get_receptor_residues(['HE... | {
"split": "train",
"index": 79597,
"acecode_id": "bigcode_python_fns_1075",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings representing Redis keys, write a function `filter_keys(keys: List[str], pattern: str) -> List[str]` that returns a list of keys that match a given pattern. The pattern can include wildcard characters: '*' which matches any sequence of characters, and '?'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_keys(['user_1', 'user_2', 'admin', 'guest'], 'user_*') == ['user_1', 'user_2']\", \"assert filter_keys(['user_1', 'user_2', 'admin', 'guest'], 'admin') == ['admin']\", \"assert filter_keys(['user_1', 'user_2', 'admin', 'guest'], 'guest?') == []\", \"a... | {
"split": "train",
"index": 79598,
"acecode_id": "bigcode_python_fns_38012",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that transforms values by applying a specific transformation logic. The function, `transform_values`, takes a single parameter `value`, which can be an integer, a list of integers, or a tuple of integers. The transformation logic is t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_values(5) == 6\", \"assert transform_values([1, 2, 3]) == [2, 3, 4]\", \"assert transform_values((1, 2, 3)) == (2, 3, 4)\", \"assert transform_values([1, (2, 3), 4]) == [2, (3, 4), 5]\", \"assert transform_values((1, (2, 3), 4)) == (2, (3, 4), 5)\"... | {
"split": "train",
"index": 79599,
"acecode_id": "oss_24408",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.