original_docstring: Clears songs from queue that match a predicate.
          Returns the amount of songs removed
docstring: Clears songs from queue that match a predicate.
  Returns the amount of songs removed
docstring_tokens: Clears songs from queue that match a predicate . Returns the amount of songs removed
code: def clear_by_predicate(self, predicate):
          """Clears songs from queue that match a predicate.
          Returns the amount of songs removed"""
          removed = self.select_by_predicate(predicate)
          for song in removed:
              try:
                  self.playlist.remove(song)
              except ValueError:
                  pass
  
          return len(removed)
code_tokens: def clear_by_predicate ( self , predicate ) : removed = self . select_by_predicate ( predicate ) for song in removed : try : self . playlist . remove ( song ) except ValueError : pass return len ( removed )
short_docstring: Clears songs from queue that match a predicate.
short_docstring_tokens: Clears songs from queue that match a predicate .
comment: """Clears songs from queue that match a predicate.
          Returns the amount of songs removed"""