rddl_block : rddl_block domain_block
                      | rddl_block instance_block
                      | rddl_block nonfluent_block
                      | empty
498633
def p_rddl_block(self, p):
        ''''''
        if p[1] is None:
            p[0] = dict()
        else:
            name, block = p[2]
            p[1][name] = block
            p[0] = p[1]
119664
def domain_unblock(self, domain=None):
        
        params = self.__generate_params(locals())
        self.__api_request('DELETE', '/api/v1/domain_blocks', params)
67360
def _content_blocks(self, r):
    """"""
    return (self._block_rows - self._left_zero_blocks(r)
            - self._right_zero_blocks(r))
444752
def insertBulkBlock(self):
        
        try:
            body = request.body.read()
            indata = cjson.decode(body)
            if (indata.get("file_parent_list", []) and indata.get("dataset_parent_list", [])): 
                dbsExceptionHandler("dbsException-invalid-input2", "insertBulkBlock: dataset and file parentages cannot be in the input at the same time",  
                    self.logger.exception, "insertBulkBlock: datset and file parentages cannot be in the input at the same time.")    
            indata = validateJSONInputNoCopy("blockBulk", indata)
            self.dbsBlockInsert.putBlock(indata)
        except cjson.DecodeError as dc:
            dbsExceptionHandler("dbsException-invalid-input2", "Wrong format/data from insert BulkBlock input",  self.logger.exception, str(dc))
        except dbsException as de:
            dbsExceptionHandler(de.eCode, de.message, self.logger.exception, de.message)
        except HTTPError as he:
            raise he
        except Exception as ex:
            #illegal variable name/number
            if str(ex).find("ORA-01036") != -1:
                dbsExceptionHandler("dbsException-invalid-input2", "illegal variable name/number from input",  self.logger.exception, str(ex))
            else:
                sError = "DBSWriterModel/insertBulkBlock. %s\n. Exception trace: \n %s" \
                    % (ex, traceback.format_exc())
                dbsExceptionHandler('dbsException-server-error',  dbsExceptionCode['dbsException-server-error'], self.logger.exception, sError)
425697
def get_sched_block_instance_ids(self):
        """"""

        # Initialise empty list
        scheduling_block_ids = []

        # Pattern used to search scheduling block ids
        pattern = 'scheduling_block:*'
        block_ids = self._db.get_ids(pattern)

        for block_id in block_ids:
            if 'processing_block' not in block_id:
                id_split = block_id.split(':')[-1]
                scheduling_block_ids.append(id_split)
        return sorted(scheduling_block_ids)
358764
def block(*, name = None, metric = call_default, count = 1):
    
    t = time.time()
    try:
        yield
    finally:
        metric(name, count, time.time() - t)
609244
def block(self, group=False, custom=False):
        '''
        
        '''
        reader = BlockReader()
        symbol = os.path.join(self.tdxdir, 'block_zs.dat')

        if symbol is not None:
            return reader.get_df(symbol, group)

        return None
831583
private void readBlock(int blockIndex, int startIndex, int blockLength) throws Exception
   {
      logBlock(blockIndex, startIndex, blockLength);

      if (blockLength < 128)
      {
         readTableBlock(startIndex, blockLength);
      }
      else
      {
         readColumnBlock(startIndex, blockLength);
      }
   }
144442
def replay_block(self, block_to_replay, limit=5):
        

        if block_to_replay == 'latest':
            if self.verbose:
                print("Getting latest %s block header" % source.upper())
            block = get_block(self.source, latest=True, verbose=self.verbose)
            if self.verbose:
                print("Latest %s block is #%s" % (self.source.upper(), block['block_number']))
        else:
            blocknum = block_to_replay if type(block_to_replay) == int else block_to_replay['block_number']
            if blocknum < self.parent_fork_block or blocknum < self.child_fork_block:
                raise Exception("Can't replay blocks mined before the fork")

        if type(block_to_replay) is not dict:
            if self.verbose:
                print("Getting %s block header #%s" % (self.source.upper(), block_to_replay))
            block = get_block(self.source, block_number=int(block_to_replay), verbose=self.verbose)
        else:
            block = block_to_replay

        if self.verbose:
            print("Using %s for pushing to %s" % (self.pusher.name, self.destination.upper()))
            print("Using %s for getting %s transactions" % (self.tx_fetcher.name, self.source.upper()))
            print("Finished getting block header,", len(block['txids']), "transactions in block, will replay", (limit or "all of them"))

        results = []
        enforced_limit = (limit or len(block['txids']))

        for i, txid in enumerate(block['txids'][:enforced_limit]):
            print("outside", txid)
            self._replay_tx(txid, i)
