parameters: (data, mod)
return_statement: return lst
docstring: Returns `data` unwrapped modulo `mod`. Does not modify data.
  
    Adds integer multiples of mod to all elements of data except the
    first, such that all pairs of consecutive elements (a, b) satisfy
    -mod / 2 <= b - a < mod / 2.
  
    E.g. Unwrap([0, 1, 2, 0, 1, 2, 7, 8], 3) -> [0, 1, 2, 3,
    4, 5, 4, 5]
docstring_summary: Returns `data` unwrapped modulo `mod`. Does not modify data.
docstring_tokens: Returns data unwrapped modulo mod . Does not modify data .
function: def Unwrap(data, mod):
    """Returns `data` unwrapped modulo `mod`. Does not modify data.
  
    Adds integer multiples of mod to all elements of data except the
    first, such that all pairs of consecutive elements (a, b) satisfy
    -mod / 2 <= b - a < mod / 2.
  
    E.g. Unwrap([0, 1, 2, 0, 1, 2, 7, 8], 3) -> [0, 1, 2, 3,
    4, 5, 4, 5]
    """
    lst = data[:]
    for i in range(1, len(data)):
      lst[i] = lst[i - 1] + (lst[i] - lst[i - 1] +
                             mod // 2) % mod - (mod // 2)
    return lst
function_tokens: def Unwrap ( data , mod ) : lst = data [ : ] for i in range ( 1 , len ( data ) ) : lst [ i ] = lst [ i - 1 ] + ( lst [ i ] - lst [ i - 1 ] + mod // 2 ) % mod - ( mod // 2 ) return lst