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 a nested list of integers, implement a function that returns a new nested list containing the squares of each individual integer in the original list. The input list may contain integers and other nested lists of integers. Write a function named `square_nested_list` that ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert square_nested_list([1, [2, 3], [4, [5, 6]], 7]) == [1, [4, 9], [16, [25, 36]], 49]\", \"assert square_nested_list([]) == []\", \"assert square_nested_list([[1], [2], [3]]) == [[1], [4], [9]]\", \"assert square_nested_list([[-1, -2], [-3, [-4]]]) == [[1, 4], ... | {
"split": "train",
"index": 77200,
"acecode_id": "evol_20467",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of session data represented as tuples where each tuple contains a session ID and a boolean value indicating if the session is valid, write a function `session_validity_stats(sessions: List[Tuple[int, bool]]) -> Tuple[int, int]` that returns a tuple containing two i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert session_validity_stats([(1, True), (2, False), (3, True)]) == (2, 3)\", \"assert session_validity_stats([(1, True), (2, True), (3, True)]) == (3, 3)\", \"assert session_validity_stats([(1, False), (2, False), (3, False)]) == (0, 3)\", \"assert session_validi... | {
"split": "train",
"index": 77201,
"acecode_id": "bigcode_python_fns_23487",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates fetching data from a hypothetical API endpoint. The function should take a URL (a string) and a dictionary of query parameters, and it should return a simulated response in the form of a dictionary. The simulated response s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_data('https://api.example.com/data', {'param1': 'value1', 'param2': 'value2'}) == {'data': [1, 2, 3, 4, 5], 'status_code': 200}\", \"assert get_data('https://api.example.com/data', {'key': 'value'}) == {'data': [1, 2, 3, 4, 5], 'status_code': 200}\", \"a... | {
"split": "train",
"index": 77202,
"acecode_id": "oss_14559",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two objects, `run` and `user`, each with specific properties, write a function `GetMappingKeyName(run, user)` that returns a unique string identifier for a mapping. The `run` object has a method `key()` that returns an object with a method `name()`, which returns a string... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert GetMappingKeyName(MockRun('TestRun'), MockUser(123)) == 'RunTesterMap_TestRun_123'\", \"assert GetMappingKeyName(MockRun('RunA'), MockUser(456)) == 'RunTesterMap_RunA_456'\", \"assert GetMappingKeyName(MockRun('RunB'), MockUser(1)) == 'RunTesterMap_RunB_1'\"... | {
"split": "train",
"index": 77203,
"acecode_id": "bigcode_python_fns_20983",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to implement a function that takes this list as input and returns a new list containing only the unique elements from the original list, preserving the order of their first occurrence. For example, given the input list [1, 2, 1, 3,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_elements([1, 2, 1, 3, 2]) == [1, 2, 3]\", \"assert unique_elements([4, 5, 4, 4, 6]) == [4, 5, 6]\", \"assert unique_elements([1, 2, 3]) == [1, 2, 3]\", \"assert unique_elements([]) == []\", \"assert unique_elements([1, 1, 1]) == [1]\", \"assert unique... | {
"split": "train",
"index": 77204,
"acecode_id": "oss_17577",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that accepts an alphanumeric sequence as an argument, which can include nested sequences represented as tuples. The function should return the sequence reversed, including reversing the order of elements in nested tuples. If any integers are present, they s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_sequence(('ABC', ('DEF', 'GHI'), 'JKL')) == ('LKJ', ('IHG', 'FED'), 'CBA')\", \"assert reverse_sequence(('Hello', 'World')) == ('dlroW', 'olleH')\", \"assert reverse_sequence('Test') == 'tseT'\", \"assert reverse_sequence(('A', 'B', ('C', 'D'))) == (... | {
"split": "train",
"index": 77205,
"acecode_id": "evol_25176",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function to calculate the monthly mortgage payment for a house. The function should take in three parameters: the user's salary (a floating-point number), the price of the house (a floating-point number), and the number of years over which ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_monthly_payment(50000.0, 300000.0, 30) == 833.33\", \"assert calculate_monthly_payment(60000.0, 240000.0, 15) == 1333.33\", \"assert calculate_monthly_payment(70000.0, 420000.0, 20) == 1750.0\", \"assert calculate_monthly_payment(80000.0, 480000.0,... | {
"split": "train",
"index": 77206,
"acecode_id": "oss_325",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `create_queue_method(queue_name: str, durable: bool, auto_delete: bool, priorities: int, extra_properties: Optional[dict] = None) -> dict` that simulates the creation of a queue. The function should take in the queue parameters and re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_queue_method('my_queue', True, False, 5) == {'type': 'queue', 'name': 'my_queue', 'properties': {'durable': True, 'auto-delete': False, 'qpid.priorities': 5}}\", \"assert create_queue_method('test_queue', False, True, 0) == {'type': 'queue', 'name': '... | {
"split": "train",
"index": 77207,
"acecode_id": "bigcode_python_fns_37884",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a timestamp in seconds since the epoch (as an integer), write a function `format_time(record: int) -> str` that formats the timestamp to an ISO 8601 string in UTC. The output should be in the format 'YYYY-MM-DD HH:MM:SS.sssZ' where 'sss' represents milliseconds. The funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_time(0) == '1970-01-01 00:00:00.000Z'\", \"assert format_time(1614556800) == '2021-03-01 00:00:00.000Z'\", \"assert format_time(946684800) == '2000-01-01 00:00:00.000Z'\", \"assert format_time(1672531199) == '2022-12-31 23:59:59.000Z'\", \"assert form... | {
"split": "train",
"index": 77208,
"acecode_id": "bigcode_python_fns_42158",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `getVoice` that simulates the process of generating audio files with different voices based on provided parameters. The function takes in five parameters: an access token (string), a language code (string), a voice type (string, either 'm... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert getVoice('token', 'en', 'female', 'Hello World', 'output.wav') == 'Audio file saved as output.wav with female voice in en language.'\", \"assert getVoice('token', 'fr', 'male', 'Bonjour le monde', 'output.mp3') == 'Audio file saved as output.mp3 with male vo... | {
"split": "train",
"index": 77209,
"acecode_id": "oss_35873",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string 'abcd', write a function that generates all unique combinations of the characters in the string. After generating the combinations, filter out those that do not contain any vowels (defined as 'a', 'e', 'i', 'o', 'u'). Return the filtered combinations in alphabeti... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_combinations_with_vowels('xyz') == []\", \"assert generate_combinations_with_vowels('bcd') == []\", \"assert generate_combinations_with_vowels('ae') == ['a', 'ae', 'e']\", \"assert generate_combinations_with_vowels('a') == ['a']\", \"assert generate... | {
"split": "train",
"index": 77210,
"acecode_id": "evol_8164",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python program to summarize the results of various test groups. Each test group is represented as a function that returns the count of successful tests and the total count of tests conducted. Your task is to implement the `run_tests` function, whi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert run_tests([lambda: (15, 15), lambda: (28, 30), lambda: (40, 40)]) == '83/85 tests were conducted successfully.'\", \"assert run_tests([lambda: (0, 0), lambda: (0, 0)]) == '0/0 tests were conducted successfully.'\", \"assert run_tests([lambda: (10, 20), lambd... | {
"split": "train",
"index": 77211,
"acecode_id": "oss_5135",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a tuple of tokens representing various identifiers, keywords, and symbols. Your task is to implement a function `count_token_frequency(tokens: tuple) -> dict` that returns a dictionary where the keys are the unique tokens and the values are the frequency of each t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_token_frequency(('ID', 'STRING', 'ID', 'LP', 'RP', 'STRING', 'ID')) == {'ID': 3, 'STRING': 2, 'LP': 1, 'RP': 1}\", \"assert count_token_frequency(('A', 'B', 'A', 'C', 'B', 'A')) == {'A': 3, 'B': 2, 'C': 1}\", \"assert count_token_frequency(('TOKEN1', '... | {
"split": "train",
"index": 77212,
"acecode_id": "oss_27929",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that checks whether the count of divisors of a given positive integer is even and returns a list of those divisors. The function should only take one integer as input and output a tuple where the first element is a boolean indicating if the count of divi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert divisor_count_and_list(6) == (True, [1, 2, 3, 6])\", \"assert divisor_count_and_list(8) == (True, [1, 2, 4, 8])\", \"assert divisor_count_and_list(9) == (False, [1, 3, 9])\", \"assert divisor_count_and_list(10) == (True, [1, 2, 5, 10])\", \"assert divisor_co... | {
"split": "train",
"index": 77213,
"acecode_id": "evol_12745",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of processing instructions (PIs) for an XML tree. The function should take in a list of tuples where each tuple contains a key and a value representing the processing instruction. Your function should return a li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_processing_instructions([]) == []\", \"assert format_processing_instructions([('xml-stylesheet', \\\"type='text/xsl' href='style.xsl'\\\")]) == [\\\"<?xml-stylesheet type='text/xsl' href='style.xsl'?>\\\"]\", \"assert format_processing_instructions([(... | {
"split": "train",
"index": 77214,
"acecode_id": "oss_8760",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates processing a payment request through different payment gateways based on a given order ID and receipt code. Your function should take in three parameters: an order ID (integer), a receipt code (string), and a payment ga... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_payment(1, 'receipt123', 'PayPal') == 'Payment processed successfully via PayPal.'\", \"assert process_payment(2, 'receipt456', 'PayPal') == 'Payment processed successfully via PayPal.'\", \"assert process_payment(3, 'receipt789', 'PayPal') == 'Payme... | {
"split": "train",
"index": 77215,
"acecode_id": "bigcode_python_fns_23075",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a string of comma-separated integers, implement a function that determines if the integers can be partitioned into two distinct segments such that the sum of each segment is even. The function should return True if such a partition is possible, and False otherwise. The in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert partition_even_sum('1,2,3,4,5,6') == True\", \"assert partition_even_sum('1,1,1,1') == True\", \"assert partition_even_sum('2,2,2,2') == True\", \"assert partition_even_sum('5,5,5,5') == True\", \"assert partition_even_sum('4,3,2,1') == True\", \"assert part... | {
"split": "train",
"index": 77216,
"acecode_id": "evol_9815",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Write a function that takes this list as input and returns the product of all the integers in the list. If any integer in the list is zero, the product should be zero as well. Implement the function named `product_of_list` that takes a single p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert product_of_list([1, 2, 3]) == 6\", \"assert product_of_list([0, 2, 3]) == 0\", \"assert product_of_list([-1, -2, -3]) == -6\", \"assert product_of_list([1, 0, 3]) == 0\", \"assert product_of_list([5]) == 5\", \"assert product_of_list([]) == 1\", \"assert pro... | {
"split": "train",
"index": 77217,
"acecode_id": "evol_18065",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a sequence of DNA, consisting of the characters 'A', 'C', 'G', and 'T'. Your task is to implement a function that counts the number of times the substring 'AT' appears in the given DNA string. Write a function `count_at_substring(dna: str) ->... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_at_substring('ATGCGATACG') == 2\", \"assert count_at_substring('CAGTACGAT') == 1\", \"assert count_at_substring('TTTT') == 0\", \"assert count_at_substring('ATATATAT') == 4\", \"assert count_at_substring('') == 0\", \"assert count_at_substring('A') == ... | {
"split": "train",
"index": 77218,
"acecode_id": "bigcode_python_fns_12636",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given an alphanumeric string, write a function `count_consonants(text: str) -> int` that computes the number of consonants present in the string. Consonants are defined as any alphabetic character that is not a vowel (a, e, i, o, u) regardless of case. Ignore spaces, punctuatio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_consonants('Hello World!') == 7\", \"assert count_consonants('Python3.9 is great!') == 9\", \"assert count_consonants('12345!@#$%^&*()') == 0\", \"assert count_consonants('aAeEiIoOuU') == 0\", \"assert count_consonants('') == 0\", \"assert count_conson... | {
"split": "train",
"index": 77219,
"acecode_id": "evol_5729",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function `evaluate_expression(expression: str) -> float` that takes a mathematical expression as a string containing only integers, addition (+), subtraction (-), multiplication (*), and division (/). The function should evaluate the expression following the BIDMAS/... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate_expression('3 + 5') == 8.0\", \"assert evaluate_expression('10 - 2 * 3') == 4.0\", \"assert evaluate_expression('(8 / 4) + 2 * 3') == 8.0\", \"assert evaluate_expression('2 + 3 * 4 - 1') == 13.0\", \"assert evaluate_expression('0 * 5 + 3') == 3.0\",... | {
"split": "train",
"index": 77220,
"acecode_id": "evol_15642",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `create_hamiltonian_matrix` that generates a Hamiltonian matrix for a tight-binding model. The Hamiltonian matrix should be represented as a 2D list (array) where the diagonal elements are given by the on-site energies from the input l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_hamiltonian_matrix([1, 2, 3], 4) == [[1, 4, 4], [4, 2, 4], [4, 4, 3]]\", \"assert create_hamiltonian_matrix([5, 0, -1], 2) == [[5, 2, 2], [2, 0, 2], [2, 2, -1]]\", \"assert create_hamiltonian_matrix([-3, -2, -1], 1) == [[-3, 1, 1], [1, -2, 1], [1, 1, ... | {
"split": "train",
"index": 77221,
"acecode_id": "bigcode_python_fns_6790",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that manages a collection of environment variables represented as a dictionary. The function should be able to perform the following operations based on the provided command: 'add', 'update', 'remove', or 'clear'. Your function should acc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_env_vars('add', {'VAR1': 'value1', 'VAR2': 'value2'}) == {'VAR1': 'value1', 'VAR2': 'value2'}\", \"assert manage_env_vars('update', {'VAR1': 'new_value1'}) == {'VAR1': 'new_value1'}\", \"assert manage_env_vars('clear', {'VAR1': 'value1', 'VAR2': 'valu... | {
"split": "train",
"index": 77222,
"acecode_id": "bigcode_python_fns_36760",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `send_message` that simulates sending a message over a network. The function takes a string `message` and a tuple `address` where the first element is a string representing the host and the second element is an integer representing th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert send_message('Hello, World!', ('localhost', 8080)) == 'Sent: Hello, World! to localhost:8080'\", \"assert send_message('Test message', ('192.168.1.1', 3000)) == 'Sent: Test message to 192.168.1.1:3000'\", \"assert send_message('', ('localhost', 8080)) == 'Er... | {
"split": "train",
"index": 77223,
"acecode_id": "oss_23864",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a configuration dictionary for a Flask application. The function should accept the following parameters: `manager_ip`, `driver`, `hash_salt`, and `secret_key`. The function will return a dictionary containing the configurat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_flask_config('localhost', 'pg8000', 'my_salt', 'my_secret') == {'SQLALCHEMY_DATABASE_URI': 'postgresql+pg8000://localhost', 'SQLALCHEMY_TRACK_MODIFICATIONS': False, 'ENV': 'production', 'hash_salt': 'my_salt', 'secret_key': 'my_secret'}\", \"assert ... | {
"split": "train",
"index": 77224,
"acecode_id": "bigcode_python_fns_17659",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates a simple banking operation. The function should allow users to perform the following actions: create an account, deposit funds, withdraw funds, and check their balance. The function should take the following paramete... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bank_operations([('create', 'Alice', 1000.0), ('deposit', 1, 500.0), ('withdraw', 1, 200.0), ('check_balance', 1)]) == [1300.0]\", \"assert bank_operations([('create', 'Dave', 100.0), ('deposit', 1, 50.0), ('check_balance', 1)]) == [150.0]\", \"assert bank_o... | {
"split": "train",
"index": 77225,
"acecode_id": "oss_21086",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers and a target integer, write a function called `larger_values_indices` that returns a list of indices of all elements in the array that are greater than the target integer. If no elements are greater, return an empty list.\nPlease reason step by step, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert larger_values_indices([1, 2, 3, 4, 5], 3) == [3, 4]\", \"assert larger_values_indices([10, 20, 30, 40, 50], 25) == [2, 3, 4]\", \"assert larger_values_indices([5, 4, 3, 2, 1], 5) == []\", \"assert larger_values_indices([], 0) == []\", \"assert larger_values_... | {
"split": "train",
"index": 77226,
"acecode_id": "evol_18133",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given three lists of integers, `states`, `setpoints`, and `weather`. Write a function `calculate_total_PAR(states: List[int], setpoints: List[int], weather: List[int]) -> int` that calculates the total PAR (Photosynthetically Active Radiation) absorbed by the canopy. Th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_PAR([1, 2, 3], [4, 5], [6]) == 21\", \"assert calculate_total_PAR([0, 0, 0], [0, 0], [0]) == 0\", \"assert calculate_total_PAR([10, 20], [30, 40, 50], [60]) == 210\", \"assert calculate_total_PAR([-1, -2, -3], [-4, -5], [-6]) == -21\", \"asse... | {
"split": "train",
"index": 77227,
"acecode_id": "bigcode_python_fns_48579",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to manage uniform shader variables in a graphics application. Specifically, you need to create a function named `manage_uniforms` that takes a list of uniform variable definitions and returns a dictionary containing the uniform variab... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_uniforms([('u_color', 'vec3', (1, 0, 0)), ('u_light', 'float', 2.0)]) == {'u_color': (1, 0, 0), 'u_light': 2.0}\", \"assert manage_uniforms([('u_texture', 'sampler2D', 'texture.png'), ('u_alpha', 'float', 1.0)]) == {'u_texture': 'texture.png', 'u_alph... | {
"split": "train",
"index": 77228,
"acecode_id": "oss_18555",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers and a list of bit positions, return a new array where each element indicates whether any of the specified bits are set in the corresponding element of the input array. The first bit is denoted as zero and the second bit as one. For each bit position, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bitset([3, 4, 1], [0]) == [1, 0, 1]\", \"assert bitset([0, 0, 0], [1]) == [0, 0, 0]\", \"assert bitset([5, 10, 15], [1, 2]) == [1, 1, 1]\", \"assert bitset([1, 2, 3], [0]) == [1, 0, 1]\", \"assert bitset([5, 6, 7], [0, 1]) == [1, 1, 1]\", \"assert bitset([16... | {
"split": "train",
"index": 77229,
"acecode_id": "bigcode_python_fns_29599",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary `model_config` representing a technology hierarchy, where each technology has a unique id and a parent technology id, implement a function `get_inheritance_tree(tech_id: str, model_config: dict) -> List[str]` that returns a list of all ancestor technology ids... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_inheritance_tree('tech1', {'techs': {'tech1': {'essentials': {'parent': 'tech2'}}, 'tech2': {'essentials': {'parent': 'tech3'}}, 'tech3': {'essentials': {'parent': None}}}}) == ['tech2', 'tech3']\", \"assert get_inheritance_tree('tech2', {'techs': {'tech... | {
"split": "train",
"index": 77230,
"acecode_id": "bigcode_python_fns_10681",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `s`, determine if the longest matching LMS (Last Minimum Suffix) substrings starting at two specified offsets `offsetA` and `offsetB` are equal. An LMS substring is defined as a substring that is preceded by a character that is smaller than it and followed by a c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert are_lms_substrings_equal('abcabc', 0, 3) == True\", \"assert are_lms_substrings_equal('abcabc', 1, 4) == True\", \"assert are_lms_substrings_equal('abcabc', 0, 4) == False\", \"assert are_lms_substrings_equal('abcabc', 1, 2) == False\", \"assert are_lms_subs... | {
"split": "train",
"index": 77231,
"acecode_id": "bigcode_python_fns_22383",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates default configuration settings for a software development environment. The function should take no parameters and return a list of tuples, where each tuple consists of a configuration key and its corresponding default v... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert detect_default_settings() == [('os_arch', 'x64'), ('compiler_version', 'gcc 9.3'), ('build_type', 'Release')]\", \"assert detect_default_settings()[0] == ('os_arch', 'x64')\", \"assert detect_default_settings()[1] == ('compiler_version', 'gcc 9.3')\", \"asse... | {
"split": "train",
"index": 77232,
"acecode_id": "bigcode_python_fns_48548",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to create a function that returns a new list containing only the unique integers from the input list, maintaining the order of their first occurrence. Implement a function `unique_integers(arr: List[int]) -> List[int]` where `arr` ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_integers([1, 2, 2, 3, 4, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert unique_integers([5, 5, 5, 5]) == [5]\", \"assert unique_integers([]) == []\", \"assert unique_integers([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert unique_integers([1, 1, 2, 2, 3, 3]) =... | {
"split": "train",
"index": 77233,
"acecode_id": "bigcode_python_fns_39597",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that simulates the growth of a population over multiple generations. The function should take in the initial population size, the annual growth rate, and a target population size. It should return True if the population reaches... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert population_growth(100, 0.1, 150) == True\", \"assert population_growth(50, 0.2, 100) == True\", \"assert population_growth(30, 0.5, 100) == True\", \"assert population_growth(200, 0.05, 250) == True\", \"assert population_growth(10, 0.3, 50) == True\", \"ass... | {
"split": "train",
"index": 77234,
"acecode_id": "oss_34157",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that returns a new list containing only the elements that appear more than once in the original list. The order of the elements in the output list should reflect their first appearance in the input list. If no elements appear more than... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_duplicates([1, 2, 3, 4, 5]) == []\", \"assert find_duplicates([1, 2, 2, 3, 4, 4, 5]) == [2, 4]\", \"assert find_duplicates([1, 1, 1, 1, 1]) == [1]\", \"assert find_duplicates([]) == []\", \"assert find_duplicates([5, 5, 6, 7, 6, 8, 8]) == [5, 6, 8]\", \... | {
"split": "train",
"index": 77235,
"acecode_id": "bigcode_python_fns_33094",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `sum_of_seven(x, y)` that takes two parameters, `x` and `y`, and returns their sum plus an additional 7. The function should handle exceptions that may occur if the provided arguments are of incompatible types. If a TypeError occurs, the function should return ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_seven(1, 2) == 10\", \"assert sum_of_seven(0, 0) == 7\", \"assert sum_of_seven(-1, -1) == 5\", \"assert sum_of_seven(1.5, 2.5) == 11\", \"assert sum_of_seven(1, 2.5) == 10.5\", \"assert sum_of_seven(-3, 2) == 6\", \"assert sum_of_seven(0, 3) == 10\", ... | {
"split": "train",
"index": 77236,
"acecode_id": "evol_12376",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a name, a list of data, a list of arguments, and a list of known error files. The function should combine the lists of data and known error files into a single list, and then append a string to the list of arguments that specif... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert combine_test_data('test_name', ['data1'], [], []) == (['data1'], ['--known_error_files='])\", \"assert combine_test_data('test_name', [], ['arg1'], []) == ([], ['arg1', '--known_error_files='])\", \"assert combine_test_data('test_name', [], [], ['file1.txt']... | {
"split": "train",
"index": 77237,
"acecode_id": "bigcode_python_fns_42935",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a proximity name based on a given mode. The function `get_proximity_name` takes a single optional parameter `mode`, which defaults to \"server\". The function should return a string representing the proximity name based on ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_proximity_name() == 'local'\", \"assert get_proximity_name('server') == 'local'\", \"assert get_proximity_name('client') == 'remote'\", \"assert get_proximity_name('unknown_mode') == 'unknown'\", \"assert get_proximity_name('') == 'unknown'\", \"assert g... | {
"split": "train",
"index": 77238,
"acecode_id": "oss_29217",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates an HTML anchor tag for a given author's name and their profile URL. The function should take two parameters: a string `url` representing the profile link of the author, and a string `full_name` representing the author's ful... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_author('https://example.com/author', 'John Doe') == \\\"<a class='more-info' href='https://example.com/author'>John Doe</a>\\\"\", \"assert format_author('https://example.com/authors/jane', 'Jane Smith') == \\\"<a class='more-info' href='https://examp... | {
"split": "train",
"index": 77239,
"acecode_id": "bigcode_python_fns_10991",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes two dates as input: a start date and an end date. The function should return a list of tuples, where each tuple represents a week-long broadcast period starting from the start date and ending 6 days later. A broadcast week is d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert broadcast_weeks('2023-11-01', '2023-11-07') == [('2023-11-01', '2023-11-07')]\", \"assert broadcast_weeks('2023-10-01', '2023-10-07') == [('2023-10-01', '2023-10-07')]\", \"assert broadcast_weeks('2023-10-01', '2023-10-14') == [('2023-10-01', '2023-10-07'), ... | {
"split": "train",
"index": 77240,
"acecode_id": "bigcode_python_fns_49575",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a function that validates a URL based on specific criteria. The function should take a single string parameter, `url_name`, and return 'Valid' if the URL adheres to the following rules; otherwise, return 'Invalid':\n- The URL must only contain alphanumeric characters,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert url_check('https://example.edu/') == 'Invalid'\", \"assert url_check('http://example..com') == 'Invalid'\", \"assert url_check('http://example.com/path//to/resource') == 'Invalid'\", \"assert url_check('http://example.com//path') == 'Invalid'\", \"assert url... | {
"split": "train",
"index": 77241,
"acecode_id": "evol_5377",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_prime(n: int) -> bool` that determines whether a given integer n is a prime number. A prime number is defined as a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. The function should return True if n is a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_prime(2) == True\", \"assert is_prime(3) == True\", \"assert is_prime(4) == False\", \"assert is_prime(5) == True\", \"assert is_prime(10) == False\", \"assert is_prime(11) == True\", \"assert is_prime(12) == False\", \"assert is_prime(13) == True\", \"as... | {
"split": "train",
"index": 77242,
"acecode_id": "evol_20315",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that takes an integer input representing the total number of seconds elapsed since the last visit to a local server. Your function should convert this total time into a formatted string indicating the duration in hours, minutes, and second... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_time_elapsed(3661) == '1\\u5c0f\\u65f61\\u5206\\u949f1\\u79d2\\u524d\\u6709\\u4eba\\u6765\\u8fc7\\u3002'\", \"assert format_time_elapsed(7200) == '2\\u5c0f\\u65f60\\u5206\\u949f0\\u79d2\\u524d\\u6709\\u4eba\\u6765\\u8fc7\\u3002'\", \"assert format_tim... | {
"split": "train",
"index": 77243,
"acecode_id": "oss_2106",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are asked to implement a function `dispatch_request(methods, request)` that simulates the dispatching of JSON-RPC requests. The function should take two parameters: a list or dictionary of methods and a request in the form of a dictionary containing the keys 'jsonrpc', 'met... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dispatch_request({'cat': lambda: 'meow'}, {'jsonrpc': '2.0', 'method': 'cat', 'id': 1, 'params': []}) == 'meow'\", \"assert dispatch_request({'cat': lambda: 'meow'}, {'jsonrpc': '2.0', 'method': 'dog', 'id': 1, 'params': []}) == 'Method not found'\", \"asser... | {
"split": "train",
"index": 77244,
"acecode_id": "bigcode_python_fns_1519",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that filters a list of strings based on multiple pairs of prefixes and suffixes. The function should return strings that start with any of the specified prefixes and end with any of the specified suffixes. Additionally, the function should accept a paramete... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_sort_multiple_prefix_suffix([], [('a', 'z')], 'asc') == []\", \"assert filter_sort_multiple_prefix_suffix(['xyz', 'axz', 'ayz', 'abz'], [('a', 'z')], 'asc') == ['abz', 'axz', 'ayz']\", \"assert filter_sort_multiple_prefix_suffix(['cat', 'dog', 'bat', ... | {
"split": "train",
"index": 77245,
"acecode_id": "evol_35933",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function named `send_message_summary` that simulates sending messages for a marketing campaign. The function should take two parameters: a list of messages and the total number of recipients. Each message is represented as a dictionary with two ke... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert send_message_summary([{'recipient': 'Alice', 'content': 'Hello Alice!'}, {'recipient': 'Bob', 'content': 'Hello Bob!'}], 3) == 2\", \"assert send_message_summary([{'recipient': 'Alice', 'content': 'Hello Alice!'}], 1) == 1\", \"assert send_message_summary([]... | {
"split": "train",
"index": 77246,
"acecode_id": "oss_6293",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a 9x9 Sudoku board represented as a 2D list of integers, write a function `print_board(board)` that prints the Sudoku board in a readable format. The board will contain integers from 0 to 9, where 0 represents an empty cell. The function should format the output by separa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert print_board([[5,3,0,0,7,0,0,0,0],[6,0,0,1,9,5,0,0,0],[0,9,8,0,0,0,0,6,0],[8,0,0,0,6,0,0,0,3],[4,0,0,8,0,3,0,0,1],[7,0,0,0,2,0,0,0,6],[0,6,0,0,0,0,2,8,0],[0,0,0,4,1,9,0,0,5],[0,0,0,0,8,0,0,7,9]]) == None\", \"assert print_board([[0,0,0,0,0,0,0,0,0],[0,0,0,0,0... | {
"split": "train",
"index": 77247,
"acecode_id": "bigcode_python_fns_32099",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function `get_years_since(year: int) -> int` that takes an integer `year` as input and returns the number of years that have passed since that year until the current year. The current year is assumed to be 2023. For example, if the input year is 2020, the output sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_years_since(2020) == 3\", \"assert get_years_since(2023) == 0\", \"assert get_years_since(2025) == -2\", \"assert get_years_since(2000) == 23\", \"assert get_years_since(1999) == 24\", \"assert get_years_since(2022) == 1\", \"assert get_years_since(1900)... | {
"split": "train",
"index": 77248,
"acecode_id": "bigcode_python_fns_25139",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a resource management system. The function should accept a resource type and a resource name, and return a dictionary representing the resource with the keys 'type' and 'name'. The 'type' should be the same as the input res... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_resource('Server', 'Main Server') == {'type': 'Server', 'name': 'Main Server'}\", \"assert create_resource('Database', 'UserDB') == {'type': 'Database', 'name': 'UserDB'}\", \"assert create_resource('Cache', 'RedisCache') == {'type': 'Cache', 'name': ... | {
"split": "train",
"index": 77249,
"acecode_id": "oss_19146",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a request object which contains information about a customer. Your task is to implement a function that returns the selected shipping country for the customer. The selected shipping country could either be an explicitly selected country of the current user or the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_selected_shipping_country({'customer': {'selected_shipping_address': {'country': 'USA'}, 'selected_country': 'Canada'}}) == 'USA'\", \"assert get_selected_shipping_country({'customer': {'selected_shipping_address': None, 'selected_country': 'Canada'}}) =... | {
"split": "train",
"index": 77250,
"acecode_id": "bigcode_python_fns_1692",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing a Directed Flow Graph (DFG) and two dictionaries representing start and end activities. Write a function `visualize_performance_dfg(dfg: dict, start_activities: dict, end_activities: dict, aggregation_measure: str) -> str` that simulates ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert visualize_performance_dfg({}, {}, {}, 'mean') == 'Visualization created in None format with aggregation measure mean'\", \"assert visualize_performance_dfg({'A': 'B'}, {'A': 1}, {'B': 2}, 'median') == 'Visualization created in None format with aggregation me... | {
"split": "train",
"index": 77251,
"acecode_id": "bigcode_python_fns_27879",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that returns the Fibonacci number at the 'n-th' position, where 'n' is a non-negative integer. The Fibonacci sequence starts with 0 and 1, and each subsequent number is the sum of the previous two. For example, the Fibonacci numbers for positions 0 through 5 ar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(0) == 0\", \"assert fibonacci(1) == 1\", \"assert fibonacci(2) == 1\", \"assert fibonacci(3) == 2\", \"assert fibonacci(4) == 3\", \"assert fibonacci(5) == 5\", \"assert fibonacci(6) == 8\", \"assert fibonacci(7) == 13\", \"assert fibonacci(8) == 2... | {
"split": "train",
"index": 77252,
"acecode_id": "evol_29728",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes in a customer's preferred communication platforms and the customer's timezone, and returns the preferred communication platform based on the current time in that timezone. The input will be a dictionary with two keys: 'daytime' and 'nighttime', w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_preferred_communication('Asia/Kolkata', {'daytime': 'whatsapp', 'nighttime': 'telegram'}) == 'whatsapp'\", \"assert get_preferred_communication('Australia/Sydney', {'daytime': 'none', 'nighttime': 'sms'}) == 'none'\", \"assert get_preferred_communication... | {
"split": "train",
"index": 77253,
"acecode_id": "evol_9768",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a byte string that may contain a Byte Order Mark (BOM) at the beginning. Your task is to implement a function that inspects the byte string and determines the encoding based on the presence of a BOM. The possible encodings are: 'utf-8', 'utf-16-le', 'utf-16-be', a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert detect_bom(b'\\\\xef\\\\xbb\\\\xbfHello World') == 'utf-8'\", \"assert detect_bom(b'\\\\xff\\\\xfeHello World') == 'utf-16-le'\", \"assert detect_bom(b'\\\\xfe\\\\xffHello World') == 'utf-16-be'\", \"assert detect_bom(b'Hello World') == 'none'\", \"assert de... | {
"split": "train",
"index": 77254,
"acecode_id": "bigcode_python_fns_20060",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that manages a collection of variables. Your function should take a list of variables and return a new list that contains all the variables in the same order, but with each variable converted to a string representation. Write a functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_variables([10, 'hello', True]) == ['10', 'hello', 'True']\", \"assert manage_variables([1, 2, 3]) == ['1', '2', '3']\", \"assert manage_variables(['apple', 'banana', 'cherry']) == ['apple', 'banana', 'cherry']\", \"assert manage_variables([None, 0, -1... | {
"split": "train",
"index": 77255,
"acecode_id": "oss_13712",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two quaternions represented as tuples of four numbers (w, x, y, z). Your task is to implement a function that multiplies these two quaternions and returns the result as a tuple in the same format. A quaternion is a number system that extends complex numbers and is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multiply_quaternions((1, 0, 0, 0), (1, 0, 0, 0)) == (1, 0, 0, 0)\", \"assert multiply_quaternions((0, 1, 0, 0), (0, 0, 1, 0)) == (0, 0, 0, 1)\", \"assert multiply_quaternions((0, 0, 1, 0), (0, 0, 0, 1)) == (0, 1, 0, 0)\", \"assert multiply_quaternions((1, 2,... | {
"split": "train",
"index": 77256,
"acecode_id": "bigcode_python_fns_17150",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a JSON response that contains a list of items, each with an 'id' and a 'name', implement a function that retrieves all items with 'id' values that are prime numbers. The function should take a JSON string as input and return a list of names corresponding to the prime 'id'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_prime_names('{\\\"results\\\": [{\\\"id\\\": 1, \\\"name\\\": \\\"John\\\"}, {\\\"id\\\": 2, \\\"name\\\": \\\"Dave\\\"}, {\\\"id\\\": 3, \\\"name\\\": \\\"Laura\\\"}, {\\\"id\\\": 4, \\\"name\\\": \\\"Mike\\\"}]}') == ['Dave', 'Laura']\", \"assert fi... | {
"split": "train",
"index": 77257,
"acecode_id": "evol_31355",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function to generate license types for a software product management system. The function `create_license_types` takes in a list of products and an optional count parameter. It creates a specified number of license types for each product an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_license_types(['ProductA'], 2) == ['ProductA_License_1', 'ProductA_License_2']\", \"assert create_license_types(['ProductB'], 3) == ['ProductB_License_1', 'ProductB_License_2', 'ProductB_License_3']\", \"assert create_license_types(['ProductC'], 1) ==... | {
"split": "train",
"index": 77258,
"acecode_id": "oss_18160",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, each representing a command response from a device in the format 'at+recv=index,signal_strength,data_length,data'. Implement a function that takes this list of command responses and returns a list of strings where each string is the command resp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_highest_signal_events(['at+recv=0,-68,7,0', 'at+recv=1,-65,6,2:4865']) == ['at+recv=1,-65,6,2:4865']\", \"assert get_highest_signal_events(['at+recv=0,-70,5,0', 'at+recv=1,-65,6,2:4865', 'at+recv=2,-68,4,1:1234']) == ['at+recv=1,-65,6,2:4865']\", \"asser... | {
"split": "train",
"index": 77259,
"acecode_id": "bigcode_python_fns_29028",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function named `binary_search` that takes a sorted list of integers `arr` and an integer `x` as input and returns the index of `x` in `arr` if it is present. If `x` is not present in the list, return -1. You may assume that the list is sorted in ascending order. The... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binary_search([1, 2, 3, 4, 5], 3) == 2\", \"assert binary_search([1, 2, 3, 4, 5], 1) == 0\", \"assert binary_search([1, 2, 3, 4, 5], 5) == 4\", \"assert binary_search([1, 2, 3, 4, 5], 6) == -1\", \"assert binary_search([], 3) == -1\", \"assert binary_search(... | {
"split": "train",
"index": 77260,
"acecode_id": "evol_10878",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary that represents a collection of genomic variant counts for different categories. Your task is to implement a function `count_pass_multiallelic_sites(mqc: Dict[str, Any]) -> Tuple[str, Union[int, str]]` that retrieves the count of 'pass_multiallelic_si... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_pass_multiallelic_sites({'multiqc_npm_count_variants': {'key1': {'pass_multiallelic_sites': 10}}}) == ('count_pass_multiallelic_sites', 10)\", \"assert count_pass_multiallelic_sites({'multiqc_npm_count_variants': {'key2': {'pass_multiallelic_sites': 0}... | {
"split": "train",
"index": 77261,
"acecode_id": "bigcode_python_fns_44658",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a string s, return the length of the longest substring without repeating characters. A substring is a contiguous sequence of characters within the string. For example, if the input string is 'abcabcbb', the longest substring without repeating characters is 'abc', which ha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lengthOfLongestSubstring('abcabcbb') == 3\", \"assert lengthOfLongestSubstring('bbbbb') == 1\", \"assert lengthOfLongestSubstring('pwwkew') == 3\", \"assert lengthOfLongestSubstring('') == 0\", \"assert lengthOfLongestSubstring('a') == 1\", \"assert lengthOf... | {
"split": "train",
"index": 77262,
"acecode_id": "bigcode_python_fns_3429",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of URLs, your task is to extract all unique news article links from these URLs. Each URL will contain HTML content, and you need to find links that contain the substring '/news/'. The input will be a list of strings, each representing the HTML content of a webpage.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_news_links(['<a href=\\\"/news/article1\\\">Article 1</a>', '<a href=\\\"/news/article2\\\">Article 2</a>', '<a href=\\\"/other/link\\\">Other Link</a>', '<a href=\\\"/news/article1\\\">Article 1</a>']) == ['https://www.bloomberg.com/news/article1', ... | {
"split": "train",
"index": 77263,
"acecode_id": "bigcode_python_fns_5203",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes two lists of integers, `list_1` and `list_2`, and returns a tuple containing two lists. The first list should include all unique elements from `list_1` that are not present in `list_2`, sorted in ascending order. The second list should contain th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_elements([1, 2, 3, 4], [5, 6, 7]) == ([1, 2, 3, 4], [1, 1, 1, 1])\", \"assert count_elements([1, 1, 1, 1], [1]) == ([], [])\", \"assert count_elements([], [1, 2, 3]) == ([], [])\", \"assert count_elements([10, 20, 30], [15, 25]) == ([10, 20, 30], [1, 1... | {
"split": "train",
"index": 77264,
"acecode_id": "evol_20086",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that retrieves specific columns from a list of dictionaries, where each dictionary represents a row of data. The function should take two parameters: a list of dictionaries (`data`) and a list of strings (`columns`). The function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fetch_columns([{'name': 'Alice', 'age': 30}, {'name': 'Bob', 'age': 25}], ['name']) == [{'name': 'Alice'}, {'name': 'Bob'}]\", \"assert fetch_columns([{'name': 'Alice', 'age': 30}, {'name': 'Bob', 'age': 25}], ['age']) == [{'age': 30}, {'age': 25}]\", \"asse... | {
"split": "train",
"index": 77265,
"acecode_id": "oss_16300",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes in a user identifier and an event identifier, and returns the template to be used for rendering the event details along with the argument data required for that rendering. The function should check if the user is an analyst (i.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_event_details('event123', 'analyst_john') == ('event_analyst_detail.html', {'event_id': 'event123', 'analyst': 'analyst_john'})\", \"assert get_event_details('event456', 'user_mike') == ('event_default_detail.html', {'event_id': 'event456', 'analyst': 'u... | {
"split": "train",
"index": 77266,
"acecode_id": "bigcode_python_fns_7016",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a user deletion from a database in a web application. The function should take a user ID as input and return a message indicating whether the deletion was successful or if the user was not found. The function should als... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delete_user(1) == 'User deleted successfully.'\", \"assert delete_user(0) == 'Invalid user ID.'\", \"assert delete_user(-1) == 'Invalid user ID.'\", \"assert delete_user(2) == 'User deleted successfully.'\", \"assert delete_user(3) == 'User deleted successfu... | {
"split": "train",
"index": 77267,
"acecode_id": "evol_4350",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a list of arithmetic operations represented as integers or their string equivalents, implement a function `operation_result(operations: List[Union[int, str]], case_insensitive: bool = False) -> bool` that determines if the cumulative result ever drops below zero. If the c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert operation_result([1, 2, 3, -6]) == False\", \"assert operation_result([1, 2, '-4', 5]) == True\", \"assert operation_result([1, '2', -3], True) == True\", \"assert operation_result([-1, 1, 0]) == True\", \"assert operation_result([1, '0', -1], True) == True\... | {
"split": "train",
"index": 77268,
"acecode_id": "evol_28289",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function `get_primes_sequence(n)` that generates a list of the first `n` prime numbers. The function should return an empty list if `n` is less than or equal to 0. The primes should be ordered from the smallest to the largest.\nPlease reason step by step, then write... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_primes_sequence(0) == []\", \"assert get_primes_sequence(1) == [2]\", \"assert get_primes_sequence(2) == [2, 3]\", \"assert get_primes_sequence(3) == [2, 3, 5]\", \"assert get_primes_sequence(4) == [2, 3, 5, 7]\", \"assert get_primes_sequence(5) == [2, 3... | {
"split": "train",
"index": 77269,
"acecode_id": "evol_23576",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the removal of a configuration entry from a device. The function should take two string parameters: 'device_id' and 'config_entry_id'. The function should return True if the removal is successful and False otherwise. The re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_config_entry('dev_123', 'config_456') == True\", \"assert remove_config_entry('dev_123', 'entry_456') == False\", \"assert remove_config_entry('device_001', 'config_456') == False\", \"assert remove_config_entry('device_001', 'entry_456') == False\", ... | {
"split": "train",
"index": 77270,
"acecode_id": "bigcode_python_fns_18424",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with extracting the title of a book from a given review section string. The review section is formatted as a string, and the title is enclosed within specific markers. Your goal is to implement a function that extracts the title from the review section and handle... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_book_title('This is a review with a title <<Effective Python>> in it.') == 'Effective Python'\", \"assert extract_book_title('No title here.') == 'Error: No valid title found.'\", \"assert extract_book_title('Another review with no title markers.') =... | {
"split": "train",
"index": 77271,
"acecode_id": "oss_37297",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a dictionary representing HTTP request headers. The function should take in this dictionary and return a new dictionary representing HTTP response headers based on certain rules. The input dictionary contains various client... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_headers({'device-memory': '4', 'dpr': '2', 'viewport-width': '1920'}) == {'device-memory-received': '4', 'dpr-received': '2', 'viewport-width-received': '1920'}\", \"assert process_headers({'sec-ch-viewport-height': '1080', 'rtt': '100', 'downlink': ... | {
"split": "train",
"index": 77272,
"acecode_id": "bigcode_python_fns_13013",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with transforming a structure consisting of atoms in a specific space group to another space group by selectively removing atoms based on their positions. Write a function `transform_spacegroup(atoms, spgroup_a, spgroup_b, target_b_contribution)` that takes the f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_spacegroup([(0.5, 0.5, 0.5), (0.5, 0.0, 0.0), (0.0, 0.5, 0.0)], 'Im-3m', 'Pm-3m', 0.33) == [(0.5, 0.5, 0.5), (0.5, 0.0, 0.0)]\", \"assert transform_spacegroup([(0.0, 0.0, 0.0), (0.5, 0.5, 0.5)], 'Im-3m', 'Pm-3m', 0.0) == [(0.5, 0.5, 0.5)]\", \"asse... | {
"split": "train",
"index": 77273,
"acecode_id": "bigcode_python_fns_14155",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that takes a list of integers and returns the sum of all even integers in that list. The function should only implement the summation of even numbers and ignore any odd integers. For example, given the input list [1, 2, 3, 4, 5], the funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([10, 15, 20, 25]) == 30\", \"assert sum_of_evens([1, 3, 5, 7]) == 0\", \"assert sum_of_evens([2, 4, 6, 8]) == 20\", \"assert sum_of_evens([]) == 0\", \"assert sum_of_evens([0]) == 0\", \"assert sum_... | {
"split": "train",
"index": 77274,
"acecode_id": "bigcode_python_fns_33344",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two sentences, write a function that returns a list of distinct lexemes that are present in either of the sentences but not in both. The lexemes should be case insensitive and should not be repeated in the output list. The output list should maintain the order of the firs... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compare_sentences('The blue whale sprints towards the horizon', 'The cheetah dashes across the savannah') == ['blue', 'whale', 'sprints', 'towards', 'horizon', 'cheetah', 'dashes', 'across', 'savannah']\", \"assert compare_sentences('A quick brown fox', 'A l... | {
"split": "train",
"index": 77275,
"acecode_id": "evol_26626",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates unique sequential numbers for different categories. The function, `get_number(category, call_count)`, should take a string `category` and an integer `call_count`, which represents how many times the number should be gen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_number('Category1', 3) == [1, 2, 3]\", \"assert get_number('Category1', 2) == [1, 2]\", \"assert get_number('Category2', 2) == [1, 2]\", \"assert get_number('Category3', 1) == [1]\", \"assert get_number('Category2', 3) == [1, 2, 3]\", \"assert get_number... | {
"split": "train",
"index": 77276,
"acecode_id": "oss_8225",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that replaces all occurrences of spaces, commas, or dots in a given string with a colon. The function should also count the number of replacements made and return this count. The function should be able to handle large strings efficiently without using addition... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_and_count('Hello World') == 1\", \"assert replace_and_count('Hello, World.') == 3\", \"assert replace_and_count('') == 0\", \"assert replace_and_count('A.B.C.D.E.F.G') == 6\", \"assert replace_and_count(' ') == 3\", \"assert replace_and_count('Hell... | {
"split": "train",
"index": 77277,
"acecode_id": "evol_19456",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function called `filter_users(users, search_term, user_role)` that filters a list of users based on a search term and a user role. The `users` parameter is a list of dictionaries where each dictionary represents a user with the following keys:... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_users([{'id': 1, 'name': 'Alice', 'username': 'alice123', 'roles': ['admin']}, {'id': 2, 'name': 'Bob', 'username': 'bob456', 'roles': ['user']}, {'id': 3, 'name': 'Charlie', 'username': 'charlie789', 'roles': ['user', 'admin']}], 'Alice', 'all') == [... | {
"split": "train",
"index": 77278,
"acecode_id": "bigcode_python_fns_2475",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a string that represents a name. Your task is to implement a function that converts the name into a formatted string. The formatted string should be in the form 'Last Name, First Name' where the last name is the part of the name that appears after the last space, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_name('John Doe') == 'Doe, John'\", \"assert format_name('Alice Smith Johnson') == 'Johnson, Alice Smith'\", \"assert format_name('SingleName') == 'SingleName'\", \"assert format_name(' Leading Spaces') == 'Spaces, Leading'\", \"assert format_name('T... | {
"split": "train",
"index": 77279,
"acecode_id": "bigcode_python_fns_30300",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `s`, write a function that identifies and returns the longest 'nice' substring within it. A substring is considered 'nice' if every alphabet letter it contains is represented in both uppercase and lowercase forms. If multiple 'nice' substrings of equal length exi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert(longestNiceSubstring('YazaAay') == 'aAa')\", \"assert(longestNiceSubstring('Bb') == 'Bb')\", \"assert(longestNiceSubstring('c') == '')\", \"assert(longestNiceSubstring('dDzeE') == 'dD')\", \"assert(longestNiceSubstring('aAbB') == 'aAbB')\", \"assert(longestN... | {
"split": "train",
"index": 77280,
"acecode_id": "evol_10322",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a database connection URL as input and returns a formatted connection string suitable for SQLAlchemy usage. The connection URL will be a string formatted as 'dialect+driver://username:password@host:port/database'. Your function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_connection_string('postgresql+psycopg2://user:pass@localhost:5432/mydb') == 'sqlalchemy://user:pass@localhost:5432/mydb'\", \"assert format_connection_string('mysql+pymysql://user:password@127.0.0.1:3306/testdb') == 'sqlalchemy://user:password@127.0.0... | {
"split": "train",
"index": 77281,
"acecode_id": "bigcode_python_fns_36055",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `sigmoid(z: float) -> float` that calculates the sigmoid of a given number `z`. The sigmoid function is defined as 1 / (1 + e^(-z)). However, if the input `z` is greater than 100, the function should return 0. Your task is to compute the sigmoid value based... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sigmoid(0) == 0.5\", \"assert sigmoid(1) == 0.7310585786300049\", \"assert sigmoid(-1) == 0.2689414213699951\", \"assert sigmoid(101) == 0\", \"assert sigmoid(10) == 0.9999546021312976\", \"assert sigmoid(5) == 0.9933071490757153\", \"assert sigmoid(-5) == 0... | {
"split": "train",
"index": 77282,
"acecode_id": "bigcode_python_fns_9992",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple game rendering logic. Your goal is to implement a function that simulates the rendering process of various game elements on the screen. The game includes a background, nodes, pellets, a Pacman character, ghosts, and life icons representing ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert render_game_elements(True, [(1, 2), (3, 4)], [(5, 6)], (100, 100), [(200, 200)], 3) == 'Rendered background, Nodes at [(1, 2), (3, 4)], Pellets at [(5, 6)], Pacman at (100, 100), Ghosts at [(200, 200)], Lives: 3'\", \"assert render_game_elements(True, [(0, 0... | {
"split": "train",
"index": 77283,
"acecode_id": "oss_20656",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing class names in an ontology. Your task is to implement a function that retrieves a class name from the list based on a provided label. If exactly one class matches the label, return that class name. If no class matches, return None. I... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_class_by_label(['Animal', 'Plant', 'Mineral'], 'Animal') == 'Animal'\", \"assert get_class_by_label(['Animal', 'Plant', 'Mineral'], 'Mineral') == 'Mineral'\", \"assert get_class_by_label(['Animal', 'Plant', 'Mineral'], 'Plant') == 'Plant'\", \"assert get... | {
"split": "train",
"index": 77284,
"acecode_id": "bigcode_python_fns_1025",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that creates a dictionary of tempo values. The dictionary should have keys formatted as 'tempo_i' where 'i' ranges from 1 to 40, and the corresponding values should be integers representing tempo values starting from 10 and increasing... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_tempo_dictionary() == {'tempo_1': 10, 'tempo_2': 15}\", \"assert create_tempo_dictionary() == {'tempo_1': 10, 'tempo_2': 15}\", \"assert create_tempo_dictionary() == {'tempo_1': 10, 'tempo_2': 15}\", \"assert create_tempo_dictionary() == {'tempo_1': 1... | {
"split": "train",
"index": 77285,
"acecode_id": "oss_23783",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a simple Table of Contents (TOC) for a legal document. Your task is to implement a function that can handle the following operations on the TOC: adding a section with a unique section ID, label, and sub-label; adding an appendix with a unique sectio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_toc([('add_section', '101-A', 'Introduction', 'Overview'), ('display_toc',)]) == ['101-A: Introduction (Overview)']\", \"assert manage_toc([('add_section', '201-C', 'Main Content', 'Core'), ('add_section', '202-D', 'Conclusion', 'Wrap-up'), ('remove_s... | {
"split": "train",
"index": 77286,
"acecode_id": "oss_32351",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a sorted array of distinct integers and a target value. Implement a function `search` that checks whether the target is present in the array and returns its index. If the target is not found, return -1. You must use a binary search algorithm for your solution. The... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert 4 == search([-1, 0, 3, 5, 9, 12], 9)\", \"assert -1 == search([-1, 0, 3, 5, 9, 12], 2)\", \"assert 0 == search([5], 5)\", \"assert 1 == search([2, 5], 5)\", \"assert -1 == search([1, 3, 5, 7, 9], 2)\", \"assert 2 == search([1, 3, 5, 7, 9], 5)\", \"assert 0 =... | {
"split": "train",
"index": 77287,
"acecode_id": "oss_20780",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing names of people in an address book. Your task is to implement a function that checks if a given name exists in the address book. If the name exists, return 'Found', otherwise return 'Not Found'. Implement the function `check_name_in_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_name_in_address_book(['Alice', 'Bob', 'Charlie'], 'Bob') == 'Found'\", \"assert check_name_in_address_book(['Alice', 'Bob', 'Charlie'], 'Dave') == 'Not Found'\", \"assert check_name_in_address_book(['John', 'Doe'], 'John') == 'Found'\", \"assert check_... | {
"split": "train",
"index": 77288,
"acecode_id": "bigcode_python_fns_37478",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that determines if a given object is either None or empty. An object is considered empty if it has no elements. Your function should handle various types of inputs such as strings, lists, tuples, dictionaries, and sets. Implement a functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_none_or_empty(None) == True\", \"assert is_none_or_empty('') == True\", \"assert is_none_or_empty([]) == True\", \"assert is_none_or_empty(()) == True\", \"assert is_none_or_empty({}) == True\", \"assert is_none_or_empty(set()) == True\", \"assert is_none... | {
"split": "train",
"index": 77289,
"acecode_id": "bigcode_python_fns_47122",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `transform_list` that transforms the list by applying a specific transformation to each element. The transformation is defined as follows: for each element `x` in the list, if `x` is even, it should be multiplied by 2; if `x` is odd, i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_list([1, 2, 3, 4]) == [3, 4, 9, 8]\", \"assert transform_list([0, 5, 10, 11]) == [0, 15, 20, 33]\", \"assert transform_list([-1, -2, -3, -4]) == [-3, -4, -9, -8]\", \"assert transform_list([]) == []\", \"assert transform_list([2, 4, 6]) == [4, 8, 1... | {
"split": "train",
"index": 77290,
"acecode_id": "bigcode_python_fns_32102",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `generate_random_integers` that takes three parameters: `min_int`, `max_int`, and `n`. The function should generate a list of `n` random integers, where each integer is inclusively between `min_int` and `max_int`. If `n` is less than or equal to 0, t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_random_integers(1, 10, 0) == []\", \"assert len(generate_random_integers(1, 10, 10)) == 10\", \"assert all(1 <= i <= 10 for i in generate_random_integers(1, 10, 5))\", \"assert generate_random_integers(0, 0, 1) == [0]\", \"assert generate_random_int... | {
"split": "train",
"index": 77291,
"acecode_id": "evol_31116",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with analyzing operations performed on a text file. Your goal is to calculate the total number of insertions, deletions, and substitutions made to the file based on three dictionaries: one for insertions, one for deletions, and one for substitutions. Write a func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_operations_summary({'a': 2, 'b': 3}, {'c': 1}, {'d': 4}) == {'total_insertions': 5, 'total_deletions': 1, 'total_substitutions': 4}\", \"assert calculate_operations_summary({}, {}, {}) == {'total_insertions': 0, 'total_deletions': 0, 'total_substit... | {
"split": "train",
"index": 77292,
"acecode_id": "oss_15081",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a datetime object, convert it to a signed 64-bit integer representing the number of seconds since 0 hours, 0 minutes, 0 seconds, on the 1st of January, 1970, in UTC. The datetime object must be timezone aware. If the datetime object is not in UTC, raise an exception. Impl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_seconds(datetime(2020, 1, 1, 0, 0, 0, tzinfo=timezone.utc), False) == 1577836800\", \"assert convert_to_seconds(datetime(2020, 1, 1, 0, 0, 0, tzinfo=timezone.utc), True) == 1577836800\", \"assert convert_to_seconds(datetime(1970, 1, 1, 0, 0, 0, tz... | {
"split": "train",
"index": 77293,
"acecode_id": "bigcode_python_fns_25279",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to control a robotic vehicle's motors based on received velocity and omega values. The function, `process_twist`, will take two parameters: `velocity` (an integer representing the forward speed of the vehicle) and `omega` (an integer ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_twist(10, 2) == (8, 12)\", \"assert process_twist(0, 0) == (0, 0)\", \"assert process_twist(-5, 3) == (-8, -2)\", \"assert process_twist(20, 5) == (15, 25)\", \"assert process_twist(15, -3) == (18, 12)\", \"assert process_twist(7, 7) == (0, 14)\", \"... | {
"split": "train",
"index": 77294,
"acecode_id": "oss_306",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a generator function `gen_cubes(n)` that yields the cube of numbers starting from 0 up to n-1. The function should take an integer n as input and yield each cube value sequentially.\nPlease reason step by step, then write a self-contained Python solution. Give your fi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert list(gen_cubes(0)) == []\", \"assert list(gen_cubes(1)) == [0]\", \"assert list(gen_cubes(2)) == [0, 1]\", \"assert list(gen_cubes(3)) == [0, 1, 8]\", \"assert list(gen_cubes(4)) == [0, 1, 8, 27]\", \"assert list(gen_cubes(5)) == [0, 1, 8, 27, 64]\", \"asser... | {
"split": "train",
"index": 77295,
"acecode_id": "evol_10352",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a datetime object in Python, implement a function that converts it into a string format defined by ECMA-262. The output format should be 'YYYY-MM-DDTHH:MM:SS.SSSZ', where 'YYYY' is the year, 'MM' is the month, 'DD' is the day, 'HH' is the hour, 'MM' is the minute, 'SS' is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert to_ecma_datetime_string(datetime(2023, 10, 1, 12, 30, 45, 123456)) == '2023-10-01T12:30:45.123Z'\", \"assert to_ecma_datetime_string(datetime(2023, 1, 1, 0, 0, 0, 0)) == '2023-01-01T00:00:00.000Z'\", \"assert to_ecma_datetime_string(datetime(2022, 7, 4, 15, ... | {
"split": "train",
"index": 77296,
"acecode_id": "bigcode_python_fns_15753",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of integers and an integer value, and returns the number of times the value appears in the list.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block."
}
] | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_occurrences([1, 2, 3, 4, 1, 2, 1], 1) == 3\", \"assert count_occurrences([5, 6, 7, 8, 5, 5], 5) == 3\", \"assert count_occurrences([9, 0, 9, 0, 9], 9) == 3\", \"assert count_occurrences([3, 1, 4, 1, 5, 1], 1) == 3\", \"assert count_occurrences([], 1) =... | {
"split": "train",
"index": 77297,
"acecode_id": "evol_14045",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a text matching function that compares two strings based on a specified matcher type. Your function should take a matcher type and two strings (or a set of strings) as input and return a boolean value indicating whether the comparison satisfies ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert match_strings('EQUAL_TO_SET', 'apple', {'banana', 'apple', 'orange'}) == True\", \"assert match_strings('PART_OF_SET', 'apple', {'banana', 'apple', 'orange'}) == True\", \"assert match_strings('CONTAINS_ALL_OF_SET', 'applebananaorange', {'banana', 'apple', '... | {
"split": "train",
"index": 77298,
"acecode_id": "oss_17260",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design and implement an efficient algorithm to determine if it is possible to place N rooks on an N x N chessboard such that no two rooks attack each other, considering that rooks can attack horizontally, vertically, and diagonally. You need to implement a function `can_place_r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_place_rooks(1) == True\", \"assert can_place_rooks(2) == False\", \"assert can_place_rooks(3) == False\", \"assert can_place_rooks(4) == False\", \"assert can_place_rooks(5) == False\", \"assert can_place_rooks(6) == False\", \"assert can_place_rooks(7) ... | {
"split": "train",
"index": 77299,
"acecode_id": "evol_20871",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.