

def __init__(self, *args, **kwargs):
    '\n        Initializes on the given sequence -- may take lists, tuples, NumPy arrays\n        of X,Y pairs, or Point objects.  If Point objects are used, ownership is\n        _not_ transferred to the LineString object.\n\n        Examples:\n         ls = LineString((1, 1), (2, 2))\n         ls = LineString([(1, 1), (2, 2)])\n         ls = LineString(array([(1, 1), (2, 2)]))\n         ls = LineString(Point(1, 1), Point(2, 2))\n        '
    if (len(args) == 1):
        coords = cs[0]
    else:
        coords = args
    if isinstance(coords, (tuple, list)):
        ncoords = len(coords)
        if coords:
            ndim = len(coords[0])
        else:
            raise TypeError('Cannot initialize on empty sequence.')
        self._checkdim(ndim)
        for i in xrange(1, ncoords):
            if (not isinstance(coords[i], (tuple, list, Point))):
                raise TypeError('each coordinate should be a sequence (list or tuple)')
            if (len(coords[i]) != ndim):
                raise TypeError('Dimension mismatch.')
        numpy_coords = False
    elif (numpy and isinstance(coords, numpy.ndarray)):
        shape = coords.shape
        if (len(shape) != 2):
            raise TypeError('Too many dimensions.')
        self._checkdim(shape[1])
        ncoords = shape[0]
        ndim = shape[1]
        numpy_coords = True
    else:
        raise TypeError('Invalid initialization input for LineStrings.')
    cs = GEOSCoordSeq(capi.create_cs(ncoords, ndim), z=bool((ndim == 3)))
    for i in xrange(ncoords):
        if numpy_coords:
            cs[i] = coords[i, :]
        elif isinstance(coords[i], Point):
            cs[i] = coords[i].tuple
        else:
            cs[i] = coords[i]
    srid = kwargs.get('srid', None)
    super(LineString, self).__init__(self._init_func(cs.ptr), srid=srid)

dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.5/django/contrib/gis/geos/linestring.py LineString.__init__/VarMisuse@32/218 `args`->`cs`