importing module without importing that models imports
If you want to use from module import * and not include everything imported within module then you should define the variable __all__ in module. This variable should be a list of strings naming the classes, variables, modules, etc. that should be imported.
From the python documentation

If the list of identifiers is replaced by a star (*), all public names defined in the module are bound in the local namespace of the import statement

and

The public names defined by a module are determined by checking the module’s namespace for a variable named __all__; if defined, it must be a sequence of strings which are names defined or imported by that module. The names given in __all__ are all considered public and are required to exist.  If __all__ is not defined, the set of public names includes all names found in the module’s namespace which do not begin with an underscore character (_) [...] It is intended to avoid accidentally exporting items that are not part of the API (such as library modules which were imported and used within the module). (emphasis mine)
I am trying to import a python module without importing the imports of that module. I was digging around a bit, but the only way to exclude any command from being run when a file is being imported is the if __name__ == "__main__":
But the module is also imported by various other modules that ened that modules imports, so I cant place the imports below the  if __name__ == "__main__":
Any idea how to solve that?
The reason why I dont want to import this modules imports that those modules get run also from a jar jython envioronment and import java.lang functions. I just need to access a few functions in that file without the whole and importing those modules break make script. The functions that I am trying to access dont need any dependencies that module ahs.
I import via 'from moduleX import f1,f2,f3'