from typing import OrderedDict


def make_offset_dict(strand):
    """
    Helper function for calculating offsets at which chains fall into in a model

    :param strand: Model to calculate offsets from, OrderedDict with chain names as keys
    :return: Dictionary of offsets
    """
    offset_dict = OrderedDict.fromkeys(strand.keys())
    temp_length = 0
    for chain, items in strand.items():
        offset_dict[chain] = temp_length
        temp_length += len(items)

    return offset_dict