input: Write a function to check if a given URL is a valid route in a Flask app.
  assert is_valid_route("/") == True
  assert is_valid_route("/nonexistent") == False
  assert is_valid_route("/hello") == False
output: def is_valid_route(url):
      from flask import Flask
      import urllib
  
      app = Flask(__name__)
  
      @app.route('/')
      def home():
          return "Home"
  
      with app.test_request_context():
          try:
              app.url_map.bind("").match(urllib.parse.urlparse(url).path)
              return True
          except (werkzeug.routing.RequestRedirect, werkzeug.routing.NotFound, werkzeug.routing.MethodNotAllowed):
              return False