class_docstr: A routing rule.
class_docstr_tok: ["A","routing","rule","."]
docstr: Constructs a Rule instance.
  
  :arg Matcher matcher: a `Matcher` instance used for determining
      whether the rule should be considered a match for a specific
      request.
  :arg target: a Rule's target (typically a ``RequestHandler`` or
      `~.httputil.HTTPServerConnectionDelegate` subclass or even a nested `Router`,
      depending on routing implementation).
  :arg dict target_kwargs: a dict of parameters that can be useful
      at the moment of target instantiation (for example, ``status_code``
      for a ``RequestHandler`` subclass). They end up in
      ``target_params['target_kwargs']`` of `RuleRouter.get_target_delegate`
      method.
  :arg str name: the name of the rule that can be used to find it
      in `ReversibleRouter.reverse_url` implementation.
docstr_tok: ["Constructs","a","Rule","instance",".",":","arg","Matcher","matcher",":","a","`","Matcher","`","instance","used","for","determining","whether","the","rule","should","be","considered","a","match","for","a","specific","request",".",":","arg","target",":","a","Rule","'s","target","(","typically","a","``","RequestHandler","``","or","`","~.httputil.HTTPServerConnectionDelegate","`","subclass","or","even","a","nested","`","Router","`",",","depending","on","routing","implementation",")",".",":","arg","dict","target_kwargs",":","a","dict","of","parameters","that","can","be","useful","at","the","moment","of","target","instantiation","(","for","example",",","``","status_code","``","for","a","``","RequestHandler","``","subclass",")",".","They","end","up","in","``","target_params","[","'target_kwargs","'","]","``","of","`","RuleRouter.get_target_delegate","`","method",".",":","arg","str","name",":","the","name","of","the","rule","that","can","be","used","to","find","it","in","`","ReversibleRouter.reverse_url","`","implementation","."]
code: def __init__(self, matcher, target, target_kwargs=None, name=None):
      """Constructs a Rule instance.
  
      :arg Matcher matcher: a `Matcher` instance used for determining
          whether the rule should be considered a match for a specific
          request.
      :arg target: a Rule's target (typically a ``RequestHandler`` or
          `~.httputil.HTTPServerConnectionDelegate` subclass or even a nested `Router`,
          depending on routing implementation).
      :arg dict target_kwargs: a dict of parameters that can be useful
          at the moment of target instantiation (for example, ``status_code``
          for a ``RequestHandler`` subclass). They end up in
          ``target_params['target_kwargs']`` of `RuleRouter.get_target_delegate`
          method.
      :arg str name: the name of the rule that can be used to find it
          in `ReversibleRouter.reverse_url` implementation.
      """
      if isinstance(target, str):
          # import the Module and instantiate the class
          # Must be a fully qualified name (module.ClassName)
          target = import_object(target)
  
      self.matcher = matcher  # type: Matcher
      self.target = target
      self.target_kwargs = target_kwargs if target_kwargs else {}
      self.name = name
  
imports: from __future__ import absolute_import, division, print_function
  import re
  from functools import partial
  from tornado import httputil
  from tornado.httpserver import _CallableAdapter
  from tornado.escape import url_escape, url_unescape, utf8
  from tornado.log import app_log
  from tornado.util import basestring_type, import_object, re_unescape, unicode_type
label_desc: Use image node_id 1 to create a new Rule object from inherited base classes: object with example: obj = Rule(matcher, target, target_kwargs, name)