-
Notifications
You must be signed in to change notification settings - Fork 0
/
startup
64 lines (52 loc) · 1.13 KB
/
startup
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
from __future__ import annotations
import asyncio
import collections
import collections.abc
import contextlib
import dataclasses
import datetime
import enum
import functools
import inspect
import itertools
import json
import logging
import math
import os
import pathlib
import re
import socket
import statistics
import subprocess
import typing as ty
import unittest
from collections.abc import *
from dataclasses import dataclass, field
from enum import *
from pathlib import Path
from typing import *
from unittest import mock
__missing_modules__: list[str] = []
@contextlib.contextmanager
def try_import():
try:
yield
except ImportError as exc:
if exc.name:
__missing_modules__.append(exc.name)
with try_import():
import matplotlib.pyplot as plt
with try_import():
import numpy as np
with try_import():
import pydantic
from pydantic import BaseModel, Field
with try_import():
import requests
with try_import():
import scipy as sp
import scipy.io as sio
with try_import():
import yaml
if __missing_modules__:
print("Missing modules:", ", ".join(sorted(__missing_modules__)))