Tuple of Decimals in the form of (lat, lon) or None
322144
def coordinates(self):
    '''
    
    '''
    if not getattr(self, '_coordinates', False):
      query_params = {
        'prop': 'coordinates',
        'colimit': 'max',
        'titles': self.title,
      }

      request = _wiki_request(query_params)

      if 'query' in request:
        coordinates = request['query']['pages'][self.pageid]['coordinates']
        self._coordinates = (Decimal(coordinates[0]['lat']), Decimal(coordinates[0]['lon']))
      else:
        self._coordinates = None

    return self._coordinates
937909
def coerce(self, value):
        

        return {
            'lat': float(value.get('lat', value.get('latitude'))),
            'lon': float(value.get('lon', value.get('longitude')))
        }
1022516
function(sexagesimal) {

			if (sexagesimal in geolib.decimal) {
				return geolib.decimal[sexagesimal];
			}

			var	regEx = new RegExp(sexagesimalPattern);
			var	data = regEx.exec(sexagesimal);

			if(data) {
				var min = parseFloat(data[2]/60);
				var sec = parseFloat(data[4]/3600) || 0;
			}

			var	dec = ((parseFloat(data[1]) + min + sec)).toFixed(8);
				// South and West are negative decimals
				dec = (data[7] == 'S' || data[7] == 'W') ? dec * -1 : dec;

			geolib.decimal[sexagesimal] = dec;

			return dec;

		}
903481
def latitude(self, latitude):
        """"""
        if not (-90 <= latitude <= 90):
            raise ValueError('latitude was {}, but has to be in [-90, 90]'
                             .format(latitude))
        self._latitude = latitude
1262983
def numberp(v):
    """"""
    return (not(isinstance(v, bool)) and
            (isinstance(v, int) or isinstance(v, float)))
116463
def space_events(lon=None, lat=None, limit=None, date=None):
    '''
    
    
    '''

    base_url = 'http://api.predictthesky.org/?'

    if not lon or not lat:
        raise ValueError(
            "space_events endpoint expects lat and lon, type has to be float. Call the method with keyword args. Ex : lon=100.75, lat=1.5")
    else:
        try:
            validate_float(lon, lat)
            # Floats are entered/displayed as decimal numbers, but your computer 
            # (in fact, your standard C library) stores them as binary. 
            # You get some side effects from this transition:
            # >>> print len(repr(0.1))
            # 19
            # >>> print repr(0.1)
            # 0.10000000000000001
            # Thus using decimal to str transition is more reliant
            lon = decimal.Decimal(lon)
            lat = decimal.Decimal(lat)
            base_url += "lon=" + str(lon) + "&" + "lat=" + str(lat)
        except:
            raise ValueError(
                "space_events endpoint expects lat and lon, type has to be float. Call the method with keyword args. Ex : lon=100.75, lat=1.5")

    if date:
        try:
            validate_iso8601(date)
            base_url += "&" + 'date=' + date
        except:
            raise ValueError(
                "Your date input is not in iso8601 format. ex: 2014-01-01T23:59:59")

    if limit:
        if not isinstance(limit, int):
            logger.error(
                "The limit arg you provided is not the type of int, ignoring it")
        base_url += "&" + "limit=" + str(limit)

    return dispatch_http_get(base_url)
406564
function (str) {
            
            var typeOf = typeof str;
            if (typeOf === 'number')
                return str;
            
            else if (typeOf !== 'string')
                return Number.NaN;
            
            else if (_floatRegex.test(str))
                return parseFloat(str);
                
            else if (   str === 'Infinity'
                     || str === '+Infinity' )
                return Number.POSITIVE_INFINITY;
            
            else if (str === '-Infinity')
                return Number.NEGATIVE_INFINITY;
            
            else  // whether "NaN" or any other string
                return Number.NaN;
        }
1198173
function(value) {

			value = value.toString().replace(/\s*/, '');

			// looks silly but works as expected
			// checks if value is in decimal format
			if (!isNaN(parseFloat(value)) && parseFloat(value).toString() == value) {    
				return parseFloat(value);
			// checks if it's sexagesimal format (HHH° MM' SS" (NESW))
			} else if(geolib.isSexagesimal(value) == true) {
				return parseFloat(geolib.sexagesimal2decimal(value));
			} else {
				throw 'Unknown format.';
			}

		}
532427
def _lat_lons_from_geojson(s):
    
    if len(s) >= 2 and isinstance(s[0], _number) and isinstance(s[0], _number):
        lat, lon = s[1], s[0]
        return [(lat, lon)]
    else:
        return [lat_lon for sub in s for lat_lon in _lat_lons_from_geojson(sub)]
1230605
def get_utm_crs(lat: float, lon: float) -> Dict:
    
    zone = utm.from_latlon(lat, lon)[2]
    south = lat < 0
    return {
        "proj": "utm",
        "zone": zone,
        "south": south,
        "ellps": "WGS84",
        "datum": "WGS84",
        "units": "m",
        "no_defs": True,
    }
108732
def encode(lonlat, length=12):
  """"""
  assert len(lonlat) == 2, "Invalid lon/lat: %s"%lonlat
  # Half the length for each component.
  length /= 2
  lon = _float_to_bits(lonlat[0], lower=-180.0, upper=180.0, length=length*5)
  lat = _float_to_bits(lonlat[1], lower=-90.0, upper=90.0, length=length*5)
  # Zip the GeoHash bits.
  ret = []
  for a,b in zip(lon,lat):
    ret.append(a)
    ret.append(b)
  return _bits_to_geohash(ret)
426687
def parsedate(data):
    """"""
    t = parsedate_tz(data)
    if isinstance(t, tuple):
        return t[:9]
    else:
        return t
1285808
def format_decimal(decimal):
    
    # strip trailing fractional zeros
    normalized = decimal.normalize()
    sign, digits, exponent = normalized.as_tuple()
    if exponent >= 1:
        normalized = normalized.quantize(1)

    return str(normalized)
1130876
def to_decimal(number, points=None):
    
    if not is_number(number):
        return number

    number = float(decimal.Decimal(number * 1.))  # can't Decimal an int
    if is_number(points):
        return round(number, points)
    return number
1033904
def interpolate_nearest(self, lons, lats, data):
        
        return self.interpolate(lons, lats, data, order=0)
184986
def _lons(self):
        """"""
        lons = _np.linspace(0.0, 360.0 - 360.0 / self.nlon, num=self.nlon)
        return lons
131676
private static void decimal(CLDR.Locale locale, String[] numbers, DecimalFormatOptions opts) {
    for (String num : numbers) {
      BigDecimal n = new BigDecimal(num);
      StringBuilder buf = new StringBuilder("  ");
      NumberFormatter fmt = CLDR.get().getNumberFormatter(locale);
      fmt.formatDecimal(n, buf, opts);
      System.out.println(buf.toString());
    }
  }