<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_key_files(kfiles, dirname, names):
 """Return key files"""

    for name in names:
        fullname = os.path.join(dirname, name)
        if os.path.isfile(fullname) and \
            fullname.endswith('_rsa') or \
                fullname.endswith('_dsa'):
            kfiles.put(fullname)