train.py 文件源码

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

项目:lain 作者: llllllllll 项目源码 文件源码
def eligible_replays(replays, *, age=None):
    """Filter replays down to just the replays we want to train with.

    Parameters
    ----------
    replays : iterable[Replay]
        The replays to filter.
    age : datetime.timedelta, optional
        Only count replays less than this age old.

    Yields
    ------
    replay : Replay
        The eligible replays in the directory.

    Notes
    -----
    The same beatmap may appear more than once if there are multiple replays
    for this beatmap.
    """
    for replay in replays:
        if age is not None and datetime.utcnow() - replay.timestamp > age:
            continue

        if not (replay.mode != GameMode.standard or
                replay.failed or
                replay.autoplay or
                replay.auto_pilot or
                replay.cinema or
                replay.relax or
                len(replay.beatmap.hit_objects) < 2):
            # ignore plays with mods that are not representative of user skill
            yield replay
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号