code: def _format_lines(lines):
      """Format the individual lines
  
      This will replace the '{', '}' and '~' characters of our mini
      formatting language with the proper 'where ...', 'and ...' and ' +
      ...' text, taking care of indentation along the way.
  
      Return a list of formatted lines.
      """
      result = lines[:1]
      stack = [0]
      stackcnt = [0]
      for line in lines[1:]:
          if line.startswith("{"):
              if stackcnt[-1]:
                  s = "and   "
              else:
                  s = "where "
              stack.append(len(result))
              stackcnt[-1] += 1
              stackcnt.append(0)
              result.append(
                  " +" + "  " * (len(stack) - 1) + s + line[1:]
              )
          elif line.startswith("}"):
              stack.pop()
              stackcnt.pop()
              result[stack[-1]] += line[1:]
          else:
              assert line[0] in ["~", ">"]
              stack[-1] += 1
              indent = (
                  len(stack) if line.startswith("~") else len(stack) - 1
              )
              result.append("  " * indent + line[1:])
      assert len(stack) == 1
      return result
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import pprint
  import six
  import _pytest._code
  from ..compat import Sequence
  from _pytest import outcomes
  from _pytest._io.saferepr import saferepr
  from _pytest.compat import ATTRS_EQ_FIELD
label_desc: Use image node_id 4 for calling a global function with example usage: _format_lines(lines) and returns: result