#!/usr/bin/env python
# -*- coding: utf-8 -*- 

#
# Generated Wed Nov 14 13:01:01 2012 by generateDS.py version 2.7c.
#

import sys
import getopt
import re as re_

import cybox.bindings.cybox_core_1_0 as cybox_core_binding
import cybox.bindings.cybox_common_types_1_0 as cybox_common_binding
import stix.bindings.iodef.iodef_1_0 as iodef_binding
import stix.bindings.stix_common_0_2 as stix_common_binding
import stix.bindings.stix_ttp_0_6 as stix_ttp_binding
import stix.bindings.stix_coa_0_3_1 as stix_coa_binding
import stix.bindings.data_marking_0_5 as data_marking_binding



abs_impl = {'GenericTestMechanismType' : {  'module':'stix_indicator_1_1',
                                            'python_name':'GenericTestMechanismType',
                                            'namespace_prefix':'indicator',
                                            'namespace':'http://stix.mitre.org/Indicator',
                                            'schema_location':'STIX-Indicator_v1.1.xsd',
                                        }
            }



etree_ = None
Verbose_import_ = False
(   XMLParser_import_none, XMLParser_import_lxml,
    XMLParser_import_elementtree
    ) = range(3)
XMLParser_import_library = None
try:
    # lxml
    from lxml import etree as etree_
    XMLParser_import_library = XMLParser_import_lxml
    if Verbose_import_:
        print("running with lxml.etree")
except ImportError:
    try:
        # cElementTree from Python 2.5+
        import xml.etree.cElementTree as etree_
        XMLParser_import_library = XMLParser_import_elementtree
        if Verbose_import_:
            print("running with cElementTree on Python 2.5+")
    except ImportError:
        try:
            # ElementTree from Python 2.5+
            import xml.etree.ElementTree as etree_
            XMLParser_import_library = XMLParser_import_elementtree
            if Verbose_import_:
                print("running with ElementTree on Python 2.5+")
        except ImportError:
            try:
                # normal cElementTree install
                import cElementTree as etree_
                XMLParser_import_library = XMLParser_import_elementtree
                if Verbose_import_:
                    print("running with cElementTree")
            except ImportError:
                try:
                    # normal ElementTree install
                    import elementtree.ElementTree as etree_
                    XMLParser_import_library = XMLParser_import_elementtree
                    if Verbose_import_:
                        print("running with ElementTree")
                except ImportError:
                    raise ImportError("Failed to import ElementTree from any known place")

def parsexml_(*args, **kwargs):
    if (XMLParser_import_library == XMLParser_import_lxml and
        'parser' not in kwargs):
        # Use the lxml ElementTree compatible parser so that, e.g.,
        #   we ignore comments.
        kwargs['parser'] = etree_.ETCompatXMLParser()
    doc = etree_.parse(*args, **kwargs)
    return doc

#
# User methods
#
# Calls to the methods in these classes are generated by generateDS.py.
# You can replace these methods by re-implementing the following class
#   in a module named generatedssuper.py.

try:
    from generatedssuper import GeneratedsSuper
except ImportError, exp:

    class GeneratedsSuper(object):
        def gds_format_string(self, input_data, input_name=''):
            return input_data
        def gds_validate_string(self, input_data, node, input_name=''):
            return input_data
        def gds_format_integer(self, input_data, input_name=''):
            return '%d' % input_data
        def gds_validate_integer(self, input_data, node, input_name=''):
            return input_data
        def gds_format_integer_list(self, input_data, input_name=''):
            return '%s' % input_data
        def gds_validate_integer_list(self, input_data, node, input_name=''):
            values = input_data.split()
            for value in values:
                try:
                    fvalue = float(value)
                except (TypeError, ValueError), exp:
                    raise_parse_error(node, 'Requires sequence of integers')
            return input_data
        def gds_format_float(self, input_data, input_name=''):
            return '%f' % input_data
        def gds_validate_float(self, input_data, node, input_name=''):
            return input_data
        def gds_format_float_list(self, input_data, input_name=''):
            return '%s' % input_data
        def gds_validate_float_list(self, input_data, node, input_name=''):
            values = input_data.split()
            for value in values:
                try:
                    fvalue = float(value)
                except (TypeError, ValueError), exp:
                    raise_parse_error(node, 'Requires sequence of floats')
            return input_data
        def gds_format_double(self, input_data, input_name=''):
            return '%e' % input_data
        def gds_validate_double(self, input_data, node, input_name=''):
            return input_data
        def gds_format_double_list(self, input_data, input_name=''):
            return '%s' % input_data
        def gds_validate_double_list(self, input_data, node, input_name=''):
            values = input_data.split()
            for value in values:
                try:
                    fvalue = float(value)
                except (TypeError, ValueError), exp:
                    raise_parse_error(node, 'Requires sequence of doubles')
            return input_data
        def gds_format_boolean(self, input_data, input_name=''):
            return '%s' % input_data
        def gds_validate_boolean(self, input_data, node, input_name=''):
            return input_data
        def gds_format_boolean_list(self, input_data, input_name=''):
            return '%s' % input_data
        def gds_validate_boolean_list(self, input_data, node, input_name=''):
            values = input_data.split()
            for value in values:
                if value not in ('true', '1', 'false', '0', ):
                    raise_parse_error(node, 'Requires sequence of booleans ("true", "1", "false", "0")')
            return input_data
        def gds_str_lower(self, instring):
            return instring.lower()
        def get_path_(self, node):
            path_list = []
            self.get_path_list_(node, path_list)
            path_list.reverse()
            path = '/'.join(path_list)
            return path
        Tag_strip_pattern_ = re_.compile(r'\{.*\}')
        def get_path_list_(self, node, path_list):
            if node is None:
                return
            tag = GeneratedsSuper.Tag_strip_pattern_.sub('', node.tag)
            if tag:
                path_list.append(tag)
            self.get_path_list_(node.getparent(), path_list)
        def get_class_obj_(self, node, default_class=None):
            class_obj1 = default_class
            if 'xsi' in node.nsmap:
                classname = node.get('{%s}type' % node.nsmap['xsi'])
                if classname is not None:
                    names = classname.split(':')
                    if len(names) == 2:
                        classname = names[1]
                    class_obj2 = globals().get(classname)
                    if class_obj2 is not None:
                        class_obj1 = class_obj2
            return class_obj1
        def gds_build_any(self, node, type_name=None):
            return None


#
# If you have installed IPython you can uncomment and use the following.
# IPython is available from http://ipython.scipy.org/.
#

## from IPython.Shell import IPShellEmbed
## args = ''
## ipshell = IPShellEmbed(args,
##     banner = 'Dropping into IPython',
##     exit_msg = 'Leaving Interpreter, back to program.')

# Then use the following line where and when you want to drop into the
# IPython shell:
#    ipshell('<some message> -- Entering ipshell.\nHit Ctrl-D to exit')

#
# Globals
#

ExternalEncoding = 'ascii'
Tag_pattern_ = re_.compile(r'({.*})?(.*)')
String_cleanup_pat_ = re_.compile(r"[\n\r\s]+")
Namespace_extract_pat_ = re_.compile(r'{(.*)}(.*)')

#
# Support/utility functions.
#

def showIndent(outfile, level, pretty_print=True):
    if pretty_print:
        for idx in range(level):
            outfile.write('    ')

def quote_xml(inStr):
    if not inStr:
        return ''
    s1 = (isinstance(inStr, basestring) and inStr or
          '%s' % inStr)
    s1 = s1.replace('&', '&amp;')
    s1 = s1.replace('<', '&lt;')
    s1 = s1.replace('>', '&gt;')
    return s1

def quote_attrib(inStr):
    s1 = (isinstance(inStr, basestring) and inStr or
          '%s' % inStr)
    s1 = s1.replace('&', '&amp;')
    s1 = s1.replace('<', '&lt;')
    s1 = s1.replace('>', '&gt;')
    if '"' in s1:
        if "'" in s1:
            s1 = '"%s"' % s1.replace('"', "&quot;")
        else:
            s1 = "'%s'" % s1
    else:
        s1 = '"%s"' % s1
    return s1

def quote_python(inStr):
    s1 = inStr
    if s1.find("'") == -1:
        if s1.find('\n') == -1:
            return "'%s'" % s1
        else:
            return "'''%s'''" % s1
    else:
        if s1.find('"') != -1:
            s1 = s1.replace('"', '\\"')
        if s1.find('\n') == -1:
            return '"%s"' % s1
        else:
            return '"""%s"""' % s1

def get_all_text_(node):
    if node.text is not None:
        text = node.text
    else:
        text = ''
    for child in node:
        if child.tail is not None:
            text += child.tail
    return text

def find_attr_value_(attr_name, node):
    attrs = node.attrib
    attr_parts = attr_name.split(':')
    value = None
    if len(attr_parts) == 1:
        value = attrs.get(attr_name)
    elif len(attr_parts) == 2:
        prefix, name = attr_parts
        namespace = node.nsmap.get(prefix)
        if namespace is not None:
            value = attrs.get('{%s}%s' % (namespace, name, ))
    return value


class GDSParseError(Exception):
    pass

def raise_parse_error(node, msg):
    if XMLParser_import_library == XMLParser_import_lxml:
        msg = '%s (element %s/line %d)' % (msg, node.tag, node.sourceline, )
    else:
        msg = '%s (element %s)' % (msg, node.tag, )
    raise GDSParseError(msg)


class MixedContainer:
    # Constants for category:
    CategoryNone = 0
    CategoryText = 1
    CategorySimple = 2
    CategoryComplex = 3
    # Constants for content_type:
    TypeNone = 0
    TypeText = 1
    TypeString = 2
    TypeInteger = 3
    TypeFloat = 4
    TypeDecimal = 5
    TypeDouble = 6
    TypeBoolean = 7
    def __init__(self, category, content_type, name, value):
        self.category = category
        self.content_type = content_type
        self.name = name
        self.value = value
    def getCategory(self):
        return self.category
    def getContenttype(self, content_type):
        return self.content_type
    def getValue(self):
        return self.value
    def getName(self):
        return self.name
    def export(self, outfile, level, name, namespace, pretty_print=True):
        if self.category == MixedContainer.CategoryText:
            # Prevent exporting empty content as empty lines.
            if self.value.strip(): 
                outfile.write(self.value)
        elif self.category == MixedContainer.CategorySimple:
            self.exportSimple(outfile, level, name)
        else:    # category == MixedContainer.CategoryComplex
            self.value.export(outfile, level, namespace, name, pretty_print)
    def exportSimple(self, outfile, level, name):
        if self.content_type == MixedContainer.TypeString:
            outfile.write('<%s>%s</%s>' % (self.name, self.value, self.name))
        elif self.content_type == MixedContainer.TypeInteger or \
                self.content_type == MixedContainer.TypeBoolean:
            outfile.write('<%s>%d</%s>' % (self.name, self.value, self.name))
        elif self.content_type == MixedContainer.TypeFloat or \
                self.content_type == MixedContainer.TypeDecimal:
            outfile.write('<%s>%f</%s>' % (self.name, self.value, self.name))
        elif self.content_type == MixedContainer.TypeDouble:
            outfile.write('<%s>%g</%s>' % (self.name, self.value, self.name))
    def exportLiteral(self, outfile, level, name):
        if self.category == MixedContainer.CategoryText:
            showIndent(outfile, level)
            outfile.write('model_.MixedContainer(%d, %d, "%s", "%s"),\n' % \
                (self.category, self.content_type, self.name, self.value))
        elif self.category == MixedContainer.CategorySimple:
            showIndent(outfile, level)
            outfile.write('model_.MixedContainer(%d, %d, "%s", "%s"),\n' % \
                (self.category, self.content_type, self.name, self.value))
        else:    # category == MixedContainer.CategoryComplex
            showIndent(outfile, level)
            outfile.write('model_.MixedContainer(%d, %d, "%s",\n' % \
                (self.category, self.content_type, self.name,))
            self.value.exportLiteral(outfile, level + 1)
            showIndent(outfile, level)
            outfile.write(')\n')


class MemberSpec_(object):
    def __init__(self, name='', data_type='', container=0):
        self.name = name
        self.data_type = data_type
        self.container = container
    def set_name(self, name): self.name = name
    def get_name(self): return self.name
    def set_data_type(self, data_type): self.data_type = data_type
    def get_data_type_chain(self): return self.data_type
    def get_data_type(self):
        if isinstance(self.data_type, list):
            if len(self.data_type) > 0:
                return self.data_type[-1]
            else:
                return 'xs:string'
        else:
            return self.data_type
    def set_container(self, container): self.container = container
    def get_container(self): return self.container

