docs: def _extract_options(line):
          r'''Given a line as it would appear in the authorized_keys file,
          return an OrderedDict of options, and the remainder of a line as a
          string.
  
          >>> Key._extract_options(r'no-pty,command="sh" ssh-rsa AAAAB3NzaC1yc2EAAA...OFy5Lwc8Lo+Jk=')
          (OrderedDict([('no-pty', True), ('command', 'sh')]), 'ssh-rsa AAAAB3NzaC1yc2EAAA...OFy5Lwc8Lo+Jk=')
          >>> Key._extract_options(r'ssh-rsa AAAAB3NzaC1yc...Lwc8OFy5Lo+kU=')
          (OrderedDict(), 'ssh-rsa AAAAB3NzaC1yc...Lwc8OFy5Lo+kU=')
          '''
          options = OrderedDict({})
          quoted = False
          escaped = False
          option_name = ''
          option_val = None
          key_without_options = ''
          in_options = True
          in_option_name = True
          for letter in line.strip():
              if in_options:
                  if quoted:
                      if letter == "\\":
                          escaped = True
                      elif letter == '"':
                          if escaped:
                              option_val += letter
                              escaped = False
                          else:
                              quoted = False
                      else:
                          if escaped:
                              option_val += "\\"
                              escaped = False
                          option_val += letter
                  else:  # not quoted
                      if letter == ' ':
                          # end of options
                          in_options = False
                          if (option_name in ['ssh-rsa', 'ssh-dss'] or
                              option_name.startswith('ecdsa-')):
                              # what we thought was an option name was really the
                              # key type, and there are no options
                              key_without_options = option_name + " "
                              option_name = ''
                          else:
                              if option_val is None:
                                  options[option_name] = True
                              else:
                                  options[option_name] = option_val
                      elif letter == '"':
                          quoted = True
                      elif letter == '=':
                          # '=' separated option name from value
                          in_option_name = False
                          if option_val is None:
                              option_val = ''
                      elif letter == ',':
                          # next option_name
                          if option_val is None:
                              options[option_name] = True
                          else:
                              options[option_name] = option_val
                          in_option_name = True
                          option_name = ''
                          option_val = None
                      else:  # general unquoted letter
                          if in_option_name:
                              option_name += letter
                          else:
                              option_val += letter
              else:
                  key_without_options += letter
          if key_without_options == '':
              # certain mal-formed keys (e.g. a line not containing any spaces)
              # will be completely swallowed up by the above parser. It's
              # better to follow the principle of least surprize and return the
              # original line, allowing the error to be handled later.
              return OrderedDict({}), line.strip()
          else:
              return options, key_without_options