<commit_before>import json
import requests

url = "http://access.alchemyapi.com/calls/text/TextGetTextSentiment"
apikey = "<KEY>"

def makeRequest(text):
  values = {
    "apikey" : apikey,
    "text"   : text,
    "outputMode" : "json"
  }
  r = requests.post(url, data=values)
  json_text = json.loads(r.text)
  docSentiment = json_text['docSentiment']
  return docSentiment

sentiment = makeRequest("hello you are the best")
sentiment_type = sentiment['type']

if sentiment_type == "neutral":
  print (sentiment_type, 0.0)
else:
  print (sentiment_type, sentiment['score'])<commit_msg>changes<commit_after>import sys
import json
import requests

url = "http://access.alchemyapi.com/calls/text/TextGetTextSentiment"
apikey = "<KEY>"

def makeRequest(text):
  values = {
    "apikey" : apikey,
    "text"   : text,
    "outputMode" : "json"
  }
  r = requests.post(url, data=values)
  json_text = json.loads(r.text)
  docSentiment = json_text['docSentiment']
  return docSentiment

sentiment = makeRequest(sys.argv[1])
sentiment_type = sentiment['type']

if sentiment_type == "neutral":
  print (sentiment_type, 0.0)
else:
  print (sentiment_type, sentiment['score'])
{'fraction_non_alphanumeric': 0.13955479452054795, 'fraction_numerical': 0.004280821917808219, 'mean_word_length': 4.730392156862745, 'pattern_counts': {'":': 2, '<': 5, '<?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': '1340868', 'n_tokens_mistral': 412, 'n_tokens_neox': 409, 'n_words': 85}