def GetTopLevelContainingType(self):
    desc = self
    while desc.containing_type is not None:
      desc = desc.containing_type
    return desc
Returns the root if this is a nested type, or itself if its the root.
dataset/ETHPy150Open AppScale/appscale/AppServer/google/net/proto2/python/public/descriptor.py/_NestedDescriptorBase.GetTopLevelContainingType