def nnd_hotdeck_using_feather(receiver = None, donor = None, matching_variables = None, z_variables = None):
    """
    Not working
    """
    import feather

    assert receiver is not None and donor is not None
    assert matching_variables is not None

    temporary_directory_path = os.path.join(config_files_directory, 'tmp')
    assert os.path.exists(temporary_directory_path)
    receiver_path = os.path.join(temporary_directory_path, 'receiver.feather')
    donor_path = os.path.join(temporary_directory_path, 'donor.feather')
    feather.write_dataframe(receiver, receiver_path)
    feather.write_dataframe(donor, donor_path)
    if isinstance(matching_variables, str):
        match_vars = '"{}"'.format(matching_variables)
    elif len(matching_variables) == 1:
        match_vars = '"{}"'.format(matching_variables[0])
    else:
        match_vars = '"{}"'.format('todo')

    r_script = """
rm(list=ls())
gc()
devtools::install_github("wesm/feather/R")
library(feather)
library(StatMatch)

receiver <- read_feather({receiver_path})
donor <- read_feather({donor_path})
summary(receiver)
summary(donor)

# variables
receiver = as.data.frame(receiver)
donor = as.data.frame(donor)
gc()
match_vars = {match_vars}
# don_class = c("sexe")
out.nnd <- NND.hotdeck(
  data.rec = receiver, data.don = donor, match.vars = match_vars
  )

# out.nndsummary(out.nnd$mtc.ids)
# head(out.nnd$mtc.ids, 10)
# head(receiver, 10)

fused.nnd.m <- create.fused(
    data.rec = receiver, data.don = donor,
    mtc.ids = out.nnd$mtc.ids,
    z.vars = "{z_variables}"
    )
summary(fused.nnd.m)
""".format(
        receiver_path = receiver_path,
        donor_path = donor_path,
        match_vars = match_vars,
        z_variables = z_variables,
        )
    print(r_script)
Not working