'Returns a dialect (or None) corresponding to the sample'

def sniff(self, sample, delimiters=None):

    (quotechar, doublequote, delimiter, skipinitialspace) = self._guess_quote_and_delimiter(sample, delimiters)
    if (not delimiter):
        (delimiter, skipinitialspace) = self._guess_delimiter(sample, delimiters)
    if (not delimiter):
        raise Error, 'Could    not    determine    delimiter'
    class dialect(Dialect, ):
        _name = 'sniffed'
        lineterminator = '\r\n'
        quoting = QUOTE_MINIMAL
    dialect.doublequote = doublequote
    dialect.delimiter = delimiter
    dialect.quotechar = (quotechar or '"')
    dialect.skipinitialspace = skipinitialspace
    return dialect
