code: def my_func(name):
      
      # 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))
docs: Sample function.