<commit_before>import { QAlert } from '../components/alert'
import { QTransition } from '../components/transition'
import uid from '../utils/uid'

const positionList = [
  'top-left', 'top-right',
  'bottom-left', 'bottom-right',
  'top', 'bottom', 'left', 'right', 'center'
]

export default {
  create (opts) {
    return this.__vm.add(opts)
  },

  __installed: false,
  install ({ $q, Vue }) {
    if (this.__installed) { return }
    this.__installed = true

    const node = document.createElement('div')
    document.body.appendChild(node)

    this.__vm = new Vue({
      name: 'q-notifications',
      data: {
        notifs: {
          center: [],
          left: [],
          right: [],
          top: [],
          'top-left': [],
          'top-right': [],
          bottom: [],
          'bottom-left': [],
          'bottom-right': []
        }
      },
      methods: {
        add (notif) {
          if (!notif) {
            console.error('Notify: parameter required')
            return false
          }
          if (typeof notif === 'string') {
            notif = {
              message: notif,
              timeout: 5000
            }
          }
          else if (notif.position && !positionList.includes(notif.position)) {
            console.error(`Notify: wrong position: ${notif.position}`)
            return false
          }

          notif.__uid = uid()
          if (!notif.position) {
            notif.position = 'bottom'
          }
          const action = notif.position.indexOf('top') > -1 ? 'unshift' : 'push'
          this.notifs[notif.position][action](notif)

          const close = () => {<commit_msg>chore: another update for Notify<commit_after>import { QAlert } from '../components/alert'
import { QTransition } from '../components/transition'
import uid from '../utils/uid'

const positionList = [
  'top-left', 'top-right',
  'bottom-left', 'bottom-right',
  'top', 'bottom', 'left', 'right', 'center'
]

export default {
  create (opts) {
    return this.__vm.add(opts)
  },

  __installed: false,
  install ({ $q, Vue }) {
    if (this.__installed) { return }
    this.__installed = true

    const node = document.createElement('div')
    document.body.appendChild(node)

    this.__vm = new Vue({
      name: 'q-notifications',
      data: {
        notifs: {
          center: [],
          left: [],
          right: [],
          top: [],
          'top-left': [],
          'top-right': [],
          bottom: [],
          'bottom-left': [],
          'bottom-right': []
        }
      },
      methods: {
        add (notif) {
          if (!notif) {
            console.error('Notify: parameter required')
            return false
          }
          if (typeof notif === 'string') {
            notif = {
              message: notif,
              timeout: 5000
            }
          }
          else if (notif.position) {
            if (!positionList.includes(notif.position)) {
              console.error(`Notify: wrong position: ${notif.position}`)
              return false
            }
          }
          else {
            notif.position = 'bottom'
          }

          notif.__uid = uid()

          const action = notif.position.indexOf('top') > -1 ? 'unshift' : 'push'
          this.notifs[notif.position][action](notif)

          const close = () => {
{'fraction_non_alphanumeric': 0.15143369175627241, 'fraction_numerical': 0.002986857825567503, 'mean_word_length': 1.6453396524486572, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '5862307', 'n_tokens_mistral': 978, 'n_tokens_neox': 952, 'n_words': 210}