class_docstr: Raised to tell the user that there is a problem with the template.
class_docstr_tok: ["Raised","to","tell","the","user","that","there","is","a","problem","with","the","template","."]
code: def __str__(self) -> str:
      # for translated errors we only return the message
      if self.translated:
          return t.cast(str, self.message)
  
      # otherwise attach some stuff
      location = f"line {self.lineno}"
      name = self.filename or self.name
      if name:
          location = f'File "{name}", {location}'
      lines = [t.cast(str, self.message), "  " + location]
  
      # if the source is set, add the line to the output
      if self.source is not None:
          try:
              line = self.source.splitlines()[self.lineno - 1]
          except IndexError:
              pass
          else:
              lines.append("    " + line.strip())
  
      return "\n".join(lines)
  
imports: import typing
label_desc: Use image node_id 2 for calling the TemplateSyntaxError obj's underlying member method code with example usage: obj.__str__() and returns: str, t