# Path: acpype/utils.py
# def _getoutput(cmd):
#     """
#     To simulate commands.getoutput
#     shell=True is necessary despite security issues
#     """
#     out = sub.Popen(cmd, shell=True, stderr=sub.STDOUT, stdout=sub.PIPE).communicate()[0][:-1]
#     return out.decode()


import fnmatch
import os
import sys
from acpype.utils import _getoutput
        for molLabel in ET1:
            mol, structure = molLabel.split("_")
            cmd = f"grep -e '^ATOM' {mol}/*{structure}.out"
            out = _getoutput(cmd)
            print("# %s #" % molLabel)
            print(out, "\n")

    if WT7:
        print("=>Mols have atoms in close contact")
        for molLabel in WT7:
            mol, structure = molLabel.split("_")
            cmd = f"grep -e '^Warning: Close contact of' {mol}/*{structure}.out"
            out = _getoutput(cmd)
            print("# %s #" % molLabel)
            print(out, "\n")

    if WT5:
        print("=>Mols have irregular bonds")
        for molLabel in WT5:
            mol, structure = molLabel.split("_")
            cmd = f"grep -A 1 -e '^WARNING: There is a bond of' {mol}/*{structure}.out"
            out = _getoutput(cmd)
            print("# %s #" % molLabel)
            print(out, "\n")

    if ET2:
        print("=>Mols have atoms too close")
        for molLabel in ET2:
            mol, structure = molLabel.split("_")
            cmd = f"grep -e '^ .*ATOM' {mol}/*{structure}.out"

# Path: acpype/utils.py
# def _getoutput(cmd):
#     """
#     To simulate commands.getoutput
#     shell=True is necessary despite security issues
#     """
#     out = sub.Popen(cmd, shell=True, stderr=sub.STDOUT, stdout=sub.PIPE).communicate()[0][:-1]
#     return out.decode()


# Path: scripts/analyse_test_acpype_db_ligands.py
import fnmatch
import os
import sys
from acpype.utils import _getoutput

        for molLabel in ET1:
            mol, structure = molLabel.split("_")
            cmd = f"grep -e '^ATOM' {mol}/*{structure}.out"
            out = _getoutput(cmd)
            print("# %s #" % molLabel)
            print(out, "\n")

    if WT7:
        print("=>Mols have atoms in close contact")
        for molLabel in WT7:
            mol, structure = molLabel.split("_")
            cmd = f"grep -e '^Warning: Close contact of' {mol}/*{structure}.out"
            out = _getoutput(cmd)
            print("# %s #" % molLabel)
            print(out, "\n")

    if WT5:
        print("=>Mols have irregular bonds")
        for molLabel in WT5:
            mol, structure = molLabel.split("_")
            cmd = f"grep -A 1 -e '^WARNING: There is a bond of' {mol}/*{structure}.out"
            out = _getoutput(cmd)
            print("# %s #" % molLabel)
            print(out, "\n")

    if ET2:
        print("=>Mols have atoms too close")
        for molLabel in ET2:
            mol, structure = molLabel.split("_")
            cmd = f"grep -e '^ .*ATOM' {mol}/*{structure}.out"

            out = _getoutput(cmd)