def ignoreCode(code, lineFlags):
    """
    Function to check, if the given code should be ignored as per line flags.
    
    @param code error code to be checked
    @type str
    @param lineFlags list of line flags to check against
    @type list of str
    @return flag indicating to ignore the code
    @rtype bool
    """
    if lineFlags:
        if '__IGNORE_WARNING__' in lineFlags or 'noqa' in lineFlags:
            return True
        for flag in lineFlags:
            if flag.startswith('__IGNORE_WARNING_'):
                ignoredCode = flag[2:-2].rsplit('_', 1)[-1]
                if code.startswith(ignoredCode):
                    return True
    return False
