Flag indicating if the asset has a balance.

        Args:
            assetId (UInt256):

        Returns:
            bool: True if a balance is present. False otherwise.
3088
def HasBalance(self, assetId):
        
        for key, fixed8 in self.Balances.items():
            if key == assetId:
                return True
        return False
90116
def valid?
      return false if @id.nil?
      return false if @name.nil?
      return false if @type.nil?
      type_validator = EnumAttributeValidator.new('String', ['checking', 'savings', 'cash', 'creditCard', 'lineOfCredit', 'otherAsset', 'otherLiability', 'payPal', 'merchantAccount', 'investmentAccount', 'mortgage'])
      return false unless type_validator.valid?(@type)
      return false if @on_budget.nil?
      return false if @closed.nil?
      return false if @note.nil?
      return false if @balance.nil?
      return false if @cleared_balance.nil?
      return false if @uncleared_balance.nil?
      return false if @transfer_payee_id.nil?
      return false if @deleted.nil?
      true
    end
521350
def _calculate_order_value_amount(self, asset, value):
        
        # Make sure the asset exists, and that there is a last price for it.
        # FIXME: we should use BarData's can_trade logic here, but I haven't
        # yet found a good way to do that.
        normalized_date = normalize_date(self.datetime)

        if normalized_date < asset.start_date:
            raise CannotOrderDelistedAsset(
                msg="Cannot order {0}, as it started trading on"
                    " {1}.".format(asset.symbol, asset.start_date)
            )
        elif normalized_date > asset.end_date:
            raise CannotOrderDelistedAsset(
                msg="Cannot order {0}, as it stopped trading on"
                    " {1}.".format(asset.symbol, asset.end_date)
            )
        else:
            last_price = \
                self.trading_client.current_data.current(asset, "price")

            if np.isnan(last_price):
                raise CannotOrderDelistedAsset(
                    msg="Cannot order {0} on {1} as there is no last "
                        "price for the security.".format(asset.symbol,
                                                         self.datetime)
                )

        if tolerant_equals(last_price, 0):
            zero_message = "Price of 0 for {psid}; can't infer value".format(
                psid=asset
            )
            if self.logger:
                self.logger.debug(zero_message)
            # Don't place any order
            return 0

        value_multiplier = asset.price_multiplier

        return value / (last_price * value_multiplier)
527659
def containsID(self, idVal):
        
        for i in self:
            if i.id == idVal:
                return True
        return False
1131705
def is_flagged(self, user=None, status=None):
        
        filter_kwargs = {
            'content_type': ContentType.objects.get_for_model(self),
            'object_id': self.id,
        }
        update_filter_dict(filter_kwargs, user, status)
        return self.flags.filter(**filter_kwargs).count()
476014
def get_balance(self, address, block="latest"):
        
        response = self.make_request("eth_getBalance", [address, block])
        return int(response['result'], 16)
919944
def _can_refresh_check(self, check_id):
        
        try:
            refresh_status = \
                self.conn.describe_trusted_advisor_check_refresh_statuses(
                    checkIds=[check_id]
                )
            logger.debug("TA Check %s refresh status: %s", check_id,
                         refresh_status['statuses'][0])
            ms = refresh_status['statuses'][0]['millisUntilNextRefreshable']
            if ms > 0:
                logger.warning("Trusted Advisor check cannot be refreshed for "
                               "another %d milliseconds; skipping refresh and "
                               "getting check results now", ms)
                return False
            return True
        except Exception:
            logger.warning("Could not get refresh status for TA check %s",
                           check_id, exc_info=True)
        # default to True if we don't know...
        return True
973472
function addAssetQuantity (commandOptions, { assetId, amount }) {
  return command(
    commandOptions,
    txHelper.addCommand(
      txHelper.emptyTransaction(),
      'addAssetQuantity',
      {
        assetId,
        amount
      }
    )
  )
}
41517
def asset(self, asset_id, asset_type, action='GET'):
        
        if not self.can_update():
            self._tcex.handle_error(910, [self.type])

        if asset_type == 'PHONE':
            return self.tc_requests.adversary_phone_asset(
                self.api_type, self.api_sub_type, self.unique_id, asset_id, action=action
            )
        if asset_type == 'HANDLER':
            return self.tc_requests.adversary_handle_asset(
                self.api_type, self.api_sub_type, self.unique_id, asset_id, action=action
            )
        if asset_type == 'URL':
            return self.tc_requests.adversary_url_asset(
                self.api_type, self.api_sub_type, self.unique_id, asset_id, action=action
            )
        self._tcex.handle_error(
            925, ['asset_type', 'assets', 'asset_type', 'asset_type', asset_type]
        )
        return None
267197
def _check_state(self):
        
        if self._transaction_id is None:
            raise ValueError("Transaction is not begun")

        if self.committed is not None:
            raise ValueError("Transaction is already committed")

        if self._rolled_back:
            raise ValueError("Transaction is already rolled back")
181727
private boolean isAddToLoadBalancerSuspended(AutoScalingGroup asg) {
        List<SuspendedProcess> suspendedProcesses = asg.getSuspendedProcesses();
        for (SuspendedProcess process : suspendedProcesses) {
            if (PROP_ADD_TO_LOAD_BALANCER.equals(process.getProcessName())) {
                return true;
            }
        }
        return false;
    }
577823
def asset_exists?(asset_type, asset_path)
      File.exists?(Merb.root / asset_path(asset_type, asset_path, true))
    end
1279345
@SuppressWarnings("unchecked")
  public Query linksToAssetId(String assetId) {
    checkNotEmpty(assetId, "assetId must not be empty.");

    params.put(PARAMETER_LINKS_TO_ASSET, assetId);

    return (Query) this;
  }
221841
def should_add_tenant_theme_to_asset?(asset)
      if asset.is_a? String
        return true if (! asset.match /^http:\/\//) && (! asset.match /^\//)
      end
      false
    end
197163
def effective_balance(self, address: Address, block_identifier: BlockSpecification) -> Balance:
        
        fn = getattr(self.proxy.contract.functions, 'effectiveBalance')
        balance = fn(address).call(block_identifier=block_identifier)

        if balance == b'':
            raise RuntimeError(f"Call to 'effectiveBalance' returned nothing")

        return balance
587494
def get_symbols_with_positive_balances(self) -> List[str]:
        
        from gnucash_portfolio import BookAggregate

        holdings = []

        with BookAggregate() as book:
            # query = book.securities.query.filter(Commodity.)
            holding_entities = book.securities.get_all()
            for item in holding_entities:
                # Check holding balance
                agg = book.securities.get_aggregate(item)
                balance = agg.get_num_shares()
                if balance > Decimal(0):
                    holdings.append(f"{item.namespace}:{item.mnemonic}")
                else:
                    self.logger.debug(f"0 balance for {item}")
            # holdings = map(lambda x: , holding_entities)

        return holdings
801794
def get_balance(self, acc_id, site='Pro'):
        
        assert site in ['Pro', 'HADAX']
        path = f'/v1{"/" if site == "Pro" else "/hadax/"}account/accounts/{acc_id}/balance'
        # params = {'account-id': self.acct_id}
        params = {}

        def _wrapper(_func):
            @wraps(_func)
            def handle():
                _func(api_key_get(params, path))

            return handle

        return _wrapper