def calculate(a: int, operator: str, b: int) -> int:
    """
    Simple calculator.

    >>> calculate(a = 3, operator = "+", b = 4)
    7
    >>> calculate(a = 3, operator = "-", b = 4)
    -1
    >>> calculate(a = 3, operator = "*", b = 4)
    12
    >>> calculate(a = 3, operator = "/", b = 4)
    0
    >>> calculate(a = 3, operator = "!", b = 4)
    Traceback (most recent call last):
    ...
    ValueError: Invalid operator
    """
    if operator == "+":
        return a + b
    elif operator == "-":
        return a - b
    elif operator == "*":
        return a * b
    elif operator == "/":
        return a // b
    else:
        raise ValueError("Invalid operator")