metrics.py 文件源码

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

项目:iCount 作者: tomazc 项目源码 文件源码
def __init__(self, context=None, **kwargs):
        """
        When creating the placeholder, a process-specific context should be given.

        Parameters
        ----------
        context : str
            Context is used to indicate the process that generated the processing statistics.

        Returns
        -------
        Metrics
            Instance where processing statistics can be added or modified.

        """
        # If context is not given, determine it from calling function.
        if context is None:
            previous_frame = inspect.getouterframes(inspect.currentframe())[1]
            module = inspect.getmodulename(previous_frame[1])
            context = module + '.' + previous_frame[3]
        self.context = context
        for arg, value in kwargs.items():
            setattr(self, arg, value)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号