Given a list of consonant positions, move the consonants according to certain
        consonant syllable behavioral rules for gathering and grouping.

        :param letters:
        :param positions:
        :return:
556878
def _move_consonant(self, letters: list, positions: List[int]) -> List[str]:
        
        for pos in positions:
            previous_letter = letters[pos - 1]
            consonant = letters[pos]
            next_letter = letters[pos + 1]
            if self._contains_vowels(next_letter) and self._starts_with_vowel(next_letter):
                return string_utils.move_consonant_right(letters, [pos])
            if self._contains_vowels(previous_letter) and self._ends_with_vowel(
                    previous_letter) and len(previous_letter) == 1:
                return string_utils.move_consonant_left(letters, [pos])
            if previous_letter + consonant in self.constants.ASPIRATES:
                return string_utils.move_consonant_left(letters, [pos])
            if consonant + next_letter in self.constants.ASPIRATES:
                return string_utils.move_consonant_right(letters, [pos])
            if next_letter[0] == consonant:
                return string_utils.move_consonant_left(letters, [pos])
            if consonant in self.constants.MUTES and next_letter[0] in self.constants.LIQUIDS:
                return string_utils.move_consonant_right(letters, [pos])
            if consonant in ['k', 'K'] and next_letter[0] in ['w', 'W']:
                return string_utils.move_consonant_right(letters, [pos])
            if self._contains_consonants(next_letter[0]) and self._starts_with_vowel(
                    previous_letter[-1]):
                return string_utils.move_consonant_left(letters, [pos])
            # fall through case
            if self._contains_consonants(next_letter[0]):
                return string_utils.move_consonant_right(letters, [pos])
        return letters
235293
def random_words(self, letter=None, count=1):
        
        self.check_count(count)

        words = []

        if letter is None:
            all_words = list(
                chain.from_iterable(self.nouns.values()))

            try:
                words = sample(all_words, count)
            except ValueError:
                len_sample = len(all_words)
                raise ValueError('Param "count" must be less than {0}. \
(It is only {0} words)'.format(len_sample + 1, letter))

        elif type(letter) is not str:
            raise ValueError('Param "letter" must be string.')

        elif letter not in self.available_letters:
            raise ValueError(
                'Param "letter" must be in {0}.'.format(
                    self.available_letters))

        elif letter in self.available_letters:
            try:
                words = sample(self.nouns[letter], count)
            except ValueError:
                len_sample = len(self.nouns[letter])
                raise ValueError('Param "count" must be less than {0}. \
(It is only {0} words for letter "{1}")'.format(len_sample + 1, letter))

        return words
722642
def letter():
    ''''''
    @Parser
    def letter_parser(text, index=0):
        if index < len(text) and text[index].isalpha():
            return Value.success(index + 1, text[index])
        else:
            return Value.failure(index, 'a letter')
    return letter_parser
892084
def run(self, args):
        
        args = vars(args)
        positionals = []
        keywords = {}
        for action in self.argparser._actions:
            if not hasattr(action, 'label'):
                continue
            if action.label == 'positional':
                positionals.append(args[action.dest])
            elif action.label == 'varargs':
                positionals.extend(args[action.dest])
            elif action.label == 'keyword':
                keywords[action.dest] = args[action.dest]
            elif action.label == 'varkwargs':
                kwpairs = iter(args[action.dest] or [])
                for key in kwpairs:
                    try:
                        key, value = key.split('=', 1)
                    except ValueError:
                        value = next(kwpairs)
                        key = key.strip('-')
                    keywords[key] = value
        return self.func(*positionals, **keywords)
158894
def apply_T4(word):
    ''''''
    WORD = word.split('.')

    for i, v in enumerate(WORD):

        # i % 2 != 0 prevents this rule from applying to first, third, etc.
        # syllables, which receive stress (WSP)
        if is_consonant(v[-1]) and i % 2 != 0:

            if i + 1 == len(WORD) or is_consonant(WORD[i + 1][0]):
                vv = u_or_y_final_diphthongs(v)

                if vv and not is_long(vv.group(1)):
                    I = vv.start(1) + 1
                    WORD[i] = v[:I] + '.' + v[I:]

    WORD = '.'.join(WORD)
    RULE = ' T4' if word != WORD else ''

    return WORD, RULE
