<commit_before>import React from 'react';
import imgflo from 'imgflo-url';

const sizes = [
  {maxWidth: 360, maxHeight: 360},
  {maxWidth: 640, maxHeight: 480},
  {maxWidth: 1280, maxHeight: 720},
  {maxWidth: 1920, maxHeight: 1080}
];

// All generated sources
let sourceCache = [];
export function getAllImageSources () { return sourceCache; }

function sizeByMax (cover, max=sizes[0]) {
  let {width, height} = cover;
  let {maxWidth, maxHeight} = max;
  if (!width || !height) {
    return {width: maxWidth};
  }
  if (width <= maxWidth && height <= maxHeight) {
    return {width, height};
  }
  let ratio = width/height;
  let maxRatio = maxWidth/maxHeight;<commit_msg>take out biggest<commit_after>import React from 'react';
import imgflo from 'imgflo-url';

const sizes = [
  {maxWidth: 360, maxHeight: 360},
  {maxWidth: 640, maxHeight: 480},
  {maxWidth: 1280, maxHeight: 720}
];

// All generated sources
let sourceCache = [];
export function getAllImageSources () { return sourceCache; }

function sizeByMax (cover, max=sizes[0]) {
  let {width, height} = cover;
  let {maxWidth, maxHeight} = max;
  if (!width || !height) {
    return {width: maxWidth};
  }
  if (width <= maxWidth && height <= maxHeight) {
    return {width, height};
  }
  let ratio = width/height;
  let maxRatio = maxWidth/maxHeight;
{'fraction_non_alphanumeric': 0.1426403641881639, 'fraction_numerical': 0.036418816388467376, 'mean_word_length': 4.172549019607843, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, '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': '3469032', 'n_tokens_mistral': 482, 'n_tokens_neox': 432, 'n_words': 133}