<commit_before>Alchemy::plugins.neo4jBackend = (instance) ->
  a: instance
  conf: instance.conf.plugins["neo4jBackend"]
  graphJSON:  {}
  constructor: ->
    conf = @conf

    # Fill in blank settings with the defaults
    defaultSettings =
      "url"  : "http://127.0.0.1:7474/db/data/transaction/commit"
      "query": null

    @conf = _.defaults conf, defaultSettings

  runQuery: (query) ->
    plugin = @a.plugins.neo4jBackend
    conf   = @conf
    query  = if query? then query else conf.query

    # Send request to Neo4j
    d3.xhr(conf.url)
      .header "Content-Type", "application/json"
      .send "POST", JSON.stringify(
        statements: [{
          statement: query,
          parameters: {}
          resultDataContents:["row","graph"]
        }]<commit_msg>Use init() instead of constructor()<commit_after>Alchemy::plugins.neo4jBackend = (instance) ->
  a: instance
  conf: instance.conf.plugins["neo4jBackend"]
  graphJSON:  {}
  init: ->
    conf = @conf

    # Fill in blank settings with the defaults
    defaultSettings =
      "url"  : "http://127.0.0.1:7474/db/data/transaction/commit"
      "query": null

    @conf = _.defaults conf, defaultSettings

  runQuery: (query) ->
    plugin = @a.plugins.neo4jBackend
    conf   = @conf
    query  = if query? then query else conf.query

    # Send request to Neo4j
    d3.xhr(conf.url)
      .header "Content-Type", "application/json"
      .send "POST", JSON.stringify(
        statements: [{
          statement: query,
          parameters: {}
          resultDataContents:["row","graph"]
        }]
{'fraction_non_alphanumeric': 0.13282732447817835, 'fraction_numerical': 0.018975332068311195, 'mean_word_length': 2.5233853006681515, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '4069659', 'n_tokens_mistral': 508, 'n_tokens_neox': 492, 'n_words': 114}