def add_session(session, graph):
    """
    For session like:
        [sku1, sku2, sku3]
    add 1 weight to each of the following edges:
        sku1 -> sku2
        sku2 -> sku3
    If sesson length < 2, no nodes/edges will be added
    """
    for i in range(len(session) - 1):
        edge = str(session[i]) + "," + str(session[i + 1])
        try:
            graph[edge] += 1
        except KeyError:
            graph[edge] = 1

    For session like:
        [sku1, sku2, sku3]
    add 1 weight to each of the following edges:
        sku1 -> sku2
        sku2 -> sku3
    If sesson length < 2, no nodes/edges will be added
    
examples/pytorch/eges/utils.py