Selectively updates Dataset information.

    Args:
      friendly_name: if not None, the new friendly name.
      description: if not None, the new description.

    Returns:
357081
def update(self, friendly_name=None, description=None):
    
    self._get_info()

    if self._info:
      if friendly_name:
        self._info['friendlyName'] = friendly_name
      if description:
        self._info['description'] = description
      try:
        self._api.datasets_update(self._name_parts, self._info)
      except Exception as e:
        raise e
      finally:
        self._info = None
94841
def Update(self,name):
		

		r = clc.v2.API.Call('PUT','antiAffinityPolicies/%s/%s' % (self.alias,self.id),{'name': name},session=self.session)
		self.name = name
285536
protected void addNewConferenceRecord(String accountSid, CallDetailRecord callRecord, String friendlyName){
        final ConferenceDetailRecord.Builder conferenceBuilder = ConferenceDetailRecord.builder();
        Sid sid = Sid.generate(Sid.Type.CONFERENCE);
        conferenceBuilder.setSid(sid);
        conferenceBuilder.setDateCreated(DateTime.now());

        conferenceBuilder.setAccountSid(new Sid(accountSid));
        conferenceBuilder.setStatus(ConferenceStateChanged.State.RUNNING_INITIALIZING+"");
        conferenceBuilder.setApiVersion(callRecord.getApiVersion());
        final StringBuilder UriBuffer = new StringBuilder();
        UriBuffer.append("/").append(callRecord.getApiVersion()).append("/Accounts/").append(accountSid).append("/Conferences/");
        UriBuffer.append(sid);
        final URI uri = URI.create(UriBuffer.toString());
        conferenceBuilder.setUri(uri);
        conferenceBuilder.setFriendlyName(friendlyName);
        conferenceBuilder.setMasterMsId(localMsId);

        ConferenceDetailRecord cdr = conferenceBuilder.build();
        storage.getConferenceDetailRecordsDao().addConferenceDetailRecord(cdr);
    }
801233
def update_name(self, name):
        
        short_desc_node = self.metadata.find('short_description')
        if short_desc_node is None:
            log.debug('Could not find short description node for [{}].'.format(str(self.iocid)))
            log.debug('Creating & inserting the short description node')
            short_desc_node = ioc_et.make_short_description_node(name)
            self.metadata.insert(0, short_desc_node)
        else:
            short_desc_node.text = name
        return True
248436
def _notify_change(self, model, attr, old, new, hint=None, setter=None, callback_invoker=None):
        ''' 

        '''
        # if name changes, update by-name index
        if attr == 'name':
            if old is not None:
                self._all_models_by_name.remove_value(old, model)
            if new is not None:
                self._all_models_by_name.add_value(new, model)

        if hint is None:
            serializable_new = model.lookup(attr).serializable_value(model)
        else:
            serializable_new = None

        event = ModelChangedEvent(self, model, attr, old, new, serializable_new, hint, setter, callback_invoker)
        self._trigger_on_change(event)
1063649
def update_tenant(self, tenant, name=None, description=None, enabled=True):
        
        tenant_id = utils.get_id(tenant)
        data = {"tenant": {
                "enabled": enabled,
                }}
        if name:
            data["tenant"]["name"] = name
        if description:
            data["tenant"]["description"] = description
        resp, resp_body = self.method_put("tenants/%s" % tenant_id, data=data)
        return Tenant(self, resp_body)
1350242
def updates_selection(update_selection):
    
    def handle_update(selection, *args, **kwargs):
        """Check for changes in the selection

        If the selection is changed by the decorated method, the internal core element lists are updated and a signal is
        emitted with the old and new selection as well as the name of the method that caused the change..
        """
        old_selection = selection.get_all()
        update_selection(selection, *args, **kwargs)
        new_selection = selection.get_all()

        affected_models = old_selection ^ new_selection
        if len(affected_models) != 0:  # The selection was updated
            deselected_models = old_selection - new_selection
            selected_models = new_selection - old_selection
            map(selection.relieve_model, deselected_models)
            map(selection.observe_model, selected_models)

            # Maintain internal lists for fast access
            selection.update_core_element_lists()

            # Clear focus if no longer in selection
            if selection.focus and selection.focus not in new_selection:
                del selection.focus

            # Send notifications about changes
            affected_classes = set(model.core_element.__class__ for model in affected_models)
            msg_namedtuple = SelectionChangedSignalMsg(update_selection.__name__, new_selection, old_selection,
                                                       affected_classes)
            selection.selection_changed_signal.emit(msg_namedtuple)
            if selection.parent_signal is not None:
                selection.parent_signal.emit(msg_namedtuple)
    return handle_update
