def is_service_running(endpoint_url, expected_status_code):
    try:
        # feel free to suggest better solution for this check
        response = requests.get(endpoint_url, timeout=1)
        return response.status_code == expected_status_code
    except requests.exceptions.ConnectionError:
        return False