Copies the event tag to a dictionary.

    Returns:
      dict[str, object]: event tag attributes.
489937
def CopyToDict(self):
    
    result_dict = {
        'labels': self.labels
    }
    if self.comment:
      result_dict['comment'] = self.comment

    return result_dict
199386
def dict(self):
    ''''''
    return {
        'raw': self.raw,
        'start': self.start,
        'end': self.end,
        'entities': [(e.tag, e) for e in self.entities],
        'tokens': self.tokens,
        'words': self.words,
        'pos_tags': self.pos_tags,
        'language': self.language.code,
        # TODO: 'polarity': self.polarity,
    }
1341457
def get_as_datadict(self):
        
        return dict(type=self.__class__.__name__, tags=list(self.tags))
847318
def as_dict(self):
        

        element_dict = super(HTMLElement, self).as_dict()

        if hasattr(self, 'content'):
            element_dict['content'] = self.content

        return element_dict
1253991
def CopyToDict(self):
    
    path_spec_dict = {}
    for attribute_name, attribute_value in iter(self.__dict__.items()):
      if attribute_value is None:
        continue

      if attribute_name == 'parent':
        attribute_value = attribute_value.CopyToDict()

      path_spec_dict[attribute_name] = attribute_value

    return path_spec_dict
306056
def get_events(self):
        
        res = copy.copy(self.events)
        del self.events[:]
        return res
577987
def _FormatTag(self, event):
    
    tag = getattr(event, 'tag', None)

    if not tag:
      return '-'

    return ' '.join(tag.labels)
293708
def to_dict(self):
        
        return dict(
            (attr, getattr(self, attr))
            for attr in self.ATTRIBUTES
            if hasattr(self, attr)
        )
1149523
def as_dict(self):
        
        tags_dict = dict(self)
        tags_dict['@module'] = self.__class__.__module__
        tags_dict['@class'] = self.__class__.__name__
        return tags_dict
26012
def to_dict(self):
        
        if self._dict is not None:
            return self._dict

        result = {}
        for key in self.ATTRIBUTES:
            value = getattr(self, key)
            if value:
                result[key] = value
        self._dict = result
        return result
1317589
def get_all_events(self):
        
        self.all_events = {}
        events = self.tree.findall('EVENT')
        events += self.tree.findall('CC')
        for e in events:
            event_id = e.attrib['id']
            if event_id in self._static_events:
                continue
            event_type = e.find('type').text
            try:
                self.all_events[event_type].append(event_id)
            except KeyError:
                self.all_events[event_type] = [event_id]
1249428
def _CreateEventTag(self, event, comment, labels):
    
    event_identifier = event.GetIdentifier()

    event_tag = events.EventTag(comment=comment)
    event_tag.SetEventIdentifier(event_identifier)
    event_tag.AddLabels(labels)

    event_identifier_string = event_identifier.CopyToString()
    logger.debug('Created event tag: {0:s} for event: {1:s}'.format(
        comment, event_identifier_string))

    return event_tag
216465
def build_dictionary(self):
        
        d = {}
        for t in self.all_tags_of_type(DefinitionTag, recurse_into_sprites = False):
            if t.characterId in d:
                #print 'redefinition of characterId %d:' % (t.characterId)
                #print '  was:', d[t.characterId]
                #print 'redef:', t
                raise ValueError('illegal redefinition of character')
            d[t.characterId] = t
        return d
1144641
def as_dict(self):
        
        return {self.FLD_OP: self._op.name,
                self.FLD_MARK: self._pos,
                self.FLD_FLD: self._fld}
58247
def tag_to_dict(html):
    """"""

    element = document_fromstring(html).xpath("//html/body/child::*")[0]
    attributes = dict(element.attrib)
    attributes["text"] = element.text_content()
    return attributes
1303755
def to_dict(self):
        

        msg_dict = {}
        msg_dict['level'] = self.level
        msg_dict['message'] = self.message
        msg_dict['now_time'] = monotonic()
        msg_dict['created_time'] = self.created
        msg_dict['id'] = self.id
        msg_dict['count'] = self.count

        return msg_dict
1340982
def tags(self):
        
        ret = {}
        for typ in _meta_fields_twig:
            if typ in ['uniqueid', 'plugin', 'feedback', 'fitting', 'history', 'twig', 'uniquetwig']:
                continue

            k = '{}s'.format(typ)
            ret[k] = getattr(self, k)

        return ret