code: def ssh_authorized_key_exists(public_key, application_name, user=None):
      
      with open(authorized_keys(application_name, user)) as keys:
          return ('%s' % public_key) in keys.read()
docs: Check if given key is in the authorized_key file.
  
      :param public_key: Public key.
      :type public_key: str
      :param application_name: Name of application eg nova-compute-something
      :type application_name: str
      :param user: The user that the ssh asserts are for.
      :type user: str
      :returns: Whether given key is in the authorized_key file.
      :rtype: boolean