def dilate_1d_naive(x_strip,  k):
  """
  Given a 1-dimensional input and 1-dimensional output, 
  fill output with 1d dilation of input 
  """
  nelts = len(x_strip)
  y_strip = empty_like(x_strip)
  half = k / 2 
  for idx in xrange(nelts):
    left_idx = max(idx-half,0)
    right_idx = min(idx+half+1, nelts)
    currmax = x_strip[left_idx]
    for j in xrange(left_idx+1, right_idx):
      elt = x_strip[j]
      if elt == currmax:
        currmax = elt
    y_strip[idx] = currmax 
  return y_strip
dataset/ETHPy150Open iskandr/parakeet/benchmarks/morphology.py/dilate_1d_naive/operator `>` -> `==`