(dim, ndim)
| 466 | |
| 467 | |
| 468 | def dim_resolve_negative(dim, ndim): |
| 469 | if not isinstance(dim, tuple): |
| 470 | dim = (dim, ) |
| 471 | pos = [] |
| 472 | for d in dim: |
| 473 | if d < 0: |
| 474 | d = ndim + d |
| 475 | pos.append(d) |
| 476 | return tuple(pos) |
| 477 | |
| 478 | |
| 479 | def get_free_port() -> int: |