:param geo_box_str: [-90,-180 TO 90,180]
    :return: ("-90,-180", "90,180")
355059
def parse_solr_geo_range_as_pair(geo_box_str):
    
    pattern = "\\[(.*) TO (.*)\\]"
    matcher = re.search(pattern, geo_box_str)
    if matcher:
        return matcher.group(1), matcher.group(2)
    else:
        raise Exception("Regex {0} could not parse {1}".format(pattern, geo_box_str))
339302
def matrix_str(p, decimal_places=2, print_zero=True, label_columns=False):
    ''''''
    return '[{0}]'.format("\n  ".join([(str(i) if label_columns else '') + vector_str(a, decimal_places, print_zero) for i, a in enumerate(p)]))
643469
def _str_superbox(self):
        """"""
        msg = Jp2kBox.__str__(self)
        for box in self.box:
            boxstr = str(box)
            # Indent the child boxes to make the association clear.
            msg += '\n' + self._indent(boxstr)
        return msg
884493
def geo_length(arg, use_spheroid=None):
    
    op = ops.GeoLength(arg, use_spheroid)
    return op.to_expr()
365395
def latitude(value):
    
    lat = round(float_(value), 5)
    if lat > 90.:
        raise ValueError('latitude %s > 90' % lat)
    elif lat < -90.:
        raise ValueError('latitude %s < -90' % lat)
    return lat
965005
def _offset_dt(cls, dt, offset_str):
        
        match = cls._offset_pattern.match(offset_str)
        if match is None:
            raise ValueError(
                "'%s' is not a valid offset string" % offset_str
            )
        sign, hours_str, minutes_str = match.groups()
        sign_factor = -1 if sign == '+' else 1
        hours = int(hours_str) * sign_factor
        minutes = int(minutes_str) * sign_factor
        td = timedelta(hours=hours, minutes=minutes)
        return dt + td
353365
def _coerce_point_to_string(point, output_format="%(lat)s,%(lon)s"):
        
        try:
            if not isinstance(point, Point):
                point = Point(point)
        except ValueError as e:
            if isinstance(point, string_compare):
                warnings.warn(
                    'Unable to parse the string as Point: "%s". Using the value '
                    'as-is for the query. In geopy 2.0 this will become an '
                    'exception.' % str(e), DeprecationWarning, stacklevel=3
                )
                return point
            raise
        else:
            # Altitude is silently dropped.
            return output_format % dict(lat=point.latitude,
                                        lon=point.longitude)
872862
def geocode(self, string, bounds=None, region=None,
                language=None, sensor=False):
        '''
        '''
        if isinstance(string, unicode):
            string = string.encode('utf-8')

        params = {
            'address': self.format_string % string,
            'sensor': str(sensor).lower()
        }

        
        if bounds:
            params['bounds'] = bounds
            
        if region:
            params['region'] = region
            
        if language:
            params['language'] = language
            

        if not self.premier:
            url = self.get_url(params)
        else:
            url = self.get_signed_url(params)

        return self.GetService_url(url)
685107
def _tzstr(self, sep=":"):
        """"""
        off = self.utcoffset()
        if off is not None:
            if off.days < 0:
                sign = "-"
                off = -off
            else:
                sign = "+"
            hh, mm = divmod(off, timedelta(hours=1))
            assert not mm % timedelta(minutes=1), "whole minute"
            mm //= timedelta(minutes=1)
            assert 0 <= hh < 24
            off = "%s%02d%s%02d" % (sign, hh, sep, mm)
        return off
298410
def keys_values(self):
        """"""
        keys_values = []
        for value in self.keys.values():
            if isinstance(value, list):
                keys_values += value
            elif isinstance(value, basestring) and not value.startswith('-'):
                # Avoid -99. Should be fixed in geozones
                keys_values.append(value)
            elif isinstance(value, int) and value >= 0:
                # Avoid -99. Should be fixed in geozones
                keys_values.append(str(value))
        return keys_values
181276
def within_geo_box(self, key, southwest, northeast):
        
        self._add_condition(key, '$within', {'$box': [southwest, northeast]})
        return self
1028449
function normalizePosition(value) {
	if (typeof value === 'string') {
		value = value.split(',');
	}
	if (_.isArray(value)) {
		if (value.length !== 2) {
			throw new FieldError('invalid_type', 'Must be array in form [ long, lat ]');
		}
		value[0] = numberType.normalize(value[0], { type: 'number', min: -180, max: 180 });
		value[1] = numberType.normalize(value[1], { type: 'number', min: -90, max: 90 });
	}
	validatePosition(value);
	return value;
}
6907
def to_s
      str = ''
      if @width > 0
        fmt = @width.truncate == @width ? '%d' : '%.2f'
        str << format(fmt, @width)
        str << '%' if @flag == PercentGeometry
      end

      str << 'x' if (@width > 0 && @flag != PercentGeometry) || (@height > 0)

      if @height > 0
        fmt = @height.truncate == @height ? '%d' : '%.2f'
        str << format(fmt, @height)
        str << '%' if @flag == PercentGeometry
      end
      str << format('%+d%+d', @x, @y) if @x != 0 || @y != 0
      str << FLAGS[@flag.to_i] if @flag != PercentGeometry
      str
    end
43382
def get_bbox(self):
        
        resource_list = self.get_resource()
        bounding_box = namedtuple('boundingbox', ['southlatitude',
                                                  'westlongitude',
                                                  'northlatitude',
                                                  'eastlongitude'])
        try:
            return [bounding_box(*resource['bbox'])
                    for resource in resource_list]
        except (KeyError, TypeError):
            try:
                if isinstance(resource_list, dict):
                    resource_list = [resource_list]
                return [bounding_box(resource['BoundingBox']['SouthLatitude'],
                                     resource['BoundingBox']['WestLongitude'],
                                     resource['BoundingBox']['NorthLatitude'],
                                     resource['BoundingBox']['EastLongitude'])
                        for resource in resource_list]
            except (KeyError, TypeError) as exc:
                print(exc)
877623
def geo(self):
        
        out = dict(zip(['xmin', 'xres', 'rotation_x', 'ymax', 'rotation_y', 'yres'],
                       self.raster.GetGeoTransform()))
        
        # note: yres is negative!
        out['xmax'] = out['xmin'] + out['xres'] * self.cols
        out['ymin'] = out['ymax'] + out['yres'] * self.rows
        return out
245959
def to_mapquest_str(self):
        
        vb = self.convert_srs(4326)
        return '%s,%s,%s,%s' % (vb.left, vb.top, vb.right, vb.bottom)
1150767
def convert(value):
  
  s0 = "Sbp" + value if value in COLLISIONS else value
  s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', s0)
  return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower() + "_t"