code: def _determine_dialect(self, lines):
  		
  		permuts = [(quotechar, escapechar)
  				for quotechar in CSV_QUOTECHARS
  				for escapechar in CSV_ESCAPECHARS]
  
  		for delim in CSV_DELIMITERS:
  			counts = [line.count(delim) for line in lines]
  
  			if min(counts) == 0:
  				continue
  
  			for quotechar, escapechar in permuts:
  				doublequote = True if escapechar is None else False
  
  				reader = csv.reader(lines, delimiter=delim, quotechar=quotechar,
  								doublequote=doublequote, escapechar=escapechar)
  
  				try:
  					assert len(set([len(line) for line in reader])) == 1
  				except AssertionError:
  					continue
  				else:
  					break
  			else:
  				continue  # no suitable quoting found
  
  			break  # found it!
  
  		else:
  			return None
  
  		return Dialect(delim, quotechar, doublequote, escapechar)
docs: Expects a non-empty [] of strings; these would normally be the first
  		few lines of a csv file. Returns the most likely Dialect named tuple or
  		None if the data seems to form a single column.
  
  		Ensures that using the returned dialect, all the lines given will have
  		the same number of columns.
  
  		Helper for the get_dialect method.