MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / _natsort_key

Function _natsort_key

misc/python/materialize/cli/scratch/create.py:31–35  ·  view source on GitHub ↗

Split a string into text and integer parts for natural sorting.

(s: str)

Source from the content-addressed store, hash-verified

29
30
31def _natsort_key(s: str) -> list:
32 """Split a string into text and integer parts for natural sorting."""
33 import re
34
35 return [int(part) if part.isdigit() else part for part in re.split(r"(\d+)", s)]
36
37
38def pick_machine() -> str:

Callers 1

pick_machineFunction · 0.85

Calls 1

splitMethod · 0.45

Tested by

no test coverage detected