def __init__(self, net_file, batch_size, num_samples, negative=5, gpus=[0], fast_neg=True, ogbl_name='', load_from_ogbl=False, ogbn_name='', load_from_ogbn=False):
    " This class has the following functions:\n        1. Transform the txt network file into DGL graph;\n        2. Generate random walk sequences for the trainer;\n        3. Provide the negative table if the user hopes to sample negative\n        nodes according to nodes' degrees;\n\n        Parameter\n        ---------\n        net_file str : path of the dgl network file\n        walk_length int : number of nodes in a sequence\n        window_size int : context window size\n        num_walks int : number of walks for each node\n        batch_size int : number of node sequences in each batch\n        negative int : negative samples for each positve node pair\n        fast_neg bool : whether do negative sampling inside a batch\n        "
    self.batch_size = batch_size
    self.negative = negative
    self.num_samples = num_samples
    self.num_procs = len(gpus)
    self.fast_neg = fast_neg
    if load_from_ogbl:
        assert (len(gpus) == 1), 'ogb.linkproppred is not compatible with multi-gpu training.'
        from load_dataset import load_from_ogbl_with_name
        self.G = load_from_ogbl_with_name(ogbl_name)
    elif load_from_ogbn:
        assert (len(gpus) == 1), 'ogb.linkproppred is not compatible with multi-gpu training.'
        from load_dataset import load_from_ogbn_with_name
        self.G = load_from_ogbn_with_name(ogbn_name)
    else:
        self.G = dgl.load_graphs(net_file)[0][0]
    self.G = make_undirected(self.G)
    print('Finish reading graph')
    self.num_nodes = self.G.number_of_nodes()
    start = time.time()
    seeds = np.random.choice(np.arange(self.G.number_of_edges()), self.num_samples, replace=True)
    self.seeds = torch.split(torch.LongTensor(seeds), int(np.ceil((self.num_samples / self.num_procs))), 0)
    end = time.time()
    t = (end - start)
    print(('generate %d samples in %.2fs' % (len(seeds), t)))
    self.valid_nodes = find_connected_nodes(self.G)
    if (not fast_neg):
        node_degree = self.G.out_degrees(self.valid_nodes).numpy()
        node_degree = np.power(node_degree, 0.75)
        node_degree /= np.sum(node_degree)
        node_degree = np.array((node_degree * 100000000.0), dtype=np.int)
        self.neg_table = []
        for (idx, node) in enumerate(self.valid_nodes):
            self.neg_table += ([node] * node_degree[idx])
        self.neg_table_size = len(self.neg_table)
        self.neg_table = np.array(self.neg_table, dtype=np.long)
        del node_degree
This class has the following functions:
1. Transform the txt network file into DGL graph;
2. Generate random walk sequences for the trainer;
3. Provide the negative table if the user hopes to sample negative
nodes according to nodes' degrees;

Parameter
---------
net_file str : path of the dgl network file
walk_length int : number of nodes in a sequence
window_size int : context window size
num_walks int : number of walks for each node
batch_size int : number of node sequences in each batch
negative int : negative samples for each positve node pair
fast_neg bool : whether do negative sampling inside a batch
def __init__(self, net_file, batch_size, num_samples, negative=5, gpus=[0], fast_neg=True, ogbl_name=, load_from_ogbl=False, ogbn_name=, load_from_ogbn=False):
    " This class has the following functions:\n        1. Transform the txt network file into DGL graph;\n        2. Generate random walk sequences for the trainer;\n        3. Provide the negative table if the user hopes to sample negative\n        nodes according to nodes' degrees;\n\n        Parameter\n        ---------\n        net_file str : path of the dgl network file\n        walk_length int : number of nodes in a sequence\n        window_size int : context window size\n        num_walks int : number of walks for each node\n        batch_size int : number of node sequences in each batch\n        negative int : negative samples for each positve node pair\n        fast_neg bool : whether do negative sampling inside a batch\n        "
    self.batch_size = batch_size
    self.negative = negative
    self.num_samples = num_samples
    self.num_procs = len(gpus)
    self.fast_neg = fast_neg
    if load_from_ogbl:
        assert (len(gpus) == 1), 'ogb.linkproppred is not compatible with multi-gpu training.'
        from load_dataset import load_from_ogbl_with_name
        self.G = load_from_ogbl_with_name(ogbl_name)
    elif load_from_ogbn:
        assert (len(gpus) == 1), 'ogb.linkproppred is not compatible with multi-gpu training.'
        from load_dataset import load_from_ogbn_with_name
        self.G = load_from_ogbn_with_name(ogbn_name)
    else:
        self.G = dgl.load_graphs(net_file)[0][0]
    self.G = make_undirected(self.G)
    print('Finish reading graph')
    self.num_nodes = self.G.number_of_nodes()
    start = time.time()
    seeds = np.random.choice(np.arange(self.G.number_of_edges()), self.num_samples, replace=True)
    self.seeds = torch.split(torch.LongTensor(seeds), int(np.ceil((self.num_samples / self.num_procs))), 0)
    end = time.time()
    t = (end - start)
    print(('generate %d samples in %.2fs' % (len(seeds), t)))
    self.valid_nodes = find_connected_nodes(self.G)
    if (not fast_neg):
        node_degree = self.G.out_degrees(self.valid_nodes).numpy()
        node_degree = np.power(node_degree, 0.75)
        node_degree /= np.sum(node_degree)
        node_degree = np.array((node_degree * 100000000.0), dtype=np.int)
        self.neg_table = []
        for (idx, node) in enumerate(self.valid_nodes):
            self.neg_table += ([node] * node_degree[idx])
        self.neg_table_size = len(self.neg_table)
        self.neg_table = np.array(self.neg_table, dtype=np.long)
        del node_degree