<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def badge(pipeline_id):
    '''An individual pipeline status'''
    if not pipeline_id.startswith('./'):
        pipeline_id = './' + pipeline_id
    pipeline_status = status.get(pipeline_id)

    status_color = 'lightgray'
    if pipeline_status.pipeline_details:
        status_text = pipeline_status.state().lower()
        last_execution = pipeline_status.get_last_execution()
        success = last_execution.success if last_execution else None
        if success is True:
            stats = last_execution.stats if last_execution else None
            record_count = stats.get('count_of_rows')
            if record_count is not None:
                status_text += ' (%d records)' % record_count
            status_color = 'brightgreen'
        elif success is False:
            status_color = 'red'
    else:
        status_text = "not found"
    return _make_badge_response('pipeline', status_text, status_color)