<commit_before>import React from 'react';
import Avatar from 'react-md/lib/Avatars';
import FontIcon from 'react-md/lib/FontIcons';
import { Link } from 'react-router';

import { toTitle } from './StringUtils';
import { flatten } from './index';

import sassIcon from '../../imgs/sass-icon.png';
const reactLogo = 'https://facebook.github.io/react/img/logo.svg';
const googleLogo = 'https://i.ytimg.com/vi/PAKCgvprpQ8/maxresdefault.jpg';

function mapComponentRoutes(component, prefix = '') {
  let realPath, options, realNestedItems;
  if(typeof component === 'string') {
    realPath = component;
    options = {};
  } else {
    const { path, nestedItems, ...remaining } = component;
    realPath = path;
    realNestedItems = nestedItems;
    options = remaining;
  }

  if(prefix) {
    prefix += '/';
  }

  return {
    ...options,
    nestedItems: realNestedItems && realNestedItems.map(c => mapComponentRoutes(c, realPath)),
    path: `components/${prefix}${realPath}`,
    primaryText: toTitle(realPath),
  };
}

const components = [
  'avatars', {
    path: 'buttons',
    nestedItems: ['flat', 'raised', 'floating', 'icon'],
  },
  'cards',
  'chips',
  'dialogs',
  'dividers',
  'font-icons',
  'lists',
  'inks',
  'menus',
  'navigation-drawers',
  'papers', {
    path: 'pickers',
    nestedItems: ['date', 'time'],
  }, {
    path: 'progress',
    nestedItems: ['circular', 'linear'],
  }, 'select-fields', {
    path: 'selection-controls',
    nestedItems: ['checkboxes', 'radios', 'switches'],
  },
  'sidebars',
  'sliders',
  'snackbars',
  'tabs',
  'text-fields',
  'toolbars',
  'tooltips',
].map(c => mapComponentRoutes(c));
export const FIRST_COMPONENT_LINK = `/${components[0].path}`;

function mapItemsToNavParts({ component, icon, avatarProps, path, nestedItems, primaryText, ...props }, pathname) {
  if(props.subheader || props.divider) {
    return props;
  }

  let left;
  if(icon) {
    left = <FontIcon>{icon}</FontIcon>;
  } else if(avatarProps) {
    left = <Avatar {...avatarProps} className="fake-icon" />;
  }

  const to = path;
  let componentToUse;<commit_msg>Forgot to make paths absolute..<commit_after>import React from 'react';
import Avatar from 'react-md/lib/Avatars';
import FontIcon from 'react-md/lib/FontIcons';
import { Link } from 'react-router';

import { toTitle } from './StringUtils';
import { flatten } from './index';

import sassIcon from '../../imgs/sass-icon.png';
const reactLogo = 'https://facebook.github.io/react/img/logo.svg';
const googleLogo = 'https://i.ytimg.com/vi/PAKCgvprpQ8/maxresdefault.jpg';

function mapComponentRoutes(component, prefix = '') {
  let realPath, options, realNestedItems;
  if(typeof component === 'string') {
    realPath = component;
    options = {};
  } else {
    const { path, nestedItems, ...remaining } = component;
    realPath = path;
    realNestedItems = nestedItems;
    options = remaining;
  }

  if(prefix) {
    prefix += '/';
  }

  return {
    ...options,
    nestedItems: realNestedItems && realNestedItems.map(c => mapComponentRoutes(c, realPath)),
    path: `components/${prefix}${realPath}`,
    primaryText: toTitle(realPath),
  };
}

const components = [
  'avatars', {
    path: 'buttons',
    nestedItems: ['flat', 'raised', 'floating', 'icon'],
  },
  'cards',
  'chips',
  'dialogs',
  'dividers',
  'font-icons',
  'lists',
  'inks',
  'menus',
  'navigation-drawers',
  'papers', {
    path: 'pickers',
    nestedItems: ['date', 'time'],
  }, {
    path: 'progress',
    nestedItems: ['circular', 'linear'],
  }, 'select-fields', {
    path: 'selection-controls',
    nestedItems: ['checkboxes', 'radios', 'switches'],
  },
  'sidebars',
  'sliders',
  'snackbars',
  'tabs',
  'text-fields',
  'toolbars',
  'tooltips',
].map(c => mapComponentRoutes(c));
export const FIRST_COMPONENT_LINK = `/${components[0].path}`;

function mapItemsToNavParts({ component, icon, avatarProps, path, nestedItems, primaryText, ...props }, pathname) {
  if(props.subheader || props.divider) {
    return props;
  }

  let left;
  if(icon) {
    left = <FontIcon>{icon}</FontIcon>;
  } else if(avatarProps) {
    left = <Avatar {...avatarProps} className="fake-icon" />;
  }

  const to = '/' + path;
  let componentToUse;
{'fraction_non_alphanumeric': 0.18044402456306094, 'fraction_numerical': 0.000944733112895607, 'mean_word_length': 3.684734513274336, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, 'https://': 4, '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': '1652915', 'n_tokens_mistral': 1475, 'n_tokens_neox': 1456, 'n_words': 307}