docstr: Compute signature pattern from stack trace, by remove factors such as date,
  time, temp directory, line numbers, etc. This help to aggregate similar logs
  into same bug patterns
docstr_tok: ["Compute","signature","pattern","from","stack","trace",",","by","remove","factors","such","as","date",",","time",",","temp","directory",",","line","numbers",",","etc",".","This","help","to","aggregate","similar","logs","into","same","bug","patterns"]
code: def _compute_signature(stack_trace: List[str]) -> str:
      """
      Compute signature pattern from stack trace, by remove factors such as date,
      time, temp directory, line numbers, etc. This help to aggregate similar logs
      into same bug patterns
      """
      massaged_trace = []
      for line in stack_trace:
          # remove any hashes that are more than 10 characters
          line = re.sub(r"[a-z0-9]{10,}", "", line.strip())
          # remove any numbers
          line = re.sub(r"\d", "", line)
          if line == "Traceback (most recent call last):":
              continue
          file_line = re.search(r'File "(.*)", (.*)', line)
          if file_line:
              # append the file's base name and caller information; the result string
              # is not something meaningful to human, we just need something that
              # uniquely represent the stack trace
              line = f'{file_line.group(1).split("/")[-1]}{file_line.group(2)}'
          massaged_trace.append(line)
      return "".join(massaged_trace)
  
imports: import re
  from typing import List
label_desc: Use image node_id 3 for calling the LogAggregator obj's underlying member method code with example usage: obj._compute_signature(stack_trace) and returns: str