def create_map_output_array(self, 
                                 fn, array_args, axes, 
                                 cartesian_product = False, 
                                name = "output"):
    """
    Given a function and its argument, use shape inference to figure out the
    result shape of the array and preallocate it.  If the result should be a
    scalar, just return a scalar variable.
    """
    assert self.is_fn(fn), \
      "Expected function, got %s" % (fn,)
    assert isinstance(array_args, (list,tuple)), \
      "Expected list of array args, got %s" % (array_args,)
    axes = self.normalize_axes(array_args, axes)
    
    
    
    n_indices = 0
    for arg, axis in zip(array_args, axes):
      r = self.rank(arg)
      if r == 0:
        continue 
      if axis is None:
        if cartesian_product:
          n_indices += self.rank(arg)
        else:
          n_indices = max(n_indices, self.rank(arg))
      elif axis <= r:
        continue 
      else:
        if cartesian_product:
          n_indices += 1
        else:
          n_indices = max(n_indices, 1)
    
    
    # take the 0'th slice just to have a value in hand 
    inner_args = self.get_slices(builder = self, 
                                 array_arg_vars = array_args, 
                                 axes = axes, 
                                 index_input_vars = [zero_i64] * (n_indices),
                                 cartesian_product = cartesian_product)
     
                  
    
    if cartesian_product:
      extra_dims = []
      for array, axis in zip(array_args, axes):
        rank = self.rank(array)
        if axis is None:
          dim = 1
        elif rank > axis:
          dim = self.shape(array, axis)
        else:
          dim = 1 
        extra_dims.append(dim)
      outer_shape_tuple = self.tuple(extra_dims)
    else:
      outer_shape_tuple = self.iter_bounds(array_args, axes)
      if isinstance(outer_shape_tuple.type, ScalarT):
        outer_shape_tuple = self.tuple([outer_shape_tuple])

    return self.create_output_array(fn, inner_args, outer_shape_tuple, name)
dataset/ETHPy150Open iskandr/parakeet/parakeet/transforms/indexify_adverbs.py/IndexifyAdverbs.create_map_output_array/swapped operands of `<=`