(arr: Union[np.ndarray, bytes])
| 3 | |
| 4 | |
| 5 | def upcast_array(arr: Union[np.ndarray, bytes]): |
| 6 | if isinstance(arr, list): |
| 7 | return [upcast_array(a) for a in arr] |
| 8 | if isinstance(arr, np.ndarray): |
| 9 | if arr.dtype == np.uint16: |
| 10 | return arr.astype(np.int32) |
| 11 | if arr.dtype == np.uint32: |
| 12 | return arr.astype(np.int64) |
| 13 | if arr.dtype == np.uint64: |
| 14 | return arr.astype(np.int64) |
| 15 | return arr |
no outgoing calls
no test coverage detected