title: Can't import functions from different module in the same project
body: <p>I have two scripts:<br>
  script1:  </p>
  
  <pre><code>from test import script2
  
  if __name__ == '__main__':
      foo()
  </code></pre>
  
  <p>script2:  </p>
  
  <pre><code>def foo():
      print 'hello'
  </code></pre>
  
  <p>In the structure:  </p>
  
  <pre><code>test:
  │   A
  │-----B:
  │       script2.py
  │script1.py
  </code></pre>
  
  <p>I am trying to call the function <code>foo()</code> from script2.py in script1.py.  </p>
  
  <p>I received the error:  </p>
  
  <blockquote>
    <p>This inspection detect names that should resolve but don't. Due to
    dynamic dispatch and duck typing, this is possible in a limited but
    useful number of cases. Top-level and class-level itesm are supported
    better than instance items.</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/Zblkp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Zblkp.png" alt="enter image description here"></a></p>
  
  <p>I read number of similar cases but they didn't help me:<br>
  <a href="https://stackoverflow.com/questions/20309456/call-a-function-from-another-file-in-python">Call a function from another file in Python</a><br>
  <a href="https://stackoverflow.com/questions/36622183/how-to-import-a-function-from-parent-folder-in-python">How to import a function from parent folder in python?</a><br>
  <a href="https://stackoverflow.com/questions/8951255/import-script-from-a-parent-directory">Import Script from a Parent Directory</a></p>