parameters: (weights, num_samples)
return_statement: return absolute(weights)
docstring: Checks fweight and aweight in np.cov.
docstring_summary: Checks fweight and aweight in np.cov.
docstring_tokens: Checks fweight and aweight in np . cov .
function: def _handle_weights(weights, num_samples):
      """Checks fweight and aweight in np.cov."""
      weights = asarray_const(weights)
      if not _check_is_int(weights.dtype):
          _raise_type_error("weights must be integer")
      weights = weights.astype("float32")
      if weights.ndim > 1:
          _raise_runtime_error("cannot handle multidimensional weights")
      if weights.shape[0] != num_samples:
          _raise_runtime_error("incompatible numbers of samples and weights")
      return absolute(weights)
function_tokens: def _handle_weights ( weights , num_samples ) : weights = asarray_const ( weights ) if not _check_is_int ( weights . dtype ) : _raise_type_error ( "weights must be integer" ) weights = weights . astype ( "float32" ) if weights . ndim > 1 : _raise_runtime_error ( "cannot handle multidimensional weights" ) if weights . shape [ 0 ] != num_samples : _raise_runtime_error ( "incompatible numbers of samples and weights" ) return absolute ( weights )