<s> import sys <EOL> from mixbox . binding_utils import * <EOL> from . import cybox_common <EOL> class CodeSegmentXORType ( cybox_common . StringObjectPropertyType ) : <EOL> """<STR_LIT>""" <EOL> subclass = None <EOL> superclass = cybox_common . StringObjectPropertyType <EOL> def __init__ ( self , obfuscation_algorithm_ref = None , refanging_transform_type = None , has_changed = None , delimiter = '<STR_LIT>' , pattern_type = None , datatype = '<STR_LIT:string>' , refanging_transform = None , is_case_sensitive = True , bit_mask = None , appears_random = None , observed_encoding = None , defanging_algorithm_ref = None , is_obfuscated = None , regex_syntax = None , apply_condition = '<STR_LIT>' , trend = None , idref = None , is_defanged = None , id = None , condition = None , xor_pattern = '<STR_LIT>' , valueOf_ = None ) : <EOL> super ( CodeSegmentXORType , self ) . __init__ ( obfuscation_algorithm_ref , refanging_transform_type , has_changed , delimiter , pattern_type , datatype , refanging_transform , is_case_sensitive , bit_mask , appears_random , observed_encoding , defanging_algorithm_ref , is_obfuscated , regex_syntax , apply_condition , trend , idref , is_defanged , id , condition , valueOf_ ) <EOL> self . xor_pattern = _cast ( None , xor_pattern ) <EOL> self . valueOf_ = valueOf_ <EOL> def factory ( * args_ , ** kwargs_ ) : <EOL> if CodeSegmentXORType . subclass : <EOL> return CodeSegmentXORType . subclass ( * args_ , ** kwargs_ ) <EOL> else : <EOL> return CodeSegmentXORType ( * args_ , ** kwargs_ ) <EOL> factory = staticmethod ( factory ) <EOL> def get_xor_pattern ( self ) : return self . xor_pattern <EOL> def set_xor_pattern ( self , xor_pattern ) : self . xor_pattern = xor_pattern <EOL> def get_valueOf_ ( self ) : return self . valueOf_ <EOL> def set_valueOf_ ( self , valueOf_ ) : self . valueOf_ = valueOf_ <EOL> def hasContent_ ( self ) : <EOL> if ( <EOL> self . valueOf_ or <EOL> super ( CodeSegmentXORType , self ) . hasContent_ ( ) <EOL> ) : <EOL> return True <EOL> else : <EOL> return False <EOL> def export ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , namespacedef_ = '<STR_LIT>' , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , namespacedef_ and '<STR_LIT:U+0020>' + namespacedef_ or '<STR_LIT>' , ) ) <EOL> already_processed = set ( ) <EOL> self . exportAttributes ( lwrite , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . hasContent_ ( ) : <EOL> lwrite ( '<STR_LIT:>>' ) <EOL> lwrite ( quote_xml ( self . valueOf_ ) ) <EOL> self . exportChildren ( lwrite , level + <NUM_LIT:1> , namespace_ , name_ , pretty_print = pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , eol_ ) ) <EOL> else : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> def exportAttributes ( self , lwrite , level , already_processed , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' ) : <EOL> super ( CodeSegmentXORType , self ) . exportAttributes ( lwrite , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . xor_pattern is not None : <EOL> lwrite ( '<STR_LIT>' % ( self . gds_format_string ( quote_attrib ( self . xor_pattern ) , input_name = '<STR_LIT>' ) , ) ) <EOL> def exportChildren ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , fromsubclass_ = False , pretty_print = True ) : <EOL> super ( CodeSegmentXORType , self ) . exportChildren ( lwrite , level , '<STR_LIT>' , name_ , True , pretty_print = pretty_print ) <EOL> pass <EOL> def build ( self , node ) : <EOL> already_processed = set ( ) <EOL> self . buildAttributes ( node , node . attrib , already_processed ) <EOL> self . valueOf_ = get_all_text_ ( node ) <EOL> for child in node : <EOL> nodeName_ = Tag_pattern_ . match ( child . tag ) . groups ( ) [ - <NUM_LIT:1> ] <EOL> self . buildChildren ( child , node , nodeName_ ) <EOL> def buildAttributes ( self , node , attrs , already_processed ) : <EOL> value = find_attr_value_ ( '<STR_LIT>' , node ) <EOL> if value is not None : <EOL> self . xor_pattern = value <EOL> super ( CodeSegmentXORType , self ) . buildAttributes ( node , attrs , already_processed ) <EOL> def buildChildren ( self , child_ , node , nodeName_ , fromsubclass_ = False ) : <EOL> pass <EOL> class TargetedPlatformsType ( GeneratedsSuper ) : <EOL> """<STR_LIT>""" <EOL> subclass = None <EOL> superclass = None <EOL> def __init__ ( self , Targeted_Platform = None ) : <EOL> if Targeted_Platform is None : <EOL> self . Targeted_Platform = [ ] <EOL> else : <EOL> self . Targeted_Platform = Targeted_Platform <EOL> def factory ( * args_ , ** kwargs_ ) : <EOL> if TargetedPlatformsType . subclass : <EOL> return TargetedPlatformsType . subclass ( * args_ , ** kwargs_ ) <EOL> else : <EOL> return TargetedPlatformsType ( * args_ , ** kwargs_ ) <EOL> factory = staticmethod ( factory ) <EOL> def get_Targeted_Platform ( self ) : return self . Targeted_Platform <EOL> def set_Targeted_Platform ( self , Targeted_Platform ) : self . Targeted_Platform = Targeted_Platform <EOL> def add_Targeted_Platform ( self , value ) : self . Targeted_Platform . append ( value ) <EOL> def insert_Targeted_Platform ( self , index , value ) : self . Targeted_Platform [ index ] = value <EOL> def hasContent_ ( self ) : <EOL> if ( <EOL> self . Targeted_Platform <EOL> ) : <EOL> return True <EOL> else : <EOL> return False <EOL> def export ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , namespacedef_ = '<STR_LIT>' , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , namespacedef_ and '<STR_LIT:U+0020>' + namespacedef_ or '<STR_LIT>' , ) ) <EOL> already_processed = set ( ) <EOL> self . exportAttributes ( lwrite , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . hasContent_ ( ) : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> self . exportChildren ( lwrite , level + <NUM_LIT:1> , namespace_ , name_ , pretty_print = pretty_print ) <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , eol_ ) ) <EOL> else : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> def exportAttributes ( self , lwrite , level , already_processed , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' ) : <EOL> pass <EOL> def exportChildren ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , fromsubclass_ = False , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> for Targeted_Platform_ in self . Targeted_Platform : <EOL> Targeted_Platform_ . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> def build ( self , node ) : <EOL> already_processed = set ( ) <EOL> self . buildAttributes ( node , node . attrib , already_processed ) <EOL> for child in node : <EOL> nodeName_ = Tag_pattern_ . match ( child . tag ) . groups ( ) [ - <NUM_LIT:1> ] <EOL> self . buildChildren ( child , node , nodeName_ ) <EOL> def buildAttributes ( self , node , attrs , already_processed ) : <EOL> pass <EOL> def buildChildren ( self , child_ , node , nodeName_ , fromsubclass_ = False ) : <EOL> if nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . PlatformSpecificationType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . Targeted_Platform . append ( obj_ ) <EOL> class ProcessorTypeType ( cybox_common . BaseObjectPropertyType ) : <EOL> """<STR_LIT>""" <EOL> subclass = None <EOL> superclass = cybox_common . BaseObjectPropertyType <EOL> def __init__ ( self , obfuscation_algorithm_ref = None , refanging_transform_type = None , has_changed = None , delimiter = '<STR_LIT>' , pattern_type = None , datatype = '<STR_LIT:string>' , refanging_transform = None , is_case_sensitive = True , bit_mask = None , appears_random = None , observed_encoding = None , defanging_algorithm_ref = None , is_obfuscated = None , regex_syntax = None , apply_condition = '<STR_LIT>' , trend = None , idref = None , is_defanged = None , id = None , condition = None , valueOf_ = None ) : <EOL> super ( ProcessorTypeType , self ) . __init__ ( obfuscation_algorithm_ref , refanging_transform_type , has_changed , delimiter , pattern_type , datatype , refanging_transform , is_case_sensitive , bit_mask , appears_random , observed_encoding , defanging_algorithm_ref , is_obfuscated , regex_syntax , apply_condition , trend , idref , is_defanged , id , condition , valueOf_ ) <EOL> self . datatype = _cast ( None , datatype ) <EOL> self . valueOf_ = valueOf_ <EOL> def factory ( * args_ , ** kwargs_ ) : <EOL> if ProcessorTypeType . subclass : <EOL> return ProcessorTypeType . subclass ( * args_ , ** kwargs_ ) <EOL> else : <EOL> return ProcessorTypeType ( * args_ , ** kwargs_ ) <EOL> factory = staticmethod ( factory ) <EOL> def get_datatype ( self ) : return self . datatype <EOL> def set_datatype ( self , datatype ) : self . datatype = datatype <EOL> def get_valueOf_ ( self ) : return self . valueOf_ <EOL> def set_valueOf_ ( self , valueOf_ ) : self . valueOf_ = valueOf_ <EOL> def hasContent_ ( self ) : <EOL> if ( <EOL> self . valueOf_ or <EOL> super ( ProcessorTypeType , self ) . hasContent_ ( ) <EOL> ) : <EOL> return True <EOL> else : <EOL> return False <EOL> def export ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , namespacedef_ = '<STR_LIT>' , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , namespacedef_ and '<STR_LIT:U+0020>' + namespacedef_ or '<STR_LIT>' , ) ) <EOL> already_processed = set ( ) <EOL> self . exportAttributes ( lwrite , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . hasContent_ ( ) : <EOL> lwrite ( '<STR_LIT:>>' ) <EOL> lwrite ( quote_xml ( self . valueOf_ ) ) <EOL> self . exportChildren ( lwrite , level + <NUM_LIT:1> , namespace_ , name_ , pretty_print = pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , eol_ ) ) <EOL> else : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> def exportAttributes ( self , lwrite , level , already_processed , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' ) : <EOL> super ( ProcessorTypeType , self ) . exportAttributes ( lwrite , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . datatype is not None : <EOL> lwrite ( '<STR_LIT>' % ( quote_attrib ( self . datatype ) , ) ) <EOL> def exportChildren ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , fromsubclass_ = False , pretty_print = True ) : <EOL> super ( ProcessorTypeType , self ) . exportChildren ( lwrite , level , '<STR_LIT>' , name_ , True , pretty_print = pretty_print ) <EOL> pass <EOL> def build ( self , node ) : <EOL> already_processed = set ( ) <EOL> self . buildAttributes ( node , node . attrib , already_processed ) <EOL> self . valueOf_ = get_all_text_ ( node ) <EOL> for child in node : <EOL> nodeName_ = Tag_pattern_ . match ( child . tag ) . groups ( ) [ - <NUM_LIT:1> ] <EOL> self . buildChildren ( child , node , nodeName_ ) <EOL> def buildAttributes ( self , node , attrs , already_processed ) : <EOL> value = find_attr_value_ ( '<STR_LIT>' , node ) <EOL> if value is not None : <EOL> self . datatype = value <EOL> super ( ProcessorTypeType , self ) . buildAttributes ( node , attrs , already_processed ) <EOL> def buildChildren ( self , child_ , node , nodeName_ , fromsubclass_ = False ) : <EOL> pass <EOL> class CodeLanguageType ( cybox_common . BaseObjectPropertyType ) : <EOL> """<STR_LIT>""" <EOL> subclass = None <EOL> superclass = cybox_common . BaseObjectPropertyType <EOL> def __init__ ( self , obfuscation_algorithm_ref = None , refanging_transform_type = None , has_changed = None , delimiter = '<STR_LIT>' , pattern_type = None , datatype = '<STR_LIT:string>' , refanging_transform = None , is_case_sensitive = True , bit_mask = None , appears_random = None , observed_encoding = None , defanging_algorithm_ref = None , is_obfuscated = None , regex_syntax = None , apply_condition = '<STR_LIT>' , trend = None , idref = None , is_defanged = None , id = None , condition = None , valueOf_ = None ) : <EOL> super ( CodeLanguageType , self ) . __init__ ( obfuscation_algorithm_ref , refanging_transform_type , has_changed , delimiter , pattern_type , datatype , refanging_transform , is_case_sensitive , bit_mask , appears_random , observed_encoding , defanging_algorithm_ref , is_obfuscated , regex_syntax , apply_condition , trend , idref , is_defanged , id , condition , valueOf_ ) <EOL> self . datatype = _cast ( None , datatype ) <EOL> self . valueOf_ = valueOf_ <EOL> def factory ( * args_ , ** kwargs_ ) : <EOL> if CodeLanguageType . subclass : <EOL> return CodeLanguageType . subclass ( * args_ , ** kwargs_ ) <EOL> else : <EOL> return CodeLanguageType ( * args_ , ** kwargs_ ) <EOL> factory = staticmethod ( factory ) <EOL> def get_datatype ( self ) : return self . datatype <EOL> def set_datatype ( self , datatype ) : self . datatype = datatype <EOL> def get_valueOf_ ( self ) : return self . valueOf_ <EOL> def set_valueOf_ ( self , valueOf_ ) : self . valueOf_ = valueOf_ <EOL> def hasContent_ ( self ) : <EOL> if ( <EOL> self . valueOf_ or <EOL> super ( CodeLanguageType , self ) . hasContent_ ( ) <EOL> ) : <EOL> return True <EOL> else : <EOL> return False <EOL> def export ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , namespacedef_ = '<STR_LIT>' , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , namespacedef_ and '<STR_LIT:U+0020>' + namespacedef_ or '<STR_LIT>' , ) ) <EOL> already_processed = set ( ) <EOL> self . exportAttributes ( lwrite , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . hasContent_ ( ) : <EOL> lwrite ( '<STR_LIT:>>' ) <EOL> lwrite ( quote_xml ( self . valueOf_ ) ) <EOL> self . exportChildren ( lwrite , level + <NUM_LIT:1> , namespace_ , name_ , pretty_print = pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , eol_ ) ) <EOL> else : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> def exportAttributes ( self , lwrite , level , already_processed , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' ) : <EOL> super ( CodeLanguageType , self ) . exportAttributes ( lwrite , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . datatype is not None : <EOL> lwrite ( '<STR_LIT>' % ( quote_attrib ( self . datatype ) , ) ) <EOL> def exportChildren ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , fromsubclass_ = False , pretty_print = True ) : <EOL> super ( CodeLanguageType , self ) . exportChildren ( lwrite , level , '<STR_LIT>' , name_ , True , pretty_print = pretty_print ) <EOL> pass <EOL> def build ( self , node ) : <EOL> already_processed = set ( ) <EOL> self . buildAttributes ( node , node . attrib , already_processed ) <EOL> self . valueOf_ = get_all_text_ ( node ) <EOL> for child in node : <EOL> nodeName_ = Tag_pattern_ . match ( child . tag ) . groups ( ) [ - <NUM_LIT:1> ] <EOL> self . buildChildren ( child , node , nodeName_ ) <EOL> def buildAttributes ( self , node , attrs , already_processed ) : <EOL> value = find_attr_value_ ( '<STR_LIT>' , node ) <EOL> if value is not None : <EOL> self . datatype = value <EOL> super ( CodeLanguageType , self ) . buildAttributes ( node , attrs , already_processed ) <EOL> def buildChildren ( self , child_ , node , nodeName_ , fromsubclass_ = False ) : <EOL> pass <EOL> class CodePurposeType ( cybox_common . BaseObjectPropertyType ) : <EOL> """<STR_LIT>""" <EOL> subclass = None <EOL> superclass = cybox_common . BaseObjectPropertyType <EOL> def __init__ ( self , obfuscation_algorithm_ref = None , refanging_transform_type = None , has_changed = None , delimiter = '<STR_LIT>' , pattern_type = None , datatype = '<STR_LIT:string>' , refanging_transform = None , is_case_sensitive = True , bit_mask = None , appears_random = None , observed_encoding = None , defanging_algorithm_ref = None , is_obfuscated = None , regex_syntax = None , apply_condition = '<STR_LIT>' , trend = None , idref = None , is_defanged = None , id = None , condition = None , valueOf_ = None ) : <EOL> super ( CodePurposeType , self ) . __init__ ( obfuscation_algorithm_ref , refanging_transform_type , has_changed , delimiter , pattern_type , datatype , refanging_transform , is_case_sensitive , bit_mask , appears_random , observed_encoding , defanging_algorithm_ref , is_obfuscated , regex_syntax , apply_condition , trend , idref , is_defanged , id , condition , valueOf_ ) <EOL> self . datatype = _cast ( None , datatype ) <EOL> self . valueOf_ = valueOf_ <EOL> def factory ( * args_ , ** kwargs_ ) : <EOL> if CodePurposeType . subclass : <EOL> return CodePurposeType . subclass ( * args_ , ** kwargs_ ) <EOL> else : <EOL> return CodePurposeType ( * args_ , ** kwargs_ ) <EOL> factory = staticmethod ( factory ) <EOL> def get_datatype ( self ) : return self . datatype <EOL> def set_datatype ( self , datatype ) : self . datatype = datatype <EOL> def get_valueOf_ ( self ) : return self . valueOf_ <EOL> def set_valueOf_ ( self , valueOf_ ) : self . valueOf_ = valueOf_ <EOL> def hasContent_ ( self ) : <EOL> if ( <EOL> self . valueOf_ or <EOL> super ( CodePurposeType , self ) . hasContent_ ( ) <EOL> ) : <EOL> return True <EOL> else : <EOL> return False <EOL> def export ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , namespacedef_ = '<STR_LIT>' , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , namespacedef_ and '<STR_LIT:U+0020>' + namespacedef_ or '<STR_LIT>' , ) ) <EOL> already_processed = set ( ) <EOL> self . exportAttributes ( lwrite , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . hasContent_ ( ) : <EOL> lwrite ( '<STR_LIT:>>' ) <EOL> lwrite ( quote_xml ( self . valueOf_ ) ) <EOL> self . exportChildren ( lwrite , level + <NUM_LIT:1> , namespace_ , name_ , pretty_print = pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , eol_ ) ) <EOL> else : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> def exportAttributes ( self , lwrite , level , already_processed , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' ) : <EOL> super ( CodePurposeType , self ) . exportAttributes ( lwrite , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . datatype is not None : <EOL> lwrite ( '<STR_LIT>' % ( quote_attrib ( self . datatype ) , ) ) <EOL> def exportChildren ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , fromsubclass_ = False , pretty_print = True ) : <EOL> super ( CodePurposeType , self ) . exportChildren ( lwrite , level , '<STR_LIT>' , name_ , True , pretty_print = pretty_print ) <EOL> pass <EOL> def build ( self , node ) : <EOL> already_processed = set ( ) <EOL> self . buildAttributes ( node , node . attrib , already_processed ) <EOL> self . valueOf_ = get_all_text_ ( node ) <EOL> for child in node : <EOL> nodeName_ = Tag_pattern_ . match ( child . tag ) . groups ( ) [ - <NUM_LIT:1> ] <EOL> self . buildChildren ( child , node , nodeName_ ) <EOL> def buildAttributes ( self , node , attrs , already_processed ) : <EOL> value = find_attr_value_ ( '<STR_LIT>' , node ) <EOL> if value is not None : <EOL> self . datatype = value <EOL> super ( CodePurposeType , self ) . buildAttributes ( node , attrs , already_processed ) <EOL> def buildChildren ( self , child_ , node , nodeName_ , fromsubclass_ = False ) : <EOL> pass <EOL> class CodeTypeType ( cybox_common . BaseObjectPropertyType ) : <EOL> """<STR_LIT>""" <EOL> subclass = None <EOL> superclass = cybox_common . BaseObjectPropertyType <EOL> def __init__ ( self , obfuscation_algorithm_ref = None , refanging_transform_type = None , has_changed = None , delimiter = '<STR_LIT>' , pattern_type = None , datatype = '<STR_LIT:string>' , refanging_transform = None , is_case_sensitive = True , bit_mask = None , appears_random = None , observed_encoding = None , defanging_algorithm_ref = None , is_obfuscated = None , regex_syntax = None , apply_condition = '<STR_LIT>' , trend = None , idref = None , is_defanged = None , id = None , condition = None , valueOf_ = None ) : <EOL> super ( CodeTypeType , self ) . __init__ ( obfuscation_algorithm_ref , refanging_transform_type , has_changed , delimiter , pattern_type , datatype , refanging_transform , is_case_sensitive , bit_mask , appears_random , observed_encoding , defanging_algorithm_ref , is_obfuscated , regex_syntax , apply_condition , trend , idref , is_defanged , id , condition , valueOf_ ) <EOL> self . datatype = _cast ( None , datatype ) <EOL> self . valueOf_ = valueOf_ <EOL> def factory ( * args_ , ** kwargs_ ) : <EOL> if CodeTypeType . subclass : <EOL> return CodeTypeType . subclass ( * args_ , ** kwargs_ ) <EOL> else : <EOL> return CodeTypeType ( * args_ , ** kwargs_ ) <EOL> factory = staticmethod ( factory ) <EOL> def get_datatype ( self ) : return self . datatype <EOL> def set_datatype ( self , datatype ) : self . datatype = datatype <EOL> def get_valueOf_ ( self ) : return self . valueOf_ <EOL> def set_valueOf_ ( self , valueOf_ ) : self . valueOf_ = valueOf_ <EOL> def hasContent_ ( self ) : <EOL> if ( <EOL> self . valueOf_ or <EOL> super ( CodeTypeType , self ) . hasContent_ ( ) <EOL> ) : <EOL> return True <EOL> else : <EOL> return False <EOL> def export ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , namespacedef_ = '<STR_LIT>' , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , namespacedef_ and '<STR_LIT:U+0020>' + namespacedef_ or '<STR_LIT>' , ) ) <EOL> already_processed = set ( ) <EOL> self . exportAttributes ( lwrite , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . hasContent_ ( ) : <EOL> lwrite ( '<STR_LIT:>>' ) <EOL> lwrite ( quote_xml ( self . valueOf_ ) ) <EOL> self . exportChildren ( lwrite , level + <NUM_LIT:1> , namespace_ , name_ , pretty_print = pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , eol_ ) ) <EOL> else : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> def exportAttributes ( self , lwrite , level , already_processed , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' ) : <EOL> super ( CodeTypeType , self ) . exportAttributes ( lwrite , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . datatype is not None : <EOL> lwrite ( '<STR_LIT>' % ( quote_attrib ( self . datatype ) , ) ) <EOL> def exportChildren ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , fromsubclass_ = False , pretty_print = True ) : <EOL> super ( CodeTypeType , self ) . exportChildren ( lwrite , level , '<STR_LIT>' , name_ , True , pretty_print = pretty_print ) <EOL> pass <EOL> def build ( self , node ) : <EOL> already_processed = set ( ) <EOL> self . buildAttributes ( node , node . attrib , already_processed ) <EOL> self . valueOf_ = get_all_text_ ( node ) <EOL> for child in node : <EOL> nodeName_ = Tag_pattern_ . match ( child . tag ) . groups ( ) [ - <NUM_LIT:1> ] <EOL> self . buildChildren ( child , node , nodeName_ ) <EOL> def buildAttributes ( self , node , attrs , already_processed ) : <EOL> value = find_attr_value_ ( '<STR_LIT>' , node ) <EOL> if value is not None : <EOL> self . datatype = value <EOL> super ( CodeTypeType , self ) . buildAttributes ( node , attrs , already_processed ) <EOL> def buildChildren ( self , child_ , node , nodeName_ , fromsubclass_ = False ) : <EOL> pass <EOL> class CodeObjectType ( cybox_common . ObjectPropertiesType ) : <EOL> """<STR_LIT>""" <EOL> subclass = None <EOL> superclass = cybox_common . ObjectPropertiesType <EOL> def __init__ ( self , object_reference = None , Custom_Properties = None , xsi_type = None , Description = None , Type = None , Purpose = None , Code_Language = None , Targeted_Platforms = None , Processor_Family = None , Discovery_Method = None , Start_Address = None , Code_Segment = None , Code_Segment_XOR = None , Digital_Signatures = None , Extracted_Features = None ) : <EOL> super ( CodeObjectType , self ) . __init__ ( object_reference , Custom_Properties , xsi_type ) <EOL> self . Description = Description <EOL> self . Type = Type <EOL> self . Purpose = Purpose <EOL> self . Code_Language = Code_Language <EOL> self . Targeted_Platforms = Targeted_Platforms <EOL> if Processor_Family is None : <EOL> self . Processor_Family = [ ] <EOL> else : <EOL> self . Processor_Family = Processor_Family <EOL> self . Discovery_Method = Discovery_Method <EOL> self . Start_Address = Start_Address <EOL> self . Code_Segment = Code_Segment <EOL> self . Code_Segment_XOR = Code_Segment_XOR <EOL> self . Digital_Signatures = Digital_Signatures <EOL> self . Extracted_Features = Extracted_Features <EOL> def factory ( * args_ , ** kwargs_ ) : <EOL> if CodeObjectType . subclass : <EOL> return CodeObjectType . subclass ( * args_ , ** kwargs_ ) <EOL> else : <EOL> return CodeObjectType ( * args_ , ** kwargs_ ) <EOL> factory = staticmethod ( factory ) <EOL> def get_Description ( self ) : return self . Description <EOL> def set_Description ( self , Description ) : self . Description = Description <EOL> def get_Type ( self ) : return self . Type <EOL> def set_Type ( self , Type ) : self . Type = Type <EOL> def validate_CodeTypeType ( self , value ) : <EOL> pass <EOL> def get_Purpose ( self ) : return self . Purpose <EOL> def set_Purpose ( self , Purpose ) : self . Purpose = Purpose <EOL> def validate_CodePurposeType ( self , value ) : <EOL> pass <EOL> def get_Code_Language ( self ) : return self . Code_Language <EOL> def set_Code_Language ( self , Code_Language ) : self . Code_Language = Code_Language <EOL> def validate_CodeLanguageType ( self , value ) : <EOL> pass <EOL> def get_Targeted_Platforms ( self ) : return self . Targeted_Platforms <EOL> def set_Targeted_Platforms ( self , Targeted_Platforms ) : self . Targeted_Platforms = Targeted_Platforms <EOL> def get_Processor_Family ( self ) : return self . Processor_Family <EOL> def set_Processor_Family ( self , Processor_Family ) : self . Processor_Family = Processor_Family <EOL> def add_Processor_Family ( self , value ) : self . Processor_Family . append ( value ) <EOL> def validate_ProcessorTypeType ( self , value ) : <EOL> pass <EOL> def get_Discovery_Method ( self ) : return self . Discovery_Method <EOL> def set_Discovery_Method ( self , Discovery_Method ) : self . Discovery_Method = Discovery_Method <EOL> def get_Start_Address ( self ) : return self . Start_Address <EOL> def set_Start_Address ( self , Start_Address ) : self . Start_Address = Start_Address <EOL> def validate_HexBinaryObjectPropertyType ( self , value ) : <EOL> pass <EOL> def get_Code_Segment ( self ) : return self . Code_Segment <EOL> def set_Code_Segment ( self , Code_Segment ) : self . Code_Segment = Code_Segment <EOL> def validate_StringObjectPropertyType ( self , value ) : <EOL> pass <EOL> def get_Code_Segment_XOR ( self ) : return self . Code_Segment_XOR <EOL> def set_Code_Segment_XOR ( self , Code_Segment_XOR ) : self . Code_Segment_XOR = Code_Segment_XOR <EOL> def get_Digital_Signatures ( self ) : return self . Digital_Signatures <EOL> def set_Digital_Signatures ( self , Digital_Signatures ) : self . Digital_Signatures = Digital_Signatures <EOL> def get_Extracted_Features ( self ) : return self . Extracted_Features <EOL> def set_Extracted_Features ( self , Extracted_Features ) : self . Extracted_Features = Extracted_Features <EOL> def hasContent_ ( self ) : <EOL> if ( <EOL> self . Description is not None or <EOL> self . Type is not None or <EOL> self . Purpose is not None or <EOL> self . Code_Language is not None or <EOL> self . Targeted_Platforms is not None or <EOL> self . Processor_Family or <EOL> self . Discovery_Method is not None or <EOL> self . Start_Address is not None or <EOL> self . Code_Segment is not None or <EOL> self . Code_Segment_XOR is not None or <EOL> self . Digital_Signatures is not None or <EOL> self . Extracted_Features is not None or <EOL> super ( CodeObjectType , self ) . hasContent_ ( ) <EOL> ) : <EOL> return True <EOL> else : <EOL> return False <EOL> def export ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , namespacedef_ = '<STR_LIT>' , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , namespacedef_ and '<STR_LIT:U+0020>' + namespacedef_ or '<STR_LIT>' , ) ) <EOL> already_processed = set ( ) <EOL> self . exportAttributes ( lwrite , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . hasContent_ ( ) : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> self . exportChildren ( lwrite , level + <NUM_LIT:1> , namespace_ , name_ , pretty_print = pretty_print ) <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , eol_ ) ) <EOL> else : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> def exportAttributes ( self , lwrite , level , already_processed , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' ) : <EOL> super ( CodeObjectType , self ) . exportAttributes ( lwrite , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> def exportChildren ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , fromsubclass_ = False , pretty_print = True ) : <EOL> super ( CodeObjectType , self ) . exportChildren ( lwrite , level , '<STR_LIT>' , name_ , True , pretty_print = pretty_print ) <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> if self . Description is not None : <EOL> self . Description . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Type is not None : <EOL> self . Type . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Purpose is not None : <EOL> self . Purpose . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Code_Language is not None : <EOL> self . Code_Language . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Targeted_Platforms is not None : <EOL> self . Targeted_Platforms . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> for Processor_Family_ in self . Processor_Family : <EOL> Processor_Family_ . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Discovery_Method is not None : <EOL> self . Discovery_Method . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Start_Address is not None : <EOL> self . Start_Address . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Code_Segment is not None : <EOL> self . Code_Segment . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Code_Segment_XOR is not None : <EOL> self . Code_Segment_XOR . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Digital_Signatures is not None : <EOL> self . Digital_Signatures . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Extracted_Features is not None : <EOL> self . Extracted_Features . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> def build ( self , node ) : <EOL> already_processed = set ( ) <EOL> self . buildAttributes ( node , node . attrib , already_processed ) <EOL> for child in node : <EOL> nodeName_ = Tag_pattern_ . match ( child . tag ) . groups ( ) [ - <NUM_LIT:1> ] <EOL> self . buildChildren ( child , node , nodeName_ ) <EOL> def buildAttributes ( self , node , attrs , already_processed ) : <EOL> super ( CodeObjectType , self ) . buildAttributes ( node , attrs , already_processed ) <EOL> def buildChildren ( self , child_ , node , nodeName_ , fromsubclass_ = False ) : <EOL> if nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StructuredTextType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Description ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = CodeTypeType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Type ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = CodePurposeType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Purpose ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = CodeLanguageType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Code_Language ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = TargetedPlatformsType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Targeted_Platforms ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = ProcessorTypeType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . Processor_Family . append ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . MeasureSourceType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Discovery_Method ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . HexBinaryObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Start_Address ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Code_Segment ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = CodeSegmentXORType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Code_Segment_XOR ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . DigitalSignaturesType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Digital_Signatures ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . ExtractedFeaturesType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Extracted_Features ( obj_ ) <EOL> super ( CodeObjectType , self ) . buildChildren ( child_ , node , nodeName_ , True ) <EOL> GDSClassesMapping = { <EOL> '<STR_LIT>' : cybox_common . BuildUtilityType , <EOL> '<STR_LIT>' : cybox_common . ErrorsType , <EOL> '<STR_LIT>' : cybox_common . TimeType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . MetadataType , <EOL> '<STR_LIT>' : cybox_common . HashType , <EOL> '<STR_LIT>' : cybox_common . ControlledVocabularyStringType , <EOL> '<STR_LIT>' : cybox_common . HashValueType , <EOL> '<STR_LIT>' : cybox_common . FuzzyHashStructureType , <EOL> '<STR_LIT>' : cybox_common . MetadataType , <EOL> '<STR_LIT>' : cybox_common . HashValueType , <EOL> '<STR_LIT>' : cybox_common . DigitalSignatureInfoType , <EOL> '<STR_LIT>' : cybox_common . CodeSnippetsType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . ControlledVocabularyStringType , <EOL> '<STR_LIT>' : cybox_common . InternationalizationSettingsType , <EOL> '<STR_LIT>' : cybox_common . ToolConfigurationType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . FunctionsType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . PlatformSpecificationType , <EOL> '<STR_LIT>' : cybox_common . CompilerInformalDescriptionType , <EOL> '<STR_LIT>' : cybox_common . ObjectPropertiesType , <EOL> '<STR_LIT>' : cybox_common . PlatformSpecificationType , <EOL> '<STR_LIT>' : cybox_common . UsageContextAssumptionsType , <EOL> '<STR_LIT>' : cybox_common . ExtractedFeaturesType , <EOL> '<STR_LIT>' : cybox_common . CompilersType , <EOL> '<STR_LIT>' : cybox_common . DigitalSignaturesType , <EOL> '<STR_LIT>' : cybox_common . ExtractedStringType , <EOL> '<STR_LIT>' : cybox_common . CustomPropertiesType , <EOL> '<STR_LIT>' : cybox_common . BuildInformationType , <EOL> '<STR_LIT>' : cybox_common . HashListType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . ErrorInstancesType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . PropertyType , <EOL> '<STR_LIT>' : cybox_common . ExtractedStringsType , <EOL> '<STR_LIT>' : cybox_common . PersonnelType , <EOL> '<STR_LIT>' : cybox_common . StructuredTextType , <EOL> '<STR_LIT>' : cybox_common . ObjectPropertiesType , <EOL> '<STR_LIT>' : cybox_common . ConfigurationSettingsType , <EOL> '<STR_LIT>' : cybox_common . SimpleHashValueType , <EOL> '<STR_LIT>' : cybox_common . HexBinaryObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . PlatformSpecificationType , <EOL> '<STR_LIT>' : cybox_common . ObjectPropertiesType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . PlatformIdentifierType , <EOL> '<STR_LIT>' : cybox_common . ToolSpecificDataType , <EOL> '<STR_LIT>' : cybox_common . ExecutionEnvironmentType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . DependenciesType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . DateRangeType , <EOL> '<STR_LIT>' : cybox_common . HashListType , <EOL> '<STR_LIT>' : cybox_common . HashSegmentsType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StructuredTextType , <EOL> '<STR_LIT>' : cybox_common . FuzzyHashBlockType , <EOL> '<STR_LIT>' : cybox_common . DependencyType , <EOL> '<STR_LIT>' : cybox_common . ErrorType , <EOL> '<STR_LIT>' : cybox_common . HexBinaryObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . EnvironmentVariableType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . ByteRunType , <EOL> '<STR_LIT>' : cybox_common . LibrariesType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . ImportsType , <EOL> '<STR_LIT>' : cybox_common . LibraryType , <EOL> '<STR_LIT>' : cybox_common . ToolReferencesType , <EOL> '<STR_LIT>' : cybox_common . InternalStringsType , <EOL> '<STR_LIT>' : cybox_common . ConfigurationSettingType , <EOL> '<STR_LIT>' : cybox_common . HexBinaryObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StructuredTextType , <EOL> '<STR_LIT>' : cybox_common . ObjectPropertiesType , <EOL> '<STR_LIT>' : cybox_common . BuildConfigurationType , <EOL> '<STR_LIT>' : cybox_common . ControlledVocabularyStringType , <EOL> '<STR_LIT>' : cybox_common . MeasureSourceType , <EOL> '<STR_LIT>' : cybox_common . HexBinaryObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . HashSegmentType , <EOL> '<STR_LIT>' : cybox_common . CompilerType , <EOL> '<STR_LIT:Name>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . ControlledVocabularyStringType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . PlatformSpecificationType , <EOL> '<STR_LIT>' : cybox_common . FuzzyHashValueType , <EOL> '<STR_LIT>' : cybox_common . DataSizeType , <EOL> '<STR_LIT>' : cybox_common . StructuredTextType , <EOL> '<STR_LIT>' : cybox_common . ContributorType , <EOL> '<STR_LIT>' : cybox_common . ToolsInformationType , <EOL> '<STR_LIT>' : cybox_common . ToolInformationType , <EOL> } <EOL> USAGE_TEXT = """<STR_LIT>""" <EOL> def usage ( ) : <EOL> print ( USAGE_TEXT ) <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> def get_root_tag ( node ) : <EOL> tag = Tag_pattern_ . match ( node . tag ) . groups ( ) [ - <NUM_LIT:1> ] <EOL> rootClass = GDSClassesMapping . get ( tag ) <EOL> if rootClass is None : <EOL> rootClass = globals ( ) . get ( tag ) <EOL> return tag , rootClass <EOL> def parse ( inFileName ) : <EOL> doc = parsexml_ ( inFileName ) <EOL> rootNode = doc . getroot ( ) <EOL> rootTag , rootClass = get_root_tag ( rootNode ) <EOL> if rootClass is None : <EOL> rootTag = '<STR_LIT>' <EOL> rootClass = CodeObjectType <EOL> rootObj = rootClass . factory ( ) <EOL> rootObj . build ( rootNode ) <EOL> doc = None <EOL> return rootObj <EOL> def parseEtree ( inFileName ) : <EOL> doc = parsexml_ ( inFileName ) <EOL> rootNode = doc . getroot ( ) <EOL> rootTag , rootClass = get_root_tag ( rootNode ) <EOL> if rootClass is None : <EOL> rootTag = '<STR_LIT>' <EOL> rootClass = CodeObjectType <EOL> rootObj = rootClass . factory ( ) <EOL> rootObj . build ( rootNode ) <EOL> doc = None <EOL> rootElement = rootObj . to_etree ( None , name_ = rootTag ) <EOL> content = etree_ . tostring ( rootElement , pretty_print = True , <EOL> xml_declaration = True , encoding = "<STR_LIT:utf-8>" ) <EOL> sys . stdout . write ( content ) <EOL> sys . stdout . write ( '<STR_LIT:\n>' ) <EOL> return rootObj , rootElement <EOL> def parseString ( inString ) : <EOL> from mixbox . vendor . six import StringIO <EOL> doc = parsexml_ ( StringIO ( inString ) ) <EOL> rootNode = doc . getroot ( ) <EOL> rootTag , rootClass = get_root_tag ( rootNode ) <EOL> if rootClass is None : <EOL> rootTag = '<STR_LIT>' <EOL> rootClass = CodeObjectType <EOL> rootObj = rootClass . factory ( ) <EOL> rootObj . build ( rootNode ) <EOL> doc = None <EOL> return rootObj <EOL> def main ( ) : <EOL> args = sys . argv [ <NUM_LIT:1> : ] <EOL> if len ( args ) == <NUM_LIT:1> : <EOL> parse ( args [ <NUM_LIT:0> ] ) <EOL> else : <EOL> usage ( ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> main ( ) <EOL> __all__ = [ <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" <EOL> ] </s>
