<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_cohp_dict(self, cohp_dict, key_sort_func=None):
 """ Adds a dictionary of COHPs with an optional sorting function for the keys. Args: cohp_dict: dict of the form {label: Cohp} key_sort_func: function used to sort the cohp_dict keys. """

        if key_sort_func:
            keys = sorted(cohp_dict.keys(), key=key_sort_func)
        else:
            keys = cohp_dict.keys()
        for label in keys:
            self.add_cohp(label, cohp_dict[label])