<commit_before>#!/usr/bin/python
# -*- coding: utf-8 -*-

import os
import sys
import time
import scraperwiki

dir = os.path.split(os.path.split(os.path.realpath(__file__))[0])[0]
sys.path.append(dir)

from utilities.hdx_format import item
from ors_collect import patch as Patch
from ors_collect import collect as Collect

def Main(patch=True):
  '''Wrapper for main program.'''

  #
  # Collect data.
  #
  Collect.Main()

  #
  # Patch.
  #
  if patch:
    Patch.Main()

if __name__ == '__main__':
  Main()

  # try:
  #     Main()
  #     print "SW Status: Everything seems to be just fine."
  #     scraperwiki.status('ok')

  # except Exception as e:
  #     print e
  #     scraperwiki.status('error', 'Error collecting data.')
  #     os.system("echo https://ds-ec2.scraperwiki.com/3zarzzv/0zftw6fzkjxommp/http/log.txt | mail -s 'ORS APIs: Failed collecting data.' <EMAIL>")<commit_msg>adding scraperwiki wrapper<commit_after>#!/usr/bin/python
# -*- coding: utf-8 -*-

import os
import sys
import time
import scraperwiki

dir = os.path.split(os.path.split(os.path.realpath(__file__))[0])[0]
sys.path.append(dir)

from utilities.hdx_format import item
from ors_collect import patch as Patch
from ors_collect import collect as Collect

def Main(patch=True):
  '''Wrapper for main program.'''

  #
  # Collect data.
  #
  Collect.Main()

  #
  # Patch.
  #
  if patch:
    Patch.Main()

if __name__ == '__main__':

  try:
      Main()
      print "SW Status: Everything seems to be just fine."
      scraperwiki.status('ok')

  except Exception as e:
      print e
      scraperwiki.status('error', 'Error collecting data.')
      os.system("echo https://ds-ec2.scraperwiki.com/3zarzzv/0zftw6fzkjxommp/http/log.txt | mail -s 'ORS APIs: Failed collecting data.' <EMAIL>")
{'fraction_non_alphanumeric': 0.13641488162344984, 'fraction_numerical': 0.007891770011273957, 'mean_word_length': 3.308252427184466, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '948552', 'n_tokens_mistral': 645, 'n_tokens_neox': 626, 'n_words': 158}