abstract_related.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:gransk 作者: pcbje 项目源码 文件源码
def load_all(self, config):
    """
    Load all existing data.

    :param config: Configuration object.
    :type config: ``dict``
    """
    self.buckets = {}

    for path in glob.glob(os.path.join(
            config[helper.DATA_ROOT], '%s_buckets-*.pickle' % self.NAME)):
      with open(path, 'rb') as inp:
        try:
          for key, value in pickle.load(inp).items():
            if key in self.buckets:
                self.buckets[key]['bins'].update(value['bins'])
            else:
              self.buckets[key] = value
        except:
          logging.warning('could not load related_%s data', self.NAME)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号