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 subprocess | |
from pathlib import Path | |
import typer | |
def main(task_name: str): | |
task_dir = Path(task_name) | |
code_path = task_dir / 'code.py' |
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 | |
class NoStrIterable(collections.Iterable): | |
""" | |
'isinstance(smt, NoStrIterable)' | |
instead of | |
'isinstance(smt, collection.Iterable) and not isinstance(smt, str)' | |
""" |
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
def get_obj_by_path(path): | |
""" | |
Example: | |
obj = get_obj_by_path('module.Object') | |
""" | |
module_path, target = path.rsplit('.', maxsplit=1) | |
module = __import__(name=module_path, fromlist=(target,)) | |
return getattr(module, target) |
NewerOlder