Map natural position to machine code postion
694
def map_position(pos):
    """"""

    posiction_dict = dict(zip(range(1, 17), [i for i in range(30, 62) if i % 2]))
    return posiction_dict[pos]
654518
function _offsetPos(pos, offset) {
        return {line: pos.line, ch: pos.ch + offset};
    }
1373467
def push_location(
            self,
            element_path,  # type: Text
            array_index=None  # type: Optional[int]
    ):
        # type: (...) -> None
        """"""
        location = ProcessorLocation(element_path=element_path, array_index=array_index)
        self._locations.append(location)
824914
def loop_position(self):
        """"""
        for i, v in enumerate(self._sort_loop):
            if v == glances_processes.sort_key:
                return i
        return 0
1324676
def setposition(self, position):
        
        try:
            if isinstance(position, list):
                self.send('position startpos moves {}'.format(
                    self.__listtostring(position)))
                self.isready()
            elif re.match('\s*^(((?:[rnbqkpRNBQKP1-8]+\/){7})[rnbqkpRNBQKP1-8]+)\s([b|w])\s([K|Q|k|q|-]{1,4})\s(-|[a-h][1-8])\s(\d+\s\d+)$', position):
                regexList = re.match('\s*^(((?:[rnbqkpRNBQKP1-8]+\/){7})[rnbqkpRNBQKP1-8]+)\s([b|w])\s([K|Q|k|q|-]{1,4})\s(-|[a-h][1-8])\s(\d+\s\d+)$', position).groups()
                fen = regexList[0].split("/")
                if len(fen) != 8:
                    raise ValueError("expected 8 rows in position part of fen: {0}".format(repr(fen)))

                for fenPart in fen:
                    field_sum = 0
                    previous_was_digit, previous_was_piece = False, False

                    for c in fenPart:
                        if c in ["1", "2", "3", "4", "5", "6", "7", "8"]:
                            if previous_was_digit:
                                raise ValueError("two subsequent digits in position part of fen: {0}".format(repr(fen)))
                            field_sum += int(c)
                            previous_was_digit = True
                            previous_was_piece = False
                        elif c == "~":
                            if not previous_was_piece:
                                raise ValueError("~ not after piece in position part of fen: {0}".format(repr(fen)))
                            previous_was_digit, previous_was_piece = False, False
                        elif c.lower() in ["p", "n", "b", "r", "q", "k"]:
                            field_sum += 1
                            previous_was_digit = False
                            previous_was_piece = True
                        else:
                            raise ValueError("invalid character in position part of fen: {0}".format(repr(fen)))

                    if field_sum != 8:
                        raise ValueError("expected 8 columns per row in position part of fen: {0}".format(repr(fen)))  
                self.send('position fen {}'.format(position))
                self.isready()
            else: raise ValueError("fen doesn`t match follow this example: rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1 ")  

        except ValueError as e:
            print('\nCheck position correctness\n')
            sys.exit(e.message)
1219439
def store_pos(mdTopLt, mdBotRt, x1, y1, x2, y2)  # :nodoc:
    record  = 0x104F     # Record identifier.
    length  = 0x0014     # Number of bytes to follow.
    # mdTopLt            # Top left.
    # mdBotRt            # Bottom right.
    # x1                 # X coordinate.
    # y1                 # Y coordinate.
    # x2                 # Width.
    # y2                 # Height.

    header = [record, length].pack('vv')
    data  = [mdTopLt].pack('v')
    data += [mdBotRt].pack('v')
    data += [x1].pack('V')
    data += [y1].pack('V')
    data += [x2].pack('V')
    data += [y2].pack('V')

    append(header, data)
  end
761585
def _invert(self, pos):
        """"""
        assert 0 <= pos < self.len
        self._datastore.invertbit(pos)
1153558
function (position) {
    var lat = position.coords.latitude;
    var lng = position.coords.longitude;
    geo_codeLatLng(lat, lng);
}
1097447
function nextNeighbor(elt, dir) {
    var drow = 0, dcol = 0;
    if (dir == "none") {
      return null;
    } else {
      var offset = directions[dir];
      return {r: elt.r + offset[0], c: elt.c + offset[1]};
    }
  }
437973
def near_to_position(self, position, max_distance):
        ''''''
        end = self.ref_end_pos()
        return self.POS <= position <= end or abs(position - self.POS) <= max_distance or abs(position - end) <= max_distance
571107
def set_position(self, key, latlon, layer=None, rotation=0):
        ''''''
        self.object_queue.put(SlipPosition(key, latlon, layer, rotation))
