<commit_before>import React, { Component } from 'react'
import PropTypes from 'prop-types'
import { onAuthStateChanged } from '../api/auth'

export class AuthProvider extends Component {
  state = { user: null }

  static childContextTypes = {
    signedIn: PropTypes.bool.isRequired,
  }

  getChildContext() {
    return {
      signedIn: Boolean(this.state.user),
    }
  }

  componentDidMount() {
    onAuthStateChanged((user) => this.setState({ user }))
  }

  render() {
    return React.Children.only(this.props.children)
  }
}

export const withUser = (WrappedComponent) => {
  return class extends Component {
    static contextTypes = {
      signedIn: PropTypes.bool.isRequired,
    }

    render() {
      const { signedIn } = this.context
      return (
        <WrappedComponent {...this.props} signedIn={signedIn} />
      )
    }
  }
}<commit_msg>Minor formatting change to AuthProvider<commit_after>import React, { Component } from 'react'
import PropTypes from 'prop-types'
import { onAuthStateChanged } from '../api/auth'

export class AuthProvider extends Component {
  state = { user: null }

  static childContextTypes = {
    signedIn: PropTypes.bool.isRequired,
  }

  getChildContext() {
    return {
      signedIn: Boolean(this.state.user),
    }
  }

  componentDidMount() {
    onAuthStateChanged((user) => this.setState({ user }))
  }

  render() {
    return React.Children.only(this.props.children)
  }
}

export const withUser = (WrappedComponent) =>
  class extends Component {
    static contextTypes = {
      signedIn: PropTypes.bool.isRequired,
    }

    render = () =>
      <WrappedComponent {...this.props} signedIn={this.context.signedIn} />
  }
{'fraction_non_alphanumeric': 0.12374185908821789, 'fraction_numerical': 0.0, 'mean_word_length': 3.132029339853301, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, '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': '7223133', 'n_tokens_mistral': 512, 'n_tokens_neox': 507, 'n_words': 111}