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

import requests
import json

import settings
from mail import send_error_mail_and_log


# Get all OpenXChange contacts
def get_ox_contacts(diff_timestamp=None):
    token = get_token(settings.ox_login_name, settings.ox_login_pass)

    payload = {'session': str(token[0].get("session", "")), 'folder': settings.ox_contacts_folder,
            'columns': settings.ox_contacts_columns, "action": "all"}
    if diff_timestamp:
        payload["action"] = "updates"
        payload["timestamp"] = diff_timestamp
    r = requests.get(settings.ox_contacts_url, params=payload, cookies=token[1])
<commit_msg>Fixed error in update logic<commit_after>#!/usr/bin/env python
# coding: utf-8

import requests
import json

import settings
from mail import send_error_mail_and_log


# Get all OpenXChange contacts
def get_ox_contacts(diff_timestamp=None):
    token = get_token(settings.ox_login_name, settings.ox_login_pass)

    payload = {'session': str(token[0].get("session", "")), 'folder': settings.ox_contacts_folder,
            'columns': settings.ox_contacts_columns, "action": "all"}
    if diff_timestamp is None:
        payload["action"] = "updates"
        payload["timestamp"] = diff_timestamp
    r = requests.get(settings.ox_contacts_url, params=payload, cookies=token[1])

{'fraction_non_alphanumeric': 0.12012012012012012, 'fraction_numerical': 0.0045045045045045045, 'mean_word_length': 4.872246696035242, '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': '383511', 'n_tokens_mistral': 417, 'n_tokens_neox': 410, 'n_words': 90}