human
Complete the below
def _layer_json(layers, sources):

    ''''return a list of layer config for the provided layer'
    '''

=====
Give me a the Python code you requested?
assistant
#Here is the Python code you requested.
    server_lookup = {}
    def uniqify(seq):
        '\n                                get    a    list    of    unique    items    from    the    input    sequence.\n\n                                This    relies    only    on    equality    tests,    so    you    can    use    it    on    most\n                                things.        If    you    have    a    sequence    of    hashables,    list(set(seq))    is\n                                better.\n                                '
        results = []
        for x in seq:
            if (x not in results):
                results.append(x)
        return results
    configs = [l.source_config() for l in layers]
    i = 0
    for source in uniqify(configs):
        while (str(i) in sources):
            i = (i + 1)
        sources[str(i)] = source
        server_lookup[json.dumps(source)] = str(i)
    def source_lookup(source):
        for (k, v) in sources.iteritems():
            if (v == source):
                return k
        return None
    def layer_config(l, user=None):
        cfg = l.layer_config(user=user)
        src_cfg = l.source_config()
        source = source_lookup(src_cfg)
        if source:
            cfg['source'] = source
        return cfg
    return [layer_config(l, user=None) for l in layers]