code: def get_action(args):
      
      redirect_mode = args.bang or args.search or args.lucky
      if redirect_mode and not args.url:
          return webbrowser.open_new_tab
      else:
          return print_result
docs: Return a function to launch the web browser or print a result