<commit_before>import requests
from hmac import HMAC
from datetime import datetime
from hashlib import md5, sha512

filename="spring-web-4.2.0.RELEASE.jar"
hostname="localhost"
port=5000
server = "http://{0}:{1}".format(hostname, port)
username="jshepher"
password="<PASSWORD>!"


def uploadArchive(filename, gid, aid, vid, cves):
    print "uploading file: " + filename
    server = "http://%s:%s" % (hostname, port)
    path = "/service/v2/submit/archive/java/?version=%s\&groupId=%s\&artifactId=%s\&cves=%s" % (
        vid, gid, aid, ','.join(cves))
    url = server + path
    #date = datetime.utcnow().strftime('%a, %d %b %Y %H:%M:%S GMT')
    with open(filename, 'rb') as archive:
        #md5sums = [md5(archive.read()).hexdigest()]
        #archive.seek(0)
        files = { 'archive': archive }
        response = requests.put(url,
            #headers = {'X-Victims-Api': "%s:%s" % (apiKey, generate_signature(
            #	secret, 'PUT', path, date, md5sums)),
            #	"Date": date},
            files=files,
            auth = (username, password)
            )
    print response.text
<commit_msg>cleanup upload filename<commit_after>import requests
from hmac import HMAC
from datetime import datetime
from hashlib import md5, sha512

hostname="localhost"
port=5000
server = "http://{0}:{1}".format(hostname, port)
username="jshepher"
password="<PASSWORD>!"


def uploadArchive(filename, gid, aid, vid, cves):
    print "uploading file: " + filename
    server = "http://%s:%s" % (hostname, port)
    path = "/service/v2/submit/archive/java/?version=%s\&groupId=%s\&artifactId=%s\&cves=%s" % (
        vid, gid, aid, ','.join(cves))
    url = server + path
    #date = datetime.utcnow().strftime('%a, %d %b %Y %H:%M:%S GMT')
    with open(filename, 'rb') as archive:
        #md5sums = [md5(archive.read()).hexdigest()]
        #archive.seek(0)
        files = { 'archive': archive }
        response = requests.put(url,
            #headers = {'X-Victims-Api': "%s:%s" % (apiKey, generate_signature(
            #	secret, 'PUT', path, date, md5sums)),
            #	"Date": date},
            files=files,
            auth = (username, password)
            )
    print response.text

{'fraction_non_alphanumeric': 0.17361740707162285, 'fraction_numerical': 0.014959202175883953, 'mean_word_length': 2.9837545126353793, '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': '280001', 'n_tokens_mistral': 763, 'n_tokens_neox': 741, 'n_words': 169}