application : str
        charm_url : str
        constraints : Value
        force_charm_url : bool
        force_series : bool
        min_units : int
        settings : typing.Mapping[str, str]
        settings_yaml : str
        Returns -> None
7190
async def Update(self, application, charm_url, constraints, force_charm_url, force_series, min_units, settings, settings_yaml):
        '''
        
        '''
        # map input types to rpc msg
        _params = dict()
        msg = dict(type='Application',
                   request='Update',
                   version=4,
                   params=_params)
        _params['application'] = application
        _params['charm-url'] = charm_url
        _params['constraints'] = constraints
        _params['force-charm-url'] = force_charm_url
        _params['force-series'] = force_series
        _params['min-units'] = min_units
        _params['settings'] = settings
        _params['settings-yaml'] = settings_yaml
        reply = await self.rpc(msg)
        return reply
290124
def match_url_vars_type(url_vars, type_hints):
    
    typed_url_vars = {}
    try:
        for k, v in url_vars.items():
            arg_type = type_hints.get(k)
            if arg_type and arg_type != str:
                typed_url_vars[k] = arg_type(v)
            else:
                typed_url_vars[k] = v
    except ValueError:
        return False, {}
    return True, typed_url_vars
333722
def _get(id, type):
    '''  '''
    result = query("{0}/{1}/{2}/".format(
        settings.BASE_URL,
        type,
        str(id))
    )
    return result
492173
def yunit(self):
        
        try:
            return self._dy.unit
        except AttributeError:
            try:
                return self._y0.unit
            except AttributeError:
                return self._default_yunit
117826
def config(self, charm_id, channel=None):
        '''
        '''
        url = '{}/{}/meta/charm-config'.format(self.url, _get_path(charm_id))
        data = self._get(_add_channel(url, channel))
        return data.json()
334254
def units(self):
        
        self._units, value = self.get_attr_string(self._units, 'units')
        return value
825545
def _match_minimum_decimal(self, match_key, decimal_value, match):
        """"""
        if decimal_value is None:
            raise NullArgument()
        if match is None:
            match = True
        if match:
            gtelt = '$gte'
        else:
            gtelt = '$lt'
        if match_key in self._query_terms:
            self._query_terms[match_key][gtelt] = decimal_value
        else:
            self._query_terms[match_key] = {gtelt: decimal_value}
315160
def ncVarUnit(ncVar):
    
    attributes = ncVarAttributes(ncVar)
    if not attributes:
        return '' # a premature optimization :-)

    for key in ('unit', 'units', 'Unit', 'Units', 'UNIT', 'UNITS'):
        if key in attributes:
            # In Python3 the attribures are byte strings so we must decode them
            # This a bug in h5py, see https://github.com/h5py/h5py/issues/379
            return attributes[key]
    else:
        return ''
995285
async def SetCharmProfile(self, application, charm_url):
        '''
        
        '''
        # map input types to rpc msg
        _params = dict()
        msg = dict(type='Application',
                   request='SetCharmProfile',
                   version=8,
                   params=_params)
        _params['application'] = application
        _params['charm-url'] = charm_url
        reply = await self.rpc(msg)
        return reply
437716
def _py_ctype(parameter):
    
    ctype = parameter.ctype
    if ctype is None:
        raise ValueError("Can't bind ctypes py_parameter for parameter"
                         " {}".format(parameter.definition()))
    return ctype.lower()
1092496
def gauge(self, key, gauge=None, default=float("nan"), **dims):
        """"""
        return super(RegexRegistry, self).gauge(
            self._get_key(key), gauge=gauge, default=default, **dims)
1091624
def url(self):
        # type:() -> str
        
        url = "https://api.darksky.net/forecast/{key}/{lat},{lon}".format(key=self.api_key,
                                                                          lat=self.latitude,
                                                                          lon=self.longitude)

        if isinstance(self._date, datetime):
            url += ",{:%Y-%m-%dT%H:%M:%S}".format(self._date)

        url += "?units={}".format(self.units)

        if self.lang != "auto":
            url += "&lang={}".format(self.lang)

        if len(self._exclude) > 0:
            url += "&exclude="
            for e in self._exclude:
                url += "{},".format(e)
            url = url.strip(",")

        if self._extend:
            url += "&extend=hourly"

        return url
1155992
def user_loc_value_to_instance_string(axis_tag, user_loc):
    
    codes = {}
    if axis_tag == "wght":
        codes = WEIGHT_CODES
    elif axis_tag == "wdth":
        codes = WIDTH_CODES
    else:
        raise NotImplementedError
    class_ = user_loc_value_to_class(axis_tag, user_loc)
    return min(
        sorted((code, class_) for code, class_ in codes.items() if code is not None),
        key=lambda item: abs(item[1] - class_),
    )[0]
168823
def validate_rmq_ssl_disabled_units(self, sentry_units):
        
        for sentry_unit in sentry_units:
            if self.rmq_ssl_is_enabled_on_unit(sentry_unit):
                return ('Unexpected condition:  ssl is enabled on unit '
                        '({})'.format(sentry_unit.info['unit_name']))
        return None
67973
def charm_icon_url(self, charm_id, channel=None):
        '''
        '''
        url = '{}/{}/icon.svg'.format(self.url, _get_path(charm_id))
        return _add_channel(url, channel)
171343
def is_url_for(cls, _action, _endpoint=None, _app=None, _external=None, **paramattrs):
        
        def decorator(f):
            if 'url_for_endpoints' not in cls.__dict__:
                cls.url_for_endpoints = {None: {}}  # Stick it into the class with the first endpoint
            cls.url_for_endpoints.setdefault(_app, {})

            for keyword in paramattrs:
                if isinstance(paramattrs[keyword], six.string_types) and '.' in paramattrs[keyword]:
                    paramattrs[keyword] = tuple(paramattrs[keyword].split('.'))
            cls.url_for_endpoints[_app][_action] = _endpoint or f.__name__, paramattrs, _external
            return f
        return decorator
276180
def get_config_string(params, units=None):
    
    compact_str_items = []
    # first make a list of compact strings for each parameter
    for k, v in params.items():
        unit = ""
        if isinstance(units, dict): #check if not None not enough, units could be mocked which causes errors
            unit = units.get(k, "")
        compact_str_items.append(k + "=" + str(v) + unit)
    # and finally join them
    compact_str = ", ".join(compact_str_items)
    return compact_str