Examples:

        leg.add_role('member', term='2009', chamber='upper',
                     party='Republican', district='10th')
184137
def add_role(self, role, term, start_date=None, end_date=None,
                 **kwargs):
        
        self['roles'].append(dict(role=role, term=term,
                                  start_date=start_date,
                                  end_date=end_date, **kwargs))
456775
private void addOps(Map<Key, List<TableOperation>> operations, Table schemaTable, Row row)
    {
        Key key = ((TableImpl) schemaTable).createKey(row, false);

        TableOperation ops = tableAPI.getTableOperationFactory().createPut(row, Choice.NONE, true);

        if (operations.containsKey(key))
        {
            operations.get(key).add(ops);

        }
        else
        {
            List<TableOperation> operation = new ArrayList<TableOperation>();
            operation.add(ops);
            operations.put(key, operation);
        }
    }
92028
def append(self, item):
        
        if not is_any(item):
            raise MemberTypeError(self, item, member=len(self))
        self._data.append(item)
890171
public ServerUpdater addRolesToUser(User user, Collection<Role> roles) {
        delegate.addRolesToUser(user, roles);
        return this;
    }
422737
def filter(self, chamber, congress=CURRENT_CONGRESS, **kwargs):
        
        check_chamber(chamber)

        kwargs.update(chamber=chamber, congress=congress)

        if 'state' in kwargs and 'district' in kwargs:
            path = ("members/{chamber}/{state}/{district}/"
                    "current.json").format(**kwargs)

        elif 'state' in kwargs:
            path = ("members/{chamber}/{state}/"
                    "current.json").format(**kwargs)

        else:
            path = ("{congress}/{chamber}/"
                    "members.json").format(**kwargs)

        return self.fetch(path, parse=lambda r: r['results'])
72954
def append_column(table, col_name, default_value=None):
    '''
    
    '''
    table[0].append(col_name.strip())
    for row in table[1:]:
        row.append(default_value)
978947
def _rt_parse_members(self, statement, element, mode):
        """"""
        if mode == "delete":
            self._rt_members_delete(element, statement)
        elif mode == "insert":
            self._rt_members_add(element, statement)
1343204
protected function addRole()
    {
        if (!$this->isError()) {
            $id = $this->role->add($this->getSubmitted());
            if (empty($id)) {
                $this->errorAndExit($this->text('Unexpected result'));
            }
            $this->line($id);
        }
    }
1119290
def add_role(self, role_obj):
        
        role_node = role_obj.get_node()
        self.node.append(role_node)
723245
def add_item(self, sqla_col_type, item, key_specific=None):
        
        if key_specific is not None:
            self.setdefault(key_specific, {})[sqla_col_type] = item
        else:
            self[sqla_col_type] = item
246002
private void changeRole(PrimaryTerm term) {
    threadContext.execute(() -> {
      if (term.term() >= currentTerm) {
        log.debug("{} - Term changed: {}", memberId, term);
        currentTerm = term.term();
        leader = term.primary() != null ? term.primary().memberId() : null;
        followers = term.backups(replicationFactor - 1)
            .stream()
            .map(GroupMember::memberId)
            .collect(Collectors.toList());

        if (Objects.equals(leader, clusterMembershipService.getLocalMember().id())) {
          if (this.role == null) {
            this.role = new LeaderRole(this);
            log.debug("{} transitioning to {}", clusterMembershipService.getLocalMember().id(), Role.LEADER);
          } else if (this.role.role() != Role.LEADER) {
            this.role.close();
            this.role = new LeaderRole(this);
            log.debug("{} transitioning to {}", clusterMembershipService.getLocalMember().id(), Role.LEADER);
          }
        } else if (followers.contains(clusterMembershipService.getLocalMember().id())) {
          if (this.role == null) {
            this.role = new FollowerRole(this);
            log.debug("{} transitioning to {}", clusterMembershipService.getLocalMember().id(), Role.FOLLOWER);
          } else if (this.role.role() != Role.FOLLOWER) {
            this.role.close();
            this.role = new FollowerRole(this);
            log.debug("{} transitioning to {}", clusterMembershipService.getLocalMember().id(), Role.FOLLOWER);
          }
        } else {
          if (this.role == null) {
            this.role = new NoneRole(this);
            log.debug("{} transitioning to {}", clusterMembershipService.getLocalMember().id(), Role.NONE);
          } else if (this.role.role() != Role.NONE) {
            this.role.close();
            this.role = new NoneRole(this);
            log.debug("{} transitioning to {}", clusterMembershipService.getLocalMember().id(), Role.NONE);
          }
        }
      }
    });
  }
388205
def putkeyword(self, keyword, value, makesubrecord=False):
        """"""
        return self._table.putcolkeyword(self._column, keyword, value, makesubrecord)
641608
public void addRoleRelation(String roleFrom, String roleTo) throws PropertyException{
		validateStringValue(roleFrom);
		validateStringValue(roleTo);
		
		String relationName = String.format(ROLE_RELATION_FORMAT, getNextRelationIndex());
		props.setProperty(relationName, String.format(ROLE_RELATION_VALUE_FORMAT, roleFrom, roleTo));
		addRelationNameToList(relationName);
	}
1220901
def add_column(self, column):
        """"""
        self.columns.append(column.name)
        self.column_funcs.append(column.path)

        if column.mask is not None:
            self.mask_parts.add(column.mask)
803028
def _rt_members_add(self, element, statement):
        """"""
        members = self.vparser.parse(statement, None)
        for member in members:
            single = members[member]
            single.parent = element
            element.members[member] = single
731532
def add_role(self, role):
        
        schema = RoleSchema()
        ok = schema.process(role)
        if not ok or not role.id:
            err = 'Role must be valid and saved before adding to user'
            raise x.UserException(err)

        self.__roles.append(role)
786204
def add_membership(self, member, role=github.GithubObject.NotSet):
        
        assert isinstance(member, github.NamedUser.NamedUser), member
        assert role is github.GithubObject.NotSet or isinstance(
            role, (str, unicode)), role
        if role is not github.GithubObject.NotSet:
            assert role in ['member', 'maintainer']
            put_parameters = {
                "role": role,
            }
        else:
            put_parameters = {
                "role": "member",
            }
        headers, data = self._requester.requestJsonAndCheck(
            "PUT",
            self.url + "/memberships/" + member._identity,
            input=put_parameters
        )