MCPcopy Create free account
hub / github.com/dask/dask / maybe_pluralize

Function maybe_pluralize

dask/utils.py:2197–2202  ·  view source on GitHub ↗

Pluralize a count-noun string pattern when necessary

(count, noun, plural_form=None)

Source from the content-addressed store, hash-verified

2195
2196
2197def maybe_pluralize(count, noun, plural_form=None):
2198 """Pluralize a count-noun string pattern when necessary"""
2199 if count == 1:
2200 return f"{count} {noun}"
2201 else:
2202 return f"{count} {plural_form or noun + 's'}"
2203
2204
2205def is_namedtuple_instance(obj: Any) -> bool:

Callers 4

__repr__Method · 0.90
to_htmlMethod · 0.90
test_to_stringFunction · 0.90
_repr_html_Method · 0.90

Calls

no outgoing calls

Tested by 1

test_to_stringFunction · 0.72