def derive(self, path):
        """
        :param path: a path like "m/44'/0'/1'/0/10" if deriving from a master key,
                     or a relative path like "./0/10"
        :return: the derived ExtendedPublicKey if deriving from an ExtendedPublicKey,
                 the derived ExtendedPrivateKey if deriving from an ExtendedPrivateKey
        """
        steps = path.split('/')

        if steps[0] not in {'m', '.'}:
            raise ValueError('Invalid derivation path: {}'.format(path))

        if steps[0] == 'm' and not self.is_master():
            raise ValueError('Trying to derive absolute path from non-master key')

        current = self
        for step in steps[1:]:
            hardened = False
            if step[-1] == "'":
                hardened = True
                step = step[:-1]
            index = int(step)
            current = current.get_child(index, hardened)

        return current
def derive ( self , path ) : steps = path . split ( '/' ) if steps [ 0 ] not in { 'm' , '.' } : raise ValueError ( 'Invalid derivation path: {}' . format ( path ) ) if steps [ 0 ] == 'm' and not self . is_master ( ) : raise ValueError ( 'Trying to derive absolute path from non-master key' ) current = self for step in steps [ 1 : ] : hardened = False if step [ - 1 ] == "'" : hardened = True step = step [ : - 1 ] index = int ( step ) current = current . get_child ( index , hardened ) return current
:param path: a path like "m/44'/0'/1'/0/10" if deriving from a master key,
                     or a relative path like "./0/10"
        :return: the derived ExtendedPublicKey if deriving from an ExtendedPublicKey,
                 the derived ExtendedPrivateKey if deriving from an ExtendedPrivateKey