code: def get_parent_path(brain_or_object):
      
      if is_portal(brain_or_object):
          return get_path(get_portal())
      if is_brain(brain_or_object):
          path = get_path(brain_or_object)
          return path.rpartition("/")[0]
      return get_path(get_object(brain_or_object).aq_parent)
docs: Calculate the physical parent path of this object
  
      :param brain_or_object: A single catalog brain or content object
      :type brain_or_object: ATContentType/DexterityContentType/CatalogBrain
      :returns: Physical path of the parent object
      :rtype: string