original_docstring: 
      Cycles through the documents in order to find the current document
      and return its successor
      
docstring: Cycles through the documents in order to find the current document
  and return its successor
docstring_tokens: Cycles through the documents in order to find the current document and return its successor
code: def find_next_document(user, current_doc_filename):
      """
      Cycles through the documents in order to find the current document
      and return its successor
      """
      sorted_labeled_docs = get_docs_ordered_by_id(user)
  
      licycle = itertools.cycle(sorted_labeled_docs)
      nextelem = licycle.next()
  
      counter = len(sorted_labeled_docs) + 1
      while counter:
          thiselem, nextelem = nextelem, licycle.next()
          if thiselem.filename == current_doc_filename:
              break;
          counter -= 1
  
      next_doc = nextelem
      return next_doc
code_tokens: def find_next_document ( user , current_doc_filename ) : sorted_labeled_docs = get_docs_ordered_by_id ( user ) licycle = itertools . cycle ( sorted_labeled_docs ) nextelem = licycle . next ( ) counter = len ( sorted_labeled_docs ) + 1 while counter : thiselem , nextelem = nextelem , licycle . next ( ) if thiselem . filename == current_doc_filename : break ; counter -= 1 next_doc = nextelem return next_doc
short_docstring: Cycles through the documents in order to find the current document
  and return its successor
short_docstring_tokens: Cycles through the documents in order to find the current document and return its successor
comment: """
      Cycles through the documents in order to find the current document
      and return its successor
      """