def path_for_import(name):
 return os.path.dirname(os.path.abspath(import_module(name).__file__))

def path_for_import ( name ) : return os . path . dirname ( os . path . abspath ( import_module ( name ) . __file__ ) )
returns the directory path for the given package or module .