MCPcopy Create free account
hub / github.com/numpy/numpy / normalize_whitespace

Function normalize_whitespace

numpy/distutils/tests/test_from_template.py:31–36  ·  view source on GitHub ↗

Remove leading and trailing whitespace, and convert internal stretches of whitespace to a single space.

(s)

Source from the content-addressed store, hash-verified

29
30
31def normalize_whitespace(s):
32 """
33 Remove leading and trailing whitespace, and convert internal
34 stretches of whitespace to a single space.
35 """
36 return ' '.join(s.split())
37
38
39def test_from_template():

Callers 1

test_from_templateFunction · 0.70

Calls 2

joinMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected