| 7793 | return result |
| 7794 | |
| 7795 | def remove_repeated_elements_from_array(self, input, fallbackToTimestamp: bool = True): |
| 7796 | uniqueDic = {} |
| 7797 | uniqueResult = [] |
| 7798 | for i in range(0, len(input)): |
| 7799 | entry = input[i] |
| 7800 | uniqValue = self.safe_string_n(entry, ['id', 'timestamp', 0]) if fallbackToTimestamp else self.safe_string(entry, 'id') |
| 7801 | if uniqValue is not None and not (uniqValue in uniqueDic): |
| 7802 | uniqueDic[uniqValue] = 1 |
| 7803 | uniqueResult.append(entry) |
| 7804 | valuesLength = len(uniqueResult) |
| 7805 | if valuesLength > 0: |
| 7806 | return uniqueResult |
| 7807 | return input |
| 7808 | |
| 7809 | def remove_repeated_trades_from_array(self, input): |
| 7810 | uniqueResult = {} |