def invert_items(df):
    """This function inverts the scale of some items of LoC so that for all
    items higher numbers reflect greater feelings of control."""
    inverted_items = [
        "LOC_ACHIEVED_DESERVE",
        "LOC_LUCK",
        "LOC_OTHERS",
        "LOC_DOUBT",
        "LOC_POSSIBILITIES",
        "LOC_ABILITIES",
        "LOC_LITTLE_CONTROL",
    ]
    for item in inverted_items:
        df[item].replace(
            to_replace=[1, 2, 3, 4, 5, 6, 7], value=[7, 6, 5, 4, 3, 2, 1], inplace=True
        )

    return df