code: def increment_slug(s):
      
      slug_parts = s.split('-')
      # advance (or add) the serial counter on the end of this slug
      # noinspection PyBroadException
      try:
          # if it's an integer, increment it
          slug_parts[-1] = str(1 + int(slug_parts[-1]))
      except:
          # there's no counter! add one now
          slug_parts.append('2')
      return '-'.join(slug_parts)
docs: Generate next slug for a series.
  
         Some docstore types will use slugs (see above) as document ids. To
         support unique ids, we'll serialize them as follows:
           TestUserA/my-test
           TestUserA/my-test-2
           TestUserA/my-test-3
           ...