I tried to handle this code as I have a big file with size 3 GB "mydata.dat"
3 GB
block one for the code is
class Graph(defaultdict):