github.py 文件源码

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

项目:flash_services 作者: textbook 项目源码 文件源码
def half_life(issues):
        """Calculate the half life of the service's issues.

        Args:
          issues (:py:class:`list`): The service's issue data.

        Returns:
          :py:class:`datetime.timedelta`: The half life of the issues.

        """
        lives = []
        for issue in issues:
            start = safe_parse(issue.get('created_at'))
            end = safe_parse(issue.get('closed_at'))
            if start and end:
                lives.append(end - start)
        if lives:
            lives.sort()
            size = len(lives)
            return lives[((size + (size % 2)) // 2) - 1]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号