def _parse_read_preference(options):
 if ('read_preference' in options):
  return options['read_preference']
 mode = options.get('readpreference', 0)
 tags = options.get('readpreferencetags')
 max_staleness = options.get('maxstalenessseconds', (-1))
 return make_read_preference(mode, tags, max_staleness)

def _parse_read_preference ( options ) : if ( 'read_preference' in options ) : return options [ 'read_preference' ] mode = options . get ( 'readpreference' , 0 ) tags = options . get ( 'readpreferencetags' ) max_staleness = options . get ( 'maxstalenessseconds' , ( - 1 ) ) return make_read_preference ( mode , tags , max_staleness )
parse read preference options .