285908
def pos(self, p_x=None, y=None, z=None):
        """"""
        if p_x is None:
            return np.array(self.GetPosition())
        if z is None:  # assume p_x is of the form (x,y,z)
            self.SetPosition(p_x)
        else:
            self.SetPosition(p_x, y, z)
        if self.trail:
            self.updateTrail()
        return self
582252
def __map_axis(self, axis):
        """"""
        start_code, start_value = axis
        value = start_value
        code = self.manager.codes['xpad'][start_code]
        return code, value
687773
function ( ) {
			if ( ! options.exist ) {
				// http request to Nominatim to performs the Geocoding of the pin.
				// To avoid to much call to Nominatim with the same position,
				// the call is only performed when it's a new pin
				var NominatimUrl = 
					'http://nominatim.openstreetmap.org/reverse?format=json&lat=' +
					latlng.lat +
					'&lon=' +
					latlng.lng +
					'&zoom=' +
					Map.getZoom ( ) +
					'&addressdetails=1&accept-language=' +
					_Translator.UserLanguage +
					'&osm_type=W';
				var XmlHttpRequest = new XMLHttpRequest ( );
				XmlHttpRequest.onreadystatechange = function ( ) { 
					if ( XmlHttpRequest.readyState == 4 && XmlHttpRequest.status == 200 ) {
						_NominatimCallback ( XmlHttpRequest.responseText );
					}
				};  
				XmlHttpRequest.open ( "GET", NominatimUrl, true );
				XmlHttpRequest.send ( null );
			}
		}
1153506
def position_changing(position , to)
      Position.log.debug "Instruction from #{position} to 0x#{to.to_s(16)}, bin #{Position.get(@binary)}"
      update_index(to)
      instruction = position.object
      return unless instruction.next
      if @index == (Parfait::BinaryCode.data_length - 1 ) and !instruction.is_a?(Label)
        nekst_pos_diff = @binary.padded_length
      else
        nekst_pos_diff = @index * 4 + instruction.byte_length
      end
      Position.log.debug "Nekst + #{nekst_pos_diff + Parfait::BinaryCode.byte_offset}"
      nekst = Position.get(position.object.next)
      nekst.set(Position.get(@binary) + nekst_pos_diff + Parfait::BinaryCode.byte_offset)
    end
1238409
private String parseExemplarLocation(String text, ParsePosition pos) {
        int startIdx = pos.getIndex();
        int parsedPos = -1;
        String tzID = null;

        EnumSet<NameType> nameTypes = EnumSet.of(NameType.EXEMPLAR_LOCATION);
        Collection<MatchInfo> exemplarMatches = _tznames.find(text, startIdx, nameTypes);
        if (exemplarMatches != null) {
            MatchInfo exemplarMatch = null;
            for (MatchInfo match : exemplarMatches) {
                if (startIdx + match.matchLength() > parsedPos) {
                    exemplarMatch = match;
                    parsedPos = startIdx + match.matchLength();
                }
            }
            if (exemplarMatch != null) {
                tzID = getTimeZoneID(exemplarMatch.tzID(), exemplarMatch.mzID());
                pos.setIndex(parsedPos);
            }
        }
        if (tzID == null) {
            pos.setErrorIndex(startIdx);
        }

        return tzID;
    }
871623
function (position) {
			this.writeDebug('autoGeocodeQuery',arguments);
			var _this = this,
				distance = null,
				$distanceInput = $('#' + this.settings.maxDistanceID),
				originAddress;

			// Query string parameters
			if (this.settings.querystringParams === true) {
				// Check for distance query string parameters
				if (this.getQueryString(this.settings.maxDistanceID)){
					distance = this.getQueryString(this.settings.maxDistanceID);

					if ($distanceInput.val() !== '') {
						distance = $distanceInput.val();
					}
				}
				else{
					// Get the distance if set
					if (this.settings.maxDistance === true) {
						distance = $distanceInput.val() || '';
					}
				}
			}
			else {
				// Get the distance if set
				if (this.settings.maxDistance === true) {
					distance = $distanceInput.val() || '';
				}
			}

			// The address needs to be determined for the directions link
			var r = new this.reverseGoogleGeocode(this);
			var latlng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
			r.geocode({'latLng': latlng}, function (data) {
				if (data !== null) {
					originAddress = addressInput = data.address;
					olat = mappingObj.lat = position.coords.latitude;
					olng = mappingObj.lng = position.coords.longitude;
					mappingObj.origin = originAddress;
					mappingObj.distance = distance;
					_this.mapping(mappingObj);

					// Fill in the search box.
					if (typeof originAddress !== 'undefined') {
						$('#' + _this.settings.addressID).val(originAddress);
					}
				} else {
					// Unable to geocode
					_this.notify(_this.settings.addressErrorAlert);
				}
			});
		}