Generate a :class:`Keypair` object via a deterministic
        phrase.

        Using a mnemonic, such as one generated from :class:`StellarMnemonic`,
        generate a new keypair deterministically. Uses :class:`StellarMnemonic`
        internally to generate the seed from the mnemonic, using PBKDF2.

        :param str mnemonic: A unique string used to deterministically generate
            keypairs.
        :param str passphrase: An optional passphrase used as part of the salt
            during PBKDF2 rounds when generating the seed from the mnemonic.
        :param str lang: The language of the mnemonic, defaults to english.
        :param int index: The index of the keypair generated by the mnemonic.
            This allows for multiple Keypairs to be derived from the same
            mnemonic, such as::

                >>> from stellar_base.keypair import Keypair
                >>> m = 'update hello cry airport drive chunk elite boat shaft sea describe number'  # Don't use this mnemonic in practice.
                >>> kp1 = Keypair.deterministic(m, lang='english', index=0)
                >>> kp2 = Keypair.deterministic(m, lang='english', index=1)
                >>> kp3 = Keypair.deterministic(m, lang='english', index=2)

        :return: A new :class:`Keypair` instance derived from the mnemonic.

def deterministic(cls, mnemonic, passphrase='', lang='english', index=0):
        """Generate a :class:`Keypair` object via a deterministic
        phrase.

        Using a mnemonic, such as one generated from :class:`StellarMnemonic`,
        generate a new keypair deterministically. Uses :class:`StellarMnemonic`
        internally to generate the seed from the mnemonic, using PBKDF2.

        :param str mnemonic: A unique string used to deterministically generate
            keypairs.
        :param str passphrase: An optional passphrase used as part of the salt
            during PBKDF2 rounds when generating the seed from the mnemonic.
        :param str lang: The language of the mnemonic, defaults to english.
        :param int index: The index of the keypair generated by the mnemonic.
            This allows for multiple Keypairs to be derived from the same
            mnemonic, such as::

                >>> from stellar_base.keypair import Keypair
                >>> m = 'update hello cry airport drive chunk elite boat shaft sea describe number'  # Don't use this mnemonic in practice.
                >>> kp1 = Keypair.deterministic(m, lang='english', index=0)
                >>> kp2 = Keypair.deterministic(m, lang='english', index=1)
                >>> kp3 = Keypair.deterministic(m, lang='english', index=2)

        :return: A new :class:`Keypair` instance derived from the mnemonic.

        """
        sm = StellarMnemonic(lang)
        seed = sm.to_seed(mnemonic, passphrase=passphrase, index=index)
        return cls.from_raw_seed(seed)