tools/utils.py: oh, some code duplication

Status Job ID Name Coverage
  Test Tools
passed #736315
test_tools

00:00:11

 
  Test Quality
passed #736316
code_quality

00:02:37