code: def select_best_paths(examples):
      
      possible_paths = {}  # {varname: [paths]}
  
      # collect list of all possible paths to all existing variables
      for example in examples:
          dom = _create_dom(example["html"])
          matching_elements = _match_elements(dom, example["vars"])
  
          for key, match in matching_elements.items():
              if key not in possible_paths:  # TODO: merge paths together?
                  possible_paths[key] = _collect_paths(match)
  
      # leave only paths, that works in all examples where, are required
      for example in examples:
          dom = _create_dom(example["html"])
          matching_elements = _match_elements(dom, example["vars"])
  
          for key, paths in possible_paths.items():
              if key not in matching_elements:
                  continue
  
              possible_paths[key] = filter(
                  lambda path: _is_working_path(
                      dom,
                      path,
                      matching_elements[key]
                  ),
                  paths
              )
  
      priorities = [
          "find",
          "left_neighbour_tag",
          "right_neighbour_tag",
          "wfind",
          "match",
          "Chained"
      ]
      priorities = dict(map(lambda x: (x[1], x[0]), enumerate(priorities)))
  
      # sort all paths by priority table
      for key in possible_paths.keys():
          possible_paths[key] = list(sorted(
              possible_paths[key],
              key=lambda x: priorities.get(x.call_type, 100)
          ))
  
      return possible_paths
docs: Process `examples`, select only paths that works for every example. Select
      best paths with highest priority.
  
      Args:
          examples (dict): Output from :func:`.read_config`.
  
      Returns:
          list: List of :class:`.PathCall` and :class:`.Chained` objects.