Prepare sentinel directory for revocation registry construction.

        :param rr_id: revocation registry identifier
        :rr_size: size of revocation registry to build
320295
def mark_in_progress(self, rr_id: str, rr_size: int) -> None:
        
        try:
            makedirs(join(self._dir_tails_sentinel, rr_id), exist_ok=False)
        except FileExistsError:
            LOGGER.warning('Rev reg %s construction already in progress', rr_id)
        else:
            open(join(self._dir_tails_sentinel, rr_id, '.{}'.format(rr_size)), 'w').close()
1002937
async def _set_rev_reg(self, rr_id: str, rr_size: int) -> None:
        

        LOGGER.debug('Issuer._set_rev_reg >>> rr_id: %s, rr_size: %s', rr_id, rr_size)
        assert self.rrbx

        dir_hopper_rr_id = join(self.rrb.dir_tails_hopper, rr_id)

        while Tails.linked(dir_hopper_rr_id, rr_id) is None:
            await asyncio.sleep(1)
        await self._send_rev_reg_def(rr_id)

        cd_id = rev_reg_id2cred_def_id(rr_id)
        (next_tag, rr_size_suggested) = Tails.next_tag(self.dir_tails, cd_id)
        rr_id = rev_reg_id(cd_id, next_tag)
        self.rrb.mark_in_progress(rr_id, rr_size or rr_size_suggested)

        LOGGER.debug('Issuer._set_rev_reg <<<')
94575
def location_id(self, location_id):
        

        if location_id is None:
            raise ValueError("Invalid value for `location_id`, must not be `None`")
        if len(location_id) < 1:
            raise ValueError("Invalid value for `location_id`, length must be greater than or equal to `1`")

        self._location_id = location_id
1325070
function createDir(dir) {
  return new RSVP.Promise(function(resolve, reject) {
    // Delete the temporary compiled docs directory.
    mkdirp(dir, function (err) {
      if (err) {
        reject(err);
      } else {
        console.log('Created directory ' + dir);
        resolve();
      }
    });
  });
}
954322
def rrc(self, r):
        
        if not is_number(self.regs[r]):
            self.set(r, None)
            self.set_flag(None)
            return

        v_ = self.getv(self.regs[r]) & 0xFF
        self.regs[r] = str((v_ >> 1) | ((v_ & 1) << 7))
1303576
def set_metric_ids(self, key, metric_ids):
        
        with self._lock:
            self._metric_ids[key] = metric_ids
508659
def rrmdir(directory):
    
    for root, dirs, files in os.walk(directory, topdown=False):
        for name in files:
            os.remove(os.path.join(root, name))
        for name in dirs:
            os.rmdir(os.path.join(root, name))
    os.rmdir(directory)
575331
def publish_retry_length(self, redis_client, port, db):
        
        retry_length = redis_client.zcard('retry')
        self.__publish(port, db, 'retry', retry_length)
687420
def calculate_size(transaction_id, thread_id):
    
    data_size = 0
    data_size += calculate_size_str(transaction_id)
    data_size += LONG_SIZE_IN_BYTES
    return data_size
1248855
def create(self, rs_params):
        
        repl_id = rs_params.get('id', None)
        if repl_id is not None and repl_id in self:
            raise ReplicaSetError(
                "replica set with id={id} already exists".format(id=repl_id))
        repl = ReplicaSet(rs_params)
        self[repl.repl_id] = repl
        return repl.repl_id
1360275
def _ensure_valid_record_size(self, size):
        """"""
        if size > self.config['max_request_size']:
            raise Errors.MessageSizeTooLargeError(
                "The message is %d bytes when serialized which is larger than"
                " the maximum request size you have configured with the"
                " max_request_size configuration" % (size,))
        if size > self.config['buffer_memory']:
            raise Errors.MessageSizeTooLargeError(
                "The message is %d bytes when serialized which is larger than"
                " the total memory buffer you have configured with the"
                " buffer_memory configuration." % (size,))
1325147
def search_disk_size(self, search_index):
        
        ddoc_search_disk_size = self.r_session.get(
            '/'.join([self.document_url, '_search_disk_size', search_index]))
        ddoc_search_disk_size.raise_for_status()
        return response_to_json_dict(ddoc_search_disk_size)
1106087
def calculate_size(uuid, partition_id, interrupt):
    
    data_size = 0
    data_size += calculate_size_str(uuid)
    data_size += INT_SIZE_IN_BYTES
    data_size += BOOLEAN_SIZE_IN_BYTES
    return data_size
1157758
int initialize(int nextAvailableRegister) {
        this.reg = nextAvailableRegister;
        this.spec = RegisterSpec.make(nextAvailableRegister, type.ropType);
        return size();
    }
787926
def dir_tails(self, rr_id: str) -> str:
        

        return Tails.dir(self._dir_tails, rr_id)
29396
function rndid(len) {
  len = len || 8;
  const id = rndm(len);

  if (document.getElementById(id)) {
    return rndid(len);
  }

  return id;
}
1291360
def create_rbd_image(service, pool, image, sizemb):
    """"""
    cmd = ['rbd', 'create', image, '--size', str(sizemb), '--id', service,
           '--pool', pool]
    check_call(cmd)