docs: def valuegetter(*fieldspecs, **kwargs):
      """
      Modelled after `operator.itemgetter`. Takes a variable
      number of specs and returns a function, which applied to
      any `pymarc.Record` returns the matching values.
  
      Specs are in the form `field` or `field.subfield`, e.g.
      `020` or `020.9`.
  
      Example:
  
      >>> from marcx import Record, valuegetter
      >>> from urllib import urlopen
      >>> record = Record(data=urlopen("http://goo.gl/lfJnw9").read())
  
      In two steps:
  
      >>> getter = valuegetter('020.a')
      >>> getter(record)
      <generator object values at 0x2d97690>
  
      >>> set(getter(record))
      set(['020161622X'])
  
      Or in one step:
  
      >>> set(valuegetter('020.a')(record))
      set(['020161622X'])
  
      A variable number of specs can be passed:
  
      >>> set(valuegetter('001', '005', '700.a')(record))
      set(['20040816084925.0', 'Thomas, David,', '11778504'])
  
      Non-existent field tags can be passed - they are ignored:
      >>> set(valuegetter('002')(record))
      set([])
  
      @see also: `Record.itervalues`
      """
      combine_subfields = kwargs.get('combine_subfields', False)
      pattern = r'(?P<field>[^.]+)(.(?P<subfield>[^.]+))?'
  
      def values(record):
          for s in fieldspecs:
              match = re.match(pattern, s)
              if not match:
                  continue
              gd = match.groupdict()
              for field in record.get_fields(gd['field']):
                  if gd['subfield']:
                      for value in field.get_subfields(gd['subfield']):
                          yield value
                  else:
                      if combine_subfields:
                          yield field.value()
                      else:
                          if int(gd['field']) < 10:
                              yield field.value()
                          else:
                              for value in field.subfields[1::2]:
                                  yield value
      values.__doc__ = 'returns a value generator over %s' % (
          ', '.join(fieldspecs))
      return values