Common neighbors

How can I find the number of immediate common neighbors between all the nodes
in a given graph and represent it as a matrix. i have attached the graph.
Please provide some inputs. connectivity11.gz

m = zeros((g.num_vertices(), g.num_vertices()))

for v in g.vertices():
    nv = set(v.all_neighbours())
    for w in g.vertices():
        nw = set(w.all_neighbours())
        m[v, w] = len(nv.intersection(nw))