<commit_before>/* @flow */

import Pouch from '../../../core/pouch'

import type { Metadata, MetadataSidesInfo } from '../../../core/metadata'

export default class BaseMetadataBuilder {
  pouch: ?Pouch
  opts: {
    path: string,
    trashed?: true,
    sides: MetadataSidesInfo
  }

  constructor (pouch: ?Pouch) {
    this.pouch = pouch
    this.opts = {
      path: 'foo',
      sides: {}
    }
  }

  path (path: string): this {
    this.opts.path = path
    return this
  }

  trashed (): this {
    this.opts.trashed = true
    return this
  }

  notUpToDate (): this {
    this.opts.sides = {remote: 1}
    return this
  }

  build (): Metadata {
    throw new Error('BaseMetadataBuilder#build() not implemented')
  }

  async create (): Promise<Metadata> {
    if (this.pouch == null) {
      throw new Error('Cannot create dir metadata without Pouch')<commit_msg>test/builders/metadata: Add ino()<commit_after>/* @flow */

import Pouch from '../../../core/pouch'

import type { Metadata, MetadataSidesInfo } from '../../../core/metadata'

export default class BaseMetadataBuilder {
  pouch: ?Pouch
  opts: {
    path: string,
    trashed?: true,
    sides: MetadataSidesInfo
  }

  constructor (pouch: ?Pouch) {
    this.pouch = pouch
    this.opts = {
      path: 'foo',
      sides: {}
    }
  }

  ino (ino: number): this {
    this.opts.ino = ino
    return this
  }

  path (path: string): this {
    this.opts.path = path
    return this
  }

  trashed (): this {
    this.opts.trashed = true
    return this
  }

  notUpToDate (): this {
    this.opts.sides = {remote: 1}
    return this
  }

  build (): Metadata {
    throw new Error('BaseMetadataBuilder#build() not implemented')
  }

  async create (): Promise<Metadata> {
    if (this.pouch == null) {
      throw new Error('Cannot create dir metadata without Pouch')
{'fraction_non_alphanumeric': 0.1402936378466558, 'fraction_numerical': 0.001087547580206634, 'mean_word_length': 2.49146110056926, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '7564808', 'n_tokens_mistral': 622, 'n_tokens_neox': 611, 'n_words': 161}