code: def node_neighbours_extended(v, nodes, edges):
      """Returns a list of neighbours of vertex v"""
      nodes = np.array(nodes)
      edges = np.array(edges)
      mask = np.in1d(edges[:, 0], v)
      return (
          v,
          np.where(np.in1d(nodes, edges[mask, 1])),
          edges[mask, 1],
      )
  
imports: from collections import OrderedDict
  import networkx
  from networkx.readwrite import json_graph
  import os
  import json
  import uuid
  import numpy
  import scipy.sparse
  import multiprocessing
  from multiprocessing import Pool
  from functools import partial
  from time import sleep
label_desc: Use image node_id 2 for calling a global function with example usage: node_neighbours_extended(v, nodes, edges) and returns: v,  np,  edges