docs: def _clean_rule(self, rule):
          """
          Cleans a css Rule by removing Selectors without matches on the tree
          Returns None if the whole rule do not match
  
          :param rule: CSS Rule to check
          :type rule: A tinycss Rule object
          :returns: A cleaned tinycss Rule with only Selectors matching the tree or None
          :rtype: tinycss Rule or None
          """
          # Always match @ rules
          if rule.at_keyword is not None:
              return rule
  
          # Clean selectors
          cleaned_token_list = []
  
          for token_list in split_on_comma(rule.selector):
  
              # If the token list matches the tree
              if self._token_list_matches_tree(token_list):
  
                  # Add a Comma if multiple token lists matched
                  if len(cleaned_token_list) > 0:
                      cleaned_token_list.append(
                          cssselect.parser.Token('DELIM', ',', len(cleaned_token_list) + 1))
  
                  # Append it to the list of cleaned token list
                  cleaned_token_list += token_list
  
          # Return None if selectors list is empty
          if not cleaned_token_list:
              return None
  
          # Update rule token list
          rule.selector = cleaned_token_list
  
          # Return cleaned rule
          return rule