当前位置: 首页>>代码示例>>Python>>正文


Python StructuredTextList.from_dict方法代码示例

本文整理汇总了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
开发者ID:ExodusIntelligence,项目名称:python-stix,代码行数:14,代码来源:exploit.py

示例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
开发者ID:ExodusIntelligence,项目名称:python-stix,代码行数:14,代码来源:objective.py

示例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
开发者ID:ExodusIntelligence,项目名称:python-stix,代码行数:15,代码来源:configuration.py

示例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
开发者ID:ExodusIntelligence,项目名称:python-stix,代码行数:16,代码来源:infrastructure.py

示例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
开发者ID:ExodusIntelligence,项目名称:python-stix,代码行数:19,代码来源:header.py

示例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
开发者ID:ExodusIntelligence,项目名称:python-stix,代码行数:19,代码来源:affected_asset.py

示例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
开发者ID:dandye,项目名称:python-stix,代码行数:21,代码来源:base.py

示例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
开发者ID:ExodusIntelligence,项目名称:python-stix,代码行数:12,代码来源:weakness.py

示例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
开发者ID:ExodusIntelligence,项目名称:python-stix,代码行数:22,代码来源:malware_instance.py

示例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
开发者ID:ExodusIntelligence,项目名称:python-stix,代码行数:24,代码来源:vulnerability.py

示例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
开发者ID:ExodusIntelligence,项目名称:python-stix,代码行数:15,代码来源:generic_test_mechanism.py

示例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
开发者ID:ExodusIntelligence,项目名称:python-stix,代码行数:15,代码来源:property_affected.py

示例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
开发者ID:shinsec,项目名称:python-stix,代码行数:25,代码来源:base.py

示例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
开发者ID:ExodusIntelligence,项目名称:python-stix,代码行数:16,代码来源:sightings.py


注:本文中的stix.common.StructuredTextList.from_dict方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。