Retrieves divident history
1464
def get_dividendhistory(self, symbol, startDate, endDate, items=None):
        
        startDate, endDate = self.__get_time_range(startDate, endDate)
        response = self.select('yahoo.finance.dividendhistory', items).where(['symbol', '=', symbol], ['startDate', '=', startDate], ['endDate', '=', endDate])
        return response
435443
def returnLendingHistory(self, start=0, end=2**32-1, limit=None):
        
        return self._private('returnLendingHistory', start=start, end=end,
                             limit=limit)
832780
def get_total_paid_for_remaining_stock(self) -> Decimal:
        
        paid = Decimal(0)

        accounts = self.get_holding_accounts()
        for acc in accounts:
            splits = self.get_available_splits_for_account(acc)
            paid += sum(split.value for split in splits)
        return paid
229601
@Override
  public UserTrades getTradeHistory(TradeHistoryParams params) throws IOException {
    Long limit = null;
    CurrencyPair currencyPair = null;
    Long offset = null;
    TradeHistoryParamsSorted.Order sort = null;
    Long sinceTimestamp = null;
    if (params instanceof TradeHistoryParamPaging) {
      limit = Long.valueOf(((TradeHistoryParamPaging) params).getPageLength());
    }
    if (params instanceof TradeHistoryParamCurrencyPair) {
      currencyPair = ((TradeHistoryParamCurrencyPair) params).getCurrencyPair();
    }
    if (params instanceof TradeHistoryParamOffset) {
      offset = ((TradeHistoryParamOffset) params).getOffset();
    }
    if (params instanceof TradeHistoryParamsSorted) {
      sort = ((TradeHistoryParamsSorted) params).getOrder();
    }
    if (params instanceof TradeHistoryParamsTimeSpan) {
      sinceTimestamp =
          DateUtils.toUnixTimeNullSafe(((TradeHistoryParamsTimeSpan) params).getStartTime());
    }
    BitstampUserTransaction[] txs =
        getBitstampUserTransactions(
            limit, currencyPair, offset, sort == null ? null : sort.toString(), sinceTimestamp);
    return BitstampAdapters.adaptTradeHistory(txs);
  }
708462
def _get_history_next(self):
        
        if self._has_history:
            ret = self._input_history.return_history(1)
            self.string = ret
            self._curs_pos = len(ret)
1014954
@Override
  public UserTrades getTradeHistory(TradeHistoryParams params) throws IOException {

    CoinsuperTradeHistoryParams coinsuperTradeHistoryParams = (CoinsuperTradeHistoryParams) params;
    Map<String, String> parameters = new HashMap<String, String>();
    parameters.put("orderNoList", coinsuperTradeHistoryParams.getOrderNoList());

    CoinsuperResponse<List<OrderDetail>> orderDetails = orderDetails(parameters);
    // System.out.println(data);

    // CoinsuperUserTransaction[] coinsuperUserTransaction = null;

    return CoinsuperAdapters.adaptTradeHistory(orderDetails);
  }
20619
def get_historical_accounts():
    """"""
    if os.environ.get('SWAG_BUCKET', False):
        swag_opts = {
            'swag.type': 's3',
            'swag.bucket_name': os.environ['SWAG_BUCKET'],
            'swag.data_file': os.environ.get('SWAG_DATA_FILE', 'accounts.json'),
            'swag.region': os.environ.get('SWAG_REGION', 'us-east-1')
        }
        swag = SWAGManager(**parse_swag_config_options(swag_opts))
        search_filter = f"[?provider=='aws' && owner=='{os.environ['SWAG_OWNER']}' && account_status!='deleted'"

        if parse_boolean(os.environ.get('TEST_ACCOUNTS_ONLY')):
            search_filter += " && environment=='test'"

        search_filter += ']'

        accounts = swag.get_service_enabled('historical', search_filter=search_filter)
    else:
        accounts = [{'id': account_id} for account_id in os.environ['ENABLED_ACCOUNTS'].split(',')]

    return accounts
5626
def get_shell_history():
    
    # try for ipython
    if 'get_ipython' in globals():
        a = list(get_ipython().history_manager.input_hist_raw)
        a.reverse()
        return a

    elif 'SPYDER_SHELL_ID' in _os.environ:
        try:
            p = _os.path.join(_settings.path_user, ".spyder2", "history.py")
            a = read_lines(p)
            a.reverse()
            return a
        except:
            pass

    # otherwise try pyshell or pycrust (requires wx)
    else:
        try:
            import wx
            for x in wx.GetTopLevelWindows():
                if type(x) in [wx.py.shell.ShellFrame, wx.py.crust.CrustFrame]:
                    a = x.shell.GetText().split(">>>")
                    a.reverse()
                    return a
        except:
            pass

    return ['shell history not available']
