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": "Implement a function `max_min_value(num_list)` that takes a list of numerical elements and returns a tuple containing the maximum and minimum values from that list. The function should handle empty lists gracefully by returning (None, None).\nPlease reason step by step, then wr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_min_value([7, 4, 2, 9, 0, 5]) == (9, 0)\", \"assert max_min_value([1]) == (1, 1)\", \"assert max_min_value([-1, -5, -3]) == (-1, -5)\", \"assert max_min_value([3.5, 2.1, 5.6]) == (5.6, 2.1)\", \"assert max_min_value([]) == (None, None)\", \"assert max_mi... | {
"split": "train",
"index": 77800,
"acecode_id": "evol_20096",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that tracks the usage of a resource. The function should take two parameters: the name of the resource (a string) and the amount of the resource used (a non-negative integer). The function should return a dictionary with two keys: 'na... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert track_resource_usage('Water', 100) == {'name': 'Water', 'amount_used': 100}\", \"assert track_resource_usage('Electricity', 200) == {'name': 'Electricity', 'amount_used': 200}\", \"assert track_resource_usage('Gas', 50) == {'name': 'Gas', 'amount_used': 50}\... | {
"split": "train",
"index": 77801,
"acecode_id": "oss_714",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Construct a Python function named 'concatenateAlphabets' which accepts two parameters of string data type and outputs their concatenated string after validating for characters in the input strings. The function must handle exceptions for non-string inputs and maintain the order... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert concatenateAlphabets('Hello 123', ' World@321') == 'HelloWorld'\", \"assert concatenateAlphabets('Python3.9', 'is@awesome!') == 'Pythonisawesome'\", \"assert concatenateAlphabets('1234', '5678') == ''\", \"assert concatenateAlphabets('!@#$', '%^&*') == ''\",... | {
"split": "train",
"index": 77802,
"acecode_id": "evol_16714",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an integer angle in degrees. Your task is to implement a function that converts this angle into radians. The conversion from degrees to radians is done using the formula: radians = degrees * (π / 180). Write a function `convert_to_radians(angle: int) -> float` tha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_radians(0) == 0.0\", \"assert convert_to_radians(90) == 1.5707963267948966\", \"assert convert_to_radians(-90) == -1.5707963267948966\", \"assert convert_to_radians(180) == 3.141592653589793\", \"assert convert_to_radians(-180) == -3.1415926535897... | {
"split": "train",
"index": 77803,
"acecode_id": "bigcode_python_fns_14238",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a 2D grid of integers, write a function `slice_grid` that takes in a list of dimension indices and a 2D grid. The function should return a new grid slice based on the specified indices. If the index is 'all', return all elements along that dimension. If an integer index i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert slice_grid([0, 'all'], [[1, 2], [3, 4], [5, 6]]) == [[1, 2]]\", \"assert slice_grid(['all', 'all'], [[1, 2], [3, 4], [5, 6]]) == [[1, 2], [3, 4], [5, 6]]\", \"assert slice_grid([1, 2], [[1, 2], [3, 4], [5, 6]]) == []\", \"assert slice_grid(['all', 'all'], [[... | {
"split": "train",
"index": 77804,
"acecode_id": "bigcode_python_fns_39068",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with developing a system to manage transport methods requested via email. Your function will process a line of text from an email and extract the requested transport type if the line contains the word 'transport'. If found, the transport type should be added to a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_transport_type('Please add obfs3 transport', ['obfs4', 'meek', 'snowflake']) == None\", \"assert add_transport_type('Requesting the transport method: obfs5', ['obfs4']) == None\", \"assert add_transport_type('Just a random line without transport', ['obfs... | {
"split": "train",
"index": 77805,
"acecode_id": "oss_9209",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of numbers, `tau` and `strs`, both of the same length `n`. Your task is to implement a function `calc_diss_energy_fd(tau, strs)` that calculates the total dissipation energy based on the following formula: \n\n\\[ \text{dissipation energy} = \\sum_{i=1}^... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calc_diss_energy_fd([1, 0, 1], [0, 1, 0]) == 1.0\", \"assert calc_diss_energy_fd([1, 1, 1], [1, 1, 1]) == 0.0\", \"assert calc_diss_energy_fd([1, 2, 3, 4], [1, 2, 1, 2]) == 1.5\", \"assert calc_diss_energy_fd([0, 0, 0], [0, 0, 0]) == 0.0\", \"assert calc_dis... | {
"split": "train",
"index": 77806,
"acecode_id": "oss_23798",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program to analyze and display compact information about a set of data. The data consists of multiple records, each containing a 'cur' value and an 'avg' value. Your program should implement a function called `display_records` that takes the follo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert display_records(0, 0, 40, 10, [{'cur': 10, 'avg': 8}, {'cur': 15, 'avg': 12}, {'cur': 20, 'avg': 18}]) == ['Record 1: Cur = 10, Avg = 8', 'Record 2: Cur = 15, Avg = 12', 'Record 3: Cur = 20, Avg = 18']\", \"assert display_records(0, 0, 40, 10, [{'cur': 5, 'a... | {
"split": "train",
"index": 77807,
"acecode_id": "oss_36753",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `parse_arguments(arguments: List[str], options: List[str] = None) -> Dict[str, str]` that emulates the behavior of parsing input arguments. The function takes a list of string arguments and a list of options to resolve. If the input argum... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_arguments(['--name', 'Alice', '--age', '30'], ['--name', '--age']) == {'--name': 'Alice', '--age': '30'}\", \"assert parse_arguments(['--name', 'Alice', '--age', '30'], ['--name']) == {'--name': 'Alice'}\", \"assert parse_arguments(['--name'], ['--name... | {
"split": "train",
"index": 77808,
"acecode_id": "bigcode_python_fns_489",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that calculates the area and perimeter of a given geometric shape. The function should take three parameters: the shape type (a string, which can be 'square', 'rectangle', 'circle', or 'triangle'), and the necessary dimensions as additiona... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_shape_properties('square', 2) == {'area': 4.0, 'perimeter': 8.0}\", \"assert calculate_shape_properties('rectangle', 4, 5) == {'area': 20.0, 'perimeter': 18.0}\", \"assert calculate_shape_properties('triangle', 3, 4, 5) == {'area': 6.0, 'perimeter'... | {
"split": "train",
"index": 77809,
"acecode_id": "oss_12807",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating a migration script for a database schema update in a Django project. You need to create a function that generates a migration script for adding a new field to a specified model in a given app. The function should return a string representation of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_migration_script('classroom', 'MyFile', 'file', 'CharField', 100, True) == \\\"\\\\n dependencies = [\\\\n ('classroom', '0024_auto_20190825_1723'),\\\\n ]\\\\n\\\\n operations = [\\\\n migrations.AddField(\\\\n mod... | {
"split": "train",
"index": 77810,
"acecode_id": "oss_30615",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers and returns a new list containing only the even numbers from the original list. The function should preserve the order of the original elements in the output list. You may assume the input list will alway... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 15, 20, 25, 30]) == [10, 20, 30]\", \"assert filter_even_numbers([0, -1, -2, 3, 4]) == [0, -2, 4]\", \"assert filter_even_numbers([]) == []\", \"assert filter_even_numbers([7... | {
"split": "train",
"index": 77811,
"acecode_id": "oss_14695",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a Python function called `interpolation_search` that takes a list of integers and a target integer as inputs. The function should perform the following: First, sort the list in ascending order if it is not already sorted. Then, use the interpolation search algorithm t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert interpolation_search([], 5) == -1\", \"assert interpolation_search([10], 10) == 0\", \"assert interpolation_search([10], 5) == -1\", \"assert interpolation_search([5, 1, 3], 3) == 1\", \"assert interpolation_search([1, 2, 3, 4, 5], 3) == 2\", \"assert interp... | {
"split": "train",
"index": 77812,
"acecode_id": "evol_31447",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of integers, `f` and `g`, both of the same length `n`. Your task is to write a function that multiplies the corresponding elements of these two lists, and then returns a new list containing the results, where each result is taken modulo `m`. Implement th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multiply_and_mod([0, 0, 0], [1, 2, 3], 5) == [0, 0, 0]\", \"assert multiply_and_mod([1, 2, 3], [0, 0, 0], 5) == [0, 0, 0]\", \"assert multiply_and_mod([10, 20], [30, 40], 50) == [0, 0]\", \"assert multiply_and_mod([1], [1], 2) == [1]\", \"assert multiply_and... | {
"split": "train",
"index": 77813,
"acecode_id": "bigcode_python_fns_16567",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `c_string_arguments(encoding: str, *strings: str) -> bytes` that takes an encoding type (a string) and a variable number of strings as input. The function should return a single bytes object that contains each input string encoded using the specified encodi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert c_string_arguments('UTF-8', 'hello', 'world') == b'hello\\\\0world\\\\0'\", \"assert c_string_arguments('ASCII', 'test', 'string') == b'test\\\\0string\\\\0'\", \"assert c_string_arguments('UTF-8', 'foo', 'bar', 'baz') == b'foo\\\\0bar\\\\0baz\\\\0'\", \"ass... | {
"split": "train",
"index": 77814,
"acecode_id": "bigcode_python_fns_49682",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a pseudo-random number using a simple linear congruential generator (LCG). The LCG is defined by the formula: X_{n+1} = (a * X_n + c) % m, where X is the current random number, a is the multiplier, c is the increment, m is ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_random(0, 5, 3) == 3\", \"assert generate_random(1, 5, 3) == 8\", \"assert generate_random(10, 3, 4) == 4\", \"assert generate_random(15, 2, 5) == 5\", \"assert generate_random(20, 10, 7) == 7\", \"assert generate_random(30, 1, 1) == 1\", \"assert g... | {
"split": "train",
"index": 77815,
"acecode_id": "bigcode_python_fns_7308",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `median(list_in)` that calculates and returns the median of the numbers in the list. The median is defined as the middle value when the list is sorted. If the list has an even number of elements, return the average of the two middle va... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert median([1, 3, 2]) == 2.0\", \"assert median([1, 2, 3, 4]) == 2.5\", \"assert median([5]) == 5.0\", \"assert median([7, 1, 3, 9, 5]) == 5.0\", \"assert median([1, 2, 3, 4, 5, 6]) == 3.5\", \"assert median([-1, -2, -3, -4]) == -2.5\", \"assert median([0, 0, 0]... | {
"split": "train",
"index": 77816,
"acecode_id": "bigcode_python_fns_8029",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes in a dictionary and returns a JSON string representation of that dictionary with its keys sorted in alphabetical order. The JSON string should use commas to separate items and colons to separate keys from values. Implement the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert stringify_message({'b': 'banana', 'a': 'apple'}) == '{\\\"a\\\":\\\"apple\\\",\\\"b\\\":\\\"banana\\\"}'\", \"assert stringify_message({'key1': 'value1', 'key3': 'value3', 'key2': 'value2'}) == '{\\\"key1\\\":\\\"value1\\\",\\\"key2\\\":\\\"value2\\\",\\\"ke... | {
"split": "train",
"index": 77817,
"acecode_id": "bigcode_python_fns_26273",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function called `calculate_statistics` that takes a 2D list of numerical data and returns a dictionary containing the mean, median, and standard deviation of each column. The input data will be a list of lists, where each inner list represents... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_statistics([[], [], []]) == {}\", \"assert calculate_statistics([[1.5, 2.5], [3.5, 4.5], [5.5, 6.5]]) == {0: {'mean': 3.5, 'median': 3.5, 'std': 2.0}, 1: {'mean': 4.5, 'median': 4.5, 'std': 2.0}}\", \"assert calculate_statistics([[1, 2], [3, 4], [5... | {
"split": "train",
"index": 77818,
"acecode_id": "oss_5886",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a date in the format 'DDth Month', where 'DD' is the day of the month (1 to 31) followed by 'th', 'st', 'nd', or 'rd', and 'Month' is the full name of the month (e.g., 'January', 'February', etc.). Implement a function that extracts the day a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_date('12th December') == (12, 12)\", \"assert extract_date('1st January') == (1, 1)\", \"assert extract_date('3rd March') == (3, 3)\", \"assert extract_date('21st April') == (21, 4)\", \"assert extract_date('31st May') == (31, 5)\", \"assert extract_... | {
"split": "train",
"index": 77819,
"acecode_id": "bigcode_python_fns_33245",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that calculates the sum of two integers. Your function should take two integer parameters, `a` and `b`, and return their sum. Additionally, the function should log the execution time in milliseconds using the logging module. Th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_with_logging(1, 2) == 3\", \"assert sum_with_logging(-1, 1) == 0\", \"assert sum_with_logging(0, 0) == 0\", \"assert sum_with_logging(100, 200) == 300\", \"assert sum_with_logging(-5, -5) == -10\", \"assert sum_with_logging(50, 50) == 100\", \"assert sum... | {
"split": "train",
"index": 77820,
"acecode_id": "oss_22155",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the behavior of an event manager. The function, `event_manager`, should take in a list of events and a list of callback functions. The function should return a list where each element is the result of invoking each callback... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert event_manager([{'type': 'click', 'value': 1}, {'type': 'hover', 'value': 2}], [lambda e: e['value'] * 2]) == [2, 4]\", \"assert event_manager([{'type': 'click', 'value': 1}, {'type': 'hover', 'value': 2}], [lambda e: e['value'] + 1]) == [2, 3]\", \"assert ev... | {
"split": "train",
"index": 77821,
"acecode_id": "oss_30726",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a positive integer n, implement a recursive function that calculates the factorial of n. The factorial of a number n is the product of all positive integers less than or equal to n. For example, the factorial of 5 is 5 * 4 * 3 * 2 * 1 = 120. Your function should return 1 ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert factorial(0) == 1\", \"assert factorial(1) == 1\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", \"assert factorial(5) == 120\", \"assert factorial(6) == 720\", \"assert factorial(7) == 5040\", \"assert factorial(... | {
"split": "train",
"index": 77822,
"acecode_id": "evol_18847",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of article titles and returns a list of unique titles sorted in alphabetical order. An article title is considered unique if it appears only once in the input list. Your function should handle any input list, returni... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_sorted_titles(['Python Basics', 'Flask Web Development', 'Python Basics', 'Machine Learning']) == ['Flask Web Development', 'Machine Learning']\", \"assert get_unique_sorted_titles(['Article One', 'Article Two', 'Article One', 'Article Three', 'Ar... | {
"split": "train",
"index": 77823,
"acecode_id": "oss_2546",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of candidate points represented as tuples (x, y) and a list of corners representing the vertices of a polygon, implement a function that returns a list of points that are within the polygon. The polygon is defined by the corners in the order they are provided. A po... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_points([(0, 0), (4, 4)], [(1, 1), (1, 3), (3, 3), (3, 1)]) == []\", \"assert filter_points([(2, 2), (5, 5)], [(1, 1), (1, 4), (4, 4), (4, 1)]) == [(2, 2)]\", \"assert filter_points([(10, 10)], [(0, 0), (0, 15), (15, 15), (15, 0)]) == [(10, 10)]\", \"a... | {
"split": "train",
"index": 77824,
"acecode_id": "bigcode_python_fns_28527",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that retrieves a set of videos associated with a specific cast member identified by their unique ID. The function should take a parameter `cast_member_id` of type `uuid.UUID` and return a set of video titles (strings) associated with ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_videos_by_cast_member(uuid.UUID('123e4567-e89b-12d3-a456-426614174000')) == {'Video A', 'Video B'}\", \"assert get_videos_by_cast_member(uuid.UUID('123e4567-e89b-12d3-a456-426614174001')) == {'Video C'}\", \"assert get_videos_by_cast_member(uuid.UUID('12... | {
"split": "train",
"index": 77825,
"acecode_id": "oss_10753",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing a position in a 'real' coordinate system with three keys: 'x', 'y', and 'z', each corresponding to a floating-point value. Your task is to transform this position into a 'sim' coordinate system using a predefined transformation matrix. Th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_position({'x': 1.0, 'y': 2.0, 'z': 3.0}) == {'x': 1.5, 'y': 0.9010001, 'z': 3.0}\", \"assert transform_position({'x': 0.0, 'y': 0.0, 'z': 0.0}) == {'x': 0.0, 'y': 0.9010001, 'z': 0.0}\", \"assert transform_position({'x': -1.0, 'y': -2.0, 'z': -3.0}... | {
"split": "train",
"index": 77826,
"acecode_id": "bigcode_python_fns_700",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function called `credential_property` that takes a string parameter `name` and returns a property object. The property should allow setting and getting a value associated with the `name` attribute. The value should be stored internally in a private varia... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isinstance(credential_property('username'), property)\", \"assert isinstance(credential_property('password'), property)\", \"assert isinstance(credential_property('email'), property)\", \"assert isinstance(credential_property('token'), property)\", \"assert ... | {
"split": "train",
"index": 77827,
"acecode_id": "bigcode_python_fns_14914",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists, `y_true` and `y_pred`, representing the true labels and predicted labels of a classification task respectively, implement a function `calculate_confusion_matrix(y_true, y_pred)` that returns the confusion matrix as a 2D list. The confusion matrix should be stru... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_confusion_matrix([1, 0, 1, 0], [1, 0, 0, 0]) == [[2, 0], [1, 1]]\", \"assert calculate_confusion_matrix([1, 1, 1, 1], [1, 1, 1, 1]) == [[4]]\", \"assert calculate_confusion_matrix([1, 0, 1, 0], [0, 1, 0, 1]) == [[0, 2], [2, 0]]\", \"assert calculat... | {
"split": "train",
"index": 77828,
"acecode_id": "bigcode_python_fns_20700",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing different options for a command-line interface (CLI). Your task is to implement a function that takes a list of options and a default command option. The function should check if each option in the list (except for 'all' and 'config'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_cli_options(['info', 'status', 'config'], 'info status detail') == True\", \"assert check_cli_options(['all', 'status'], 'info status detail') == True\", \"assert check_cli_options(['info', 'status', 'config'], 'info config detail') == False\", \"asser... | {
"split": "train",
"index": 77829,
"acecode_id": "bigcode_python_fns_27644",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of numbers that can be either integers or floats. Your task is to implement a function that converts all elements in the list to their absolute values. If an element is a negative number, it should be replaced by its positive counterpart. The function shoul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_absolute([-1, 2.5, -3, 4.0]) == [1.0, 2.5, 3.0, 4.0]\", \"assert convert_to_absolute([0, -0.0, -5.5]) == [0.0, 0.0, 5.5]\", \"assert convert_to_absolute([3, -6, 7.8, -2.2]) == [3.0, 6.0, 7.8, 2.2]\", \"assert convert_to_absolute([-10, -20, 30]) ==... | {
"split": "train",
"index": 77830,
"acecode_id": "bigcode_python_fns_37033",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of image names along with a directory path, and returns information about each image. The function should take in a directory path and a list of image names, and for each image, it should return a tuple contai... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_images('LabeledApproved_full', ['image1.jpg', 'image2.jpg', 'image3.jpg']) == [('image1.jpg', 'LabeledApproved_full/image1.jpg', 300, 200), ('image2.jpg', 'LabeledApproved_full/image2.jpg', 400, 250), ('image3.jpg', 'LabeledApproved_full/image3.jpg',... | {
"split": "train",
"index": 77831,
"acecode_id": "oss_17778",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the ages of a group of people. Your task is to implement a function `average_age(ages: List[int]) -> float` that calculates the average age of this group. The function should return the average age as a float, rounded to two decimal... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_age([20, 30, 40]) == 30.00\", \"assert average_age([25, 35, 45, 55]) == 40.00\", \"assert average_age([10]) == 10.00\", \"assert average_age([18, 22]) == 20.00\", \"assert average_age([16, 16, 16]) == 16.00\", \"assert average_age([0, 0, 0]) == 0.00\... | {
"split": "train",
"index": 77832,
"acecode_id": "bigcode_python_fns_20243",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string `job_id` that represents a job identifier. Your task is to implement a function `decompose_job_id(job_id: str) -> List[str]` that splits the `job_id` into its components based on a specific character known as the `SPACER`. The `SPACER` is defined as a hyp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decompose_job_id('abc-def-ghi') == ['abc', 'def', 'ghi']\", \"assert decompose_job_id('a-b-c') == ['a', 'b', 'c']\", \"assert decompose_job_id('abc') == ['abc']\", \"assert decompose_job_id('') == []\", \"assert decompose_job_id('-abc-def-') == ['abc', 'def'... | {
"split": "train",
"index": 77833,
"acecode_id": "bigcode_python_fns_40089",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `check_workspace_existence(current_workspace: str, workspaces_list: List[str]) -> str` that verifies if a given workspace exists in a list of available workspaces. The function should return a warning message if the workspace does not... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_workspace_existence('dev', ['prod', 'test', 'dev']) == 'Workspace dev is active.'\", \"assert check_workspace_existence('staging', ['prod', 'test', 'dev']) == 'Warning - Workspace staging has been deleted or killed.'\", \"assert check_workspace_existen... | {
"split": "train",
"index": 77834,
"acecode_id": "bigcode_python_fns_24568",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a media management system for a cannabis dispensary. The system should allow users to upload media files with associated metadata, including the title, description, tags, and category. Your task is to implement a single function called `upload_m... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert upload_media('path/to/image.jpg', 'Cannabis Plant', 'A beautiful cannabis plant', ['cannabis', 'plant'], 'images') == {'file_path': 'path/to/image.jpg', 'title': 'Cannabis Plant', 'description': 'A beautiful cannabis plant', 'tags': ['cannabis', 'plant'], 'c... | {
"split": "train",
"index": 77835,
"acecode_id": "oss_35076",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a subclass named 'Manager' that inherits from a superclass named 'Employee'. The 'Employee' class should have attributes for 'name', 'age', and 'salary'. The 'Manager' class should extend 'Employee' by adding an attribute for 'experience'. Implement a method named 'displ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert Employee('Alice', 30, 50000).name == 'Alice'\", \"assert Employee('Bob', 40, 60000).age == 40\", \"assert Employee('Charlie', 35, 55000).salary == 55000\", \"assert Manager('David', 45, 80000, 15).name == 'David'\", \"assert Manager('Eve', 50, 90000, 20).age... | {
"split": "train",
"index": 77836,
"acecode_id": "evol_1009",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks if a given list of strings has been modified and if a specified pattern is no longer present in the list. Your function should take the following parameters: \n- `strings`: A list of strings representing the current state ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_modified([], [], 'test') == False\", \"assert check_modified(['abc', 'def'], ['abc', 'def'], 'test') == False\", \"assert check_modified(['abc'], ['abc', 'def'], 'def') == True\", \"assert check_modified(['abc', 'def'], ['abc'], 'xyz') == True\", \"ass... | {
"split": "train",
"index": 77837,
"acecode_id": "oss_24491",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Write a function `get_memory_stats()` that returns the current total memory allocated and the memory currently in use by the system. The function should return a tuple containing two integers: the first integer represents `total_memory_allocated`, and the second integer represe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_memory_stats() == (1024, 512)\", \"assert isinstance(get_memory_stats(), tuple)\", \"assert len(get_memory_stats()) == 2\", \"assert get_memory_stats()[0] >= 0\", \"assert get_memory_stats()[1] >= 0\", \"assert get_memory_stats()[0] > get_memory_stats()[... | {
"split": "train",
"index": 77838,
"acecode_id": "bigcode_python_fns_43898",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of URL patterns and returns a dictionary containing the static file URLs. The URL patterns are represented as a list of tuples, where each tuple contains a regular expression pattern and a corresponding view f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_static_urls([(r'^products/(?P<slug>[-\\\\w]+)/', 'STATIC_URL'), (r'', 'MEDIA_URL')]) == {'static': 'STATIC_URL', 'media': 'MEDIA_URL'}\", \"assert extract_static_urls([(r'^blog/', 'STATIC_URL'), (r'', 'MEDIA_URL')]) == {'static': 'STATIC_URL', 'media... | {
"split": "train",
"index": 77839,
"acecode_id": "oss_14025",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string that represents a script containing 'IF' statements followed by 'THEN' actions. Each 'IF' statement can have multiple conditions, and each 'THEN' statement can have an associated response and actions. Your task is to parse this string and return a diction... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_script('IF condition1 THEN response1: action1; action2; IF condition2 THEN response2: action3;') == 'Error: Multiple matches found'\", \"assert parse_script('IF condition1 THEN response1: action1; action2; IF condition2 OR(1) condition3 THEN response2:... | {
"split": "train",
"index": 77840,
"acecode_id": "bigcode_python_fns_14938",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Write a function `first_six_primes_and_average()` that returns a list containing the first six prime numbers along with their running average. The output should be a list of tuples where each tuple contains a prime number and the average of all primes displayed so far at that p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert type(first_six_primes_and_average()) == list\", \"assert len(first_six_primes_and_average()) == 6\", \"assert first_six_primes_and_average()[0][0] == 2\", \"assert first_six_primes_and_average()[1][0] == 3\", \"assert first_six_primes_and_average()[2][0] == ... | {
"split": "train",
"index": 77841,
"acecode_id": "evol_6841",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a single Schmidt coefficient, denoted as 'lambda' (0 < lambda < 1). Your task is to implement a function that calculates the entanglement based on the formula: ent = - [lambda * log(lambda) + (1 - lambda) * log(1 - lambda)], where 'log' is the natural logarithm. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert abs(lambda_to_ent(0.1) - 0.32508297339144845) < 1e-9\", \"assert abs(lambda_to_ent(0.5) - 0.6931471805599453) < 1e-9\", \"assert abs(lambda_to_ent(0.9) - 0.32508297339144845) < 1e-9\", \"assert abs(lambda_to_ent(0.25) - 0.5623351446188074) < 1e-9\", \"assert... | {
"split": "train",
"index": 77842,
"acecode_id": "bigcode_python_fns_25964",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks if a given string is a palindrome. A palindrome is a word, phrase, number, or other sequences of characters which reads the same backward as forward, ignoring spaces, punctuation, and capitalization. Your function should t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_palindrome('A man, a plan, a canal: Panama') == True\", \"assert is_palindrome('racecar') == True\", \"assert is_palindrome('No lemon, no melon') == True\", \"assert is_palindrome('Was it a car or a cat I saw?') == True\", \"assert is_palindrome('12321') ... | {
"split": "train",
"index": 77843,
"acecode_id": "oss_35704",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes in the details of a GitHub repository and returns a formatted string containing the repository's full name, last push date, archived status, description, list of topics, and default branch. The input to the function will be a d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_repository_info({'full_name': 'awesome-dev/awesome-repo', 'pushed_at': '1970-01-01T00:00:00Z', 'archived': False, 'description': 'Awesome!', 'topics': ['awesome'], 'default_branch': 'master'}) == 'Repository: awesome-dev/awesome-repo, Last Push: 1970-... | {
"split": "train",
"index": 77844,
"acecode_id": "oss_2712",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `get_grade(numeric_value)` that takes an integer `numeric_value` between 0 and 100 (inclusive) and returns the corresponding alphabetic grade representation. The grading scale is as follows: A for 90 and above, B for 80 to 89, C for 70 to 79, D for 60 to 69... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_grade(95) == 'A'\", \"assert get_grade(85) == 'B'\", \"assert get_grade(75) == 'C'\", \"assert get_grade(65) == 'D'\", \"assert get_grade(55) == 'F'\", \"assert get_grade(100) == 'A'\", \"assert get_grade(90) == 'A'\", \"assert get_grade(89) == 'B'\", \"... | {
"split": "train",
"index": 77845,
"acecode_id": "evol_30785",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `unload_entry(entry_id: int, platforms: List[str], data: Dict[int, Any]) -> bool` that simulates unloading a configuration entry from a system. The function takes three parameters: an integer `entry_id` representing the ID of the entry to... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unload_entry(1, ['platform1', 'platform2'], {1: {'data': 'value1'}, 2: {'data': 'value2'}}) == True\", \"assert unload_entry(2, ['platform1'], {1: {'data': 'value1'}, 2: {'data': 'value2'}}) == True\", \"assert unload_entry(3, ['platform1'], {1: {'data': 'va... | {
"split": "train",
"index": 77846,
"acecode_id": "bigcode_python_fns_40427",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a Python function that identifies the optimal rightmost point of removal for a specific value in a sorted list or tuple while maintaining the overall sorted sequence. The function should be able to manage lists in both ascending and descending order, as well as lists wit... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_removal_point([1, 3, 5, 7], 4) == 2\", \"assert find_removal_point([7, 5, 3, 1], 4) == 2\", \"assert find_removal_point(['a', 'c', 'e', 'g'], 'd') == 2\", \"assert find_removal_point([1.0, 2.5, 3.5], 3.0) == 2\", \"assert find_removal_point(['apple', 'b... | {
"split": "train",
"index": 77847,
"acecode_id": "evol_11407",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes an image upload and sends a tweet containing the uploaded image and a comment. The function should take two parameters: a `photolog_id`, which represents the ID of the uploaded photo, and a `comment`, which is the text ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert send_tweet('123', 'This is my photo!') == 'Tweet sent successfully!'\", \"assert send_tweet('456', 'Beautiful scenery!') == 'Tweet sent successfully!'\", \"assert send_tweet('789', 'Check out this picture!') == 'Tweet sent successfully!'\", \"assert send_twe... | {
"split": "train",
"index": 77848,
"acecode_id": "bigcode_python_fns_27187",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries representing start entries of a race, where each dictionary contains details about a start entry such as its 'id' and 'name'. Write a function `get_start_entry_ids(start_entries: List[Dict[str, Any]]) -> List[int]` that takes a list of start... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_start_entry_ids([]) == []\", \"assert get_start_entry_ids([{ 'id': 1, 'name': 'Entry 1' }, { 'id': 2, 'name': 'Entry 2' }]) == [1, 2]\", \"assert get_start_entry_ids([{ 'id': 5, 'name': 'Entry 5' }, { 'id': 10, 'name': 'Entry 10' }, { 'id': 15, 'name': '... | {
"split": "train",
"index": 77849,
"acecode_id": "bigcode_python_fns_19310",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `decorator_with_option(decorator_fn)` that wraps a given decorator, allowing it to be applied both with and without options. The decorator should maintain its behavior regardless of how it is applied. The function should accept a single p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decorator_with_option(lambda fn: fn)(lambda x: x)(5) == 5\", \"assert decorator_with_option(lambda fn: fn)(lambda: 40)() == 40\", \"assert decorator_with_option(lambda fn: fn)(lambda: 60)() == 60\", \"assert decorator_with_option(lambda fn: fn)(lambda x: x +... | {
"split": "train",
"index": 77850,
"acecode_id": "bigcode_python_fns_6215",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a path represented by three lists: `px`, `py`, and `pyaw` that denote the x-coordinates, y-coordinates, and orientations (in radians) of various points along the path. Your task is to implement a function `check_edge_condition` that verifies whether the start and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_edge_condition([1.0, 2.0, 3.0, 4.0, 5.0], [1.0, 1.5, 2.0, 2.5, 3.0], [0.0, 0.5, 1.0, 1.25, 1.57], 1.0, 1.0, 0.0, 5.0, 3.0, 1.57) is None\", \"assert check_edge_condition([1.01, 2.0, 3.0, 4.0, 5.0], [1.0, 1.5, 2.0, 2.5, 3.0], [0.0, 0.5, 1.0, 1.25, 1.57]... | {
"split": "train",
"index": 77851,
"acecode_id": "oss_1265",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a function `run_in_background(func: callable, *args, **kwargs)` that runs a given function `func` with specified arguments `*args` and keyword arguments `**kwargs` in the background and returns a Future representing the result of the function call. Your task is to impleme... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert execute_async(lambda: 1 + 1) == 2\", \"assert execute_async(lambda x: x * 2, 5) == 10\", \"assert execute_async(lambda: 'Hello, World!') == 'Hello, World!'\", \"assert execute_async(lambda x, y: x + y, 3, 4) == 7\", \"assert execute_async(lambda x: x**2, 10)... | {
"split": "train",
"index": 77852,
"acecode_id": "bigcode_python_fns_34897",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string that represents an API format. The string consists of a token and an API address separated by a colon. The API address contains protocol, address, and port separated by slashes. Your task is to implement a function `get_url_and_token(string: str) -> Tuple... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_url_and_token('mytoken:http://localhost:8080/api') == ('http://localhost:8080/rpc/v0', 'mytoken')\", \"assert get_url_and_token('secrettoken:https://example.com:443/path/to/resource') == ('https://example.com:443/rpc/v0', 'secrettoken')\", \"assert get_u... | {
"split": "train",
"index": 77853,
"acecode_id": "bigcode_python_fns_39707",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that filters a list of file names based on specific exclusion patterns. The function should take a list of file names and an optional list of exclusion patterns. The exclusion patterns should follow Unix shell-style wildcards (for example... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_files(['file1.txt', 'file2.py', 'file3.md', '.hiddenfile', 'script.py'], ['*.py']) == ['file1.txt', 'file3.md']\", \"assert filter_files(['image.png', 'document.pdf', 'notes.txt'], ['*.pdf']) == ['image.png', 'notes.txt']\", \"assert filter_files(['re... | {
"split": "train",
"index": 77854,
"acecode_id": "bigcode_python_fns_19302",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D integer array `adjacentPairs` of size `n - 1` where each `adjacentPairs[i] = [ui, vi]` signifies that the elements `ui` and `vi` are neighbours in some original integer array `nums` composed of `n` distinct elements. Your task is to implement a function that ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert restoreArray([[2,1],[3,4],[3,2]]) == [1,2,3,4] or [4,3,2,1]\", \"assert restoreArray([[4,-2],[1,4],[-3,1]]) == [-2,4,1,-3] or [-3,1,4,-2]\", \"assert restoreArray([[100000,-100000]]) == [100000,-100000] or [-100000,100000]\", \"assert restoreArray([[1,2],[2,... | {
"split": "train",
"index": 77855,
"acecode_id": "evol_14802",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that validates a list of file names related to a graph database. The function should iterate through the list of file names and perform specific checks based on the file names. If a file name contains 'Vertex.json.gz', it should re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_graph_files(['Vertex.json.gz']) == [True]\", \"assert validate_graph_files(['Edge.json.gz']) == [True]\", \"assert validate_graph_files(['OtherFile.txt']) == [False]\", \"assert validate_graph_files(['Vertex.json.gz', 'Edge.json.gz']) == [True, True... | {
"split": "train",
"index": 77856,
"acecode_id": "oss_18327",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that separates the even and odd numbers into two distinct lists and returns them. The first list should contain all the even numbers, and the second list should contain all the odd numbers. The order of numbers in the output lists ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert group_numbers([1, 3, 4, 6, 7, 8, 9]) == ([4, 6, 8], [1, 3, 7, 9])\", \"assert group_numbers([10, 21, 32, 43, 54]) == ([10, 32, 54], [21, 43])\", \"assert group_numbers([]) == ([], [])\", \"assert group_numbers([2, 4, 6, 8]) == ([2, 4, 6, 8], [])\", \"assert ... | {
"split": "train",
"index": 77857,
"acecode_id": "evol_27747",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `generate_ranges(starts: List[int], limits: List[int], deltas: List[int]) -> List[List[int]]` that takes three lists of integers, `starts`, `limits`, and `deltas`, and returns a list of lists. Each list in the output corresponds to a range generated from th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_ranges([0], [3], [1]) == [[0, 1, 2]]\", \"assert generate_ranges([1], [5], [1]) == [[1, 2, 3, 4]]\", \"assert generate_ranges([5], [5], [1]) == [[]]\", \"assert generate_ranges([0, 1, 2], [3, 4, 5], [1, 1, 1]) == [[0, 1, 2], [1, 2, 3], [2, 3, 4]]\",... | {
"split": "train",
"index": 77858,
"acecode_id": "bigcode_python_fns_2924",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of image URLs and a blog name as inputs, and returns a formatted list of strings indicating the download status of each image. The format of each string should be 'Downloaded {filename} from {url}' if the download was su... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert download_images(['http://example.com/image1.jpg', 'http://example.com/image2.jpg'], 'my_blog') == ['Downloaded image1.jpg from http://example.com/image1.jpg', 'Failed to download from http://example.com/image2.jpg']\", \"assert download_images(['http://examp... | {
"split": "train",
"index": 77859,
"acecode_id": "bigcode_python_fns_16533",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with solving the N-Queens puzzle with a twist. The n-queens puzzle requires you to place `n` queens on an `n x n` chessboard such that no two queens attack each other. However, you must also ensure that no three queens are in a straight line at any angle, includi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert solve_n_queens(1) == 1\", \"assert solve_n_queens(2) == 0\", \"assert solve_n_queens(3) == 0\", \"assert solve_n_queens(5) == 10\", \"assert solve_n_queens(6) == 4\", \"assert solve_n_queens(7) == 40\", \"assert solve_n_queens(8) == 92\", \"assert solve_n_qu... | {
"split": "train",
"index": 77860,
"acecode_id": "evol_14283",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with analyzing a simplified representation of entries from a WebAssembly (Wasm) module's import section. Each entry represents an import and has specific attributes. Your goal is to implement a function that extracts information about global variables from this l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_global_variables([{'kind': 0, 'type': {'content_type': 'i32'}, 'module_str': b'module1', 'field_str': b'var1'}, {'kind': 1, 'type': {'content_type': 'i64'}, 'module_str': b'module2', 'field_str': b'var2'}, {'kind': 0, 'type': {'content_type': 'f32'},... | {
"split": "train",
"index": 77861,
"acecode_id": "oss_17218",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that manages a TV show's information. The function should take in two strings representing the start date and end date of a TV show, and an integer representing the number of episodes. The function should return a dictionary with the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_tv_show('January 1, 2022', 'December 31, 2022', 70) == {'startDate': 'January 1, 2022', 'endDate': 'December 31, 2022', 'episodes': 70}\", \"assert manage_tv_show('February 15, 2021', 'November 30, 2021', 50) == {'startDate': 'February 15, 2021', 'end... | {
"split": "train",
"index": 77862,
"acecode_id": "oss_24212",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, write a function `lowercase_words` that takes this list as input and returns a new list where all the strings are converted to lowercase. The input list may contain words with mixed case letters. Your function should ensure that the original list remain... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lowercase_words(['Hello', 'WORLD', 'Python']) == ['hello', 'world', 'python']\", \"assert lowercase_words(['LeetCode', 'Is', 'Awesome']) == ['leetcode', 'is', 'awesome']\", \"assert lowercase_words(['TEST', 'test', 'Test']) == ['test', 'test', 'test']\", \"a... | {
"split": "train",
"index": 77863,
"acecode_id": "bigcode_python_fns_30568",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a nearest neighbor data retrieval system for a given dataset. The dataset consists of low-resolution and high-resolution data points. Your goal is to implement a function `retrieve_k_nearest_neighbors(low_res_point: List[float], high_res_data: L... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert retrieve_k_nearest_neighbors([1.0, 2.0], [[1.5, 2.5], [3.0, 4.0], [0.5, 1.5]], 2) == [[1.5, 2.5], [0.5, 1.5]]\", \"assert retrieve_k_nearest_neighbors([0.0, 0.0], [[1.0, 1.0], [2.0, 2.0], [3.0, 3.0]], 2) == [[1.0, 1.0], [2.0, 2.0]]\", \"assert retrieve_k_nea... | {
"split": "train",
"index": 77864,
"acecode_id": "oss_36139",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a 2D matrix consisting of character elements '0', '1', and other characters, implement a function that replaces each occurrence of the character '0' with 'x'. Then replace the horizontal and vertical neighbors of 'x' (which were originally '0') with 'y' if they consist of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replaceZero([['1', '0', '1'], ['0', '1', '0'], ['1', '0', '1']]) == [['1', 'x', '1'], ['x', '1', 'x'], ['1', 'x', '1']]\", \"assert replaceZero([['0', '0', '1'], ['0', '1', '0'], ['1', '0', '0']]) == [['x', 'x', '1'], ['x', '1', 'x'], ['1', 'x', 'x']]\", \"a... | {
"split": "train",
"index": 77865,
"acecode_id": "evol_11915",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that accepts three sets of integers as input. Your function should find the intersection of these three sets. If the intersection is not empty, it should return a list containing the intersection elements and a message indicating that all... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_sets({1, 2, 3}, {2, 3, 4}, {3, 4, 5}) == ([3], 'All three sets have a common element.')\", \"assert process_sets({1, 2, 3}, {4, 5, 6}, {7, 8, 9}) == ([], 'There is nothing notable.')\", \"assert process_sets({10, 20}, {30, 40, 10}, {10, 50}) == ([10]... | {
"split": "train",
"index": 77866,
"acecode_id": "oss_3326",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `rational_operations(num_1: int, num_2: int) -> Tuple[int, int, int]` that takes two integers `num_1` and `num_2`. The function should return a tuple containing the results of the following operations: addition, subtraction, and multiplication of the two nu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rational_operations(5, 10) == (15, -5, 50)\", \"assert rational_operations(0, 0) == (0, 0, 0)\", \"assert rational_operations(-5, -10) == (-15, 5, 50)\", \"assert rational_operations(-5, 0) == (-5, -5, 0)\", \"assert rational_operations(5, -10) == (-5, 15, -... | {
"split": "train",
"index": 77867,
"acecode_id": "evol_32037",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of template file contents based on a user-defined variable. Each template content is represented as a string, and it contains placeholders for variables that need to be replaced with the user-defined values. Your fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_templates(['Hello, <VAR>!', 'Goodbye, <VAR>!'], 'World', False) == ['Hello, World!', 'Goodbye, World!']\", \"assert process_templates(['<VAR> is here.'], 'Python', True) == ['Python is here.']\", \"assert process_templates(['No variable here.'], 'Tes... | {
"split": "train",
"index": 77868,
"acecode_id": "oss_19278",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that finds the last prime number in the list which is not a multiple of 5. You may assume that the input list will always contain at least one non-multiple of 5 prime number. The function should handle extremely large numbers effec... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_last_prime_not_multiple_of_five([2, 3, 5, 10, 15, 31, 97, 100, 101]) == 101\", \"assert find_last_prime_not_multiple_of_five([4, 6, 8, 9, 10, 12, 13, 17, 19]) == 19\", \"assert find_last_prime_not_multiple_of_five([11, 23, 35, 37, 49, 55]) == 37\", \"as... | {
"split": "train",
"index": 77869,
"acecode_id": "evol_4925",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python package metadata parser that extracts relevant information from a given code snippet. The code snippet represents the metadata of a Python package and contains various attributes such as package name, description, URL, version, author, emai... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_package_metadata('__all__ = [\\\"my_package\\\", \\\"A sample package\\\", \\\"https://example.com\\\", \\\"1.0.0\\\", \\\"John Doe\\\", \\\"john.doe@example.com\\\", \\\"MIT License\\\"]') == {'package_name': 'my_package', 'description': 'A sample pac... | {
"split": "train",
"index": 77870,
"acecode_id": "oss_13358",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks if a given string has expired based on a specified expiration time in seconds. The function should take two parameters: a string `data` that represents the data, and an integer `expire_time` that represents the expiration ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_data_expired('example data', 10) == False\", \"assert is_data_expired('example data', 0) == True\", \"assert is_data_expired('test', 5) == False\", \"assert is_data_expired('test', 3) == False\", \"assert is_data_expired('test', 10) == False\", \"assert i... | {
"split": "train",
"index": 77871,
"acecode_id": "oss_36231",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Develop a Python function that takes a string as input and returns a dictionary containing the frequency of each character in that string. The keys of the dictionary should be the characters, and the values should be their respective counts in the input string. The function sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert char_freq('Hello, World!') == {'H': 1, 'e': 1, 'l': 3, 'o': 2, ',': 1, ' ': 1, 'W': 1, 'r': 1, 'd': 1, '!': 1}\", \"assert char_freq('') == {}\", \"assert char_freq('12345!') == {'1': 1, '2': 1, '3': 1, '4': 1, '5': 1, '!': 1}\", \"assert char_freq('aaaAAA')... | {
"split": "train",
"index": 77872,
"acecode_id": "evol_34563",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple version control system. The function takes a list of strings representing commits in a repository and returns the latest commit in the format of the first 7 characters of its SHA. A commit is represented as a strin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert latest_commit(['commit: a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0']) == 'a1b2c3d'\", \"assert latest_commit(['commit: 1234567890abcdef1234567890abcdef12345678', 'commit: fedcba0987654321fedcba0987654321fedcba09']) == 'fedcba0'\", \"assert latest_commit(['comm... | {
"split": "train",
"index": 77873,
"acecode_id": "bigcode_python_fns_35704",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integer labels, your task is to implement a function `calculate_entropy(labels: List[int]) -> float` that calculates the entropy of the labels using the formula: `-Sum(Prob(class) * log2(Prob(class)))` for each unique class in the labels. The function should fir... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_entropy([1, 1, 1, 1]) == 0.0\", \"assert calculate_entropy([1, 2, 1, 2]) == 1.0\", \"assert calculate_entropy([1, 2, 3]) == 1.584962500721156\", \"assert calculate_entropy([1, 2, 3, 4]) == 2.0\", \"assert calculate_entropy([]) == 0.0\", \"assert ca... | {
"split": "train",
"index": 77874,
"acecode_id": "bigcode_python_fns_26908",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given an integer representing an IPv4 address, convert it to its corresponding string representation in the format 'A.B.C.D', where A, B, C, and D are integers between 0 and 255. Implement a function that takes one parameter, an integer, and returns the formatted IPv4 address s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert _toIPv4AddrString(0) == '0.0.0.0'\", \"assert _toIPv4AddrString(255) == '0.0.0.255'\", \"assert _toIPv4AddrString(256) == '0.0.1.0'\", \"assert _toIPv4AddrString(16777215) == '0.255.255.255'\", \"assert _toIPv4AddrString(4294967295) == '255.255.255.255'\", \... | {
"split": "train",
"index": 77875,
"acecode_id": "bigcode_python_fns_36805",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a Python function to execute a ternary search for a specific element in a pre-sorted numerical array. The function should take an array of integers and a target integer as input and return the index of the target if it exists in the array, or -1 if it does not. The array... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert ternary_search([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 5) == 4\", \"assert ternary_search([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 1) == 0\", \"assert ternary_search([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 10) == 9\", \"assert ternary_search([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 11) =... | {
"split": "train",
"index": 77876,
"acecode_id": "evol_27283",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `calculate_area(shape, *dimensions)` that calculates the area of a given geometric shape based on its type and dimensions. The `shape` parameter can be 'rectangle', 'square', or 'triangle'. The function should validate the dimensions based on the shape type... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_area('rectangle', 5, 3) == 15\", \"assert calculate_area('square', 4) == 16\", \"assert calculate_area('triangle', 6, 4) == 12\", \"assert calculate_area('rectangle', 10, 2) == 20\", \"assert calculate_area('square', 1) == 1\", \"assert calculate_a... | {
"split": "train",
"index": 77877,
"acecode_id": "evol_9820",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a tuple representing indices in a multi-dimensional array, replace the indices at specified dimensions with new values. The function should take an index tuple, the number of dimensions, a list of dimensions to replace, and a list of new indices. The output should be a ne... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_indices((1, 2, 3), 3, [0, 2], [4, 5]) == (4, 2, 5)\", \"assert replace_indices((0, 0, 0), 3, [0], [7]) == (7, 0, 0)\", \"assert replace_indices((1, 2), 2, [1], [3]) == (1, 3)\", \"assert replace_indices((5, 6), 2, [0], [8]) == (8, 6)\", \"assert repl... | {
"split": "train",
"index": 77878,
"acecode_id": "bigcode_python_fns_11347",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that determines if a given undirected graph represented as an adjacency list is connected. A connected graph is one where there is a path between every pair of vertices. Implement the function `is_connected(graph)` where `graph` is a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_connected({'A': ['B'], 'B': ['A']}) == True\", \"assert is_connected({'A': ['B'], 'B': ['A', 'C'], 'C': ['B']}) == True\", \"assert is_connected({'A': ['B'], 'B': ['A'], 'C': []}) == False\", \"assert is_connected({'A': ['B', 'C'], 'B': ['A'], 'C': ['A']}... | {
"split": "train",
"index": 77879,
"acecode_id": "oss_34002",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of transactions where each transaction consists of a date, a description, and an amount. Your task is to process the transactions and return a new list containing only the transactions that have a positive amount. Each transaction in the list is represented... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_positive_transactions([]) == []\", \"assert filter_positive_transactions([{'date': '2023-01-01', 'description': 'Salary', 'amount': 1000.0}]) == [{'date': '2023-01-01', 'description': 'Salary', 'amount': 1000.0}]\", \"assert filter_positive_transactio... | {
"split": "train",
"index": 77880,
"acecode_id": "bigcode_python_fns_10684",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the estimated total flux from a set of wavelength values and their corresponding flux density values. Implement a function `calculate_total_flux(wavelength: List[float], flambda: List[float], wlmin: Optional[float] = None, wlmax: Optional[float] ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_flux([1.0, 2.0], [10.0, 20.0]) == 15.0\", \"assert calculate_total_flux([1.0], [10.0]) == 0.0\", \"assert calculate_total_flux([1.0, 2.0, 3.0], [10.0, 20.0, 30.0], 2.0, 3.0) == 25.0\", \"assert calculate_total_flux([2.0, 3.0], [20.0, 30.0]) =... | {
"split": "train",
"index": 77881,
"acecode_id": "bigcode_python_fns_28257",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that calculates the total cost of a meal at a restaurant, considering the meal price, sales tax rate, and tip percentage. The function should take three parameters: meal_price (float), sales_tax (float), and tip_percentage (float). It should return the t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_expense(20, 0.05, 0.15) == 24.0\", \"assert calculate_total_expense(100, 0.08, 0.2) == 128.0\", \"assert calculate_total_expense(0, 0, 0) == 0.0\", \"assert calculate_total_expense(10, 0.1, 0.1) == 12.0\", \"assert calculate_total_expense(60,... | {
"split": "train",
"index": 77882,
"acecode_id": "evol_26153",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_bicycle` that takes three parameters: `brand` (a string), `model` (a string), and `color` (a string). The function should return a dictionary representing a bicycle with the keys 'brand', 'model', and 'color', and their corresponding values from the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_bicycle('Trek', 'Domane', 'Red') == {'brand': 'Trek', 'model': 'Domane', 'color': 'Red'}\", \"assert create_bicycle('Giant', 'Defy', 'Blue') == {'brand': 'Giant', 'model': 'Defy', 'color': 'Blue'}\", \"assert create_bicycle('Specialized', 'Roubaix', '... | {
"split": "train",
"index": 77883,
"acecode_id": "evol_32335",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `cumulative_product_of_primes(n: int, m: int) -> int` that calculates the cumulative product of all prime numbers present between a defined range of integers from `n` to `m`, inclusive. The function should return 1 if there are no prime numbers in the range... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cumulative_product_of_primes(2, 20) == 9699690\", \"assert cumulative_product_of_primes(10, 10) == 1\", \"assert cumulative_product_of_primes(1, 10) == 210\", \"assert cumulative_product_of_primes(5, 5) == 5\", \"assert cumulative_product_of_primes(0, 5) == ... | {
"split": "train",
"index": 77884,
"acecode_id": "evol_10765",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given the initial position and velocity of a particle in a three-dimensional space represented by lists of three floating-point numbers. Your task is to implement a function that updates the position of the particle based on its velocity over a specified time interval. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_position([0, 0, 0], [1, 1, 1], 1) == [1, 1, 1]\", \"assert update_position([10, 10, 10], [0, 0, 0], 5) == [10, 10, 10]\", \"assert update_position([1, 2, 3], [2, 2, 2], 3) == [7, 8, 9]\", \"assert update_position([-5, -5, -5], [5, 5, 5], 2) == [5, 5, ... | {
"split": "train",
"index": 77885,
"acecode_id": "bigcode_python_fns_31487",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, write a function `longest_increasing_subsequence` that returns the length of the longest strictly increasing subsequence in the array. The function should have the signature: `def longest_increasing_subsequence(arr: List[int]) -> int:`.\nPlease reaso... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longest_increasing_subsequence([10, 22, 9, 33, 21, 50, 41, 60]) == 5\", \"assert longest_increasing_subsequence([3, 10, 2, 1, 20]) == 3\", \"assert longest_increasing_subsequence([3, 2]) == 1\", \"assert longest_increasing_subsequence([1, 2, 3, 4, 5]) == 5\"... | {
"split": "train",
"index": 77886,
"acecode_id": "evol_15726",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates sending a tweet about a sunset. The function should take a string parameter representing the sunset message and return a confirmation message indicating that the tweet has been sent. The confirmation message should be in th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert send_sunset_tweet('The sunset is beautiful!') == 'Tweet sent: The sunset is beautiful!'\", \"assert send_sunset_tweet('Sunsets are proof that endings can be beautiful too.') == 'Tweet sent: Sunsets are proof that endings can be beautiful too.'\", \"assert se... | {
"split": "train",
"index": 77887,
"acecode_id": "bigcode_python_fns_41832",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D list representing an image where each element in the list is a pixel value (0 for black, 1 for white). Your task is to implement a function that resizes the image to a new specified width and height while maintaining the aspect ratio. If the aspect ratio of t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert resize_image([[1]], 2, 2) == [[1, 1], [1, 1]]\", \"assert resize_image([[0]], 5, 5) == [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]]\", \"assert resize_image([[1, 1, 1], [0, 0, 0]], 3, 2) == [[1, 1, 1], [0, 0, 0]]\", \... | {
"split": "train",
"index": 77888,
"acecode_id": "bigcode_python_fns_9271",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of integers to determine the number of unique integers in the list. Your function should take a single argument, which is a list of integers, and return an integer representing the count of unique integers. The i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_integers([1, 2, 3, 4, 5]) == 5\", \"assert count_unique_integers([1, 1, 1, 1]) == 1\", \"assert count_unique_integers([]) == 0\", \"assert count_unique_integers([-1, -1, -2, -2, -3]) == 3\", \"assert count_unique_integers([0, 0, 0]) == 1\", \"as... | {
"split": "train",
"index": 77889,
"acecode_id": "oss_30435",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to like a post in a social media application. The function `like_post(post_id: int) -> str` should take an integer `post_id` as input. If the `post_id` is less than 0, the function should return 'No Post Found to like!'. If the `post_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert like_post(-1) == 'No Post Found to like!'\", \"assert like_post(-10) == 'No Post Found to like!'\", \"assert like_post(0) == 'Post liked!'\", \"assert like_post(1) == 'Post liked!'\", \"assert like_post(999) == 'Post liked!'\", \"assert like_post(1000) == 'P... | {
"split": "train",
"index": 77890,
"acecode_id": "bigcode_python_fns_9719",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a given string is a palindrome. A palindrome is a string that reads the same backward as forward, ignoring spaces, punctuation, and capitalization. Implement the function `is_palindrome(s: str) -> bool` which takes a single... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_palindrome('A man, a plan, a canal: Panama') == True\", \"assert is_palindrome('racecar') == True\", \"assert is_palindrome('') == True\", \"assert is_palindrome('No lemon, no melon') == True\", \"assert is_palindrome('Was it a car or a cat I saw?') == Tr... | {
"split": "train",
"index": 77891,
"acecode_id": "oss_30457",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string that represents a mathematical expression containing non-negative integers and the operators '+', '-', '*', and '/'. Your task is to evaluate the expression and return the result as an integer. The expression will be well-formed and contain no spaces. Imp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate_expression('3+2*2') == 7\", \"assert evaluate_expression(' 3/2 ') == 1\", \"assert evaluate_expression(' 3+5 / 2 ') == 5\", \"assert evaluate_expression('14-3*2') == 8\", \"assert evaluate_expression('2-3+4') == 3\", \"assert evaluate_expression('2*... | {
"split": "train",
"index": 77892,
"acecode_id": "bigcode_python_fns_33472",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function `process_text` that takes a string `text` as input and performs the following operations: \n1. Remove all non-alphanumeric characters (punctuation, spaces, etc.) from the input string. \n2. Convert the resulting string to lowercase. \n3. C... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_text('A man, a plan, a canal: Panama') == 0\", \"assert process_text('racecar') == 0\", \"assert process_text('No lemon, no melon') == 0\", \"assert process_text('Hello, World!') == 1\", \"assert process_text('12321') == 0\", \"assert process_text('W... | {
"split": "train",
"index": 77893,
"acecode_id": "oss_33109",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given the coordinates of a point (x, y) and the dimensions of a bounding box defined by its width (w) and height (h), write a function `trunc(x: int, y: int, w: int, h: int) -> Tuple[int, int]` that truncates the coordinates to ensure that they lie within the bounding box. The ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert trunc(5, 5, 10, 10) == (5, 5)\", \"assert trunc(-1, 5, 10, 10) == (0, 5)\", \"assert trunc(5, -1, 10, 10) == (5, 0)\", \"assert trunc(11, 5, 10, 10) == (9, 5)\", \"assert trunc(5, 11, 10, 10) == (5, 9)\", \"assert trunc(0, 0, 10, 10) == (0, 0)\", \"assert tr... | {
"split": "train",
"index": 77894,
"acecode_id": "bigcode_python_fns_28730",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string and an integer. Write a function `concatenate_string_and_integer(s: str, n: int) -> str` that concatenates the string `s` with the string representation of the integer `n` and returns the resulting string.\nPlease reason step by step, then write a self-co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert concatenate_string_and_integer('Hello World', 1) == 'Hello World1'\", \"assert concatenate_string_and_integer('Python', 3) == 'Python3'\", \"assert concatenate_string_and_integer('Test', 0) == 'Test0'\", \"assert concatenate_string_and_integer('LeetCode', 42... | {
"split": "train",
"index": 77895,
"acecode_id": "evol_6895",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing contigs (continuous sequences of DNA) and a dictionary representing overlaps between these contigs. Your task is to implement a function that takes a string representing a contig end, a list of contigs, and a dictionary of overlaps. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert censor_contig('A', ['A', 'B', 'C'], {'A': {'B': 1}, 'B': {'C': 1}}) == (['B', 'C'], {'B': {'C': 1}})\", \"assert censor_contig('B', ['A', 'B', 'C'], {'A': {'B': 1}, 'B': {'C': 1}}) == (['A', 'C'], {'A': {}})\", \"assert censor_contig('D', ['A', 'B', 'C'], {'... | {
"split": "train",
"index": 77896,
"acecode_id": "bigcode_python_fns_7285",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a 2D board of characters and a list of words, return all words from the list that can be found in the board. Words can be constructed from letters of sequentially adjacent cells, where adjacent cells are horizontally or vertically neighboring. The same letter cell may not... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert findWords([['o', 'a', 'a', 'n'], ['e', 't', 'a', 'e'], ['i', 'h', 'k', 'r'], ['i', 'f', 'l', 'v']], ['oath', 'pea', 'eat', 'rain']) == ['oath', 'eat']\", \"assert findWords([['a']], ['a', 'b', 'c']) == ['a']\", \"assert findWords([['b', 'a', 'b'], ['a', 'b',... | {
"split": "train",
"index": 77897,
"acecode_id": "evol_18267",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple messaging system. The function should allow users to send and receive messages, and return all messages sent to a specific recipient. Your task is to implement the `message_system` function with the following speci... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert message_system([('Alice', 'Hello'), ('Bob', 'Hi there'), ('Alice', 'How are you?')], 'Alice') == ['Hello', 'How are you?']\", \"assert message_system([('Alice', 'Hello'), ('Bob', 'Hi there'), ('Alice', 'How are you?')], 'Bob') == ['Hi there']\", \"assert mes... | {
"split": "train",
"index": 77898,
"acecode_id": "oss_33410",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with developing a function that extracts information from a 'Todo' comment in a Python code snippet. The 'Todo' comment follows a specific format, beginning with 'Todo:' and ending with '\"\"\"'. Your function should handle cases where the 'Todo' comment might co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_todo_info('Todo:\\\\n Implement the data validation logic.\\\\n\\\"\\\"\\\"') == 'Implement the data validation logic.'\", \"assert parse_todo_info('Todo:\\\\n Fix the bug in the user login code.\\\\n\\\"\\\"\\\"') == 'Fix the bug in the user log... | {
"split": "train",
"index": 77899,
"acecode_id": "oss_2216",
"num_tests": 14
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.