def copy_or_move_subcommand(action, vcard_list, target_address_book_list):
<EOL>source_vcard = choose_vcard_from_list(<EOL>"<STR_LIT>" % action.title(), vcard_list)<EOL>if source_vcard is None:<EOL><INDENT>print("<STR_LIT>")<EOL>sys.exit(<NUM_LIT:1>)<EOL><DEDENT>else:<EOL><INDENT>print("<STR_LIT>"<EOL>% (action.title(), source_vcard, source_vcard.address_book))<EOL><DEDENT>if len(target_address_book_list) == <NUM_LIT:1>and target_address_book_list[<NUM_LIT:0>] == source_vcard.address_book:<EOL><INDENT>print("<STR_LIT>"<EOL>% (target_address_book_list[<NUM_LIT:0>], source_vcard))<EOL>sys.exit(<NUM_LIT:1>)<EOL><DEDENT>else:<EOL><INDENT>available_address_books = [abook for abook in target_address_book_list<EOL>if abook != source_vcard.address_book]<EOL>selected_target_address_book = choose_address_book_from_list(<EOL>"<STR_LIT>", available_address_books)<EOL>if selected_target_address_book is None:<EOL><INDENT>print("<STR_LIT>")<EOL>sys.exit(<NUM_LIT:1>)<EOL><DEDENT><DEDENT>target_vcard = choose_vcard_from_list(<EOL>"<STR_LIT>",<EOL>get_contact_list_by_user_selection([selected_target_address_book],<EOL>source_vcard.get_full_name(), True))<EOL>if target_vcard is None:<EOL><INDENT>copy_contact(source_vcard, selected_target_address_book,<EOL>action == "<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>if source_vcard == target_vcard:<EOL><INDENT>print("<STR_LIT>" % target_vcard)<EOL>if action == "<STR_LIT>":<EOL><INDENT>copy_contact(source_vcard, selected_target_address_book, True)<EOL><DEDENT>else:<EOL><INDENT>print("<STR_LIT>")<EOL><DEDENT><DEDENT>else:<EOL><INDENT>print("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>" % (<EOL>target_vcard.address_book, source_vcard,<EOL>source_vcard.print_vcard(), target_vcard.print_vcard(),<EOL>"<STR_LIT>" if action == "<STR_LIT>" else "<STR_LIT>"))<EOL>while True:<EOL><INDENT>input_string = input("<STR_LIT>")<EOL>if input_string.lower() == "<STR_LIT:a>":<EOL><INDENT>copy_contact(source_vcard, selected_target_address_book,<EOL>action == "<STR_LIT>")<EOL>break<EOL><DEDENT>if input_string.lower() == "<STR_LIT:o>":<EOL><INDENT>copy_contact(source_vcard, selected_target_address_book,<EOL>action == "<STR_LIT>")<EOL>target_vcard.delete_vcard_file()<EOL>break<EOL><DEDENT>if input_string.lower() == "<STR_LIT:m>":<EOL><INDENT>merge_existing_contacts(source_vcard, target_vcard,<EOL>action == "<STR_LIT>")<EOL>break<EOL><DEDENT>if input_string.lower() in ["<STR_LIT>", "<STR_LIT:q>"]:<EOL><INDENT>print("<STR_LIT>")<EOL>break<EOL><DEDENT><DEDENT><DEDENT><DEDENT>
Copy or move a contact to a different address book.

    :action: the string "copy" or "move" to indicate what to do
    :type action: str
    :param vcard_list: the contact list from which to select one for the action
    :type vcard_list: list of carddav_object.CarddavObject
    :param target_address_book_list: the list of target address books
    :type target_address_book_list: list(addressbook.AddressBook)
    :returns: None
    :rtype: None