<commit_before>import React from 'react';
import styled from 'react-emotion';
import { graphql } from 'react-apollo';
import gql from 'graphql-tag';
import TodaySchedule from '../components/TodaySchedule';
import { keyBy } from 'lodash';
import { Flex, Box } from 'grid-emotion';
import { HomepageBlock } from '../components/ContentTypesBlock';
import { OnAirBlock } from '../components/OnAirBlock';

interface IProps {
  data: any;
}

const WelcomeHeading = styled.h1`
  font-size: 1.6rem;
  margin: 0;
  padding-top: 1rem;
  padding-bottom: 1rem;

  @media (min-width: 960px) {
    font-size: 2.8rem;
    padding-top: 2rem;
    padding-bottom: 2rem;
  }

  @media (min-width: 1440px) {
    font-size: 4.1rem;
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
`;

const BlockContainer = styled.div`
  max-width: 1440px;
`;

function renderBlocks(props: IProps) {
  if (props.data.loading) {
    return <div>loading</div>;
  }

  if (props.data.error) {
    return <div>error</div>;
  }
  const byPosition = keyBy(props.data.homepage, 'position');

  const hasHero = byPosition.hasOwnProperty('HERO');
  const hasSecondary =
    byPosition.hasOwnProperty('SEC_1') && byPosition.hasOwnProperty('SEC_2');
  const hasThirds =
    byPosition.hasOwnProperty('THIRD_1') &&
    byPosition.hasOwnProperty('THIRD_2') &&
    byPosition.hasOwnProperty('THIRD_3');

  return (
    <BlockContainer>
      {hasHero && (
        <Flex mx={-2} wrap>
          <Box width={[1, 400]} px={2} mb={2}>
            <OnAirBlock />
          </Box>
          <Box width={1} px={2} mb={2}>
            <HomepageBlock block={byPosition.HERO} size={1} />
          </Box>
        </Flex>
      )}
      {hasSecondary && (
        <Flex mx={-2} wrap>
          <Box width={[1, 1 / 2]} px={2} mb={2}><commit_msg>Line up on air block<commit_after>import React from 'react';
import styled from 'react-emotion';
import { graphql } from 'react-apollo';
import gql from 'graphql-tag';
import TodaySchedule from '../components/TodaySchedule';
import { keyBy } from 'lodash';
import { Flex, Box } from 'grid-emotion';
import { HomepageBlock } from '../components/ContentTypesBlock';
import { OnAirBlock } from '../components/OnAirBlock';

interface IProps {
  data: any;
}

const WelcomeHeading = styled.h1`
  font-size: 1.6rem;
  margin: 0;
  padding-top: 1rem;
  padding-bottom: 1rem;

  @media (min-width: 960px) {
    font-size: 2.8rem;
    padding-top: 2rem;
    padding-bottom: 2rem;
  }

  @media (min-width: 1440px) {
    font-size: 4.1rem;
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
`;

const BlockContainer = styled.div`
  max-width: 1440px;
`;

function renderBlocks(props: IProps) {
  if (props.data.loading) {
    return <div>loading</div>;
  }

  if (props.data.error) {
    return <div>error</div>;
  }
  const byPosition = keyBy(props.data.homepage, 'position');

  const hasHero = byPosition.hasOwnProperty('HERO');
  const hasSecondary =
    byPosition.hasOwnProperty('SEC_1') && byPosition.hasOwnProperty('SEC_2');
  const hasThirds =
    byPosition.hasOwnProperty('THIRD_1') &&
    byPosition.hasOwnProperty('THIRD_2') &&
    byPosition.hasOwnProperty('THIRD_3');

  return (
    <BlockContainer>
      {hasHero && (
        <Flex mx={-2} wrap>
          <Box width={[1, 400]} px={2} mb={2}>
            <OnAirBlock />
          </Box>
          <Box width={1} px={2} mb={2} flex="1 1 0">
            <HomepageBlock block={byPosition.HERO} size={1} />
          </Box>
        </Flex>
      )}
      {hasSecondary && (
        <Flex mx={-2} wrap>
          <Box width={[1, 1 / 2]} px={2} mb={2}>
{'fraction_non_alphanumeric': 0.16007795100222716, 'fraction_numerical': 0.02700445434298441, 'mean_word_length': 3.0011135857461024, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, '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': '1272391', 'n_tokens_mistral': 1319, 'n_tokens_neox': 1256, 'n_words': 274}