original_docstring: Processes `archives` to splice out any
          instance of `XMMarker` if it exists
docstring: Processes `archives` to splice out any
  instance of `XMMarker` if it exists
docstring_tokens: Processes ` archives ` to splice out any instance of ` XMMarker ` if it exists
code: def _process_cuts(
          self,
          archives: Dict[str, str],
          cuts: Union[List[XMCutMarker], List[XMEpisodeMarker]],
      ) -> int:
          """Processes `archives` to splice out any
          instance of `XMMarker` if it exists"""
  
          if self._state.live is None or self._state.db is None:
              return 0
  
          processed = 0
          for cut in cuts:
              if cut.duration == 0.0:
                  continue
  
              db_item: Union[DBSong, DBEpisode, None] = None
              if isinstance(cut, XMEpisodeMarker):
                  db_item = (
                      self._state.db.query(DBEpisode).filter_by(guid=cut.guid).first()
                  )
              elif isinstance(cut.cut, XMSong):
                  existing = (
                      self._state.db.query(DBSong)
                      .filter_by(title=cut.cut.title, artist=cut.cut.artists[0].name)
                      .all()
                  )
  
                  if len(existing) >= MAX_DUPLICATE_COUNT:
                      continue
  
                  db_item = self._state.db.query(DBSong).filter_by(guid=cut.guid).first()
  
              if db_item is not None:
                  continue
  
              title: Optional[str] = None
              if isinstance(cut, XMEpisodeMarker):
                  title = cut.episode.long_title or cut.episode.medium_title
              elif isinstance(cut.cut, XMSong):
                  title = cut.cut.title
  
              if title is None:
                  title = "unknown"
              self._log.debug(
                  f"processing {title}: " f"{cut.time}: {cut.duration}" f"{cut.guid}"
              )
              success = self._process_cut(archives, cut)
  
              if success:
                  processed += 1
          return processed
code_tokens: def _process_cuts ( self , archives : Dict [ str , str ] , cuts : Union [ List [ XMCutMarker ] , List [ XMEpisodeMarker ] ] , ) -> int : if self . _state . live is None or self . _state . db is None : return 0 processed = 0 for cut in cuts : if cut . duration == 0.0 : continue db_item : Union [ DBSong , DBEpisode , None ] = None if isinstance ( cut , XMEpisodeMarker ) : db_item = ( self . _state . db . query ( DBEpisode ) . filter_by ( guid = cut . guid ) . first ( ) ) elif isinstance ( cut . cut , XMSong ) : existing = ( self . _state . db . query ( DBSong ) . filter_by ( title = cut . cut . title , artist = cut . cut . artists [ 0 ] . name ) . all ( ) ) if len ( existing ) >= MAX_DUPLICATE_COUNT : continue db_item = self . _state . db . query ( DBSong ) . filter_by ( guid = cut . guid ) . first ( ) if db_item is not None : continue title : Optional [ str ] = None if isinstance ( cut , XMEpisodeMarker ) : title = cut . episode . long_title or cut . episode . medium_title elif isinstance ( cut . cut , XMSong ) : title = cut . cut . title if title is None : title = "unknown" self . _log . debug ( f"processing {title}: " f"{cut.time}: {cut.duration}" f"{cut.guid}" ) success = self . _process_cut ( archives , cut ) if success : processed += 1 return processed
short_docstring: Processes `archives` to splice out any
  instance of `XMMarker` if it exists
short_docstring_tokens: Processes ` archives ` to splice out any instance of ` XMMarker ` if it exists
comment: """Processes `archives` to splice out any
          instance of `XMMarker` if it exists"""