I have been reading about the function of __init__.py file. It is said that we need an empty __init__.py file in the folder which contains modules,
If a directory (folder) contains a __init__.py file then it becomes a package. What you thought you read was not strictly correct, as you found. A package can be imported as if it was a module by itself, and any code in __init__.py is run, although it is often empty. Packages are a way of grouping multiple modules together, and you can load them using:
import package-name.module-name
Packages can also be nested, and often are. Look in the Lib directory under your Python software directory for many examples.