def clone_container(container, dest_dir):
 dest_dir = os.path.abspath(os.path.realpath(dest_dir))
 clone_data = container.clone_data(dest_dir)
 cls = type(container)
 if (cls is Container):
  return cls(None, None, container.log, clone_data=clone_data)
 return cls(None, container.log, clone_data=clone_data)

def clone_container ( container , dest_dir ) : dest_dir = os . path . abspath ( os . path . realpath ( dest_dir ) ) clone_data = container . clone_data ( dest_dir ) cls = type ( container ) if ( cls is Container ) : return cls ( None , None , container . log , clone_data = clone_data ) return cls ( None , container . log , clone_data = clone_data )
efficiently clone a container using hard links .