tailot's picture
Upload folder using huggingface_hub
db2c7db verified
Raw History Blame Contribute Delete
385 Bytes
"""Reporting what a basket holds.
One function counts the basket to ask whether it is empty, and that is the shape the
truthiness pattern rewrites. The other already asks directly, and the pattern says so.
"""
def describe(items):
if len(items) == 0:
return "empty"
return "full"
def first_or_none(items):
if not items:
return None
return items[0]