def get_nodes_by_id(ntwrk, nodeid):
    """
    Return a dictionary of nodes (in ntwrk) whose key matches the
    given 'nodeid'. (Ideally, we shouldn't even need this function;
    if ntwrk is a simple dict, then simply return {nodeid: ntwrk[nodeid]}.)
    """
    return {k: v for el in ntwrk
                  for k, v in el.items() if k == nodeid}