Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
"""Some helpful functions for neatly displaying the output of `pytest | |
--durations=0`.""" | |
import itertools | |
import re | |
import sys | |
def parse_lines(text): | |
results = [] | |
for line in text.splitlines(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import collections | |
import re | |
import os | |
number_re = re.compile(r"([0-9]+)") | |
def number_split_permutations(filename): | |
for match in number_re.finditer(filename): | |
start, end = match.span() | |
prefix = filename[:start] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from_gym.py adapted to work with Gymnasium. Differences: | |
# | |
# - gym.* -> gymnasium.* | |
# - Deals with .step() returning a tuple of (obs, reward, terminated, truncated, | |
# info) rather than (obs, reward, done, info). | |
# - Also deals with .reset() returning a tuple of (obs, info) rather than just | |
# obs. | |
# - Passes render_mode='rgb_array' to gymnasium.make() rather than .render(). | |
# - A bunch of minor/irrelevant type checking changes that stopped pyright from | |
# complaining (these have no functional purpose, I'm just a completionist who |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Hack to load CUDA variables shipped via PyPI. Addresses this Torch bug: | |
https://github.com/pytorch/pytorch/issues/101314 | |
Copied from PyTorch's __init__.py file, with modifications: | |
https://github.com/pytorch/pytorch/blob/main/torch/__init__.py | |
Copyright notice below is from Torch. | |
""" |
OlderNewer