<commit_before>import { createSelector } from 'reselect'

const documentCaptures = state => state.captures.document
const faceCaptures = state => state.captures.face

export const documentCaptured = createSelector(
  documentCaptures,
  documents => documents.some(i => i.valid)
)

export const documentValidAndConfirmed= createSelector(
  documentCaptures,
  documents => documents.some(i => i.valid && i.confirmed)
)

export const documentSelector = createSelector(
  documentCaptures,
  documents => documents.filter(i => i.valid)
)

export const faceCaptured = createSelector(
  faceCaptures,
  faces => faces.some(i => i.valid)
)

export const faceValidAndConfirmed= createSelector(
  faceCaptures,
  faces => faces.some(i => i.valid && i.confirmed)
)

export const faceSelector = createSelector(
  faceCaptures,
  faces => faces.filter(i => i.valid)
)

export const allCaptured = createSelector(
  documentValidAndConfirmed,
  faceValidAndConfirmed,
  (a, b) => [a, b].every(i => i)
)

export const captureSelector = createSelector(
  documentSelector,
  faceSelector,
  (documentCapture, faceCapture) => ({
    documentCapture: documentCapture[0],
    faceCapture: faceCapture[0]
  })
)<commit_msg>created selector for unprocessed documents<commit_after>import { createSelector } from 'reselect'

const documentCaptures = state => state.captures.document
const faceCaptures = state => state.captures.face

export const documentCaptured = createSelector(
  documentCaptures,
  documents => documents.some(i => i.valid)
)

export const documentValidAndConfirmed= createSelector(
  documentCaptures,
  documents => documents.some(i => i.valid && i.confirmed)
)

export const documentSelector = createSelector(
  documentCaptures,
  documents => documents.filter(i => i.valid)
)

export const faceCaptured = createSelector(
  faceCaptures,
  faces => faces.some(i => i.valid)
)

export const faceValidAndConfirmed= createSelector(
  faceCaptures,
  faces => faces.some(i => i.valid && i.confirmed)
)

export const faceSelector = createSelector(
  faceCaptures,
  faces => faces.filter(i => i.valid)
)

export const allCaptured = createSelector(
  documentValidAndConfirmed,
  faceValidAndConfirmed,
  (a, b) => [a, b].every(i => i)
)

export const captureSelector = createSelector(
  documentSelector,
  faceSelector,
  (documentCapture, faceCapture) => ({
    documentCapture: documentCapture[0],
    faceCapture: faceCapture[0]
  })
)

export const unprocessedDocuments = createSelector(documentCaptures, (documentCapturesValue) => (
  documentCapturesValue.filter(documentValue => !documentValue.processed)
))
{'fraction_non_alphanumeric': 0.1089866156787763, 'fraction_numerical': 0.0015296367112810707, 'mean_word_length': 5.288461538461538, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2947776', 'n_tokens_mistral': 779, 'n_tokens_neox': 765, 'n_words': 181}