<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def key_to_metric(self, key):
 """Replace all non-letter characters with underscores"""

        return ''.join(l if l in string.letters else '_' for l in key)