<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def atlas_find_missing_zonefile_availability( peer_table=None, con=None, path=None, missing_zonefile_info=None ):
 """ Find the set of missing zonefiles, as well as their popularity amongst our neighbors. Only consider zonefiles that are known by at least one peer; otherwise they're missing from our clique (and we'll re-sync our neighborss' inventories every so often to make sure we detect when zonefiles become available). Return a dict, structured as: { 'zonefile hash': { 'names': [names], 'txid': first txid that set it, 'tried_storage': True|False } } """


    # which zonefiles do we have?
    bit_offset = 0
    bit_count = 10000
    missing = []
    ret = {}

    if missing_zonefile_info is None:
        while True:
            zfinfo = atlasdb_zonefile_find_missing( bit_offset, bit_count, con=con, path=path )
            if len(zfinfo) == 0:
                break

            missing += zfinfo
            bit_offset += len(zfinfo)

        if len(missing) > 0:
            log.debug("Missing %s zonefiles" % len(missing))

    else:
        missing = missing_zonefile_info

    if len(missing) == 0:
        # none!
        return ret

    with AtlasPeerTableLocked(peer_table) as ptbl:
        # do any other peers have this zonefile?
        for zfinfo in missing:
            popularity = 0
            byte_index = (zfinfo['inv_index'] - 1) / 8
            bit_index = 7 - ((zfinfo['inv_index'] - 1) % 8)
            peers = []

            if not ret.has_key(zfinfo['zonefile_hash']):
                ret[zfinfo['zonefile_hash']] = {
                    'names': [],
                    'txid': zfinfo['txid'],
                    'indexes': [],
                    'block_heights': [],
                    'popularity': 0,
                    'peers': [],
                    'tried_storage': False
                }

            for peer_hostport in ptbl.keys():
                peer_inv = atlas_peer_get_zonefile_inventory( peer_hostport, peer_table=ptbl )
                if len(peer_inv) <= byte_index:
                    # too new for this peer
                    continue

                if (ord(peer_inv[byte_index]) & (1 << bit_index)) == 0:
                    # this peer doesn't have it
                    continue

                if peer_hostport not in ret[zfinfo['zonefile_hash']]['peers']:
                    popularity += 1
                    peers.append( peer_hostport )

            ret[zfinfo['zonefile_hash']]['names'].append( zfinfo['name'] )
            ret[zfinfo['zonefile_hash']]['indexes'].append( zfinfo['inv_index']-1 )
            ret[zfinfo['zonefile_hash']]['block_heights'].append( zfinfo['block_height'] )
            ret[zfinfo['zonefile_hash']]['popularity'] += popularity
            ret[zfinfo['zonefile_hash']]['peers'] += peers
            ret[zfinfo['zonefile_hash']]['tried_storage'] = zfinfo['tried_storage']

    return ret