def level_prefix(level, nub='+ '):
  """Determine line prefix for the given level.

  Args:
    level: [int]  Depth to indent.
    nub: [string] trailing text at the end of the indent.
  """
  if not level:
    return ''
  return '{preamble}  {nub}'.format(preamble='  |' * (level - 1), nub=nub)