What does the first argument of the imp.load_source method do?
Question: I'm reading [this](http://stackoverflow.com/questions/67631/how-to-import-a-
module-given-the-full-path) SO question about importing modules from absolute
path. An answer suggest to use following code:

    
    
    import imp
    foo = imp.load_source('module.name', '/path/to/file.py')
    foo.MyClass()
    

I want to import file from dir which has following structure (it is package):

    
    
    __int__.py
    model_params.py
    

I've done this:

    
    
    import01 = imp.load_source('module.name', '/home/wakatana/experiments/model_params/model_params.py')
    

Now I can access variables within `model_params.py` via
`import01.VARIABLE_NAME`. It seems like equivalent to `import numpy as np`.
Where `model_params.py` is like `numpy` and `import01` is like `np`.

I would like to ask what does the first argument of `load_source` method do?
`help(imp)` says practically nothing about `load_source` method, e.g.
following `help(imp.load_source)` returns `load_source(...)`

Thanks

**EDIT based on behzad.nouri comment**

On documentation page of
[load_source](https://docs.python.org/2/library/imp.html#imp.load_source) is
said:

> The name argument is used to create or access a module object.

But when I try to access `module.name` I get an error about not defined
module. Also why there is not documentation that can be accessed by `help`,
can I install it somehow? I was hoping that documentation is part of the code
itself in python, or is it common practice to not have it built-in but rather
have it on-line?


Answer: [From documentation ](https://docs.python.org/2/library/imp.html)

> imp.load_source(name, pathname[, file]):
>
> Load and initialize a module implemented as a Python source file and return
> its module object. If the module was already initialized, it will be
> initialized again. **The name argument is used to create or access a module
> object**. The pathname argument points to the source file. The file argument
> is the source file, open for reading as text, from the beginning. It must
> currently be a real file object, not a user-defined class emulating a file.
> Note that if a properly matching byte-compiled file (with suffix .pyc or
> .pyo) exists, it will be used instead of parsing the given source file

