<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def check_dict_keys(self, config_yaml_flags_dict):
 """ Fill in all optional keys with None. Exit in a crucial key is not defined. """

        crucial_keys = ['MODEL_DIRECTORY', 'SAVE_DIRECTORY']
        for key in crucial_keys:
            if key not in config_yaml_flags_dict:
                print('You must define %s. Now exiting...' % key)
                exit()
        optional_keys = ['RESTORE_SLIM_FILE', 'RESTORE_META', 'RESTORE_SLIM', 'SEED', 'GPU']
        for key in optional_keys:
            if key not in config_yaml_flags_dict:
                config_yaml_flags_dict[key] = None
                print('%s in flags, yaml or config dictionary was not found.' % key)
        if 'RUN_NUM' not in config_yaml_flags_dict:
            config_yaml_flags_dict['RUN_NUM'] = 0
        if 'NUM_EPOCHS' not in config_yaml_flags_dict:
            config_yaml_flags_dict['NUM_EPOCHS'] = 1
        return config_yaml_flags_dict