@staticmethod
def set_list(l, i, v):
    """
        Function sets i-th value in list to v. If i does not exist in l
        it is initialized else value is modified
        """
    try:
        l[i] = v
    except IndexError:
        for _ in range(i - len(l)):
            l.append(None)
        l.append(v)
    return l
