def check_isinstance(obj, cls):
    if isinstance(obj, cls):
        return obj
    raise Exception(_('Expected object of type: %s') % (str(cls)))
Checks that obj is of type cls, and lets PyLint infer types.
dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/utils.py/check_isinstance