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

Function maybe_pluralize

dask/utils.py:2202–2207  ·  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

2200
2201
2202def maybe_pluralize(count, noun, plural_form=None):
2203 """Pluralize a count-noun string pattern when necessary"""
2204 if count == 1:
2205 return f"{count} {noun}"
2206 else:
2207 return f"{count} {plural_form or noun + 's'}"
2208
2209
2210def 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