Pluralize a count-noun string pattern when necessary
(count, noun, plural_form=None)
| 2195 | |
| 2196 | |
| 2197 | def 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 | |
| 2205 | def is_namedtuple_instance(obj: Any) -> bool: |
no outgoing calls