code: def CheckRepeatLogic(filename, linenumber, clean_lines, errors):
      
      line = clean_lines.lines[linenumber]
      for cmd in _logic_commands:
          if re.search(r'\b%s\b'%cmd, line.lower()):
              m = _RE_LOGIC_CHECK.search(line)
              if m:
                  errors(filename, linenumber, 'readability/logic',
                          'Expression repeated inside %s; '
                          'better to use only %s()'%(cmd, m.group(1)))
              break
docs: Check for logic inside else, endif etc