# Path: vmcatcher/__version__.py

# 
# Path: vmcatcher/listutils.py
# def pairsNnot(list_a,list_b):
#     len_generate_list = len(list_a)
#     len_image_list = len(list_b)
#     ocupies_generate_list = set(range(len_generate_list))
#     ocupies_image_list = set(range(len_image_list))
#     ocupies_pairs = ocupies_image_list.intersection(ocupies_generate_list)
#     diff_a = ocupies_generate_list.difference(ocupies_image_list)
#     diff_b = ocupies_image_list.difference(ocupies_generate_list)
#     arepairs = []
#     for i in ocupies_pairs:
#         arepairs.append([list_a[i],list_b[i]])
#     notpairs_a = []
#     for i in diff_a:
#         notpairs_a.append(list_a[i])
#     notpairs_b = []
#     for i in diff_b:
#         notpairs_b.append(list_b[i])
# 
#     return arepairs,notpairs_a,notpairs_b


from sqlalchemy import create_engine
from smimeX509validation import TrustStore, LoadDirChainOfTrust,smimeX509validation, smimeX509ValidationError
from vmcatcher.__version__ import version
from sqlalchemy.orm import sessionmaker
from sqlalchemy.exc import IntegrityError, DatabaseError, ProgrammingError
from hepixvmitrust.vmitrustlib import VMimageListDecoder as VMimageListDecoder
from hepixvmitrust.vmitrustlib import time_format_definition as time_format_definition
from vmcatcher.listutils import pairsNnot
import vmcatcher.databaseDefinition as model
import os
import logging
import optparse
import sys
import vmcatcher
import urllib2
import urllib
import hashlib
import datetime
    import json
    import simplejson
import vmcatcher.outputfacard
import vmcatcher.queryby
                    db_sub = query_row[1]
                    db_subAuthEnd = query_row[2]
                    Session.delete(db_subAuthEnd)
                    Session.commit()

    def endorsers_info(self,selected):
        errorhappened = False
        Session = self.SessionFactory()
        for selector_filter in selected:
            output_fileptr = sys.stdout
            query_endorser = self.selector_curent(Session,selector_filter)
            if query_endorser.count() == 0:
                self.log.error("endorser '%s' not found" % (selector_filter))
                continue
            self._outputter.fpOutput = sys.stdout
            self._outputter.saSession = Session
            self._outputter.x509anchor = self.anchor
            for endorser in query_endorser:
                self._outputter.display_endorser(endorser)
                princible_query = Session.query(model.EndorserPrincible).\
                    filter(model.EndorserPrincible.endorser == endorser.id)

                if princible_query.count() == 0:
                    self.log.warning("endorser '%s' has no princibles" % (selector_filter))
                else:
                    pass
        return True

    def endorser_create(self,endorser,subjects,issuers):
        # Check input parameters.

# Path: vmcatcher/__version__.py

# 
# Path: vmcatcher/listutils.py
# def pairsNnot(list_a,list_b):
#     len_generate_list = len(list_a)
#     len_image_list = len(list_b)
#     ocupies_generate_list = set(range(len_generate_list))
#     ocupies_image_list = set(range(len_image_list))
#     ocupies_pairs = ocupies_image_list.intersection(ocupies_generate_list)
#     diff_a = ocupies_generate_list.difference(ocupies_image_list)
#     diff_b = ocupies_image_list.difference(ocupies_generate_list)
#     arepairs = []
#     for i in ocupies_pairs:
#         arepairs.append([list_a[i],list_b[i]])
#     notpairs_a = []
#     for i in diff_a:
#         notpairs_a.append(list_a[i])
#     notpairs_b = []
#     for i in diff_b:
#         notpairs_b.append(list_b[i])
# 
#     return arepairs,notpairs_a,notpairs_b


# Path: vmcatcher/vmcatcher_endorser/controler.py
from sqlalchemy import create_engine
from smimeX509validation import TrustStore, LoadDirChainOfTrust,smimeX509validation, smimeX509ValidationError
from vmcatcher.__version__ import version
from sqlalchemy.orm import sessionmaker
from sqlalchemy.exc import IntegrityError, DatabaseError, ProgrammingError
from hepixvmitrust.vmitrustlib import VMimageListDecoder as VMimageListDecoder
from hepixvmitrust.vmitrustlib import time_format_definition as time_format_definition
from vmcatcher.listutils import pairsNnot
import vmcatcher.databaseDefinition as model
import os
import logging
import optparse
import sys
import vmcatcher
import urllib2
import urllib
import hashlib
import datetime
    import json
    import simplejson
import vmcatcher.outputfacard
import vmcatcher.queryby

                    db_sub = query_row[1]
                    db_subAuthEnd = query_row[2]
                    Session.delete(db_subAuthEnd)
                    Session.commit()

    def endorsers_info(self,selected):
        errorhappened = False
        Session = self.SessionFactory()
        for selector_filter in selected:
            output_fileptr = sys.stdout
            query_endorser = self.selector_curent(Session,selector_filter)
            if query_endorser.count() == 0:
                self.log.error("endorser '%s' not found" % (selector_filter))
                continue
            self._outputter.fpOutput = sys.stdout
            self._outputter.saSession = Session
            self._outputter.x509anchor = self.anchor
            for endorser in query_endorser:
                self._outputter.display_endorser(endorser)
                princible_query = Session.query(model.EndorserPrincible).\
                    filter(model.EndorserPrincible.endorser == endorser.id)

                if princible_query.count() == 0:
                    self.log.warning("endorser '%s' has no princibles" % (selector_filter))
                else:
                    pass
        return True

    def endorser_create(self,endorser,subjects,issuers):
        # Check input parameters.

        pairs, extra_subs ,extra_issuers = pairsNnot(subjects,issuers)