def get_packages(package):
 return [dirpath for (dirpath, dirnames, filenames) in os.walk(package) if os.path.exists(os.path.join(dirpath, '__init__.py'))]

def get_packages ( package ) : return [ dirpath for ( dirpath , dirnames , filenames ) in os . walk ( package ) if os . path . exists ( os . path . join ( dirpath , '__init__.py' ) ) ]
get all packages which are under dname .