code: def _generate_lastnames_variations(lastnames):
      
      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
docs: 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.