<commit_before>// @flow
import log4js from 'log4js'
import { connectToGaiaHub as bsConnectToGaiaHub, GaiaHubConfig, uploadToGaiaHub } from 'blockstack'

const logger = log4js.getLogger(__filename)

export function redirectToConnectToGaiaHub() {
  logger.info('redirectToConnectToGaiaHub')
  const port = location.port === '' ? 80 : location.port
  const host = location.hostname
  window.top.location.href = `http://${host}:${port}/account/storage#gaiahub`
}

const connectToGaiaHub = (hubUrl: string, key: string) => bsConnectToGaiaHub(hubUrl, key)

export { connectToGaiaHub, GaiaHubConfig, uploadToGaiaHub }<commit_msg>connectToGaiaHub() takes an optional third argument for an association token<commit_after>// @flow
import log4js from 'log4js'
import { connectToGaiaHub as bsConnectToGaiaHub, GaiaHubConfig, uploadToGaiaHub } from 'blockstack'

const logger = log4js.getLogger(__filename)

export function redirectToConnectToGaiaHub() {
  logger.info('redirectToConnectToGaiaHub')
  const port = location.port === '' ? 80 : location.port
  const host = location.hostname
  window.top.location.href = `http://${host}:${port}/account/storage#gaiahub`
}

const connectToGaiaHub = (hubUrl: string, key: string, associationToken?: string) => 
  bsConnectToGaiaHub(hubUrl, key, associationToken)

export { connectToGaiaHub, GaiaHubConfig, uploadToGaiaHub }
{'fraction_non_alphanumeric': 0.1121771217712177, 'fraction_numerical': 0.007380073800738007, 'mean_word_length': 6.369565217391305, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2350097', 'n_tokens_mistral': 436, 'n_tokens_neox': 428, 'n_words': 98}