def dict_param(obj, param_name, key_type=None, value_type=None):
if not isinstance(obj, dict):<EOL><INDENT>raise_with_traceback(_param_type_mismatch_exception(obj, dict, param_name))<EOL><DEDENT>if not (key_type or value_type):<EOL><INDENT>return obj<EOL><DEDENT>return _check_key_value_types(obj, key_type, value_type)<EOL>
Ensures argument obj is a native Python dictionary, raises an exception if not, and otherwise
    returns obj.