<commit_before>__author__ = 'lorenzo'

#
# Dumps vocabularies into remote datastore with POST requests
#

import sys
import os
from os.path import dirname
import urllib

def _upload_all(url):
    basepath = os.path.join(dirname(dirname(os.path.abspath(__file__))), 'RDFvocab', 'ntriples')
    for path, _dirs, files in os.walk(basepath):
        for filename in files:
            if filename.endswith(".ntriples"):
                fullpath = os.path.join(path, filename)
                print 'Uploading {}...'.format(fullpath)
                with open(fullpath, 'r') as f:
                    data = f.read()
                params = urllib.urlencode({'pwd': '***', 'triple': data})
                f = urllib.urlopen(url, params)
                print f.read()

if __name__ == "__main__":
    #Usage examples:<commit_msg>Found a way to use reference to config.py<commit_after>__author__ = 'lorenzo'

#
# Dumps vocabularies into remote datastore with POST requests
#

import sys
import os
from os.path import dirname
import urllib
sys.path.insert(0, '..')
import config

def _upload_all(url):
    basepath = os.path.join(dirname(dirname(os.path.abspath(__file__))), 'RDFvocab', 'ntriples')
    for path, _dirs, files in os.walk(basepath):
        for filename in files:
            if filename.endswith(".ntriples"):
                fullpath = os.path.join(path, filename)
                print 'Uploading {}...'.format(fullpath)
                with open(fullpath, 'r') as f:
                    data = f.read()
                params = urllib.urlencode({'pwd': config._TEMP_SECRET, 'triple': data})
                f = urllib.urlopen(url, params)
                print f.read()

if __name__ == "__main__":
    #Usage examples:
{'fraction_non_alphanumeric': 0.12478336221837089, 'fraction_numerical': 0.0005777007510109763, 'mean_word_length': 2.409448818897638, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, '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': '2939552', 'n_tokens_mistral': 564, 'n_tokens_neox': 550, 'n_words': 140}