Return the zero (additive unit) element of this space.
773774
def zero(self):
        """"""
        tmp = self.element()
        self.lincomb(0, tmp, 0, tmp, tmp)
        return tmp
910092
def sum_from(zero: T1 = None) -> Callable[[ActualIterable[T1]], T1]:
    

    def _(collection: Iterable[T1]) -> T1:
        if zero is None:
            collection = iter(collection)
            _zero = next(collection)
            return builtins.sum(collection, _zero)

        return builtins.sum(collection, zero)

    return _
104799
def i2m(self, pkt, x):
        """"""
        if x is None:
            # Try to return zero if undefined
            x = self.h2i(pkt, 0)
        return x
543741
def zeros(self, name, **kwargs):
        """"""
        return self._write_op(self._zeros_nosync, name, **kwargs)
352917
def single(C, namespace=None):
        """"""
        if namespace is None:
            B = C()._
        else:
            B = C(default=namespace, _=namespace)._
        return B
482458
def _unit(g):
    """"""
    nt_unit_rule = get_any_nt_unit_rule(g)
    while nt_unit_rule:
        g = _remove_unit_rule(g, nt_unit_rule)
        nt_unit_rule = get_any_nt_unit_rule(g)
    return g
599835
def linear(self, limits=None, k=5):
        """"""
        start, stop = limits or (self.minval, self.maxval)
        return np.linspace(start, stop, k)
954385
def get_X0(X):
    
    if pandas_available and isinstance(X, pd.DataFrame):
        assert len(X) == 1
        x = np.array(X.iloc[0])
    else:
        x, = X
    return x
436233
def disjunct_hs_zero(cls, ops, kwargs):
    
    from qnet.algebra.core.hilbert_space_algebra import TrivialSpace
    from qnet.algebra.core.operator_algebra import ZeroOperator
    hilbert_spaces = []
    for op in ops:
        try:
            hs = op.space
        except AttributeError:  # scalars
            hs = TrivialSpace
        for hs_prev in hilbert_spaces:
            if not hs.isdisjoint(hs_prev):
                return ops, kwargs
        hilbert_spaces.append(hs)
    return ZeroOperator
433991
def get_zero_position(self):
        

        LSB = self.bus.read_byte_data(self.address, self.zero_position_MSB)
        MSB = self.bus.read_byte_data(self.address, self.zero_position_LSB)
        DATA = (MSB << 6) + LSB
        return DATA
351798
def _left_zero_blocks(self, r):
    """"""
    if not self._include_off_diagonal:
      return r
    elif not self._upper:
      return 0
    elif self._include_diagonal:
      return r
    else:
      return r + 1
398796
def get_unit(a):
    """"""
    typestr = a.dtype.str
    i = typestr.find('[')
    if i == -1:
        raise TypeError("Expected a datetime64 array, not %s", a.dtype)
    return typestr[i + 1: -1]
212835
def as_int(self, val: Tuple[str]) -> int:
        """"""
        res = 0
        try:
            for b in val:
                res += 1 << self.bit[b]
        except KeyError:
            return None
        return res
335223
def __find_a_zero(self):
        """"""
        row = -1
        col = -1
        i = 0
        n = self.n
        done = False

        while not done:
            j = 0
            while True:
                if (self.C[i][j] == 0) and \
                        (not self.row_covered[i]) and \
                        (not self.col_covered[j]):
                    row = i
                    col = j
                    done = True
                j += 1
                if j >= n:
                    break
            i += 1
            if i >= n:
                done = True

        return (row, col)
629379
def num_elements(self):
        """"""
        if self.is_fully_defined():
            size = 1
            for dim in self._dims:
                size *= dim.value
            return size
        else:
            return None
126967
def zero_grad(self):
        """"""
        if self._grad is None:
            return
        for i in self._grad:
            ndarray.zeros_like(i, out=i)
330017
public static Vector zero(int length) {
        return length > 1000 ? SparseVector.zero(length) : DenseVector.zero(length);
    }