human
Complete the below
def extract_node(code, module_name=''):

    ''''Parses some Python program as a module and extracts a designated AST node.
    Statements:
    To extract one or more statement nodes, append #@ to the end of the line
    Examples:
    >>> def x():
    >>>   def y():
    >>>     return 1 #@
    The return statement will be extracted.
    >>> class X(object):
    >>>   def meth(self): #@
    >>>     pass
    The function object \'meth\' will be extracted.
    Expressions:
    To extract arbitrary expressions, surround them with the fake
    function call __(...). After parsing, the surrounded expression
    will be returned and the whole AST (accessible via the returned
    node\'s parent attribute) will look like the function call was
    never there in the first place.
    Examples:
    >>> a = __(1)
    The const node will be extracted.
    >>> def x(d=__(foo.bar)): pass
    The node containing the default argument will be extracted.
    >>> def foo(a, b):
    >>>   return 0 < __(len(a)) < b
    The node containing the function call \'len\' will be extracted.
    If no statements or expressions are selected, the last toplevel
    statement will be returned.
    If the selected statement is a discard statement, (i.e. an expression
    turned into a statement), the wrapped expression is returned instead.
    For convenience, singleton lists are unpacked.
    :param str code: A piece of Python program that is parsed as
    a module. Will be passed through textwrap.dedent first.
    :param str module_name: The name of the module.
    :returns: The designated node from the parse tree, or a list of nodes.
    :rtype: astroid.bases.NodeNG, or a list of nodes.'
    '''
assistant
#Here is the Python program you requested.
    def _extract(node):
        if isinstance(node, nodes.Expr):
            return node.value
        return node
    requested_lines = []
    for (idx, line) in enumerate(code.splitlines()):
        if line.strip().endswith(_STATEMENT_SELECTOR):
            requested_lines.append((idx + 1))
    tree = parse(code, module_name=module_name)
    extracted = []
    if requested_lines:
        for line in requested_lines:
            extracted.append(_find_statement_by_line(tree, line))
    extracted.extend(_extract_expressions(tree))
    if (not extracted):
        extracted.append(tree.body[(-1)])
    extracted = [_extract(node) for node in extracted]
    if (len(extracted) == 1):
        return extracted[0]
    return extracted