<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def make_geohash_tables(table,listofprecisions,**kwargs):
	'''
	sort_by - field to sort by for each group
	return_squares - boolean arg if true returns a list of squares instead of writing out to table
	'''
	return_squares = False
	sort_by = 'COUNT'
	# logic for accepting kwarg inputs
	for key,value in kwargs.iteritems():
		if key == 'sort_by':
			sort_by = value
		if key == 'return_squares':
			return_squares = value

	# getting header
	header = df2list(table)[0]

	# getting columns
	columns = header[10:]

	# getting original table
	originaltable = table
	if not sort_by == 'COUNT':
		originaltable = originaltable.sort([sort_by],ascending=[0])




	listofprecisions = sorted(listofprecisions,reverse=True)
	# making total table to hold a list of dfs
	if return_squares == True and listofprecisions[-1] == 8:
		total_list = [table]
	elif return_squares == True:
		total_list = []

	for row in listofprecisions:
		precision = int(row)
		table = originaltable
		table['GEOHASH'] = table.GEOHASH.str[:precision]
		table = table[['GEOHASH','COUNT']+columns].groupby(['GEOHASH'],sort=True).sum()
		table = table.sort([sort_by],ascending=[0])
		table = table.reset_index()

		newsquares = [header]
		# iterating through each square here 
		for row in df2list(table)[1:]:
			# getting points
			points = get_points_geohash(row[0])
			
			# making new row
			newrow = [row[0]] + points + row[1:]
			
			# appending to newsquares 
			newsquares.append(newrow)

		# taking newsquares to dataframe
		table = list2df(newsquares)

		if return_squares == True:
			total_list.append(table)
		else:
			table.to_csv('squares' + str(precision) + '.csv',index=False)

	if return_squares == True:
		return total_list
	else:
		print 'Wrote output squares tables to csv files.'