803837
def _lookup_dig(name, rdtype, timeout=None, servers=None, secure=None):
    '''
    
    '''
    cmd = 'dig {0} -t {1} '.format(DIG_OPTIONS, rdtype)
    if servers:
        cmd += ''.join(['@{0} '.format(srv) for srv in servers])
    if timeout is not None:
        if servers:
            timeout = int(float(timeout) / len(servers))
        else:
            timeout = int(timeout)
        cmd += '+time={0} '.format(timeout)
    if secure:
        cmd += '+dnssec +adflag '

    cmd = __salt__['cmd.run_all']('{0} {1}'.format(cmd, name), python_shell=False, output_loglevel='quiet')

    if 'ignoring invalid type' in cmd['stderr']:
        raise ValueError('Invalid DNS type {}'.format(rdtype))
    elif cmd['retcode'] != 0:
        log.warning(
            'dig returned (%s): %s',
            cmd['retcode'], cmd['stderr'].strip(string.whitespace + ';')
        )
        return False
    elif not cmd['stdout']:
        return []

    validated = False
    res = []
    for line in cmd['stdout'].splitlines():
        _, rtype, rdata = line.split(None, 2)
        if rtype == 'CNAME' and rdtype != 'CNAME':
            continue
        elif rtype == 'RRSIG':
            validated = True
            continue
        res.append(_data_clean(rdata))

    if res and secure and not validated:
        return False
    else:
        return res
631376
def p_namedblock(self, p):
        ''
        p[0] = Block(p[4], p[3], lineno=p.lineno(1))
        p.set_lineno(0, p.lineno(1))
454202
private Alias searchForAliasInBlock(final ControlFlowBlock block) {
        checkNotNull(block);
        Alias result = Alias.newInstance(false, Integer.MIN_VALUE);
        if (alreadyVisited.contains(block)) {
            return result;
        }
        alreadyVisited.add(block);
        final List<AbstractInsnNode> insns = block.getBlockInstructions();
        final int indexOfGetfield = findIndexOfGetfieldForVariable(insns);
        if (indexOfGetfieldFound(indexOfGetfield)) {
            final AbstractInsnNode successorInsnOfGetfieldForVariable = insns.get(indexOfGetfield + 1);
            if (isStoreInstruction(successorInsnOfGetfieldForVariable)) {
                final VarInsnNode storeInstruction = (VarInsnNode) successorInsnOfGetfieldForVariable;
                result = Alias.newInstance(true, storeInstruction.var);
            }
        }
        if (!result.doesExist) {
            for (final ControlFlowBlock predecessor : block.getPredecessors()) {
                return searchForAliasInBlock(predecessor);
            }
        }
        return result;
    }
1220347
def mine_blocks(num_blocks: int, chain: MiningChain) -> MiningChain:
    
    if not isinstance(chain, MiningChain):
        raise ValidationError('`mine_block` may only be used on MiningChain instances')
    for _ in range(num_blocks):
        chain.mine_block()
    return chain
132954
def _empty_resource_attributes(self):

		'''
		
		'''

		self.status_code = 404
		self.headers = {}
		self.exists = False

		# build RDF
		self.rdf = self._build_rdf()

		# if NonRDF, empty binary data
		if type(self) == NonRDFSource:
			self.binary.empty()
620032
def copy_raw_block(self):
        '''
        
        '''
        ctable = []
        r, c = 0, 0
        try:
            for row_index in range(self.start[0], self.end[0]):
                r = row_index
                row = []
                ctable.append(row)
                for column_index in range(self.start[1], self.end[1]):
                    c = column_index
                    row.append(self.table[row_index][column_index])
        except IndexError:
            raise InvalidBlockError('Missing table element at [%d, %d]' % (r, c))
        return ctable
