def to_csv(df, filename, name_function=None, compression=None, compute=True, get=None, **kwargs):
 values = [_to_csv_chunk(d, **kwargs) for d in df.to_delayed()]
 values = write_bytes(values, filename, name_function, compression, encoding=None)
 if compute:
  delayed(values).compute(get=get)
 else:
  return values

def to_csv ( df , filename , name_function = None , compression = None , compute = True , get = None , ** kwargs ) : values = [ _to_csv_chunk ( d , ** kwargs ) for d in df . to_delayed ( ) ] values = write_bytes ( values , filename , name_function , compression , encoding = None ) if compute : delayed ( values ) . compute ( get = get ) else : return values
return a csv string from a list of indices .