docs: def _resolve_expression_block(self, expression, context, url_encode, strategy, errors):
          """
          Resolves an expression block found in the template, e.g. @(...). If an evaluation error occurs, expression is
          returned as is.
          """
          try:
              body = expression[1:]  # strip prefix
  
              # if expression doesn't start with ( then check it's an allowed top level context reference
              if not body.startswith('('):
                  top_level = body.split('.')[0].lower()
                  if top_level not in self._allowed_top_levels:
                      return expression
  
              evaluated = self.evaluate_expression(body, context, strategy)
  
              # convert result to string
              result = conversions.to_string(evaluated, context)
  
              return urlquote(result) if url_encode else result
          except EvaluationError as e:
              logger.debug("EvaluationError: %s" % str(e))
  
              # if we can't evaluate expression, include it as is in the output
              errors.append(str(e))
              return expression