class_docstr: A size of a financial instrument for use in trading.
  
  Parameters
  ----------
  instrument : `Instrument`
      The unit of the quantity.
  size : `Decimal`
      The number of units of the instrument.
  path_id : str, optional
      The path order_id that this quantity is allocated for and associated
      with.
  
  Raises
  ------
  InvalidNegativeQuantity
      Raised if the `size` of the quantity being created is negative.
docstr: Performs a generic boolean operation on two quantities.
  
  Parameters
  ----------
  left : `Union[Quantity, Number]`
      The left argument of the operation.
  right : `Union[Quantity, Number]`
      The right argument of the operation.
  op : `Callable[[T, T], bool]`
      The boolean operation to be used.
  
  Returns
  -------
  bool
      The result of performing `op` on with `left` and `right`.
docstr_tok: ["Performs","a","generic","boolean","operation","on","two","quantities",".","Parameters","--","--","--","--","--","left",":","`","Union","[","Quantity",",","Number","]","`","The","left","argument","of","the","operation",".","right",":","`","Union","[","Quantity",",","Number","]","`","The","right","argument","of","the","operation",".","op",":","`","Callable","[","[","T",",","T","]",",","bool","]","`","The","boolean","operation","to","be","used",".","Returns","--","--","--","-","bool","The","result","of","performing","`","op","`","on","with","`","left","`","and","`","right","`","."]
code: def _bool_op(
      left: "Union[Quantity, Number]",
      right: "Union[Quantity,Number]",
      op: "Callable[[T, T], bool]",
  ) -> bool:
      """Performs a generic boolean operation on two quantities.
  
      Parameters
      ----------
      left : `Union[Quantity, Number]`
          The left argument of the operation.
      right : `Union[Quantity, Number]`
          The right argument of the operation.
      op : `Callable[[T, T], bool]`
          The boolean operation to be used.
  
      Returns
      -------
      bool
          The result of performing `op` on with `left` and `right`.
      """
      left, right = Quantity.validate(left, right)
      boolean = op(left.size, right.size)
      return boolean
  
imports: import operator
  from typing import Union, Tuple, Callable, TypeVar
  from numbers import Number
  from decimal import Decimal, ROUND_DOWN
  from functools import total_ordering
  from tensortrade.core.exceptions import InvalidNegativeQuantity, IncompatibleInstrumentOperation, InvalidNonNumericQuantity, QuantityOpPathMismatch
label_desc: Use image node_id 10 for calling the Quantity obj's underlying member method code with example usage: obj._bool_op(left, right, op) and returns: boolean