<commit_before>#MAEC Object Reference Class

#Copyright (c) 2014, The MITRE Corporation
#All rights reserved

#Compatible with MAEC v4.1
#Last updated 02/18/2014

import maec
import maec.bindings.maec_bundle as bundle_binding       

class ObjectReference(maec.Entity):
    _namespace = maec.bundle._namespace

    def init(self, object_idref = None):
        super(ObjectReference, self).__init__()
        self.object_idref = object_idref

    def to_obj(self):
        object_reference_obj = bundle_binding.ObjectReferenceType()
        if self.object_idref is not None : object_reference_obj.set_object_idref(self.object_idref)
        return object_reference_obj

    def to_dict(self):
        object_reference_dict = {}
        if self.object_idref is not None : object_reference_dict['object_idref'] = self.object_idref
        return object_reference_dict

    @staticmethod
    def from_dict(object_reference_dict):
        if not object_reference_dict:
            return None
        object_reference_ = ObjectReference()
        object_reference_.object_idref = object_reference_dict.get('object_idref')
        return object_reference_

    @staticmethod
    def from_obj(object_reference_obj):
        if not object_reference_obj:
            return None
        object_reference_ = ObjectReference()
        object_reference_.object_idref = object_reference_obj.get_object_idref()
        return object_reference_
        
class ObjectReferenceList(maec.EntityList):
    _contained_type = ObjectReference
    _binding_class = bundle_binding.ObjectReferenceListType
    _binding_var = "Object_Reference"
    _namespace = maec.bundle._namespace<commit_msg>Updated for TypedField implementation<commit_after># MAEC Object Reference Class

# Copyright (c) 2014, The MITRE Corporation
# All rights reserved

# Compatible with MAEC v4.1
# Last updated 08/28/2014

import maec
import maec.bindings.maec_bundle as bundle_binding       

class ObjectReference(maec.Entity):
    _binding = bundle_binding
    _binding_class = bundle_binding.ObjectReferenceType
    _namespace = maec.bundle._namespace

    def __init__(self, object_idref = None):
        super(ObjectReference, self).__init__()
        self.object_idref = object_idref
        
class ObjectReferenceList(maec.EntityList):
    _contained_type = ObjectReference
    _binding_class = bundle_binding.ObjectReferenceListType
    _binding_var = "Object_Reference"
    _namespace = maec.bundle._namespace
{'fraction_non_alphanumeric': 0.06315789473684211, 'fraction_numerical': 0.011336032388663968, 'mean_word_length': 3.77027027027027, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1859165', 'n_tokens_mistral': 723, 'n_tokens_neox': 693, 'n_words': 155}