def getParentProxyId(proxy):
    """
    Return '0' if the given proxy has no Input otherwise will return
    the parent proxy id as a String.
    """
    if proxy and proxy.GetProperty("Input"):
      parentProxy = proxy.GetProperty("Input").GetProxy(0)
      if parentProxy:
        return parentProxy.GetGlobalIDAsString()
    return '0'