<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_metrics(self, key, name, metrics):
 """ Store a list of metric identifiers for the given instance key and Mor object name. If the key is not in the cache, raises a KeyError. If the Mor object is not in the cache, raises a MorNotFoundError """

        with self._mor_lock:
            mor = self._mor[key].get(name)
            if mor is None:
                raise MorNotFoundError("Mor object '{}' is not in the cache.".format(name))
            mor['metrics'] = metrics