<commit_before>const admin = require('firebase-admin')
const functions = require('firebase-functions')
const cors = require('cors')({origin: true})

admin.initializeApp(functions.config().firebase)

exports.ping = functions.https.onRequest((request, response) => {
  admin.messaging().sendToDevice(request.query.token, {
    notification: {
      title: 'Todo item created',
      body: request.query.ping
    },
    data: {
      message: request.query.ping
    }
  }).then(function (response) {
    console.log('Successfully sent message:', response)
  }).catch(function (error) {
    console.log('Error sending message:', error)
  })

  cors(request, response, () => {
    response.json({
      pong: request.query.ping
    })
  })
})

exports.clean = functions.https.onRequest((request, response) => {
  admin.database().ref('/').set({
    todos: {
      '-KtqzKEE4kQHdckAXEmh': {
        done: true,
        label: 'Hello'
      },
      '-KtqzL-Rgzmox9liHblv': {
        done: false,
        label: 'World'
      }
    }
  })

  admin.storage().bucket().upload(
    'clean.png',
    { destination: 'test.png' }
  )

  cors(request, response, () => {
    response.json({
      done: true
    })
  })
})
<commit_msg>Clean firestore data.<commit_after>const admin = require('firebase-admin')
const functions = require('firebase-functions')
const cors = require('cors')({origin: true})

admin.initializeApp(functions.config().firebase)

exports.ping = functions.https.onRequest((request, response) => {
  admin.messaging().sendToDevice(request.query.token, {
    notification: {
      title: 'Todo item created',
      body: request.query.ping
    },
    data: {
      message: request.query.ping
    }
  }).then(function (response) {
    console.log('Successfully sent message:', response)
  }).catch(function (error) {
    console.log('Error sending message:', error)
  })

  cors(request, response, () => {
    response.json({
      pong: request.query.ping
    })
  })
})

exports.clean = functions.https.onRequest((request, response) => {
  admin.database().ref('/').set({
    todos: {
      '-KtqzKEE4kQHdckAXEmh': {
        done: true,
        label: 'Hello'
      },
      '-KtqzL-Rgzmox9liHblv': {
        done: false,
        label: 'World'
      }
    }
  })

  const documentReferences = []
  const todos = admin.firestore().collection('todos')

  todos.stream()
  .on('data', snapshot => documentReferences.push(snapshot.ref))
  .on('end', () => {
    Promise.all(documentReferences.map(ref => ref.delete()))
    .then(() => {
      todos.add({
        done: true,
        label: 'Hello'
      })
      todos.add({
        done: false,
        label: 'World'
      })
    })
  })

  admin.storage().bucket().upload(
    'clean.png',
    { destination: 'test.png' }
  )

  cors(request, response, () => {
    response.json({
      done: true
    })
  })
})

{'fraction_non_alphanumeric': 0.17276210379658655, 'fraction_numerical': 0.0013932427725531174, 'mean_word_length': 2.7395833333333335, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '633168', 'n_tokens_mistral': 950, 'n_tokens_neox': 949, 'n_words': 157}