Cogic score calculation (Python library)