def detect(stream, delimiter=DEFAULT_DELIMITER):
    try:
        csv.Sniffer().sniff(stream, delimiters=delimiter)
        return True
    except (csv.Error, TypeError):
        return False
Returns True if given stream is valid CSV.
dataset/ETHPy150Open kennethreitz/tablib/tablib/formats/_csv.py/detect