Skip to content
Snippets Groups Projects
my_module.py 685 B
Newer Older
Christian Doh Dinga's avatar
Christian Doh Dinga committed
"""Documentation about the demoses_distibuted_optimization module."""


# FIXME: put actual code here
def hello(name):
    """Say hello.

    Function docstring using Google docstring style.

    Args:
        name (str): Name to say hello to

    Returns:
        str: Hello message

    Raises:
        ValueError: If `name` is equal to `nobody`

    Example:
        This function can be called with `Jane Smith` as argument using

        >>> from demoses_distibuted_optimization.my_module import hello
        >>> hello('Jane Smith')
        'Hello Jane Smith!'

    """
    if name == 'nobody':
        raise ValueError('Can not say hello to nobody')
    return f'Hello {name}!'