1337598
def rfc_persona_moral
      consonants_n_amp = CONSONANTS + ['Ñ', '&']
      all_letters = consonants_n_amp + VOWELS
      date = ::Time.at(rand * ::Time.now.to_f).strftime('%y%m%d')
      "#{fetch_sample(all_letters, count: 3).join}#{date}#{fetch_sample(HOMOCLAVE, count: 3).join}"
    end
1360346
def letter_set(self):
        
        end_str = ctypes.create_string_buffer(MAX_CHARS)

        cgaddag.gdg_letter_set(self.gdg, self.node, end_str)

        return [char for char in end_str.value.decode("ascii")]
17815
def __moveLineOrCol(self, line, d):
        
        nl = [c for c in line if c != 0]
        if d == Board.UP or d == Board.LEFT:
            return nl + [0] * (self.__size - len(nl))
        return [0] * (self.__size - len(nl)) + nl
496281
void joinClusters( int mouth , int food ) {

		List<Node> listMouth = clusters.get(mouth);
		List<Node> listFood = clusters.get(food);

		// put all members of food into mouth
		for (int i = 0; i < listFood.size(); i++) {
			listMouth.add( listFood.get(i) );
			listFood.get(i).cluster = mouth;
		}

		// zero food members
		listFood.clear();
	}
1271467
def set_prev_hard(self):
        
        prev = self.get_prev_letter()
        if not prev:
            return
        if not prev.is_consonant():
            return
        if self.is_softener(prev):
            prev.set_hard(False)
        elif self.letter in self.vovels_set_hard:
            prev.set_hard(True)
320344
def _scansion(self, sentence_syllables):
        

        scanned_text = []
        for sentence in sentence_syllables:
            scanned_sent = []
            for syllable in sentence:
                if self._long_by_position(syllable, sentence) or \
                   self._long_by_nature(syllable):
                    scanned_sent.append('¯')
                else:
                    scanned_sent.append('˘')
            if len(scanned_sent) > 1:
                del scanned_sent[-1]
                scanned_sent.append('x')
            scanned_text.append(''.join(scanned_sent))
        return scanned_text
1026322
def aspirate(self, consonant) :
		'''
		
		'''
		aspirated_consonant = deepcopy(consonant)
		aspirated_consonant[Aspirated] = Aspirated.pos
		return self._find_sound(aspirated_consonant)
182765
def _starting_consonants_only(self, letters: list) -> list:
        """"""
        for idx, letter in enumerate(letters):
            if not self._contains_vowels(letter) and self._contains_consonants(letter):
                return [idx]
            if self._contains_vowels(letter):
                return []
            if self._contains_vowels(letter) and self._contains_consonants(letter):
                return []
        return []
926438
def _ending_consonants_only(self, letters: List[str]) -> List[int]:
        """"""
        reversed_letters = list(reversed(letters))
        length = len(letters)
        for idx, letter in enumerate(reversed_letters):
            if not self._contains_vowels(letter) and self._contains_consonants(letter):
                return [(length - idx) - 1]
            if self._contains_vowels(letter):
                return []
            if self._contains_vowels(letter) and self._contains_consonants(letter):
                return []
        return []
489456
def match_positions(shape, list_of_coords):
    
    match_array = np.zeros(shape)
    try:
        # excpetion hit on this line if nothing in list_of_coords- i.e. no matches
        match_array[list_of_coords[:,0],list_of_coords[:,1]] = 1
        labelled = label(match_array)
        objects = find_objects(labelled[0])
        coords = [{'x':(slice_x.start, slice_x.stop),'y':(slice_y.start, slice_y.stop)} for (slice_y,slice_x) in objects]
        final_positions = [(int(np.mean(coords[i]['x'])),int(np.mean(coords[i]['y']))) for i in range(len(coords))]
        return final_positions
    except IndexError:
        print 'no matches found'
        # this error occurs if no matches are found
        return []
481980
def get_precomposed_chars():
	
	return set([
		letter for letter in chart.consonants
		if unicodedata.normalize('NFD', letter) != letter ])
258285
def go_to_position(self, position):
        

        cursor = self.textCursor()
        cursor.setPosition(position)
        self.setTextCursor(cursor)
        return True