Returns an extra keyword arguments dictionary that is used with
        the `add_item` call of the feed generator.
        Add the 'content' field of the 'Entry' item, to be used by the custom
        feed generator.
499474
def item_extra_kwargs(self, action):
        
        item = self.format(action)
        item.pop('title', None)
        item['uri'] = item.pop('url')
        item['activity:verb'] = item.pop('verb')
        return item
1347618
def _additional(self, idents, kwargs):
        ''''''
        if kwargs:
            for name, value in list(kwargs.items()):
                if not isinstance(value, list):
                    raise ValueError('Additional arguments must be lists of \
same length as idents')
                for i in range(len(value)):
                    self[idents[i]][name] = value[i]
837229
def extend(self, *args, **kwargs):
        
        if len(args) > 1:
            raise TypeError("extend() takes at most 1 positional "
                            "arguments ({0} given)".format(len(args)))
        other = args[0] if len(args) >= 1 else ()

        if isinstance(other, HTTPHeaderDict):
            for key, val in other.iteritems():
                self.add(key, val)
        elif isinstance(other, Mapping):
            for key in other:
                self.add(key, other[key])
        elif hasattr(other, "keys"):
            for key in other.keys():
                self.add(key, other[key])
        else:
            for key, value in other:
                self.add(key, value)

        for key, value in kwargs.items():
            self.add(key, value)
1293349
def _add_cat_dict(self,
                      cat_dict_class,
                      key_in_self,
                      check_for_dupes=True,
                      **kwargs):
        
        # Try to create a new instance of this subclass of `CatDict`
        new_entry = self._init_cat_dict(cat_dict_class, key_in_self, **kwargs)
        if new_entry is None:
            return False

        # Compare this new entry with all previous entries to make sure is new
        if cat_dict_class != Error:
            for item in self.get(key_in_self, []):
                if new_entry.is_duplicate_of(item):
                    item.append_sources_from(new_entry)
                    # Return the entry in case we want to use any additional
                    # tags to augment the old entry
                    return new_entry

        self.setdefault(key_in_self, []).append(new_entry)

        return True
283403
def add_item(self, item, **options):
        
        export_item = {
            "item": item.url,
        }
        export_item.update(options)
        self.items.append(export_item)
        return self
1336750
def add(self, key, val):
        
        key_lower = key.lower()
        new_vals = key, val
        # Keep the common case aka no item present as fast as possible
        vals = _dict_setdefault(self, key_lower, new_vals)
        if new_vals is not vals:
            # new_vals was not inserted, as there was a previous one
            if isinstance(vals, list):
                # If already several items got inserted, we have a list
                vals.append(val)
            else:
                # vals should be a tuple then, i.e. only one item so far
                # Need to convert the tuple to list for further extension
                _dict_setitem(self, key_lower, [vals[0], vals[1], val])
1202030
def AddSlur(self, item):
        '''
        
        '''
        if not hasattr(self, "slurs"):
            self.slurs = []
        self.slurs.append(item)
340029
def send_kwargs(self) -> dict:
        

        display_page = self.display_page
        page_num = f'\nPage {display_page + 1}/{self.page_count}'
        content = self.pages[display_page] + page_num
        return {'content': content}
401295
def add_custom_arg(self, custom_arg):
        
        if custom_arg.personalization is not None:
            try:
                personalization = \
                    self._personalizations[custom_arg.personalization]
                has_internal_personalization = True
            except IndexError:
                personalization = Personalization()
                has_internal_personalization = False
            if isinstance(custom_arg, dict):
                (k, v) = list(custom_arg.items())[0]
                personalization.add_custom_arg(CustomArg(k, v))
            else:
                personalization.add_custom_arg(custom_arg)

            if not has_internal_personalization:
                self.add_personalization(
                    personalization, index=custom_arg.personalization)
        else:
            if isinstance(custom_arg, dict):
                (k, v) = list(custom_arg.items())[0]
                self._custom_args = self._ensure_append(
                    CustomArg(k, v), self._custom_args)
            else:
                self._custom_args = self._ensure_append(
                    custom_arg, self._custom_args)
133981
def add_new_fields(data, data_to_add):
        
        for key, value in data_to_add.items():
            if not data.get(key):
                data[key] = value

        return data
811649
def parse_feed(content):
        
        feed = feedparser.parse(content)
        articles = []
        for entry in feed['entries']:
            article = {
                'title': entry['title'],
                'link': entry['link']
            }
            try:
                article['media'] = entry['media_content'][0]['url']
            except KeyError:
                article['media'] = None
            articles.append(article)
        return articles
1007567
def kwargs(self):
    
    return {k: v for k, v in self._kwargs.items() if k not in self._INTERNAL_FIELDS}
535835
def append_value(dictionary, key, item):
    """"""
    items = dictionary.get(key, [])
    items.append(item)
    dictionary[key] = items
597155
def extra_create_kwargs(self):
        
        user = self.get_agnocomplete_context()
        if user:
            _, domain = user.email.split('@')
            return {
                'domain': domain
            }
        return {}
866854
def _add_info(self, msg, **kwargs):
        

        args, extensions = self._filter_args(msg, **kwargs)
        for key, val in args.items():
            setattr(msg, key, val)

        if extensions:
            if msg.extension_elements:
                msg.extension_elements.extend(extensions)
            else:
                msg.extension_elements = extensions
1328877
def construct_item_args(self, domain_event):
        
        # Get the sequence ID.
        sequence_id = domain_event.__dict__[self.sequence_id_attr_name]

        # Get the position in the sequence.
        position = getattr(domain_event, self.position_attr_name, None)

        # Get topic and data.
        topic, state = self.get_item_topic_and_state(
            domain_event.__class__,
            domain_event.__dict__
        )

        # Get the 'other' args.
        # - these are meant to be derivative of the other attributes,
        #   to populate database fields, and shouldn't affect the hash.
        other_args = tuple((getattr(domain_event, name) for name in self.other_attr_names))

        return (sequence_id, position, topic, state) + other_args
515052
def extend(self, *args, **kwargs):
        
        self._extend(args, kwargs, 'extend', self._extend_items)