<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _generate_lastnames_variations(lastnames):
 """Generate variations for lastnames. Note: This method follows the assumption that the first last name is the main one. E.g. For 'Caro Estevez', this method generates: ['Caro', 'Caro Estevez']. In the case the lastnames are dashed, it splits them in two. """

    if not lastnames:
        return []

    split_lastnames = [split_lastname for lastname in lastnames for split_lastname in lastname.split('-')]

    lastnames_variations = split_lastnames
    if len(split_lastnames) > 1:
        # Generate lastnames concatenation if there are more than one lastname after split.
        lastnames_variations.append(u' '.join([lastname for lastname in split_lastnames]))

    return lastnames_variations