code: def _default_in_place(func, x, out, **kwargs):
      
      result = np.array(func._call_out_of_place(x, **kwargs), copy=False)
      if result.dtype == object:
          # Different shapes encountered, need to broadcast
          flat_results = result.ravel()
          if is_valid_input_array(x, func.domain.ndim):
              scalar_out_shape = out_shape_from_array(x)
          elif is_valid_input_meshgrid(x, func.domain.ndim):
              scalar_out_shape = out_shape_from_meshgrid(x)
          else:
              raise RuntimeError('bad input')
  
          bcast_results = [np.broadcast_to(res, scalar_out_shape)
                           for res in flat_results]
          # New array that is flat in the `out_shape` axes, reshape it
          # to the final `out_shape + scalar_shape`, using the same
          # order ('C') as the initial `result.ravel()`.
          result = np.array(bcast_results, dtype=func.scalar_out_dtype)
          result = result.reshape(func.out_shape + scalar_out_shape)
  
      # The following code is required to remove extra axes, e.g., when
      # the result has shape (2, 1, 3) but should have shape (2, 3).
      # For those cases, broadcasting doesn't apply.
      try:
          reshaped = result.reshape(out.shape)
      except ValueError:
          # This is the case when `result` must be broadcast
          out[:] = result
      else:
          out[:] = reshaped
  
      return out
docs: Default in-place evaluation method.