<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def authorized_keys(mode='r'):
 """ Open the authorized_keys file. Separate function for mocking. :param mode: As :py:meth:`open` """

    path = '/var/home/.ssh/authorized_keys'
    if not os.path.exists(path):
        os.makedirs(os.path.dirname(path))
        open(path, 'w').close()
    with open(path, mode) as ak:
        yield ak