(operation, increment, used, facts)
| 309 | |
| 310 | |
| 311 | async def update_scores(operation, increment, used, facts): |
| 312 | knowledge_svc_handle = BaseService.get_service('knowledge_svc') |
| 313 | for uf in used: |
| 314 | all_facts = await operation.all_facts() if operation else facts |
| 315 | for found_fact in all_facts: |
| 316 | if found_fact.unique == uf.unique: |
| 317 | found_fact.score += increment |
| 318 | await knowledge_svc_handle.update_fact(dict(trait=found_fact.trait, value=found_fact.value, |
| 319 | source=found_fact.source), dict(score=found_fact.score)) |
| 320 | break |
no test coverage detected