code: def where_entry_visible(query, date=None):
      
  
      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))
           )
      )
docs: Generate a where clause for currently-visible entries
  
      Arguments:
  
      date -- The date to generate it relative to (defaults to right now)