<commit_before># -*- coding: utf-8 -*-

from time import time
from Cookie import SimpleCookie

class CookieJar(SimpleCookie):

    def getCookie(self, name):
        return self[name].value

    def setCookie(self, domain, name, value, path="/", exp=None, secure="FALSE"):
        if not exp: exp = time() + 3600 * 24 * 180

        self[name] = value
        self[name]["domain"] = domain
        self[name]["path"] = path
        self[name]["expires"] = exp
        if secure == "TRUE":
            self[name]["secure"] = secure<commit_msg>Fix cookie issues<commit_after># -*- coding: utf-8 -*-

from time import time
from Cookie import SimpleCookie

class CookieJar(SimpleCookie):

    def getCookie(self, name):
        return self[name].value

    def setCookie(self, domain, name, value, path="/", exp=None, secure="FALSE"):
        self[name] = value
        self[name]["domain"] = domain
        self[name]["path"] = path
        
        #Value of expires should be integer if possible
        # otherwise the cookie won't be used
        expire=0
        if not exp:
	        expires = time() + 3600 * 24 * 180
        else:
            try:
                expires = int(exp)
            except ValueError:
                expires = exp
        
        self[name]["expires"] = expires
        if secure == "TRUE":
            self[name]["secure"] = secure
{'fraction_non_alphanumeric': 0.12801755669348938, 'fraction_numerical': 0.015362106803218726, 'mean_word_length': 2.1448275862068966, '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': '3683301', 'n_tokens_mistral': 414, 'n_tokens_neox': 385, 'n_words': 118}