<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def ls_cmd(context, before, status):
 """Display recent logs for analyses."""

    runs = context.obj['store'].analyses(
        status=status,
        deleted=False,
        before=parse_date(before) if before else None,
    ).limit(30)
    for run_obj in runs:
        if run_obj.status == 'pending':
            message = f"{run_obj.id} | {run_obj.family} [{run_obj.status.upper()}]"
        else:
            message = (f"{run_obj.id} | {run_obj.family} {run_obj.started_at.date()} "
                       f"[{run_obj.type.upper()}/{run_obj.status.upper()}]")
            if run_obj.status == 'running':
                message = click.style(f"{message} - {run_obj.progress * 100}/100", fg='blue')
            elif run_obj.status == 'completed':
                message = click.style(f"{message} - {run_obj.completed_at}", fg='green')
            elif run_obj.status == 'failed':
                message = click.style(message, fg='red')
        print(message)