93fc87ef4a966d6667a5f9dc6826555e994988c8,web/dataIndicatorsHandler.py,GetDataIndicatorsHandler,get,#GetDataIndicatorsHandler#,16

Before Change


        comp1 = components(p)
        comp2 = components(p)
        comp_list.append(comp1)
        comp_list.append(comp2)

        self.render("stock_indicators.html", comp_list=comp_list, leftMenu=webBase.GetLeftMenu(self.request.uri))

After Change



        try:
            date_now = datetime.datetime.now()
            date_end = date_now.strftime("%Y-%m-%d")
            date_start = (date_now + datetime.timedelta(days=-300)).strftime("%Y-%m-%d")
            print(code, date_start, date_end)

            // open, high, close, low, volume, price_change, p_change, ma5, ma10, ma20, v_ma5, v_ma10, v_ma20, turnover
            // 使用缓存方法。加快计算速度。
            stock = common.get_hist_data_cache(code, date_start, date_end)
            logging.info(stock.head(1))

            // print(stock) [186 rows x 14 columns]
            // 初始化统计类
            // stockStat = stockstats.StockDataFrame.retype(pd.read_csv("002032.csv"))
            stockStat = stockstats.StockDataFrame.retype(stock)
            batch_add(comp_list, stockStat)


        except Exception as e:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: pythonstock/stock
Commit Name: 93fc87ef4a966d6667a5f9dc6826555e994988c8
Time: 2017-12-07
Author: yhy
File Name: web/dataIndicatorsHandler.py
Class Name: GetDataIndicatorsHandler
Method Name: get


Project Name: quiltdata/quilt
Commit Name: 9087a7f9301e17510bc903b9beb532bc7ae641fd
Time: 2020-07-16
Author: dima@quiltdata.io
File Name: lambdas/access_counts/index.py
Class Name:
Method Name: handler


Project Name: akkana/scripts
Commit Name: ec41711c68c091aefb90b91b2402d8f38f488ad5
Time: 2019-05-08
Author: akkana@shallowsky.com
File Name: mpl_smart_dates.py
Class Name: smart_time_locator
Method Name: __call__