def get_common_path(pathlist):
 common = osp.normpath(osp.commonprefix(pathlist))
 if (len(common) > 1):
  if (not osp.isdir(common)):
   return abspardir(common)
  else:
   for path in pathlist:
    if (not osp.isdir(osp.join(common, path[(len(common) + 1):]))):
     return abspardir(common)
   else:
    return osp.abspath(common)

def get_common_path ( pathlist ) : common = osp . normpath ( osp . commonprefix ( pathlist ) ) if ( len ( common ) > 1 ) : if ( not osp . isdir ( common ) ) : return abspardir ( common ) else : for path in pathlist : if ( not osp . isdir ( osp . join ( common , path [ ( len ( common ) + 1 ) : ] ) ) ) : return abspardir ( common ) else : return osp . abspath ( common )
return common path for all paths in pathlist .