code: def _init_nd_shape_and_axes_sorted(x, shape, axes):
      """Handle and sort shape and axes arguments for n-dimensional transforms.
  
      This is identical to `_init_nd_shape_and_axes`, except the axes are
      returned in sorted order and the shape is reordered to match.
  
      Parameters
      ----------
      x : array_like
          The input array.
      shape : int or array_like of ints or None
          The shape of the result.  If both `shape` and `axes` (see below) are
          None, `shape` is ``x.shape``; if `shape` is None but `axes` is
          not None, then `shape` is ``scipy.take(x.shape, axes, axis=0)``.
          If `shape` is -1, the size of the corresponding dimension of `x` is
          used.
      axes : int or array_like of ints or None
          Axes along which the calculation is computed.
          The default is over all axes.
          Negative indices are automatically converted to their positive
          counterpart.
  
      Returns
      -------
      shape : array
          The shape of the result. It is a 1D integer array.
      axes : array
          The shape of the result. It is a 1D integer array.
  
      """
      noaxes = axes is None
      shape, axes = _init_nd_shape_and_axes(x, shape, axes)
  
      if not noaxes:
          shape = shape[axes.argsort()]
          axes.sort()
  
      return shape, axes
  
file_path: catboost/contrib/python/scipy/py2/scipy/fftpack/helper.py
imports: from __future__ import division, print_function, absolute_import
  import operator
  from numpy import arange, array, asarray, atleast_1d, intc, integer, isscalar, issubdtype, take, unique, where
  from numpy.fft.helper import fftshift, ifftshift, fftfreq
  from bisect import bisect_left
label_desc: Use image node_id 4 for calling a global function with example usage: _init_nd_shape_and_axes_sorted(x, shape, axes) and returns: shape,  axes