human
I wrote the below code

    info_file = get_info_filename(target)
    if (not os.path.exists(info_file)):
        old_filename = (target + '.sha1')
        if ((field == 'sha1') and os.path.exists(old_filename)):
            hash_file = open(old_filename)
            hash_value = hash_file.read()
            hash_file.close()
            write_stored_info(target, field=field, value=hash_value)
            os.remove(old_filename)
            d = {field: hash_value}
        else:
            d = {}
    else:
        lock_name = ('info-%s' % os.path.split(target)[(-1)])
        lock_path = os.path.join(CONF.instances_path, 'locks')
        @lockutils.synchronized(lock_name, 'nova-', external=True, lock_path=lock_path)
        def read_file(info_file):
            LOG.debug(_('Reading    image    info    file:    %s'), info_file)
            with open(info_file, 'r') as f:
                return f.read().rstrip()
        serialized = read_file(info_file)
        d = _read_possible_json(serialized, info_file)
    if field:
        if timestamped:
            return (d.get(field, None), d.get(('%s-timestamp' % field), None))
        else:
            return d.get(field, None)
    return d

What's a good function header?

=====
Here's a good function header?
assistant
#Here's a good function header.

def read_stored_info(target, field=None, timestamped=False):