def _sa_range_to_dict(self, sa_range, allocations=None):
size = (sa_range['<STR_LIT>'] + <NUM_LIT:1>) - sa_range['<STR_LIT>']<EOL>sa_range_dict = dict(sa_range)<EOL>sa_range_dict.pop('<STR_LIT>')<EOL>sa_range_dict['<STR_LIT:size>'] = size<EOL>if allocations is not None:<EOL><INDENT>sa_range_dict['<STR_LIT>'] = size - allocations<EOL><DEDENT>return sa_range_dict<EOL>
Helper to turn a model into a dict for assertions.