<commit_before>import * as React from 'react'
import { LinkButton } from '../lib/link-button'
import { Button } from '../lib/button'

const ForgotPasswordURL = 'https://github.com/password_<PASSWORD>'

interface ISignInDotComProps {
  readonly onSignInWithBrowser: () => void

  readonly additionalButtons?: ReadonlyArray<JSX.Element>
}

interface ISignInDotComState {
  readonly username: string
  readonly password: string
}

/** The GitHub.com sign in component. */
export class SignInDotCom extends React.Component<ISignInDotComProps, ISignInDotComState> {
  public constructor(props: ISignInDotComProps) {
    super(props)

    this.state = { username: '', password: '' }
  }

  public render() {
    const signInDisabled = Boolean(!this.state.username.length || !this.state.password.length)
    return (
      <form id='sign-in-form' onSubmit={e => this.signIn(e)}>
        <label>Username or email address
          <input onChange={e => this.onUsernameChange(e)}/>
        </label>

        <label>Password
          <input type='password' onChange={e => this.onPasswordChange(e)}/>
        </label>

        <LinkButton uri={ForgotPasswordURL}>Forgot password?</LinkButton>

        <div className='actions'>
          <Button type='submit' disabled={signInDisabled}>Sign in</Button>
          {this.props.additionalButtons}
        </div>

        <div>or</div>

        <LinkButton onClick={() => this.props.onSignInWithBrowser()}>Sign in using your browser</LinkButton>
      </form>
    )
  }

  private onUsernameChange(event: React.FormEvent<HTMLInputElement>) {
    this.setState({
      username: event.currentTarget.value,
      password: this.<PASSWORD>,
    })
  }

  private onPasswordChange(event: React.FormEvent<HTMLInputElement>) {
    this.setState({
      username: this.state.username,
      password: event.currentTarget.value,
    })
  }

  private signIn(event: React.FormEvent<HTMLFormElement>) {
    event.preventDefault()

    // TODO: Actually sign in lolololol
  }
}<commit_msg>Try creating an authorization<commit_after>import * as React from 'react'
import { LinkButton } from '../lib/link-button'
import { Button } from '../lib/button'
import { createAuthorization } from '../../lib/api'

const ForgotPasswordURL = 'https://github.com/password_<PASSWORD>'

interface ISignInDotComProps {
  readonly onSignInWithBrowser: () => void

  readonly additionalButtons?: ReadonlyArray<JSX.Element>
}

interface ISignInDotComState {
  readonly username: string
  readonly password: string
}

/** The GitHub.com sign in component. */
export class SignInDotCom extends React.Component<ISignInDotComProps, ISignInDotComState> {
  public constructor(props: ISignInDotComProps) {
    super(props)

    this.state = { username: '', password: '' }
  }

  public render() {
    const signInDisabled = Boolean(!this.state.username.length || !this.state.password.length)
    return (
      <form id='sign-in-form' onSubmit={e => this.signIn(e)}>
        <label>Username or email address
          <input onChange={e => this.onUsernameChange(e)}/>
        </label>

        <label>Password
          <input type='password' onChange={e => this.onPasswordChange(e)}/>
        </label>

        <LinkButton uri={ForgotPasswordURL}>Forgot password?</LinkButton>

        <div className='actions'>
          <Button type='submit' disabled={signInDisabled}>Sign in</Button>
          {this.props.additionalButtons}
        </div>

        <div>or</div>

        <LinkButton onClick={() => this.props.onSignInWithBrowser()}>Sign in using your browser</LinkButton>
      </form>
    )
  }

  private onUsernameChange(event: React.FormEvent<HTMLInputElement>) {
    this.setState({
      username: event.currentTarget.value,
      password: <PASSWORD>,
    })
  }

  private onPasswordChange(event: React.FormEvent<HTMLInputElement>) {
    this.setState({
      username: this.state.username,
      password: event.currentTarget.value,
    })
  }

  private async signIn(event: React.FormEvent<HTMLFormElement>) {
    event.preventDefault()

    const response = await createAuthorization('https://api.github.com', this.state.username, this.state.password, null)
    console.log(response)

    // TODO: Actually sign in lolololol
  }
}
{'fraction_non_alphanumeric': 0.1305064782096584, 'fraction_numerical': 0.0, 'mean_word_length': 3.432150313152401, 'pattern_counts': {'":': 0, '<': 53, '<?xml version=': 0, '>': 63, 'https://': 3, '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': '1765775', 'n_tokens_mistral': 1249, 'n_tokens_neox': 1232, 'n_words': 256}