@modules.action
    def authorize(self, args):
        """allows login with a key (adds it to authorized_keys)"""
        self.prepare_folder()

        if args:
            key = args[0]
            self.extra_params(args[1:])
        else:
            key = self.ask('Public key?', validate=self.validate_not_blank)

        path = self.normalize_path('~/.ssh/authorized_keys')

        if os.path.exists(path) and self.has_line(path, key):
            return self.failure('Already in authorized')

        self.append(path, '%s\n' % key.strip())

        return self.success('Now try login here using a private key from the pair')
dataset/ETHPy150Open va1en0k/please/pyplease/modules/ssh.py/Module.authorize/original