import numbers


def isnum(item, rais=True):
    """
    Return true if input *item* is a scalar number, otherwise false.
    Raise error if input *rais* is true.
    """
    if isinstance(item, numbers.Number):
        return True
    else:
        if rais:
            raise TypeError("Input 'item' must be a scalar number")
        else:
            return False