Rename contact group

        :param group: group data or name of group
        :param newname: of group
        :type group: ``str``, ``unicode``, ``dict``
        :type newname: ``str``, ``unicode``
        :rtype: ``bool``
511272
def rename_group(self, group, newname):
        

        if isinstance(group, basestring):
            group = self.get_contact(group)

        method, url = get_URL('group_update')

        payload = {
            'apikey': self.config.get('apikey'),
            'logintoken': self.session.cookies.get('logintoken'),
            'contactgroupid': group['contactgroupid'],
            'name': newname
            }

        res = getattr(self.session, method)(url, params=payload)

        if res.status_code == 200:
            return True

        hellraiser(res)
955534
def merge_into_group(self, group):
        
        super(VerboseMixin, self).merge_into_group(group)
        group.verbose_name = self.verbose_name
        group.help_text = self.help_text
264916
def rename(self, new_name):
        """"""
        # Write the new object.
        self.bucket.set(new_name, self.get(), self.meta)

        # Delete the current key.
        self.delete()

        # Set the new name.
        self.name = new_name
203138
def _make_name(current, new):
    '''
    
    '''

    current_tokens = current.split()
    new_tokens = new.split()

    new = ' '.join(
        new_token for new_token in new_tokens
        if new_token not in current_tokens
    )

    return '/'.join((current, new))
345724
def create_group(self, name):
        
        url = 'rest/api/2/group'
        data = {'name': name}

        return self.post(url, data=data)
371524
def get_group(self, name):
        

        groups = self.get_groups()
        for group in groups:
            if group['contactgroupname'] == name:
                return group

        msg = 'No group named: "{name}" found.'
        raise FMBaseError(msg.format(name=name))
1097199
def get_group_names(self):
        
        if self._group_names is None:
            self._load_cached_attr("_group_names")

        if self._group_names is None:
            group_infos = self._get_group_infos()
            self._group_names = {
                self._group_type.group_name_from_info(group_info)
                for group_info in group_infos
            }
            self._cache_attr("_group_names")

        return self._group_names
959895
public void rename(String newName) {
        URL url = FILE_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID());
        BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), url, "PUT");

        JsonObject updateInfo = new JsonObject();
        updateInfo.add("name", newName);

        request.setBody(updateInfo.toString());
        BoxAPIResponse response = request.send();
        response.disconnect();
    }
819234
def set_name(self, new_name):
        

        yield from self._hypervisor.send('nio_bridge rename "{name}" "{new_name}"'.format(name=self._name,
                                                                                          new_name=new_name))

        self._name = new_name
780937
def rename_header(self, old_name, new_name):
        
        self.hkeys[self.hkeys.index(old_name)] = new_name
        self.headers[new_name] = self.headers.pop(old_name)
        return self
148260
def save_group(self, group):
        
        # If group already exists, take over existing group rather then error.
        try:
            lgroup = self._get_group(group.name)
            changes = changeset(lgroup, {})
        except ObjectDoesNotExist:
            lgroup = self._group_class()
            changes = changeset(lgroup, {
                'cn': group.name,
            })

        changes = changes.merge({
            'description': group.description
        })
        save(changes, database=self._database)
495800
def rename(self, dn: str, new_rdn: str, new_base_dn: Optional[str] = None) -> None:
        

        return self._do_with_retry(
            lambda obj: obj.rename_s(dn, new_rdn, new_base_dn))
794874
def rename_key(d: Dict[str, Any], old: str, new: str) -> None:
    
    d[new] = d.pop(old)
254878
def set_monitoring_transaction_name(name, group=None, priority=None):
    
    if not newrelic:
        return
    newrelic.agent.set_transaction_name(name, group, priority)
240411
def new_name(self, template=u"xxx_todo_changeme"):
        
        name = template
        while name in self.used_names:
            name = template + unicode(self.numbers.next())
        self.used_names.add(name)
        return name
949905
def renames(self, new):
        
        os.renames(self, new)
        return self._next_class(new)
831678
def cli(ctx, group_id, new_name):
    
    return ctx.gi.groups.update_group(group_id, new_name)