Add mypy checks.

mypy checks have been added to the gitlab pipeline.
They can be triggered via `make mypy`.

Some (minor) fixes to error checks are inlcuded.
2 jobs for T293382-add-typing
Name Stage Failure
test-ima Test There has been a timeout failure or the job got stuck. Check your timeout limits or try again
No job log