code: def weibull(a, size=None, ctx=None, out=None):
      r"""Draw samples from a 1-parameter Weibull distribution with given parameter a
      via inversion.
  
      Parameters
      ----------
      a : float or array_like of floats
          Shape of the distribution. Must be non-negative.
      size : int or tuple of ints, optional
          Output shape.  If the given shape is, e.g., ``(m, n, k)``, then
          ``m * n * k`` samples are drawn.  If size is ``None`` (default),
          a single value is returned if ``a`` is a scalar. Otherwise,
          ``np.array(a).size`` samples are drawn.
  
      Returns
      -------
      out : _Symbol
          Drawn samples from the 1-parameter Weibull distribution.
  
      Examples
      --------
      >>> np.random.weibull(a=5)
      array(0.9553641)
  
      >>> np.random.weibull(a=5, size=[2,3])
      array([[1.0466299 , 1.1320982 , 0.98415005],
            [1.1430776 , 0.9532727 , 1.1344457 ]])
  
      >>> np.random.weibull(a=np.array([2,3])
      array([0.98843634, 1.0125613 ])
  
      The Weibull distribution is one of a class of Generalized Extreme
      Value (GEV) distributions. This class includes the Gumbel and Frechet
      distributions.
  
      The probability density for the Weibull distribution is
      f(x) = \frac{a}{\lambda}(\frac{x}{\lambda})^{a-1}e^{-(x/\lambda)^a},
      where a is the shape and \lambda the scale. The generated 1-parameter Weibull
      sample has the scale parameter \lambda = 1.
  
      The Weibull distribution is commonly used in reliability engineering to
      model time to failure, in modeling particle sizes, in information retrieval
      to model dwell time on pages, in quantitative finance to model risk etc.
      """
      from ..numpy import _Symbol as np_symbol
  
      tensor_type_name = np_symbol
      if ctx is None:
          ctx = current_context()
      if size == ():
          size = None
      is_tensor = isinstance(a, tensor_type_name)
      if is_tensor:
          return _npi.weibull(a, a=None, size=size, ctx=ctx, out=out)
      else:
          return _npi.weibull(a=a, size=size, ctx=ctx, out=out)
  
imports: import numpy
  from ...context import current_context
  from ...util import is_np_default_dtype
  from .None import _internal
label_desc: Use image node_id 16 for calling a global function with example usage: weibull(a, size, ctx, out) and returns: _npi, _npi