Returns True if the channel is opened and the node has deposit in it.
510674
def can_transfer(self, block_identifier: BlockSpecification) -> bool:
        
        return self.token_network.can_transfer(
            participant1=self.participant1,
            participant2=self.participant2,
            block_identifier=block_identifier,
            channel_identifier=self.channel_identifier,
        )
1080678
private boolean isDangling(Node node)
	{
		if (!result.contains(node)) return false;
		if (ST.contains(node)) return false;

		boolean hasIncoming = false;

		for (Edge edge : node.getUpstream())
		{
			if (result.contains(edge))
			{
				hasIncoming = true;
				break;
			}
		}

		boolean hasOutgoing = false;

		for (Edge edge : node.getDownstream())
		{
			if (result.contains(edge))
			{
				hasOutgoing = true;
				break;
			}
		}

		if (hasIncoming && hasOutgoing) return false;

		boolean hasParent = false;

		for (Node parent : node.getUpperEquivalent())
		{
			if (result.contains(parent))
			{
				hasParent = true;
				break;
			}
		}

		if (hasParent && (hasIncoming || hasOutgoing)) return false;

		boolean hasChild = false;

		for (Node child : node.getLowerEquivalent())
		{
			if (result.contains(child))
			{
				hasChild = true;
				break;
			}
		}

		return !(hasChild && (hasIncoming || hasOutgoing || hasParent));
	}
273587
def is_open(location, now=None):
    
    if now is None:
        now = get_now()

    if has_closing_rule_for_now(location):
        return False

    now_time = datetime.time(now.hour, now.minute, now.second)

    if location:
        ohs = OpeningHours.objects.filter(company=location)
    else:
        ohs = Company.objects.first().openinghours_set.all()
    for oh in ohs:
        is_open = False
        # start and end is on the same day
        if (oh.weekday == now.isoweekday() and
                oh.from_hour <= now_time and
                now_time <= oh.to_hour):
            is_open = oh

        # start and end are not on the same day and we test on the start day
        if (oh.weekday == now.isoweekday() and
                oh.from_hour <= now_time and
                ((oh.to_hour < oh.from_hour) and
                    (now_time < datetime.time(23, 59, 59)))):
            is_open = oh

        # start and end are not on the same day and we test on the end day
        if (oh.weekday == (now.isoweekday() - 1) % 7 and
                oh.from_hour >= now_time and
                oh.to_hour >= now_time and
                oh.to_hour < oh.from_hour):
            is_open = oh
            # print " 'Special' case after midnight", oh

        if is_open is not False:
            return oh
    return False
190773
final void logicalOpen() {
      openTime = Clock.currTimeMillis;
      transactionState = TransactionState.NONE;
      if(debug) {
         lastTrace = Util.getFilteredStack();
      }
   }
432129
private boolean isClientChannelClosed(Throwable cause) {
        if (cause instanceof ClosedChannelException ||
                cause instanceof Errors.NativeIoException) {
            LOG.error("ZuulFilterChainHandler::isClientChannelClosed - IO Exception");
            return true;
        }
        return false;
    }
1231988
def channel_open(
            self,
            registry_address: PaymentNetworkID,
            token_address: TokenAddress,
            partner_address: Address,
            settle_timeout: BlockTimeout = None,
            retry_timeout: NetworkTimeout = DEFAULT_RETRY_TIMEOUT,
    ) -> ChannelID:
        
        if settle_timeout is None:
            settle_timeout = self.raiden.config['settle_timeout']

        if settle_timeout < self.raiden.config['reveal_timeout'] * 2:
            raise InvalidSettleTimeout(
                'settle_timeout can not be smaller than double the reveal_timeout',
            )

        if not is_binary_address(registry_address):
            raise InvalidAddress('Expected binary address format for registry in channel open')

        if not is_binary_address(token_address):
            raise InvalidAddress('Expected binary address format for token in channel open')

        if not is_binary_address(partner_address):
            raise InvalidAddress('Expected binary address format for partner in channel open')

        chain_state = views.state_from_raiden(self.raiden)
        channel_state = views.get_channelstate_for(
            chain_state=chain_state,
            payment_network_id=registry_address,
            token_address=token_address,
            partner_address=partner_address,
        )

        if channel_state:
            raise DuplicatedChannelError('Channel with given partner address already exists')

        registry = self.raiden.chain.token_network_registry(registry_address)
        token_network_address = registry.get_token_network(token_address)

        if token_network_address is None:
            raise TokenNotRegistered(
                'Token network for token %s does not exist' % to_checksum_address(token_address),
            )

        token_network = self.raiden.chain.token_network(
            registry.get_token_network(token_address),
        )

        with self.raiden.gas_reserve_lock:
            has_enough_reserve, estimated_required_reserve = has_enough_gas_reserve(
                self.raiden,
                channels_to_open=1,
            )

            if not has_enough_reserve:
                raise InsufficientGasReserve((
                    'The account balance is below the estimated amount necessary to '
                    'finish the lifecycles of all active channels. A balance of at '
                    f'least {estimated_required_reserve} wei is required.'
                ))

            try:
                token_network.new_netting_channel(
                    partner=partner_address,
                    settle_timeout=settle_timeout,
                    given_block_identifier=views.state_from_raiden(self.raiden).block_hash,
                )
            except DuplicatedChannelError:
                log.info('partner opened channel first')

        waiting.wait_for_newchannel(
            raiden=self.raiden,
            payment_network_id=registry_address,
            token_address=token_address,
            partner_address=partner_address,
            retry_timeout=retry_timeout,
        )
        chain_state = views.state_from_raiden(self.raiden)
        channel_state = views.get_channelstate_for(
            chain_state=chain_state,
            payment_network_id=registry_address,
            token_address=token_address,
            partner_address=partner_address,
        )

        assert channel_state, f'channel {channel_state} is gone'

        return channel_state.identifier
