class_docstr: Abstract base class representing a fail-safe control on the behavior of any
  algorithm.
class_docstr_tok: ["Abstract","base","class","representing","a","fail-safe","control","on","the","behavior","of","any","algorithm","."]
docstr: Before any order is executed by TradingAlgorithm, this method should be
  called *exactly once* on each registered TradingControl object.
  
  If the specified asset and amount do not violate this TradingControl's
  restraint given the information in `portfolio`, this method should
  return None and have no externally-visible side-effects.
  
  If the desired order violates this TradingControl's contraint, this
  method should call self.fail(asset, amount).
docstr_tok: ["Before","any","order","is","executed","by","TradingAlgorithm",",","this","method","should","be","called","*","exactly","once","*","on","each","registered","TradingControl","object",".","If","the","specified","asset","and","amount","do","not","violate","this","TradingControl's","restraint","given","the","information","in","`","portfolio","`",",","this","method","should","return","None","and","have","no","externally-visible","side-effects",".","If","the","desired","order","violates","this","TradingControl","'s","contraint",",","this","method","should","call","self.fail","(","asset",",","amount",")","."]
code: def validate(
      self, asset, amount, portfolio, algo_datetime, algo_current_data
  ):
      """
      Before any order is executed by TradingAlgorithm, this method should be
      called *exactly once* on each registered TradingControl object.
  
      If the specified asset and amount do not violate this TradingControl's
      restraint given the information in `portfolio`, this method should
      return None and have no externally-visible side-effects.
  
      If the desired order violates this TradingControl's contraint, this
      method should call self.fail(asset, amount).
      """
      raise NotImplementedError
  
imports: import abc
  import logbook
  import pandas
  from six import with_metaclass
  from catalyst.errors import AccountControlViolation, TradingControlViolation
  from catalyst.constants import LOG_LEVEL
label_desc: Use image node_id 2 for calling the TradingControl obj's underlying member method code with example usage: obj.validate(asset, amount, portfolio, algo_datetime, algo_current_data) without return types