def convert_old_variant_handle(handle_dict):
old_variables = handle_dict.get("<STR_LIT>", {})<EOL>variables = dict(repository_type="<STR_LIT>")<EOL>for old_key, key in variant_key_conversions.iteritems():<EOL><INDENT>value = old_variables.get(old_key)<EOL>variables[key] = value<EOL><DEDENT>path = handle_dict["<STR_LIT:path>"]<EOL>filename = os.path.basename(path)<EOL>if os.path.splitext(filename)[<NUM_LIT:0>] == "<STR_LIT>":<EOL><INDENT>key = "<STR_LIT>"<EOL><DEDENT>else:<EOL><INDENT>key = "<STR_LIT>"<EOL><DEDENT>return dict(key=key, variables=variables)<EOL>
Convert a variant handle from serialize_version < 4.0.