def data_callback_factory(variable):
 def callback(data):
  variable.write(data)
  return
 return callback

def data_callback_factory ( variable ) : def callback ( data ) : variable . write ( data ) return return callback
returns a callback suitable for use by the ftp library .