import _ast


def Expr(value):
  """Creates an _ast.Expr node.

  Note that this node is mostly used to wrap other nodes so they're treated
  as whole-line statements.

  Args:
    value: The value stored in the node.

  Raises:
    ValueError: If value is an _ast.stmt node.

  Returns:
    An _ast.Expr node.
  """
  if isinstance(value, _ast.stmt):
    raise ValueError(
        'value must not be an _ast.stmt node, because those nodes don\'t need '
        'to be wrapped in an Expr node. Value passed: {}'.format(value))
  return _ast.Expr(value)