def format_header(caller, entry):
 width = (_HEADER_WIDTH - 10)
 if (caller.ndb.batch_batchmode != 'batch_commands'):
  entry = _RE_CODE_START.split(entry, 1)[1]
  entry = _RE_COMMENT.sub('', entry).strip()
 header = utils.crop(entry, width=width)
 ptr = (caller.ndb.batch_stackptr + 1)
 stacklen = len(caller.ndb.batch_stack)
 header = ('{w%02i/%02i{G: %s{n' % (ptr, stacklen, header))
 header = ('%s%s' % (header, (' ' * (width - len(header)))))
 header = header.replace('\n', '\\n')
 return header

def format_header ( caller , entry ) : width = ( _HEADER_WIDTH - 10 ) if ( caller . ndb . batch_batchmode != 'batch_commands' ) : entry = _RE_CODE_START . split ( entry , 1 ) [ 1 ] entry = _RE_COMMENT . sub ( '' , entry ) . strip ( ) header = utils . crop ( entry , width = width ) ptr = ( caller . ndb . batch_stackptr + 1 ) stacklen = len ( caller . ndb . batch_stack ) header = ( '{w%02i/%02i{G: %s{n' % ( ptr , stacklen , header ) ) header = ( '%s%s' % ( header , ( ' ' * ( width - len ( header ) ) ) ) ) header = header . replace ( '\n' , '\\n' ) return header
formats a header .