def is_int(string):
    """ 检查字符串是不是合法的 int. validate if string is a valid int.

    Examples::

        if is_int('wrong string'): ...

    :rtype: bool
    """
    try:
        int(string)
        return True
    except ValueError:
        return False
