class_docstr: Sequence of ndarrays having variable first dimension sizes.
  
  This is a container that can store multiple ndarrays where each ndarray
  might have a different first dimension size but a *common* size for the
  remaining dimensions.
  
  More generally, an instance of :class:`ArraySequence` of length $N$ is
  composed of $N$ ndarrays of shape $(d_1, d_2, ... d_D)$ where $d_1$
  can vary in length between arrays but $(d_2, ..., d_D)$ have to be the
  same for every ndarray.
class_docstr_tok: ["Sequence","of","ndarrays","having","variable","first","dimension","sizes",".","This","is","a","container","that","can","store","multiple","ndarrays","where","each","ndarray","might","have","a","different","first","dimension","size","but","a","*","common","*","size","for","the","remaining","dimensions",".","More","generally",",","an","instance","of",":","class",":","`","ArraySequence","`","of","length","$","N","$","is","composed","of","$","N","$","ndarrays","of","shape","$","(","d_1",",","d_2",",","...","d_D",")","$","where","$","d_1","$","can","vary","in","length","between","arrays","but","$","(","d_2",",","...",",","d_D",")","$","have","to","be","the","same","for","every","ndarray","."]
docstr: Applies some operator to this arraysequence.
  
  This handles both unary and binary operators with a scalar or another
  array sequence. Operations are performed directly on the underlying
  data, or a copy of it, which depends on the value of `inplace`.
  
  Parameters
  ----------
  op : str
      Name of the Python operator (e.g., `"__add__"`).
  value : scalar or :class:`ArraySequence`, optional
      If None, the operator is assumed to be unary.
      Otherwise, that value is used in the binary operation.
  inplace: bool, optional
      If False, the operation is done on a copy of this array sequence.
      Otherwise, this array sequence gets modified directly.
docstr_tok: ["Applies","some","operator","to","this","arraysequence",".","This","handles","both","unary","and","binary","operators","with","a","scalar","or","another","array","sequence",".","Operations","are","performed","directly","on","the","underlying","data",",","or","a","copy","of","it",",","which","depends","on","the","value","of","`","inplace","`",".","Parameters","--","--","--","--","--","op",":","str","Name","of","the","Python","operator","(","e.g.",",","`","``","__add__","''","`",")",".","value",":","scalar","or",":","class",":","`","ArraySequence","`",",","optional","If","None",",","the","operator","is","assumed","to","be","unary",".","Otherwise",",","that","value","is","used","in","the","binary","operation",".","inplace",":","bool",",","optional","If","False",",","the","operation","is","done","on","a","copy","of","this","array","sequence",".","Otherwise",",","this","array","sequence","gets","modified","directly","."]
code: def _op(self, op, value=None, inplace=False):
      """Applies some operator to this arraysequence.
  
      This handles both unary and binary operators with a scalar or another
      array sequence. Operations are performed directly on the underlying
      data, or a copy of it, which depends on the value of `inplace`.
  
      Parameters
      ----------
      op : str
          Name of the Python operator (e.g., `"__add__"`).
      value : scalar or :class:`ArraySequence`, optional
          If None, the operator is assumed to be unary.
          Otherwise, that value is used in the binary operation.
      inplace: bool, optional
          If False, the operation is done on a copy of this array sequence.
          Otherwise, this array sequence gets modified directly.
      """
      seq = self if inplace else self.copy()
  
      if is_array_sequence(value) and seq._check_shape(value):
          elements = zip(
              seq._offsets,
              seq._lengths,
              self._offsets,
              self._lengths,
              value._offsets,
              value._lengths,
          )
  
          # Change seq.dtype to match the operation resulting type.
          o0, l0, o1, l1, o2, l2 = next(elements)
          tmp = getattr(self._data[o1 : o1 + l1], op)(
              value._data[o2 : o2 + l2]
          )
          seq._data = seq._data.astype(tmp.dtype)
          seq._data[o0 : o0 + l0] = tmp
  
          for o0, l0, o1, l1, o2, l2 in elements:
              seq._data[o0 : o0 + l0] = getattr(
                  self._data[o1 : o1 + l1], op
              )(value._data[o2 : o2 + l2])
  
      else:
          args = (
              [] if value is None else [value]
          )  # Dealing with unary and binary ops.
          elements = zip(
              seq._offsets, seq._lengths, self._offsets, self._lengths
          )
  
          # Change seq.dtype to match the operation resulting type.
          o0, l0, o1, l1 = next(elements)
          tmp = getattr(self._data[o1 : o1 + l1], op)(*args)
          seq._data = seq._data.astype(tmp.dtype)
          seq._data[o0 : o0 + l0] = tmp
  
          for o0, l0, o1, l1 in elements:
              seq._data[o0 : o0 + l0] = getattr(
                  self._data[o1 : o1 + l1], op
              )(*args)
  
      return seq
  
imports: import numbers
  from functools import reduce
  from operator import mul
  import numpy
label_desc: Use image node_id 17 for calling the ArraySequence obj's underlying member method code with example usage: obj._op(op, value, inplace) and returns: seq