本文整理汇总了Python中stix.common.StructuredTextList.from_dict方法的典型用法代码示例。如果您正苦于以下问题:Python StructuredTextList.from_dict方法的具体用法?Python StructuredTextList.from_dict怎么用?Python StructuredTextList.from_dict使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stix.common.StructuredTextList
的用法示例。
在下文中一共展示了StructuredTextList.from_dict方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: from_dict
# 需要导入模块: from stix.common import StructuredTextList [as 别名]
# 或者: from stix.common.StructuredTextList import from_dict [as 别名]
def from_dict(cls, dict_repr, return_obj=None):
if not dict_repr:
return None
if not return_obj:
return_obj = cls()
return_obj.id_ = dict_repr.get('id')
return_obj.title = dict_repr.get('title')
return_obj.descriptions = StructuredTextList.from_dict(dict_repr.get('description'))
return_obj.short_descriptions = StructuredTextList.from_dict(dict_repr.get('short_description'))
return return_obj
示例2: from_dict
# 需要导入模块: from stix.common import StructuredTextList [as 别名]
# 或者: from stix.common.StructuredTextList import from_dict [as 别名]
def from_dict(cls, dict_repr, return_obj=None):
if not dict_repr:
return None
if not return_obj:
return_obj = cls()
get = dict_repr.get
return_obj.description = StructuredTextList.from_dict(get('description'))
return_obj.short_description = StructuredTextList.from_dict(get('short_description'))
return_obj.applicability_confidence = Confidence.from_dict(get('applicability_confidence'))
return return_obj
示例3: from_dict
# 需要导入模块: from stix.common import StructuredTextList [as 别名]
# 或者: from stix.common.StructuredTextList import from_dict [as 别名]
def from_dict(cls, dict_repr, return_obj=None):
if not dict_repr:
return None
if not return_obj:
return_obj = cls()
get = dict_repr.get
return_obj.descriptions = StructuredTextList.from_dict(get('description'))
return_obj.short_descriptions = StructuredTextList.from_dict(get('short_description'))
return_obj.cce_id = get('cce_id')
return return_obj
示例4: from_dict
# 需要导入模块: from stix.common import StructuredTextList [as 别名]
# 或者: from stix.common.StructuredTextList import from_dict [as 别名]
def from_dict(cls, dict_repr, return_obj=None):
if not dict_repr:
return None
if not return_obj:
return_obj = cls()
return_obj.id_ = dict_repr.get('id')
return_obj.title = dict_repr.get('title')
return_obj.descriptions = StructuredTextList.from_dict(dict_repr.get('description'))
return_obj.short_descriptions = StructuredTextList.from_dict(dict_repr.get('short_description'))
return_obj.types = [VocabString.from_dict(x) for x in dict_repr.get('types', [])]
return_obj.observable_characterization = Observables.from_dict(dict_repr.get('observable_characterization'))
return return_obj
示例5: from_dict
# 需要导入模块: from stix.common import StructuredTextList [as 别名]
# 或者: from stix.common.StructuredTextList import from_dict [as 别名]
def from_dict(cls, dict_repr, return_obj=None):
if not dict_repr:
return None
if not return_obj:
return_obj = cls()
get = dict_repr.get
return_obj.title = get('title')
return_obj.intents = _ReportIntents.from_list(get('intents'))
return_obj.descriptions = StructuredTextList.from_dict(get('description'))
return_obj.short_descriptions = StructuredTextList.from_dict(get('short_description'))
return_obj.handling = Marking.from_dict(get('handling'))
return_obj.information_source = InformationSource.from_dict(get('information_source'))
return return_obj
示例6: from_dict
# 需要导入模块: from stix.common import StructuredTextList [as 别名]
# 或者: from stix.common.StructuredTextList import from_dict [as 别名]
def from_dict(cls, d, return_obj=None):
if not d:
return None
if not return_obj:
return_obj = cls()
get = d.get
return_obj.type_ = AssetType.from_dict(get('type'))
return_obj.descriptions = StructuredTextList.from_dict(get('description'))
return_obj.business_functions_or_roles = StructuredTextList.from_dict(get('business_function_or_role'))
return_obj.ownership_class = VocabString.from_dict(get('ownership_class'))
return_obj.management_class = VocabString.from_dict(get('management_class'))
return_obj.location_class = VocabString.from_dict(get('location_class'))
# return_obj.location = Location.from_dict(get('location'))
return_obj.nature_of_security_effect = NatureOfSecurityEffect.from_dict(get('nature_of_security_effect'))
return_obj.structured_description = Observables.from_dict(get('structured_description'))
return return_obj
示例7: from_dict
# 需要导入模块: from stix.common import StructuredTextList [as 别名]
# 或者: from stix.common.StructuredTextList import from_dict [as 别名]
def from_dict(cls, d, return_obj=None):
from stix.common import StructuredTextList, InformationSource
from stix.data_marking import Marking
if not return_obj:
raise ValueError("Must provide a return_obj argument")
get = d.get
return_obj.id_ = get("id")
return_obj.idref = get("idref")
return_obj.timestamp = get("timestamp")
return_obj.version = get("version")
return_obj.title = get("title")
return_obj.descriptions = StructuredTextList.from_dict(get("description"))
return_obj.short_descriptions = StructuredTextList.from_dict(get("short_description"))
return_obj.information_source = InformationSource.from_dict(get("information_source"))
return_obj.handling = Marking.from_dict(get("handling"))
return return_obj
示例8: from_dict
# 需要导入模块: from stix.common import StructuredTextList [as 别名]
# 或者: from stix.common.StructuredTextList import from_dict [as 别名]
def from_dict(cls, dict_repr, return_obj=None):
if not dict_repr:
return None
if not return_obj:
return_obj = cls()
return_obj.descriptions = StructuredTextList.from_dict(dict_repr.get('description'))
return_obj.cwe_id = dict_repr.get('cwe_id')
return return_obj
示例9: from_dict
# 需要导入模块: from stix.common import StructuredTextList [as 别名]
# 或者: from stix.common.StructuredTextList import from_dict [as 别名]
def from_dict(cls, dict_repr, return_obj=None):
from stix.extensions.malware import maec_4_1_malware # noqa
if not dict_repr:
return None
get = dict_repr.get
if not return_obj:
klass = stix.lookup_extension(get('xsi:type'), cls)
return_obj = klass.from_dict(dict_repr, klass())
else:
return_obj.id_ = get('id')
return_obj.title = get('title')
return_obj.descriptions = StructuredTextList.from_dict(get('description'))
return_obj.short_descriptions = StructuredTextList.from_dict(get('short_description'))
return_obj.names = MalwareNames.from_dict(get('names'))
return_obj.types = MalwareTypes.from_dict(get('types'))
return return_obj
示例10: from_dict
# 需要导入模块: from stix.common import StructuredTextList [as 别名]
# 或者: from stix.common.StructuredTextList import from_dict [as 别名]
def from_dict(cls, dict_repr, return_obj=None):
if not dict_repr:
return None
if not return_obj:
return_obj = cls()
get = dict_repr.get
return_obj.is_known = utils.xml_bool(get('is_known'))
return_obj.is_publicly_acknowledged = utils.xml_bool(get('is_publicly_acknowledged'))
return_obj.title = get('title')
return_obj.descriptions = StructuredTextList.from_dict(get('description'))
return_obj.short_descriptions = StructuredTextList.from_dict(get('short_description'))
return_obj.cve_id = get('cve_id')
return_obj.osvdb_id = get('osvdb_id')
return_obj.source = get('source')
return_obj.cvss_score = CVSSVector.from_dict(get('cvss_score'))
return_obj.discovered_datetime = DateTimeWithPrecision.from_dict(get('discovered_datetime'))
return_obj.published_datetime = DateTimeWithPrecision.from_dict(get('published_datetime'))
return_obj.affected_software = AffectedSoftware.from_dict(get('affected_software'))
return_obj.references = get('references')
return return_obj
示例11: from_dict
# 需要导入模块: from stix.common import StructuredTextList [as 别名]
# 或者: from stix.common.StructuredTextList import from_dict [as 别名]
def from_dict(cls, d, return_obj=None):
if not d:
return None
if not return_obj:
return_obj = cls()
super(GenericTestMechanism, cls).from_dict(d, return_obj)
return_obj.reference_location = d.get('reference_location')
return_obj.descriptions = StructuredTextList.from_dict(d.get('description'))
return_obj.type_ = VocabString.from_dict(d.get('type'))
return_obj.specification = EncodedCDATA.from_dict(d.get('specification'))
return return_obj
示例12: from_dict
# 需要导入模块: from stix.common import StructuredTextList [as 别名]
# 或者: from stix.common.StructuredTextList import from_dict [as 别名]
def from_dict(cls, d, return_obj=None):
if not d:
return None
if not return_obj:
return_obj = cls()
return_obj.property_ = VocabString.from_dict(d.get('property'))
return_obj.descriptions_of_effect = StructuredTextList.from_dict(d.get('description_of_effect'))
return_obj.type_of_availability_loss = VocabString.from_dict(d.get('type_of_availability_loss'))
return_obj.duration_of_availability_loss = VocabString.from_dict(d.get('duration_of_availability_loss'))
return_obj.non_public_data_compromised = NonPublicDataCompromised.from_dict(d.get('non_public_data_compromised'))
return return_obj
示例13: from_dict
# 需要导入模块: from stix.common import StructuredTextList [as 别名]
# 或者: from stix.common.StructuredTextList import from_dict [as 别名]
def from_dict(cls, d, return_obj=None):
from stix.common import StructuredTextList, InformationSource
from stix.data_marking import Marking
if not return_obj:
raise ValueError("Must provide a return_obj argument")
get = d.get
return_obj.id_ = get('id')
return_obj.idref = get('idref')
return_obj.timestamp = get('timestamp')
return_obj.version = get('version')
return_obj.title = get('title')
return_obj.descriptions = \
StructuredTextList.from_dict(get('description'))
return_obj.short_descriptions = \
StructuredTextList.from_dict(get('short_description'))
return_obj.information_source = \
InformationSource.from_dict(get('information_source'))
return_obj.handling = \
Marking.from_dict(get('handling'))
return return_obj
示例14: from_dict
# 需要导入模块: from stix.common import StructuredTextList [as 别名]
# 或者: from stix.common.StructuredTextList import from_dict [as 别名]
def from_dict(cls, d, return_obj=None):
if not d:
return None
if return_obj is None:
return_obj = cls()
return_obj.timestamp = d.get('timestamp')
return_obj.timestamp_precision = d.get('timestamp_precision')
return_obj.source = InformationSource.from_dict(d.get('source'))
return_obj.reference = d.get('reference')
return_obj.confidence = Confidence.from_dict(d.get('confidence'))
return_obj.descriptions = StructuredTextList.from_dict(d.get('description'))
return_obj.related_observables = RelatedObservables.from_dict(d.get('related_observables'))
return return_obj