In Python, codes can be organized into separate files called as modules which then can be imported by using the namespaces. The functions of the respective modules can be accessed by namespace followed by respective function name.


Below table has some of the possible ways of importing the modules

Python
# imports the argument parsing module
import argparse
# imports the Pattern class from the regular expressions module
from re import Pattern
# imports all symbols inside the typing module
from typing import *
# Python supports an alias or user prepared name for convience
import numpy as np

When a module is imported, the interpreter first checks whether its exists in the "sys.modules" cache and uses it. If not exists then its loads from it actual path.