def get_qualified_path(name):
 import sys
 import os
 path = sys.path
 try:
  path = ([os.path.dirname(__file__)] + path)
 except NameError:
  pass
 for dir in path:
  fullname = os.path.join(dir, name)
  if os.path.exists(fullname):
   return fullname
 return name

def get_qualified_path ( name ) : import sys import os path = sys . path try : path = ( [ os . path . dirname ( __file__ ) ] + path ) except NameError : pass for dir in path : fullname = os . path . join ( dir , name ) if os . path . exists ( fullname ) : return fullname return name
return a more qualified path to name .