<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 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: In two steps: <generator object values at 0x2d97690> set(['020161622X']) Or in one step: set(['020161622X']) A variable number of specs can be passed: set(['20040816084925.0', 'Thomas, David,', '11778504']) Non-existent field tags can be passed - they are ignored: 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