MCPcopy Create free account
hub / github.com/SwayStar123/SpeedrunDiT / parse_tuple

Function parse_tuple

preprocessing/dataset_tools.py:39–43  ·  view source on GitHub ↗
(s: str)

Source from the content-addressed store, hash-verified

37# Example: '4x2' returns (4,2)
38
39def parse_tuple(s: str) -> Tuple[int, int]:
40 m = re.match(r'^(\d+)[x,](\d+)$', s)
41 if m:
42 return int(m.group(1)), int(m.group(2))
43 raise click.ClickException(f'cannot parse tuple {s}')
44
45#----------------------------------------------------------------------------
46

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected