def to_progress_instance(progress):
 if callable(progress):
  return CallableRemoteProgress(progress)
 elif (progress is None):
  return RemoteProgress()
 else:
  return progress

def to_progress_instance ( progress ) : if callable ( progress ) : return CallableRemoteProgress ( progress ) elif ( progress is None ) : return RemoteProgress ( ) else : return progress
given the progress return a suitable object derived from remoteprogress() .