def expand_and_add_csv_to_zipfile(zip_out, arc_filename, file, do_expand):
    ''' Write csv to zipfile, with optional expand.expand_street_name().
    
        File is assumed to be open in binary mode.
    '''
    handle, tmp_filename = mkstemp(suffix='.csv'); close(handle)
    
    if not PY2:
        file = TextIOWrapper(file, 'utf8')
    
    size, squares = .1, defaultdict(lambda: 0)
    
    with open(tmp_filename, 'w') as output:
        in_csv = DictReader(file)
        out_csv = DictWriter(output, OPENADDR_CSV_SCHEMA, dialect='excel')
        out_csv.writerow({col: col for col in OPENADDR_CSV_SCHEMA})
    
        for row in in_csv:
            try:
                lat, lon = float(row['LAT']), float(row['LON'])
            except ValueError:
                continue

            if do_expand:
                row['STREET'] = expand.expand_street_name(row['STREET'])
            
            out_csv.writerow(row)
            key = floor(size / lat) * size, floor(lon / size) * size
            squares[key] += 1

    zip_out.write(tmp_filename, arc_filename)
    remove(tmp_filename)

    _add_spatial_summary_to_zipfile(zip_out, arc_filename, size, squares)
dataset/ETHPy150Open openaddresses/machine/openaddr/ci/collect.py/expand_and_add_csv_to_zipfile/swapped operands of `/`