'Initialize on the given sequence -- may take lists, tuples, NumPy arrays
of X,Y pairs, or Point objects.  If Point objects are used, ownership is
_not_ transferred to the LineString object.
Examples:
ls = LineString((1, 1), (2, 2))
ls = LineString([(1, 1), (2, 2)])
ls = LineString(array([(1, 1), (2, 2)]))
ls = LineString(Point(1, 1), Point(2, 2))'

def __init__(self, *args, **kwargs):

    if (len(args) == 1):
        coords = args[0]
    else:
        coords = args
    if (not (isinstance(coords, (tuple, list)) or (numpy and isinstance(coords, numpy.ndarray)))):
        raise TypeError('Invalid    initialization    input    for    LineStrings.')
    srid = kwargs.get('srid')
    ncoords = len(coords)
    if (not ncoords):
        super().__init__(self._init_func(None), srid=srid)
        return
    if (ncoords < self._minlength):
        raise ValueError(('%s    requires    at    least    %d    points,    got    %s.' % (self.__class__.__name__, self._minlength, ncoords)))
    if isinstance(coords, (tuple, list)):
        ndim = None
        for coord in coords:
            if (not isinstance(coord, (tuple, list, Point))):
                raise TypeError('Each    coordinate    should    be    a    sequence    (list    or    tuple)')
            if (ndim is None):
                ndim = len(coord)
                self._checkdim(ndim)
            elif (len(coord) != ndim):
                raise TypeError('Dimension    mismatch.')
        numpy_coords = False
    else:
        shape = coords.shape
        if (len(shape) != 2):
            raise TypeError('Too    many    dimensions.')
        self._checkdim(shape[1])
        ndim = shape[1]
        numpy_coords = True
    cs = GEOSCoordSeq(capi.create_cs(ncoords, ndim), z=bool((ndim == 3)))
    point_setter = (cs._set_point_3d if (ndim == 3) else cs._set_point_2d)
    for i in range(ncoords):
        if numpy_coords:
            point_coords = coords[i, :]
        elif isinstance(coords[i], Point):
            point_coords = coords[i].tuple
        else:
            point_coords = coords[i]
        point_setter(i, point_coords)
    super().__init__(self._init_func(cs.ptr), srid=srid)
