pympi/Praat.py
def sort_tiers(self, key=lambda x: x.name):
        """Sort the tiers given the key. Example key functions:

        Sort according to the tiername in a list:

        ``lambda x: ['name1', 'name2' ... 'namen'].index(x.name)``.

        Sort according to the number of annotations:

        ``lambda x: len(list(x.get_intervals()))``

        :param func key: A key function. Default sorts alphabetically.
        """
        self.tiers.sort(key=key)
def sort_tiers(self, key=lambda x: x.name):
        """Sort the tiers given the key. Example key functions:

        Sort according to the tiername in a list:

        ``lambda x: ['name1', 'name2' ... 'namen'].index(x.name)``.

        Sort according to the number of annotations:

        ``lambda x: len(list(x.get_intervals()))``

        :param func key: A key function. Default sorts alphabetically.
        """
        self.tiers.sort(key=key)
Sort the tiers given the key. Example key functions:

        Sort according to the tiername in a list:

        ``lambda x: ['name1', 'name2' ... 'namen'].index(x.name)``.

        Sort according to the number of annotations:

        ``lambda x: len(list(x.get_intervals()))``

        :param func key: A key function. Default sorts alphabetically.