def divide(value, arg):
    """
    Divides the value by the arg. Integer division.
    
    Returns 0 if an exception occurs, or if dividing by zero.
    """
    try:
        output = int(value) / int(arg)
    except:
        output = 0
    return output