messages list | membership_label int64 |
|---|---|
[
{
"role": "user",
"content": "You are tasked with implementing a function `process_string(data: str) -> str` that takes a string as input and returns a new string with all characters converted to uppercase. Your function should handle any string input, including empty strings. For example, if the input is '... | 1 |
[
{
"role": "user",
"content": "You are tasked with creating a function that simulates changing the background color based on button clicks. You will implement a function called `choiceColor` that takes a string argument `button_label`. The function should return the corresponding background color as a string... | 1 |
[
{
"role": "user",
"content": "Implement a function `shared_chars_count(str1, str2)` that takes two strings as input and returns a dictionary containing the characters that are present in both strings, ignoring case. The keys of the dictionary should be the shared characters, and the values should be the num... | 1 |
[
{
"role": "user",
"content": "Write a function that converts a given string into its binary representation. Each character in the string should be represented by its binary ASCII value, and the binary values should be separated by a single space. Implement the function `string_to_binary(s: str) -> str`, whe... | 1 |
[
{
"role": "user",
"content": "You are given a list of documents, where each document is represented as a list of tokens (words). Your task is to create a function that transforms these documents into a 2D array where each row corresponds to a document and each column corresponds to a specific word vector re... | 1 |
[
{
"role": "user",
"content": "Implement a function `get_user_data(user_id: int) -> dict` that takes a user ID as an integer and returns a dictionary containing user data fetched from a simulated API. The API endpoint is `http://api.example.com/user/{user_id}`. For the purpose of this exercise, simulate the ... | 1 |
[
{
"role": "user",
"content": "Implement a function `calculate_shape_properties` that takes in a shape type (either 'circle' or 'rectangle') and the corresponding dimensions (either radius for a circle or width and height for a rectangle) and returns a tuple of (area, perimeter). The function should raise a ... | 1 |
[
{
"role": "user",
"content": "You are given a 2D list (matrix) representing a table of data where each element is a number. Implement a function `delete_row_and_column(matrix: List[List[int]], row: int, col: int) -> List[List[int]]` that removes the specified row and column from the matrix, returning a new ... | 1 |
[
{
"role": "user",
"content": "You are given a string `s` that consists of lowercase letters, and you need to determine if it is a palindrome. A string is considered a palindrome if it reads the same backward as forward. Implement a function `is_palindrome(s: str) -> bool` that returns `True` if `s` is a pal... | 1 |
[
{
"role": "user",
"content": "You are given a float number 'x' and a float number 'sigma'. Implement a function called 'gmof' that computes the Geman-McClure error function using the formula: (sigma^2 * x^2) / (sigma^2 + x^2). Your function should return the computed value as a float. The inputs 'x' and 'si... | 1 |
[
{
"role": "user",
"content": "You are tasked with implementing a URL redirection function for a web application. The function should take a host name and a request path as input, and return the appropriate redirect URL based on the following conditions: \n\n1. If the host is 'www.dalme.org' or 'public.dalme... | 1 |
[
{
"role": "user",
"content": "Given a list of bounding boxes, each represented as a tuple of two points (top-left and bottom-right coordinates), and a corresponding list of confidence scores for each bounding box, write a function `filter_person_boxes(bounding_boxes: List[Tuple[Tuple[int, int], Tuple[int, i... | 1 |
[
{
"role": "user",
"content": "You are given a positive integer `n` representing the number of items. You need to determine the total number of ways to select any number of items from these `n` items. Each selection can either include or exclude each item. Implement the function `count_selections(n: int) -> ... | 1 |
[
{
"role": "user",
"content": "You are tasked with implementing a function that takes a nested dictionary as input and returns a flattened dictionary. A nested dictionary is a dictionary where the values can be either simple values (like integers or strings) or other dictionaries. Your function should concat... | 1 |
[
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of integers and returns the sum of all the even numbers in the list. The function should also handle any exceptions that may occur during the processing of the list. If an exception occurs, the function should... | 1 |
[
{
"role": "user",
"content": "Implement a function `cubed_product(lst)` that computes the product of the cubed values of the individual integer elements in a given list. The list should only contain integers between -10 and 10 inclusive. If any element is not an integer or is out of the specified range, the... | 1 |
[
{
"role": "user",
"content": "You are given a list of dictionaries, each representing metadata about a trial containing assay records. Each dictionary contains a 'cimac_id' and a list of 'records' which are dictionaries of cell counts for different cell types. Your task is to implement a function `combine_c... | 1 |
[
{
"role": "user",
"content": "Given a list of integers `x` and a set of integers `inArray`, write a function `filter_and_sort` that filters the elements from `x` which are also present in `inArray`, adds them to `inArray`, and returns the sorted list of unique elements from `inArray`. The function should ma... | 1 |
[
{
"role": "user",
"content": "You are given a list of tuples representing operations in a CIGAR string format. Each tuple consists of an operation type (represented as an integer) and a length (represented as an integer). The operation types are as follows: 0 for matches, 1 for mismatches, 2 for insertions,... | 1 |
[
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of strings and removes any trailing whitespace from each string. Your function should return the list of processed strings after trimming the trailing whitespace. Implement the function `trim_trailing_whitespace(stri... | 1 |
[
{
"role": "user",
"content": "Given two strings, determine if they are anagrams of each other. An anagram is a word or phrase formed by rearranging the letters of a different word or phrase, using all the original letters exactly once. Ignore spaces and letter casing when evaluating the anagrams. Implement ... | 1 |
[
{
"role": "user",
"content": "You are tasked with creating a function that manages a list of display fields for a user profile in an e-commerce application. The function should support adding and removing fields from the display list, and also returning the current list of display fields. Additionally, you ... | 1 |
[
{
"role": "user",
"content": "You are tasked with creating a Python function that takes a string as input, which is expected to be a base64-encoded representation of some text. Your function should decode this base64 string and return the decoded text. If the input is not a valid base64 string, your functio... | 1 |
[
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the addition of a new field to a database model in a migration operation. The new field is called 'published', and it is a Boolean field that defaults to False. Your function should take a dictionary representing the cu... | 1 |
[
{
"role": "user",
"content": "You are given a string `user_key` which contains a combination of alphanumeric characters and special symbols, and a context string `context`. Your task is to implement a function `get_token(context: str, user_key: str) -> str` that processes the `user_key` by removing all spec... | 1 |
[
{
"role": "user",
"content": "You are tasked with implementing a simulation of a multi-armed bandit problem. In this problem, an agent is presented with a row of slot machines (bandits), each with a fixed probability of providing a reward when pulled, determined by its index. Your goal is to implement the f... | 1 |
[
{
"role": "user",
"content": "You are given a string 's'. Your task is to determine whether the provided string can be classified as 'happy' or not. A 'happy' string is defined by the following characteristics: It must have a minimum length of three characters, every individual character within the string m... | 1 |
[
{
"role": "user",
"content": "Design a function that processes a provided nested list, where each inner list consists of string elements. The function should perform the following operations: (1) Remove any duplicate string elements within each inner list, (2) Sort each inner list in ascending lexicographic... | 1 |
[
{
"role": "user",
"content": "Implement a function `char_at_index(s: str, index: int) -> str` that takes a string `s` and an integer `index` as input. The function should return the character at the specified index in the string. If the index is out of bounds, the function should return an empty string. The... | 1 |
[
{
"role": "user",
"content": "You are tasked with simulating a simple text-based game where a player navigates through a series of rooms, collecting items. Each room contains a unique identifier, a description, and a list of items that can be found in it. Implement a function called `collect_items(rooms: Li... | 1 |
[
{
"role": "user",
"content": "You are given a list of integers representing the indices of thermodynamic entries in a database. Your task is to implement a function that finds the minimum and maximum valid entry indices from the list. A valid entry index is any index that is greater than zero. The function ... | 1 |
[
{
"role": "user",
"content": "You are tasked with managing a list of interrupt service routines (ISRs) represented as strings in the format 'NVIC_<PERIPHERAL_NAME>_IRQ'. Your goal is to implement a function `manage_isrs(operations: List[Tuple[str, str]]) -> List[str]` that processes a sequence of operations... | 1 |
[
{
"role": "user",
"content": "You are tasked with implementing a Python function that performs namespace flattening on a nested dictionary. Namespace flattening involves transforming a nested dictionary into a flattened dictionary, where the keys are concatenated with a specified delimiter to represent the ... | 1 |
[
{
"role": "user",
"content": "You are given a function that determines which files should be ignored based on the name of a directory. Implement the function `ignore_files(directory: str) -> List[str]` that takes in a string `directory` representing the name of a directory and returns a list of strings that... | 1 |
[
{
"role": "user",
"content": "You are given a dictionary representing a multi-sector design with the following structure: {'unpacked_designation': <string>, 'sectors': [<dict1>, <dict2>, ...]}. Each sector dictionary can contain any key-value pairs. Your task is to implement a function `process_designation(... | 1 |
[
{
"role": "user",
"content": "Implement a function `largest_prime_factor(n: int) -> int` that returns the largest prime factor of the given integer 'n'. The function should handle both positive and negative integers. It is guaranteed that the absolute value of 'n' is greater than 1 and is not a prime number... | 1 |
[
{
"role": "user",
"content": "Implement a function `generate_sequence(starting_number: int, step: int) -> List[int]` that generates a sequence of natural numbers starting from `starting_number` and increases each subsequent number by `step`. The function should return the first `n` numbers of the sequence a... | 1 |
[
{
"role": "user",
"content": "You are given a dictionary representing various parameters of a vehicle, where keys are categories such as 'powertrain' and 'size', and the values are lists of options available in those categories. Your task is to write a function that checks if certain parameters are absent f... | 1 |
[
{
"role": "user",
"content": "You are tasked with creating a Python function to calculate the Body Mass Index (BMI) and categorize it into one of the following categories: 'Underweight' (BMI < 18.5), 'Normal weight' (18.5 <= BMI < 25), 'Overweight' (25 <= BMI < 30), or 'Obese' (BMI >= 30). Implement a funct... | 1 |
[
{
"role": "user",
"content": "You are tasked with visualizing the iterations involved in solving Lambert's problem, which is a classic problem in orbital mechanics. Your function should take as input a list of tuples representing iteration points in two-dimensional space, where each tuple contains an x-coor... | 1 |
[
{
"role": "user",
"content": "Write a function called `create_nim_board` that takes an integer `n` as input and creates a multi-stacked Nim game board represented as a list of lists. The board should consist of `n` stacks, where each stack is a list of integers representing stones. The number of stones in e... | 1 |
[
{
"role": "user",
"content": "You are given a list of celestial coordinates represented as tuples of (x, y) and a frame type. Implement a function that takes a list of such coordinates and a frame type, and returns a new list with the equinox values adjusted based on the frame type. For 'icrs' frame, the eq... | 1 |
[
{
"role": "user",
"content": "You are tasked with implementing a function that constructs a string representation of a network host. The function should take two parameters: the host's name and its endpoint. The function should return a string in the format 'Host(name, endpoint)', where 'Host' is a constant... | 1 |
[
{
"role": "user",
"content": "Implement a function `classify_text(text: str) -> str` that classifies the input text as 'Spam' or 'Not Spam' based on predefined keywords. The function should return 'Spam' if the text contains any of the following keywords: 'offer', 'free', 'win', 'click', 'subscribe'. Otherw... | 1 |
[
{
"role": "user",
"content": "You are given a list of integers and a target integer. Your task is to determine if there are two distinct indices in the list such that the sum of the integers at those indices equals the target integer. Implement a function named `find_pair_with_sum` that takes in two paramet... | 1 |
[
{
"role": "user",
"content": "Given a string input, return the string with 'Hello, ' prefixed to it. Implement a function called `greet(name: str) -> str` that takes a single parameter `name`, which is a string. The function should return the greeting message as a new string. For example, if the input is 'A... | 1 |
[
{
"role": "user",
"content": "Given an array of integers, write a function that finds the minimum sum of five negative numbers in that array. If the array contains fewer than five negative numbers, the function should raise a ValueError. Implement the function `min_sum_of_five(arr)` where `arr` is the input... | 1 |
[
{
"role": "user",
"content": "Given a list of elements, write a function that removes duplicate elements while maintaining the original order of the first occurrence of each element. The function should take a list of items and return a new list containing only the distinct elements. The function should be ... | 1 |
[
{
"role": "user",
"content": "Write a function `is_perfect_square(n: int) -> bool` that checks if a given non-negative integer `n` is a perfect square. A perfect square is an integer that is the square of an integer. For example, 0, 1, 4, 9, 16 are perfect squares, while 2, 3, 5, 6, 7, 8, 10, 11, 12, 13, 14... | 1 |
[
{
"role": "user",
"content": "You are tasked with creating a function that can handle data serialization into plain text or YAML format. The function should take two parameters: `data`, which is the data to be serialized, and `format`, which specifies the serialization format (either `1` for plain text or `... | 1 |
[
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates the execution of a custom program within a virtualization management tool. The function will take three string inputs: `python_executable_path`, `custom_path`, and `custom_program`. Your function should construct a c... | 0 |
[
{
"role": "user",
"content": "Implement a function that takes an integer and returns the cube of that integer. The function should be named `cube` and should accept a single parameter `n`, which is the integer to be cubed. The output should be an integer representing the cubed value of `n`."
}
] | 0 |
[
{
"role": "user",
"content": "Given a list of email addresses, implement a function `is_spam(email: str, dataset: List[Dict[str, Union[str, int]]]) -> bool` that determines whether the provided email address is classified as spam based on a given dataset. The dataset consists of dictionaries containing emai... | 0 |
[
{
"role": "user",
"content": "You are given a list of skills and a list of interests that a volunteer possesses. Your task is to create a function called `create_profile` that takes two lists as input: `skills` (a list of strings representing the skills) and `interests` (a list of strings representing the i... | 0 |
[
{
"role": "user",
"content": "Given a list of integers, determine if the elements are monotonically increasing or decreasing under certain conditions. The function should check for the following: if the elements form an arithmetic progression or a geometric progression, if they follow the Fibonacci sequence... | 0 |
[
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the total number of elements in a series of octree levels and returns a list of formatted strings representing the dimensions and total elements in each level. Each octree level is represented by a tuple of dimensions ... | 0 |
[
{
"role": "user",
"content": "You are tasked with updating a dictionary of parameters. Write a function `update_params(old_param: Dict[str, Any], new_param: Dict[str, Any], errors: str = 'raise') -> Dict[str, Any]` that takes in the following three arguments: \n1. `old_param`: A dictionary representing the ... | 0 |
[
{
"role": "user",
"content": "You are implementing a version control system where you need to track objects based on their version numbers. Write a function `object_has_version(key: str, version_number: int) -> None` that takes a string `key` representing the object and an integer `version_number` represent... | 0 |
[
{
"role": "user",
"content": "You are tasked with creating a Python function that validates an event data dictionary. The function should ensure that the event data meets certain criteria before it can be considered valid. The function should accept a dictionary called `event_data`, which contains the follo... | 0 |
[
{
"role": "user",
"content": "Given two lists of vertical values, `u` and `v`, representing measurements at various depths, and a target depth, implement a function `vertical_interpolation(u: List[float], v: List[float], depth: List[float], target_depth: float) -> Tuple[List[float], List[float]]` that perfo... | 0 |
[
{
"role": "user",
"content": "Given an integer value, implement a function that finds the smallest exponent such that 2 raised to that exponent is greater than or equal to the absolute value of the integer. The function should return this exponent. The input integer can be either positive, negative, or zero... | 0 |
[
{
"role": "user",
"content": "You are tasked with implementing a function that evaluates whether a physics event passes a specific cut criterion based on a hypothesis validity check and the sum of delta R values for gen-matched particles. Write a function `applyCut(isHypoValid: bool, genMatchSumDR: float) -... | 0 |
[
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a dictionary and logs its contents. The function should take in a dictionary called `responseDictionary`, log its contents with a custom logging utility, and then return the original dictionary. The logging shoul... | 0 |
[
{
"role": "user",
"content": "Given an array of non-zero integers, implement a function that calculates the product of the distinct signs of those integers multiplied by the sum of their distinct absolute values. If the array is empty or contains a zero, the function should return None. Write a function `pr... | 0 |
[
{
"role": "user",
"content": "You are given a list of strings representing the content of each cell in a worksheet. Your task is to implement a function that resizes the columns of the worksheet to fit the content inside the cells of the columns. The function should return a list of integers representing th... | 0 |
[
{
"role": "user",
"content": "You are tasked with implementing a function that takes in a list of integers and returns a new list containing only the unique elements from the original list, maintaining their original order. Write a function called `remove_duplicates` that fulfills this requirement. The func... | 0 |
[
{
"role": "user",
"content": "Given a dictionary where the keys are public key IDs (strings) and the values are x.509 certificate data (strings), implement a function that returns a list of all public key IDs in the dictionary. The function should only return the keys that have non-empty certificate data. T... | 0 |
[
{
"role": "user",
"content": "You are tasked with creating a function `generate_efficientnet_b6_model(pretrained: bool, num_classes: int, in_chans: int) -> str` that simulates the creation of an EfficientNet-B6 model configuration. The function should take three parameters: `pretrained`, a boolean indicatin... | 0 |
[
{
"role": "user",
"content": "You are tasked with implementing a function that converts a given string of HTML content into a formatted plain text output. The function should strip out all HTML tags, decode any HTML entities (like & to &), and return the plain text result. The HTML content may contain v... | 0 |
[
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates the updating or creation of a camera object based on provided details. The camera objects are represented by a dictionary, where the keys are the camera names and the values are dictionaries containing the camera att... | 0 |
[
{
"role": "user",
"content": "You are tasked with creating a function that simulates writing an emotional state to a database. The function `write_emotion` should take four parameters: `happy`, `anger`, `bored`, and `confused`, which represent the intensity of each emotion (as integers). The function should... | 0 |
[
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple database connection management system. The function should handle opening and closing the database connection, and it should provide an interface for executing SQL queries. Implement the function `manage_database_c... | 0 |
[
{
"role": "user",
"content": "Implement a function that takes a multi-dimensional nested list and transforms it into a flat list. The function should be able to handle varying levels of nested lists, ensuring that the relative order of the elements is maintained in the output. For example, given the input [... | 0 |
[
{
"role": "user",
"content": "Given a sentence consisting of words separated by spaces, write a function `sort_sentence(sentence: str) -> str` that sorts the words in the sentence in alphabetical order and returns them as a single string with words separated by a single space. The input will be a string, an... | 0 |
[
{
"role": "user",
"content": "You are working on a game development project where various objects and elements in the game world are represented using bitmasks. Each object or element has a unique identifier represented by a BitMask32 value. Your task is to create a function that can determine whether a giv... | 0 |
[
{
"role": "user",
"content": "Create a function called `filter_numbers` that takes a list of integers and returns a new list containing only the numbers that occur exactly once in the input list and are not prime numbers."
}
] | 0 |
[
{
"role": "user",
"content": "You are tasked with creating a Python function that parses a given GitHub repository URL and extracts the repository owner and repository name. The function should handle various formats of GitHub repository URLs and return the extracted information in a structured format. Writ... | 0 |
[
{
"role": "user",
"content": "Implement a function `contains_float(sequence)` that takes a list called `sequence` as input and returns `True` if there is at least one floating-point number in the list. The list may contain various data types, including integers, strings, and floats. If there are no floating... | 0 |
[
{
"role": "user",
"content": "You are tasked with creating a function `load_unique_messages(messages: List[Tuple[str, str, str, str, str]], unique: bool) -> List[Tuple[str, str, str, str, str]]` that processes a list of message tuples. Each tuple contains five elements: sender, recipients, timestamp, subjec... | 0 |
[
{
"role": "user",
"content": "You are tasked with creating a Python function that analyzes the status of a networked instance. The function should take in a dictionary `instance_data` containing information about the instance and return `None` if the instance is running but appears to be unreachable externa... | 0 |
[
{
"role": "user",
"content": "You are given a destination address represented as a string. Implement a function `trace_route(dest: str, hops: int, queries: int, timeout: int, ttl: int, wait: int) -> str` that simulates a traceroute to the given destination address. The function should return a string that d... | 0 |
[
{
"role": "user",
"content": "Given an integer `hour_angle_sunrise` that represents the hour angle of sunrise in degrees, write a function `sunlight_duration(hour_angle_sunrise)` that returns the duration of sunlight in minutes. The duration of sunlight is calculated as 8 times the `hour_angle_sunrise`. The... | 0 |
[
{
"role": "user",
"content": "You are tasked with creating a Python function that manipulates a URL. Your function should take in a URL as input and return a string that formats the URL in a specific way. The formatted URL should start with 'URL: ' followed by the provided URL. The function signature should... | 0 |
[
{
"role": "user",
"content": "Given a list of numerical inputs, implement a function that computes the product of their absolute values, after rounding down to the nearest integer. Any values exceeding 100 should be excluded from the computation. Write a function `compute_absolute_product(lst)` that takes a... | 0 |
[
{
"role": "user",
"content": "Implement a function `decimal_to_ternary(n: float) -> Tuple[str, int]` that converts a decimal number to its ternary (base 3) representation. The function should take a single parameter `n`, which can be either an integer or a float. If the input is not of type integer or float... | 0 |
[
{
"role": "user",
"content": "You are tasked with creating a function that simulates enabling an addon in a software system. The function `enable_addon(addon_module_name: str) -> str` takes a single string parameter representing the name of the addon to be enabled. The function should return a message indic... | 0 |
[
{
"role": "user",
"content": "You are tasked with creating a function `parse_section(section: str) -> List[str]` that takes a string representing a section name and returns a list containing two strings: the component and the section. The section can either be a simple name or a name prefixed with the compo... | 0 |
[
{
"role": "user",
"content": "Given an array of integers, implement a function `longestIncreasingSubsequence(arr)` that returns the length of the longest increasing subsequence in the array. An increasing subsequence is a sequence of numbers where each subsequent number is greater than the previous one. For... | 0 |
[
{
"role": "user",
"content": "You are tasked with implementing a method within the Student class that counts how many Student instances have been created. Every time a Student object is initialized, the count should increment by one. Additionally, you should implement a class method that returns the total n... | 0 |
[
{
"role": "user",
"content": "You are tasked with creating a Python function to determine the appropriate test script to call based on given command-line arguments and configuration settings. Write a function `select_test_script(sys_argv, config)` that takes a list of command-line arguments `sys_argv` and a... | 0 |
[
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a query operation on a database. The function `execute_query` should accept a string parameter `query_string` which represents a SQL query and return a string indicating the status of the query execution. If the query s... | 0 |
[
{
"role": "user",
"content": "You are tasked with implementing a vote counting system for an event. You need to create a function `vote_counting(votes: List[Tuple[str, str]]) -> Dict[str, int]` where `votes` is a list of tuples. Each tuple contains a voting `option` (a string) and a `name` (a string) repres... | 0 |
[
{
"role": "user",
"content": "Given a trigonometric function defined as: h(x, y) = 3sin(x) + 4cos^2(y), implement a function that calculates the value of h for given inputs x and y. The function should take two parameters, x and y, which are floating-point numbers, and return the computed value of h(x, y)."... | 0 |
[
{
"role": "user",
"content": "You are given a dictionary representing genetic variant information. Each variant is represented as a dictionary that contains an 'INFO' key, which itself is a dictionary. Your task is to implement a function that retrieves the minor allele frequency (MAF) from the 'INFO' dicti... | 0 |
[
{
"role": "user",
"content": "You are tasked with implementing a function that finds the closest symbol to a given position in a text editor. The function takes in a list of tuples, where each tuple contains a region (represented as a pair of integers) and a symbol (a string). The region represents the star... | 0 |
[
{
"role": "user",
"content": "You are given a nested list of integers `a`. Write a function `modify_list(a)` that modifies the list in place according to the following rules: for each element at position (i, j), if both i and j are greater than 0, replace the element with the value of the element at positio... | 0 |
[
{
"role": "user",
"content": "You are given a list of integers representing the sales figures of a company for each month in a year. Your task is to write a function `calculate_quarterly_average(sales_data)` that takes in a list of 12 integers, where each integer represents the sales figure for a specific m... | 0 |
[
{
"role": "user",
"content": "Implement a function `create_book(title: str, author: str, publication_year: int) -> dict` that takes in the title, author, and publication year of a book and returns a dictionary representing the book with keys 'title', 'author', and 'publication_year'."
}
] | 0 |
[
{
"role": "user",
"content": "Implement a function that converts a given decimal number to its ternary notation. The function should take a single integer parameter and return a string that represents the ternary (base-3) equivalent of the decimal number. If the input is 0, the function should return '0'."
... | 0 |
[
{
"role": "user",
"content": "Given a 3x3 matrix represented as a list of lists, write a function `sum_rows_columns(matrix)` that calculates the sum of elements in each row and each column of the matrix. The function should return a dictionary with keys 'row_1', 'row_2', 'row_3', 'col_1', 'col_2', and 'col_... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.