<commit_before>import { sample } from 'lodash/collection'
import BackgroundImageModel from './BackgroundImageModel'
import { BACKGROUND_IMAGE_LEGACY_CATEGORY } from '../constants'
/**
 * Fetch a Random image from the image base.
 * @return {Promise<BackgroundImage>}  A promise that resolve
 * into a BackgroundImage instance.
 */

export default async (
  userContext,
  category = BACKGROUND_IMAGE_LEGACY_CATEGORY
) => {
  let images
  if (category === BACKGROUND_IMAGE_LEGACY_CATEGORY) {
    // We're assuming legacy photo items in the DB don't have a category. Can remove this if we migrate that field to all items.
    images = await BackgroundImageModel.getAll(userContext)<commit_msg>Commit to trigger Travis build<commit_after>import { sample } from 'lodash/collection'
import BackgroundImageModel from './BackgroundImageModel'
import { BACKGROUND_IMAGE_LEGACY_CATEGORY } from '../constants'
/**
 * Fetch a Random image from the image base.
 * @return {Promise<BackgroundImage>}  A promise that resolve
 * into a BackgroundImage instance.
 */

export default async (
  userContext,
  category = BACKGROUND_IMAGE_LEGACY_CATEGORY
) => {
  let images
  if (category === BACKGROUND_IMAGE_LEGACY_CATEGORY) {
    // We're assuming legacy photo items in the DB don't have a category.
    // Can remove this if we migrate that field to all items.
    images = await BackgroundImageModel.getAll(userContext)
{'fraction_non_alphanumeric': 0.08250355618776671, 'fraction_numerical': 0.0, 'mean_word_length': 4.539370078740157, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4822230', 'n_tokens_mistral': 421, 'n_tokens_neox': 389, 'n_words': 137}