<commit_before># -*- coding:utf8 -*-

import requests
import hashlib
from uuid import uuid4
from log import Syslog
from config import SSO

#Something public variable
md5            = lambda pwd:hashlib.md5(pwd).hexdigest()
logger         = Syslog.getLogger()
gen_requestId  = lambda :str(uuid4())


def isLogged_in(cookie_str):
    ''' To determine whether to log on with cookie '''

    SSOURL = SSO.get("SSO.URL")
    if cookie_str:
        username, expires, sessionId = cookie_str.split('.')
        #success = Requests(SSOURL+"/sso/").post(data={"username": username, "time": expires, "sessionId": sessionId}).get("success", False)
        success = requests.post(SSOURL+"/sso/", data={"username": username, "time": expires, "sessionId": sessionId}, timeout=5, verify=False).json().get("success", False)
        logger.info("check login request, cookie_str: %s, success:%s" %(cookie_str, success))
        return success
    else:
        return False
<commit_msg>add a logger<commit_after># -*- coding:utf8 -*-

import requests
import hashlib
from uuid import uuid4
from log import Syslog
from config import SSO

#Something public variable
md5            = lambda pwd:hashlib.md5(pwd).hexdigest()
logger         = Syslog.getLogger()
gen_requestId  = lambda :str(uuid4())


def isLogged_in(cookie_str):
    ''' To determine whether to log on with cookie '''

    SSOURL = SSO.get("SSO.URL")
    if cookie_str:
        username, expires, sessionId = cookie_str.split('.')
        #success = Requests(SSOURL+"/sso/").post(data={"username": username, "time": expires, "sessionId": sessionId}).get("success", False)
        success = requests.post(SSOURL+"/sso/", data={"username": username, "time": expires, "sessionId": sessionId}, timeout=5, verify=False).json().get("success", False)
        logger.info("check login request, cookie_str: %s, success:%s" %(cookie_str, success))
        return success
    else:
        logger.info("Not Logged in")
        return False

{'fraction_non_alphanumeric': 0.1453900709219858, 'fraction_numerical': 0.0060790273556231, 'mean_word_length': 3.7590361445783134, 'pattern_counts': {'":': 12, '<': 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': '6388413', 'n_tokens_mistral': 618, 'n_tokens_neox': 607, 'n_words': 163}