code: def apply_branchset(self, branchset_node, branchset):
          
          apply_to_branches = branchset_node.attrib.get('applyToBranches')
          if apply_to_branches:
              apply_to_branches = apply_to_branches.split()
              for branch_id in apply_to_branches:
                  if branch_id not in self.branches:
                      raise LogicTreeError(
                          branchset_node, self.filename,
                          "branch '%s' is not yet defined" % branch_id)
                  branch = self.branches[branch_id]
                  if branch.child_branchset is not None:
                      raise LogicTreeError(
                          branchset_node, self.filename,
                          "branch '%s' already has child branchset" % branch_id)
                  if branch not in self.open_ends:
                      raise LogicTreeError(
                          branchset_node, self.filename,
                          'applyToBranches must reference only branches '
                          'from previous branching level')
                  branch.child_branchset = branchset
          else:
              for branch in self.open_ends:
                  branch.child_branchset = branchset
docs: See superclass' method for description and signature specification.
  
          Parses branchset node's attribute ``@applyToBranches`` to apply
          following branchests to preceding branches selectively. Branching
          level can have more than one branchset exactly for this: different
          branchsets can apply to different open ends.
  
          Checks that branchset tries to be applied only to branches on previous
          branching level which do not have a child branchset yet.