def _DoSubstitute(args, context, callback):

  name, formatters = args

  # So we can have {.section is_new}new since {@}{.end}.  Hopefully this idiom
  # is OK.
  if name == '@':
    value = context.Lookup('@')
  else:
    try:
      value = context.Lookup(name)
    except TypeError, e:
      raise EvaluationError(
          'Error evaluating %r in context %r: %r' % (name, context, e))

  for func, args, func_type in formatters:
    try:
      if func_type == ENHANCED_FUNC:
        value = func(value, context, args)
      else:
        value = func(value)
    except KeyboardInterrupt:
      raise
    except Exception, e:
      raise EvaluationError(
          'Formatting value %r with formatter %s raised exception: %r' %
          (value, formatters, e), original_exception=e)

  # TODO: Require a string/unicode instance here?
  if value is None:
    raise EvaluationError('Evaluating %r gave None value' % name)
  callback(value)
Returns balance
dataset/ETHPy150Open cloudbuilders/radioedit/jsontemplate.py/_DoSubstitute--crossover with--dataset/ETHPy150Open treeio/treeio/treeio/finance/models.py/Account.get_balance