<commit_before>import React, { Component } from 'react';
import Header from './components/Header';
import Loader from './components/Loader';
import SearchForm from './components/SearchForm';
import DaysTable from './components/DaysTable';

import './App.css';

class App extends Component {
  constructor() {
    super();
    this.state = {
      loading: true,
      city: '',
      list: [],
    }

    this.handleSubmit = this.handleSubmit.bind(this);
    this.handleInputChange = this.handleInputChange.bind(this);
  }

  componentDidMount() {
    setTimeout(() => this.setState({ loading: false }), 1000); 
  }

  handleInputChange = (value) => {
    this.setState({
      city: value
    });
  }

  handleSubmit = (evt) => {
    this.setState({ loading: true });
    evt.preventDefault();
    //const URL = '/data.json';
    // Need to do that as github pages is on https and 
    const URL = `https://cors-anywhere.herokuapp.com/http://api.openweathermap.org/data/2.5/forecast?q=${this.state.city},uk&units=metric&appid=cc9fafbcb2f3ff46890ef19abaa2fe87`;
    fetch(URL)
    .then( response => response.json() )
    .then( (data) => {
      const processedList = [];
      for(let item of data.list) {
        const aDate = item.dt_txt.split(' ');
        if(!processedList[aDate[0]]){
          processedList[aDate[0]] = [];
        }
        processedList[aDate[0]].push({
          hour: aDate[1].substr(0,5),
          temp: item.main.temp,
          icon: `https://cors-anywhere.herokuapp.com/http://openweathermap.org/img/w/${item.weather[0].icon}.png`,
          description: item.weather[0].description,
        })
      }
      this.setState({list: processedList});
      setTimeout(() => this.setState({ loading: false }), 500); 
    });
  }

  render() {
    return (
      <div className="content">
        <Header />
        <SearchForm 
          {...this.state}
          handleSubmit={this.handleSubmit}
          handleInputChange={this.handleInputChange}/><commit_msg>Load image via https<commit_after>import React, { Component } from 'react';
import Header from './components/Header';
import Loader from './components/Loader';
import SearchForm from './components/SearchForm';
import DaysTable from './components/DaysTable';

import './App.css';

class App extends Component {
  constructor() {
    super();
    this.state = {
      loading: true,
      city: '',
      list: [],
    }

    this.handleSubmit = this.handleSubmit.bind(this);
    this.handleInputChange = this.handleInputChange.bind(this);
  }

  componentDidMount() {
    setTimeout(() => this.setState({ loading: false }), 1000); 
  }

  handleInputChange = (value) => {
    this.setState({
      city: value
    });
  }

  handleSubmit = (evt) => {
    this.setState({ loading: true });
    evt.preventDefault();
    //const URL = '/data.json';
    // Need to do that as github pages is on https and 
    const URL = `https://cors-anywhere.herokuapp.com/http://api.openweathermap.org/data/2.5/forecast?q=${this.state.city},uk&units=metric&appid=cc9fafbcb2f3ff46890ef19abaa2fe87`;
    fetch(URL)
    .then( response => response.json() )
    .then( (data) => {
      const processedList = [];
      for(let item of data.list) {
        const aDate = item.dt_txt.split(' ');
        if(!processedList[aDate[0]]){
          processedList[aDate[0]] = [];
        }
        processedList[aDate[0]].push({
          hour: aDate[1].substr(0,5),
          temp: item.main.temp,
          icon: `https://openweathermap.org/img/w/${item.weather[0].icon}.png`,
          description: item.weather[0].description,
        })
      }
      this.setState({list: processedList});
      setTimeout(() => this.setState({ loading: false }), 500); 
    });
  }

  render() {
    return (
      <div className="content">
        <Header />
        <SearchForm 
          {...this.state}
          handleSubmit={this.handleSubmit}
          handleInputChange={this.handleInputChange}/>
{'fraction_non_alphanumeric': 0.16203235591506573, 'fraction_numerical': 0.015166835187057633, 'mean_word_length': 2.643646408839779, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 21, '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': '441922', 'n_tokens_mistral': 1260, 'n_tokens_neox': 1224, 'n_words': 230}