code: def GetItemContainerLink(link):
      
      link = TrimBeginningAndEndingSlashes(link) + '/'
  
      index = IndexOfNth(link, '/', 4)
      
      if index != -1:
          return link[0:index]
      else:
          raise ValueError('Unable to parse document collection link from ' + link)
docs: Gets the document collection link
  
      :param str link:
          Resource link
  
      :return:
          Document collection link.
      :rtype: str