def value_for_dsd_ref(kind, args, kwargs):
    """Maybe replace a string 'value_for' in *kwargs* with a DSD reference."""
    try:
        dsd = kwargs.pop('dsd')
        descriptor = getattr(dsd, kind + 's')
        kwargs['value_for'] = descriptor.get(kwargs['value_for'])
    except KeyError:
        pass
    return args, kwargs
