class_docstr: This mixin provides ability to split the code into subroutines based on
  the size of the AST.
  
  Subclasses only need to implement `create_code_generator` method.
  
  Their code generators should implement 3 methods:
       - function_definition;
       - function_invocation;
       - add_return_statement.
  
  Interpreter should prepare at least one subroutine using method
  `enqueue_subroutine` and then call method `process_subroutine_queue` with
  instance of code generator, which will be populated with the result code.
docstr: The logic below counts the number of non-binary expressions
  in a non-recursive branch of a binary expression to account
  for large tree-like models and adjust the size check frequency
  if necessary.
docstr_tok: ["The","logic","below","counts","the","number","of","non-binary","expressions","in","a","non-recursive","branch","of","a","binary","expression","to","account","for","large","tree-like","models","and","adjust","the","size","check","frequency","if","necessary","."]
code: def _adjust_ast_check_frequency(self, expr):
      """
      The logic below counts the number of non-binary expressions
      in a non-recursive branch of a binary expression to account
      for large tree-like models and adjust the size check frequency
      if necessary.
      """
      cnt = None
      if not isinstance(expr.left, ast.BinExpr):
          cnt = ast.count_exprs(expr.left, exclude_list={ast.BinExpr})
      elif not isinstance(expr.right, ast.BinExpr):
          cnt = ast.count_exprs(expr.right, exclude_list={ast.BinExpr})
      if cnt and cnt < self.ast_size_per_subroutine_threshold:
          return math.ceil(self.ast_size_per_subroutine_threshold / cnt)
      return self.ast_size_check_frequency
  
imports: import math
  import sys
  from collections import namedtuple
  from m2cgen import ast
  from m2cgen.interpreters.interpreter import BaseToCodeInterpreter
label_desc: Use image node_id 5 for calling the SubroutinesMixin obj's underlying member method code with example usage: obj._adjust_ast_check_frequency(expr) and returns: self, math