<commit_before>import { Component, PropTypes } from "react";
import { connect } from "react-redux";
import { graphql } from "react-apollo";
import ReactMixin from "react-mixin";
import gql from "graphql-tag";
import { withRouter } from "react-router";

import Split, { Left, Right } from "../../../components/@primitives/layout/split";
import Headerable from "../../../deprecated/mixins/mixins.Header";
import { nav as navActions, modal } from "../../../data/store";

import Layout from "./Layout";
import Result from "./Result";
import ErrTemplate from "./ErrTemplate";

const defaultArray = [];

class TemplateWithoutData extends Component {
  static propTypes = {
    dispatch: PropTypes.func.isRequired,
    router: PropTypes.object.isRequired,
    location: PropTypes.object.isRequired,
    autofill: PropTypes.object.isRequired,
    attributes: PropTypes.object.isRequired,
    content: PropTypes.object.isRequired,
  };

  state = {
    tags: [],
    query: null,
    latitude: null,
    longitude: null,
    campus: "",
    zip: "",
  };

  componentWillMount() {
    this.props.dispatch(navActions.setLevel("TOP"));
    if (this.headerAction) {
      this.headerAction({ title: "Group Finder" });
    }
  }

  componentWillReceiveProps(nextProps) {
    if (nextProps.location && Object.keys(nextProps.location.query).length) {
      this.props.dispatch(navActions.setLevel("BASIC_CONTENT"));
    } else {
      this.props.dispatch(navActions.setLevel("TOP"));
    }
  }

  geoLocateMe = (e: Event) => {
    if (e) e.preventDefault();
    navigator.geolocation.getCurrentPosition(this.geolocationSuccess, this.geolocationError, {
      timeout: 5000,
    });
  };

  geolocationSuccess = (position: Object) => {
    this.setState({
      latitude: position.coords.latitude,
      longitude: position.coords.longitude,
    });
    const zip = document.getElementById("zip");
    zip.value = "Using your location";
  };

  geolocationError = error => {
    this.props.dispatch(modal.render(ErrTemplate, { errorCode: error.code }));
  };

  getResults = () => {
    const { router, location } = this.props;
    const { latitude, longitude } = this.state;
    // create an array of the attributes returned by graphql
    const attributeTags = this.props.attributes.tags.map(tag => tag.value);

    const tags = [];
    const query = [];

    // find the tags that aren't defined
    this.state.tags.forEach(e => {
      if (e && attributeTags.indexOf(e) > -1) {
        tags.push(e);
      } else {
        query.push(e);
      }<commit_msg>removed the timeout<commit_after>import { Component, PropTypes } from "react";
import { connect } from "react-redux";
import { graphql } from "react-apollo";
import ReactMixin from "react-mixin";
import gql from "graphql-tag";
import { withRouter } from "react-router";

import Split, { Left, Right } from "../../../components/@primitives/layout/split";
import Headerable from "../../../deprecated/mixins/mixins.Header";
import { nav as navActions, modal } from "../../../data/store";

import Layout from "./Layout";
import Result from "./Result";
import ErrTemplate from "./ErrTemplate";

const defaultArray = [];

class TemplateWithoutData extends Component {
  static propTypes = {
    dispatch: PropTypes.func.isRequired,
    router: PropTypes.object.isRequired,
    location: PropTypes.object.isRequired,
    autofill: PropTypes.object.isRequired,
    attributes: PropTypes.object.isRequired,
    content: PropTypes.object.isRequired,
  };

  state = {
    tags: [],
    query: null,
    latitude: null,
    longitude: null,
    campus: "",
    zip: "",
  };

  componentWillMount() {
    this.props.dispatch(navActions.setLevel("TOP"));
    if (this.headerAction) {
      this.headerAction({ title: "Group Finder" });
    }
  }

  componentWillReceiveProps(nextProps) {
    if (nextProps.location && Object.keys(nextProps.location.query).length) {
      this.props.dispatch(navActions.setLevel("BASIC_CONTENT"));
    } else {
      this.props.dispatch(navActions.setLevel("TOP"));
    }
  }

  geoLocateMe = (e: Event) => {
    if (e) e.preventDefault();
    navigator.geolocation.getCurrentPosition(this.geolocationSuccess, this.geolocationError);
  };

  geolocationSuccess = (position: Object) => {
    this.setState({
      latitude: position.coords.latitude,
      longitude: position.coords.longitude,
    });
    const zip = document.getElementById("zip");
    zip.value = "Using your location";
  };

  geolocationError = error => {
    this.props.dispatch(modal.render(ErrTemplate, { errorCode: error.code }));
  };

  getResults = () => {
    const { router, location } = this.props;
    const { latitude, longitude } = this.state;
    // create an array of the attributes returned by graphql
    const attributeTags = this.props.attributes.tags.map(tag => tag.value);

    const tags = [];
    const query = [];

    // find the tags that aren't defined
    this.state.tags.forEach(e => {
      if (e && attributeTags.indexOf(e) > -1) {
        tags.push(e);
      } else {
        query.push(e);
      }
{'fraction_non_alphanumeric': 0.14705882352941177, 'fraction_numerical': 0.0011843663639952626, 'mean_word_length': 3.226021684737281, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, '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': '3206585', 'n_tokens_mistral': 1531, 'n_tokens_neox': 1522, 'n_words': 338}