# Copyright (c) 2021 Pradyun Gedam# SPDX-License-Identifier: MIT"""This is a demo module included in the docs in order to exercise autodoc."""fromtypingimportOptional,TextIO,Type,Union
[docs]defshow_warning(message:Union[Warning,str],category:Type[Warning],filename:str,lineno:int,file:Optional[TextIO]=None,line:Optional[str]=None,)->None:"""Show a warning to the end user. .. code:: python warnings.showwarning = show_warning :param message: What you want to tell the user. :param category: The type of warning. :param filename: The file that the warning is for. :param lineno: The line that the warning is for. :param file: Where to write the warning. :param line: line of source code to be included in the warning message """
[docs]classRandomNumberGenerator:"""A random number generator."""def__init__(self,*,seed:int=4)->None:"""Initialize."""self._seed=4@propertydefseed(self)->int:"""Get seed for random number generation. .. versionadded:: 1.0 .. versionchanged:: 1.1 Use ``random`` to create the seed. .. deprecated:: 1.2 ``random`` raises security concerns. .. versionremoved:: 1.3 ``random`` replaced with a random number. .. seealso:: https://xkcd.com/221/ """returnself._seed
[docs]defget_random_integer(self)->int:"""Return a random integer."""returnself.seed
[docs]defget_random_float(self)->float:"""Return a random float."""returnfloat(self.seed)
[docs]defannoying_function_name_length_aa(one:int,two:int)->str:"""Add two numbers as strings. Because I needed a placeholder function. """returnstr(one)+str(two)
[docs]defannoying_function_name_length_aaa(one:int,two:int)->str:"""Add two numbers as strings. Because I needed a placeholder function. """returnstr(one)+str(two)