def _get_notes(
    self,
    notes: pd.DataFrame,
    noteStatusHistory: pd.DataFrame,
  ):
    """Determine notes to include in scoring and associated metadata.

    To be included, notes must have an associated tweet and classification.  Returned columns
    include: noteId, tweetId, classification, noteCreationMillis, tweetCreationMillis

    Args:
      notes: Input DataFrame containing creation times.
      noteStatusHistory: Input DataFrame containing creation times.
    """
    # Validate that "notes" contains a subset of noteStatusHistory.
    assert notes[c.noteIdKey].nunique() == len(notes), "notes contains duplicate noteIds"
    assert noteStatusHistory[c.noteIdKey].nunique() == len(
      noteStatusHistory
    ), "noteStatusHistory contains duplicate noteIds"
    assert len(notes) == len(
      noteStatusHistory[[c.noteIdKey, c.createdAtMillisKey]].merge(
        notes[[c.noteIdKey, c.createdAtMillisKey]],
        on=[c.noteIdKey, c.createdAtMillisKey],
        how="inner",
      )
    ), "notes is not a subset of noteStatusHistory"
    # Develop set of candidate notes
    candidateNotes = noteStatusHistory[[c.noteIdKey, c.createdAtMillisKey]].rename(
      columns={c.createdAtMillisKey: _NOTE_CREATION_MILLIS}
    )
    candidateNotes = candidateNotes.merge(notes[[c.noteIdKey, c.tweetIdKey, c.classificationKey]])
    candidateNotes[_TWEET_CREATION_MILLIS] = [
      _get_timestamp_from_snowflake(tweetId) for tweetId in candidateNotes[c.tweetIdKey]
    ]
    # Prune candidates to require that associated tweet and classification are available, and possibly
    # that associated tweet is recent.
    candidateNotes = candidateNotes[
      (candidateNotes[c.tweetIdKey] > 0) & (candidateNotes[c.classificationKey].notna())
    ]
    return candidateNotes
Determine notes to include in scoring and associated metadata.

    To be included, notes must have an associated tweet and classification.  Returned columns
    include: noteId, tweetId, classification, noteCreationMillis, tweetCreationMillis

    Args:
      notes: Input DataFrame containing creation times.
      noteStatusHistory: Input DataFrame containing creation times.
    
sourcecode/scoring/pflip_plus_model.py