Returns the number of shares for the given security.
        It gets the number from all the accounts in the book.
664
def get_quantity(self) -> Decimal:
        
        from pydatum import Datum
        # Use today's date but reset hour and lower.
        today = Datum()
        today.today()
        today.end_of_day()
        return self.get_num_shares_on(today.value)
327923
def get_account_details(account):
    
    result = []
    for datastore in _get_datastores():
        value = datastore.get_account_details(account)
        value['datastore'] = datastore.config['DESCRIPTION']
        result.append(value)
    return result
579223
def Q_stock(self):
        
        return self._Q_sys * (self._C_sys / self._C_stock).to(u.dimensionless)
1154662
def orderbook_for_stock(self, stock):
        
        url_fragment = 'venues/{venue}/stocks/{stock}'.format(
            venue=self.venue,
            stock=stock,
        )
        url = urljoin(self.base_url, url_fragment)
        return self.session.get(url).json()
274311
def get_share(self, sharename):
        

        response = GettRequest().get("/shares/%s" % sharename)

        if response.http_status == 200:
            return GettShare(self.user, **response.response)
1286885
def generate_simpleaccount(self):
        
        if len(self.portfolio_list.keys()) < 1:
            po = self.new_portfolio()
        else:
            po = list(self.portfolio_list.values())[0]
        ac = po.new_account()
        return ac, po
649958
def transactions(self) -> TransactionsAggregate:
        
        if not self.__transactions_aggregate:
            self.__transactions_aggregate = TransactionsAggregate(self.book)
        return self.__transactions_aggregate
418168
def accounts(self, id=None):
        
        return Account.load(self, id) if id else Account.all(self)
82445
def venue_stocks(self):
        
        url = urljoin(self.base_url, 'venues/{0}/stocks'.format(self.venue))
        return self.session.get(url).json()
1185331
def get_all(self, security):
        
        url = 'http://www.google.com/finance?q=%s' % security
        page = self._request(url)

        soup = BeautifulSoup(page)
        snapData = soup.find("table", {"class": "snap-data"})
        if snapData is None:
            raise UfException(Errors.STOCK_SYMBOL_ERROR, "Can find data for stock %s, security error?" % security)
        data = {}
        for row in snapData.findAll('tr'):
            keyTd, valTd = row.findAll('td')
            data[keyTd.getText()] = valTd.getText()

        return data
469988
def get_for_accounts(self, accounts: List[Account]):
        '''  '''
        account_ids = [acc.guid for acc in accounts]
        query = (
            self.query
            .filter(Split.account_guid.in_(account_ids))
        )
        splits = query.all()
        return splits
816591
def outlays(self):
        
        return pd.DataFrame({x.name: x.outlays for x in self.securities})
1114088
def shares(self, token: dict = None, prot: str = "https") -> dict:
        
        # passing auth parameter
        shares_url = "{}://v1.{}.isogeo.com/shares/".format(prot, self.api_url)
        shares_req = self.get(
            shares_url, headers=self.header, proxies=self.proxies, verify=self.ssl
        )

        # checking response
        checker.check_api_response(shares_req)

        # end of method
        return shares_req.json()
1336724
def get(self, sg_id):
        
        secgroup = self.client.show_security_group(sg_id).get('security_group')
        sg_dict = self._sg_name_dict(sg_id, secgroup['security_group_rules'])
        return SecurityGroup(secgroup, sg_dict)
1162879
def find_unallocated_holdings(self):
        
        # Get linked securities
        session = self.open_session()
        linked_entities = session.query(AssetClassStock).all()
        linked = []
        # linked = map(lambda x: f"{x.symbol}", linked_entities)
        for item in linked_entities:
            linked.append(item.symbol)

        # Get all securities with balance > 0.
        from .stocks import StocksInfo

        stocks = StocksInfo()
        stocks.logger = self.logger
        holdings = stocks.get_symbols_with_positive_balances()

        # Find those which are not included in the stock links.
        non_alloc = []
        index = -1
        for item in holdings:
            try:
                index = linked.index(item)
                self.logger.debug(index)
            except ValueError:
                non_alloc.append(item)

        return non_alloc
1011829
def accounts(self):
        
        if self._accounts is None:
            from twilio.rest.accounts import Accounts
            self._accounts = Accounts(self)
        return self._accounts
464457
def secgroup_list(self):
        '''
        
        '''
        nt_ks = self.compute_conn
        ret = {}
        for item in nt_ks.security_groups.list():
            ret[item.name] = {
                'name': item.name,
                'description': item.description,
                'id': item.id,
                'tenant_id': item.tenant_id,
                'rules': item.rules,
            }
        return ret