docstr: Detect and apply helper functions to test event data
  
  Helpers are declared in test fixtures via the following keyword:
  "<helpers:helper_name>"
  
  Supported helper functions:
      last_hour: return the current epoch time minus 60 seconds to pass the
                 last_hour rule helper.
docstr_tok: ["Detect","and","apply","helper","functions","to","test","event","data","Helpers","are","declared","in","test","fixtures","via","the","following","keyword",":","''","<","helpers",":","helper_name",">","''","Supported","helper","functions",":","last_hour",":","return","the","current","epoch","time","minus","60","seconds","to","pass","the","last_hour","rule","helper","."]
code: def _apply_helpers(self):
      """Detect and apply helper functions to test event data
  
      Helpers are declared in test fixtures via the following keyword:
      "<helpers:helper_name>"
  
      Supported helper functions:
          last_hour: return the current epoch time minus 60 seconds to pass the
                     last_hour rule helper.
      """
      # declare all helper functions here, they should always return a string
      record_helpers = {"last_hour": lambda: str(int(time.time()) - 60)}
      helper_regex = re.compile(r"<helper:(?P<helper>\w+)>")
  
      def _find_and_apply_helpers(test_record):
          """Apply any helpers to the passed in test_record"""
          for key, value in test_record.items():
              if isinstance(value, str):
                  test_record[key] = re.sub(
                      helper_regex,
                      lambda match: record_helpers[
                          match.group("helper")
                      ](),
                      value,
                  )
              elif isinstance(value, dict):
                  _find_and_apply_helpers(test_record[key])
  
      _find_and_apply_helpers(self._event)
  
imports: import base64
  import json
  import re
  import time
  import zlib
  from mock import patch
  from streamalert.classifier.parsers import ParserBase
  from streamalert.shared import rule
  from streamalert.shared.logger import get_logger
  from streamalert_cli.test.mocks import LookupTableMocks, ThreatIntelMocks
label_desc: Use image node_id 24 for calling the TestEvent obj's underlying member method code with example usage: obj._apply_helpers() without return types