parameters: (main, cmp, skip_begin=0, skip_end=0, str_input=True)
return_statement: return None
docstring: Compares logs but allows for certain lines to be excluded from comparison.
      If str_input is True (default), the input it assumed to be a string,
      which is split into lines. Otherwise the input is assumed to be a file.
      Returns None on success, mismatch otherwise.
docstring_summary: Compares logs but allows for certain lines to be excluded from comparison.
      If str_input is True (default), the input it assumed to be a string,
      which is split into lines. Otherwise the input is assumed to be a file.
      Returns None on success, mismatch otherwise.
docstring_tokens: Compares logs but allows for certain lines to be excluded from comparison . If str_input is True ( default ) the input it assumed to be a string which is split into lines . Otherwise the input is assumed to be a file . Returns None on success mismatch otherwise .
function: def compare_logs(main, cmp, skip_begin=0, skip_end=0, str_input=True):
      '''
      Compares logs but allows for certain lines to be excluded from comparison.
      If str_input is True (default), the input it assumed to be a string,
      which is split into lines. Otherwise the input is assumed to be a file.
      Returns None on success, mismatch otherwise.
      '''
      main_inp = main.splitlines() if str_input else main.readlines()
      cmp_inp = cmp.splitlines() if str_input else cmp.readlines()
      # rewind logs after consumption
      if not str_input:
          main.seek(0)
          cmp.seek(0)
      for lhs, rhs in list(zip(main_inp, cmp_inp))[skip_begin:-skip_end or None]:
          if lhs != rhs:
              # check skip patterns
              for skip in SKIP_MATCH:
                  # both lines must contain the pattern
                  if re.search(skip, lhs) and re.search(skip, rhs):
                      break
              # otherwise return mismatching lines
              else:
                  return (lhs, rhs)
      return None
function_tokens: def compare_logs ( main , cmp , skip_begin = 0 , skip_end = 0 , str_input = True ) : main_inp = main . splitlines ( ) if str_input else main . readlines ( ) cmp_inp = cmp . splitlines ( ) if str_input else cmp . readlines ( ) # rewind logs after consumption if not str_input : main . seek ( 0 ) cmp . seek ( 0 ) for lhs , rhs in list ( zip ( main_inp , cmp_inp ) ) [ skip_begin : - skip_end or None ] : if lhs != rhs : # check skip patterns for skip in SKIP_MATCH : # both lines must contain the pattern if re . search ( skip , lhs ) and re . search ( skip , rhs ) : break # otherwise return mismatching lines else : return ( lhs , rhs ) return None