642513
@Override
  public UserTrades getTradeHistory(TradeHistoryParams p) throws IOException {
    try {
      if (p instanceof CoingiTradeHistoryParams) {
        CoingiTradeHistoryParams params = (CoingiTradeHistoryParams) p;

        CoingiGetOrderHistoryRequest request = new CoingiGetOrderHistoryRequest();

        if (params.getCurrencyPair() != null) request.setCurrencyPair(params.getCurrencyPair());

        request.setPageNumber(params.getPageNumber());
        request.setPageSize(params.getPageSize());

        if (params.getStatus() != null) request.setStatus(params.getStatus());

        if (params.getType() != null) request.setType(params.getType());

        CoingiOrdersList orderList = getCoingiOrderHistory(request);
        return CoingiAdapters.adaptTradeHistory(orderList);
      }

      return null;
    } catch (CoingiException e) {
      throw CoingiErrorAdapter.adapt(e);
    }
  }
395995
def get_transactions(self, include_investment=False):
        """"""
        assert_pd()
        s = StringIO(self.get_transactions_csv(
            include_investment=include_investment))
        s.seek(0)
        df = pd.read_csv(s, parse_dates=['Date'])
        df.columns = [c.lower().replace(' ', '_') for c in df.columns]
        df.category = (df.category.str.lower()
                       .replace('uncategorized', pd.np.nan))
        return df
1032857
def history(ctx, account, limit, type, csv, exclude, raw):
    
    from peerplaysbase.operations import getOperationNameForId

    header = ["#", "time (block)", "operation", "details"]
    if csv:
        import csv

        t = csv.writer(sys.stdout, delimiter=";")
        t.writerow(header)
    else:
        t = PrettyTable(header)
        t.align = "r"
        t.align["details"] = "l"

    for a in account:
        account = Account(a, peerplays_instance=ctx.peerplays)
        for b in account.history(limit=limit, only_ops=type, exclude_ops=exclude):
            row = [
                b["id"].split(".")[2],
                "%s" % (b["block_num"]),
                "{} ({})".format(getOperationNameForId(b["op"][0]), b["op"][0]),
                pprintOperation(b) if not raw else json.dumps(b, indent=4),
            ]
            if csv:
                t.writerow(row)
            else:
                t.add_row(row)
    if not csv:
        click.echo(t)
967162
def get_balance_context(self):
        """"""
        bank_account = Account.objects.get(name='Bank')

        return dict(
            bank=bank_account,
            retained_earnings_accounts=Account.objects.filter(parent__name='Retained Earnings'),
        )
803586
def _get_divisions(taxdump_file):
    """"""
    
    with tarfile.open(taxdump_file) as tf:    
        with tf.extractfile('division.dmp') as fh:
            df = pd.read_csv(fh, header=None, sep='|', encoding='ascii')

    # only keep division ids and names
    df = df.iloc[:, [0, 2]]

    # remove tab characters flanking each division name
    df.iloc[:, 1] = df.iloc[:, 1].str.strip('\t')

    # generate dictionary
    divisions = {}
    for _, row in df.iterrows():
        divisions[row.iloc[1]] = row.iloc[0]
    
    return divisions
1348250
def _get_history_daily_window(self,
                                  assets,
                                  end_dt,
                                  bar_count,
                                  field_to_use,
                                  data_frequency):
        
        session = self.trading_calendar.minute_to_session_label(end_dt)
        days_for_window = self._get_days_for_window(session, bar_count)

        if len(assets) == 0:
            return pd.DataFrame(None,
                                index=days_for_window,
                                columns=None)

        data = self._get_history_daily_window_data(
            assets, days_for_window, end_dt, field_to_use, data_frequency
        )
        return pd.DataFrame(
            data,
            index=days_for_window,
            columns=assets
        )
86007
@Override
  public UserTrades getTradeHistory(TradeHistoryParams params) throws IOException {

    Integer page = null;
    Integer limit = null;
    if (params instanceof TradeHistoryParamPaging) {
      page = ((TradeHistoryParamPaging) params).getPageNumber() + 1;
      limit = ((TradeHistoryParamPaging) params).getPageLength();
    }

    final CoinbaseTransfers transfers = super.getCoinbaseTransfers(page, limit);
    return CoinbaseAdapters.adaptTrades(transfers);
  }
730021
def get_history(self, start, end):
        
        return self.history_table.set_index(
            'datetime',
            drop=False
        ).loc[slice(pd.Timestamp(start),
                    pd.Timestamp(end))]
70193
def dividend_receivable(self):
        
        return sum(d['quantity'] * d['dividend_per_share'] for d in six.itervalues(self._dividend_receivable))