nodes: 0, module; 1, function_definition; 2, function_name:_get_sorted; 3, parameters; 4, block; 5, identifier:self; 6, identifier:resources; 7, expression_statement; 8, expression_statement; 9, for_statement; 10, return_statement; 11, comment:"""Order the resources by priority - the most specific paths come
          first.
  
          :param resources: List of :class:`wsgiservice.resource.Resource`
                            classes to be served by this application.
          """; 12, assignment; 13, identifier:resource; 14, identifier:resources; 15, block; 16, list_comprehension; 17, identifier:tmp; 18, list; 19, expression_statement; 20, comment:# Each slash counts as 10 priority, each variable takes one away; 21, expression_statement; 22, expression_statement; 23, identifier:resource; 24, for_in_clause; 25, assignment; 26, assignment; 27, call; 28, pattern_list; 29, call; 30, identifier:path; 31, attribute; 32, identifier:priority; 33, binary_operator:path.count('/') * 10 - path.count('{'); 34, attribute; 35, argument_list; 36, identifier:prio; 37, identifier:resource; 38, identifier:reversed; 39, argument_list; 40, identifier:resource; 41, identifier:_path; 42, binary_operator:path.count('/') * 10; 43, call; 44, identifier:tmp; 45, identifier:append; 46, tuple; 47, call; 48, call; 49, integer:10; 50, attribute; 51, argument_list; 52, identifier:priority; 53, identifier:resource; 54, identifier:sorted; 55, argument_list; 56, attribute; 57, argument_list; 58, identifier:path; 59, identifier:count; 60, string; 61, identifier:tmp; 62, identifier:path; 63, identifier:count; 64, string; 65, string_content:{; 66, string_content:/
code: def _get_sorted(self, resources):
          """Order the resources by priority - the most specific paths come
          first.
  
          :param resources: List of :class:`wsgiservice.resource.Resource`
                            classes to be served by this application.
          """
          tmp = []
          for resource in resources:
              path = resource._path
              # Each slash counts as 10 priority, each variable takes one away
              priority = path.count('/') * 10 - path.count('{')
              tmp.append((priority, resource))
          return [resource for prio, resource in reversed(sorted(tmp))]