original_docstring: 
          Read master's address from shared lock, and if new master is elected
          sync it with segments.
          
docstring: Read master's address from shared lock, and if new master is elected
  sync it with segments.
docstring_tokens: Read master ' s address from shared lock and if new master is elected sync it with segments .
code: def _update_master(self):
          """
          Read master's address from shared lock, and if new master is elected
          sync it with segments.
          """
          if self.zk.have_lock():
              self._segs_to_master.clear()
              return
          try:
              curr_master = self.zk.get_lock_holder()
          except ZkNoConnection:
              logging.warning("_update_master(): ZkNoConnection.")
              return
          if curr_master and curr_master == self._master_id:
              return
          self._master_id = curr_master
          if not curr_master:
              logging.warning("_update_master(): current master is None.")
              return
          logging.debug("New master is: %s", self._master_id)
          self._sync_master()
code_tokens: def _update_master ( self ) : if self . zk . have_lock ( ) : self . _segs_to_master . clear ( ) return try : curr_master = self . zk . get_lock_holder ( ) except ZkNoConnection : logging . warning ( "_update_master(): ZkNoConnection." ) return if curr_master and curr_master == self . _master_id : return self . _master_id = curr_master if not curr_master : logging . warning ( "_update_master(): current master is None." ) return logging . debug ( "New master is: %s" , self . _master_id ) self . _sync_master ( )
short_docstring: Read master's address from shared lock, and if new master is elected
  sync it with segments.
short_docstring_tokens: Read master ' s address from shared lock and if new master is elected sync it with segments .
comment: """
          Read master's address from shared lock, and if new master is elected
          sync it with segments.
          """