class_docstr: Generic node for performing any operation like A.fn(B)
class_docstr_tok: ["Generic","node","for","performing","any","operation","like","A.fn","(","B",")"]
code: def process(self, **args):
      if isinstance(self.fn, tuple):
          for name in self.fn:
              try:
                  fn = getattr(args["A"], name)
                  break
              except AttributeError as e:
                  pass
          else:
              raise e
      else:
          fn = getattr(args["A"], self.fn)
      out = fn(args["B"])
      if out is NotImplemented:
          raise Exception(
              "Operation %s not implemented between %s and %s"
              % (fn, str(type(args["A"])), str(type(args["B"])))
          )
  
      # Coerce dtype if requested
      typ = self.stateGroup.state()["outputType"]
      if typ == "no change":
          pass
      elif typ == "input A":
          out = out.astype(args["A"].dtype)
      elif typ == "input B":
          out = out.astype(args["B"].dtype)
      else:
          out = out.astype(typ)
  
      # print "     ", fn, out
      return {"Out": out}
  
imports: from ..Node import Node
  from .common import CtrlNode
label_desc: Use image node_id 2 for calling the BinOpNode obj's underlying member method code with example usage: obj.process() and returns: dict