def package_dirname(package):
 if isinstance(package, str):
  package = __import__(package, fromlist=[''])
 filename = package.__file__
 dirname = os.path.dirname(filename)
 return dirname

def package_dirname ( package ) : if isinstance ( package , str ) : package = __import__ ( package , fromlist = [ '' ] ) filename = package . __file__ dirname = os . path . dirname ( filename ) return dirname
return the directory path where package is located .