doc2json/jats2json/pmc_utils/all_tag_utils.py
def _reduce_args(stack: List, end_token: str) -> List[List]:
    """Helper function for `_parse_all_paragraphs_in_section`.
    
    Pop arguments for the xref off the top of the stack and return a list of argument lists,
    where the outer lists represent groups divided by separators."""
    start_token = end_token.replace('end', 'start')
    sep_token = end_token.replace('end', 'sep')
    args = [[]]
    while True:
        token = stack.pop()
        if token == start_token:
            return args
        elif token == sep_token:
            args.insert(0, [])
        else:
            args[0].insert(0, token)
Helper function for `_parse_all_paragraphs_in_section`.
    
    Pop arguments for the xref off the top of the stack and return a list of argument lists,
    where the outer lists represent groups divided by separators.
Helper function for `_parse_all_paragraphs_in_section`.
Pop arguments for the xref off the top of the stack and return a list of argument lists,
where the outer lists represent groups divided by separators.
Helper function for ` _parse_all_paragraphs_in_section ` . Pop arguments for the xref off the top of the stack and return a list of argument lists where the outer lists represent groups divided by separators .
def _reduce_args(stack: List, end_token: str) -> List[List]:
    start_token = end_token.replace('end', 'start')
    sep_token = end_token.replace('end', 'sep')
    args = [[]]
    while True:
        token = stack.pop()
        if token == start_token:
            return args
        elif token == sep_token:
            args.insert(0, [])
        else:
            args[0].insert(0, token)
def _reduce_args ( stack : List , end_token : str ) -> List [ List ] : start_token = end_token . replace ( 'end' , 'start' ) sep_token = end_token . replace ( 'end' , 'sep' ) args = [ [ ] ] while True : token = stack . pop ( ) if token == start_token : return args elif token == sep_token : args . insert ( 0 , [ ] ) else : args [ 0 ] . insert ( 0 , token )
Helper function for `_parse_all_paragraphs_in_section`.
Helper function for ` _parse_all_paragraphs_in_section ` .
"""Helper function for `_parse_all_paragraphs_in_section`.
    
    Pop arguments for the xref off the top of the stack and return a list of argument lists,
    where the outer lists represent groups divided by separators."""
stack
List
end_token
str