def random_init_mapping(candidate_mapping):
<EOL>random.seed()<EOL>matched_dict = {}<EOL>result = []<EOL>for c in candidate_mapping:<EOL><INDENT>candidates = list(c)<EOL>if not candidates:<EOL><INDENT>result.append(-<NUM_LIT:1>)<EOL>continue<EOL><DEDENT>found = False<EOL>while candidates:<EOL><INDENT>rid = random.randint(<NUM_LIT:0>, len(candidates) - <NUM_LIT:1>)<EOL>candidate = candidates[rid]<EOL>if candidate in matched_dict:<EOL><INDENT>candidates.pop(rid)<EOL><DEDENT>else:<EOL><INDENT>matched_dict[candidate] = <NUM_LIT:1><EOL>result.append(candidate)<EOL>found = True<EOL>break<EOL><DEDENT><DEDENT>if not found:<EOL><INDENT>result.append(-<NUM_LIT:1>)<EOL><DEDENT><DEDENT>return result<EOL>
Generate a random node mapping.
Args:
    candidate_mapping: candidate_mapping: candidate node match list
Returns:
    randomly-generated node mapping between two AMRs