1330861
private Block getBlock(QueryConditonDatakey qcdk) {
		Block clientBlock = new Block(qcdk.getStart(), qcdk.getCount());
		if (clientBlock.getCount() > this.blockLength)
			clientBlock.setCount(this.blockLength);

		// create dataBlock get DataBase or cache;
		List list = getBlockKeys(qcdk);
		Block dataBlock = new Block(qcdk.getBlockStart(), list.size());

		int currentStart = clientBlock.getStart() - dataBlock.getStart();
		Block currentBlock = new Block(currentStart, clientBlock.getCount());
		currentBlock.setList(list);

		try {
			// because clientBlock's length maybe not be equals to the
			// dataBlock's length
			// we need the last length:
			// 1.the last block length is great than the clientBlock's
			// length，the current block's length is the clientBlock's length
			// 2.the last block length is less than the clientBlock's
			// length，under this condition, there are two choice.
			int lastCount = dataBlock.getCount() + dataBlock.getStart() - clientBlock.getStart();
			Debug.logVerbose("[JdonFramework] lastCount=" + lastCount, module);
			// 2 happened
			if (lastCount < clientBlock.getCount()) {
				// if 2 , two case：
				// 1. if the dataBlock's length is this.blockLength(200)，should
				// have more dataBlocks.
				if (dataBlock.getCount() == this.blockLength) {
					// new datablock, we must support new start and new count
					// the new start = old datablock's length + old datablock's
					// start.
					int newStartIndex = dataBlock.getStart() + dataBlock.getCount();
					int newCount = clientBlock.getCount() - lastCount;
					qcdk.setStart(newStartIndex);
					qcdk.setCount(newCount);
					Debug.logVerbose("[JdonFramework]  newStartIndex=" + newStartIndex + " newCount=" + newCount, module);
					Block nextBlock = getBlock(qcdk);
					Debug.logVerbose("[JdonFramework]  nextBlock.getCount()=" + nextBlock.getCount(), module);
					currentBlock.setCount(currentBlock.getCount() + nextBlock.getCount());
				} else {
					// 2. if not, all datas just be here, clientBlock's count
					// value maybe not correct.
					currentBlock.setCount(lastCount);
				}
			}
		} catch (Exception e) {
			Debug.logError(" getBlock error" + e, module);
		}
		return currentBlock;
	}
774137
static public int getBlockCrc(DataNode datanode, ReplicaToRead ri,
      int namespaceId, Block block) throws IOException {
    InputStream rawStreamIn = null;
    DataInputStream streamIn = null;
    try {
      int bytesPerCRC;
      int checksumSize;

      long crcPerBlock;

      rawStreamIn = BlockWithChecksumFileReader.getMetaDataInputStream(
          datanode.data, namespaceId, block);
      streamIn = new DataInputStream(new BufferedInputStream(rawStreamIn,
          FSConstants.BUFFER_SIZE));

      final BlockMetadataHeader header = BlockMetadataHeader
          .readHeader(streamIn);
      final DataChecksum checksum = header.getChecksum();
      if (checksum.getChecksumType() != DataChecksum.CHECKSUM_CRC32) {
        throw new IOException("File Checksum now is only supported for CRC32");
      }

      bytesPerCRC = checksum.getBytesPerChecksum();
      checksumSize = checksum.getChecksumSize();
      crcPerBlock = (((BlockWithChecksumFileReader.MetaDataInputStream) rawStreamIn)
          .getLength() - BlockMetadataHeader.getHeaderSize()) / checksumSize;

      int blockCrc = 0;
      byte[] buffer = new byte[checksumSize];
      for (int i = 0; i < crcPerBlock; i++) {
        IOUtils.readFully(streamIn, buffer, 0, buffer.length);
        int intChecksum = ((buffer[0] & 0xff) << 24)
            | ((buffer[1] & 0xff) << 16) | ((buffer[2] & 0xff) << 8)
            | ((buffer[3] & 0xff));

        if (i == 0) {
          blockCrc = intChecksum;
        } else {
          int chunkLength;
          if (i != crcPerBlock - 1 || ri.getBytesVisible() % bytesPerCRC == 0) {
            chunkLength = bytesPerCRC;
          } else {
            chunkLength = (int) ri.getBytesVisible() % bytesPerCRC;
          }
          blockCrc = CrcConcat.concatCrc(blockCrc, intChecksum, chunkLength);
        }
      }
      return blockCrc;
    } finally {
      if (streamIn != null) {
        IOUtils.closeStream(streamIn);
      }
      if (rawStreamIn != null) {
        IOUtils.closeStream(rawStreamIn);
      }
    }
  }