pyk.utils module
- final class POSet(relation: 'Iterable[tuple[H, H]]')[source]
Bases:
Generic
[H
]- image: FrozenDict[H, frozenset[H]]
- case(cases: Iterable[tuple[Callable[[P], bool], Callable[[P], R]]], default: Callable[[P], R] | None = None) Callable[[P], R] [source]
- partition(iterable: Iterable[T], pred: Callable[[T, T], bool]) list[list[T]] [source]
Partition the iterable into sublists based on the given predicate.
predicate pred(_, _) should satisfy: - pred(x, x) - if pred(x, y) and pred(y, z) then pred(x, z); - if pred(x, y) then pred(y, x);
- run_process(args: str | Iterable[str], *, check: bool = True, input: str | None = None, pipe_stdout: bool = True, pipe_stderr: bool = False, cwd: str | Path | None = None, env: Mapping[str, str] | None = None, logger: Logger | None = None, exec_process: bool = False) CompletedProcess [source]
- run_process_2(args: str | Iterable[str], *, input: str | None = None, write_stdout: bool = False, write_stderr: bool = False, cwd: str | Path | None = None, env: Mapping[str, str] | None = None, logger: Logger | None = None, loglevel: int | None = None, check: bool = True) CompletedProcess [source]
- tuple_of() Callable[[tuple[()]], tuple[()]] [source]
- tuple_of(f1: Callable[[P1], R1], /) Callable[[tuple[P1]], tuple[R1]]
- tuple_of(f1: Callable[[P1], R1], f2: Callable[[P2], R2], /) Callable[[tuple[P1, P2]], tuple[R1, R2]]
- tuple_of(f1: Callable[[P1], R1], f2: Callable[[P2], R2], f3: Callable[[P3], R3], /) Callable[[tuple[P1, P2, P3]], tuple[R1, R2, R3]]
- tuple_of(f1: Callable[[P1], R1], f2: Callable[[P2], R2], f3: Callable[[P3], R3], f4: Callable[[P4], R4], /) Callable[[tuple[P1, P2, P3, P4]], tuple[R1, R2, R3, R4]]