def assign_index(self, lhs, rhs):
    if isinstance(lhs.index.type, ScalarT) and isinstance(rhs.type, ScalarT):
      self.assign(lhs,rhs)
      return 
    
    scalar_indices, scalar_index_positions, slices, slice_positions = \
      self.dissect_index_expr(lhs)
    assert len(scalar_indices) == len(scalar_index_positions)
    assert len(slices) == len(slice_positions)
    if len(slices) == 0:
      self.setidx(lhs.value, self.tuple(scalar_indices), rhs)
      return 
    

    # if we've gotten this far then there is a slice somewhere in the indexing 
    # expression, so we're going to turn the assignment into a setidx parfor 
    bounds = self.tuple([self.div(self.sub(stop, start), step)
                         for (start, stop, step) in slices])
    
    setidx_fn = self.make_setidx_fn(lhs.value.type, 
                                    rhs.type, 
                                    scalar_index_positions, 
                                    slice_positions)
    starts = [start for (start, _, _) in slices]
    steps = [step for (_, _, step) in slices]
    closure = self.closure(setidx_fn, 
                           [lhs.value, rhs] + scalar_indices + starts + steps)


    self.parfor(closure, bounds)
dataset/ETHPy150Open iskandr/parakeet/parakeet/transforms/lower_slices.py/LowerSlices.assign_index/original