human
I wrote the below code

    def snapsource_lookup(source, sources):
        for (k, v) in sources.iteritems():
            if (v.get('id') == source.get('id')):
                return k
        return None
    def snaplayer_config(layer, sources, user, access_token):
        cfg = layer.layer_config()
        src_cfg = layer.source_config()
        source = snapsource_lookup(src_cfg, sources)
        if source:
            cfg['source'] = source
        if ((src_cfg.get('ptype', 'gxp_wmscsource') == 'gxp_wmscsource') or (src_cfg.get('ptype', 'gxp_gnsource') == 'gxp_gnsource')):
            cfg['buffer'] = 0
        return cfg
    decodedid = num_decode(snapshot)
    snapshot = get_object_or_404(MapSnapshot, pk=decodedid)
    if (snapshot.map == map_obj.map):
        config = json.loads(clean_config(snapshot.config))
        layers = [l for l in config['map']['layers']]
        sources = config['sources']
        maplayers = []
        for (ordering, layer) in enumerate(layers):
            maplayers.append(layer_from_viewer_config(MapLayer, layer, config['sources'][layer['source']], ordering))
        config['map']['layers'] = [snaplayer_config(l, sources, user, access_token) for l in maplayers]
    else:
        config = map_obj.viewer_json(user, access_token)
    return config

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

def snapshot_config(snapshot, map_obj, user, access_token):