class_docstr: The base class for all structured metrics used within TFMA.
  
  This class allows custom metrics to control how proto serialization happens,
  and how to handle basic algebraic operations used in computing confidence
  intervals and model diffs. By implementing the _apply_binary_op methods,
  subclasses can then be treated like primitive numeric types.
class_docstr_tok: ["The","base","class","for","all","structured","metrics","used","within","TFMA",".","This","class","allows","custom","metrics","to","control","how","proto","serialization","happens",",","and","how","to","handle","basic","algebraic","operations","used","in","computing","confidence","intervals","and","model","diffs",".","By","implementing","the","_apply_binary_op","methods",",","subclasses","can","then","be","treated","like","primitive","numeric","types","."]
docstr: Applies the binary operator on each element in self and a single float.
  
  This function supports broadcasting operations on the structured metric by
  applying `op` on each element in self, paired with the primitive value
  `other`. This makes it possible do things like add a fixed quantity to every
  element in a structure. For example, to implement for a list, this function
  could be implemented as:
  
      return [op(elem, other) for elem in self]
  
  Args:
    other: The value to be used as the second operand when applying `op`.
    op: A binary operator which should be applied elementwise to each element
      in self and `other`.
  
  Returns:
    A new structured metric that is the result of applying `op` on each
    element within self and a single value, `other`.
docstr_tok: ["Applies","the","binary","operator","on","each","element","in","self","and","a","single","float",".","This","function","supports","broadcasting","operations","on","the","structured","metric","by","applying","`","op","`","on","each","element","in","self",",","paired","with","the","primitive","value","`","other","`",".","This","makes","it","possible","do","things","like","add","a","fixed","quantity","to","every","element","in","a","structure",".","For","example",",","to","implement","for","a","list",",","this","function","could","be","implemented","as",":","return","[","op","(","elem",",","other",")","for","elem","in","self","]","Args",":","other",":","The","value","to","be","used","as","the","second","operand","when","applying","`","op","`",".","op",":","A","binary","operator","which","should","be","applied","elementwise","to","each","element","in","self","and","`","other","`",".","Returns",":","A","new","structured","metric","that","is","the","result","of","applying","`","op","`","on","each","element","within","self","and","a","single","value",",","`","other","`","."]
code: def _apply_binary_op_broadcast(
      self: ConcreteStructuredMetricValue,
      other: float,
      op: Callable[[float, float], float],
  ) -> ConcreteStructuredMetricValue:
      """Applies the binary operator on each element in self and a single float.
  
      This function supports broadcasting operations on the structured metric by
      applying `op` on each element in self, paired with the primitive value
      `other`. This makes it possible do things like add a fixed quantity to every
      element in a structure. For example, to implement for a list, this function
      could be implemented as:
  
          return [op(elem, other) for elem in self]
  
      Args:
        other: The value to be used as the second operand when applying `op`.
        op: A binary operator which should be applied elementwise to each element
          in self and `other`.
  
      Returns:
        A new structured metric that is the result of applying `op` on each
        element within self and a single value, `other`.
      """
      ...
  
imports: import abc
  import datetime
  import operator
  from typing import Any, Callable, Dict, Iterable, List, MutableMapping, NamedTuple, Optional, TypeVar, Tuple, Union
  from apache_beam.utils import shared
  import numpy
  import six
  import tensorflow
  from tensorflow_model_analysis.proto import metrics_for_slice_pb2
label_desc: Use image node_id 3 for calling the StructuredMetricValue obj's underlying member method code with example usage: obj._apply_binary_op_broadcast(other, op) without return types