def _cast(typ, value):
    if typ is None or value is None:
        return value
    return typ(value)

#
# Data representation classes.
#

class IndicatorType(GeneratedsSuper):
    """Light-weight object for capturing metadata relating to indicators.
    If content producers choose to include optional cybox observable
    elements then this 'indicator' element also serves as a wrapper
    for that observable, providing incident-specific context to the
    observable. Content creators should either create a "simple
    indicator" containing one observable, or a "composite indicator"
    containing multiple indicators. Specifies a unique ID for this
    Indicator. Specifies a reference to the ID of an Indicator
    specified elsewhere.Specifies the relevant STIX-Indicator schema
    version for this content."""
    subclass = None
    superclass = None
    def __init__(self, idref=None, id=None, version=None, IndicatorType=None, Name=None, AlternativeID_Alias=None, Description=None, ValidTimePosition=None, Observables=None, CompositeIndicatorExpression=None, IndicatedTTP=None, KillChainPhases=None, TestMechanisms=None, LikelyImpact=None, SuggestedCOAs=None, Handling=None, Confidence=None, Sightings=None, RelatedIndicators=None, Producer=None, ExtendedInformation=None):
        self.idref = _cast(None, idref)
        self.id = _cast(None, id)
        self.version = _cast(None, version)
        self.IndicatorType = IndicatorType
        self.Name = Name
        if AlternativeID_Alias is None:
            self.AlternativeID_Alias = []
        else:
            self.AlternativeID_Alias = AlternativeID_Alias
        self.Description = Description
        if ValidTimePosition is None:
            self.ValidTimePosition = []
        else:
            self.ValidTimePosition = ValidTimePosition
        self.Observables = Observables
        self.CompositeIndicatorExpression = CompositeIndicatorExpression
        if IndicatedTTP is None:
            self.IndicatedTTP = []
        else:
            self.IndicatedTTP = IndicatedTTP
        self.KillChainPhases = KillChainPhases
        self.TestMechanisms = TestMechanisms
        self.LikelyImpact = LikelyImpact
        self.SuggestedCOAs = SuggestedCOAs
        self.Handling = Handling
        self.Confidence = Confidence
        self.Sightings = Sightings
        if RelatedIndicators is None:
            self.RelatedIndicators = []
        else:
            self.RelatedIndicators = RelatedIndicators
        self.Producer = Producer
        self.ExtendedInformation = ExtendedInformation
    def factory(*args_, **kwargs_):
        if IndicatorType.subclass:
            return IndicatorType.subclass(*args_, **kwargs_)
        else:
            return IndicatorType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_IndicatorType(self): return self.IndicatorType
    def set_IndicatorType(self, IndicatorType): self.IndicatorType = IndicatorType
    def get_Name(self): return self.Name
    def set_Name(self, Name): self.Name = Name
    def get_AlternativeID_Alias(self): return self.AlternativeID_Alias
    def set_AlternativeID_Alias(self, AlternativeID_Alias): self.AlternativeID_Alias = AlternativeID_Alias
    def add_AlternativeID_Alias(self, value): self.AlternativeID_Alias.append(value)
    def insert_AlternativeID_Alias(self, index, value): self.AlternativeID_Alias[index] = value
    def get_Description(self): return self.Description
    def set_Description(self, Description): self.Description = Description
    def get_ValidTimePosition(self): return self.ValidTimePosition
    def set_ValidTimePosition(self, ValidTimePosition): self.ValidTimePosition = ValidTimePosition
    def add_ValidTimePosition(self, value): self.ValidTimePosition.append(value)
    def insert_ValidTimePosition(self, index, value): self.ValidTimePosition[index] = value
    def get_Observables(self): return self.Observables
    def set_Observables(self, Observables): self.Observables = Observables
    def get_CompositeIndicatorExpression(self): return self.CompositeIndicatorExpression
    def set_CompositeIndicatorExpression(self, CompositeIndicatorExpression): self.CompositeIndicatorExpression = CompositeIndicatorExpression
    def get_IndicatedTTP(self): return self.IndicatedTTP
    def set_IndicatedTTP(self, IndicatedTTP): self.IndicatedTTP = IndicatedTTP
    def add_IndicatedTTP(self, value): self.IndicatedTTP.append(value)
    def insert_IndicatedTTP(self, index, value): self.IndicatedTTP[index] = value
    def get_KillChainPhases(self): return self.KillChainPhases
    def set_KillChainPhases(self, KillChainPhases): self.KillChainPhases = KillChainPhases
    def get_TestMechanisms(self): return self.TestMechanisms
    def set_TestMechanisms(self, TestMechanisms): self.TestMechanisms = TestMechanisms
    def get_LikelyImpact(self): return self.LikelyImpact
    def set_LikelyImpact(self, LikelyImpact): self.LikelyImpact = LikelyImpact
    def get_SuggestedCOAs(self): return self.SuggestedCOAs
    def set_SuggestedCOAs(self, SuggestedCOAs): self.SuggestedCOAs = SuggestedCOAs
    def get_Handling(self): return self.Handling
    def set_Handling(self, Handling): self.Handling = Handling
    def get_Confidence(self): return self.Confidence
    def set_Confidence(self, Confidence): self.Confidence = Confidence
    def get_Sightings(self): return self.Sightings
    def set_Sightings(self, Sightings): self.Sightings = Sightings
    def get_RelatedIndicators(self): return self.RelatedIndicators
    def set_RelatedIndicators(self, RelatedIndicators): self.RelatedIndicators = RelatedIndicators
    def add_RelatedIndicators(self, value): self.RelatedIndicators.append(value)
    def insert_RelatedIndicators(self, index, value): self.RelatedIndicators[index] = value
    def get_Producer(self): return self.Producer
    def set_Producer(self, Producer): self.Producer = Producer
    def get_ExtendedInformation(self): return self.ExtendedInformation
    def set_ExtendedInformation(self, ExtendedInformation): self.ExtendedInformation = ExtendedInformation
    def get_idref(self): return self.idref
    def set_idref(self, idref): self.idref = idref
    def get_id(self): return self.id
    def set_id(self, id): self.id = id
    def get_version(self): return self.version
    def set_version(self, version): self.version = version
    def export(self, outfile, level, namespace_='indicator:', name_='IndicatorType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='IndicatorType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='indicator:', name_='IndicatorType'):
        if self.idref is not None and 'idref' not in already_processed:
            already_processed.append('idref')
            outfile.write(' idref=%s' % (quote_attrib(self.idref), ))
        if self.id is not None and 'id' not in already_processed:
            already_processed.append('id')
            outfile.write(' id=%s' % (quote_attrib(self.id), ))
        if self.version is not None and 'version' not in already_processed:
            already_processed.append('version')
            outfile.write(' version=%s' % (self.gds_format_string(quote_attrib(self.version).encode(ExternalEncoding), input_name='version'), ))
    def exportChildren(self, outfile, level, namespace_='indicator:', name_='IndicatorType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.IndicatorType is not None:
            self.IndicatorType.export(outfile, level, 'indicator:', name_='IndicatorType', pretty_print=pretty_print)
        if self.Name is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sName>%s</%sName>%s' % ('indicator:', self.gds_format_string(quote_xml(self.Name).encode(ExternalEncoding), input_name='Name'), 'indicator:', eol_))
        for AlternativeID_Alias_ in self.AlternativeID_Alias:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sAlternativeID-Alias>%s</%sAlternativeID-Alias>%s' % ('indicator:', self.gds_format_string(quote_xml(AlternativeID_Alias_).encode(ExternalEncoding), input_name='AlternativeID-Alias'), 'indicator:', eol_))
        if self.Description is not None:
            self.Description.export(outfile, level, 'indicator:', name_='Description', pretty_print=pretty_print)
        for ValidTimePosition_ in self.ValidTimePosition:
            ValidTimePosition_.export(outfile, level, 'indicator:', name_='ValidTimePosition', pretty_print=pretty_print)
        if self.Observables is not None:
            self.Observables.export(outfile, level, 'indicator:', name_='Observables', pretty_print=pretty_print)
        if self.CompositeIndicatorExpression is not None:
            self.CompositeIndicatorExpression.export(outfile, level, 'indicator:', name_='CompositeIndicatorExpression', pretty_print=pretty_print)
        for IndicatedTTP_ in self.IndicatedTTP:
            IndicatedTTP_.export(outfile, level, 'indicator:', name_='IndicatedTTP', pretty_print=pretty_print)
        if self.KillChainPhases is not None:
            self.KillChainPhases.export(outfile, level, 'indicator:', name_='KillChainPhases', pretty_print=pretty_print)
        if self.TestMechanisms is not None:
            self.TestMechanisms.export(outfile, level, 'indicator:', name_='TestMechanisms', pretty_print=pretty_print)
        if self.LikelyImpact is not None:
            self.LikelyImpact.export(outfile, level, 'indicator:', name_='LikelyImpact', pretty_print=pretty_print)
        if self.SuggestedCOAs is not None:
            self.SuggestedCOAs.export(outfile, level, 'indicator:', name_='SuggestedCOAs', pretty_print=pretty_print)
        if self.Handling is not None:
            self.Handling.export(outfile, level, 'indicator:', name_='Handling', pretty_print=pretty_print)
        if self.Confidence is not None:
            self.Confidence.export(outfile, level, 'indicator:', name_='Confidence', pretty_print=pretty_print)
        if self.Sightings is not None:
            self.Sightings.export(outfile, level, 'indicator:', name_='Sightings', pretty_print=pretty_print)
        for RelatedIndicators_ in self.RelatedIndicators:
            RelatedIndicators_.export(outfile, level, 'indicator:', name_='RelatedIndicators', pretty_print=pretty_print)
        if self.Producer is not None:
            self.Producer.export(outfile, level, 'indicator:', name_='Producer', pretty_print=pretty_print)
        if self.ExtendedInformation is not None:
            self.ExtendedInformation.export(outfile, level, 'indicator:', name_='ExtendedInformation', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.IndicatorType is not None or
            self.Name is not None or
            self.AlternativeID_Alias or
            self.Description is not None or
            self.ValidTimePosition or
            self.Observables is not None or
            self.CompositeIndicatorExpression is not None or
            self.IndicatedTTP or
            self.KillChainPhases is not None or
            self.TestMechanisms is not None or
            self.LikelyImpact is not None or
            self.SuggestedCOAs is not None or
            self.Handling is not None or
            self.Confidence is not None or
            self.Sightings is not None or
            self.RelatedIndicators or
            self.Producer is not None or
            self.ExtendedInformation is not None
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='IndicatorType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.idref is not None and 'idref' not in already_processed:
            already_processed.append('idref')
            showIndent(outfile, level)
            outfile.write('idref = %s,\n' % (self.idref,))
        if self.id is not None and 'id' not in already_processed:
            already_processed.append('id')
            showIndent(outfile, level)
            outfile.write('id = %s,\n' % (self.id,))
        if self.version is not None and 'version' not in already_processed:
            already_processed.append('version')
            showIndent(outfile, level)
            outfile.write('version = "%s",\n' % (self.version,))
    def exportLiteralChildren(self, outfile, level, name_):
        if self.IndicatorType is not None:
            showIndent(outfile, level)
            outfile.write('IndicatorType=model_.IndicatorTypeType(\n')
            self.IndicatorType.exportLiteral(outfile, level, name_='IndicatorType')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.Name is not None:
            showIndent(outfile, level)
            outfile.write('Name=%s,\n' % quote_python(self.Name).encode(ExternalEncoding))
        showIndent(outfile, level)
        outfile.write('AlternativeID_Alias=[\n')
        level += 1
        for AlternativeID_Alias_ in self.AlternativeID_Alias:
            showIndent(outfile, level)
            outfile.write('%s,\n' % quote_python(AlternativeID_Alias_).encode(ExternalEncoding))
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
        if self.Description is not None:
            showIndent(outfile, level)
            outfile.write('Description=model_.cybox_common_binding.StructuredTextType(\n')
            self.Description.exportLiteral(outfile, level, name_='Description')
            showIndent(outfile, level)
            outfile.write('),\n')
        showIndent(outfile, level)
        outfile.write('ValidTimePosition=[\n')
        level += 1
        for ValidTimePosition_ in self.ValidTimePosition:
            showIndent(outfile, level)
            outfile.write('model_.ValidTimeType(\n')
            ValidTimePosition_.exportLiteral(outfile, level, name_='ValidTimeType')
            showIndent(outfile, level)
            outfile.write('),\n')
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
        if self.Observables is not None:
            showIndent(outfile, level)
            outfile.write('Observables=model_.ObservablesType(\n')
            self.Observables.exportLiteral(outfile, level, name_='Observables')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.CompositeIndicatorExpression is not None:
            showIndent(outfile, level)
            outfile.write('CompositeIndicatorExpression=model_.CompositeIndicatorExpressionType(\n')
            self.CompositeIndicatorExpression.exportLiteral(outfile, level, name_='CompositeIndicatorExpression')
            showIndent(outfile, level)
            outfile.write('),\n')
        showIndent(outfile, level)
        outfile.write('IndicatedTTP=[\n')
        level += 1
        for IndicatedTTP_ in self.IndicatedTTP:
            showIndent(outfile, level)
            outfile.write('model_.IndicatedTTPType(\n')
            IndicatedTTP_.exportLiteral(outfile, level, name_='IndicatedTTPType')
            showIndent(outfile, level)
            outfile.write('),\n')
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
        if self.KillChainPhases is not None:
            showIndent(outfile, level)
            outfile.write('KillChainPhases=model_.KillChainPhasesType(\n')
            self.KillChainPhases.exportLiteral(outfile, level, name_='KillChainPhases')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.TestMechanisms is not None:
            showIndent(outfile, level)
            outfile.write('TestMechanisms=model_.TestMechanismsType(\n')
            self.TestMechanisms.exportLiteral(outfile, level, name_='TestMechanisms')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.LikelyImpact is not None:
            showIndent(outfile, level)
            outfile.write('LikelyImpact=model_.LikelyImpactType(\n')
            self.LikelyImpact.exportLiteral(outfile, level, name_='LikelyImpact')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.SuggestedCOAs is not None:
            showIndent(outfile, level)
            outfile.write('SuggestedCOAs=model_.SuggestedCOAsType(\n')
            self.SuggestedCOAs.exportLiteral(outfile, level, name_='SuggestedCOAs')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.Handling is not None:
            showIndent(outfile, level)
            outfile.write('Handling=model_.data_marking_binding.MarkingType(\n')
            self.Handling.exportLiteral(outfile, level, name_='Handling')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.Confidence is not None:
            showIndent(outfile, level)
            outfile.write('Confidence=model_.stix_common_binding.ConfidenceType(\n')
            self.Confidence.exportLiteral(outfile, level, name_='Confidence')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.Sightings is not None:
            showIndent(outfile, level)
            outfile.write('Sightings=model_.sightingsType(\n')
            self.Sightings.exportLiteral(outfile, level, name_='Sightings')
            showIndent(outfile, level)
            outfile.write('),\n')
        showIndent(outfile, level)
        outfile.write('RelatedIndicators=[\n')
        level += 1
        for RelatedIndicators_ in self.RelatedIndicators:
            showIndent(outfile, level)
            outfile.write('model_.RelatedIndicatorsType(\n')
            RelatedIndicators_.exportLiteral(outfile, level, name_='RelatedIndicatorsType')
            showIndent(outfile, level)
            outfile.write('),\n')
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
        if self.Producer is not None:
            showIndent(outfile, level)
            outfile.write('Producer=model_.stix_common_binding.InformationSourceType(\n')
            self.Producer.exportLiteral(outfile, level, name_='Producer')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.ExtendedInformation is not None:
            showIndent(outfile, level)
            outfile.write('ExtendedInformation=model_.ExtendedInformationType(\n')
            self.ExtendedInformation.exportLiteral(outfile, level, name_='ExtendedInformation')
            showIndent(outfile, level)
            outfile.write('),\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('idref', node)
        if value is not None and 'idref' not in already_processed:
            already_processed.append('idref')
            self.idref = value
        value = find_attr_value_('id', node)
        if value is not None and 'id' not in already_processed:
            already_processed.append('id')
            self.id = value
        value = find_attr_value_('version', node)
        if value is not None and 'version' not in already_processed:
            already_processed.append('version')
            self.version = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'IndicatorType':
            obj_ = IndicatorTypeType.factory()
            obj_.build(child_)
            self.set_IndicatorType(obj_)
        elif nodeName_ == 'Name':
            Name_ = child_.text
            Name_ = re_.sub(String_cleanup_pat_, " ", Name_).strip()
            Name_ = self.gds_validate_string(Name_, node, 'Name')
            self.Name = Name_
        elif nodeName_ == 'AlternativeID-Alias':
            AlternativeID_Alias_ = child_.text
            AlternativeID_Alias_ = self.gds_validate_string(AlternativeID_Alias_, node, 'AlternativeID_Alias')
            self.AlternativeID_Alias.append(AlternativeID_Alias_)
        elif nodeName_ == 'Description':
            obj_ = cybox_common_binding.StructuredTextType.factory()
            obj_.build(child_)
            self.set_Description(obj_)
        elif nodeName_ == 'ValidTimePosition':
            obj_ = ValidTimeType.factory()
            obj_.build(child_)
            self.ValidTimePosition.append(obj_)
        elif nodeName_ == 'Observables':
            obj_ = ObservablesType.factory()
            obj_.build(child_)
            self.set_Observables(obj_)
        elif nodeName_ == 'CompositeIndicatorExpression':
            obj_ = CompositeIndicatorExpressionType.factory()
            obj_.build(child_)
            self.set_CompositeIndicatorExpression(obj_)
        elif nodeName_ == 'IndicatedTTP':
            obj_ = IndicatedTTPType.factory()
            obj_.build(child_)
            self.IndicatedTTP.append(obj_)
        elif nodeName_ == 'KillChainPhases':
            obj_ = KillChainPhasesType.factory()
            obj_.build(child_)
            self.set_KillChainPhases(obj_)
        elif nodeName_ == 'TestMechanisms':
            obj_ = TestMechanismsType.factory()
            obj_.build(child_)
            self.set_TestMechanisms(obj_)
        elif nodeName_ == 'LikelyImpact':
            obj_ = LikelyImpactType.factory()
            obj_.build(child_)
            self.set_LikelyImpact(obj_)
        elif nodeName_ == 'SuggestedCOAs':
            obj_ = SuggestedCOAsType.factory()
            obj_.build(child_)
            self.set_SuggestedCOAs(obj_)
        elif nodeName_ == 'Handling':
            obj_ = data_marking_binding.MarkingType.factory()
            obj_.build(child_)
            self.set_Handling(obj_)
        elif nodeName_ == 'Confidence':
            obj_ = stix_common_binding.ConfidenceType.factory()
            obj_.build(child_)
            self.set_Confidence(obj_)
        elif nodeName_ == 'Sightings':
            obj_ = sightingsType.factory()
            obj_.build(child_)
            self.set_Sightings(obj_)
        elif nodeName_ == 'RelatedIndicators':
            obj_ = RelatedIndicatorsType.factory()
            obj_.build(child_)
            self.RelatedIndicators.append(obj_)
        elif nodeName_ == 'Producer':
            obj_ = stix_common_binding.InformationSourceType.factory()
            obj_.build(child_)
            self.set_Producer(obj_)
        elif nodeName_ == 'ExtendedInformation':
            obj_ = ExtendedInformationType.factory()
            obj_.build(child_)
            self.set_ExtendedInformation(obj_)
# end class IndicatorType

class IndicatorTypeType(GeneratedsSuper):
    """This field specifies a reference to an indicator-type value
    reference. The value is a QName or URL that should reference a
    term in a controlled vocabulary which is understood by both the
    producing and consuming parties."""
    subclass = None
    superclass = None
    def __init__(self, indicatorTypeRef=None, valueOf_=None):
        self.indicatorTypeRef = _cast(None, indicatorTypeRef)
        self.valueOf_ = valueOf_
    def factory(*args_, **kwargs_):
        if IndicatorTypeType.subclass:
            return IndicatorTypeType.subclass(*args_, **kwargs_)
        else:
            return IndicatorTypeType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_indicatorTypeRef(self): return self.indicatorTypeRef
    def set_indicatorTypeRef(self, indicatorTypeRef): self.indicatorTypeRef = indicatorTypeRef
    def get_valueOf_(self): return self.valueOf_
    def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
    def export(self, outfile, level, namespace_='indicator:', name_='IndicatorTypeType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='IndicatorTypeType')
        if self.hasContent_():
            outfile.write('>')
            outfile.write(str(self.valueOf_).encode(ExternalEncoding))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='indicator:', name_='IndicatorTypeType'):
        if self.indicatorTypeRef is not None and 'indicatorTypeRef' not in already_processed:
            already_processed.append('indicatorTypeRef')
            outfile.write(' indicatorTypeRef=%s' % (self.gds_format_string(quote_attrib(self.indicatorTypeRef).encode(ExternalEncoding), input_name='indicatorTypeRef'), ))
    def exportChildren(self, outfile, level, namespace_='indicator:', name_='IndicatorTypeType', fromsubclass_=False, pretty_print=True):
        pass
    def hasContent_(self):
        if (
            self.valueOf_
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='IndicatorTypeType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
        showIndent(outfile, level)
        outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.indicatorTypeRef is not None and 'indicatorTypeRef' not in already_processed:
            already_processed.append('indicatorTypeRef')
            showIndent(outfile, level)
            outfile.write('indicatorTypeRef = "%s",\n' % (self.indicatorTypeRef,))
    def exportLiteralChildren(self, outfile, level, name_):
        pass
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        self.valueOf_ = get_all_text_(node)
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('indicatorTypeRef', node)
        if value is not None and 'indicatorTypeRef' not in already_processed:
            already_processed.append('indicatorTypeRef')
            self.indicatorTypeRef = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass
# end class IndicatorTypeType



class ValidTimeType(GeneratedsSuper):
    """A basic representation of a temporal window when the thing (e.g.,
    indicator) is valid."""
    subclass = None
    superclass = None
    def __init__(self, start_time=None, end_time=None):
        self.start_time = start_time
        self.end_time = end_time
    def factory(*args_, **kwargs_):
        if ValidTimeType.subclass:
            return ValidTimeType.subclass(*args_, **kwargs_)
        else:
            return ValidTimeType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_start_time(self): return self.start_time
    def set_start_time(self, start_time): self.start_time = start_time
    def get_end_time(self): return self.end_time
    def set_end_time(self, end_time): self.end_time = end_time
    def export(self, outfile, level, namespace_='indicator:', name_='ValidTimeType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='ValidTimeType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='indicator:', name_='ValidTimeType'):
        pass
    def exportChildren(self, outfile, level, namespace_='indicator:', name_='ValidTimeType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.start_time is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sstart-time>%s</%sstart-time>%s' % ('indicator:', self.gds_format_string(quote_xml(self.start_time).encode(ExternalEncoding), input_name='start-time'), 'indicator:', eol_))
        if self.end_time is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%send-time>%s</%send-time>%s' % ('indicator:', self.gds_format_string(quote_xml(self.end_time).encode(ExternalEncoding), input_name='end-time'), 'indicator:', eol_))
    def hasContent_(self):
        if (
            self.start_time is not None or
            self.end_time is not None
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='ValidTimeType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        pass
    def exportLiteralChildren(self, outfile, level, name_):
        if self.start_time is not None:
            showIndent(outfile, level)
            outfile.write('start_time=%s,\n' % quote_python(self.start_time).encode(ExternalEncoding))
        if self.end_time is not None:
            showIndent(outfile, level)
            outfile.write('end_time=%s,\n' % quote_python(self.end_time).encode(ExternalEncoding))
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        pass
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'start-time':
            start_time_ = child_.text
            start_time_ = self.gds_validate_string(start_time_, node, 'start_time')
            self.start_time = start_time_
        elif nodeName_ == 'end-time':
            end_time_ = child_.text
            end_time_ = self.gds_validate_string(end_time_, node, 'end_time')
            self.end_time = end_time_
# end class ValidTimeType

class CompositeIndicatorExpressionType(GeneratedsSuper):
    """Type for allowing content creators to create composite indicator
    expressions using basic boolean logic. Specifies the logical
    composition operator for this composite cyber threat Indicator."""
    subclass = None
    superclass = None
    def __init__(self, operator=None, Indicator=None):
        self.operator = _cast(None, operator)
        if Indicator is None:
            self.Indicator = []
        else:
            self.Indicator = Indicator
    def factory(*args_, **kwargs_):
        if CompositeIndicatorExpressionType.subclass:
            return CompositeIndicatorExpressionType.subclass(*args_, **kwargs_)
        else:
            return CompositeIndicatorExpressionType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_Indicator(self): return self.Indicator
    def set_Indicator(self, Indicator): self.Indicator = Indicator
    def add_Indicator(self, value): self.Indicator.append(value)
    def insert_Indicator(self, index, value): self.Indicator[index] = value
    def get_operator(self): return self.operator
    def set_operator(self, operator): self.operator = operator
    def export(self, outfile, level, namespace_='indicator:', name_='CompositeIndicatorExpressionType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='CompositeIndicatorExpressionType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='indicator:', name_='CompositeIndicatorExpressionType'):
        if self.operator is not None and 'operator' not in already_processed:
            already_processed.append('operator')
            outfile.write(' operator=%s' % (quote_attrib(self.operator), ))
    def exportChildren(self, outfile, level, namespace_='indicator:', name_='CompositeIndicatorExpressionType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        for Indicator_ in self.Indicator:
            Indicator_.export(outfile, level, 'indicator:', name_='Indicator', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.Indicator
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='CompositeIndicatorExpressionType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.operator is not None and 'operator' not in already_processed:
            already_processed.append('operator')
            showIndent(outfile, level)
            outfile.write('operator = %s,\n' % (self.operator,))
    def exportLiteralChildren(self, outfile, level, name_):
        showIndent(outfile, level)
        outfile.write('Indicator=[\n')
        level += 1
        for Indicator_ in self.Indicator:
            showIndent(outfile, level)
            outfile.write('model_.Indicator(\n')
            Indicator_.exportLiteral(outfile, level)
            showIndent(outfile, level)
            outfile.write('),\n')
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('operator', node)
        if value is not None and 'operator' not in already_processed:
            already_processed.append('operator')
            self.operator = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'Indicator':
            obj_ = IndicatorType.factory()
            obj_.build(child_)
            self.Indicator.append(obj_)
# end class CompositeIndicatorExpressionType

class TestMechanismType(GeneratedsSuper):
    """The TestMechanismType specifies a Test Mechanism effective at
    identifying the cyber Observables specified in this cyber threat
    Indicator. This type is defined as an abstract type enabling the
    extension and inclusion of various formats of Test Mechanism
    specifications.Specifies a unique ID for this Test
    Mechanism.Specifies a reference to the ID of a Test Mechanism
    specified elsewhere.Specifies the type of Test
    Mechanism.Specifies a reference URL for a location
    characterizing the TestMechanism type.Specifies a reference URL
    for the location of the Test Mechanism."""
    subclass = None
    superclass = None
    def __init__(self, typeReference=None, idref=None, type_=None, id=None, referenceLocation=None, Efficacy=None, Producer=None, extensiontype_=None):
        self.typeReference = _cast(None, typeReference)
        self.idref = _cast(None, idref)
        self.type_ = _cast(None, type_)
        self.id = _cast(None, id)
        self.referenceLocation = _cast(None, referenceLocation)
        self.Efficacy = Efficacy
        self.Producer = Producer
        self.extensiontype_ = extensiontype_
        
    def factory(*args_, **kwargs_):
        if TestMechanismType.subclass:
            return TestMechanismType.subclass(*args_, **kwargs_)
        else:
            return TestMechanismType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_Efficacy(self): return self.Efficacy
    def set_Efficacy(self, Efficacy): self.Efficacy = Efficacy
    def get_Producer(self): return self.Producer
    def set_Producer(self, Producer): self.Producer = Producer
    def get_typeReference(self): return self.typeReference
    def set_typeReference(self, typeReference): self.typeReference = typeReference
    def get_idref(self): return self.idref
    def set_idref(self, idref): self.idref = idref
    def get_type(self): return self.type_
    def set_type(self, type_): self.type_ = type_
    def get_id(self): return self.id
    def set_id(self, id): self.id = id
    def get_referenceLocation(self): return self.referenceLocation
    def set_referenceLocation(self, referenceLocation): self.referenceLocation = referenceLocation
    def get_extensiontype_(self): return self.extensiontype_
    def set_extensiontype_(self): return self.extensiontype_
    
    def export(self, outfile, level, namespace_='indicator:', name_='TestMechanismType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='TestMechanismType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
            
    def exportAttributes(self, outfile, level, already_processed, namespace_='indicator:', name_='TestMechanismType'):
        if self.typeReference is not None and 'typeReference' not in already_processed:
            already_processed.append('typeReference')
            outfile.write(' typeReference=%s' % (self.gds_format_string(quote_attrib(self.typeReference).encode(ExternalEncoding), input_name='typeReference'), ))
        if self.idref is not None and 'idref' not in already_processed:
            already_processed.append('idref')
            outfile.write(' idref=%s' % (quote_attrib(self.idref), ))
        if self.type_ is not None and 'type_' not in already_processed:
            already_processed.append('type_')
            outfile.write(' type=%s' % (quote_attrib(self.type_), ))
        if self.id is not None and 'id' not in already_processed:
            already_processed.append('id')
            outfile.write(' id=%s' % (quote_attrib(self.id), ))
        if self.referenceLocation is not None and 'referenceLocation' not in already_processed:
            already_processed.append('referenceLocation')
            outfile.write(' referenceLocation=%s' % (self.gds_format_string(quote_attrib(self.referenceLocation).encode(ExternalEncoding), input_name='referenceLocation'), ))
        if self.extensiontype_ is not None and 'xsi:type' not in already_processed:
            already_processed.append('xsi:type')
            outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')
            outfile.write(' xsi:type="%s"' % self.extensiontype_)
            
    def exportChildren(self, outfile, level, namespace_='indicator:', name_='TestMechanismType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.Efficacy is not None:
            self.Efficacy.export(outfile, level, 'indicator:', name_='Efficacy', pretty_print=pretty_print)
        if self.Producer is not None:
            self.Producer.export(outfile, level, 'indicator:', name_='Producer', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.Efficacy is not None or
            self.Producer is not None
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='TestMechanismType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.typeReference is not None and 'typeReference' not in already_processed:
            already_processed.append('typeReference')
            showIndent(outfile, level)
            outfile.write('typeReference = "%s",\n' % (self.typeReference,))
        if self.idref is not None and 'idref' not in already_processed:
            already_processed.append('idref')
            showIndent(outfile, level)
            outfile.write('idref = %s,\n' % (self.idref,))
        if self.type_ is not None and 'type_' not in already_processed:
            already_processed.append('type_')
            showIndent(outfile, level)
            outfile.write('type_ = %s,\n' % (self.type_,))
        if self.id is not None and 'id' not in already_processed:
            already_processed.append('id')
            showIndent(outfile, level)
            outfile.write('id = %s,\n' % (self.id,))
        if self.referenceLocation is not None and 'referenceLocation' not in already_processed:
            already_processed.append('referenceLocation')
            showIndent(outfile, level)
            outfile.write('referenceLocation = "%s",\n' % (self.referenceLocation,))
    def exportLiteralChildren(self, outfile, level, name_):
        if self.Efficacy is not None:
            showIndent(outfile, level)
            outfile.write('Efficacy=model_.EfficacyType(\n')
            self.Efficacy.exportLiteral(outfile, level, name_='Efficacy')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.Producer is not None:
            showIndent(outfile, level)
            outfile.write('Producer=model_.stix_common_binding.InformationSourceType(\n')
            self.Producer.exportLiteral(outfile, level, name_='Producer')
            showIndent(outfile, level)
            outfile.write('),\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('typeReference', node)
        if value is not None and 'typeReference' not in already_processed:
            already_processed.append('typeReference')
            self.typeReference = value
        value = find_attr_value_('idref', node)
        if value is not None and 'idref' not in already_processed:
            already_processed.append('idref')
            self.idref = value
        value = find_attr_value_('type', node)
        if value is not None and 'type' not in already_processed:
            already_processed.append('type')
            self.type_ = value
        value = find_attr_value_('id', node)
        if value is not None and 'id' not in already_processed:
            already_processed.append('id')
            self.id = value
        value = find_attr_value_('referenceLocation', node)
        if value is not None and 'referenceLocation' not in already_processed:
            already_processed.append('referenceLocation')
            self.referenceLocation = value
        value = find_attr_value_('xsi:type', node)
        if value is not None and 'xsi:type' not in already_processed:
            already_processed.append('xsi:type')
            self.extensiontype_ = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'Efficacy':
            obj_ = EfficacyType.factory()
            obj_.build(child_)
            self.set_Efficacy(obj_)
        elif nodeName_ == 'Producer':
            obj_ = stix_common_binding.InformationSourceType.factory()
            obj_.build(child_)
            self.set_Producer(obj_)
# end class TestMechanismType

class GenericTestMechanismType(TestMechanismType):
    """The GenericTestMechanismType specifies an instantial extension from
    the abstract Test MechanismType intended to support the generic
    inclusion of any test mechanism content."""
    subclass = None
    superclass = TestMechanismType
    def __init__(self, typeReference=None, idref=None, type_=None, id=None, referenceLocation=None, Efficacy=None, Producer=None, GenericTestMechanismSpecification=None):
        super(GenericTestMechanismType, self).__init__(typeReference, idref, type_, id, referenceLocation, Efficacy, Producer, )
        self.GenericTestMechanismSpecification = GenericTestMechanismSpecification
    def factory(*args_, **kwargs_):
        if GenericTestMechanismType.subclass:
            return GenericTestMechanismType.subclass(*args_, **kwargs_)
        else:
            return GenericTestMechanismType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_GenericTestMechanismSpecification(self): return self.GenericTestMechanismSpecification
    def set_GenericTestMechanismSpecification(self, GenericTestMechanismSpecification): self.GenericTestMechanismSpecification = GenericTestMechanismSpecification
    def export(self, outfile, level, namespace_='indicator:', name_='GenericTestMechanismType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='GenericTestMechanismType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='indicator:', name_='GenericTestMechanismType'):
        super(GenericTestMechanismType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='GenericTestMechanismType')
    def exportChildren(self, outfile, level, namespace_='indicator:', name_='GenericTestMechanismType', fromsubclass_=False, pretty_print=True):
        super(GenericTestMechanismType, self).exportChildren(outfile, level, 'indicator:', name_, True, pretty_print=pretty_print)
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.GenericTestMechanismSpecification is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sGenericTestMechanismSpecification>%s</%sGenericTestMechanismSpecification>%s' % ('indicator:', self.gds_format_string(quote_xml(self.GenericTestMechanismSpecification).encode(ExternalEncoding), input_name='GenericTestMechanismSpecification'), 'indicator:', eol_))
    def hasContent_(self):
        if (
            self.GenericTestMechanismSpecification is not None or
            super(GenericTestMechanismType, self).hasContent_()
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='GenericTestMechanismType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        super(GenericTestMechanismType, self).exportLiteralAttributes(outfile, level, already_processed, name_)
    def exportLiteralChildren(self, outfile, level, name_):
        super(GenericTestMechanismType, self).exportLiteralChildren(outfile, level, name_)
        if self.GenericTestMechanismSpecification is not None:
            showIndent(outfile, level)
            outfile.write('GenericTestMechanismSpecification=%s,\n' % quote_python(self.GenericTestMechanismSpecification).encode(ExternalEncoding))
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        super(GenericTestMechanismType, self).buildAttributes(node, attrs, already_processed)
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'GenericTestMechanismSpecification':
            GenericTestMechanismSpecification_ = child_.text
            GenericTestMechanismSpecification_ = self.gds_validate_string(GenericTestMechanismSpecification_, node, 'GenericTestMechanismSpecification')
            self.GenericTestMechanismSpecification = GenericTestMechanismSpecification_
        super(GenericTestMechanismType, self).buildChildren(child_, node, nodeName_, True)
# end class GenericTestMechanismType

class COARuleType(GeneratedsSuper):
    """The COARuleType specifies a structured rule for automated
    application of a Course of Action.Specifies the type of COA
    Rule.Specifies a unique ID for this COA Rule.Specifies a
    reference URL for the location of the COA Rule."""
    subclass = None
    superclass = None
    def __init__(self, referenceLocation=None, type_=None, id=None):
        self.referenceLocation = _cast(None, referenceLocation)
        self.type_ = _cast(None, type_)
        self.id = _cast(None, id)
        pass
    def factory(*args_, **kwargs_):
        if COARuleType.subclass:
            return COARuleType.subclass(*args_, **kwargs_)
        else:
            return COARuleType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_referenceLocation(self): return self.referenceLocation
    def set_referenceLocation(self, referenceLocation): self.referenceLocation = referenceLocation
    def get_type(self): return self.type_
    def set_type(self, type_): self.type_ = type_
    def get_id(self): return self.id
    def set_id(self, id): self.id = id
    def export(self, outfile, level, namespace_='indicator:', name_='COARuleType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='COARuleType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='indicator:', name_='COARuleType'):
        if self.referenceLocation is not None and 'referenceLocation' not in already_processed:
            already_processed.append('referenceLocation')
            outfile.write(' referenceLocation=%s' % (self.gds_format_string(quote_attrib(self.referenceLocation).encode(ExternalEncoding), input_name='referenceLocation'), ))
        if self.type_ is not None and 'type_' not in already_processed:
            already_processed.append('type_')
            outfile.write(' type=%s' % (quote_attrib(self.type_), ))
        if self.id is not None and 'id' not in already_processed:
            already_processed.append('id')
            outfile.write(' id=%s' % (quote_attrib(self.id), ))
    def exportChildren(self, outfile, level, namespace_='indicator:', name_='COARuleType', fromsubclass_=False, pretty_print=True):
        pass
    def hasContent_(self):
        if (

            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='COARuleType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.referenceLocation is not None and 'referenceLocation' not in already_processed:
            already_processed.append('referenceLocation')
            showIndent(outfile, level)
            outfile.write('referenceLocation = "%s",\n' % (self.referenceLocation,))
        if self.type_ is not None and 'type_' not in already_processed:
            already_processed.append('type_')
            showIndent(outfile, level)
            outfile.write('type_ = %s,\n' % (self.type_,))
        if self.id is not None and 'id' not in already_processed:
            already_processed.append('id')
            showIndent(outfile, level)
            outfile.write('id = %s,\n' % (self.id,))
    def exportLiteralChildren(self, outfile, level, name_):
        pass
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('referenceLocation', node)
        if value is not None and 'referenceLocation' not in already_processed:
            already_processed.append('referenceLocation')
            self.referenceLocation = value
        value = find_attr_value_('type', node)
        if value is not None and 'type' not in already_processed:
            already_processed.append('type')
            self.type_ = value
        value = find_attr_value_('id', node)
        if value is not None and 'id' not in already_processed:
            already_processed.append('id')
            self.id = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass
# end class COARuleType

class sightingsType(GeneratedsSuper):
    """The total number of times this Indicator was reported as sighted."""
    subclass = None
    superclass = None
    def __init__(self, sightingsCount=None, Sighting=None):
        self.sightingsCount = _cast(None, sightingsCount)
        if Sighting is None:
            self.Sighting = []
        else:
            self.Sighting = Sighting
    def factory(*args_, **kwargs_):
        if sightingsType.subclass:
            return sightingsType.subclass(*args_, **kwargs_)
        else:
            return sightingsType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_Sighting(self): return self.Sighting
    def set_Sighting(self, Sighting): self.Sighting = Sighting
    def add_Sighting(self, value): self.Sighting.append(value)
    def insert_Sighting(self, index, value): self.Sighting[index] = value
    def get_sightingsCount(self): return self.sightingsCount
    def set_sightingsCount(self, sightingsCount): self.sightingsCount = sightingsCount
    def export(self, outfile, level, namespace_='indicator:', name_='sightingsType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='sightingsType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='indicator:', name_='sightingsType'):
        if self.sightingsCount is not None and 'sightingsCount' not in already_processed:
            already_processed.append('sightingsCount')
            outfile.write(' sightingsCount=%s' % (self.gds_format_string(quote_attrib(self.sightingsCount).encode(ExternalEncoding), input_name='sightingsCount'), ))
    def exportChildren(self, outfile, level, namespace_='indicator:', name_='sightingsType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        for sighting_ in self.Sighting:
            sighting_.export(outfile, level, 'indicator:', name_='Sighting', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.Sighting
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='sightingsType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.sightingsCount is not None and 'sightingsCount' not in already_processed:
            already_processed.append('sightingsCount')
            showIndent(outfile, level)
            outfile.write('sightingsCount = "%s",\n' % (self.sightingsCount,))
    def exportLiteralChildren(self, outfile, level, name_):
        showIndent(outfile, level)
        outfile.write('Sighting=[\n')
        level += 1
        for sighting_ in self.Sighting:
            showIndent(outfile, level)
            outfile.write('model_.SightingType(\n')
            sighting_.exportLiteral(outfile, level, name_='SightingType')
            showIndent(outfile, level)
            outfile.write('),\n')
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('sightingsCount', node)
        if value is not None and 'sightingsCount' not in already_processed:
            already_processed.append('sightingsCount')
            self.sightingsCount = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'Sighting':
            obj_ = SightingType.factory()
            obj_.build(child_)
            self.Sighting.append(obj_)
# end class sightingsType

class RelationshipType(GeneratedsSuper):
    """The relationship-type encapsulates a relationship from the enclosing
    indicator to one or more associated indicators. Specifies a
    locally-defined type of relationship (predicate) being defined
    between the subject and the object of the relationship.
    Specifies an externally-defined type of relationship (predicate)
    being defined between the subject and the object of the
    relationship. The value is a QName that should reference a term
    in a controlled vocabulary which is understood by both the
    producing and consuming parties.Indicates how multiple
    IndicatorRef elements should be interpreted in this
    relationship. If "inclusive" is specified, then the relationship
    being defined is between the subject and the collection of
    objects indicated by the IndicatorRef elements (i.e. the
    relationship is not necessarily relevant for any one particular
    object being referenced, but for the aggregated collection of
    objects referenced). If "exclusive" is specified, then the
    relationship being defined is between the specific subject
    Indicator and each object individually (i.e. this is the same as
    specifying multiple relationship elements, each with the same
    @type).A placeholder so that content creators can add attributes
    as desired."""
    subclass = None
    superclass = None
    def __init__(self, scope='inclusive', externallyDefinedType=None, type_=None, IndicatorRef=None):
        self.scope = _cast(None, scope)
        self.externallyDefinedType = _cast(None, externallyDefinedType)
        self.type_ = _cast(None, type_)
        if IndicatorRef is None:
            self.IndicatorRef = []
        else:
            self.IndicatorRef = IndicatorRef
        self.anyAttributes_ = {}
    def factory(*args_, **kwargs_):
        if RelationshipType.subclass:
            return RelationshipType.subclass(*args_, **kwargs_)
        else:
            return RelationshipType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_IndicatorRef(self): return self.IndicatorRef
    def set_IndicatorRef(self, IndicatorRef): self.IndicatorRef = IndicatorRef
    def add_IndicatorRef(self, value): self.IndicatorRef.append(value)
    def insert_IndicatorRef(self, index, value): self.IndicatorRef[index] = value
    def get_scope(self): return self.scope
    def set_scope(self, scope): self.scope = scope
    def get_externallyDefinedType(self): return self.externallyDefinedType
    def set_externallyDefinedType(self, externallyDefinedType): self.externallyDefinedType = externallyDefinedType
    def get_type(self): return self.type_
    def set_type(self, type_): self.type_ = type_
    def get_anyAttributes_(self): return self.anyAttributes_
    def set_anyAttributes_(self, anyAttributes_): self.anyAttributes_ = anyAttributes_
    def export(self, outfile, level, namespace_='indicator:', name_='RelationshipType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='RelationshipType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='indicator:', name_='RelationshipType'):
        unique_counter = 0
        for name, value in self.anyAttributes_.items():
            xsinamespaceprefix = 'xsi'
            xsinamespace1 = 'http://www.w3.org/2001/XMLSchema-instance'
            xsinamespace2 = '{%s}' % (xsinamespace1, )
            if name.startswith(xsinamespace2):
                name1 = name[len(xsinamespace2):]
                name2 = '%s:%s' % (xsinamespaceprefix, name1, )
                if name2 not in already_processed:
                    already_processed.append(name2)
                    outfile.write(' %s=%s' % (name2, quote_attrib(value), ))
            else:
                mo = re_.match(Namespace_extract_pat_, name)
                if mo is not None:
                    namespace, name = mo.group(1, 2)
                    if name not in already_processed:
                        already_processed.append(name)
                        if namespace == 'http://www.w3.org/XML/1998/namespace':
                            outfile.write(' %s=%s' % (name, quote_attrib(value), ))
                        else:
                            unique_counter += 1
                            outfile.write(' xmlns:yyy%d="%s"' % (unique_counter, namespace, ))
                            outfile.write(' yyy%d:%s=%s' % (unique_counter, name, quote_attrib(value), ))
                else:
                    if name not in already_processed:
                        already_processed.append(name)
                        outfile.write(' %s=%s' % (name, quote_attrib(value), ))
        if self.scope is not None and 'scope' not in already_processed:
            already_processed.append('scope')
            outfile.write(' scope=%s' % (self.gds_format_string(quote_attrib(self.scope).encode(ExternalEncoding), input_name='scope'), ))
        if self.externallyDefinedType is not None and 'externallyDefinedType' not in already_processed:
            already_processed.append('externallyDefinedType')
            outfile.write(' externallyDefinedType=%s' % (quote_attrib(self.externallyDefinedType), ))
        if self.type_ is not None and 'type_' not in already_processed:
            already_processed.append('type_')
            outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), ))
    def exportChildren(self, outfile, level, namespace_='indicator:', name_='RelationshipType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        for IndicatorRef_ in self.IndicatorRef:
            IndicatorRef_.export(outfile, level, 'indicator:', name_='IndicatorRef', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.IndicatorRef
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='RelationshipType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.scope is not None and 'scope' not in already_processed:
            already_processed.append('scope')
            showIndent(outfile, level)
            outfile.write('scope = "%s",\n' % (self.scope,))
        if self.externallyDefinedType is not None and 'externallyDefinedType' not in already_processed:
            already_processed.append('externallyDefinedType')
            showIndent(outfile, level)
            outfile.write('externallyDefinedType = %s,\n' % (self.externallyDefinedType,))
        if self.type_ is not None and 'type_' not in already_processed:
            already_processed.append('type_')
            showIndent(outfile, level)
            outfile.write('type_ = "%s",\n' % (self.type_,))
        for name, value in self.anyAttributes_.items():
            showIndent(outfile, level)
            outfile.write('%s = "%s",\n' % (name, value,))
    def exportLiteralChildren(self, outfile, level, name_):
        showIndent(outfile, level)
        outfile.write('IndicatorRef=[\n')
        level += 1
        for IndicatorRef_ in self.IndicatorRef:
            showIndent(outfile, level)
            outfile.write('model_.xsd_QName(\n')
            IndicatorRef_.exportLiteral(outfile, level, name_='xsd:QName')
            showIndent(outfile, level)
            outfile.write('),\n')
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('scope', node)
        if value is not None and 'scope' not in already_processed:
            already_processed.append('scope')
            self.scope = value
            self.scope = ' '.join(self.scope.split())
        value = find_attr_value_('externallyDefinedType', node)
        if value is not None and 'externallyDefinedType' not in already_processed:
            already_processed.append('externallyDefinedType')
            self.externallyDefinedType = value
        value = find_attr_value_('type', node)
        if value is not None and 'type' not in already_processed:
            already_processed.append('type')
            self.type_ = value
        self.anyAttributes_ = {}
        for name, value in attrs.items():
            if name not in already_processed:
                self.anyAttributes_[name] = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'IndicatorRef':
            obj_ = xsd_QName.factory()
            obj_.build(child_)
            self.IndicatorRef.append(obj_)
# end class RelationshipType

class RelatedIndicatorType(IndicatorType):
    """Specifies a locally-defined type of relationship (predicate) being
    defined between the subject and the object of the relationship.
    Specifies an externally-defined type of relationship (predicate)
    being defined between the subject and the object of the
    relationship. The value is a QName that should reference a term
    in a controlled vocabulary which is understood by both the
    producing and consuming parties.Indicates how multiple
    IndicatorRef elements should be interpreted in this
    relationship. If "inclusive" is specified, then the relationship
    being defined is between the subject and the collection of
    objects indicated by the IndicatorRef elements (i.e. the
    relationship is not necessarily relevant for any one particular
    object being referenced, but for the aggregated collection of
    objects referenced). If "exclusive" is specified, then the
    relationship being defined is between the specific subject
    Indicator and each object individually (i.e. this is the same as
    specifying multiple relationship elements, each with the same
    @type).A placeholder so that content creators can add attributes
    as desired."""
    subclass = None
    superclass = IndicatorType
    def __init__(self, idref=None, id=None, version=None, IndicatorType=None, Name=None, AlternativeID_Alias=None, Description=None, ValidTimePosition=None, Observables=None, CompositeIndicatorExpression=None, IndicatedTTP=None, KillChainPhases=None, TestMechanisms=None, LikelyImpact=None, SuggestedCOAs=None, Handling=None, Confidence=None, Sightings=None, RelatedIndicators=None, Producer=None, ExtendedInformation=None, scope='inclusive', relationshipType=None, externallyDefinedType=None, RelatedIndicatorConfidence=None):
        super(RelatedIndicatorType, self).__init__(idref, id, version, IndicatorType, Name, AlternativeID_Alias, Description, ValidTimePosition, Observables, CompositeIndicatorExpression, IndicatedTTP, KillChainPhases, TestMechanisms, LikelyImpact, SuggestedCOAs, Handling, Confidence, Sightings, RelatedIndicators, Producer, ExtendedInformation, )
        self.scope = _cast(None, scope)
        self.relationshipType = _cast(None, relationshipType)
        self.externallyDefinedType = _cast(None, externallyDefinedType)
        self.RelatedIndicatorConfidence = RelatedIndicatorConfidence
        self.anyAttributes_ = {}
    def factory(*args_, **kwargs_):
        if RelatedIndicatorType.subclass:
            return RelatedIndicatorType.subclass(*args_, **kwargs_)
        else:
            return RelatedIndicatorType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_RelatedIndicatorConfidence(self): return self.RelatedIndicatorConfidence
    def set_RelatedIndicatorConfidence(self, RelatedIndicatorConfidence): self.RelatedIndicatorConfidence = RelatedIndicatorConfidence
    def get_scope(self): return self.scope
    def set_scope(self, scope): self.scope = scope
    def get_relationshipType(self): return self.relationshipType
    def set_relationshipType(self, relationshipType): self.relationshipType = relationshipType
    def get_externallyDefinedType(self): return self.externallyDefinedType
    def set_externallyDefinedType(self, externallyDefinedType): self.externallyDefinedType = externallyDefinedType
    def get_anyAttributes_(self): return self.anyAttributes_
    def set_anyAttributes_(self, anyAttributes_): self.anyAttributes_ = anyAttributes_
    def export(self, outfile, level, namespace_='indicator:', name_='RelatedIndicatorType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='RelatedIndicatorType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='indicator:', name_='RelatedIndicatorType'):
        unique_counter = 0
        for name, value in self.anyAttributes_.items():
            xsinamespaceprefix = 'xsi'
            xsinamespace1 = 'http://www.w3.org/2001/XMLSchema-instance'
            xsinamespace2 = '{%s}' % (xsinamespace1, )
            if name.startswith(xsinamespace2):
                name1 = name[len(xsinamespace2):]
                name2 = '%s:%s' % (xsinamespaceprefix, name1, )
                if name2 not in already_processed:
                    already_processed.append(name2)
                    outfile.write(' %s=%s' % (name2, quote_attrib(value), ))
            else:
                mo = re_.match(Namespace_extract_pat_, name)
                if mo is not None:
                    namespace, name = mo.group(1, 2)
                    if name not in already_processed:
                        already_processed.append(name)
                        if namespace == 'http://www.w3.org/XML/1998/namespace':
                            outfile.write(' %s=%s' % (name, quote_attrib(value), ))
                        else:
                            unique_counter += 1
                            outfile.write(' xmlns:yyy%d="%s"' % (unique_counter, namespace, ))
                            outfile.write(' yyy%d:%s=%s' % (unique_counter, name, quote_attrib(value), ))
                else:
                    if name not in already_processed:
                        already_processed.append(name)
                        outfile.write(' %s=%s' % (name, quote_attrib(value), ))
        super(RelatedIndicatorType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='RelatedIndicatorType')
        if self.scope is not None and 'scope' not in already_processed:
            already_processed.append('scope')
            outfile.write(' scope=%s' % (self.gds_format_string(quote_attrib(self.scope).encode(ExternalEncoding), input_name='scope'), ))
        if self.relationshipType is not None and 'relationshipType' not in already_processed:
            already_processed.append('relationshipType')
            outfile.write(' relationshipType=%s' % (self.gds_format_string(quote_attrib(self.relationshipType).encode(ExternalEncoding), input_name='relationshipType'), ))
        if self.externallyDefinedType is not None and 'externallyDefinedType' not in already_processed:
            already_processed.append('externallyDefinedType')
            outfile.write(' externallyDefinedType=%s' % (quote_attrib(self.externallyDefinedType), ))
    def exportChildren(self, outfile, level, namespace_='indicator:', name_='RelatedIndicatorType', fromsubclass_=False, pretty_print=True):
        super(RelatedIndicatorType, self).exportChildren(outfile, level, 'indicator:', name_, True, pretty_print=pretty_print)
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.RelatedIndicatorConfidence is not None:
            self.RelatedIndicatorConfidence.export(outfile, level, 'indicator:', name_='RelatedIndicatorConfidence', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.RelatedIndicatorConfidence is not None or
            super(RelatedIndicatorType, self).hasContent_()
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='RelatedIndicatorType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.scope is not None and 'scope' not in already_processed:
            already_processed.append('scope')
            showIndent(outfile, level)
            outfile.write('scope = "%s",\n' % (self.scope,))
        if self.relationshipType is not None and 'relationshipType' not in already_processed:
            already_processed.append('relationshipType')
            showIndent(outfile, level)
            outfile.write('relationshipType = "%s",\n' % (self.relationshipType,))
        if self.externallyDefinedType is not None and 'externallyDefinedType' not in already_processed:
            already_processed.append('externallyDefinedType')
            showIndent(outfile, level)
            outfile.write('externallyDefinedType = %s,\n' % (self.externallyDefinedType,))
        for name, value in self.anyAttributes_.items():
            showIndent(outfile, level)
            outfile.write('%s = "%s",\n' % (name, value,))
        super(RelatedIndicatorType, self).exportLiteralAttributes(outfile, level, already_processed, name_)
    def exportLiteralChildren(self, outfile, level, name_):
        super(RelatedIndicatorType, self).exportLiteralChildren(outfile, level, name_)
        if self.RelatedIndicatorConfidence is not None:
            showIndent(outfile, level)
            outfile.write('RelatedIndicatorConfidence=model_.stix_common_binding.ConfidenceType(\n')
            self.RelatedIndicatorConfidence.exportLiteral(outfile, level, name_='RelatedIndicatorConfidence')
            showIndent(outfile, level)
            outfile.write('),\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('scope', node)
        if value is not None and 'scope' not in already_processed:
            already_processed.append('scope')
            self.scope = value
            self.scope = ' '.join(self.scope.split())
        value = find_attr_value_('relationshipType', node)
        if value is not None and 'relationshipType' not in already_processed:
            already_processed.append('relationshipType')
            self.relationshipType = value
        value = find_attr_value_('externallyDefinedType', node)
        if value is not None and 'externallyDefinedType' not in already_processed:
            already_processed.append('externallyDefinedType')
            self.externallyDefinedType = value
        self.anyAttributes_ = {}
        for name, value in attrs.items():
            if name not in already_processed:
                self.anyAttributes_[name] = value
        super(RelatedIndicatorType, self).buildAttributes(node, attrs, already_processed)
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'RelatedIndicatorConfidence':
            obj_ = stix_common_binding.ConfidenceType.factory()
            obj_.build(child_)
            self.set_RelatedIndicatorConfidence(obj_)
        super(RelatedIndicatorType, self).buildChildren(child_, node, nodeName_, True)
# end class RelatedIndicatorType

class IndicatedTTPType(stix_ttp_binding.TTPType):
    """The IndicatedTTPType specifies a single TTP asserted to be indicated
    by this cyber threat Indicator."""
    subclass = None
    superclass = stix_ttp_binding.TTPType
    def __init__(self, idref=None, id=None, version=None, Behavior_AttackPatterns=None, Behavior_Malware=None, Behavior_Exploits=None, Resource_Tools=None, Resource_Infrastructure=None, VictimTargeting=None, ExploitTargets=None, Intent=None, RelatedTTPs=None, KillChainPhases=None, InformationSource=None, KillChains=None, IndicatedTTPConfidence=None):
        super(IndicatedTTPType, self).__init__(idref, id, version, Behavior_AttackPatterns, Behavior_Malware, Behavior_Exploits, Resource_Tools, Resource_Infrastructure, VictimTargeting, ExploitTargets, Intent, RelatedTTPs, KillChainPhases, InformationSource, KillChains, )
        self.IndicatedTTPConfidence = IndicatedTTPConfidence
    def factory(*args_, **kwargs_):
        if IndicatedTTPType.subclass:
            return IndicatedTTPType.subclass(*args_, **kwargs_)
        else:
            return IndicatedTTPType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_IndicatedTTPConfidence(self): return self.IndicatedTTPConfidence
    def set_IndicatedTTPConfidence(self, IndicatedTTPConfidence): self.IndicatedTTPConfidence = IndicatedTTPConfidence
    def export(self, outfile, level, namespace_='indicator:', name_='IndicatedTTPType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='IndicatedTTPType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='indicator:', name_='IndicatedTTPType'):
        super(IndicatedTTPType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='IndicatedTTPType')
    def exportChildren(self, outfile, level, namespace_='indicator:', name_='IndicatedTTPType', fromsubclass_=False, pretty_print=True):
        super(IndicatedTTPType, self).exportChildren(outfile, level, 'indicator:', name_, True, pretty_print=pretty_print)
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.IndicatedTTPConfidence is not None:
            self.IndicatedTTPConfidence.export(outfile, level, 'indicator:', name_='IndicatedTTPConfidence', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.IndicatedTTPConfidence is not None or
            super(IndicatedTTPType, self).hasContent_()
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='IndicatedTTPType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        super(IndicatedTTPType, self).exportLiteralAttributes(outfile, level, already_processed, name_)
    def exportLiteralChildren(self, outfile, level, name_):
        super(IndicatedTTPType, self).exportLiteralChildren(outfile, level, name_)
        if self.IndicatedTTPConfidence is not None:
            showIndent(outfile, level)
            outfile.write('IndicatedTTPConfidence=model_.stix_common_binding.ConfidenceType(\n')
            self.IndicatedTTPConfidence.exportLiteral(outfile, level, name_='IndicatedTTPConfidence')
            showIndent(outfile, level)
            outfile.write('),\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        super(IndicatedTTPType, self).buildAttributes(node, attrs, already_processed)
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'IndicatedTTPConfidence':
            obj_ = stix_common_binding.ConfidenceType.factory()
            obj_.build(child_)
            self.set_IndicatedTTPConfidence(obj_)
        super(IndicatedTTPType, self).buildChildren(child_, node, nodeName_, True)
# end class IndicatedTTPType


class ObservablesType(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, Observable=None):
        self.Observable = Observable
            
    def factory(*args_, **kwargs_):
        if ObservablesType.subclass:
            return ObservablesType.subclass(*args_, **kwargs_)
        else:
            return ObservablesType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_Observable(self): return self.Observable
    def set_Observable(self, Observable): self.Observable = Observable

    def export(self, outfile, level, namespace_='indicator:', name_='ObservablesType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='ObservablesType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='indicator:', name_='ObservablesType'):
        pass
    def exportChildren(self, outfile, level, namespace_='indicator:', name_='ObservablesType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        
        
        self.Observable.export(outfile, level, "indicator:" , name_='Observable', pretty_print=pretty_print)

    def hasContent_(self):
        if (
            self.Observable is not None
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='ObservablesType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        pass
    def exportLiteralChildren(self, outfile, level, name_):
        showIndent(outfile, level)
        outfile.write('Observable=[\n')
        level += 1
        
        for Observable_ in self.Observable:
            showIndent(outfile, level)
            outfile.write('model_.ObservableType(\n')
            Observable_.exportLiteral(outfile, level, name_='Observable')
            showIndent(outfile, level)
            outfile.write('),\n')
        
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
            
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        pass
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'Observable':
            obj_ = cybox_core_binding.ObservableType.factory()
            obj_.build(child_)
            self.Observable = obj_
            
# end class ObservablesType



class KillChainPhasesType(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, kill_chain_phase=None):
        if kill_chain_phase is None:
            self.kill_chain_phase = []
        else:
            self.kill_chain_phase = kill_chain_phase
    def factory(*args_, **kwargs_):
        if KillChainPhasesType.subclass:
            return KillChainPhasesType.subclass(*args_, **kwargs_)
        else:
            return KillChainPhasesType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_kill_chain_phase(self): return self.kill_chain_phase
    def set_kill_chain_phase(self, kill_chain_phase): self.kill_chain_phase = kill_chain_phase
    def add_kill_chain_phase(self, value): self.kill_chain_phase.append(value)
    def insert_kill_chain_phase(self, index, value): self.kill_chain_phase[index] = value
    def export(self, outfile, level, namespace_='indicator:', name_='KillChainPhasesType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='KillChainPhasesType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='indicator:', name_='KillChainPhasesType'):
        pass
    def exportChildren(self, outfile, level, namespace_='indicator:', name_='KillChainPhasesType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        for kill_chain_phase_ in self.kill_chain_phase:
            kill_chain_phase_.export(outfile, level, namespace_, name_='kill-chain-phase', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.kill_chain_phase
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='KillChainPhasesType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        pass
    def exportLiteralChildren(self, outfile, level, name_):
        showIndent(outfile, level)
        outfile.write('kill_chain_phase=[\n')
        level += 1
        for kill_chain_phase_ in self.kill_chain_phase:
            showIndent(outfile, level)
            outfile.write('model_.kill_chain_phaseType(\n')
            kill_chain_phase_.exportLiteral(outfile, level, name_='kill-chain-phaseType')
            showIndent(outfile, level)
            outfile.write('),\n')
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        pass
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'kill-chain-phase':
            obj_ = kill_chain_phaseType.factory()
            obj_.build(child_)
            self.kill_chain_phase.append(obj_)
# end class KillChainPhasesType



class kill_chain_phaseType(stix_common_binding.KillChainPhaseType):
    """This field specifies the ID for the relevant defined kill chain.This
    field specifies the descriptive name of the relevant kill chain."""
    subclass = None
    superclass = stix_common_binding.KillChainPhaseType
    def __init__(self, phaseID=None, ordinality=None, name=None, killChainName=None, killChainID=None):
        super(kill_chain_phaseType, self).__init__(phaseID, ordinality, name, )
        self.killChainName = _cast(None, killChainName)
        self.killChainID = _cast(None, killChainID)
        pass
    def factory(*args_, **kwargs_):
        if kill_chain_phaseType.subclass:
            return kill_chain_phaseType.subclass(*args_, **kwargs_)
        else:
            return kill_chain_phaseType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_killChainName(self): return self.killChainName
    def set_killChainName(self, killChainName): self.killChainName = killChainName
    def get_killChainID(self): return self.killChainID
    def set_killChainID(self, killChainID): self.killChainID = killChainID
    def export(self, outfile, level, namespace_='indicator:', name_='kill-chain-phaseType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='kill-chain-phaseType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='indicator:', name_='kill-chain-phaseType'):
        super(kill_chain_phaseType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='kill-chain-phaseType')
        if self.killChainName is not None and 'killChainName' not in already_processed:
            already_processed.append('killChainName')
            outfile.write(' killChainName=%s' % (self.gds_format_string(quote_attrib(self.killChainName).encode(ExternalEncoding), input_name='killChainName'), ))
        if self.killChainID is not None and 'killChainID' not in already_processed:
            already_processed.append('killChainID')
            outfile.write(' killChainID=%s' % (quote_attrib(self.killChainID), ))
    def exportChildren(self, outfile, level, namespace_='indicator:', name_='kill-chain-phaseType', fromsubclass_=False, pretty_print=True):
        super(kill_chain_phaseType, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
        pass
    def hasContent_(self):
        if (
            super(kill_chain_phaseType, self).hasContent_()
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='kill-chain-phaseType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.killChainName is not None and 'killChainName' not in already_processed:
            already_processed.append('killChainName')
            showIndent(outfile, level)
            outfile.write('killChainName = "%s",\n' % (self.killChainName,))
        if self.killChainID is not None and 'killChainID' not in already_processed:
            already_processed.append('killChainID')
            showIndent(outfile, level)
            outfile.write('killChainID = %s,\n' % (self.killChainID,))
        super(kill_chain_phaseType, self).exportLiteralAttributes(outfile, level, already_processed, name_)
    def exportLiteralChildren(self, outfile, level, name_):
        super(kill_chain_phaseType, self).exportLiteralChildren(outfile, level, name_)
        pass
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('killChainName', node)
        if value is not None and 'killChainName' not in already_processed:
            already_processed.append('killChainName')
            self.killChainName = value
        value = find_attr_value_('killChainID', node)
        if value is not None and 'killChainID' not in already_processed:
            already_processed.append('killChainID')
            self.killChainID = value
        super(kill_chain_phaseType, self).buildAttributes(node, attrs, already_processed)
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        super(kill_chain_phaseType, self).buildChildren(child_, node, nodeName_, True)
        pass
# end class kill_chain_phaseType


class TestMechanismsType(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, TestMechanism=None):
        if TestMechanism is None:
            self.TestMechanism = []
        else:
            self.TestMechanism = TestMechanism
    def factory(*args_, **kwargs_):
        if TestMechanismsType.subclass:
            return TestMechanismsType.subclass(*args_, **kwargs_)
        else:
            return TestMechanismsType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_TestMechanism(self): return self.TestMechanism
    def set_TestMechanism(self, TestMechanism): self.TestMechanism = TestMechanism
    def add_TestMechanism(self, value): self.TestMechanism.append(value)
    def insert_TestMechanism(self, index, value): self.TestMechanism[index] = value
    def export(self, outfile, level, namespace_='indicator:', name_='TestMechanismsType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='TestMechanismsType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='indicator:', name_='TestMechanismsType'):
        pass
    def exportChildren(self, outfile, level, namespace_='indicator:', name_='TestMechanismsType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        for TestMechanism_ in self.get_TestMechanism():
            TestMechanism_.export(outfile, level, namespace_, name_='TestMechanism', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.TestMechanism
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='TestMechanismsType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        pass
    def exportLiteralChildren(self, outfile, level, name_):
        showIndent(outfile, level)
        outfile.write('TestMechanism=[\n')
        level += 1
        for TestMechanism_ in self.TestMechanism:
            showIndent(outfile, level)
            outfile.write('model_.TestMechanismType(\n')
            TestMechanism_.exportLiteral(outfile, level, name_='TestMechanismType')
            showIndent(outfile, level)
            outfile.write('),\n')
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        pass
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'TestMechanism':
            type_name_ = child_.attrib.get('{http://www.w3.org/2001/XMLSchema-instance}type')
            if type_name_ is None:
                raise NotImplementedError('No implementation given')
                #type_name_ = child_.attrib.get('type')
            
            if type_name_ is not None:
                type_names_ = type_name_.split(':')
                if len(type_names_) == 1:
                    type_name_ = type_names_[0]
                else:
                    type_name_ = type_names_[1] 
                    
                type_map = abs_impl.get(type_name_)
                type_module = type_map.get('module')
                type_python_name = type_map.get('python_name')
                
                if type_module != 'stix_indicator_1_1':
                    class_ = getattr(__import__(type_module, globals(), fromlist=[type_python_name]),type_python_name)
                else:
                    class_ = globals()[type_python_name]
                    
                obj_ = class_.factory()
                obj_.build(child_)
            else:
                raise NotImplementedError(
                    'Class not implemented for <Defined_Object> element')
            self.TestMechanism.append(obj_)
# end class TestMechanismsType



class LikelyImpactType(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, ImpactDescription=None, Confidence=None):
        self.ImpactDescription = ImpactDescription
        self.Confidence = Confidence
    def factory(*args_, **kwargs_):
        if LikelyImpactType.subclass:
            return LikelyImpactType.subclass(*args_, **kwargs_)
        else:
            return LikelyImpactType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_ImpactDescription(self): return self.ImpactDescription
    def set_ImpactDescription(self, ImpactDescription): self.ImpactDescription = ImpactDescription
    def get_Confidence(self): return self.Confidence
    def set_Confidence(self, Confidence): self.Confidence = Confidence
    def export(self, outfile, level, namespace_='indicator:', name_='LikelyImpactType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='LikelyImpactType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='indicator:', name_='LikelyImpactType'):
        pass
    def exportChildren(self, outfile, level, namespace_='indicator:', name_='LikelyImpactType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.ImpactDescription is not None:
            self.ImpactDescription.export(outfile, level, namespace_, name_='ImpactDescription', pretty_print=pretty_print)
        if self.Confidence is not None:
            self.Confidence.export(outfile, level, namespace_, name_='Confidence', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.ImpactDescription is not None or
            self.Confidence is not None
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='LikelyImpactType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        pass
    def exportLiteralChildren(self, outfile, level, name_):
        if self.ImpactDescription is not None:
            showIndent(outfile, level)
            outfile.write('ImpactDescription=model_.StructuredTextType(\n')
            self.ImpactDescription.exportLiteral(outfile, level, name_='ImpactDescription')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.Confidence is not None:
            showIndent(outfile, level)
            outfile.write('Confidence=model_.ConfidenceType(\n')
            self.Confidence.exportLiteral(outfile, level, name_='Confidence')
            showIndent(outfile, level)
            outfile.write('),\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        pass
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'ImpactDescription':
            obj_ = cybox_common_binding.StructuredTextType.factory()
            obj_.build(child_)
            self.set_ImpactDescription(obj_)
        elif nodeName_ == 'Confidence':
            obj_ = stix_common_binding.ConfidenceType.factory()
            obj_.build(child_)
            self.set_Confidence(obj_)
# end class LikelyImpactType


class SuggestedCOAsType(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, SuggestedCOA=None):
        if SuggestedCOA is None:
            self.SuggestedCOA = []
        else:
            self.SuggestedCOA = SuggestedCOA
    def factory(*args_, **kwargs_):
        if SuggestedCOAsType.subclass:
            return SuggestedCOAsType.subclass(*args_, **kwargs_)
        else:
            return SuggestedCOAsType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_SuggestedCOA(self): return self.SuggestedCOA
    def set_SuggestedCOA(self, SuggestedCOA): self.SuggestedCOA = SuggestedCOA
    def add_SuggestedCOA(self, value): self.SuggestedCOA.append(value)
    def insert_SuggestedCOA(self, index, value): self.SuggestedCOA[index] = value
    def export(self, outfile, level, namespace_='indicator:', name_='SuggestedCOAsType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='SuggestedCOAsType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='indicator:', name_='SuggestedCOAsType'):
        pass
    def exportChildren(self, outfile, level, namespace_='indicator:', name_='SuggestedCOAsType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        for SuggestedCOA_ in self.SuggestedCOA:
            SuggestedCOA_.export(outfile, level, namespace_, name_='SuggestedCOA', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.SuggestedCOA
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='SuggestedCOAsType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        pass
    def exportLiteralChildren(self, outfile, level, name_):
        showIndent(outfile, level)
        outfile.write('SuggestedCOA=[\n')
        level += 1
        for SuggestedCOA_ in self.SuggestedCOA:
            showIndent(outfile, level)
            outfile.write('model_.COAType(\n')
            SuggestedCOA_.exportLiteral(outfile, level, name_='COAType')
            showIndent(outfile, level)
            outfile.write('),\n')
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        pass
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'SuggestedCOA':
            obj_ = stix_coa_binding.COAType.factory()
            obj_.build(child_)
            self.SuggestedCOA.append(obj_)
# end class SuggestedCOAsType


class RelatedIndicatorsType(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, RelatedIndicator=None):
        if RelatedIndicator is None:
            self.RelatedIndicator = []
        else:
            self.RelatedIndicator = RelatedIndicator
    def factory(*args_, **kwargs_):
        if RelatedIndicatorsType.subclass:
            return RelatedIndicatorsType.subclass(*args_, **kwargs_)
        else:
            return RelatedIndicatorsType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_RelatedIndicator(self): return self.RelatedIndicator
    def set_RelatedIndicator(self, RelatedIndicator): self.RelatedIndicator = RelatedIndicator
    def add_RelatedIndicator(self, value): self.RelatedIndicator.append(value)
    def insert_RelatedIndicator(self, index, value): self.RelatedIndicator[index] = value
    def export(self, outfile, level, namespace_='indicator:', name_='RelatedIndicatorsType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='RelatedIndicatorsType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='indicator:', name_='RelatedIndicatorsType'):
        pass
    def exportChildren(self, outfile, level, namespace_='indicator:', name_='RelatedIndicatorsType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        for RelatedIndicator_ in self.RelatedIndicator:
            RelatedIndicator_.export(outfile, level, namespace_, name_='RelatedIndicator', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.RelatedIndicator
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='RelatedIndicatorsType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        pass
    def exportLiteralChildren(self, outfile, level, name_):
        showIndent(outfile, level)
        outfile.write('RelatedIndicator=[\n')
        level += 1
        for RelatedIndicator_ in self.RelatedIndicator:
            showIndent(outfile, level)
            outfile.write('model_.RelatedIndicatorType(\n')
            RelatedIndicator_.exportLiteral(outfile, level, name_='RelatedIndicatorType')
            showIndent(outfile, level)
            outfile.write('),\n')
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        pass
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'RelatedIndicator':
            obj_ = RelatedIndicatorType.factory()
            obj_.build(child_)
            self.RelatedIndicator.append(obj_)
# end class RelatedIndicatorsType



class ExtendedInformationType(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, anytypeobjs_=None):
        if anytypeobjs_ is None:
            self.anytypeobjs_ = []
        else:
            self.anytypeobjs_ = anytypeobjs_
    def factory(*args_, **kwargs_):
        if ExtendedInformationType.subclass:
            return ExtendedInformationType.subclass(*args_, **kwargs_)
        else:
            return ExtendedInformationType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_anytypeobjs_(self): return self.anytypeobjs_
    def set_anytypeobjs_(self, anytypeobjs_): self.anytypeobjs_ = anytypeobjs_
    def add_anytypeobjs_(self, value): self.anytypeobjs_.append(value)
    def insert_anytypeobjs_(self, index, value): self._anytypeobjs_[index] = value
    def export(self, outfile, level, namespace_='indicator:', name_='ExtendedInformationType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='ExtendedInformationType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='indicator:', name_='ExtendedInformationType'):
        pass
    def exportChildren(self, outfile, level, namespace_='indicator:', name_='ExtendedInformationType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        for obj_ in self.anytypeobjs_:
            obj_.export(outfile, level, namespace_, pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.anytypeobjs_
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='ExtendedInformationType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        pass
    def exportLiteralChildren(self, outfile, level, name_):
        showIndent(outfile, level)
        outfile.write('anytypeobjs_=[\n')
        level += 1
        for anytypeobjs_ in self.anytypeobjs_:
            anytypeobjs_.exportLiteral(outfile, level)
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        pass
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        obj_ = self.gds_build_any(child_, 'ExtendedInformationType')
        if obj_ is not None:
            self.add_anytypeobjs_(obj_)
# end class ExtendedInformationType




class EfficacyType(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, Description=None, Confidence=None):
        self.Description = Description
        self.Confidence = Confidence
    def factory(*args_, **kwargs_):
        if EfficacyType.subclass:
            return EfficacyType.subclass(*args_, **kwargs_)
        else:
            return EfficacyType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_Description(self): return self.Description
    def set_Description(self, Description): self.Description = Description
    def get_Confidence(self): return self.Confidence
    def set_Confidence(self, Confidence): self.Confidence = Confidence
    def export(self, outfile, level, namespace_='indicator:', name_='EfficacyType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='EfficacyType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='indicator:', name_='EfficacyType'):
        pass
    def exportChildren(self, outfile, level, namespace_='indicator:', name_='EfficacyType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.Description is not None:
            self.Description.export(outfile, level, namespace_, name_='Description', pretty_print=pretty_print)
        if self.Confidence is not None:
            self.Confidence.export(outfile, level, namespace_, name_='Confidence', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.Description is not None or
            self.Confidence is not None
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='EfficacyType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        pass
    def exportLiteralChildren(self, outfile, level, name_):
        if self.Description is not None:
            showIndent(outfile, level)
            outfile.write('Description=model_.StructuredTextType(\n')
            self.Description.exportLiteral(outfile, level, name_='Description')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.Confidence is not None:
            showIndent(outfile, level)
            outfile.write('Confidence=model_.ConfidenceType(\n')
            self.Confidence.exportLiteral(outfile, level, name_='Confidence')
            showIndent(outfile, level)
            outfile.write('),\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        pass
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'Description':
            obj_ = cybox_common_binding.StructuredTextType.factory()
            obj_.build(child_)
            self.set_Description(obj_)
        elif nodeName_ == 'Confidence':
            obj_ = stix_common_binding.ConfidenceType.factory()
            obj_.build(child_)
            self.set_Confidence(obj_)
# end class EfficacyType


class SightingType(GeneratedsSuper):
    """This field provides a URI that uniquely identifies the organization
    responsible for the sighting report.This field provides the date
    and time of the Indicator sighting.This field asserts the level
    of confidence that the sightingSource places in the accuracy of
    this sighting report as an observed instance of the Indicator."""
    subclass = None
    superclass = None
    def __init__(self, sightingSource=None, sightingConfidence=None, sightingReference=None, sightingTimestamp=None):
        self.sightingSource = _cast(None, sightingSource)
        self.sightingConfidence = _cast(None, sightingConfidence)
        self.sightingReference = _cast(None, sightingReference)
        self.sightingTimestamp = _cast(None, sightingTimestamp)
        pass
    def factory(*args_, **kwargs_):
        if SightingType.subclass:
            return SightingType.subclass(*args_, **kwargs_)
        else:
            return SightingType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_sightingSource(self): return self.sightingSource
    def set_sightingSource(self, sightingSource): self.sightingSource = sightingSource
    def get_sightingConfidence(self): return self.sightingConfidence
    def set_sightingConfidence(self, sightingConfidence): self.sightingConfidence = sightingConfidence
    def get_sightingReference(self): return self.sightingReference
    def set_sightingReference(self, sightingReference): self.sightingReference = sightingReference
    def get_sightingTimestamp(self): return self.sightingTimestamp
    def set_sightingTimestamp(self, sightingTimestamp): self.sightingTimestamp = sightingTimestamp
    def export(self, outfile, level, namespace_='indicator:', name_='SightingType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='SightingType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='indicator:', name_='SightingType'):
        if self.sightingSource is not None and 'sightingSource' not in already_processed:
            already_processed.append('sightingSource')
            outfile.write(' sightingSource=%s' % (self.gds_format_string(quote_attrib(self.sightingSource).encode(ExternalEncoding), input_name='sightingSource'), ))
        if self.sightingConfidence is not None and 'sightingConfidence' not in already_processed:
            already_processed.append('sightingConfidence')
            outfile.write(' sightingConfidence=%s' % (self.gds_format_string(quote_attrib(self.sightingConfidence).encode(ExternalEncoding), input_name='sightingConfidence'), ))
        if self.sightingReference is not None and 'sightingReference' not in already_processed:
            already_processed.append('sightingReference')
            outfile.write(' sightingReference=%s' % (self.gds_format_string(quote_attrib(self.sightingReference).encode(ExternalEncoding), input_name='sightingReference'), ))
        if self.sightingTimestamp is not None and 'sightingTimestamp' not in already_processed:
            already_processed.append('sightingTimestamp')
            outfile.write(' sightingTimestamp=%s' % (self.gds_format_string(quote_attrib(self.sightingTimestamp).encode(ExternalEncoding), input_name='sightingTimestamp'), ))
    def exportChildren(self, outfile, level, namespace_='indicator:', name_='SightingType', fromsubclass_=False, pretty_print=True):
        pass
    def hasContent_(self):
        if (

            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='SightingType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.sightingSource is not None and 'sightingSource' not in already_processed:
            already_processed.append('sightingSource')
            showIndent(outfile, level)
            outfile.write('sightingSource = "%s",\n' % (self.sightingSource,))
        if self.sightingConfidence is not None and 'sightingConfidence' not in already_processed:
            already_processed.append('sightingConfidence')
            showIndent(outfile, level)
            outfile.write('sightingConfidence = "%s",\n' % (self.sightingConfidence,))
        if self.sightingReference is not None and 'sightingReference' not in already_processed:
            already_processed.append('sightingReference')
            showIndent(outfile, level)
            outfile.write('sightingReference = "%s",\n' % (self.sightingReference,))
        if self.sightingTimestamp is not None and 'sightingTimestamp' not in already_processed:
            already_processed.append('sightingTimestamp')
            showIndent(outfile, level)
            outfile.write('sightingTimestamp = "%s",\n' % (self.sightingTimestamp,))
    def exportLiteralChildren(self, outfile, level, name_):
        pass
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('sightingSource', node)
        if value is not None and 'sightingSource' not in already_processed:
            already_processed.append('sightingSource')
            self.sightingSource = value
        value = find_attr_value_('sightingConfidence', node)
        if value is not None and 'sightingConfidence' not in already_processed:
            already_processed.append('sightingConfidence')
            self.sightingConfidence = value
        value = find_attr_value_('sightingReference', node)
        if value is not None and 'sightingReference' not in already_processed:
            already_processed.append('sightingReference')
            self.sightingReference = value
        value = find_attr_value_('sightingTimestamp', node)
        if value is not None and 'sightingTimestamp' not in already_processed:
            already_processed.append('sightingTimestamp')
            self.sightingTimestamp = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass
# end class sightingType




USAGE_TEXT = """
Usage: python <Parser>.py [ -s ] <in_xml_file>
"""

def usage():
    print(USAGE_TEXT)
    sys.exit(1)

def get_root_tag(node):
    tag = Tag_pattern_.match(node.tag).groups()[-1]
    rootClass = globals().get(tag)
    return tag, rootClass

def parse(inFileName):
    doc = parsexml_(inFileName)
    rootNode = doc.getroot()
    rootTag, rootClass = get_root_tag(rootNode)
    if rootClass is None:
        rootTag = 'Indicator'
        rootClass = IndicatorType
    rootObj = rootClass.factory()
    rootObj.build(rootNode)
    # Enable Python to collect the space used by the DOM.
    doc = None
    sys.stdout.write('<?xml version="1.0" ?>\n')
    rootObj.export(sys.stdout, 0, name_=rootTag,
        namespacedef_='',
        pretty_print=True)
    return rootObj

def parseString(inString):
    from StringIO import StringIO
    doc = parsexml_(StringIO(inString))
    rootNode = doc.getroot()
    rootTag, rootClass = get_root_tag(rootNode)
    if rootClass is None:
        rootTag = 'Indicator'
        rootClass = IndicatorType
    rootObj = rootClass.factory()
    rootObj.build(rootNode)
    # Enable Python to collect the space used by the DOM.
    doc = None
    sys.stdout.write('<?xml version="1.0" ?>\n')
    rootObj.export(sys.stdout, 0, name_="Indicator",
        namespacedef_='')
    return rootObj

def parseLiteral(inFileName):
    doc = parsexml_(inFileName)
    rootNode = doc.getroot()
    rootTag, rootClass = get_root_tag(rootNode)
    if rootClass is None:
        rootTag = 'Indicator'
        rootClass = IndicatorType
    rootObj = rootClass.factory()
    rootObj.build(rootNode)
    # Enable Python to collect the space used by the DOM.
    doc = None
    sys.stdout.write('#from stix_indicator_0_1 import *\n\n')
    sys.stdout.write('import stix_indicator_0_1 as model_\n\n')
    sys.stdout.write('rootObj = model_.rootTag(\n')
    rootObj.exportLiteral(sys.stdout, 0, name_=rootTag)
    sys.stdout.write(')\n')
    return rootObj

def main():
    args = sys.argv[1:]
    if len(args) == 1:
        parse(args[0])
    else:
        usage()

if __name__ == '__main__':
    #import pdb; pdb.set_trace()
    main()

__all__ = [
    "IndicatorType",
    "ValidTimeType",
    "CompositeIndicatorExpressionType",
    "IndicatedTTPType",
    "TestMechanismType",
    "GenericTestMechanismType",
    "COARuleType",
    "sightingsType",
    "RelationshipType",
    "RelatedIndicatorType"
    ]
