@staticmethod
    def open_using_pefile(input_name, input_bytes):
        ''' Open the PE File using the Python pefile module. '''
        try:
            pef = pefile.PE(data=input_bytes, fast_load=False)
        except (__HOLE__, pefile.PEFormatError), error:
            print 'warning: pe_fail (with exception from pefile module) on file: %s' % input_name
            error_str = '(Exception):, %s' % (str(error))
            return None, error_str

        # Now test to see if the features are there/extractable if not return FAIL flag
        if pef.PE_TYPE is None or pef.OPTIONAL_HEADER is None or len(pef.OPTIONAL_HEADER.DATA_DIRECTORY) < 7:
            print 'warning: pe_fail on file: %s' % input_name
            error_str = 'warning: pe_fail on file: %s' % input_name
            return None, error_str

        # Success
        return pef, None

    # Extract various set of features using PEfile module
dataset/ETHPy150Open SuperCowPowers/workbench/workbench/workers/pe_features.py/PEFileWorker.open_using_pefile