def _parse_options(opts, delim):
 options = {}
 for opt in opts.split(delim):
  (key, val) = opt.split('=')
  if (key.lower() == 'readpreferencetags'):
   options.setdefault('readpreferencetags', []).append(val)
  else:
   if (str(key) in options):
    warnings.warn(('Duplicate URI option %s' % (str(key),)))
   options[str(key)] = unquote_plus(val)
 if ('wtimeout' in options):
  if ('wtimeoutMS' in options):
   options.pop('wtimeout')
  warnings.warn("Option wtimeout is deprecated, use 'wtimeoutMS' instead")
 return options

def _parse_options ( opts , delim ) : options = { } for opt in opts . split ( delim ) : ( key , val ) = opt . split ( '=' ) if ( key . lower ( ) == 'readpreferencetags' ) : options . setdefault ( 'readpreferencetags' , [ ] ) . append ( val ) else : if ( str ( key ) in options ) : warnings . warn ( ( 'Duplicate URI option %s' % ( str ( key ) , ) ) ) options [ str ( key ) ] = unquote_plus ( val ) if ( 'wtimeout' in options ) : if ( 'wtimeoutMS' in options ) : options . pop ( 'wtimeout' ) warnings . warn ( "Option wtimeout is deprecated, use 'wtimeoutMS' instead" ) return options
helper method for split_options which creates the options dict .