def export(self, target_url):
        if self.get_state()!=State.Running:
            self.wait()
        
        if len(self.pilot_data) > 0:
            # Search for PD that is close to local machine
            local_hostname=socket.getfqdn()
            max_score=0
            best_pd=None
            for pd in self.pilot_data:
                pd_host = SAGAUrl(pd.service_url).host
                pd_score = difflib.SequenceMatcher(a=pd_host, b=local_hostname).ratio()
                logger.debug("Export locality compute score: Localhost: %s PD at: %s Score: %s"%(local_hostname, pd_host, pd_score))
                if pd_score > max_score:
                    best_pd=pd
                    max_score=pd_score
                
                #pd_domain = tldextract.extract(pd.service_url).domain
                #local_domain = tldextract.extract(socket.getfqdn()).domain
                
            if best_pd!=None:
                logger.debug("Export from: %s"%(best_pd.service_url))
                best_pd.export_du(self, target_url)
                return
                
            # No PD found. Utilize default PD
            logger.debug("Export from random PD")
            self.pilot_data[0].export_du(self, target_url)
        else:
            logger.error("No Pilot Data for PD found")
simple implementation of export: 
dataset/ETHPy150Open saga-project/BigJob/pilot/impl/pilotdata_manager.py/DataUnit.export