# Path: pylsdj/utils.py
# class ObjectLookupDict(object):
# 
#     def __init__(self, id_list, object_list):
#         self.id_list = id_list
#         self.object_list = object_list
# 
#     def __getitem__(self, index):
#         assert_index_sane(index, len(self.id_list))
# 
#         return self.object_list[self.id_list[index]]
# 
#     def __setitem__(self, index, value):
#         assert_index_sane(index, len(self.id_list))
# 
#         self.id_list[index] = value.index


from .utils import ObjectLookupDict


class Chain(object):

    """A chain is a sequence of phrases for a single channel. Each phrase can be
    transposed by a number of semitones.
    """

    def __init__(self, song, index):
        self.song = song
        self.index = index

        self.transposes = self.song.song_data.chain_transposes[index]

# Path: pylsdj/utils.py
# class ObjectLookupDict(object):
# 
#     def __init__(self, id_list, object_list):
#         self.id_list = id_list
#         self.object_list = object_list
# 
#     def __getitem__(self, index):
#         assert_index_sane(index, len(self.id_list))
# 
#         return self.object_list[self.id_list[index]]
# 
#     def __setitem__(self, index, value):
#         assert_index_sane(index, len(self.id_list))
# 
#         self.id_list[index] = value.index


# Path: pylsdj/chain.py
from .utils import ObjectLookupDict



class Chain(object):

    """A chain is a sequence of phrases for a single channel. Each phrase can be
    transposed by a number of semitones.
    """

    def __init__(self, song, index):
        self.song = song
        self.index = index

        self.transposes = self.song.song_data.chain_transposes[index]

        self.phrases = ObjectLookupDict(