def initializer(data, labels=None, **kwds):
    """
    Function factory that returns an initializer 
    that can initialize based on a parameter row (and naming convention)

    If a node is missing the function will raise an error. If a
    default parameter is passed to the function factory the
    function will return this value upon errors
    """

    # allow to override the parameter labels, the order is important
    labels = labels or 'conc decay threshold'.split()
    
    def func( node ):
        # the extra work is to produce helpful error messages
        try:
            values = [ data[node][label] for label in labels ]
            return tuple(values) 
        except KeyError as exc:
            
            if 'default' in kwds:
                return kwds['default']
            else:
                if node not in data:
                    raise KeyError( 'could not find parameter %s' % node )
                for label in labels:
                    if label not in data[node]:
                        raise KeyError( "could not find parameter %s['%s']" % (node, label) )   

        
    return func