def opt_dict_param(obj, param_name, key_type=None, value_type=None, value_class=None):
if obj is not None and not isinstance(obj, dict):<EOL><INDENT>raise_with_traceback(_param_type_mismatch_exception(obj, dict, param_name))<EOL><DEDENT>if not obj:<EOL><INDENT>return {}<EOL><DEDENT>if value_class:<EOL><INDENT>return _check_key_value_types(obj, key_type, value_type=value_class, value_check=issubclass)<EOL><DEDENT>return _check_key_value_types(obj, key_type, value_type)<EOL>
Ensures argument obj is either a dictionary or None; if the latter, instantiates an empty
    dictionary.