262089
def set_common_datas(self, element, name, datas):
        
        element.name = str(name)
        if "description" in datas:
            element.description = str(datas["description"]).strip()

        if isinstance(element, Sampleable) and element.sample is None and "sample" in datas:
            element.sample = str(datas["sample"]).strip()

        if isinstance(element, Displayable):
            if "display" in datas:
                element.display = to_boolean(datas["display"])

            if "label" in datas:
                element.label = datas["label"]
            else:
                element.label = element.name
857333
def update(cls, resource, new_name, algorithm, ssl_enable, ssl_disable):
        
        params = {}
        if new_name:
            params['name'] = new_name
        if algorithm:
            params['lb'] = {'algorithm': algorithm}
        if ssl_enable:
            params['ssl_enable'] = ssl_enable
        if ssl_disable:
            params['ssl_enable'] = False

        result = cls.call('hosting.rproxy.update', cls.usable_id(resource),
                          params)
        cls.echo('Updating your webaccelerator')
        cls.display_progress(result)
        cls.echo('The webaccelerator have been udated')
        return result
375468
def cli(ctx, feature_id, attribute_key, old_value, new_value, organism="", sequence=""):
    
    return ctx.gi.annotations.update_attribute(feature_id, attribute_key, old_value, new_value, organism=organism, sequence=sequence)
267392
def friendly_instance_for_attribute(attr)
      klass = friendly_attributes_configuration.model_for_attribute(attr)
      send DetailsDelegator.friendly_model_reader(klass)
    end
554766
def update(self, name=None, metadata=None):
        
        return self.policy.update_webhook(self, name=name, metadata=metadata)
957089
def set_info(self, info):
        
        idx = info.get(self.name)
        if idx is not None:
            self.__dict__.update(idx)
705777
def update(self, *, name=None, position=None, visibility=None):
        

        if name is None and position is None and visibility is None:
            raise ValueError('Provide at least one parameter to update')
        data = {}
        if name:
            data['name'] = name
        if position:
            data['position'] = position
        if visibility:
            data['visibility'] = visibility

        response = self.session.patch(self.build_url(''), data=data)
        if not response:
            return False

        data = response.json()
        self.name = data.get('name', self.name)
        self.position = data.get('position', self.position)
        self.visibility = data.get('visibility', self.visibility)

        return True
427040
def UpdateKnowledgeBase(self, response, provides):
    """"""

    if isinstance(response, rdf_anomaly.Anomaly):
      return

    if isinstance(response, rdf_client.User):
      self.knowledge_base.MergeOrAddUser(response)
      return

    if isinstance(response, rdf_protodict.Dict):
      response_dict = response.ToDict()
      for attribute, value in iteritems(response_dict):
        if attribute in provides:
          self.SetKnowledgeBaseValue(attribute, value)
      return

    # If its not a dict we only support a single value.
    if len(provides) == 1:
      self.SetKnowledgeBaseValue(provides[0], response)
267647
def _update_pretty_hostname(new_val: str):
    
    try:
        with open('/etc/machine-info') as emi:
            contents = emi.read()
    except OSError:
        LOG.exception("Couldn't read /etc/machine-info")
        contents = ''
    new_contents = ''
    for line in contents.split('\n'):
        if not line.startswith('PRETTY_HOSTNAME'):
            new_contents += f'{line}\n'
    new_contents += f'PRETTY_HOSTNAME={new_val}\n'
    with open('/etc/machine-info', 'w') as emi:
        emi.write(new_contents)
1270242
def available_dataset_names(self, reader_name=None, composites=False):
        """"""
        return sorted(set(x.name for x in self.available_dataset_ids(
            reader_name=reader_name, composites=composites)))