code: def geomspace(start, stop, num=50, endpoint=True, dtype=None, axis=0):
      """
      Return numbers spaced evenly on a log scale (a geometric progression).
  
      This is similar to `logspace`, but with endpoints specified directly.
      Each output sample is a constant multiple of the previous.
  
      .. versionchanged:: 1.16.0
          Non-scalar `start` and `stop` are now supported.
  
      Parameters
      ----------
      start : array_like
          The starting value of the sequence.
      stop : array_like
          The final value of the sequence, unless `endpoint` is False.
          In that case, ``num + 1`` values are spaced over the
          interval in log-space, of which all but the last (a sequence of
          length `num`) are returned.
      num : integer, optional
          Number of samples to generate.  Default is 50.
      endpoint : boolean, optional
          If true, `stop` is the last sample. Otherwise, it is not included.
          Default is True.
      dtype : dtype
          The type of the output array.  If `dtype` is not given, infer the data
          type from the other input arguments.
      axis : int, optional
          The axis in the result to store the samples.  Relevant only if start
          or stop are array-like.  By default (0), the samples will be along a
          new axis inserted at the beginning. Use -1 to get an axis at the end.
  
          .. versionadded:: 1.16.0
  
      Returns
      -------
      samples : ndarray
          `num` samples, equally spaced on a log scale.
  
      See Also
      --------
      logspace : Similar to geomspace, but with endpoints specified using log
                 and base.
      linspace : Similar to geomspace, but with arithmetic instead of geometric
                 progression.
      arange : Similar to linspace, with the step size specified instead of the
               number of samples.
  
      Notes
      -----
      If the inputs or dtype are complex, the output will follow a logarithmic
      spiral in the complex plane.  (There are an infinite number of spirals
      passing through two points; the output will follow the shortest such path.)
  
      Examples
      --------
      >>> np.geomspace(1, 1000, num=4)
      array([    1.,    10.,   100.,  1000.])
      >>> np.geomspace(1, 1000, num=3, endpoint=False)
      array([   1.,   10.,  100.])
      >>> np.geomspace(1, 1000, num=4, endpoint=False)
      array([   1.        ,    5.62341325,   31.6227766 ,  177.827941  ])
      >>> np.geomspace(1, 256, num=9)
      array([   1.,    2.,    4.,    8.,   16.,   32.,   64.,  128.,  256.])
  
      Note that the above may not produce exact integers:
  
      >>> np.geomspace(1, 256, num=9, dtype=int)
      array([  1,   2,   4,   7,  16,  32,  63, 127, 256])
      >>> np.around(np.geomspace(1, 256, num=9)).astype(int)
      array([  1,   2,   4,   8,  16,  32,  64, 128, 256])
  
      Negative, decreasing, and complex inputs are allowed:
  
      >>> np.geomspace(1000, 1, num=4)
      array([ 1000.,   100.,    10.,     1.])
      >>> np.geomspace(-1000, -1, num=4)
      array([-1000.,  -100.,   -10.,    -1.])
      >>> np.geomspace(1j, 1000j, num=4)  # Straight line
      array([ 0.   +1.j,  0.  +10.j,  0. +100.j,  0.+1000.j])
      >>> np.geomspace(-1+0j, 1+0j, num=5)  # Circle
      array([-1.00000000+0.j        , -0.70710678+0.70710678j,
              0.00000000+1.j        ,  0.70710678+0.70710678j,
              1.00000000+0.j        ])
  
      Graphical illustration of ``endpoint`` parameter:
  
      >>> import matplotlib.pyplot as plt
      >>> N = 10
      >>> y = np.zeros(N)
      >>> plt.semilogx(np.geomspace(1, 1000, N, endpoint=True), y + 1, 'o')
      >>> plt.semilogx(np.geomspace(1, 1000, N, endpoint=False), y + 2, 'o')
      >>> plt.axis([0.5, 2000, 0, 3])
      >>> plt.grid(True, color='0.7', linestyle='-', which='both', axis='both')
      >>> plt.show()
  
      """
      start = asanyarray(start)
      stop = asanyarray(stop)
      if _nx.any(start == 0) or _nx.any(stop == 0):
          raise ValueError("Geometric sequence cannot include zero")
  
      dt = result_type(start, stop, float(num), _nx.zeros((), dtype))
      if dtype is None:
          dtype = dt
      else:
          # complex to dtype('complex128'), for instance
          dtype = _nx.dtype(dtype)
  
      # Promote both arguments to the same dtype in case, for instance, one is
      # complex and another is negative and log would produce NaN otherwise.
      # Copy since we may change things in-place further down.
      start = start.astype(dt, copy=True)
      stop = stop.astype(dt, copy=True)
  
      out_sign = _nx.ones(_nx.broadcast(start, stop).shape, dt)
      # Avoid negligible real or imaginary parts in output by rotating to
      # positive real, calculating, then undoing rotation
      if _nx.issubdtype(dt, _nx.complexfloating):
          all_imag = (start.real == 0.0) & (stop.real == 0.0)
          if _nx.any(all_imag):
              start[all_imag] = start[all_imag].imag
              stop[all_imag] = stop[all_imag].imag
              out_sign[all_imag] = 1j
  
      both_negative = (_nx.sign(start) == -1) & (_nx.sign(stop) == -1)
      if _nx.any(both_negative):
          _nx.negative(start, out=start, where=both_negative)
          _nx.negative(stop, out=stop, where=both_negative)
          _nx.negative(out_sign, out=out_sign, where=both_negative)
  
      log_start = _nx.log10(start)
      log_stop = _nx.log10(stop)
      result = out_sign * logspace(
          log_start,
          log_stop,
          num=num,
          endpoint=endpoint,
          base=10.0,
          dtype=dtype,
      )
      if axis != 0:
          result = _nx.moveaxis(result, 0, axis)
  
      return result.astype(dtype, copy=False)
  
file_path: catboost/contrib/python/numpy/py2/numpy/core/function_base.py
imports: from __future__ import division, absolute_import, print_function
  import functools
  import warnings
  import operator
  from .None import numeric
  from .numeric import result_type, NaN, shares_memory, MAY_SHARE_BOUNDS, TooHardError, asanyarray, ndim
  from numpy.core.multiarray import add_docstring
  from numpy.core import overrides
label_desc: Use image node_id 7 for calling a global function with example usage: geomspace(start, stop, num, endpoint, dtype, axis) and returns: result