Do the right thing on "point" input. For geocoders with reverse
        methods.
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)
654518
function _offsetPos(pos, offset) {
        return {line: pos.line, ch: pos.ch + offset};
    }
413196
def check_geo(geo):
    
    geo = copy.copy(geo)

    def fix_item(item):
        if isinstance(item, six.binary_type):
            return item.decode()
        return item

    def fix_list(lst):
        return [fix_item(i) for i in lst]
    if isinstance(geo.reduce, six.binary_type):
        geo.reduce = geo.reduce.decode()
    for key in geo.kwargs.keys():
        if geo.kwargs[key] is not None:
            if isinstance(geo.kwargs[key], (list, np.ndarray)):
                geo.kwargs[key] = fix_list(geo.kwargs[key])
            elif isinstance(geo.kwargs[key], six.binary_type):
                geo.kwargs[key] = fix_item(geo.kwargs[key])
    return geo
1158202
public function reverse() : void
    {
        $newBits = new SplFixedArray(count($this->bits));

        for ($i = 0; $i < $this->size; ++$i) {
            if ($this->get($this->size - $i - 1)) {
                $newBits[$i >> 5] = $newBits[$i >> 5] | (1 << ($i & 0x1f));
            }
        }

        $this->bits = $newBits;
    }
694081
function() {
        AV.GeoPoint._validate(this.latitude, this.longitude);
        return {
          __type: 'GeoPoint',
          latitude: this.latitude,
          longitude: this.longitude,
        };
      }
475803
function ( loc, cbk, opts ) {

    if ( ! loc ) {
        return cbk( new Error( "Geocoder.geocode requires a location.") );
    }

    return this.providerObj.geocode(this.providerOpts, loc, cbk, opts);

  }
969969
function(reverse) {
        var focusModel = this.focusModel;
        var address = reverse ? focusModel.prevAddress() : focusModel.nextAddress();

        focusModel.focusIn(address.rowKey, address.columnName, true);
    }
281430
def batch_geocode(self, addresses, **kwargs):
        
        fields = ",".join(kwargs.pop("fields", []))
        response = self._req(
            "post",
            verb="geocode",
            params={"fields": fields},
            data=json.dumps(addresses),
        )
        if response.status_code != 200:
            return error_response(response)

        return LocationCollection(response.json()["results"])
542418
def reverseCommit(self):
        

        if self.markerPos is None:
            return

        # Remove the specified string from the same position in every line
        # in between the mark and the cursor (inclusive).
        col = min((self.markerPos[1], self.cursorPos[1]))
        rng = range(self.markerPos[0], self.cursorPos[0] + 1)
        for idx, line in enumerate(rng):
            text = self.removedText[idx]
            if text != '':
                self.baseClass.insertAt(text, line, col)

        self.qteWidget.setCursorPosition(*self.cursorPos)
1049679
def handle_input(self, input_str, place=True, check=False):
        ''''''
        user = self.get_player()
        pos = self.validate_input(input_str)
        if pos[0] == 'u':
            self.undo(pos[1])
            return pos
        if place:
            result = self.set_pos(pos, check)
            return result
        else:
            return pos
659172
def seek(self, offset, whence=0):
        '''
        
        '''
        if whence == 0:
            self._pos = self._start_pos + offset
        elif whence == 1:
            self._pos += offset
        else:
            self._pos = (self._end_pos - 1) + offset
162050
def extract_coordinates(point)
      case point
      when Array
        if point.size == 2
          lat, lon = point
          if !lat.nil? && lat.respond_to?(:to_f) and
            !lon.nil? && lon.respond_to?(:to_f)
          then
            return [ lat.to_f, lon.to_f ]
          end
        end
      when String
        point = Geocoder.coordinates(point) and return point
      else
        if point.respond_to?(:to_coordinates)
          if Array === array = point.to_coordinates
            return extract_coordinates(array)
          end
        end
      end
      [ NAN, NAN ]
    end
1191447
def _point_in_bbox(point, bounds):
    
    return not(point['coordinates'][1] < bounds[0] or point['coordinates'][1] > bounds[2]
               or point['coordinates'][0] < bounds[1] or point['coordinates'][0] > bounds[3])
184234
public static void reverse(final Object[] arr, final int pos, final int len) {
        for (int l = pos, r = pos + len - 1; l < r; l++, r--) {
            final Object tmp = arr[l];
            arr[l] = arr[r];
            arr[r] = tmp;
        }
    }
1055336
function validatePosition(value) {
	if (
		!_.isArray(value) ||
		value.length !== 2 ||
		typeof value[0] !== 'number' ||
		typeof value[1] !== 'number'
	) {
		throw new FieldError('invalid_type', 'Must be array in form [ long, lat ]');
	}
	if (value[0] < -180 || value[0] > 180) {
		throw new FieldError('invalid_format', 'Longitude must be between -180 and 180');
	}
	if (value[1] < -90 || value[1] > 90) {
		throw new FieldError('invalid_format', 'Latitude must be between -90 and 90');
	}
}
1121857
def backwards(self, orm):
        ""
        for instance in orm.LocationSource.objects.all():
            for point in instance.points.all():
                point.user = instance.user
                point.save()
1129680
def geocode(self, commit=False, force=False):
        
        if self.need_geocoding() or force:
            result = get_cached(getattr(self, self.geocoded_by), provider='google')
            if result.status == 'OK':
                for attribute, components in self.required_address_components.items():
                    for component in components:
                        if not getattr(self, attribute) or force:
                            attr_val = getattr(result, component, None)
                            if attr_val:
                                setattr(self, attribute, attr_val)

            if commit:
                self.save()