def METHOD_NAME(d, s):
    v = None
    if s in d:
        try:
            v = float(d[s])
        except ValueError as e:
            log.error("cannot read value for '%s': %s" % (s, e))
    return v