<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_default_identity_by_index(self, index: int):
 """ This interface is used to set default account by given an index value. :param index: an int value that indicate the position of an account object in account list. """

        identities_len = len(self.identities)
        if index >= identities_len:
            raise SDKException(ErrorCode.param_error)
        for i in range(identities_len):
            self.identities[i].is_default = False
            if i == index:
                self.identities[index].is_default = True