Add an anime (or update existing).

    anime is an AnimeTree instance.
346800
def add(db, anime):
    
    aid = anime.aid
    values = {
        'aid': aid,
        'title': anime.title,
        'type': anime.type,
        'episodecount': anime.episodecount,
    }
    if anime.startdate is not None:
        values['startdate'] = datets.to_ts(anime.startdate)
    if anime.enddate is not None:
        values['enddate'] = datets.to_ts(anime.enddate)
    with db:
        upsert(db, 'anime', ['aid'], values)
        our_anime = lookup(db, anime.aid, episode_fields=ALL)
        our_episodes = our_anime.episodes
        for episode in anime.episodes:
            add_episode(db, aid, episode)
            our_episodes = [
                ep for ep in our_episodes
                if not (ep.type == episode.type and ep.number == episode.number)
            ]
        # Remove extra episodes that we have.
        for episode in our_episodes:
            delete_episode(db, aid, episode)
23316
def add(self, parent, obj_type, **attributes):
        

        response = self.post(self.server_url + parent.ref + '/' + obj_type, attributes)
        return self._get_href(response.json())
121330
public void addClassContentTree(Content contentTree, Content classContentTree) {
        if (configuration.allowTag(HtmlTag.MAIN)) {
            mainTree.addContent(classContentTree);
            contentTree.addContent(mainTree);
        } else {
            contentTree.addContent(classContentTree);
        }
    }
625832
def add_series(series)
      raise ArgumentError, "Invalid argument 'series'. Expected Series, got #{series.class}." unless series.is_a?(Series)
      # Do not add it again if the series already belongs to this instance:
      @series << series unless @associated_series[series.uid]
      @image_series << series if series.is_a?(ImageSeries) && !@associated_series[series.uid]
      @associated_series[series.uid] = series
      @associated_iseries[series.uid] = series if series.is_a?(ImageSeries)
    end
362157
def add_vertex(self, vertex, **attr):
        
        self.vertices[vertex] = []
        if attr:
            self.nodes[vertex] = attr
793824
def _add(self, codeobj):
        """"""
        assert isinstance(codeobj, (CodeNamespace, CodeClass,
                                    CodeFunction, CodeVariable))
        self.children.append(codeobj)
1344970
def add(self, observation, action, reward, terminal, *args):
    """"""
    # If this will be a problem for maintenance, we could probably override
    # DQNAgent.add() method instead.
    artificial_done = self._artificial_done and terminal
    args = list(args)
    args.append(artificial_done)
    return super(_OutOfGraphReplayBuffer, self).add(observation, action, reward,
                                                    terminal, *args)
1101346
def add_class(self, c: 'Class') -> None:
        
        self.classes[c.name] = c
        c.parent = self
99099
def _add node, allows_children=true, &block
      #raise ArgumentError, "Argument should be a node" if !node.is_a? TreeNode
      $log.debug " TODO remove from existing parent to avoid bugs XXX"
      if !node.is_a? TreeNode
        n = TreeNode.new node, allows_children, &block
        node = n
      end
      node.parent = self
      @children << node
      node
    end
52774
def add(self, child):
        

        if isinstance(child, Action):
            self.add_action(child)
        else:
            raise ModelError('Unsupported child element')
131233
private void addOuToTree(CmsOrganizationalUnit ou, CmsOrganizationalUnit parent_ou) {

        Item containerItem;
        containerItem = m_treeContainer.addItem(ou);
        if (containerItem == null) {
            containerItem = getItem(ou);
        }
        containerItem.getItemProperty(PROP_NAME).setValue(getIconCaptionHTML(ou, CmsOuTreeType.OU));
        containerItem.getItemProperty(PROP_TYPE).setValue(CmsOuTreeType.OU);
        m_treeContainer.setParent(ou, parent_ou);
    }
140837
def add_to_parent(self):
        """"""
        parent = self.parent
        if parent is not None:
            try:
                children = parent.children
            except AttributeError: pass
            else:
                include(children, self)
441371
def add(self, parent, obj_type, **attributes):
        
        return self.ixnCommand('add', parent.obj_ref(), obj_type, get_args_pairs(attributes))
400786
def addItem(self, item):
        """"""
        try:
            self.tree.addItem(item)
        except AttributeError, e:
            raise VersionError('Saved versions are immutable')
917588
public void add(T style)
    {
        Integer cnt = styles.get(style);
        if (cnt == null)
            styles.put(style, 1);
        else
            styles.put(style, cnt+1);
    }
32655
def cache_files(db, aid: int, anime_files: AnimeFiles) -> None:
    """"""
    with db:
        cache_status(db, aid)
        db.cursor().execute(
            """UPDATE cache_anime
            SET anime_files=?
            WHERE aid=?""",
            (anime_files.to_json(), aid))
1167424
def add_item(self, item):
        """"""
        _idx = len(self.items)
        self.items.update({"item_" + str(_idx + 1): item})