<commit_before>import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import _ from 'lodash';
import qs from 'qs';

import MapComponent from '../components/map';
import LocationsSource from '../components/map/locations-source';
import MeasurementsLayer from '../components/map/measurements-layer';
import MobileLayer from '../components/map/mobile-layer';
import Legend from '../components/map/legend';

function WorldMap({ parameters, location }) {
  const query = qs.parse(location.search, {
    ignoreQueryPrefix: true,
  });
  let parameterData = _.find(parameters, { name: query.parameter });
  let activeParam = parameterData || _.find(parameters, { name: 'PM25' });
  return (
    <section className="inpage">
      <header className="inpage__header">
        <div className="inner">
          <div className="inpage__headline">
            <h1 className="inpage__title">Map</h1>
          </div>
        </div>
      </header>
      <div className="inpage__body">
        <MapComponent>
          <LocationsSource activeParameter={activeParam.name.toLowerCase()}>
            <MobileLayer />
            <MeasurementsLayer
              activeParameter={activeParam.name.toLowerCase()}
            />
          </LocationsSource>
          <Legend parameters={parameters} activeParameter={activeParam.name} />
        </MapComponent>
      </div>
    </section>
  );
}

WorldMap.propTypes = {
  location: PropTypes.object,
  history: PropTypes.object,

  parameters: PropTypes.array,
};

// /////////////////////////////////////////////////////////////////////
// Connect functions

function selector(state) {
  return {
    parameters: state.baseData.data.parameters,
  };
}

export default connect(selector)(WorldMap);
<commit_msg>Patch for test<commit_after>import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import _ from 'lodash';
import qs from 'qs';

import MapComponent from '../components/map';
import LocationsSource from '../components/map/locations-source';
import MeasurementsLayer from '../components/map/measurements-layer';
import MobileLayer from '../components/map/mobile-layer';
import Legend from '../components/map/legend';

function WorldMap({ parameters, location }) {
  const query = qs.parse(location.search, {
    ignoreQueryPrefix: true,
  });
  let parameterData = _.find(parameters, { name: query.parameter });
  let activeParam = parameterData || _.find(parameters, { name: 'pm25' });
  return (
    <section className="inpage">
      <header className="inpage__header">
        <div className="inner">
          <div className="inpage__headline">
            <h1 className="inpage__title">Map</h1>
          </div>
        </div>
      </header>
      <div className="inpage__body">
        <MapComponent>
          <LocationsSource activeParameter={activeParam.name.toLowerCase()}>
            <MobileLayer />
            <MeasurementsLayer
              activeParameter={activeParam.name.toLowerCase()}
            />
          </LocationsSource>
          <Legend parameters={parameters} activeParameter={activeParam.name} />
        </MapComponent>
      </div>
    </section>
  );
}

WorldMap.propTypes = {
  location: PropTypes.object,
  history: PropTypes.object,

  parameters: PropTypes.array,
};

// /////////////////////////////////////////////////////////////////////
// Connect functions

function selector(state) {
  return {
    parameters: state.baseData.data.parameters,
  };
}

export default connect(selector)(WorldMap);

{'fraction_non_alphanumeric': 0.16773832820799553, 'fraction_numerical': 0.0022365110427732737, 'mean_word_length': 2.7232049947970864, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 41, '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': '350304', 'n_tokens_mistral': 941, 'n_tokens_neox': 944, 'n_words': 212}