Pluralize a count-noun string pattern when necessary
(count, noun, plural_form=None)
| 2200 | |
| 2201 | |
| 2202 | def 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 | |
| 2210 | def is_namedtuple_instance(obj: Any) -> bool: |
no outgoing calls