<commit_before>import React from "react"

import mapValues from "../shared/mapValues"
import QueryString from "../shared/QueryString"

const emptyObject = {}
const defaultGetQueries = () => emptyObject

function createContainer(Component, getQueries = defaultGetQueries) {

  class PhenomicRouteContainer extends React.Component {

    constructor(props, context) {
      super(props, context)
      this.computeQueries(props)
      // if we're on the server, let's just run the query
      if (this.context.__prerendering) {
        this.query()
      }
      this.forceQuery = this.forceQuery.bind(this)
    }

    componentDidMount() {
      if (!this.context.__prerendering) {
        this.query()
      }
      this.unsubscribe = this.context.store.subscribe(() => this.update())
      if (process.env.NODE_ENV !== "production") {
        require("socket.io-client")("http://localhost:1415")
          .on("change", this.forceQuery)
      }
    }

    componentWillReceiveProps(props) {
      this.computeQueries(props)
      this.schedule(() => this.query())
    }

    componentWillUnmount() {
      this.unsubscribe()
      this.unsubscribe = null
      if (process.env.NODE_ENV !== "production") {
        require("socket.io-client")("http://localhost:1415")
          .removeListener("change", this.forceQuery)<commit_msg>Avoid redundancy for socket server url<commit_after>import React from "react"

import mapValues from "../shared/mapValues"
import QueryString from "../shared/QueryString"

const emptyObject = {}
const defaultGetQueries = () => emptyObject
const socketServerURL = "http://localhost:1415"

function createContainer(Component, getQueries = defaultGetQueries) {

  class PhenomicRouteContainer extends React.Component {

    constructor(props, context) {
      super(props, context)
      this.computeQueries(props)
      // if we're on the server, let's just run the query
      if (this.context.__prerendering) {
        this.query()
      }
      this.forceQuery = this.forceQuery.bind(this)
    }

    componentDidMount() {
      if (!this.context.__prerendering) {
        this.query()
      }
      this.unsubscribe = this.context.store.subscribe(() => this.update())
      if (process.env.NODE_ENV !== "production") {
        require("socket.io-client")(socketServerURL)
          .on("change", this.forceQuery)
      }
    }

    componentWillReceiveProps(props) {
      this.computeQueries(props)
      this.schedule(() => this.query())
    }

    componentWillUnmount() {
      this.unsubscribe()
      this.unsubscribe = null
      if (process.env.NODE_ENV !== "production") {
        require("socket.io-client")(socketServerURL)
          .removeListener("change", this.forceQuery)
{'fraction_non_alphanumeric': 0.12973171628077912, 'fraction_numerical': 0.004410143329658214, 'mean_word_length': 3.026627218934911, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '5521203', 'n_tokens_mistral': 793, 'n_tokens_neox': 761, 'n_words': 151}