Parse FEATURELIST and update the Host object.
961708
def _parse_featurelist(client, command, actor, args):
    """"""
    # Strip off ":are supported by this server"
    args = args.rsplit(":", 1)[0]
    # Strip off the nick; we know it's addressed to us.
    _, _, args = args.partition(' ')

    items = args.split()
    for item in items:
        feature, _, value = item.partition("=")

        # Convert integer values to actual integers for convenience
        try:
            value = int(value)
        except (ValueError, TypeError):
            pass

        client.server.features[feature] = value
230421
async def update(self) -> None:
        
        url = '{}{}'.format(self.url, ENDPOINT)

        try:
            async with self._session.get(url) as response:
                json_dict = demjson.decode(await response.text(), strict=False)
        except aiohttp.ClientError:
            json_dict = {'status': {'status1': SyncThru.OFFLINE}}
        except demjson.JSONDecodeError:
            raise ValueError("Invalid host, does not support SyncThru.")
        self.data = json_dict
1178582
def parse_ssh_config(lines):
    '''
    
    '''
    # transform the list of individual lines into a list of sublists where each
    # sublist represents a single Host definition
    hosts = []
    for line in lines:
        line = salt.utils.stringutils.to_unicode(line)
        if not line or line.startswith('#'):
            continue
        elif line.startswith('Host '):
            hosts.append([])
        hosts[-1].append(line)

    # construct a dictionary of Host names to mapped roster properties
    targets = collections.OrderedDict()
    for host_data in hosts:
        target = collections.OrderedDict()
        hostnames = host_data[0].split()[1:]
        for line in host_data[1:]:
            for field in _ROSTER_FIELDS:
                match = re.match(field.pattern, line)
                if match:
                    target[field.target_field] = match.group(1)
        for hostname in hostnames:
            targets[hostname] = target

    # apply matching for glob hosts
    wildcard_targets = []
    non_wildcard_targets = []
    for target in targets.keys():
        if '*' in target or '?' in target:
            wildcard_targets.append(target)
        else:
            non_wildcard_targets.append(target)
    for pattern in wildcard_targets:
        for candidate in non_wildcard_targets:
            if fnmatch.fnmatch(candidate, pattern):
                targets[candidate].update(targets[pattern])
        del targets[pattern]

    # finally, update the 'host' to refer to its declaration in the SSH config
    # so that its connection parameters can be utilized
    for target in targets:
        targets[target]['host'] = target
    return targets
275925
def update(self, data):
        """"""
        self.name = data["name"]
        self.description = data['description']
        self.win_index = data['win_index']
        # Other attributes are optional
        if conf.use_winpcapy:
            self._update_pcapdata()
        try:
            self.ip = socket.inet_ntoa(get_if_raw_addr(data['guid']))
        except (KeyError, AttributeError, NameError):
            pass
        try:
            self.mac = data['mac']
        except KeyError:
            pass
834550
def _parse_names_set(feature_names):
        """"""
        feature_collection = OrderedDict()
        for feature_name in feature_names:
            if isinstance(feature_name, str):
                feature_collection[feature_name] = ...
            else:
                raise ValueError('Failed to parse {}, expected string'.format(feature_name))
        return feature_collection
1135299
def getHostsFromList(hostlist):
    """"""
    # check to see if it is a SLURM grouping instead of a
    # regular list of hosts
    if any(re.search('[\[\]]', x) for x in hostlist):
        return parseSLURM(str(hostlist))

    # Counter would be more efficient but:
    # 1. Won't be Python 2.6 compatible
    # 2. Won't be ordered
    hostlist = groupTogether(hostlist)
    retVal = []
    for key, group in groupby(hostlist):
        retVal.append((key, len(list(group))))
    return retVal
1138710
def load(self, arguments):
        ""
        features = arguments[1:-1]
        list(map(self.load_feature, features))
762485
def update_host(self, url: URL) -> None:
        """"""
        # get host/port
        if not url.host:
            raise InvalidURL(url)

        # basic auth info
        username, password = url.user, url.password
        if username:
            self.auth = helpers.BasicAuth(username, password or '')
984253
def clean(self, value):
        """"""

        if isinstance(value, (list, tuple)):
            return [super(FeatureCollectionParameter, self).clean(x) for x in value]

        raise ParameterNotValidError
912450
async def updateconfig(self):
        ""
        exists = {}
        for s in self.connections:
            exists[(s.protocol.vhost, s.rawurl)] = s
        self._createServers(self, '', exists = exists)
        for _,v in exists.items():
            await v.shutdown()
            self.connections.remove(v)
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
1285957
def adapt_feature!(parsed_feature, gathered_comments)
      # Saving off the original data
      parsed_feature['cuke_modeler_parsing_data'] = Marshal::load(Marshal.dump(parsed_feature))

      # Removing parsed data for child elements in order to avoid duplicating data
      parsed_feature['cuke_modeler_parsing_data']['tags'] = nil
      parsed_feature['cuke_modeler_parsing_data']['elements'] = nil

      if parsed_feature['comments']
        parsed_feature['cuke_modeler_parsing_data']['comments'] = nil
        gathered_comments.concat(parsed_feature['comments'])
      end

      adapt_child_elements!(parsed_feature, gathered_comments)

      if parsed_feature['tags']
        parsed_feature['tags'].each do |tag|
          adapt_tag!(tag)
        end
      end
    end
747520
public void updateStoryInformation() throws HygieiaException {
		String returnDate = this.featureSettings.getDeltaStartDate();
		if (!StringUtils.isEmpty(getMaxChangeDate())) {
			returnDate = getMaxChangeDate();
		}
		returnDate = DateUtil.getChangeDateMinutePrior(returnDate,
				this.featureSettings.getScheduledPriorMin());
		String queryName = this.featureSettings.getStoryQuery();
		updateObjectInformation(getQuery(returnDate, queryName));
	}
1079785
def update(sc, filename, asset_id):
    '''
    
    '''
    addresses = []
    with open(filename) as hostfile:
        for line in hostfile.readlines():
            addresses.append(line.strip('\n'))
    sc.asset_update(asset_id, dns=addresses)
321093
public void loadRTreeIndex(FeatureTable featureTable) {
		loadRTreeIndex(featureTable.getTableName(), featureTable
				.getGeometryColumn().getName(), featureTable.getPkColumn()
				.getName());
	}
236750
def _parse_features(features, new_names=False, rename_function=None, default_feature_type=None,
                        allowed_feature_types=None):
        
        return FeatureParser(features, new_names=new_names, rename_function=rename_function,
                             default_feature_type=default_feature_type, allowed_feature_types=allowed_feature_types)
1345671
def update_host_mapping(host_id, interface, nexus_ip, new_ch_grp):
    """"""

    LOG.debug("update_host_mapping called")
    session = bc.get_writer_session()
    mapping = _lookup_one_host_mapping(
                  session=session,
                  host_id=host_id,
                  if_id=interface,
                  switch_ip=nexus_ip)
    mapping.ch_grp = new_ch_grp
    session.merge(mapping)
    session.flush()
    return mapping