<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def where_entry_visible(query, date=None):
 """ Generate a where clause for currently-visible entries Arguments: date -- The date to generate it relative to (defaults to right now) """


    return orm.select(
        e for e in query
        if e.status == model.PublishStatus.PUBLISHED.value or
        (e.status == model.PublishStatus.SCHEDULED.value and
         (e.utc_date <= (date or arrow.utcnow().datetime))
         )
    )