def get_decoded_dimension_from_polyline(polyline, index):
    """
    Helper method for decoding polylines that returns
    new polyline index and decoded int part of one dimension
    """
    result = 1
    shift = 0
    while True:
        b = ord(polyline[index]) - 63 - 1
        index += 1
        result += b << shift
        shift += 5
        if b < 31:
            break
    return index, ~result >> 1 if result & 1 != 0 else result >> 1
