code: def surname(self, gender: Optional[Gender] = None) -> str:
          
          surnames = self._data['surnames']
  
          # Surnames separated by gender.
          if isinstance(surnames, dict):
              key = self._validate_enum(gender, Gender)
              surnames = surnames[key]
  
          return self.random.choice(surnames)
docs: Generate a random surname.
  
          :param gender: Gender's enum object.
          :return: Surname.
  
          :Example:
              Smith.