def _fg(file, pattern, ops):
  with open(file, 'r') as f:
    text = f.readlines()
    z = len(text)
    for i in range(z):
      line = text[i]
      result = pattern.match(line.strip())
      if not result: result = (ops.pattern in line.strip())
      if result:
        if ops.A:
          if i < ops.A_num:
            j = i
          else:
            j = ops.A_num
          print(''.join(text[i-j:i]), end='')
        print(line, end='')
        if ops.B:
          if i+ops.B_num > z:
            j = i-z
          else:
            j = ops.B_num
          print(''.join(text[i+1:i+j+1]), end='')
dataset/ETHPy150Open vhpanisa/pythonix/bin/phase3/grep.py/_fg/swapped operands of `-`