Get float number.

        :param key: Key (`lt` or `lg`).
        :param dms: DMS format.
        :return: Float number
775999
def _get_fs(self, key: str, dms: bool = False) -> Union[str, float]:
        
        # Default range is a range of longitude.
        rng = (-90, 90) if key == 'lt' else (-180, 180)
        result = self.random.uniform(*rng, precision=6)

        if dms:
            return self._dd_to_dms(result, key)

        return result
724199
def get_lipd_version(L):
    
    version = 1.0
    _keys = ["LipdVersion", "LiPDVersion", "lipdVersion", "liPDVersion"]
    for _key in _keys:
        if _key in L:
            version = L[_key]
            # Cast the version number to a float
            try:
                version = float(version)
            except AttributeError:
                # If the casting failed, then something is wrong with the key so assume version is 1.0
                version = 1.0
            L.pop(_key)
    return L, version
1152188
def dms2dd(d,m,s):
    
    if d < 0:
        sign = -1
    else:
        sign = 1
    dd = sign * (int(abs(d)) + float(m) / 60 + float(s) / 3600)
    return dd
530118
public Float getAsFloat(String key) {
        Object value = mValues.get(key);
        try {
            return value != null ? ((Number) value).floatValue() : null;
        } catch (ClassCastException e) {
            if (value instanceof CharSequence) {
                try {
                    return Float.valueOf(value.toString());
                } catch (NumberFormatException e2) {
                    logger.severe( "Cannot parse Float value for " + value + " at key " + key);
                    return null;
                }
            } else {
                logger.log(Level.SEVERE, "Cannot cast value for " + key + " to a Float: " + value, e);
                return null;
            }
        }
    }
425987
def read_val(self, key:str) -> Union[List[float],Tuple[List[float],List[float]]]:
        ""
        val = [pg[key] for pg in self.opt.param_groups[::2]]
        if is_tuple(val[0]): val = [o[0] for o in val], [o[1] for o in val]
        return val
52608
def get_float(self, key, default=None):
        
        value = self.get(key, default)
        return None if value is None else float(value)
1069706
def __get_float(section, name):
    """"""
    try:
        return float(section[name])
    except (ValueError, TypeError, KeyError):
        return float(0)
1119041
public Double getAsDouble(String key) {
        Object value = mValues.get(key);
        try {
            return value != null ? ((Number) value).doubleValue() : null;
        } catch (ClassCastException e) {
            if (value instanceof CharSequence) {
                try {
                    return Double.valueOf(value.toString());
                } catch (NumberFormatException e2) {
                    DLog.e(TAG, "Cannot parse Double value for " + value + " at key " + key);
                    return null;
                }
            } else {
                DLog.e(TAG, "Cannot cast value for " + key + " to a Double: " + value, e);
                return null;
            }
        }
    }
1334762
def get_float_info(self, field):
        
        length = ctypes.c_ulong()
        ret = ctypes.POINTER(ctypes.c_float)()
        _check_call(_LIB.XGDMatrixGetFloatInfo(self.handle,
                                               c_str(field),
                                               ctypes.byref(length),
                                               ctypes.byref(ret)))
        return ctypes2numpy(ret, length.value, np.float32)
102392
public double getDouble(String key, double def) {
        Object tmp = objectMap.get(key);
        return tmp != null && tmp instanceof Number ? ((Number) tmp)
                .doubleValue() : def;
    }
1322896
public float[] getFloatArray(final String key, final float[] def) {
		try {
			final float[] result = getFloatArray(key);
			return result != null ? result : def;
		} catch (final NumberFormatException nfe) {
			return def;
		}
	}
1022992
def incr_float(self, key, incr_by=1.):
        """"""
        return self.database.hincrbyfloat(self.key, key, incr_by)
765521
def get_as_nullable_float(self, key):
        
        value = self.get(key)
        return FloatConverter.to_nullable_float(value)
1133697
def dd2dm(dd):
    
    d,m,s = dd2dms(dd)
    m = m + float(s)/3600
    return d,m,s
1311310
def read_lsm_floatpairs(fh):
    """"""
    size = struct.unpack('<i', fh.read(4))[0]
    return fh.read_array('<2f8', count=size)
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)
214783
def _dd_to_dms(num: float, _type: str) -> str:
        
        degrees = int(num)
        minutes = int((num - degrees) * 60)
        seconds = (num - degrees - minutes / 60) * 3600.00
        seconds = round(seconds, 3)
        result = [abs(i) for i in (degrees, minutes, seconds)]

        direction = ''
        if _type == 'lg':
            direction = 'W' if degrees < 0 else 'E'
        elif _type == 'lt':
            direction = 'S' if degrees < 0 else 'N'

        return ('{}º{}\'{:.3f}"' + direction).format(*result)