original_docstring: 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.
  
          Args:
              test_record (dict): loaded fixture file JSON as a dict.
          
docstring: Detect and apply helper functions to test event data
  Helpers are declared in test fixtures via the following keyword:
  ""
  
  Supported helper functions:
  last_hour: return the current epoch time minus 60 seconds to pass the
  last_hour rule helper.
docstring_tokens: Detect and apply helper functions to test event data Helpers are declared in test fixtures via the following keyword : " " Supported helper functions : last_hour : return the current epoch time minus 60 seconds to pass the last_hour rule helper .
code: def apply_helpers(test_record):
          """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.
  
          Args:
              test_record (dict): loaded fixture file JSON as a dict.
          """
          # 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.iteritems():
                  if isinstance(value, (str, unicode)):
                      test_record[key] = re.sub(
                          helper_regex,
                          lambda match: record_helpers[match.group('helper')](),
                          test_record[key]
                      )
                  elif isinstance(value, dict):
                      find_and_apply_helpers(test_record[key])
  
          find_and_apply_helpers(test_record)
code_tokens: def apply_helpers ( test_record ) : 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 . iteritems ( ) : if isinstance ( value , ( str , unicode ) ) : test_record [ key ] = re . sub ( helper_regex , lambda match : record_helpers [ match . group ( 'helper' ) ] ( ) , test_record [ key ] ) elif isinstance ( value , dict ) : find_and_apply_helpers ( test_record [ key ] ) find_and_apply_helpers ( test_record )
short_docstring: Detect and apply helper functions to test event data
  Helpers are declared in test fixtures via the following keyword:
  "<helpers:helper_name>"
short_docstring_tokens: Detect and apply helper functions to test event data Helpers are declared in test fixtures via the following keyword : " <helpers : helper_name > "
comment: """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.
  
          Args:
              test_record (dict): loaded fixture file JSON as a dict.
          """$SEP$# declare all helper functions here, they should always return a string$SEP$"""Apply any helpers to the passed in test_record"""