code: def parse_template(template):
      
      m = TEMPLATE_OVERRIDE_RE.match(template)
      if not m:
          return template, 0
      return m.group('template'), int(m.group('depth'))
docs: returns a 2-tuple of (template_name, number_of_priors)