code: def sector_select(self, sector):
          
          if sector != self._current_sector:
              log.debug("select sector {0} (pages {1} to {2})".format(
                  sector, sector << 10, ((sector+1) << 8) - 1))
  
              sector_select_1 = b'\xC2\xFF'
              sector_select_2 = pack('Bxxx', sector)
  
              rsp = self.transceive(sector_select_1)
              if len(rsp) == 1 and rsp[0] == 0x0A:
                  try:
                      # command is passively ack'd, i.e. there's no response
                      # and we must make sure there's no retries attempted
                      self.transceive(sector_select_2, timeout=0.001, retries=0)
                  except Type2TagCommandError as error:
                      assert int(error) == TIMEOUT_ERROR  # passive ack
                  else:
                      log.debug("sector {0} does not exist".format(sector))
                      raise Type2TagCommandError(INVALID_SECTOR_ERROR)
              else:
                  log.debug("sector select is not supported for this tag")
                  raise Type2TagCommandError(INVALID_SECTOR_ERROR)
  
              log.debug("sector {0} is now selected".format(sector))
              self._current_sector = sector
          return self._current_sector
docs: Send a SECTOR_SELECT command to switch the 1K address sector.
  
          The command is only send to the tag if the *sector* number is
          different from the currently selected sector number (set to 0
          when the tag instance is created). If the command was
          successful, the currently selected sector number is updated
          and further :meth:`read` and :meth:`write` commands will be
          relative to that sector.
  
          Command execution errors raise :exc:`Type2TagCommandError`.