data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "You are given a dictionary where the keys are image filter names and the values are the filter parameters. Your task is to implement a function that takes this dictionary as input and returns a list of serialized filter parameters in the format 'filter_name:filter_parameter'. W... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert serialize_filters({'blur': 1, 'sharpen': 2, 'contrast': 3}) == ['blur:1', 'sharpen:2', 'contrast:3']\", \"assert serialize_filters({'edge_detect': 5, 'sepia': 0.5}) == ['edge_detect:5', 'sepia:0.5']\", \"assert serialize_filters({'invert': True, 'grayscale':... | {
"split": "train",
"index": 73500,
"acecode_id": "bigcode_python_fns_31819",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that determines whether a given numerical score is passing or failing based on a specific threshold. The passing score is defined as 60 or above, while any score below 60 is considered failing. You need to define a function `is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_passing(75) == True\", \"assert is_passing(60) == True\", \"assert is_passing(59) == False\", \"assert is_passing(85) == True\", \"assert is_passing(90) == True\", \"assert is_passing(45) == False\", \"assert is_passing(100) == True\", \"assert is_passing... | {
"split": "train",
"index": 73501,
"acecode_id": "oss_12810",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `read_data(memory_address: str) -> Optional[str]` that simulates reading data from a CPU's memory system. The function should first check a cache for the requested memory address. If the data is not found in the cache, it should check the main memory. If it... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert read_data(\\\"0x01\\\") == \\\"data1\\\"\", \"assert read_data(\\\"0x02\\\") == \\\"data2\\\"\", \"assert read_data(\\\"0x03\\\") == \\\"data3\\\"\", \"assert read_data(\\\"0x04\\\") == \\\"data4\\\"\", \"assert read_data(\\\"0x05\\\") == \\\"data5\\\"\", \"... | {
"split": "train",
"index": 73502,
"acecode_id": "evol_21196",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, write a function that returns the second largest number in the array. If the array has fewer than two distinct numbers, return None. The function should be named `second_largest`. The input will be a list of integers and the output should be an integ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert second_largest([3, 5, 1, 2, 4]) == 4\", \"assert second_largest([1]) == None\", \"assert second_largest([2, 2, 2]) == None\", \"assert second_largest([10, 20, 30, 40, 50]) == 40\", \"assert second_largest([-1, -2, -3, -4]) == -2\", \"assert second_largest([5... | {
"split": "train",
"index": 73503,
"acecode_id": "bigcode_python_fns_2463",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an email address as a string, implement a function that extracts and returns the domain name. The function should validate the email format, ensuring it conforms to standard email conventions, including support for sub-domains and top-level domains like '.co.uk'. If the e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_domain('john.doe@example.co.uk') == 'example.co.uk'\", \"assert extract_domain('user.name@subdomain.example.com') == 'subdomain.example.com'\", \"assert extract_domain('user@domain.org') == 'domain.org'\", \"assert extract_domain('name@domain.co.uk')... | {
"split": "train",
"index": 73504,
"acecode_id": "evol_2592",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating the behavior of a simple robot that can drive forward at a specified speed for a given duration. Write a function `drive_robot(speed: int, duration: int) -> str` that drives the robot forward. The robot should return a message indicating how far i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert drive_robot(10, 5) == 'The robot drove 50 meters.'\", \"assert drive_robot(0, 10) == 'The robot drove 0 meters.'\", \"assert drive_robot(15, 2) == 'The robot drove 30 meters.'\", \"assert drive_robot(7, 3) == 'The robot drove 21 meters.'\", \"assert drive_ro... | {
"split": "train",
"index": 73505,
"acecode_id": "oss_8352",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of integers and returns True if the list contains at least one prime number, and False otherwise.\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 contains_prime([1, 6, 10, 15, 17]) == True\", \"assert contains_prime([4, 6, 8, 10]) == False\", \"assert contains_prime([2, 3, 5, 7]) == True\", \"assert contains_prime([0, -1, -5]) == False\", \"assert contains_prime([]) == False\", \"assert contains_prime... | {
"split": "train",
"index": 73506,
"acecode_id": "evol_8408",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of pairs of words and their corresponding similarity scores. Write a function `get_similarity_pairs(pairs: List[Tuple[str, str]], scores: List[float]) -> List[Tuple[str, str]]` that returns a list of word pairs whose similarity score is above a given thresh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_similarity_pairs([('cat', 'dog'), ('car', 'bus')], [0.8, 0.5], 0.6) == [('cat', 'dog')]\", \"assert get_similarity_pairs([('apple', 'banana'), ('orange', 'grape')], [0.3, 0.7], 0.5) == [('orange', 'grape')]\", \"assert get_similarity_pairs([('fast', 'qui... | {
"split": "train",
"index": 73507,
"acecode_id": "bigcode_python_fns_23985",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given the root of a balanced binary tree, implement a function that calculates the diameter of the tree. The diameter is defined as the length of the longest path between any two nodes in the tree. You can assume that each node has a value and two children (left and right), whi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert diameter(None) == 0\", \"assert diameter(Node(1)) == 1\", \"assert diameter(Node(1, Node(2))) == 2\", \"assert diameter(Node(1, Node(2), Node(3))) == 3\", \"assert diameter(Node(1, Node(2, Node(4), Node(5)), Node(3))) == 4\", \"assert diameter(Node(1, Node(2... | {
"split": "train",
"index": 73508,
"acecode_id": "evol_13655",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an array of integers `nums`. Your task is to write a function `firstMissingPositive` that finds the smallest positive integer that does not exist in the array. The function should take in the array `nums` and return the smallest missing positive integer. For examp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert firstMissingPositive([3, 4, -1, 1]) == 2\", \"assert firstMissingPositive([1, 2, 0]) == 3\", \"assert firstMissingPositive([-1, -2, -3]) == 1\", \"assert firstMissingPositive([1, 1, 1]) == 2\", \"assert firstMissingPositive([2, 3, 4]) == 1\", \"assert firstM... | {
"split": "train",
"index": 73509,
"acecode_id": "oss_11291",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a configuration dictionary that describes a device automation trigger for a smart home system. Your task is to validate this configuration based on the device's model and the type of trigger specified. The function should check if the device ID exists in a predefi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_device_trigger({'device_id': 'device_1', 'type': 'trigger_1'}) == {'device_id': 'device_1', 'type': 'trigger_1'}\", \"assert validate_device_trigger({'device_id': 'device_2', 'type': 'trigger_3'}) == {'device_id': 'device_2', 'type': 'trigger_3'}\",... | {
"split": "train",
"index": 73510,
"acecode_id": "bigcode_python_fns_41713",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, implement a function that separates the integers into two lists: one for even integers and one for odd integers. The function should return a tuple containing the two lists, where the first list contains all the even integers and the second list cont... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert separate_by_parity([1, 2, 3, 4, 5, 6]) == ([2, 4, 6], [1, 3, 5])\", \"assert separate_by_parity([0, -1, -2, -3]) == ([0, -2], [-1, -3])\", \"assert separate_by_parity([10, 21, 32, 43, 54]) == ([10, 32, 54], [21, 43])\", \"assert separate_by_parity([7, 14, 21... | {
"split": "train",
"index": 73511,
"acecode_id": "evol_9182",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a retry mechanism for a function that simulates an HTTP request. The function `simulate_request` is provided, which takes in arbitrary arguments and keyword arguments. It returns a named tuple containing `status`, `cookies`, `text`, and `json`. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert retry_request(3, 'arg1', key='value').status == 200 or retry_request(3, 'arg1', key='value').status == 404\", \"assert retry_request(5, 'arg3').cookies is not None\", \"assert retry_request(3, 'arg6', key='value').status in [200, 404]\", \"assert retry_reque... | {
"split": "train",
"index": 73512,
"acecode_id": "oss_19551",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the median of a list of positive integers, ignoring any negative numbers. The function should handle lists with an even or odd number of elements without sorting the list. If the list contains no positive integers, return None. The median is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert median([3, 1, 2, 4, 5]) == 3\", \"assert median([-1, -2, -3]) == None\", \"assert median([1, 2, 3, 4]) == 2.5\", \"assert median([5, 3, 2]) == 3\", \"assert median([8, 7, 6, 5]) == 6.5\", \"assert median([10, 20, 30]) == 20\", \"assert median([]) == None\", ... | {
"split": "train",
"index": 73513,
"acecode_id": "evol_9575",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of tuples `L`, where each tuple contains two elements: a string and an integer. Your task is to calculate a value `S` based on the following rules: Initialize two variables `T` and `S` to 0. For each tuple in the list `L`, add the ASCII value of the first c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_S([('b', 2)]) == 98 + 40\", \"assert calculate_S([('c', 3)]) == 99 + 60\", \"assert calculate_S([('d', 4)]) == 100 + 80\", \"assert calculate_S([('e', 5)]) == 101 + 100\", \"assert calculate_S([]) == 0\"]}"
} | {
"split": "train",
"index": 73514,
"acecode_id": "oss_11304",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a service name. Write a function `is_service_running(service_name: str) -> bool` that checks whether the service is running based on the following conditions: 1. If the service name is 'vsftpd', return True, as this service is always consider... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_service_running('vsftpd') == True\", \"assert is_service_running('nginx') == False\", \"assert is_service_running('mysql') == False\", \"assert is_service_running('apache2') == False\", \"assert is_service_running('ftp') == False\", \"assert is_service_ru... | {
"split": "train",
"index": 73515,
"acecode_id": "bigcode_python_fns_45551",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a positive integer n, implement a function that returns a list of its prime factors. The list should contain the prime factors in ascending order and should not include duplicates. For example, the prime factors of 54 are [2, 3].\nPlease reason step by step, then write a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert prime_factors(54) == [2, 3]\", \"assert prime_factors(1) == []\", \"assert prime_factors(2) == [2]\", \"assert prime_factors(3) == [3]\", \"assert prime_factors(4) == [2]\", \"assert prime_factors(5) == [5]\", \"assert prime_factors(6) == [2, 3]\", \"assert ... | {
"split": "train",
"index": 73516,
"acecode_id": "evol_17386",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `upward_trajectory(arr)` that takes a multidimensional array of integers and floating point numbers as input and returns a list of indices representing the dimensions that show a strictly increasing order. A dimension is considered to be strictly increasing... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert upward_trajectory([[2, 3, 5], [1.0, 2.0, 3.0], [3, 2, 1]]) == [0, 1]\", \"assert upward_trajectory([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == [0, 1, 2]\", \"assert upward_trajectory([[5, 4, 3], [1.0, 2.0, 3.0]]) == [1]\", \"assert upward_trajectory([[1, 2, 3], [3... | {
"split": "train",
"index": 73517,
"acecode_id": "evol_28642",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating a multi-layer perceptron (MLP) model for a given input size. Write a function `generate_mlp(input_size: int) -> List[List[int]]` that takes an integer `input_size` and returns a list of layers in the MLP. Each layer should be represented as a list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_mlp(1) == [[0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0]]\", \"assert generate_mlp(2) == [[0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0]]\", \"assert generate_mlp(3) == [[0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0]]\", \"assert generate_mlp(4) == [[0, 0, ... | {
"split": "train",
"index": 73518,
"acecode_id": "bigcode_python_fns_24343",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `get_session_description(session_type)` that takes in a `session_type` parameter and returns a description of the session type. The `session_type` can be one of the following: 'workshop', 'lecture', or 'seminar'. The function should r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_session_description('workshop') == 'Hands-on training session'\", \"assert get_session_description('lecture') == 'Informative presentation session'\", \"assert get_session_description('seminar') == 'Interactive discussion session'\", \"assert get_session... | {
"split": "train",
"index": 73519,
"acecode_id": "oss_29625",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers, `predictions` and `labels`, implement a function that calculates the approximate ROUGE-2 F1 score between them. The ROUGE-2 F1 score is defined as the harmonic mean of recall and precision, where recall is the ratio of the number of overlapping bigr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rouge_2_fscore([1, 2, 3], [1, 2, 3]) == 1.0\", \"assert rouge_2_fscore([1, 2], [3, 4]) == 0.0\", \"assert rouge_2_fscore([5, 6, 7], [5, 5, 6]) == 0.5\", \"assert rouge_2_fscore([1, 2, 3, 4, 5], [2, 3, 4]) == 0.6666666666666666\", \"assert rouge_2_fscore([], ... | {
"split": "train",
"index": 73520,
"acecode_id": "bigcode_python_fns_33465",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a basic authentication mechanism for a client-server application. You need to create a function `authenticate_client(api_key: str, api_secret: str) -> bool` that takes in two parameters: an API key and an API secret. The function should return `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert authenticate_client('valid_api_key', 'valid_secret') == True\", \"assert authenticate_client('valid_api_key', 'valid_secret') == True\", \"assert authenticate_client('valid_api_key', 'valid_secret') == True\", \"assert authenticate_client('valid_api_key', 'v... | {
"split": "train",
"index": 73521,
"acecode_id": "oss_32336",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that takes a list of integers and returns a dictionary containing the following information: the sum of the integers, the average of the integers, and the maximum integer in the list. Your function should be named `list_statistics(... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert list_statistics([1, 2, 3, 4, 5]) == {'sum': 15, 'average': 3.0, 'maximum': 5}\", \"assert list_statistics([-1, -2, -3, -4, -5]) == {'sum': -15, 'average': -3.0, 'maximum': -1}\", \"assert list_statistics([5, 5, 5, 5, 5]) == {'sum': 25, 'average': 5.0, 'maxim... | {
"split": "train",
"index": 73522,
"acecode_id": "oss_18309",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the creation of a project with a specified base type in a project management system. The function should take a string representing the base type and return a string confirming the project has been created with that bas... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_project('R Tidyverse') == 'Project created with base: R Tidyverse'\", \"assert create_project('Python') == 'Project created with base: Python'\", \"assert create_project('Java') == 'Project created with base: Java'\", \"assert create_project('JavaScri... | {
"split": "train",
"index": 73523,
"acecode_id": "bigcode_python_fns_42909",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `draw_rhombus(n: int) -> str` that takes an integer `n` as input and returns a string representation of a rhombus shape composed of asterisk (*) symbols. The rhombus should have a height of `2*n - 1`, where the widest row contains `2*n - 1` asterisks. Each ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert draw_rhombus(1) == '*\\\\n'\", \"assert draw_rhombus(2) == ' *\\\\n***\\\\n *\\\\n'\", \"assert draw_rhombus(3) == ' *\\\\n ***\\\\n*****\\\\n ***\\\\n *\\\\n'\", \"assert draw_rhombus(4) == ' *\\\\n ***\\\\n *****\\\\n*******\\\\n *****\\\\n ***\\\\n ... | {
"split": "train",
"index": 73524,
"acecode_id": "evol_11972",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that returns a new list containing the square of each unique number from the input list. If the input list contains duplicates, those duplicates should be removed first. Additionally, the function should handle any potential except... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert square_unique_list([1, 2, 3, 4]) == [1, 4, 9, 16]\", \"assert square_unique_list([1, 2, 2, 3]) == [1, 4, 9]\", \"assert square_unique_list([0, 0, 0]) == [0]\", \"assert square_unique_list([]) == []\", \"assert square_unique_list([1]) == [1]\", \"assert squar... | {
"split": "train",
"index": 73525,
"acecode_id": "evol_31360",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `find_max_min_difference(arr: List[int]) -> int` that returns the difference between the maximum and minimum integers in the list. If the list is empty, return 0.\nPlease reason step by step, then write a self-contained Python solution... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max_min_difference([1, 2, 3, 4, 5]) == 4\", \"assert find_max_min_difference([-1, -2, -3, -4, -5]) == 4\", \"assert find_max_min_difference([10, 20, 30, 40]) == 30\", \"assert find_max_min_difference([5]) == 0\", \"assert find_max_min_difference([]) == ... | {
"split": "train",
"index": 73526,
"acecode_id": "bigcode_python_fns_46841",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `s` and an integer `bs` representing a block size, write a function `pad_string(s: str, bs: int) -> str` that pads the string `s` with a specific character until its length is a multiple of `bs`. The padding character should be the ASCII character corresponding t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pad_string('hello', 8) == 'hello\\\\x03\\\\x03\\\\x03'\", \"assert pad_string('test', 4) == 'test'\", \"assert pad_string('abc', 2) == 'abc\\\\x01'\", \"assert pad_string('padding', 10) == 'padding\\\\x03\\\\x03\\\\x03'\", \"assert pad_string('xyz', 1) == 'x... | {
"split": "train",
"index": 73527,
"acecode_id": "bigcode_python_fns_37533",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that simulates inserting records into a blockchain at a specified rate. Write a function `insert_records(targetrecordspersecond: int, duration: int) -> int` that takes in two parameters: `targetrecordspersecond`, which is the d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert insert_records(10, 5) == 50\", \"assert insert_records(0, 5) == 0\", \"assert insert_records(5, 10) == 50\", \"assert insert_records(20, 0) == 0\", \"assert insert_records(-5, 5) == 0\", \"assert insert_records(1, 1) == 1\", \"assert insert_records(15, 3) ==... | {
"split": "train",
"index": 73528,
"acecode_id": "oss_16192",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that converts temperature values from one unit to another based on user specifications. The function should take in a list of temperature readings along with a dictionary that specifies the desired unit conversion for each temperature rea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_temperatures([-40, 0, 100], {0: 'Celsius', 1: 'Fahrenheit', 2: 'Kelvin'}) == [-40.0, 32.0, 373.15]\", \"assert convert_temperatures([25, -10, 100], {0: 'Fahrenheit', 1: 'Fahrenheit', 2: 'Kelvin'}) == [77.0, 14.0, 373.15]\", \"assert convert_temperatu... | {
"split": "train",
"index": 73529,
"acecode_id": "bigcode_python_fns_20168",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes two strings as input, representing two versions of a document. Your function should return a list of strings that represent the lines that have changed between the two versions. Each line in the output should only appear if... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_changes('line1\\\\nline2\\\\nline3', 'line1\\\\nline2\\\\nline4') == ['line3', 'line4']\", \"assert get_changes('line1\\\\nline2\\\\nline3', 'line1\\\\nline2\\\\nline3') == []\", \"assert get_changes('line1\\\\nline2', 'line3\\\\nline4') == ['line1', 'li... | {
"split": "train",
"index": 73530,
"acecode_id": "bigcode_python_fns_8652",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a robotic system. Implement a function named `control_robotic_system` that takes three boolean parameters: `start`, `trigger`, and `end`. The function should return a list of messages based on the parameters provided. Specifically: if `start` is T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert control_robotic_system(True, False, False) == ['System Started']\", \"assert control_robotic_system(False, True, False) == ['Next Triggered']\", \"assert control_robotic_system(False, False, True) == ['System Ended']\", \"assert control_robotic_system(True, ... | {
"split": "train",
"index": 73531,
"acecode_id": "oss_7773",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that parses a list of command line arguments and returns a dictionary containing the parsed options. The function should handle the following command line options: '--version' (which should return a predefined version string), '-o' or '--... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_command_line_args(['--version']) == {'version': 'sc-jsonnet 1.0.0', 'output_file': None, 'verbose': False}\", \"assert parse_command_line_args(['-o', 'snap/snapcraft.yaml']) == {'version': None, 'output_file': 'snap/snapcraft.yaml', 'verbose': False}\"... | {
"split": "train",
"index": 73532,
"acecode_id": "bigcode_python_fns_40239",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that sorts a list of books based on their publication dates. Each book is represented as a dictionary containing 'title', 'author', and 'publication_date', where 'publication_date' is a string formatted as 'YYYY-MM-DD'. Your function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_books([{'title': 'Book A', 'author': 'Author A', 'publication_date': '2022-01-01'}, {'title': 'Book B', 'author': 'Author B', 'publication_date': '2021-12-31'}]) == [{'title': 'Book B', 'author': 'Author B', 'publication_date': '2021-12-31'}, {'title': ... | {
"split": "train",
"index": 73533,
"acecode_id": "oss_34820",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function `manage_students` that takes a list of operations as input. Each operation is a tuple where the first element is a string indicating the operation ('add' or 'remove') and the second element is the name of the student. The function should return a list of st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_students([('add', 'Alice'), ('add', 'Bob'), ('remove', 'Alice'), ('add', 'Charlie')]) == ['Bob', 'Charlie']\", \"assert manage_students([('add', 'David'), ('add', 'Eve'), ('remove', 'David'), ('remove', 'Eve')]) == []\", \"assert manage_students([('ad... | {
"split": "train",
"index": 73534,
"acecode_id": "evol_5624",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that manages memory statistics for an agent. The function should be named `memory_statistics` and take four integer parameters: `mem_ceiling`, `mem_used`, `heap_total`, and `heap_used`. The function should return a dictionary containing t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert memory_statistics(1000000, 500000, 800000, 300000) == {'mem_ceiling': 1000000, 'mem_used': 500000, 'heap_total': 800000, 'heap_used': 300000}\", \"assert memory_statistics(2000000, 1500000, 1800000, 1000000) == {'mem_ceiling': 2000000, 'mem_used': 1500000, '... | {
"split": "train",
"index": 73535,
"acecode_id": "oss_8320",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function that computes the product of three integer inputs x, y, and z, and returns the resultant multiplication.\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 multiply(1, 1, 1) == 1\", \"assert multiply(2, 3, 4) == 24\", \"assert multiply(-1, -2, -3) == -6\", \"assert multiply(-1, 2, 3) == -6\", \"assert multiply(0, 5, 10) == 0\", \"assert multiply(7, 2, 4) == 56\", \"assert multiply(10, 10, 10) == 1000\", \"asser... | {
"split": "train",
"index": 73536,
"acecode_id": "evol_1492",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string `spill` representing a spill of parameters and their values. The spill is formatted as follows: the first element is an integer `n_par` representing the number of parameters, followed by `n_par` parameter names, and then `n_par`^2 parameter values. Your t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_spill('2,a,b,1,2,3,4') == True\", \"assert validate_spill('1,x,10') == True\", \"assert validate_spill('3,p,q,r,1,2,3,4,5,6,7,8,9') == True\", \"assert validate_spill('0') == True\", \"assert validate_spill('1,a,1') == True\", \"assert validate_spil... | {
"split": "train",
"index": 73537,
"acecode_id": "oss_20130",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that crops an image represented as a 2D list of pixels based on specified box dimensions. The function should accept the image as a list of lists, a crop box defined by its top-left corner coordinates (left, top) and its dimensions (w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert crop_image([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 1, 1, 2, 2) == [[5, 6], [8, 9]]\", \"assert crop_image([[0, 1, 2], [3, 4, 5], [6, 7, 8]], 0, 0, 3, 3) == [[0, 1, 2], [3, 4, 5], [6, 7, 8]]\", \"assert crop_image([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 0, 0, 2, 2) == ... | {
"split": "train",
"index": 73538,
"acecode_id": "oss_30558",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `sentence`, implement a function `text_filter` that filters out all characters from the string except for Chinese characters, specific punctuation marks (namely: ',', '。', '?', '!', ':'), and digits. The function should return a new string that contains only the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert text_filter('Hello, \\u4e16\\u754c\\uff01 123') == '\\u4e16\\u754c\\uff01123'\", \"assert text_filter('\\u8fd9\\u662f\\u4e00\\u4e2a\\u6d4b\\u8bd5\\u30021234') == '\\u8fd9\\u662f\\u4e00\\u4e2a\\u6d4b\\u8bd5\\u30021234'\", \"assert text_filter('\\u4f60\\u597d\... | {
"split": "train",
"index": 73539,
"acecode_id": "bigcode_python_fns_37298",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates basic banking operations. The function should be able to create accounts, process transactions (deposits and withdrawals), and retrieve account information. Implement a function `bank_operations(operations: List[Tuple[str, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bank_operations([('create_account', '123', 'Alice', 1000)]) == ['Account created successfully for Alice']\", \"assert bank_operations([('create_account', '123', 'Alice', 1000), ('deposit', '123', 500)]) == ['Account created successfully for Alice', 'Deposit ... | {
"split": "train",
"index": 73540,
"acecode_id": "oss_7812",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of cryptographic key types and performs specific operations based on the key type. Your task is to implement the function `process_key_types` that takes a list of key types as input and returns a tuple contain... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_key_types([KeyAgreementCurveType.P384, KeyAgreementCurveType.P384]) == ([KeyAgreementCurveType.P384], {KeyAgreementCurveType.P384})\", \"assert process_key_types([]) == ([], set())\", \"assert process_key_types([KeyAgreementCurveType.P256]) == ([KeyA... | {
"split": "train",
"index": 73541,
"acecode_id": "oss_13990",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates fetching the content of a URL and calculating a hash for it. The function should take a string representing a URL and an optional string representing a hashing algorithm ('sha256' or 'md5'). The function will return a strin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fetch_and_hash('http://testing.com/path/to/resource', 'md5') == 'hash_md5_http://t'\", \"assert fetch_and_hash('http://tiny.com', 'sha256') == 'hash_sha256_tiny.com'\", \"assert fetch_and_hash('http://tiny.com', 'md5') == 'hash_md5_http://t'\", \"assert fetc... | {
"split": "train",
"index": 73542,
"acecode_id": "bigcode_python_fns_20324",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings representing dates in the format 'YYYY-MM-DD', write a function that filters out dates that are earlier than a specified start date. The function should return a list of valid dates in the same format, sorted in ascending order. The start date will also ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_dates(['2023-01-01', '2022-12-31', '2023-01-15'], '2023-01-01') == ['2023-01-01', '2023-01-15']\", \"assert filter_dates(['2023-03-01', '2022-05-10', '2023-01-25'], '2022-12-31') == ['2023-01-25', '2023-03-01']\", \"assert filter_dates(['2021-05-05', ... | {
"split": "train",
"index": 73543,
"acecode_id": "bigcode_python_fns_15789",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a grid represented by its height and width, and a starting position of an agent defined by its x and y coordinates. Implement a function that updates the agent's position by moving it one step to the right (increasing x by 1) and one step down (increasing y by 1).... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert change_agent_position(5, 5, 0, 0) == (1, 1)\", \"assert change_agent_position(5, 5, 4, 4) == (0, 0)\", \"assert change_agent_position(5, 5, 2, 2) == (3, 3)\", \"assert change_agent_position(3, 3, 2, 1) == (0, 2)\", \"assert change_agent_position(10, 10, 9, 9... | {
"split": "train",
"index": 73544,
"acecode_id": "bigcode_python_fns_21876",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of equal length, `a` and `b`, representing pixel values of two images, and a blending factor `alpha` (0 <= alpha <= 1), implement a function `blend_images(a: List[float], b: List[float], alpha: float) -> List[float]` that returns a new list representing the blen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert blend_images([0.0, 0.5, 1.0], [1.0, 0.5, 0.0], 0.5) == [0.5, 0.5, 0.5]\", \"assert blend_images([0.0, 0.0, 0.0], [1.0, 1.0, 1.0], 0.0) == [1.0, 1.0, 1.0]\", \"assert blend_images([1.0, 1.0, 1.0], [0.0, 0.0, 0.0], 1.0) == [1.0, 1.0, 1.0]\", \"assert blend_ima... | {
"split": "train",
"index": 73545,
"acecode_id": "bigcode_python_fns_27946",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple function that acts as a basic calculator. The function should take four arguments: two numbers and a string representing the operation to perform. The operations can be 'add', 'subtract', 'multiply', or 'divide'. The function should return ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert basic_calculator(2, 3, 'add') == 5\", \"assert basic_calculator(5, 3, 'subtract') == 2\", \"assert basic_calculator(2, 3, 'multiply') == 6\", \"assert basic_calculator(6, 3, 'divide') == 2\", \"assert basic_calculator(6, 0, 'divide') == 'Error: Division by z... | {
"split": "train",
"index": 73546,
"acecode_id": "oss_5195",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes in a community ID and a community name, and returns the number of pending records associated with that community. The pending records are defined as those records with a status of 'P'. Your function should simulate this behavio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_pending_records('1', 'Community A') == 2\", \"assert count_pending_records('2', 'Community B') == 1\", \"assert count_pending_records('8', 'Community H') == 0\", \"assert count_pending_records('4', 'Community C') == 0\", \"assert count_pending_records(... | {
"split": "train",
"index": 73547,
"acecode_id": "bigcode_python_fns_9125",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing ticket information for a train journey. Each ticket includes fields represented by key-value pairs, where the key is the field name and the value is a list of possible positions for that field. Your personal ticket information is represented as a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_departure_product({'departure_location': [1], 'departure_station': [0]}, [7, 1]) == 7\", \"assert calculate_departure_product({'departure_time': [0]}, [5]) == 5\", \"assert calculate_departure_product({'class': [0], 'departure_platform': [1]}, [4, ... | {
"split": "train",
"index": 73548,
"acecode_id": "oss_14374",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a Python function that takes a list of non-negative integers and returns a tuple containing two lists. The first list should consist of the cubes of each element from the input list, and the second list should contain the corresponding Fibonacci numbers for each eleme... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert square_and_fibonacci([0]) == ([0], [0])\", \"assert square_and_fibonacci([1]) == ([1], [1])\", \"assert square_and_fibonacci([2]) == ([8], [1])\", \"assert square_and_fibonacci([3]) == ([27], [2])\", \"assert square_and_fibonacci([4]) == ([64], [3])\", \"ass... | {
"split": "train",
"index": 73549,
"acecode_id": "evol_28121",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a Python function that calculates the recurrence rate of a specific word (lexeme) in a list of strings. The recurrence rate is defined as the total count of the lexeme divided by the total number of words in all strings combined. The function should take a string `lexem... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lexeme_recurrence_rate('the', ['the the the', 'the']) == 1.0\", \"assert lexeme_recurrence_rate('a', ['']) == 0.0\", \"assert lexeme_recurrence_rate('notfound', ['hello world', 'this is a test']) == 0.0\", \"assert lexeme_recurrence_rate('hello', ['hello hel... | {
"split": "train",
"index": 73550,
"acecode_id": "evol_14053",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a string of text, implement a function `process_string(s)` that returns a tuple containing two elements: the total number of words in the string and a boolean indicating whether any anagrams exist within those words. An anagram is defined as a word that can be formed by r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_string('This is a string of text.') == (6, False)\", \"assert process_string('Listen silent') == (2, True)\", \"assert process_string('Hello world') == (2, False)\", \"assert process_string('Triangle integral') == (2, True)\", \"assert process_string... | {
"split": "train",
"index": 73551,
"acecode_id": "evol_18876",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of integers and returns a new list containing the same integers sorted in ascending order. The input list may contain duplicate values. Write a function called `sort_numbers` that accepts a list of integers as its parameter and returns the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_numbers([10, 7, 15, 1]) == [1, 7, 10, 15]\", \"assert sort_numbers([5, 3, 8, 5, 2]) == [2, 3, 5, 5, 8]\", \"assert sort_numbers([-1, -3, 0, 2, 1]) == [-3, -1, 0, 1, 2]\", \"assert sort_numbers([0]) == [0]\", \"assert sort_numbers([]) == []\", \"assert s... | {
"split": "train",
"index": 73552,
"acecode_id": "evol_29012",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of genes and a dictionary that maps each gene to a range defined by its start and end positions on a chromosome. Your task is to implement a function `get_gene_ranges(genes: List[str], gene_definitions: Dict[str, Tuple[str, Interval]]) -> Dict[str, Tuple[st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_gene_ranges(['geneA', 'geneB'], {'geneA': ('chr1', (10, 20)), 'geneB': ('chr2', (30, 40)), 'geneC': ('chr1', (50, 60))}) == {'geneA': ('chr1', (10, 20)), 'geneB': ('chr2', (30, 40))}\", \"assert get_gene_ranges(['geneX'], {'geneY': ('chr1', (5, 15))}) ==... | {
"split": "train",
"index": 73553,
"acecode_id": "bigcode_python_fns_29903",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that filters a list of numeric values based on specified conditions. The function should filter the list to include only the values that fall within a given range. Specifically, you are given a list of numbers and a range defined by a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_values([1.0, 2.5, -3.0, 4.5, 5.0], -1.0, 5.0) == [1.0, 2.5, 4.5, 5.0]\", \"assert filter_values([10.0, 20.0, 30.0, 40.0], 15.0, 35.0) == [20.0, 30.0]\", \"assert filter_values([-10.0, -5.0, 0.0, 5.0, 10.0], -5.0, 5.0) == [-5.0, 0.0, 5.0]\", \"assert f... | {
"split": "train",
"index": 73554,
"acecode_id": "oss_6586",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a simple banking operation. Write a function `bank_operations` that takes a list of operations, where each operation is a tuple consisting of an operation type ('deposit' or 'withdraw') and an amount. The function should return the final balance a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bank_operations([('deposit', 100), ('withdraw', 30), ('deposit', 50), ('withdraw', 200)]) == (120, 3)\", \"assert bank_operations([('withdraw', 100)]) == (0, 0)\", \"assert bank_operations([]) == (0, 0)\", \"assert bank_operations([('deposit', 50), ('withdra... | {
"split": "train",
"index": 73555,
"acecode_id": "oss_10405",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a list of numbers that includes negative numbers, decimals, and duplicates, implement a function that sorts the list in ascending order and returns the index of a specified target number in the sorted list. The function should take two parameters: a list of numbers `num_l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_and_index([3, -2, 7, 9, 1, 3.5, -2, -0.5], 3.5) == ([-2, -2, -0.5, 1, 3, 3.5, 7, 9], 5)\", \"assert sort_and_index([5, 3, 1, 2, 4], 1) == ([1, 2, 3, 4, 5], 0)\", \"assert sort_and_index([-1, -3, -2, 0, 2, 1], 0) == ([-3, -2, -1, 0, 1, 2], 3)\", \"assert... | {
"split": "train",
"index": 73556,
"acecode_id": "evol_34917",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_vault(name: str) -> str` that simulates the creation of a vault in a storage service. The function should take a string `name` representing the name of the vault and return a message indicating whether the vault was created successfully or if the va... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_vault('my-sample-vault') == 'Vault created: my-sample-vault'\", \"assert create_vault('') == 'Invalid vault name.'\", \"assert create_vault('a' * 256) == 'Invalid vault name.'\", \"assert create_vault('valid_vault_name') == 'Vault created: valid_vault... | {
"split": "train",
"index": 73557,
"acecode_id": "evol_20037",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `sum_of_evens(nums)` that returns the sum of all even integers in the provided list. If there are no even integers, the function should return 0. The input list can contain both positive and negative integers. Ensure that the funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_evens([]) == 0\", \"assert sum_of_evens([1, 3, 5]) == 0\", \"assert sum_of_evens([2, 4, 6]) == 12\", \"assert sum_of_evens([-2, -4, -6]) == -12\", \"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([-1, -2, -3, -4]) == -6\", \"assert... | {
"split": "train",
"index": 73558,
"acecode_id": "evol_32946",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function to find the kth Fibonacci number from a predefined array of Fibonacci numbers. The function should take an integer k as input and return the k-th Fibonacci number from the array. If k is less than 1 or greater than the length of the array, return 'invalid k... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_kth_fibonacci([1, 1, 2, 3, 5, 8, 13, 21, 34, 55], 1) == 1\", \"assert find_kth_fibonacci([1, 1, 2, 3, 5, 8, 13, 21, 34, 55], 2) == 1\", \"assert find_kth_fibonacci([1, 1, 2, 3, 5, 8, 13, 21, 34, 55], 3) == 2\", \"assert find_kth_fibonacci([1, 1, 2, 3, 5... | {
"split": "train",
"index": 73559,
"acecode_id": "evol_35602",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a version comparison tool. Your job is to implement a function that compares two version strings and determines which one is greater. The version strings follow the standard semantic versioning format, which consists of three non-negative integers s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compare_versions('1.0.0', '1.0.0') == 0\", \"assert compare_versions('1.0.1', '1.0.0') == 1\", \"assert compare_versions('1.0.0', '1.0.1') == -1\", \"assert compare_versions('2.0.0', '1.9.9') == 1\", \"assert compare_versions('1.2.3', '1.2.3') == 0\", \"asse... | {
"split": "train",
"index": 73560,
"acecode_id": "oss_28417",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a simple web crawling process. Your program should contain a function named `simulate_crawl` that takes one argument: a list of URLs (strings) to crawl. The function should return a list of the URLs that were successfully 'crawled', which means th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_crawl(['http://example.com', 'http://openai.com', '']) == ['http://example.com', 'http://openai.com']\", \"assert simulate_crawl(['', '', '']) == []\", \"assert simulate_crawl(['http://test.com']) == ['http://test.com']\", \"assert simulate_crawl([]... | {
"split": "train",
"index": 73561,
"acecode_id": "oss_1468",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a non-negative integer n, write a Python function called `fibonacci` that returns the nth Fibonacci number. The Fibonacci sequence is defined as follows: F(0) = 0, F(1) = 1, and F(n) = F(n-1) + F(n-2) for n > 1. Your function should handle values of n up to 30 efficiently... | 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": 73562,
"acecode_id": "oss_7792",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of edges represented as strings in SMILES format. Each edge may contain isotopes of the same element, specifically Xenon (Xe), which can exist in multiple isotopes. Your task is to recombine identical Xe isotopes into a single bond while removing the duplic... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert recombine_edges(['Xe', 'Xe']) == 'Xe#Xe'\", \"assert recombine_edges(['Xe', 'Xe', 'Xe']) == 'Xe#Xe#Xe'\", \"assert recombine_edges(['Xe', 'Xe', 'Xe', 'Xe']) == 'Xe#Xe#Xe#Xe'\", \"assert recombine_edges(['Xe', 'Xe', 'Xe', 'Xe', 'Xe']) == 'Xe#Xe#Xe#Xe#Xe'\", \... | {
"split": "train",
"index": 73563,
"acecode_id": "bigcode_python_fns_49240",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to determine the latest supported Bazel version based on the given current Bazel version and a list of other Bazel versions. The Bazel versions follow the semantic versioning format (major.minor.patch). Implement the function `latest_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert latest_supported_bazel_version('4.1.0', ['4.2.0', '4.0.0']) == '4.2.0'\", \"assert latest_supported_bazel_version('3.5.2', ['3.5.1', '3.5.3']) == '3.5.3'\", \"assert latest_supported_bazel_version('2.0.0', ['2.1.0', '2.0.1']) == '2.1.0'\", \"assert latest_su... | {
"split": "train",
"index": 73564,
"acecode_id": "oss_12050",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a string and a subsequence as inputs, and returns the number of times the subsequence appears in the string. The subsequence can overlap with other occurrences. For example, if the string is 'banana' and the subsequence is 'ana', it should return 1 b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_subsequence('', 'anything') == 0\", \"assert count_subsequence('hello world', 'world') == 1\", \"assert count_subsequence('sos', 's') == 2\", \"assert count_subsequence('openai', 'ai') == 1\", \"assert count_subsequence('abcde', 'f') == 0\", \"assert c... | {
"split": "train",
"index": 73565,
"acecode_id": "evol_29805",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a function named 'categorize_temperatures' that takes a list of temperature values as input and returns a dictionary categorizing each temperature as 'Cold', 'Warm', or 'Hot'. The thresholds for categorization are as follows: 'Cold' for temperatures below 10, 'Warm' f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert categorize_temperatures([5, 15, 25, 35]) == {'Cold': [5], 'Warm': [15, 25], 'Hot': [35]}\", \"assert categorize_temperatures([10, 20, 30, 40, 0]) == {'Cold': [0], 'Warm': [10, 20, 30], 'Hot': [40]}\", \"assert categorize_temperatures([-5, 0, 10, 15, 30, 35])... | {
"split": "train",
"index": 73566,
"acecode_id": "evol_35232",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a proposal for a project management system. The function should take in a proposal name, a description, and options, and determine if the proposal is valid based on certain conditions. Write a Python function `is_val... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_proposal('New Proposal', 'This is a detailed project proposal.', 'Option1') == True\", \"assert is_valid_proposal('New Proposal', 'This is a detailed project proposal.', '') == False\", \"assert is_valid_proposal('New Proposal', '', 'Option1') == Fa... | {
"split": "train",
"index": 73567,
"acecode_id": "oss_33084",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple job queue system. The system should allow adding jobs to the queue, executing the jobs in the order they were added, and retrieving the status of the jobs. You need to implement a function `job_queue_system(ope... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert job_queue_system([('add_job', 3, 'Third Job'), ('get_job_status', 3)]) == ['In queue']\", \"assert job_queue_system([('add_job', 4, 'Fourth Job'), ('execute_next_job',), ('get_job_status', 4)]) == ['Job 4 executed: Fourth Job', 'Completed']\", \"assert job_q... | {
"split": "train",
"index": 73568,
"acecode_id": "oss_11821",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a string of comma-separated column names from a CSV file. Your task is to implement a function that returns the total number of columns in the string, excluding any empty columns that might be present due to consecutive commas. Write a function `count_columns(cols... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_columns('Date,DOY,Time,Location') == 4\", \"assert count_columns('a,b,,c') == 3\", \"assert count_columns(',,') == 0\", \"assert count_columns(',,a,,b,,') == 2\", \"assert count_columns('col1,col2,col3') == 3\", \"assert count_columns('one,two,three,fo... | {
"split": "train",
"index": 73569,
"acecode_id": "bigcode_python_fns_7208",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a 2D list of integers representing coordinates of points in a Cartesian plane, implement a function `reflect(points: List[List[int]], holder: float) -> List[List[int]]` that reflects these points across the y-axis if the `holder` value is greater than 0.5. Each point is r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reflect([[1, 2], [3, 4]], 0.6) == [[-1, 2], [-3, 4]]\", \"assert reflect([[5, 6], [-7, 8]], 1.0) == [[-5, 6], [7, 8]]\", \"assert reflect([[0, 0], [1, 1]], 0.7) == [[0, 0], [-1, 1]]\", \"assert reflect([[2, 3], [4, 5], [6, 7]], 0.8) == [[-2, 3], [-4, 5], [-6... | {
"split": "train",
"index": 73570,
"acecode_id": "bigcode_python_fns_25159",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function to optimize the retrieval of stock market data based on the desired granularity. Write a function `optimize_data_retrieval` that takes the following parameters: \n- `symbol` (string): The stock symbol for which the data needs to be... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert optimize_data_retrieval('sh.600000', '30m') == '30m'\", \"assert optimize_data_retrieval('sh.600001', '60m') == '60m'\", \"assert optimize_data_retrieval('sh.600002', '30m') == '30m'\", \"assert optimize_data_retrieval('sh.600003', '60m') == '60m'\", \"asser... | {
"split": "train",
"index": 73571,
"acecode_id": "oss_25440",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program to generate a formatted string representation of earthquake data from a given dictionary. The input dictionary will contain keys corresponding to earthquake details and their respective values. Write a function `generate_earthquake_embed(d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_earthquake_embed({'\\u5831\\u544a\\u9023\\u7d50': 'https://example.com/earthquake-report', '\\u7de8\\u865f': '202112345', '\\u9707\\u592e\\u4f4d\\u7f6e': '25.0 N, 121.5 E', '\\u767c\\u751f\\u6642\\u9593': '2021-12-01 12:34:56', '\\u898f\\u6a21\\u985... | {
"split": "train",
"index": 73572,
"acecode_id": "oss_33383",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `sum_even_numbers(numbers)` that takes the list as input and returns the sum of all even numbers in that list. If there are no even numbers, return 0. The input list may contain both positive and negative integers. The function should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_even_numbers([1, 2, 3, 4, 5]) == 6\", \"assert sum_even_numbers([2, 4, 6, 8]) == 20\", \"assert sum_even_numbers([-2, -4, -6, -8]) == -20\", \"assert sum_even_numbers([-1, -3, -5]) == 0\", \"assert sum_even_numbers([]) == 0\", \"assert sum_even_numbers([... | {
"split": "train",
"index": 73573,
"acecode_id": "bigcode_python_fns_35421",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the addition of layers in a 3D convolutional neural network architecture. The function takes an integer `inplanes` as input, representing the number of input channels in the first convolutional layer. Your goal is to re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_layers(1) == [(1, 1, 3, 1, 1), (1, 1, 3, 2, 1), (1, 1, 3, 1, 1), (1, 2, 3, 2, 1), (2, 2, 3, 1, 1), (2, 2, 3, 1, 1)]\", \"assert add_layers(2) == [(2, 2, 3, 1, 1), (2, 2, 3, 2, 1), (2, 2, 3, 1, 1), (2, 4, 3, 2, 1), (4, 4, 3, 1, 1), (4, 4, 3, 1, 1)]\", \"a... | {
"split": "train",
"index": 73574,
"acecode_id": "oss_12476",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that returns a new list containing their absolute values, sorted in ascending numerical order. The function should take a single parameter, which is the list of integers.\nPlease reason step by step, then write a self-contained Pyt... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sorted_absolute_values([]) == []\", \"assert sorted_absolute_values([3, 1, 4, 1, 5]) == [1, 1, 3, 4, 5]\", \"assert sorted_absolute_values([2, 1, 3]) == [1, 2, 3]\", \"assert sorted_absolute_values([0]) == [0]\", \"assert sorted_absolute_values([0, 0, 0]) ==... | {
"split": "train",
"index": 73575,
"acecode_id": "evol_11201",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a string `S` that consists solely of lowercase English alphabets and an integer `K`. Your task is to implement a function `countRemovals(S, K)` that returns a tuple containing the final string after removing all occurrences of `K` contiguous and identical characte... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert countRemovals('deeedbbcccbdaa', 3) == ('aa', 4)\", \"assert countRemovals('abcde', 2) == ('abcde', 0)\", \"assert countRemovals('abccba', 2) == ('', 3)\", \"assert countRemovals('aabbcc', 2) == ('', 3)\", \"assert countRemovals('abcabcabc', 3) == ('abcabcabc... | {
"split": "train",
"index": 73576,
"acecode_id": "evol_35770",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers, `signal` and `dark_current`, return a new list where each element is the average of the corresponding elements from `signal` minus the average of the corresponding elements from `dark_current`. If the lengths of the two lists are not the same, retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_subtraction([10, 20, 30], [1, 2, 3]) == [9.0, 18.0, 27.0]\", \"assert average_subtraction([1, 2, 3], [1, 2]) == []\", \"assert average_subtraction([], []) == []\", \"assert average_subtraction([1], [1]) == [0.0]\", \"assert average_subtraction([4, 8,... | {
"split": "train",
"index": 73577,
"acecode_id": "bigcode_python_fns_7841",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating a training report for a deep learning model based on various performance metrics during training or validation phases. Implement a function `generate_training_report(phase, loss_per_epoch, mse_per_epoch, clip_grad_D, grad_norm_D, clip_grad_S, grad... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_training_report('train', {'Loss': 0.5, 'lh': 0.3, 'KLG': 0.1, 'KLIG': 0.05}, {'train': 0.2}, 0.1, 0.01, 0.1, 0.02) == 'Training Report for train phase:\\\\nTotal Loss: 0.5\\\\nLikelihood: 0.3\\\\nKL Divergence for Gaussian Distributions: 0.1\\\\nKL ... | {
"split": "train",
"index": 73578,
"acecode_id": "oss_5623",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates a list of package names for installation in a Python environment. The function should check if the input is a list or tuple and ensure that each element in the list is a string. Additionally, if the input is valid, the func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_and_sort_packages(['numpy', 'scipy', 'matplotlib']) == ['matplotlib', 'numpy', 'scipy']\", \"assert validate_and_sort_packages(('pandas', 'seaborn', 'statsmodels')) == ['pandas', 'seaborn', 'statsmodels']\", \"assert validate_and_sort_packages(['req... | {
"split": "train",
"index": 73579,
"acecode_id": "bigcode_python_fns_16648",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that performs an affine transformation of the cosine function. The function should take three parameters: a (output scale), b (input scale), and c (input phase shift). The function should return the value of the transformed cosine function at x = 0, calcula... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert affine_transform_cos(2, 1, 0) == 2.0\", \"assert affine_transform_cos(1, 1, 0) == 1.0\", \"assert affine_transform_cos(0, 1, 0) == 0.0\", \"assert affine_transform_cos(5, 2, 0) == 5.0\", \"assert affine_transform_cos(-1, 1, 0) == -1.0\", \"assert affine_tran... | {
"split": "train",
"index": 73580,
"acecode_id": "bigcode_python_fns_162",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to filter and format a list of annotations based on a specific set of term codes. The function `filter_annotations(annotations, termcodes)` takes two parameters:\n- `annotations`: a list of strings representing the annotations to be p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_annotations(['This is a sample annotation', 'Another annotation', 'A1 is here'], ['A1']) == ['A1 (A1 is here)']\", \"assert filter_annotations(['This is a test', 'No matches here'], ['A2', 'B3']) == []\", \"assert filter_annotations(['Sample A1 annota... | {
"split": "train",
"index": 73581,
"acecode_id": "oss_10643",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes an integer input representing a user's choice and returns a specific string based on that input. The function should behave as follows: if the user inputs '1', return the string 'solving available problems.'; if the user inputs... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert user_choice(1) == 'solving available problems.'\", \"assert user_choice(2) == 'giving your own sudoku problem.'\", \"assert user_choice(3) == 'going back to main menu.'\", \"assert user_choice(0) == 'going back to main menu.'\", \"assert user_choice(-1) == '... | {
"split": "train",
"index": 73582,
"acecode_id": "bigcode_python_fns_15329",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a sorted array of integers `nums` and an integer `n`. Your task is to determine the minimum number of patches required to ensure that any integer within the inclusive range `[1, n]` can be generated by the summation of certain elements from the array. Write a func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert minPatches([1, 3], 6) == 1\", \"assert minPatches([1, 5, 10], 20) == 2\", \"assert minPatches([1, 2, 2], 5) == 0\", \"assert minPatches([1], 1) == 0\", \"assert minPatches([1, 2, 3], 6) == 0\", \"assert minPatches([1, 2, 5], 10) == 1\", \"assert minPatches([... | {
"split": "train",
"index": 73583,
"acecode_id": "evol_344",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function that generates the first n entries in the Fibonacci sequence and returns them as a list. The Fibonacci sequence is defined as follows: the first two numbers are 0 and 1, and each subsequent number is the sum of the two preceding ones. Your function should t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_fibonacci(2) == [0, 1]\", \"assert generate_fibonacci(3) == [0, 1, 1]\", \"assert generate_fibonacci(4) == [0, 1, 1, 2]\", \"assert generate_fibonacci(5) == [0, 1, 1, 2, 3]\", \"assert generate_fibonacci(6) == [0, 1, 1, 2, 3, 5]\", \"assert generate... | {
"split": "train",
"index": 73584,
"acecode_id": "evol_30393",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a nested dictionary that may contain unserializable values such as functions, sets, or other non-serializable objects. Your task is to implement a function `remove_unserializable(data: dict) -> dict` that converts this nested dictionary into a regular dictionary. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_unserializable({'key1': 'value1', 'key2': {'key3': set()}}) == {'key1': 'value1', 'key2': {'key3': '[unserializable]'}}\", \"assert remove_unserializable({'a': 1, 'b': {'c': [1, 2, 3], 'd': lambda x: x}}) == {'a': 1, 'b': {'c': [1, 2, 3], 'd': '[unser... | {
"split": "train",
"index": 73585,
"acecode_id": "bigcode_python_fns_559",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of unique integers and a list of indices, return a new list where the elements at the specified indices (1-based) are doubled. The indices provided will always be valid and within the bounds of the list length. Write a function that accomplishes this task.\nPlease ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert augment_by_indices([1, 2, 3, 4], [1, 3]) == [2, 2, 6, 4]\", \"assert augment_by_indices([5, 10, 15], [2]) == [5, 20, 15]\", \"assert augment_by_indices([10, 20, 30, 40], [1, 2, 3]) == [20, 40, 60, 40]\", \"assert augment_by_indices([1], [1]) == [2]\", \"asse... | {
"split": "train",
"index": 73586,
"acecode_id": "evol_24129",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function customSequence(start, stop, step) that generates a sequence of numbers starting from 'start' and stopping before 'stop', incrementing by 'step'. The function should handle both integer and float step sizes. The function should yield values until 'start' is ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert list(customSequence(0, 5, 1)) == [0, 1, 2, 3, 4]\", \"assert list(customSequence(-5, 0, 1)) == [-5, -4, -3, -2, -1]\", \"assert list(customSequence(5, 5, 1)) == []\", \"assert list(customSequence(3, 4, 0.5)) == [3.0, 3.5]\", \"assert list(customSequence(0, 0... | {
"split": "train",
"index": 73587,
"acecode_id": "evol_5365",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that calculates the sum of all even numbers and the product of all odd numbers in the list. If there are no even numbers, return -1 for the sum. If there are no odd numbers, return 0 for the product. The function should return a tuple ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_and_product([1, 2, 3, 4, 5]) == (6, 15)\", \"assert sum_and_product([2, 4, 6, 8]) == (20, 0)\", \"assert sum_and_product([1, 3, 5, 7]) == (-1, 105)\", \"assert sum_and_product([0, -2, -4]) == (-6, 0)\", \"assert sum_and_product([1, 2, 3, 4, 0]) == (6, 3)... | {
"split": "train",
"index": 73588,
"acecode_id": "bigcode_python_fns_10972",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `to_camel_case(s: str) -> str` that converts a given textual string into a camelCase representation. The function should remove all special characters, treat multiple spaces as a single space, and handle multilingual inputs. The first word should be in lowercas... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert to_camel_case('hello world') == 'helloWorld'\", \"assert to_camel_case(' multiple spaces ') == 'multipleSpaces'\", \"assert to_camel_case('python is awesome!') == 'pythonIsAwesome'\", \"assert to_camel_case('hello@#$%world') == 'helloWorld'\", \"assert t... | {
"split": "train",
"index": 73589,
"acecode_id": "evol_7069",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `refit_constraints(file_name: str, top_constraint: str, bottom_constraint: str) -> None` that simulates the behavior of a file re-fitting operation based on provided constraints. The function takes three parameters: a string `file_nam... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert refit_constraints('data.txt', 'True', 'False') is None\", \"assert refit_constraints('data.txt', 'False', 'True') is None\", \"assert refit_constraints('data.txt', 'True', 'True') is None\", \"assert refit_constraints('data.txt', 'False', 'False') is None\",... | {
"split": "train",
"index": 73590,
"acecode_id": "bigcode_python_fns_17905",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Write a function that determines if two given strings are anagrams of each other. Two strings are considered anagrams if they can be rearranged to form each other, meaning they contain the same characters with the same frequency. The function should return True if the strings a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert are_anagrams('listen', 'silent') == True\", \"assert are_anagrams('evil', 'vile') == True\", \"assert are_anagrams('triangle', 'integral') == True\", \"assert are_anagrams('apple', 'papel') == True\", \"assert are_anagrams('rat', 'tar') == True\", \"assert a... | {
"split": "train",
"index": 73591,
"acecode_id": "evol_29247",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a command rollback operation for a version control system. The function `rollback_command` should return a string that indicates the status of the rollback operation. The operation can only proceed if the repository is ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rollback_command() == 'Rollback successful'\", \"assert rollback_command() == 'Rollback successful'\", \"assert rollback_command() == 'Rollback successful'\", \"assert rollback_command() == 'Rollback successful'\", \"assert rollback_command() == 'Rollback su... | {
"split": "train",
"index": 73592,
"acecode_id": "bigcode_python_fns_20783",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that retrieves the instance of a given plugin from a window object. The function should take a string representing the plugin's name and return the plugin instance if it exists, or None if it does not. The window object is simulated a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_plugin_instance({'ScriptRunner': 'instance1'}, 'ScriptRunner') == 'instance1'\", \"assert get_plugin_instance({'ScriptRunner': 'instance1'}, 'NonExistentPlugin') == None\", \"assert get_plugin_instance({'PluginA': 'instanceA', 'PluginB': 'instanceB'}, 'P... | {
"split": "train",
"index": 73593,
"acecode_id": "bigcode_python_fns_22843",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with developing a function that processes a list of product brand entries represented as strings. Each entry should be evaluated to determine if it meets a certain criterion: a valid product brand name must start with an uppercase letter and contain only alphabet... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_valid_brands(['BrandA', 'brandB', '123Brand', 'ValidBrand']) == ['BrandA', 'ValidBrand']\", \"assert filter_valid_brands(['brand', 'brand', 'brand']) == []\", \"assert filter_valid_brands(['Brand1', 'Brand2', 'Brand3']) == []\", \"assert filter_valid_... | {
"split": "train",
"index": 73594,
"acecode_id": "oss_32623",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary where each key is a string and each value is an integer. Your task is to implement a function `flip_dict(d: dict) -> dict` that swaps the keys and values in the dictionary. If multiple keys have the same value, the result should store those keys in a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert flip_dict({'a': 1, 'b': 2, 'c': 3}) == {1: 'a', 2: 'b', 3: 'c'}\", \"assert flip_dict({'x': 5, 'y': 5, 'z': 10}) == {5: ['x', 'y'], 10: 'z'}\", \"assert flip_dict({'foo': 1, 'bar': 1}) == {1: ['foo', 'bar']}\", \"assert flip_dict({'key1': 2, 'key2': 3, 'key3... | {
"split": "train",
"index": 73595,
"acecode_id": "bigcode_python_fns_32543",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an input value, implement a function `is_datetime(value)` that checks if the provided value is of the type `datetime.datetime`. The function should return `True` if the value is a `datetime` object, otherwise it should return `False`. You can assume that the input value c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_datetime('2023-10-01') == False\", \"assert is_datetime(123) == False\", \"assert is_datetime([]) == False\", \"assert is_datetime({}) == False\", \"assert is_datetime(None) == False\", \"assert is_datetime(True) == False\", \"assert is_datetime(3.14) == ... | {
"split": "train",
"index": 73596,
"acecode_id": "bigcode_python_fns_9991",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with determining whether a subnet has available IP address space based on the number of available IP addresses. Write a function `check_subnet_availability(available_ip_count: int) -> str` that returns a message indicating whether the subnet has enough available ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_subnet_availability(0) == 'Subnet does not have available IP address space, consider terminating unnecessary workloads or expanding CIDR capacity to avoid availability losses.'\", \"assert check_subnet_availability(1) == 'Subnet does not have available... | {
"split": "train",
"index": 73597,
"acecode_id": "bigcode_python_fns_27123",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string and a list of characters, write a function that converts the string into a tensor representation. Each character in the string should be replaced by its 1-based index in the character list (where the first character in the list has an index of 1). If a character ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert string_to_tensor('abc', ['a', 'b', 'c']) == [1, 2, 3]\", \"assert string_to_tensor('xyz', ['x', 'y', 'z']) == [1, 2, 3]\", \"assert string_to_tensor('', ['a', 'b', 'c']) == []\", \"assert string_to_tensor('abc', []) == [0, 0, 0]\", \"assert string_to_tensor(... | {
"split": "train",
"index": 73598,
"acecode_id": "bigcode_python_fns_48356",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing the lifecycle of a task. You need to implement a function `manage_task_lifecycle(creation_time: str, destruction_time: str, start_time: str, end_time: str) -> int` that accepts four string parameters representing the creation, destruction, start, an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_task_lifecycle('2023-10-01 10:00:00', '2023-10-01 12:00:00', '2023-10-01 10:05:00', '2023-10-01 10:30:00') == 1500\", \"assert manage_task_lifecycle('2023-10-01 10:00:00', '2023-10-01 12:00:00', '2023-10-01 10:00:00', '2023-10-01 10:15:00') == 900\", ... | {
"split": "train",
"index": 73599,
"acecode_id": "oss_159",
"num_tests": 9
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.