<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def ensure_directories_end_in_separator(opts_dict):
 """ Adds a path separator to the end of the input and output directories, if they don't already have them. :param opts_dict: dictionary that will be modified """

    assert_has_input_output(opts_dict)
    assert 'is_dir' in opts_dict
    if opts_dict['is_dir']:
        opts_dict['input'] = add_suffix(opts_dict['input'],
                                        get_path_separator())
    opts_dict['output'] = add_suffix(opts_dict['output'], get_path_separator())