algorithms/asa.py
def _get_all_offset_fronts_from_offsets(offset_fronts, corresponding_offsets):
    """
    Returns all the offset fronts that are composed of at least one of the given offset indexes.
    Also returns a dict of the form {offset_front_id: ntimes saw}
    """
    all_offset_fronts_of_interest = []
    ids_ntimes_seen = {}
    for offset_index in corresponding_offsets:
        offset_id = _front_id_from_idx(offset_fronts, offset_index)
        if offset_id not in ids_ntimes_seen:
            offset_front_idxs = _get_front_idxs_from_id(offset_fronts, offset_id)
            all_offset_fronts_of_interest.append(offset_front_idxs)
            ids_ntimes_seen[offset_id] = 1
        else:
            ids_ntimes_seen[offset_id] += 1
    return all_offset_fronts_of_interest, ids_ntimes_seen
def _get_all_offset_fronts_from_offsets(offset_fronts, corresponding_offsets):
    """
    Returns all the offset fronts that are composed of at least one of the given offset indexes.
    Also returns a dict of the form {offset_front_id: ntimes saw}
    """
    all_offset_fronts_of_interest = []
    ids_ntimes_seen = {}
    for offset_index in corresponding_offsets:
        offset_id = _front_id_from_idx(offset_fronts, offset_index)
        if offset_id not in ids_ntimes_seen:
            offset_front_idxs = _get_front_idxs_from_id(offset_fronts, offset_id)
            all_offset_fronts_of_interest.append(offset_front_idxs)
            ids_ntimes_seen[offset_id] = 1
        else:
            ids_ntimes_seen[offset_id] += 1
    return all_offset_fronts_of_interest, ids_ntimes_seen
def _get_all_offset_fronts_from_offsets ( offset_fronts , corresponding_offsets ) : all_offset_fronts_of_interest = [ ] ids_ntimes_seen = { } for offset_index in corresponding_offsets : offset_id = _front_id_from_idx ( offset_fronts , offset_index ) if offset_id not in ids_ntimes_seen : offset_front_idxs = _get_front_idxs_from_id ( offset_fronts , offset_id ) all_offset_fronts_of_interest . append ( offset_front_idxs ) ids_ntimes_seen [ offset_id ] = 1 else : ids_ntimes_seen [ offset_id ] += 1 return all_offset_fronts_of_interest , ids_ntimes_seen
Returns all the offset fronts that are composed of at least one of the given offset indexes.
    Also returns a dict of the form {offset_front_id: ntimes saw}
Returns all the offset fronts that are composed of at least one of the given offset indexes . Also returns a dict of the form { offset_front_id : ntimes saw }