Spaces:
Paused
Paused
Download chemprop/cli/utils/command.py from LudwigO/chemprop_example: direct link, hf CLI and curl.
- Browser
- Download file 633 Bytes
-
https://huggingface.co/spaces/LudwigO/chemprop_example/resolve/main/chemprop/cli/utils/command.py
- Command line
-
hf download hf://spaces/LudwigO/chemprop_example/chemprop/cli/utils/command.py
-
curl -L -o command.py https://huggingface.co/spaces/LudwigO/chemprop_example/resolve/main/chemprop/cli/utils/command.py
633 Bytes
| from abc import ABC, abstractmethod | |
| from argparse import ArgumentParser, _SubParsersAction, Namespace | |
| class Subcommand(ABC): | |
| COMMAND: str | |
| HELP: str | None = None | |
| def add(cls, subparsers: _SubParsersAction, parents) -> ArgumentParser: | |
| parser = subparsers.add_parser(cls.COMMAND, help=cls.HELP, parents=parents) | |
| cls.add_args(parser).set_defaults(func=cls.func) | |
| return parser | |
| def add_args(cls, parser: ArgumentParser) -> ArgumentParser: | |
| pass | |
| def func(cls, args: Namespace): | |
| pass | |