| 46 | |
| 47 | |
| 48 | class TmpObjectWithoutCat: |
| 49 | |
| 50 | def __init__(self, tmp) -> None: |
| 51 | assert isinstance(tmp, list) |
| 52 | if len(tmp) > 0: |
| 53 | for t in tmp: |
| 54 | assert isinstance(t, list) |
| 55 | self.tmp = tmp |
| 56 | |
| 57 | def __len__(self): |
| 58 | return len(self.tmp) |
| 59 | |
| 60 | def __getitem__(self, item): |
| 61 | if isinstance(item, int): |
| 62 | if item >= len(self) or item < -len(self): # type:ignore |
| 63 | raise IndexError(f'Index {item} out of range!') |
| 64 | else: |
| 65 | # keep the dimension |
| 66 | item = slice(item, None, len(self)) |
| 67 | return TmpObjectWithoutCat(self.tmp[item]) |
| 68 | |
| 69 | def __repr__(self): |
| 70 | return str(self.tmp) |
| 71 | |
| 72 | |
| 73 | class TestInstanceData(TestCase): |
no outgoing calls
searching dependent graphs…