def my_func(name):
    """Sample function."""
    # Add exception
    exobj = addex(TypeError, "Argument `name` is not valid")
    # Conditionally raise exception
    exobj(not isinstance(name, str))
    print("My name is {0}".format(name))
Sample function.