def helper(self, base, keys, types):
for key, type_ in zip(keys, types):<EOL><INDENT>if not type(base[key]) == type_:<EOL><INDENT>try:<EOL><INDENT>assert type_(base[key]) == base[key], key<EOL><DEDENT>except ValueError:<EOL><INDENT>assert np.allclose(type_(base[key]), base[key])<EOL><DEDENT><DEDENT><DEDENT>
Perform type checking of the values

Parameters
==========
base : dict
    Sub-dictionary we are accessing.
keys : array-like
    List of keys to test in base.
types : array-like
    List of expected return types for the keys.