original_docstring: 
          Feed newly-elected master with segments.
          
docstring: Feed newly-elected master with segments.
docstring_tokens: Feed newly - elected master with segments .
code: def _sync_master(self):
          """
          Feed newly-elected master with segments.
          """
          assert not self.zk.have_lock()
          assert self._master_id
          # TODO(PSz): consider mechanism for avoiding a registration storm.
          core_segs = []
          # Find all core segments from remote ISDs
          for pcb in self.core_segments(full=True):
              if pcb.first_ia()[0] != self.addr.isd_as[0]:
                  core_segs.append(pcb)
          # Find down-segments from local ISD.
          down_segs = self.down_segments(full=True, last_isd=self.addr.isd_as[0])
          logging.debug("Syncing with %s", self._master_id)
          seen_ases = set()
          for seg_type, segs in [(PST.CORE, core_segs), (PST.DOWN, down_segs)]:
              for pcb in segs:
                  key = pcb.first_ia(), pcb.last_ia()
                  # Send only one SCION segment for given (src, dst) pair.
                  if not pcb.is_sibra() and key in seen_ases:
                      continue
                  seen_ases.add(key)
                  self._segs_to_master.append((seg_type, pcb))
code_tokens: def _sync_master ( self ) : assert not self . zk . have_lock ( ) assert self . _master_id core_segs = [ ] for pcb in self . core_segments ( full = True ) : if pcb . first_ia ( ) [ 0 ] != self . addr . isd_as [ 0 ] : core_segs . append ( pcb ) down_segs = self . down_segments ( full = True , last_isd = self . addr . isd_as [ 0 ] ) logging . debug ( "Syncing with %s" , self . _master_id ) seen_ases = set ( ) for seg_type , segs in [ ( PST . CORE , core_segs ) , ( PST . DOWN , down_segs ) ] : for pcb in segs : key = pcb . first_ia ( ) , pcb . last_ia ( ) if not pcb . is_sibra ( ) and key in seen_ases : continue seen_ases . add ( key ) self . _segs_to_master . append ( ( seg_type , pcb ) )
short_docstring: Feed newly-elected master with segments.
short_docstring_tokens: Feed newly - elected master with segments .
comment: """
          Feed newly-elected master with segments.
          """$SEP$# TODO(PSz): consider mechanism for avoiding a registration storm.$SEP$# Find all core segments from remote ISDs$SEP$# Find down-segments from local ISD.$SEP$# Send only one SCION segment for given (src, dst) pair.