<s> from __future__ import absolute_import <EOL> from . structured_text import StructuredText , StructuredTextList <EOL> from . vocabs import VocabString <EOL> from . datetimewithprecision import DateTimeWithPrecision <EOL> from . activity import Activity <EOL> from . confidence import Confidence <EOL> from . identity import Identity <EOL> from . information_source import InformationSource <EOL> from . statement import Statement <EOL> from . tools import ToolInformation <EOL> from . names import Names <EOL> from . campaign_reference import CampaignRef <EOL> from . related import ( <EOL> GenericRelationshipList , RelatedCampaign , RelatedCOA , <EOL> RelatedExploitTarget , RelatedIdentity , RelatedIncident , <EOL> RelatedIndicator , RelatedObservable , RelatedThreatActor , RelatedTTP , <EOL> RelatedPackage , RelatedPackages , RelatedCampaignRef , RelatedReports , <EOL> RelatedReport <EOL> ) <EOL> from stix . core import STIXPackage <EOL> from cybox . core import Observable <EOL> from stix . campaign import Campaign <EOL> from stix . coa import CourseOfAction <EOL> from stix . exploit_target import ExploitTarget <EOL> from stix . incident import Incident <EOL> from stix . indicator import Indicator <EOL> from stix . report import Report <EOL> from stix . threat_actor import ThreatActor <EOL> from stix . ttp import TTP <EOL> RelatedCampaign . _base_type = Campaign <EOL> RelatedCOA . _base_type = CourseOfAction <EOL> RelatedExploitTarget . _base_type = ExploitTarget <EOL> RelatedIdentity . _base_type = Identity <EOL> RelatedIncident . _base_type = Incident <EOL> RelatedIndicator . _base_type = Indicator <EOL> RelatedThreatActor . _base_type = ThreatActor <EOL> RelatedTTP . _base_type = TTP <EOL> RelatedObservable . _base_type = Observable <EOL> RelatedPackage . _base_type = STIXPackage <EOL> RelatedReport . _base_type = Report <EOL> RelatedCampaignRef . _base_type = CampaignRef <EOL> RelatedPackages . _contained_type = RelatedPackage <EOL> RelatedReports . _contained_type = RelatedReport <EOL> import stix <EOL> import stix . utils as utils <EOL> import stix . bindings . stix_common as common_binding <EOL> class EncodedCDATA ( stix . Entity ) : <EOL> _namespace = "<STR_LIT>" <EOL> _binding = common_binding <EOL> _binding_class = _binding . EncodedCDATAType <EOL> def __init__ ( self , value = None , encoded = None ) : <EOL> self . value = value <EOL> self . encoded = encoded <EOL> @ property <EOL> def value ( self ) : <EOL> return self . _value <EOL> @ value . setter <EOL> def value ( self , value ) : <EOL> self . _value = utils . strip_cdata ( value ) <EOL> @ property <EOL> def cdata ( self ) : <EOL> return utils . cdata ( self . value ) <EOL> @ classmethod <EOL> def from_obj ( cls , obj , return_obj = None ) : <EOL> if not obj : <EOL> return None <EOL> if not return_obj : <EOL> return_obj = cls ( ) <EOL> return_obj . value = obj . valueOf_ <EOL> return_obj . encoded = obj . encoded <EOL> return return_obj <EOL> def to_obj ( self , return_obj = None , ns_info = None ) : <EOL> super ( EncodedCDATA , self ) . to_obj ( return_obj = return_obj , ns_info = ns_info ) <EOL> if not return_obj : <EOL> return_obj = self . _binding_class ( ) <EOL> return_obj . encoded = self . encoded <EOL> return_obj . valueOf_ = utils . cdata ( self . value ) <EOL> return return_obj <EOL> @ classmethod <EOL> def from_dict ( cls , d , return_obj = None ) : <EOL> if not d : <EOL> return None <EOL> if not return_obj : <EOL> return_obj = cls ( ) <EOL> return_obj . value = utils . strip_cdata ( d . get ( '<STR_LIT:value>' ) ) <EOL> return_obj . encoded = bool ( d . get ( '<STR_LIT>' ) ) <EOL> return return_obj <EOL> def to_dict ( self ) : <EOL> d = { } <EOL> if not self . value : <EOL> return d <EOL> d [ '<STR_LIT:value>' ] = utils . strip_cdata ( self . value ) <EOL> d [ '<STR_LIT>' ] = bool ( self . encoded ) <EOL> return d <EOL> def __str__ ( self ) : <EOL> return self . __unicode__ ( ) . encode ( "<STR_LIT:utf-8>" ) <EOL> def __unicode__ ( self ) : <EOL> return unicode ( self . value ) </s>
