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 `scrape_headers(url: str) -> List[str]` that takes a URL as input, performs a web request to fetch the HTML content, and extracts all the <h1> headings from the page. If the webpage is unresponsive or the request fails, the function should return an empty l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert scrape_headers('http://example.com') == ['Example Domain']\", \"assert scrape_headers('http://nonexistentwebsite.xyz') == []\", \"assert scrape_headers('http://httpstat.us/404') == []\", \"assert scrape_headers('http://httpstat.us/500') == []\", \"assert scr... | {
"split": "train",
"index": 62300,
"acecode_id": "evol_34962",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Write a Python generator function `object_attributes_generator` that takes a list of objects as input and yields a dictionary containing the attributes of each object. Each object will have attributes defined in its `__dict__`. You need to implement this function and ensure tha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert list(object_attributes_generator([Person('Alice', 25)])) == [{'name': 'Alice', 'age': 25}]\", \"assert list(object_attributes_generator([Person('Bob', 30)])) == [{'name': 'Bob', 'age': 30}]\", \"assert list(object_attributes_generator([Person('Charlie', 22),... | {
"split": "train",
"index": 62301,
"acecode_id": "oss_34590",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates processing data partitions in a multi-threaded environment. Your function should take a list of data partitions and return a flattened list containing all the elements from the partitions. The function should also appen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_partitions([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == [1, 2, 3, 4, 5, 6, 7, 8, 9, 'EOF']\", \"assert process_partitions([[10, 20], [30], [40, 50]]) == [10, 20, 30, 40, 50, 'EOF']\", \"assert process_partitions([[1], [2], [3], [4], [5]]) == [1, 2, 3, 4, 5,... | {
"split": "train",
"index": 62302,
"acecode_id": "oss_11092",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `get_even_squares(nums)` that returns a list of the squares of the integers that are even. Each integer in the input list should be squared, and only the squares that are even should be included in the output list. The output list ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_even_squares([1, 2, 3, 4]) == [4, 16]\", \"assert get_even_squares([0, 1, 2, 3]) == [0, 4]\", \"assert get_even_squares([-1, -2, -3, -4]) == [4, 16]\", \"assert get_even_squares([5, 6, 7, 8]) == [36, 64]\", \"assert get_even_squares([-5, -6, -7, -8]) == ... | {
"split": "train",
"index": 62303,
"acecode_id": "evol_6018",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the process of creating a client for a service. The function should take in a dictionary of options containing the following keys: 'host', 'tenant', 'user', 'password', 'tfa_code', and 'token'. If the 'host' is not provided... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_client({'host': None, 'tenant': 'mytenant', 'user': 'myuser', 'password': 'mypassword', 'tfa_code': '123456', 'token': None}, 'myhost.com') == {'host': 'myhost.com', 'tenant': 'mytenant', 'user': 'myuser', 'password': 'mypassword', 'tfa_code': '123456... | {
"split": "train",
"index": 62304,
"acecode_id": "bigcode_python_fns_12310",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a JSON string representing objects in an image, a dictionary that maps colors to labels, and a list of static labels. Your task is to extract rectangle geometries and their corresponding labels from the JSON string. Each rectangle is defined by its top-left and bo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_labels('{\\\"objects\\\":[{\\\"type\\\":\\\"image\\\",\\\"width\\\":100,\\\"height\\\":100},{\\\"type\\\":\\\"rect\\\",\\\"left\\\":10,\\\"top\\\":10,\\\"right\\\":20,\\\"bottom\\\":20,\\\"stroke\\\":\\\"red\\\"},{\\\"type\\\":\\\"rect\\\",\\\"left\\\"... | {
"split": "train",
"index": 62305,
"acecode_id": "bigcode_python_fns_48599",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates a session cookie for an OAuth reauthorization process. The function should take two arguments: a string 'cookie' representing the session cookie from a user's request and a string 'valid_cookie' representing the expected va... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert authorize_oauth('session123', 'session123') == True\", \"assert authorize_oauth('invalid_session', 'session123') == False\", \"assert authorize_oauth('', 'session123') == False\", \"assert authorize_oauth('session123', '') == False\", \"assert authorize_oaut... | {
"split": "train",
"index": 62306,
"acecode_id": "bigcode_python_fns_46698",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that formats user profile information into a displayable string. The function `format_user_profile` should take three parameters: `username` (a string representing the user's name), `age` (an integer representing the user's age), and `loc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_user_profile('Alice', 30, 'New York') == 'Username: Alice, Age: 30, Location: New York'\", \"assert format_user_profile('Bob', 25, 'Los Angeles') == 'Username: Bob, Age: 25, Location: Los Angeles'\", \"assert format_user_profile('Charlie', 35, 'Chicag... | {
"split": "train",
"index": 62307,
"acecode_id": "bigcode_python_fns_892",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string `name` and an optional string `library`. Your task is to create a function `go_test(name: str, library: Optional[str] = None) -> List[str]` that returns a list containing the string 'name' and, if `library` is provided, the string 'library' embedded withi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert go_test('Test1') == ['Embedded: Test1']\", \"assert go_test('Test2', 'Lib1') == ['Embedded: Test2', 'Embedded: Lib1']\", \"assert go_test('Example') == ['Embedded: Example']\", \"assert go_test('Example', 'LibraryA') == ['Embedded: Example', 'Embedded: Libra... | {
"split": "train",
"index": 62308,
"acecode_id": "bigcode_python_fns_16673",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_prime(n: int) -> bool` that determines if a given integer n is a prime number. A prime number is defined as a natural number greater than 1 that is not a product of two smaller natural numbers. The function should return True if n is prime, and False ot... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_prime(2) == True\", \"assert is_prime(3) == True\", \"assert is_prime(4) == False\", \"assert is_prime(5) == True\", \"assert is_prime(6) == False\", \"assert is_prime(7) == True\", \"assert is_prime(8) == False\", \"assert is_prime(9) == False\", \"asser... | {
"split": "train",
"index": 62309,
"acecode_id": "evol_22724",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a data compression algorithm for a multi-dimensional array. Your goal is to create a function that can efficiently compress and store multi-dimensional data while handling overlapping data types. The function should take a multi-dimensional arra... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compress_and_handle_overlap([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == ([1, 2, 3, 4, 5, 6, 7, 8, 9], {'overlap': []})\", \"assert compress_and_handle_overlap([[1, 2, 3], [1, 4, 5]]) == ([1, 2, 3, 1, 4, 5], {'overlap': [1]})\", \"assert compress_and_handle_overlap... | {
"split": "train",
"index": 62310,
"acecode_id": "oss_18355",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string, write a function that returns the longest substring without repeating characters. The function should be case-sensitive. If there are multiple longest substrings, return the first one encountered. Additionally, return the starting and ending indices of this subs... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longest_substring('abcabcbb') == ('abc', (0, 2))\", \"assert longest_substring('bbbbb') == ('b', (0, 0))\", \"assert longest_substring('pwwkew') == ('wke', (2, 4))\", \"assert longest_substring('') == ('', (0, -1))\", \"assert longest_substring('a') == ('a',... | {
"split": "train",
"index": 62311,
"acecode_id": "evol_21850",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing file names. Your task is to implement a function that identifies and returns the first file name that appears to be part of a multi-part post. A file is considered part of a multi-part post if it matches a specific naming pattern def... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_first_multi_part_file(['file1.txt', 'file2.txt', 'file3.txt'], ['file*.txt']) == 'file1.txt'\", \"assert find_first_multi_part_file(['part1.zip', 'part2.zip'], ['part?.zip']) == 'part1.zip'\", \"assert find_first_multi_part_file(['image1.png', 'image2.p... | {
"split": "train",
"index": 62312,
"acecode_id": "bigcode_python_fns_38000",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `get_access_token` that simulates the process of requesting an access token from a hypothetical API. The function takes no parameters and returns a string representing an access token. For this exercise, the function should return a hardc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_access_token() == '12345-abcde-67890-fghij'\", \"assert get_access_token() == '12345-abcde-67890-fghij'\", \"assert get_access_token() == '12345-abcde-67890-fghij'\", \"assert get_access_token() == '12345-abcde-67890-fghij'\", \"assert get_access_token()... | {
"split": "train",
"index": 62313,
"acecode_id": "bigcode_python_fns_36944",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function to calculate the greatest common divisor (GCD) of two positive integers. The GCD of two numbers is the largest positive integer that divides both numbers without leaving a remainder. Write a function `gcd(x: int, y: int) -> int` that returns the GCD of `x` ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert gcd(36, 24) == 12\", \"assert gcd(48, 18) == 6\", \"assert gcd(101, 10) == 1\", \"assert gcd(100, 25) == 25\", \"assert gcd(7, 13) == 1\", \"assert gcd(77, 14) == 7\", \"assert gcd(56, 42) == 14\", \"assert gcd(15, 5) == 5\", \"assert gcd(81, 27) == 27\", \"... | {
"split": "train",
"index": 62314,
"acecode_id": "evol_7898",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the weighted average of a document's term frequencies using inverse document frequency (IDF) values. The function takes in a dictionary `document_tokens` containing word IDs as keys and their respective term frequencie... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_weighted_average({1: 0, 2: 0, 3: 0}, [0.5, 0.5, 0.5]) == [0.0, 0.0, 0.0]\", \"assert calculate_weighted_average({1: 1}, [0.0]) == [0.0]\", \"assert calculate_weighted_average({1: 7}, [0.5]) == [3.5]\", \"assert calculate_weighted_average({1: 2}, [1... | {
"split": "train",
"index": 62315,
"acecode_id": "oss_16927",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that takes two strings as input: `activity_task_config` and `domain`. The function should return a tuple containing these two strings. Implement the function `get_task_info(activity_task_config: str, domain: str) -> Tuple[str, str]` that r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_task_info('ConfigA', 'DomainX') == ('ConfigA', 'DomainX')\", \"assert get_task_info('ConfigB', 'DomainY') == ('ConfigB', 'DomainY')\", \"assert get_task_info('TaskConfig1', 'MainDomain') == ('TaskConfig1', 'MainDomain')\", \"assert get_task_info('Task123... | {
"split": "train",
"index": 62316,
"acecode_id": "oss_358",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, where each string represents a file name (with or without extensions) that may contain a scheme. Your task is to implement a function that determines how many of these file names end with a specific file extension, which is provided as an additi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_files_with_extension(['scheme.xcodeproj', 'test.txt', 'example.xcodeproj', 'readme.md'], 'xcodeproj') == 2\", \"assert count_files_with_extension(['Scheme.XCODEPROJ', 'doc.docx', 'config.xcodeproj'], 'xcodeproj') == 2\", \"assert count_files_with_exten... | {
"split": "train",
"index": 62317,
"acecode_id": "bigcode_python_fns_16201",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a given string by removing any characters that are not alphanumeric or one of the following special characters: '.', '_', or '-'. The function should return the processed string. If the input string is empty, the function s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_valid_segment('abc123') == 'abc123'\", \"assert get_valid_segment('abc!@#') == 'abc'\", \"assert get_valid_segment('abc.def-ghi_jkl') == 'abc.def-ghi_jkl'\", \"assert get_valid_segment('') == None\", \"assert get_valid_segment('hello_world!') == 'hello_w... | {
"split": "train",
"index": 62318,
"acecode_id": "bigcode_python_fns_4873",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of keywords and their corresponding labels. Your task is to implement a function `get_keywords_and_labels(keywords: List[str], labels: List[str]) -> Tuple[List[str], List[str]]` that takes two lists: one containing keywords and the other containing labels. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_keywords_and_labels(['machine learning', 'data analysis', 'neural networks'], ['1', '0', '1']) == (['machine learning', 'data analysis', 'neural networks'], ['1', '0', '1'])\", \"assert get_keywords_and_labels(['data visualization', 'data analysis'], ['0... | {
"split": "train",
"index": 62319,
"acecode_id": "oss_24368",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a mask output based on a given input list of integers. The mask output should be a list of the same length, where each element is 1 if the corresponding input element is even, and 0 if it is odd. Implement a function named ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_mask_output([1, 2, 3, 4]) == [0, 1, 0, 1]\", \"assert generate_mask_output([0, 1, 2, 3, 4]) == [1, 0, 1, 0, 1]\", \"assert generate_mask_output([-1, -2, -3, -4]) == [0, 1, 0, 1]\", \"assert generate_mask_output([]) == []\", \"assert generate_mask_ou... | {
"split": "train",
"index": 62320,
"acecode_id": "oss_36714",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the process of filling out a user form based on the current date and user's name. The function should take two parameters: `today`, which represents the current date as a string in the format 'YYYY-MM-DD', and `user`, w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fill_form('2023-10-01', 'Alice Smith') == 'Form filled out for Alice Smith on 2023-10-01'\", \"assert fill_form('2023-10-02', 'Bob Johnson') == 'Form filled out for Bob Johnson on 2023-10-02'\", \"assert fill_form('2023-10-03', 'Charlie Brown') == 'Form fill... | {
"split": "train",
"index": 62321,
"acecode_id": "oss_5144",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the deletion of a table in a database. The function should take a string input representing the name of the table and return a confirmation message indicating that the table has been deleted. The function should handle ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delete_table('Users') == 'Table Users deleted successfully.'\", \"assert delete_table('Orders') == 'Table Orders deleted successfully.'\", \"assert delete_table(' ') == 'Invalid table name.'\", \"assert delete_table('') == 'Invalid table name.'\", \"assert d... | {
"split": "train",
"index": 62322,
"acecode_id": "bigcode_python_fns_22026",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that converts a set of attributes into a string format with specified delimiters and ending characters. The function should take four parameters: `name` (a string), `SizeE` (an integer), `SizeV` (an integer), and `SumE` (an integer). ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert to_string('Object1', 10, 20, 30) == 'Object1,10,20,30\\\\n'\", \"assert to_string('Object2', 5, 15, 25, delimiter='|') == 'Object2|5|15|25\\\\n'\", \"assert to_string('Test', 0, 0, 0, ending='!') == 'Test,0,0,0!'\", \"assert to_string('Sample', 1, 2, 3, deli... | {
"split": "train",
"index": 62323,
"acecode_id": "oss_2531",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a fingerprinting algorithm that produces unique fingerprints for various data structures. Your goal is to create a function `fingerprint(data: Union[List[int], Tuple[str, str]]) -> str` that can handle two types of inputs: 1. Lists: The function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fingerprint([1, 2, 3]) != fingerprint([1, 3, 2])\", \"assert fingerprint([1, 2, 3]) == fingerprint([1, 2, 3])\", \"assert fingerprint([4, 5, 6]) != fingerprint([7, 8, 9])\", \"assert fingerprint((\\\"file1.txt\\\", \\\"content A\\\")) != fingerprint((\\\"fil... | {
"split": "train",
"index": 62324,
"acecode_id": "oss_15100",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `multiply(num1, num2)` that takes two parameters, `num1` and `num2`. The function should return the product of the two numbers. If either parameter is not a number (i.e., not an integer or a float), the function should return a string 'TypeError: Only integ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multiply(2, 3) == 6\", \"assert multiply(2.5, 4) == 10.0\", \"assert multiply(-1, 5) == -5\", \"assert multiply(0, 100) == 0\", \"assert multiply(7, 0) == 0\", \"assert multiply(3.14, 2) == 6.28\", \"assert multiply(10, -2.5) == -25.0\", \"assert multiply('a... | {
"split": "train",
"index": 62325,
"acecode_id": "evol_31142",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a 2D list of shape (2, M) representing M samples of a curve, implement a function that calculates the variance of the curve. The first row of the 2D list contains the x-coordinates, and the second row contains the corresponding y-coordinates of the samples. The variance i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_variance([[0, 0, 0], [0, 0, 0]]) == [0.0, 0.0]\", \"assert calculate_variance([[1, 2], [3, 4]]) == [0.25, 0.25]\", \"assert calculate_variance([[1, 3], [2, 4]]) == [1.0, 1.0]\", \"assert calculate_variance([[5, 6, 7, 8], [1, 2, 3, 4]]) == [1.25, 1.... | {
"split": "train",
"index": 62326,
"acecode_id": "bigcode_python_fns_28191",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, your task is to replace all instances of the integer 7 or 8 in the list with the string 'DATIVE'. If an integer is present more than once in the list, replace each occurrence with 'DATIVE'. Return the modified list of integers and strings. \n\nFor exam... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_dative([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert replace_dative([7, 8, 9]) == ['DATIVE', 'DATIVE', 9]\", \"assert replace_dative([1, 2, 3, 8, 7, 7]) == [1, 2, 3, 'DATIVE', 'DATIVE', 'DATIVE']\", \"assert replace_dative([10, 11, 12]) == [10, 11,... | {
"split": "train",
"index": 62327,
"acecode_id": "bigcode_python_fns_44088",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `generate_secret_code()` that generates a unique, unguessable secret code comprising of sixteen characters. The code should include at least one uppercase letter, one lowercase letter, one numerical digit, and one special character. Additionally, the code must ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert len(generate_secret_code()) == 16\", \"assert any(c.islower() for c in generate_secret_code())\", \"assert any(c.isupper() for c in generate_secret_code())\", \"assert any(c.isdigit() for c in generate_secret_code())\", \"assert any(c in string.punctuation f... | {
"split": "train",
"index": 62328,
"acecode_id": "evol_27917",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the dimensions of a box in 3D space, where the first integer represents the length, the second integer the width, and the third integer the height. Your task is to implement a function `calculate_volume(dimensions: List[int]) -> flo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_volume([7, 7, 5]) == 245.0\", \"assert calculate_volume([1, 1, 1]) == 1.0\", \"assert calculate_volume([10, 5, 2]) == 100.0\", \"assert calculate_volume([3, 3, 3]) == 27.0\", \"assert calculate_volume([4, 5, 6]) == 120.0\", \"assert calculate_volum... | {
"split": "train",
"index": 62329,
"acecode_id": "bigcode_python_fns_22238",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of rankings represented as a list of floats. The rankings may include finite numbers, NaN (not a number), and positive or negative infinity. Your task is to transform these rankings into a list of integers based on the following rules: \n1. If the ranking i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_rankings([3.5, float('nan'), float('inf'), -float('inf')]) == [3, 0, 1, -1]\", \"assert transform_rankings([1.0, 2.0, float('nan'), 4.5]) == [1, 2, 0, 4]\", \"assert transform_rankings([-2.5, float('nan'), float('-inf'), 0.0]) == [-2, 0, -1, 0]\", ... | {
"split": "train",
"index": 62330,
"acecode_id": "bigcode_python_fns_35367",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a 2D grid of distinct integers where the grid size is N x N, and N is at least 2, implement a function `maxSumPath(grid: List[List[int]], k: int) -> List[Union[int, List[int]]]` that returns the maximal possible sum of exactly k cells within the grid and a list of the val... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert maxSumPath([[1,2],[3,4]], 2) == [7, [4, 3]]\", \"assert maxSumPath([[1,3,5],[2,4,6],[8,7,9]], 3) == [24, [9, 8, 7]]\", \"assert maxSumPath([[10,20],[30,40]], 1) == [40, [40]]\", \"assert maxSumPath([[1,1],[1,1]], 1) == [1, [1]]\", \"assert maxSumPath([[1,2,3... | {
"split": "train",
"index": 62331,
"acecode_id": "evol_17057",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers that represent the pixel data of an image. Each integer is either 0 or 1, where 0 represents black and 1 represents white. You are also given an integer 'border' which specifies the number of pixels to ignore from the beginning and the end of th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert invert_image_pixels([0, 0, 0, 1, 1, 1], 0) == [1, 1, 1, 0, 0, 0]\", \"assert invert_image_pixels([1, 1, 0, 0, 1, 0], 3) == []\", \"assert invert_image_pixels([0, 1, 0], 0) == [1, 0, 1]\", \"assert invert_image_pixels([1, 0, 0, 1], 0) == [0, 1, 1, 0]\", \"ass... | {
"split": "train",
"index": 62332,
"acecode_id": "bigcode_python_fns_430",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates retrieving memory information from a CUDA-enabled device based on specific conditions. Write a function `get_device_memory_info` that takes three parameters: \n- `cuda`: a boolean indicating whether CUDA is enabled or not \... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_device_memory_info(True, 'total', True) == 'Memory Info: total Memory'\", \"assert get_device_memory_info(True, 'free', True) == 'Memory Info: free Memory'\", \"assert get_device_memory_info(True, 'total', False) == 'Memory Info: total Memory'\", \"asser... | {
"split": "train",
"index": 62333,
"acecode_id": "oss_5946",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a multidimensional list, implement a function `sum_multidimensional_list(lst)` that calculates the sum of all numeric values (integers and floats) present in the list. The function should handle nested lists and ignore any non-numeric values. Do not use the built-in `sum`... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_multidimensional_list([1, 2, 3]) == 6\", \"assert sum_multidimensional_list([[1, 2], [3, 4]]) == 10\", \"assert sum_multidimensional_list([1, 'a', 2.5, None]) == 3.5\", \"assert sum_multidimensional_list([[], [], []]) == 0\", \"assert sum_multidimensiona... | {
"split": "train",
"index": 62334,
"acecode_id": "evol_30249",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with developing a function that calculates the time difference between two timestamps: the acquisition time and the injection time. The function should take the acquisition hour, acquisition minute, injection hour, and injection minute as input parameters and ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculateTimeDifference(10, 30, 9, 45) == '0 hours and 45 minutes'\", \"assert calculateTimeDifference(12, 0, 12, 0) == '0 hours and 0 minutes'\", \"assert calculateTimeDifference(11, 0, 12, 30) == '1 hours and 30 minutes'\", \"assert calculateTimeDifference... | {
"split": "train",
"index": 62335,
"acecode_id": "oss_16316",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of lists, where each inner list contains 10 integers. Your task is to process the list such that you do the following: 1) Replace the 10th element of each inner list with its sign (1 for positive, -1 for negative, and 0 for zero), 2) Replace the last elemen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_population([[3, 2, 1, 0, -1, -2, -3, -4, -5, 6], [-1, -2, -3, -4, -5, -6, -7, -8, -9, 10]]) == [[3, 2, 1, 0, -1, -2, -3, -4, -5, 1], [-1, -2, -3, -4, -5, -6, -7, -8, -9, 1]]\", \"assert process_population([[1, 2, 3, 4, 5, 6, 7, 8, 9, 0]]) == [[1, 2, ... | {
"split": "train",
"index": 62336,
"acecode_id": "bigcode_python_fns_48269",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a string that may contain backspace characters represented by '\\b'. Your task is to implement a function that processes this input string and produces a new string where each backspace character removes the previous character from the result string. If a backspac... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_backspaces('hello\\\\b world') == 'hell world'\", \"assert process_backspaces('up\\\\b\\\\bdown') == 'down'\", \"assert process_backspaces('\\\\bstart') == 'start'\", \"assert process_backspaces('text with no backspaces') == 'text with no backspaces'... | {
"split": "train",
"index": 62337,
"acecode_id": "bigcode_python_fns_44441",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the total price of products based on their unit price and quantity from a list of products. Each product is represented as a list containing two values: the unit price and the quantity. The function should be able to handle nested lists, whe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_price([[10, 2], [5, -3]]) == None\", \"assert calculate_price([[10, 2], ['a', 3]]) == None\", \"assert calculate_price([[10, 2], [5, 3], [10, 'b']]) == None\", \"assert calculate_price([[10, 2]]) == 20\", \"assert calculate_price([10, 2]) == None\"... | {
"split": "train",
"index": 62338,
"acecode_id": "evol_24450",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple monitoring system for dependencies in a software application. You need to implement a function `monitor_dependency_status(dependency: str, is_up: bool) -> str` that takes in two parameters: a string `dependency` representing the name of the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert monitor_dependency_status('Database', True) == 'The dependency Database is currently up.'\", \"assert monitor_dependency_status('Cache', False) == 'The dependency Cache is currently down.'\", \"assert monitor_dependency_status('API', True) == 'The dependency... | {
"split": "train",
"index": 62339,
"acecode_id": "bigcode_python_fns_5221",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers and a mapping list. Your task is to create a new list that contains the elements from the original list based on the indices specified in the mapping list. If the mapping list contains an index that is out of bounds for the original list, it sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert map_values([10, 20, 30, 40], [0, 2]) == [10, 30]\", \"assert map_values([1, 2, 3], [1, 1, 2]) == [2, 2, 3]\", \"assert map_values([5, 6, 7, 8], [3, 0, 2]) == [8, 5, 7]\", \"assert map_values([100, 200, 300], [2]) == [300]\", \"assert map_values([], [0]) == [... | {
"split": "train",
"index": 62340,
"acecode_id": "bigcode_python_fns_44781",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, where each string is a filename that ends with a hash value separated by a space. Your task is to implement a function `get_hash_for_filename(filenames: List[str], target_filename: str) -> str` that returns the hash value corresponding to the ta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_hash_for_filename(['file1.txt abc123', 'file2.txt def456'], 'file1.txt') == 'abc123'\", \"assert get_hash_for_filename(['file1.txt abc123', 'file2.txt def456'], 'file2.txt') == 'def456'\", \"assert get_hash_for_filename(['document.docx xyz789'], 'documen... | {
"split": "train",
"index": 62341,
"acecode_id": "bigcode_python_fns_41808",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of objects, where each object may or may not have an attribute called 'inertia_constant'. Write a function called 'has_inertia_constant' that takes a list of objects as input and returns True if the third object in the list has the 'inertia_constant' attrib... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_inertia_constant([{}, {}, {}]) == False\", \"assert has_inertia_constant([1, 2, 3]) == False\", \"assert has_inertia_constant([1, 2]) == False\", \"assert has_inertia_constant([{'name': 'A'}, {'name': 'B'}, {'name': 'C'}]) == False\", \"assert has_inerti... | {
"split": "train",
"index": 62342,
"acecode_id": "bigcode_python_fns_30876",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a list of fruits, implement a function `find_index(fruit: str, fruits: List[str]) -> Optional[int]` that returns the index of the specified fruit in the list. If the fruit is not found, return None. You should not use the built-in index method.\nPlease reason step by step... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_index('kiwi', ['strawberry', 'peach', 'blueberry', 'kiwi']) == 3\", \"assert find_index('blueberry', ['strawberry', 'peach', 'blueberry', 'kiwi']) == 2\", \"assert find_index('strawberry', ['strawberry', 'peach', 'blueberry', 'kiwi']) == 0\", \"assert f... | {
"split": "train",
"index": 62343,
"acecode_id": "evol_11452",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that truncates a given string to the first four characters. If the string is shorter than four characters, the function should return the entire string. The function should take a single parameter, input_string, which is a string. Implement the function ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert truncate_string('HelloWorld') == 'Hell'\", \"assert truncate_string('Hi') == 'Hi'\", \"assert truncate_string('Python') == 'Pyth'\", \"assert truncate_string('abcd') == 'abcd'\", \"assert truncate_string('abc') == 'abc'\", \"assert truncate_string('a') == 'a... | {
"split": "train",
"index": 62344,
"acecode_id": "evol_17474",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a string and returns a new string with all vowels and special characters removed, leaving only the alphanumeric characters. The function should preserve the order of the remaining characters. Write a function named remove_vowels_and_special_chars... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_vowels_and_special_chars('') == ''\", \"assert remove_vowels_and_special_chars('abcdef\\\\nghijklm') == 'bcdfghjklm'\", \"assert remove_vowels_and_special_chars('abcdef') == 'bcdf'\", \"assert remove_vowels_and_special_chars('aaaaa') == ''\", \"assert... | {
"split": "train",
"index": 62345,
"acecode_id": "evol_27435",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the behavior of a simple radio station. Your function should take in the name of the radio station and its URL, and return a string that displays the station name and URL in the format: 'Station Name: {station_name}\nUR... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert display_radio_station('MyStation', 'http://mystation.com', True) == 'Station Name: MyStation\\\\nURL: http://mystation.com\\\\nThe station is currently running.'\", \"assert display_radio_station('JazzFM', 'http://jazzfm.com', False) == 'Station Name: JazzFM... | {
"split": "train",
"index": 62346,
"acecode_id": "oss_11971",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a function and a string as inputs. This function should call the input function with the provided string and return the output. Implement a single function named 'call_function_with_string' that receives two parameters: a funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert call_function_with_string(str.upper, 'hello') == 'HELLO'\", \"assert call_function_with_string(str.lower, 'WORLD') == 'world'\", \"assert call_function_with_string(str.capitalize, 'python') == 'Python'\", \"assert call_function_with_string(str.split, 'a b c'... | {
"split": "train",
"index": 62347,
"acecode_id": "bigcode_python_fns_6306",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a list that may contain various data types including integers, floats, strings, and nested lists, write a function `multiply_all_numbers` that returns the product of all numeric values (integers and floats) in the list. Non-numeric values should be ignored. The function s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multiply_all_numbers([1, 2, 3]) == 6\", \"assert multiply_all_numbers([1, 'text', 3.5]) == 3.5\", \"assert multiply_all_numbers([1, [2, [3, 'ignore', 4], 5], 6]) == 720\", \"assert multiply_all_numbers([None, True, 5, [6, [7]]]) == 210\", \"assert multiply_a... | {
"split": "train",
"index": 62348,
"acecode_id": "evol_2689",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Write a recursive function in Python to calculate the largest prime factor of a given positive integer n. The function should take an integer n as input and return the largest prime factor of that number.\nPlease reason step by step, then write a self-contained Python solution.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_largest_prime(100) == 5\", \"assert find_largest_prime(56) == 7\", \"assert find_largest_prime(13195) == 29\", \"assert find_largest_prime(17) == 17\", \"assert find_largest_prime(24) == 3\", \"assert find_largest_prime(45) == 5\", \"assert find_largest... | {
"split": "train",
"index": 62349,
"acecode_id": "evol_4137",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a tuple of three integers, implement a function `find_minimum` that returns the minimum integer among the three numbers.\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 find_minimum((17, 9, 5)) == 5\", \"assert find_minimum((1, 2, 3)) == 1\", \"assert find_minimum((-1, -2, -3)) == -3\", \"assert find_minimum((0, 0, 0)) == 0\", \"assert find_minimum((100, 50, 25)) == 25\", \"assert find_minimum((5, 5, 5)) == 5\", \"assert fi... | {
"split": "train",
"index": 62350,
"acecode_id": "evol_27919",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that determines the access level of a given variable name based on specific naming conventions in Python. The access levels are defined as follows: If the variable name starts and ends with double underscores (`__`), and has a length grea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_access('__private__') == 'PRIVATE'\", \"assert get_access('__abc__') == 'PRIVATE'\", \"assert get_access('_protected') == 'PROTECTED'\", \"assert get_access('public') == 'PUBLIC'\", \"assert get_access('a') == 'PUBLIC'\", \"assert get_access('_') == 'PUB... | {
"split": "train",
"index": 62351,
"acecode_id": "bigcode_python_fns_42060",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that merges three lists of tuples and returns only the tuples containing even prime numbers, sorted in descending order. Each input list may contain integers and tuples. Only tuples with two elements will be considered. A prime number is defined as a number... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_even_prime_tuple_and_merge([(2, 4)], [(2, 2), (3, 3)], [(2, 2)]) == [(2, 2), (2, 2)]\", \"assert get_even_prime_tuple_and_merge([2, 4, 6], [(1, 1), (8, 8)], [(2, 2), (3, 3)]) == [(2, 2)]\", \"assert get_even_prime_tuple_and_merge([], [], [(1, 1), (3, 3)]... | {
"split": "train",
"index": 62352,
"acecode_id": "evol_26055",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that creates a basic API request. The function should take in two parameters: a string representing the service name and a string representing the request name. The function should return a dictionary representing the request, which i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert CreateBasicRequest('UserService', 'GetUserInfo') == {'service': 'UserService', 'requestName': 'GetUserInfo', 'siteIDs': [], 'CurrentPageIndex': 0}\", \"assert CreateBasicRequest('OrderService', 'CreateOrder') == {'service': 'OrderService', 'requestName': 'Cr... | {
"split": "train",
"index": 62353,
"acecode_id": "oss_30706",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers and your task is to implement a function that returns the sum of all even numbers in the list. If there are no even numbers, return 0. The function should be defined as follows: `def sum_of_evens(numbers: List[int]) -> int:` where `numbers` is a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([2, 4, 6, 8]) == 20\", \"assert sum_of_evens([1, 3, 5, 7]) == 0\", \"assert sum_of_evens([]) == 0\", \"assert sum_of_evens([10, 15, 20, 25]) == 30\", \"assert sum_of_evens([-2, -4, -6, -8]) == -20\"... | {
"split": "train",
"index": 62354,
"acecode_id": "oss_28277",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing an access control mechanism for a document database. Your goal is to determine whether a specific user is permitted to perform a certain action on a resource. You need to implement a function named `check_access` that takes the following paramet... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_access('registry1', 'user1', 'type1', 'resource1', 'read') == True\", \"assert check_access('registry1', 'user2', 'type1', 'resource1', 'write') == False\", \"assert check_access('registry2', 'user4', 'type2', 'resource2', 'read') == False\", \"assert ... | {
"split": "train",
"index": 62355,
"acecode_id": "oss_606",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given two lists of strings, implement a function `count_distinct_entities(primary_list, secondary_list)` that returns the count of distinct entities present in both lists combined. The function should take two parameters: `primary_list` and `secondary_list`, which are both list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_distinct_entities(['a', 'b', 'c'], ['d', 'e', 'f']) == 6\", \"assert count_distinct_entities(['x', 'y', 'z'], ['x', 'y', 'z']) == 3\", \"assert count_distinct_entities([], ['1', '2', '3']) == 3\", \"assert count_distinct_entities(['apple', 'banana'], [... | {
"split": "train",
"index": 62356,
"acecode_id": "evol_21814",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `monotonic` that checks if a given list of numbers is monotonic based on the specified conditions. The function should take four parameters: a list of numbers, a boolean indicating whether the check should be strict, a boolean indicating whether to check fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert monotonic([], strict=False, zero_crossing=False, progression=None) == True\", \"assert monotonic([1, 2, 3], strict=False, zero_crossing=False, progression='arithmetic') == True\", \"assert monotonic([2, 4, 6], strict=False, zero_crossing=False, progression='... | {
"split": "train",
"index": 62357,
"acecode_id": "evol_874",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the addition of a new adult record in an application. The function should take the following parameters: a boolean `is_valid` that indicates whether the adult's information is valid, and a string `user` representing the use... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_adult_record(True, 'Alice') == 'Adult record successfully added for Alice.'\", \"assert add_adult_record(False, 'Bob') == 'Failed to add adult record due to invalid information.'\", \"assert add_adult_record(True, 'Charlie') == 'Adult record successfully... | {
"split": "train",
"index": 62358,
"acecode_id": "bigcode_python_fns_2252",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string that may contain URLs with embedded usernames and passwords, write a function `sanitize_url(url_str: str) -> str` that replaces all such URLs with sanitized versions. A sanitized URL should not include the username and password part, keeping only the protocol and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sanitize_url('Visit https://user:pass@example.com for more info') == 'Visit https://example.com for more info'\", \"assert sanitize_url('Download from ftp://username:password@ftp.example.com/files') == 'Download from ftp://ftp.example.com/files'\", \"assert ... | {
"split": "train",
"index": 62359,
"acecode_id": "bigcode_python_fns_19707",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of floating-point numbers, determine if they are element-wise close to each other within a specified relative and absolute tolerance. Two lists are considered close if for every pair of corresponding elements, the following condition holds: |a[i] - b[i]| <= max(... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert are_lists_close([1.0, 2.0, 3.0], [1.0, 2.0, 3.0], rtol=1e-14, atol=1e-14) == True\", \"assert are_lists_close([1.0, 2.0, 3.0], [1.0, 2.0, 3.00000000000001], rtol=1e-14, atol=1e-14) == True\", \"assert are_lists_close([1.0, 2.0], [1.0, 2.0, 3.0], rtol=1e-14, ... | {
"split": "train",
"index": 62360,
"acecode_id": "bigcode_python_fns_1530",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `pluck(tree, cond_fn)` that takes a tree and a condition function. The function should traverse the tree recursively, plucking the values from the nodes where the condition function returns True. The condition function can incorporate multiple facets of rea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pluck([Node(5, []), Node(3, []), Node(8, [])], lambda x: x > 4) == [5, 8]\", \"assert pluck([Node(1, []), Node(2, []), Node(3, [])], lambda x: x % 2 == 0) == [2]\", \"assert pluck([Node(10, []), Node(15, []), Node(20, [])], lambda x: x > 10) == [15, 20]\", \... | {
"split": "train",
"index": 62361,
"acecode_id": "evol_15853",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the speed adjustment of a dinosaur character in a simple game. The dinosaur starts with an initial speed, and this speed can be adjusted based on a given factor. The speed should never go below zero. Implement a function ca... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert adjust_speed(30, 10) == 40\", \"assert adjust_speed(30, -15) == 15\", \"assert adjust_speed(30, -30) == 0\", \"assert adjust_speed(0, 10) == 10\", \"assert adjust_speed(0, -5) == 0\", \"assert adjust_speed(100, -50) == 50\", \"assert adjust_speed(100, -100) ... | {
"split": "train",
"index": 62362,
"acecode_id": "oss_14159",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, return a string representation of the array. If the length of the array is 3 or less, return the elements of the array joined by a space. If the length of the array is greater than 3, return the first two elements, followed by '...', and then the las... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert arraystr([1]) == '1'\", \"assert arraystr([1, 2]) == '1 2'\", \"assert arraystr([1, 2, 3]) == '1 2 3'\", \"assert arraystr([1, 2, 3, 4]) == '1 2 ... 4'\", \"assert arraystr([1, 2, 3, 4, 5]) == '1 2 ... 5'\", \"assert arraystr([10, 20, 30, 40, 50, 60]) == '10... | {
"split": "train",
"index": 62363,
"acecode_id": "bigcode_python_fns_16395",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that performs encryption and decryption using the Rot18 cipher. The Rot18 cipher is a letter substitution cipher that replaces each letter with the letter 13 positions later in the alphabet (like Rot13) and shifts each numerical chara... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rot18_transform('Hello, World! 123', True) == 'Uryyb, Jbeyq! 678'\", \"assert rot18_transform('Uryyb, Jbeyq! 678', False) == 'Hello, World! 123'\", \"assert rot18_transform('Test123', True) == 'Grfg678'\", \"assert rot18_transform('Grfg678', False) == 'Test1... | {
"split": "train",
"index": 62364,
"acecode_id": "oss_21770",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing file names. Each file name consists of a name and an extension separated by a dot. Your task is to write a function that groups the file names by their extensions and returns a dictionary where the keys are the extensions (in lowerca... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert group_files_by_extension(['document1.txt', 'image1.png', 'document2.txt', 'image2.png', 'spreadsheet1.xlsx']) == {'txt': ['document1.txt', 'document2.txt'], 'png': ['image1.png', 'image2.png'], 'xlsx': ['spreadsheet1.xlsx']}\", \"assert group_files_by_extens... | {
"split": "train",
"index": 62365,
"acecode_id": "oss_16065",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `swap_first_last(matrix)` that takes a 2D list (matrix) as input and swaps the first and last elements of the matrix. The first element is defined as the top-left corner element (matrix[0][0]) and the last element is defined as the bottom-right corner element (... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert swap_first_last([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == [[9, 2, 3], [4, 5, 6], [7, 8, 1]]\", \"assert swap_first_last([[1]]) == [[1]]\", \"assert swap_first_last([[1, 2], [3, 4]]) == [[4, 2], [3, 1]]\", \"assert swap_first_last([[1, 2, 3]]) == [[3, 2, 1]]\", \... | {
"split": "train",
"index": 62366,
"acecode_id": "evol_1012",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a configuration setting for a hypothetical database management system. The setting `TRACK_MODIFICATIONS` determines whether the system should track modifications made to the database. Your task is to implement a function `set_track_modifications` th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_track_modifications(True) == 'Tracking modifications is enabled'\", \"assert set_track_modifications(False) == 'Tracking modifications is disabled'\", \"assert set_track_modifications(True) == 'Tracking modifications is enabled'\", \"assert set_track_mod... | {
"split": "train",
"index": 62367,
"acecode_id": "oss_27741",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a graph represented as an adjacency list and a starting node, implement a function `DFS(graph, start_node)` that performs a depth-first search (DFS) traversal of the graph. The function should return a list of nodes in the order they were visited. The graph is a dictionar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert DFS({'A': ['B', 'C'], 'B': ['A', 'D'], 'C': ['A'], 'D': ['B']}, 'A') == ['A', 'B', 'D', 'C']\", \"assert DFS({'A': ['B'], 'B': ['C'], 'C': ['D'], 'D': ['A']}, 'A') == ['A', 'B', 'C', 'D']\", \"assert DFS({'A': ['B', 'C'], 'B': ['A'], 'C': ['A']}, 'A') == ['A... | {
"split": "train",
"index": 62368,
"acecode_id": "evol_10936",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `get_ip_info(ip_address: str) -> Tuple[str, str, str]` that takes an IP address as input and returns a tuple containing the Internet Service Provider (ISP) name, the autonomous system number (ASN), and the domain name associated with that IP address. If the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_ip_info('192.168.1.1') == ('', '', '')\", \"assert get_ip_info('8.8.8.8') == ('Google LLC', 'AS15169', 'dns.google')\", \"assert get_ip_info('1.1.1.1') == ('Cloudflare, Inc.', 'AS13335', 'one.one.one.one')\", \"assert get_ip_info('192.0.2.1') == ('', '',... | {
"split": "train",
"index": 62369,
"acecode_id": "evol_15697",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the weights of various items. Write a function `max_weight` that takes in this list and returns the maximum weight that can be achieved by selecting any combination of these items. The selected weights can be any non-empty subset of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_weight([1, 2, 3]) == 6\", \"assert max_weight([5, 10, 15]) == 30\", \"assert max_weight([0, 0, 0]) == 0\", \"assert max_weight([]) == 0\", \"assert max_weight([1]) == 1\", \"assert max_weight([1, 1, 1]) == 3\", \"assert max_weight([1, 5, 10, 20]) == 36\"... | {
"split": "train",
"index": 62370,
"acecode_id": "bigcode_python_fns_8699",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to reduce the rates of two servers based on their current rates and a given parameter `theta`. The function should take two integers representing the rates of the servers and an integer `theta`. If the rates of the two servers are equ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reduce_rate(10, 15, 2) == 10\", \"assert reduce_rate(20, 10, 5) == 10\", \"assert reduce_rate(7, 3, 1) == 3\", \"assert reduce_rate(0, 0, 2) == -0.5\", \"assert reduce_rate(1, 2, 1) == 1\", \"assert reduce_rate(10, 10, 1) == 9\", \"assert reduce_rate(25, 30,... | {
"split": "train",
"index": 62371,
"acecode_id": "oss_21156",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a variable number of keyword arguments. The function should handle two specific keyword arguments: 'disable_lint_checks' and 'kotlincopts'. The 'disable_lint_checks' argument should be a list that may contain lint checks to be ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert configure_android_library() == None\", \"assert configure_android_library(disable_lint_checks=['check1']) == None\", \"assert configure_android_library(kotlincopts=['-Xopt1']) == None\", \"assert configure_android_library(disable_lint_checks=['check1', 'chec... | {
"split": "train",
"index": 62372,
"acecode_id": "bigcode_python_fns_38605",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating a list of file names based on a specified format. Write a function called `generate_file_names` that takes in five parameters: `base_path` (string), `identifier` (string), `x_start` (integer), `y_start` (integer), and `y_count` (integer). The func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_file_names('/data', 'B2', 50, 150, 4) == ['/data/B2_50_150_file.png', '/data/B2_50_151_file.png', '/data/B2_50_152_file.png', '/data/B2_50_153_file.png']\", \"assert generate_file_names('/files', 'C3', 10, 20, 2) == ['/files/C3_10_20_file.png', '/fi... | {
"split": "train",
"index": 62373,
"acecode_id": "oss_2709",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `fahrenheit_to_kelvin(f: float) -> float` that converts a temperature from Fahrenheit to Kelvin. The conversion formula is given by the equation: K = (F - 32) * 5/9 + 273.15, where F is the temperature in Fahrenheit and K is the temperature in Kelvin. Your ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fahrenheit_to_kelvin(32) == 273.15\", \"assert fahrenheit_to_kelvin(212) == 373.15\", \"assert fahrenheit_to_kelvin(50) == 283.15\", \"assert fahrenheit_to_kelvin(98.6) == 310.15\", \"assert fahrenheit_to_kelvin(77) == 298.15\", \"assert fahrenheit_to_kelvin... | {
"split": "train",
"index": 62374,
"acecode_id": "evol_20346",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the number of filters in each convolutional layer of a VGG-like neural network. Implement a function that calculates the total number of filters used in the network. The network has five groups of layers, and each group has a specif... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert total_filters([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) == 0\", \"assert total_filters([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) == 13\", \"assert total_filters([256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256]) == 3328\", \"assert total_filter... | {
"split": "train",
"index": 62375,
"acecode_id": "bigcode_python_fns_41716",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given an original price of an item, write a function that calculates the final price after applying a default discount of 20% and an optional 10% coupon discount. The function should take a boolean parameter that determines whether the discounts are compounded. If compounded, t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert discount_calculator(100, True) == 72.0\", \"assert discount_calculator(50, True) == 36.0\", \"assert discount_calculator(100, 'yes') == 'Invalid Input'\", \"assert discount_calculator('100', True) == 'Invalid Input'\", \"assert discount_calculator(200, True)... | {
"split": "train",
"index": 62376,
"acecode_id": "evol_33924",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple stack data structure using an array. The stack should support the following operations: 1. `push(val)`: Add an element `val` to the top of the stack. 2. `pop()`: Remove and return the element at the top of the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert stack_operations([('push', 10), ('push', 20), ('peek', None), ('pop', None), ('isEmpty', None)]) == [20, 20, False]\", \"assert stack_operations([('push', 5), ('push', 15), ('pop', None), ('pop', None), ('isEmpty', None)]) == [15, 5, True]\", \"assert stack_... | {
"split": "train",
"index": 62377,
"acecode_id": "oss_22089",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a string as input and returns a new string that contains the characters of the original string in reverse order. For example, if the input is 'Hello World', the output should be 'dlroW olleH'.\nPlease reason step by step, then write a self-contai... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_string('Hello World') == 'dlroW olleH'\", \"assert reverse_string('Python') == 'nohtyP'\", \"assert reverse_string('OpenAI') == 'IAnepO'\", \"assert reverse_string('12345') == '54321'\", \"assert reverse_string('') == ''\", \"assert reverse_string('a... | {
"split": "train",
"index": 62378,
"acecode_id": "evol_26784",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes in another function as an argument and returns a new function that wraps the input function. This new function should handle any exceptions that may occur when the input function is called and return a predefined error message ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert exception_handler(lambda x, y: x / y)(10, 0) == 'An error occurred'\", \"assert exception_handler(lambda x: x + 1)(None) == 'An error occurred'\", \"assert exception_handler(lambda x: x[1])(1) == 'An error occurred'\", \"assert exception_handler(lambda: 1 / ... | {
"split": "train",
"index": 62379,
"acecode_id": "oss_24017",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string 's' and a string 't'. Your task is to implement a function 'process_strings' that replaces every character in 's' that is present in 't' with a '*' character. The function should also return a frequency count of each character in the transformed string, a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_strings('world', 'o') == ['w*rld', 'w:1,*:1,r:1,l:1,d:1', 'Unique']\", \"assert process_strings('abcde', 'xyz') == ['abcde', 'a:1,b:1,c:1,d:1,e:1', 'Unique']\", \"assert process_strings('aaaa', 'a') == ['****', '*:4', 'Non-unique']\", \"assert proces... | {
"split": "train",
"index": 62380,
"acecode_id": "evol_26423",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a flat fee, a proportional fee rate, a maximum linear imbalance fee, and a target amount, calculate the estimated fee for a transaction between two participants in a token network. The fee structure includes a flat fee and a proportional fee based on the target amount. If... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert estimate_fee(5, 10, 0, 100) == 15\", \"assert estimate_fee(0, 20, 0, 200) == 40\", \"assert estimate_fee(2, 25, 0, 400) == 102\", \"assert estimate_fee(0, 0, 0, 0) == 0\", \"assert estimate_fee(1, 50, 20, 100) == 71\", \"assert estimate_fee(0, 0, 10, 50) == ... | {
"split": "train",
"index": 62381,
"acecode_id": "bigcode_python_fns_18523",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that extracts mathematical expressions from a given string. The function should identify all mathematical expressions in the format '.. math:: expression' within the input string and return them as a list of strings. Each string in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_math_expressions('Define\\\\n\\\\n.. math:: v_{des}\\\\nas the desired velocity,\\\\n\\\\n.. math:: 1^k\\\\na vector of ones of length') == ['v_{des}', '1^k']\", \"assert extract_math_expressions('.. math:: a + b\\\\n.. math:: \\\\sum_{i=1}^{n} i\\\\... | {
"split": "train",
"index": 62382,
"acecode_id": "oss_30397",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the behavior of presenting figures in a graphical interface. The function should accept a variable number of figure identifiers (strings) as arguments and a set of keyword arguments that can control various presentation opt... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert present_figures('figure1', 'figure2', 'figure3') == 'Presenting figures: figure1, figure2, figure3'\", \"assert present_figures('figureA') == 'Presenting figures: figureA'\", \"assert present_figures() == 'No figures to present'\", \"assert present_figures('... | {
"split": "train",
"index": 62383,
"acecode_id": "bigcode_python_fns_27543",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing a list of LaTeX page-action pairs, where each page must either be cleaned or compiled based on the specified action. Write a function `process_latex_pages(pages: List[Tuple[str, str]]) -> List[str]` that takes a list of tuples as input, with each ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_latex_pages([('page1', 'clean'), ('page2', 'compile')]) == ['Cleaning page1', 'Compiling page2']\", \"assert process_latex_pages([('page3', 'clean')]) == ['Cleaning page3']\", \"assert process_latex_pages([('page4', 'compile')]) == ['Compiling page4'... | {
"split": "train",
"index": 62384,
"acecode_id": "oss_10328",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of object names, determine the corresponding class for each object based on whether the object name is in a predefined set of snapshotable objects. You have to implement a function `get_class_for_objects(object_names: List[str]) -> List[str]` that takes a list of o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_class_for_objects(['objectA', 'objectB', 'objectC']) == ['SnapshotsDropdownTreeViewItem', 'SnapshotsDropdownTreeViewItem', 'SnapshotsDropdownTreeViewItem']\", \"assert get_class_for_objects(['objectD', 'objectE']) == ['CommonDropdownTreeViewItem', 'Commo... | {
"split": "train",
"index": 62385,
"acecode_id": "bigcode_python_fns_14335",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that extracts the version number of a software package from a given input string. The input string can represent the version in various formats, including semantic versioning (e.g., '1.0.0'), pre-release versions (e.g., '1.0.0-alpha', '1.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_version('1.0.0') == '1.0.0'\", \"assert extract_version('1.0.0-alpha') == '1.0.0'\", \"assert extract_version('2.1.3-beta.2') == '2.1.3'\", \"assert extract_version('3.0.0.post1') == '3.0.0'\", \"assert extract_version('1.0.0.dev1') == '1.0.0'\", \"a... | {
"split": "train",
"index": 62386,
"acecode_id": "bigcode_python_fns_4336",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a table name as a string, write a function `construct_sql_query` that constructs and returns a SQL query string to retrieve all fields from the specified table. The function should use Python string formatting to create the query. For example, if the input is 'employee_re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert construct_sql_query('employee_records') == 'SELECT * FROM employee_records'\", \"assert construct_sql_query('users') == 'SELECT * FROM users'\", \"assert construct_sql_query('products') == 'SELECT * FROM products'\", \"assert construct_sql_query('orders') ==... | {
"split": "train",
"index": 62387,
"acecode_id": "evol_13989",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `greatest_common_divisor(a: int, b: int) -> int` that returns the greatest common divisor (GCD) of two given non-negative integers 'a' and 'b'. If both integers are zero, return zero. The function should raise a ValueError if any of the integers are negativ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert greatest_common_divisor(3, 5) == 1\", \"assert greatest_common_divisor(25, 15) == 5\", \"assert greatest_common_divisor(0, 0) == 0\", \"assert greatest_common_divisor(0, 5) == 5\", \"assert greatest_common_divisor(5, 0) == 5\", \"assert greatest_common_divis... | {
"split": "train",
"index": 62388,
"acecode_id": "evol_10690",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to calculate the total area of rectangles in a 2D space. Each rectangle is represented by a tuple of four integers: (x1, y1, x2, y2), where (x1, y1) represents the coordinates of the bottom-left corner and (x2, y2) represents the coor... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_area([(1, 1, 3, 3), (2, 2, 4, 4)]) == 7\", \"assert calculate_total_area([(0, 0, 1, 1), (1, 1, 2, 2), (2, 2, 3, 3)]) == 3\", \"assert calculate_total_area([(0, 0, 4, 4), (1, 1, 3, 3)]) == 16\", \"assert calculate_total_area([(0, 0, 1, 1), (0,... | {
"split": "train",
"index": 62389,
"acecode_id": "oss_35591",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers `baskets`, where `baskets[i]` is the number of apples in the `ith` basket, return the maximum number of apples you can collect by choosing baskets in groups of three. In each selection, the first basket is chosen by Alice, the second by you, and the t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_number_of_apples([2, 4, 1, 2, 7, 8]) == 9\", \"assert max_number_of_apples([2, 4, 5]) == 4\", \"assert max_number_of_apples([1, 1, 1, 1, 1, 1]) == 2\", \"assert max_number_of_apples([10, 10, 10, 10, 10, 10]) == 20\", \"assert max_number_of_apples([2, 2, ... | {
"split": "train",
"index": 62390,
"acecode_id": "evol_10078",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a function that returns the maximum sum of a non-adjacent subsequence from a given list of integers. A non-adjacent subsequence means that you cannot include two elements that are next to each other in the original list. The function should handle both positive and ne... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_non_adjacent_sum([]) == 0\", \"assert max_non_adjacent_sum([-1]) == 0\", \"assert max_non_adjacent_sum([-2, -3, -1]) == 0\", \"assert max_non_adjacent_sum([3, 2, 5, 10, 7]) == 15\", \"assert max_non_adjacent_sum([5, 1, 1, 5]) == 10\", \"assert max_non_ad... | {
"split": "train",
"index": 62391,
"acecode_id": "evol_15565",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given two angles x and p in radians, return the derivative of the circumferential distance between these two angles with respect to p. The circumferential distance is defined as the minimum distance on a circle with a circumference of 1. Your function should compute the derivat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert derivative_circ_dist(0.0, 0.0) == 0\", \"assert derivative_circ_dist(0.0, 0.1) == -1\", \"assert derivative_circ_dist(0.0, 0.4) == -1\", \"assert derivative_circ_dist(0.0, 0.6) == 1\", \"assert derivative_circ_dist(0.0, 1.0) == 1\", \"assert derivative_circ_... | {
"split": "train",
"index": 62392,
"acecode_id": "bigcode_python_fns_29043",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, write a function `generate_breadcrumbs` that takes a list of strings representing the path of a breadcrumb and returns a formatted HTML string that represents a breadcrumb trail. Each breadcrumb should be wrapped in an `<li>` tag, and each breadcrumb sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_breadcrumbs(['Home', 'Products', 'Electronics']) == '<ol class=\\\"breadcrumb\\\"><li><a href=\\\"/home\\\">Home</a></li><li><a href=\\\"/products\\\">Products</a></li><li class=\\\"active\\\">Electronics</li></ol>'\", \"assert generate_breadcrumbs(... | {
"split": "train",
"index": 62393,
"acecode_id": "bigcode_python_fns_26470",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a user logging in through a social media platform. The function takes in a user's profile and credentials and returns a response indicating whether the login was successful or not. The profile contains the user's display na... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert login_user({'accounts': [{'domain': 'facebook.com', 'userid': '2343'}], 'displayName': 'teddy', 'preferredUsername': 'teddy', 'emails': [{'value': 'teddy@example.com'}], 'name': 'ted'}, {'oauthAccessToken': '7897048593434'}) == {'status': True}\", \"assert l... | {
"split": "train",
"index": 62394,
"acecode_id": "bigcode_python_fns_41783",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function compute_sum(numbers) that takes a list of integers and returns their sum. If an element in the list is not an integer, the function should raise an exception with the message 'Invalid integer detected'.\nPlease reason step by step, then write a self-contain... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_sum([1, 2, 3]) == 6\", \"assert compute_sum([-1, -2, -3]) == -6\", \"assert compute_sum([0, 0, 0]) == 0\", \"assert compute_sum([10, 20, 30]) == 60\", \"assert compute_sum([1, 5, 7, 3]) == 16\", \"assert compute_sum([1, 2, 3, 4, 5]) == 15\", \"assert... | {
"split": "train",
"index": 62395,
"acecode_id": "evol_34590",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of consecutive buildings in a skyline. Your task is to implement a function that returns the index of the building with the maximum height. If there are multiple buildings with the same maximum height, return the index o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_tallest_building([1, 3, 7, 3, 2]) == 2\", \"assert find_tallest_building([5, 5, 5, 5]) == 0\", \"assert find_tallest_building([10]) == 0\", \"assert find_tallest_building([2, 1, 4, 4]) == 2\", \"assert find_tallest_building([1, 2, 3, 4, 5]) == 4\", \"as... | {
"split": "train",
"index": 62396,
"acecode_id": "oss_16430",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that allows users to evaluate a series of conditions using a custom evaluation function. The function should accept a list of conditions and an evaluation function, and return the result of the evaluation. If the list of conditions is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate_conditions([True, True, True], lambda x: all(x)) == True\", \"assert evaluate_conditions([True, False, True], lambda x: all(x)) == False\", \"assert evaluate_conditions([5, 10, 15], lambda x: all(i > 0 for i in x)) == True\", \"assert evaluate_condi... | {
"split": "train",
"index": 62397,
"acecode_id": "oss_35892",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the creation of directories based on a list of subdirectory names. Write a function `create_subdirectories(subdirs: List[str]) -> List[str]` that takes a list of strings `subdirs`, where each string represents a name of a s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_subdirectories(['dir1', 'dir2']) == ['/work/dir1', '/work/dir2']\", \"assert create_subdirectories(['folderA', 'folderB', 'folderC']) == ['/work/folderA', '/work/folderB', '/work/folderC']\", \"assert create_subdirectories([]) == []\", \"assert create... | {
"split": "train",
"index": 62398,
"acecode_id": "bigcode_python_fns_18546",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string that represents a C source file. Your task is to implement a function `check_include_directive(source: str) -> str` that checks if the given source file includes a specific header file. The function should return 'Header included' if the header file is pr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_include_directive('#include <stdio.h>\\\\n#include \\\"foo.h\\\"\\\\nint main() { return 0; }') == 'Header included'\", \"assert check_include_directive('#include <stdlib.h>\\\\nint main() { return 0; }') == 'Header not included'\", \"assert check_incl... | {
"split": "train",
"index": 62399,
"acecode_id": "bigcode_python_fns_19713",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.