messages list | membership_label int64 |
|---|---|
[
{
"role": "user",
"content": "In a Python project utilizing the Django web framework, you need to update the way primary key fields are specified in your models due to a change in the framework. The previous primary key field was represented by a string, and you need to convert this string to a new format t... | 0 |
[
{
"role": "user",
"content": "You are given a list of integers representing the ages of a group of people. Write a function that takes this list and returns a new list containing only the ages that are greater than or equal to 18. The output list should maintain the original order of the ages. Implement the... | 0 |
[
{
"role": "user",
"content": "Write a function `factorial_array(input_array)` that takes an array of non-negative integers and returns a new array containing the factorial of each integer. If the input array contains any non-integer or negative values, the function should raise a `TypeError` with the messag... | 0 |
[
{
"role": "user",
"content": "You are tasked with creating a Python function that generates a random 32-bit integer. Your task is to implement the `generate_int32` function that takes no arguments and returns a 32-bit integer initialized with a non-string value. The generated integer must be within the rang... | 0 |
[
{
"role": "user",
"content": "You are tasked with creating a function `create_api_app` that takes a dictionary `global_conf` and an arbitrary number of keyword arguments `local_conf`. The function should determine the API version from `global_conf` and return a dictionary of routes associated with their res... | 0 |
[
{
"role": "user",
"content": "Given a list of respondents' voting data from the 1992 U.S. Presidential election, implement a function that counts the number of respondents who voted for each candidate: Bill Clinton, George H.W. Bush, and Ross Perot. The input is a list of strings where each string represent... | 0 |
[
{
"role": "user",
"content": "Implement a function `encrypt_data(data: str) -> str` that encrypts the given string data using a simple substitution cipher, where each letter in the plaintext is replaced by a letter some fixed number of positions down the alphabet. The function should take a string `data` as... | 0 |
[
{
"role": "user",
"content": "You are tasked with processing a specific row name in an administrative statistics system. Your function should accept a string `row_name` which can only be one of the following three options: 'orioks_scheduled_requests', 'orioks_success_logins', or 'orioks_failed_logins'. If t... | 0 |
[
{
"role": "user",
"content": "You are tasked with creating a function `extract_metadata` that takes a string representing a range of commits and returns a list of metadata extracted from those commits. The metadata is represented as a dictionary with keys 'commit_id', 'author', and 'message'. Each commit in... | 0 |
[
{
"role": "user",
"content": "You are tasked with creating a function that retrieves constant values based on the input provided. The function should accept either a string or an integer as an argument. If the input is a string, it should return the corresponding constant value based on the uppercase versio... | 0 |
[
{
"role": "user",
"content": "Design a function that assigns a specific value to a variable and validates it. Implement the function `assign_and_validate` which assigns a 16-bit binary string representation of the number `8` to the variable `my_binary`. The function should also include error handling to che... | 0 |
[
{
"role": "user",
"content": "You are tasked with implementing a function that converts a given bytearray into a hexadecimal string representation. The function should take a bytearray as input and return a string where each byte is represented by its two-digit hexadecimal equivalent, concatenated together.... | 0 |
[
{
"role": "user",
"content": "Given a string 's' consisting of characters 'a', 'b', and 'c', determine if the string can be represented in the form 'a^i b^j c^k' where i, j, k >= 0. This means that the string must start with zero or more 'a's, followed by zero or more 'b's, and end with zero or more 'c's. I... | 0 |
[
{
"role": "user",
"content": "Given an array of non-repeating integers, implement a function to find the 3rd largest number in the array without using any inbuilt sorting function. You may assume that the array will always have at least three elements."
}
] | 0 |
[
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of integers and returns a new list containing only the even numbers from the original list, in the same order they appeared. Write a function named 'filter_even_numbers' that accepts a single parameter 'numbers', which i... | 0 |
[
{
"role": "user",
"content": "Given a string, implement a function `replace_words(base_string: str, replacements: Dict[str, str]) -> str` that replaces all occurrences of words in the base string according to the provided replacements dictionary. The function should return the modified string without direct... | 0 |
[
{
"role": "user",
"content": "Given a string `s` consisting of characters including parentheses '(', ')', and other characters, determine if the order of the parentheses is valid. A string of parentheses is considered valid if every opening parenthesis has a corresponding closing parenthesis and they are co... | 0 |
[
{
"role": "user",
"content": "Write a function `update_prices(documents: List[Dict[str, Union[str, bool]]]) -> List[Dict[str, Union[str, bool, int]]]` that takes a list of documents where each document is represented as a dictionary containing fields 'date' (as a string in the format 'YYYY-MM-DD'), 'is_disc... | 0 |
[
{
"role": "user",
"content": "You are tasked with implementing a function to generate a unique image name for a given image header, frame number, and file extension. The function should take in three parameters: `imgheader` (string), `frame` (integer), and `ext` (string). The function should return a format... | 0 |
[
{
"role": "user",
"content": "You are given two lists of integers, `list1` and `list2`, and a target integer `target`. Your task is to implement a function `find_pairs(list1: List[int], list2: List[int], target: int) -> List[Tuple[int, int]]` that returns all unique pairs of integers `(a, b)` such that `a` ... | 0 |
[
{
"role": "user",
"content": "Given a list of integers, write a function `compute_product(list_nums)` that computes the cumulative multiplication of all numbers in the list. The function should return the final product of the numbers. The input list will contain only positive integers."
}
] | 0 |
[
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of integers and returns a new list containing only the unique elements from the original list in the order they first appeared. The function should handle both positive and negative integers and maintain the o... | 0 |
[
{
"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... | 0 |
[
{
"role": "user",
"content": "You are given a list of strings, where each string represents a line of text. Each line may contain a JSON object or it may be an invalid JSON string. Your task is to write a function that processes this list and returns a new list containing either the parsed JSON object as a ... | 0 |
[
{
"role": "user",
"content": "You are given a list of integers representing the heights of buildings in a city skyline. Your task is to implement a function `generate_skyline(heights: List[int]) -> List[Tuple[int, int]]` that returns a list of tuples, where each tuple contains two integers: the position of ... | 0 |
[
{
"role": "user",
"content": "Given a list of numerical quantities, implement a function `calculate_values(numbers)` that returns a tuple containing the maximum value, minimum value, and arithmetic mean of the list. The maximum value is the highest number in the list, the minimum value is the lowest number ... | 0 |
[
{
"role": "user",
"content": "Given the first term of an arithmetic progression (AP) and a positive integer n, write a function that calculates the nth term of the progression where each term is double the previous term. The first term is provided as an integer. Implement a function called `find_nth_term` t... | 0 |
[
{
"role": "user",
"content": "You are tasked with creating a Python function that analyzes version changes and determines the type of change (breaking, minor, micro, or no change) based on the input version information and the provided change details. You are given a dictionary called `version_info` that co... | 0 |
[
{
"role": "user",
"content": "You are given a player's exhaustion level represented as an integer. The player has a chance to create a fire, which can reduce their exhaustion. When creating a fire, the player expends a random amount of labor between 5 and 10. After expending labor, there is a 75% chance tha... | 0 |
[
{
"role": "user",
"content": "You are given two lists of numbers, `train` and `test`. Your task is to standardize the `test` list using the mean and standard deviation of the `train` list. The standardization formula is given by: standardized_value = (value - mean) / std_dev. If the standard deviation of t... | 0 |
[
{
"role": "user",
"content": "Implement a function `selection_sort` that takes a list of integers as input and sorts the list in ascending order using the selection sort algorithm. The function should modify the input list in place and return nothing. The selection sort algorithm works by repeatedly finding... | 0 |
[
{
"role": "user",
"content": "You are tasked with creating a function that renames a given file name from 'TestFile' to 'CloudFile'. The function should take a single string as input, which represents the current name of the file. If the input name is 'TestFile', the function should return 'CloudFile'. If t... | 0 |
[
{
"role": "user",
"content": "Given a list of integers, write a function `find_max_difference(arr: List[int]) -> int` that returns the maximum difference between any two elements in the list, where the larger element comes after the smaller one. If the list has fewer than two elements, return 0."
}
] | 0 |
[
{
"role": "user",
"content": "Given a non-negative integer n, implement a function `sum_of_first_n(n)` that calculates the sum of the first n natural numbers. The function should return the result efficiently using a mathematical formula instead of a loop."
}
] | 0 |
[
{
"role": "user",
"content": "Given an integer `seconds`, write a function `gradual_brightness(seconds: int) -> List[int]` that simulates the brightness levels of a light bulb as it gradually increases from 0 to 254 over the specified time in seconds. The function should return a list of brightness levels, ... | 0 |
[
{
"role": "user",
"content": "You are given a binary matrix represented as a 2D list, where each element is either 0 or 1. Your task is to remove specific rows and columns from this matrix based on the provided indices. The indices are given as a list of integers, and each index corresponds to a row and a c... | 0 |
[
{
"role": "user",
"content": "You are given a string `doc` which represents a conversation or text input. Your task is to implement a function `transformations(doc: str) -> List[str]` that returns a list of strings representing various transformations of the input string. The function should apply the follo... | 0 |
[
{
"role": "user",
"content": "You are tasked with writing a function that processes messages in a chat application. Your function should accept a message object as input and return a boolean value indicating whether to process the message or ignore it. A message should be processed if it is either sent via ... | 0 |
[
{
"role": "user",
"content": "Write a function `generate_permutations(N)` that takes an integer N as input and returns a list of all possible permutations of the distinct integers from 1 to N. The result should be a list of tuples, where each tuple represents a unique permutation of the integers."
}
] | 0 |
[
{
"role": "user",
"content": "You are tasked with updating a list of services based on given parameters. Each service can have its status toggled (enabled or disabled), deleted, or updated with new context root or protocol information. Implement a function `update_services(service_ids: List[int], change_typ... | 0 |
[
{
"role": "user",
"content": "You are tasked with creating a Python function that adds an appointment to a schedule. The function should take a list of existing appointments (strings representing the appointments) and a new appointment (a string) as input. The function should then check if the new appointme... | 0 |
[
{
"role": "user",
"content": "You are tasked with creating a representation for an energy bus in a simulation framework. Your job is to define a function that initializes a bus object based on a given label. Write a function called `initialize_energy_bus(label)` that takes a string `label` as input and retu... | 0 |
[
{
"role": "user",
"content": "Given a list of integers, write a function `find_max_even(numbers)` that returns the maximum even number from the list. If there are no even numbers, return -1. The function should handle an empty list and return -1 in that case as well. \n\nFunction Signature: `def find_max_ev... | 0 |
[
{
"role": "user",
"content": "Implement a function that takes a list of unique integers and an integer n. The function should find the number with the greatest number of divisors, including divisors of those divisors, up to n-levels deep. In case of a tie in terms of divisor counts, the function should retu... | 0 |
[
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple database query operation by extracting specific fields from a list of records. Each record is represented as a dictionary containing various fields. Your function should take a list of records and a field name ... | 0 |
[
{
"role": "user",
"content": "Given an operator sign and two floating-point numbers, implement a function that performs the specified operation on the two numbers. The supported operations are addition ('+'), subtraction ('-'), multiplication ('*'), and division ('/'). If the operator is not supported, the ... | 0 |
[
{
"role": "user",
"content": "Implement a function `create_password(num_chars: int, prev_password: Optional[str] = None) -> str` that generates a strong password. The password must consist of a mix of symbols, numbers, uppercase letters, and lowercase letters. If a previous password is provided, the new pas... | 0 |
[
{
"role": "user",
"content": "Implement a function `shaker_sort(nums)` that sorts a list of integers in ascending order using the cocktail shaker sort algorithm. Your implementation should also be able to handle nested lists by sorting each sublist independently. The function should return the sorted list. ... | 0 |
[
{
"role": "user",
"content": "Implement a function `insert_and_get_min` that takes a list of integers as input, inserts them into a priority queue implemented using a circular doubly linked list, and returns the minimum element from the priority queue after all insertions. The priority queue should maintain... | 0 |
[
{
"role": "user",
"content": "Implement a function `multiply(x: int, y: int) -> int` that returns the product of two integers x and y without using standard multiplication operators. Ensure that the function correctly handles cases where x or y may be negative. For example, given x = 3 and y = -7, the funct... | 0 |
[
{
"role": "user",
"content": "Implement a function `arithmetic_operation(num1: int, num2: int, operation: str) -> Union[int, float, str]` that performs an arithmetic operation on two integers based on the given operation. The function should support four operations: 'add', 'subtract', 'multiply', and 'divid... | 0 |
[
{
"role": "user",
"content": "Given an unordered array of integers, write a function that partitions the array around a pivot element. The function should select the last element of the array as the pivot and rearrange the elements in the array such that all elements less than or equal to the pivot are on t... | 0 |
[
{
"role": "user",
"content": "Write a function `create_pyramid(levels: int) -> List[List[int]]` that constructs a pyramidical structure with a specified number of levels. Each level `i` of the pyramid should contain `i` random integers selected from the range of 1 to 15. The total number of integers in the ... | 0 |
[
{
"role": "user",
"content": "Implement a function `perform_operation` that takes three parameters: two integers `num1` and `num2`, and a string `operation` which can be 'add', 'subtract', 'multiply', or 'divide'. The function should perform the specified operation on the two numbers and return the result. ... | 0 |
[
{
"role": "user",
"content": "You are given a list of integers representing the prices of a stock on different days. Write a function `max_profit(prices: List[int]) -> int` that returns the maximum profit you can achieve from buying and selling the stock on those days. You may complete at most one transacti... | 0 |
[
{
"role": "user",
"content": "Given a variable number of arguments, implement a function `print_args` that returns a string containing all the input arguments concatenated together, separated by commas. The function should handle any type of input arguments, converting them to strings if necessary. The outp... | 0 |
[
{
"role": "user",
"content": "You are given a string that represents a zone file containing DNS records. Your task is to implement a function that parses this zone file and returns a list of records. Each record is represented as a dictionary with the following keys: 'type' (the type of the DNS record, such... | 0 |
[
{
"role": "user",
"content": "You are given a string message that contains an error message. Write a function `format_error_message(msg: str) -> str` that formats the error message by ensuring it ends with a newline character. If the input string is None, return the string 'No error message provided.' inste... | 0 |
[
{
"role": "user",
"content": "You are tasked with creating a function that accepts a JSON string representation of an OpenAPI specification and a package name. The function should extract the title of the API from the JSON structure and return it. If the title does not exist, return 'No Title Found'. The JS... | 0 |
[
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simplified dual blob store system. The function should take two lists of strings representing blobs to be written to the primary and secondary stores, respectively. The primary store processes all write requests immed... | 0 |
[
{
"role": "user",
"content": "Implement a function `validate_spin(value: int) -> int` that validates the input value of a spin. The function should return the input value if it is valid. A valid spin is defined as an integer that is either -1, 0, or 1. If the input value is not an integer, or if it is outsi... | 0 |
[
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of deployment IDs. Given a list of deployment IDs, your function should return a list containing the IDs of deployments that are marked as 'inactive'. A deployment ID is considered 'inactive' if it is an even num... | 0 |
[
{
"role": "user",
"content": "Implement a function `sphere_segment_volume(radius: float, angle: float) -> float` that calculates the volume of a segment of a sphere given its radius and the central angle in degrees. The function should return `None` if the radius is negative or if the angle is outside the r... | 0 |
[
{
"role": "user",
"content": "Given a list of integers, write a function `find_median` that returns the median of 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 values. The input list can contain b... | 0 |
[
{
"role": "user",
"content": "Implement a function `selection_sort(arr: List[int], ascending: bool) -> List[int]` that sorts an array of integers using the selection sort algorithm. The function should take two parameters: an array of integers `arr` and a boolean `ascending`. If `ascending` is True, the fun... | 0 |
[
{
"role": "user",
"content": "Given a list composed of strings that include various types of brackets: '()', '{}', '[]', and '<>', determine if the sequence of brackets is valid. A valid sequence is one where every opening bracket has a corresponding and correctly ordered closing bracket. Implement a functi... | 0 |
[
{
"role": "user",
"content": "You are given a list of country names. Your task is to implement a function that takes this list as input and returns a list of unique country names in alphabetical order. Write a function `unique_sorted_countries(countries: List[str]) -> List[str]` where `countries` is a list ... | 0 |
[
{
"role": "user",
"content": "You are tasked with creating a function that processes a product menu and updates the quantities based on user input. The function should take a list of products, where each product is represented as a dictionary with 'id', 'name', 'price', and 'quantity' keys. The function sho... | 0 |
[
{
"role": "user",
"content": "Given an integer representing a size in bytes, implement a function that converts this size into a human-readable format using appropriate units (Bytes, KB, MB, GB, TB). The function should round the size to one decimal place and return the string formatted as '<size> <unit>'. ... | 0 |
[
{
"role": "user",
"content": "Given a list of words, implement a function that returns a list of all the words that are palindromes. A palindrome is a word that reads the same forwards and backwards. For example, 'madam' is a palindrome while 'hello' is not. Your function should be case-sensitive and should... | 0 |
[
{
"role": "user",
"content": "You are tasked with creating a function that simulates the toggling of a button's state in a user interface. The function `toggle_button_state(current_state: str) -> str` takes the current state of a button as input, which can either be 'enabled' or 'disabled'. If the button is... | 0 |
[
{
"role": "user",
"content": "You are given a boolean value representing whether a sort operation should be performed on a dataset. Your task is to implement a function `perform_sort` that takes a boolean parameter `should_sort`. If `should_sort` is True, return the string 'Sorting data...'; otherwise, retu... | 0 |
[
{
"role": "user",
"content": "You are tasked with implementing a function that takes a dictionary representing application configuration settings and returns a formatted string that describes these settings in a human-readable format. The dictionary will have string keys and values that can be strings, inte... | 0 |
[
{
"role": "user",
"content": "You are tasked with managing visual and audio stimuli associated with specific markers in a psychological experiment. Implement a function named `get_stimuli_by_marker` that takes a list of visual stimuli and a list of audio stimuli, each represented as dictionaries, along with... | 0 |
[
{
"role": "user",
"content": "You are tasked with implementing a Python function that simulates a simplified version of a task execution system. The function will take a list of task operations and execute them in the specified order. Each task operation is represented as a dictionary with 'execute' and 'un... | 0 |
[
{
"role": "user",
"content": "You are given a database path (dbpath) represented as a string and a cutoff radius (cutoff) represented as a float. Your task is to create a function `get_data_info(dbpath: str, cutoff: float) -> str` that returns a string containing the database path and the cutoff radius form... | 0 |
[
{
"role": "user",
"content": "You are tasked with creating a function that simulates drawing rectangles on a canvas. The function should accept a list of rectangles, where each rectangle is represented as a tuple containing the coordinates of the top-left corner (x, y), width, and height. Your function shou... | 0 |
[
{
"role": "user",
"content": "You are tasked with creating a Python function that calculates the average price of materials based on a given list of materials. Each material is represented as a tuple containing its name and price. Your function should take a list of these tuples as input and return the aver... | 0 |
[
{
"role": "user",
"content": "You are tasked with creating a function to compare two version numbers represented as strings in the format \"x.y.z\" where x, y, and z are non-negative integers. Your function should take two version strings as input and determine their relationship. The function should return... | 0 |
[
{
"role": "user",
"content": "You are tasked with modifying a data structure that represents a chat message in a chat application. Each chat message is represented as a dictionary with the following keys: 'sender', 'receiver', 'message', and 'timestamp'. Your task is to implement a function that takes a lis... | 0 |
[
{
"role": "user",
"content": "Write a function `extract_middle(input_val)` that takes an input parameter `input_val`. The function should return the middle character of the string if the length of the string is odd. If the length of the string is even, it should return the two middle characters. The functio... | 0 |
[
{
"role": "user",
"content": "You are given a list of integers representing the expected values of a certain process. Your task is to implement a function to sort the list of expected values in non-decreasing order using a custom sorting algorithm. You cannot use any built-in sorting functions or libraries.... | 0 |
[
{
"role": "user",
"content": "Given an integer `num`, write a function that calculates the sum of all integers from `num` to 0 (inclusive) if `num` is negative, or from 0 to `num` (inclusive) if `num` is positive. Implement the function `calculate_sum(num: int) -> int` to accomplish this. The function shoul... | 0 |
[
{
"role": "user",
"content": "Given a list of integer labels, you need to remap these labels based on their frequency. The most frequent label should be assigned the label 0, the second most frequent label should be assigned the label 1, and so on. If multiple labels have the same frequency, assign the smal... | 0 |
[
{
"role": "user",
"content": "You are given an IP address in string format. Your task is to implement a function that identifies whether the given IP address is a valid IPv4 address, a valid IPv6 address, or neither. If it is a valid IPv4 address, return 'ip address <ip>'. If it is a valid IPv6 address, ret... | 0 |
[
{
"role": "user",
"content": "You are given a string that represents the contents of a file. Your task is to implement a function that reads the content of the string in chunks and returns the concatenated result. Additionally, you need to track the reading progress using a progress indicator. Implement a f... | 0 |
[
{
"role": "user",
"content": "Given a list of site identifiers and a parameter code, generate a request URL for accessing water service data. The request URL should be formatted as follows: 'https://waterservices.usgs.gov/nwis/site?sites={}¶meterCd={}&siteOutput=Expanded&format={}'. Implement a function... | 0 |
[
{
"role": "user",
"content": "Implement a function that takes a multi-dimensional list of mixed values (both numeric and non-numeric) and returns a sorted list of distinct numeric values. The function should remove all non-numeric values and handle duplicate numeric values by placing them next to each other... | 0 |
[
{
"role": "user",
"content": "You are tasked with implementing a function `setup_logging(verbose: int) -> str` that configures a simple logging system based on the given verbosity level. The function should return a message indicating the logging level that has been set. The logging levels are defined as fo... | 0 |
[
{
"role": "user",
"content": "You are given a string representing a file path. Write a function `is_executable_file(file_path: str) -> bool` that checks if the file at the given path is an executable file. An executable file is defined as one that is not a directory and has the executable permission. For si... | 0 |
[
{
"role": "user",
"content": "You are tasked with implementing a simple data structure to manage a workspace for a computational environment. The workspace is represented as a dictionary that stores variables and their corresponding values. Your goal is to create a function `manage_workspace(instructions)` ... | 0 |
[
{
"role": "user",
"content": "You are given a dictionary representing a batch of molecular data. Each entry in the dictionary may contain the following keys: 'num_atoms' (a list of integers representing the number of atoms in each molecule), 'mol_size' (a list of integers representing the size of each molec... | 0 |
[
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a color-changing mechanism based on a predefined sequence. The function takes in a string representing the current color and returns the next color in the sequence. The sequence of colors is as follows: WHITE -> RED -> ... | 0 |
[
{
"role": "user",
"content": "You are tasked with creating a function that initializes a global configuration dictionary for a program. The function 'initialize_configuration' should take a single parameter named 'data' which is a dictionary containing a key 'config' that maps to another dictionary. Your fu... | 0 |
[
{
"role": "user",
"content": "You are given a SQL update statement in the form of a string, and your task is to write a function that extracts and returns the name of the column being updated. The SQL update statement will always follow the format: 'update <table_name> set <column_name> = <new_value>'. The ... | 0 |
[
{
"role": "user",
"content": "Implement a function `check_number(n: int, shouldPrintAllPrimeDivisors: bool) -> Union[str, List[int]]` that takes a whole number `n` and a boolean `shouldPrintAllPrimeDivisors`. The function should return 'prime' if `n` is a prime number, or 'composite' if `n` is a composite n... | 0 |
[
{
"role": "user",
"content": "You are working on a bioinformatics project that involves processing gene data. You need to implement a function that determines if a provided gene list contains any duplicate genes. Your task is to create a function `has_duplicate_genes` that takes a list of genes as a paramet... | 0 |
[
{
"role": "user",
"content": "You are given a string containing digits from 2-9. Each digit maps to a set of possible letters as shown in the following mapping: 2 -> \"abc\", 3 -> \"def\", 4 -> \"ghi\", 5 -> \"jkl\", 6 -> \"mno\", 7 -> \"pqrs\", 8 -> \"tuv\", 9 -> \"wxyz\". Write a function to return all po... | 0 |
[
{
"role": "user",
"content": "You are tasked with converting a given message (a string) into a proper formatted email string according to the following rules: 1. If the message contains any newline characters, they should be replaced with the carriage return and line feed sequence (\\r\\n). 2. The output sh... | 0 |
[
{
"role": "user",
"content": "Given an integer n, implement a function that generates an n x n identity matrix. An identity matrix is a square matrix with ones on the main diagonal and zeros elsewhere. For example, the 3x3 identity matrix is:\n\n[[1, 0, 0],\n [0, 1, 0],\n [0, 0, 1]].\n\nYour function should... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.