Returns a dict of object names and values in a module, while skipping private/internal objects Args: module (ModuleType): Module to extract the objects from. Returns: dict: Dictionary of object names and corresponding values
(module)
| 761 | |
| 762 | |
| 763 | def get_objects_from_module(module): |
| 764 | """ |
| 765 | Returns a dict of object names and values in a module, while skipping private/internal objects |
| 766 | |
| 767 | Args: |
| 768 | module (ModuleType): |
| 769 | Module to extract the objects from. |
| 770 | |
| 771 | Returns: |
| 772 | dict: Dictionary of object names and corresponding values |
| 773 | """ |
| 774 | |
| 775 | objects = {} |
| 776 | for name in dir(module): |
| 777 | if name.startswith("_"): |
| 778 | continue |
| 779 | objects[name] = getattr(module, name) |
| 780 | |
| 781 | return objects |
| 782 | |
| 783 | |
| 784 | class OptionalDependencyNotAvailable(BaseException): |
no outgoing calls
no test coverage detected