<commit_before>import React from 'react'
import PropTypes from 'prop-types'
import provideContext from './provideContext'
import withContext from './withContext'

const contextShape = PropTypes.shape({ headers: PropTypes.object })
const TableContext = provideContext('responsiveTable', contextShape)
const withTableContext = withContext('responsiveTable', contextShape)
const omit = (obj, omitProps) =>
  Object.keys(obj)
    .filter(key => omitProps.indexOf(key) === -1)
    .reduce((returnObj, key) => ({ ...returnObj, [key]: obj[key] }), {})

const allowed = props =>
  omit(props, ['inHeader', 'columnKey', 'responsiveTable'])

export class Table extends React.Component {
  constructor(props) {
    super(props)
    this.state = {
      headers: {},
    }
  }
  render() {
    const { headers } = this.state
    const classes = (this.props.className || '') + ' responsiveTable'
    return (
      <TableContext headers={headers}>
        <table {...allowed(this.props)} className={classes} />
      </TableContext>
    )
  }
}

export const Thead = props => (
  <thead {...allowed(props)}>
    {React.cloneElement(props.children, { inHeader: true })}
  </thead>
)

class TrInner extends React.Component {
  constructor(props) {
    super(props)
    const { headers } = props.responsiveTable
    if (headers && props.inHeader) {
      props.children.map((child, i) => {<commit_msg>Use React.Children.map Top level api except props.children.map<commit_after>import React from 'react'
import PropTypes from 'prop-types'
import provideContext from './provideContext'
import withContext from './withContext'

const contextShape = PropTypes.shape({ headers: PropTypes.object })
const TableContext = provideContext('responsiveTable', contextShape)
const withTableContext = withContext('responsiveTable', contextShape)
const omit = (obj, omitProps) =>
  Object.keys(obj)
    .filter(key => omitProps.indexOf(key) === -1)
    .reduce((returnObj, key) => ({ ...returnObj, [key]: obj[key] }), {})

const allowed = props =>
  omit(props, ['inHeader', 'columnKey', 'responsiveTable'])

export class Table extends React.Component {
  constructor(props) {
    super(props)
    this.state = {
      headers: {},
    }
  }
  render() {
    const { headers } = this.state
    const classes = (this.props.className || '') + ' responsiveTable'
    return (
      <TableContext headers={headers}>
        <table {...allowed(this.props)} className={classes} />
      </TableContext>
    )
  }
}

export const Thead = props => (
  <thead {...allowed(props)}>
    {React.cloneElement(props.children, { inHeader: true })}
  </thead>
)

class TrInner extends React.Component {
  constructor(props) {
    super(props)
    const { headers } = props.responsiveTable
    if (headers && props.inHeader) {
      React.Children.map(props.children, (child, i) => {
{'fraction_non_alphanumeric': 0.1509700176366843, 'fraction_numerical': 0.0007054673721340388, 'mean_word_length': 3.782462057335582, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 25, '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': '2332511', 'n_tokens_mistral': 840, 'n_tokens_neox': 828, 'n_words': 201}