<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def create_incident(**kwargs):
 """ Creates an incident """

    incidents = cachet.Incidents(endpoint=ENDPOINT, api_token=API_TOKEN)
    if 'component_id' in kwargs:
        return incidents.post(name=kwargs['name'],
                              message=kwargs['message'],
                              status=kwargs['status'],
                              component_id=kwargs['component_id'],
                              component_status=kwargs['component_status'])
    else:
        return incidents.post(name=kwargs['name'],
                              message=kwargs['message'],
                              status=kwargs['status'])