code: def ListComp(xp, fp, it, test=None):
      """A list comprehension of the form [xp for fp in it if test].
  
      If test is None, the "if test" part is omitted.
      """
      xp.prefix = ""
      fp.prefix = " "
      it.prefix = " "
      for_leaf = Leaf(token.NAME, "for")
      for_leaf.prefix = " "
      in_leaf = Leaf(token.NAME, "in")
      in_leaf.prefix = " "
      inner_args = [for_leaf, fp, in_leaf, it]
      if test:
          test.prefix = " "
          if_leaf = Leaf(token.NAME, "if")
          if_leaf.prefix = " "
          inner_args.append(Node(syms.comp_if, [if_leaf, test]))
      inner = Node(
          syms.listmaker, [xp, Node(syms.comp_for, inner_args)]
      )
      return Node(
          syms.atom,
          [Leaf(token.LBRACE, "["), inner, Leaf(token.RBRACE, "]")],
      )
  
imports: from itertools import islice
  from .pgen2 import token
  from .pytree import Leaf, Node
  from .pygram import python_symbols
  from .None import patcomp
label_desc: Use image node_id 16 for calling a global function with example usage: ListComp(xp, fp, it, test) and returns: Node