This is the environment implementation of
        :attr:`BaseKerning.find`. This must return an
        :ref:`type-int-float` or `default`.
176367
def _find(self, pair, default=None):
        
        from fontTools.ufoLib.kerning import lookupKerningValue
        font = self.font
        groups = font.groups
        return lookupKerningValue(pair, self, groups, fallback=default)
708098
def getInt(self, name, default=0, parent_search=False, multikeys_search=False):
		
		try:
			value = self.get(name, default, parent_search, multikeys_search)
			return int(value)

		except:
			# pas de configuration trouvé ou convertion impossible ?
			return default
922537
def _call_to_base_type(self, value):
    
    methods = self._find_methods('_validate', '_to_base_type')
    call = self._apply_list(methods)
    return call(value)
534555
def set_float(val):
    
    out = None
    if not val in (None, ''):
        try:
            out = float(val)
        except ValueError:
            return None
        if numpy.isnan(out):
            out = default
    return out
827034
def safe_float(string, default=None):
    
    value = default
    try:
        value = float(string)
    except TypeError:
        pass
    except ValueError:
        pass
    return value
1206809
def pop_float(self, key: str, default: Any = DEFAULT) -> float:
        
        value = self.pop(key, default)
        if value is None:
            return None
        else:
            return float(value)
702455
def to_int(value, default=0):
    
    try:
        return int(value)
    except (TypeError, ValueError):
        return to_int(default, default=0)
561138
def find(path, saltenv='base'):
    '''
    
    '''
    # Return a list of paths + text or bin
    ret = []
    if saltenv not in __opts__['pillar_roots']:
        return ret
    for root in __opts__['pillar_roots'][saltenv]:
        full = os.path.join(root, path)
        if os.path.isfile(full):
            # Add it to the dict
            with salt.utils.files.fopen(full, 'rb') as fp_:
                if salt.utils.files.is_text(fp_):
                    ret.append({full: 'txt'})
                else:
                    ret.append({full: 'bin'})
    return ret
10774
def getenv(option, default=undefined, cast=undefined):
    

    # We can't avoid __contains__ because value may be empty.
    if option in os.environ:
        value = os.environ[option]
    else:
        if isinstance(default, Undefined):
            raise UndefinedValueError('{} not found. Declare it as envvar or define a default value.'.format(option))

        value = default

    if isinstance(cast, Undefined):
        return value

    if cast is bool:
        value = _cast_boolean(value)
    elif cast is list:
        value = [x for x in value.split(',') if x]
    else:
        value = cast(value)

    return value
1354128
def file_find(self, load):
        '''
        
        '''
        path = load.get('path')
        if not path:
            return {'path': '',
                    'rel': ''}
        tgt_env = load.get('saltenv', 'base')
        return self.find_file(path, tgt_env)
952699
def _GetValue(self, name, context, default=utils.NotAValue):
    """"""
    container = self.defaults

    # The caller provided a default value.
    if default is not utils.NotAValue:
      value = default

    # Take the default from the definition.
    elif name in self.defaults:
      value = self.defaults[name]

    else:
      raise UnknownOption("Option %s not defined." % name)

    # We resolve the required key with the default raw data, and then iterate
    # over all elements in the context to see if there are overriding context
    # configurations.
    new_value = self.raw_data.get(name)
    if new_value is not None:
      value = new_value
      container = self.raw_data

    # Now check for any contexts. We enumerate all the possible resolutions and
    # sort by their path length. The last one will be the match with the deepest
    # path (i.e .the most specific match).
    matches = list(self._ResolveContext(context, name, self.raw_data))

    if matches:
      # Sort by the length of the path - longest match path will be at the end.
      matches.sort(key=lambda x: len(x[2]))
      value = matches[-1][1]
      container = matches[-1][0]

      if (len(matches) >= 2 and len(matches[-1][2]) == len(matches[-2][2]) and
          matches[-1][2] != matches[-2][2] and
          matches[-1][1] != matches[-2][1]):
        # This warning specifies that there is an ambiguous match, the config
        # attempts to find the most specific value e.g. if you have a value
        # for X.y in context A,B,C, and a value for X.y in D,B it should choose
        # the one in A,B,C. This warning is for if you have a value in context
        # A,B and one in A,C. The config doesn't know which one to pick so picks
        # one and displays this warning.
        logging.warning(
            "Ambiguous configuration for key %s: "
            "Contexts of equal length: %s (%s) and %s (%s)", name,
            matches[-1][2], matches[-1][1], matches[-2][2], matches[-2][1])

    # If there is a writeback location this overrides any previous
    # values.
    if self.writeback_data:
      new_value = self.writeback_data.get(name)
      if new_value is not None:
        value = new_value
        container = self.writeback_data

    # Allow the global override to force an option value.
    if name in self.global_override:
      return self.global_override, self.global_override[name]

    return container, value
1111634
def baseline(cls, element):
        
        if 'title' in element.attrib:
            matches = cls.baseline_pattern.search(element.attrib['title'])
            if matches:
                return float(matches.group(1)), int(matches.group(2))
        return (0, 0)
1194693
def resolve(self, _):
        
        if self.default_value == DUMMY_VALUE:
            if self.name in os.environ:
                return os.environ[self.name]
            else:
                raise VelException(f"Undefined environment variable: {self.name}")
        else:
            return os.environ.get(self.name, self.default_value)
1283788
def baseclass(self):
        """"""
        for cls in _BASE_CLASSES:
            if isinstance(self, cls):
                return cls

        raise ValueError("Cannot determine the base class of %s" % self.__class__.__name__)
698736
def _find_base_type(data_type):
    
    bases = type(data_type).__mro__
    for base in bases:
        if base in _ALL:
            return base

    return None
1314957
def float(self, item, default=None):
        
        try:
            item = self.__getattr__(item)
        except AttributeError as err:
            if default is not None:
                return default
            raise err
        return float(item)
51063
def int(name, default=None, allow_none=False, fallback=None):
    
    value = read(name, default, allow_none, fallback=fallback)
    if isinstance(value, builtins.str):
        value = value.strip()

    if value is None and allow_none:
        return None
    else:
        return builtins.int(value)