910898
protected boolean isItemAccepted(byte[] key) {
        boolean entryAccepted = false;
        if (!fetchOrphaned) {
            if (isKeyNeeded(key)) {
                entryAccepted = true;
            }
        } else {
            if (!StoreRoutingPlan.checkKeyBelongsToNode(key, nodeId, initialCluster, storeDef)) {
                entryAccepted = true;
            }
        }
        return entryAccepted;
    }
339979
def is_running(self):
        
        for node in self._nodes.values():
            # Some node type are always running we ignore them
            if node.status != "stopped" and not node.is_always_running():
                return True
        return False
538525
def is_running(self, is_stopped):
        '''  '''
        if is_stopped and self.is_stopped():
            return False

        return faspmanager2.isRunning(self.get_transfer_id())
1013288
public static boolean isSentToCltvPaymentChannel(Script script) {
        List<ScriptChunk> chunks = script.chunks;
        if (chunks.size() != 10) return false;
        // Check that opcodes match the pre-determined format.
        if (!chunks.get(0).equalsOpCode(OP_IF)) return false;
        // chunk[1] = recipient pubkey
        if (!chunks.get(2).equalsOpCode(OP_CHECKSIGVERIFY)) return false;
        if (!chunks.get(3).equalsOpCode(OP_ELSE)) return false;
        // chunk[4] = locktime
        if (!chunks.get(5).equalsOpCode(OP_CHECKLOCKTIMEVERIFY)) return false;
        if (!chunks.get(6).equalsOpCode(OP_DROP)) return false;
        if (!chunks.get(7).equalsOpCode(OP_ENDIF)) return false;
        // chunk[8] = sender pubkey
        if (!chunks.get(9).equalsOpCode(OP_CHECKSIG)) return false;
        return true;
    }
447757
def channel_is_opened(
            self,
            participant1: Address,
            participant2: Address,
            block_identifier: BlockSpecification,
            channel_identifier: ChannelID,
    ) -> bool:
        
        try:
            channel_state = self._get_channel_state(
                participant1=participant1,
                participant2=participant2,
                block_identifier=block_identifier,
                channel_identifier=channel_identifier,
            )
        except RaidenRecoverableError:
            return False
        return channel_state == ChannelState.OPENED
986397
def check(self):
        """"""
        if not self.date:
            raise XnDataError("Missing date")
        if not self.desc:
            raise XnDataError("Missing description")
        if not self.dst:
            raise XnDataError("No destination accounts")
        if not self.src:
            raise XnDataError("No source accounts")
        if not self.amount:
            raise XnDataError("No transaction amount")
1207132
def lock_exists_in_either_channel_side(
        channel_state: NettingChannelState,
        secrethash: SecretHash,
) -> bool:
    """"""
    lock = get_lock(channel_state.our_state, secrethash)
    if not lock:
        lock = get_lock(channel_state.partner_state, secrethash)
    return lock is not None
1164764
def channel_is_closed(
            self,
            participant1: Address,
            participant2: Address,
            block_identifier: BlockSpecification,
            channel_identifier: ChannelID,
    ) -> bool:
        
        try:
            channel_state = self._get_channel_state(
                participant1=participant1,
                participant2=participant2,
                block_identifier=block_identifier,
                channel_identifier=channel_identifier,
            )
        except RaidenRecoverableError:
            return False
        return channel_state == ChannelState.CLOSED
314330
public function markPending(): bool
    {
        $this->owner->{$this->statusAttribute} = Status::PENDING;

        if ($this->beforeModeration()) {
            return $this->owner->save();
        }

        return false;
    }
280199
def guard_rollback_to_open(worksheet):
    
    for analysis in worksheet.getAnalyses():
        if api.get_review_status(analysis) in ["assigned"]:
            return True
    return False
192312
public boolean isWatched(TransactionBag transactionBag) {
        try {
            Script script = getScriptPubKey();
            return transactionBag.isWatchedScript(script);
        } catch (ScriptException e) {
            // Just means we didn't understand the output of this transaction: ignore it.
            log.debug("Could not parse tx output script: {}", e.toString());
            return false;
        }
    }