<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_potential_markables(docgraph):
 """ returns a list of all NPs and PPs in the given docgraph. Parameters docgraph : DiscourseDocumentGraph a document graph that (at least) contains syntax trees (imported from Tiger XML files) Returns ------- potential_markables : list of str or int Node IDs of all nodes that represent an NP/PP syntactical category/phrase in the input document. If an NP is embedded in a PP, only the node ID of the PP is returned. """

    potential_markables = []

    for node_id, nattr in dg.select_nodes_by_layer(docgraph, 'tiger:syntax', data=True):
        if nattr['tiger:cat'] == 'NP':
            # if an NP is embedded into a PP, only print the PP
            pp_parent = False
            for source, target in docgraph.in_edges(node_id):
                parent_node = docgraph.node[source]
                if 'tiger:cat' in parent_node and parent_node['tiger:cat'] == 'PP':
                    potential_markables.append(source) # add parent PP phrase
                    pp_parent = True
            if not pp_parent:
                potential_markables.append(node_id) # add NP phrase

        elif nattr['tiger:cat'] == 'PP':
            potential_markables.append(node_id) # add PP phrase
    return potential_markables