store second vehicle position for filtering purposes
515504
def set_secondary_vehicle_position(self, m):
        ''''''
        if m.get_type() != 'GLOBAL_POSITION_INT':
            return
        (lat, lon, heading) = (m.lat*1.0e-7, m.lon*1.0e-7, m.hdg*0.01)
        if abs(lat) < 1.0e-3 and abs(lon) < 1.0e-3:
            return
        self.vehicle2_pos = VehiclePos(m)
140696
def filter(self, other=None):
        

        if not other:
            other = Fuse.fuseoptref()

        return SubOptsHive.filter(self, other)
1228084
def setup_filter(self, root_path, path_list):
        """"""
        self.root_path = osp.normpath(to_text_string(root_path))
        self.path_list = [osp.normpath(to_text_string(p)) for p in path_list]
        self.invalidateFilter()
886488
def _move(self, feature, randomLocation = False, useNoise = True):
    

    if randomLocation:
      locationOnObject = {
        "top": feature["top"] + np.random.rand()*feature["height"],
        "left": feature["left"] + np.random.rand()*feature["width"],
      }
    else:
      locationOnObject = {
        "top": feature["top"] + feature["height"]/2.,
        "left": feature["left"] + feature["width"]/2.
      }

    if self.locationOnObject is not None:
      displacement = {"top": locationOnObject["top"] -
                             self.locationOnObject["top"],
                      "left": locationOnObject["left"] -
                              self.locationOnObject["left"]}
      if useNoise:
        params = self.column.movementCompute(displacement,
                                             self.noiseFactor,
                                             self.moduleNoiseFactor)
      else:
        params = self.column.movementCompute(displacement, 0, 0)

      for monitor in self.monitors.values():
        monitor.afterLocationShift(**params)
    else:
      for monitor in self.monitors.values():
        monitor.afterLocationInitialize()

    self.locationOnObject = locationOnObject
    for monitor in self.monitors.values():
      monitor.afterLocationChanged(locationOnObject)
571107
def set_position(self, key, latlon, layer=None, rotation=0):
        ''''''
        self.object_queue.put(SlipPosition(key, latlon, layer, rotation))
888528
def _save(self, objects, old_pos, new_pos):
        """"""
        to_shift = objects.exclude(pk=self.pk) if self.pk else objects

        # If not set, insert at end.
        if self.sort_order is None:
            self._move_to_end(objects)

        # New insert.
        elif not self.pk and not old_pos:
            # Increment `sort_order` on objects with:
            #     sort_order > new_pos.
            to_shift = to_shift.filter(sort_order__gte=self.sort_order)
            self._update(to_shift)
            self.sort_order = new_pos

        # self.sort_order decreased.
        elif old_pos and new_pos < old_pos:
            self._move_to_end(objects)
            super(Orderable, self).save()
            # Increment `sort_order` on objects with:
            #     sort_order >= new_pos and sort_order < old_pos
            to_shift = to_shift.filter(sort_order__gte=new_pos, sort_order__lt=old_pos)
            self._update(to_shift)
            self.sort_order = new_pos

        # self.sort_order increased.
        elif old_pos and new_pos > old_pos:
            self._move_to_end(objects)
            super(Orderable, self).save()
            # Decrement sort_order on objects with:
            #     sort_order <= new_pos and sort_order > old_pos.
            to_shift = to_shift.filter(sort_order__lte=new_pos, sort_order__gt=old_pos)
            to_shift.update(sort_order=models.F('sort_order') - 1)
            self.sort_order = new_pos
1164285
function filter(store, keyObj) {
      var size = 0;
      var data = store.data.asObject();
      var filteredData = {};
      var isArray = store.data.__sorted;
      var validItem;

      // If no key is specified retrieve root data
      if (keyObj && keyObj.constructor === Object) {
        if (isArray) {
          data = store.data.asArray();
          filteredData = [];

          for (var i = 0; i < data.length; i++) {
            validItem = true;
            // Loop through filter fields keys
            for (var key in keyObj) {
              // Data has the specified filter property
              if (data[i][key] !== keyObj[key]) {
                // Discard item from data
                validItem = false;
                break;
              }
            }
            // Add item to filtered data
            if (validItem) {
              filteredData.push(data[i]);
            }
          }
        } else {
          // Loop through store data
          for (var index in data) {
            validItem = true;
            // Loop through filter fields keys
            for (var key in keyObj) {
              // Data has the specified filter property
              if (data[index][key] !== keyObj[key]) {
                // Discard item from data
                validItem = false;
                break;
              }
            }
            // Add item to filtered data
            if (validItem) {
              filteredData[index] = data[index];
            }
          }
        }

        // Update store data object
        store.data = new Result(filteredData, store, store.data.__sorted);
      } 
      // Update store data items length
      store.size = Object.keys(filteredData).length;
    }
1369391
def thing2place(self, name):
        """"""
        self.engine._set_thing_loc(
            self.name, name, None
        )
        if (self.name, name) in self.engine._node_objs:
            thing = self.engine._node_objs[self.name, name]
            place = Place(self, name)
            for port in thing.portals():
                port.origin = place
            for port in thing.preportals():
                port.destination = place
            self.engine._node_objs[self.name, name] = place
54033
function(storerecord, feedQueue) {
		var r = [],
			i = 0,
			l = 0,
			firstQueueitem = feedQueue[0];
		
		var filterFunc = function(elem) {
			if (storerecord === null) {
				return true;
			}
			return (elem.b >= storerecord.v);
		};
		
		for (i=0, l=feedQueue.length; i<l; i++) {
			if (
				(feedQueue[i].s != firstQueueitem.s) ||
				(feedQueue[i].k != firstQueueitem.k)
			) {
				return _filter(r,filterFunc);
			}
			r.push(feedQueue[i]);
		}
		return _filter(r,filterFunc);
	}
1067357
function Filter (params) {
  var self = this
  if (!(self instanceof Filter)) return new Filter(params)

  self.identifier = params['filter_id']
  self.priority = params['priority'] | 0
  self.hideSponsoredSlug = !!params['hide_spondored_slug']
  self.imageURL = params['image']
  self.isDynamic = !!params['is_dynamic_geofilter']
  self.isSponsored = !!params['is_sponsoed']
  self.position = params['position']
  self.prepositioned = !!params['prepositioned']
  self.prepositionedImageURL = params['prepositioned_image']

  var geofence = params['geofence']
  var coords = geofence['coordinates']

  self.geofenceIdentifier = geofence['id']
  self.coordinates = (coords || [ ]).map(function (coord) {
    return {
      lat: coord['lat'],
      lng: coord['long']
    }
  })
}
119833
function performMove(fields, direction) {
  const oldSpaceshipPosition = findSpaceshipPosition(fields);
  const dx = { left: -1, ahead: 0, right: 1 }[direction];
  const newSpaceshipPosition = [oldSpaceshipPosition[0] - 1, oldSpaceshipPosition[1] + dx];
  const newFields = fields.map((row, i) => row.map((field, j) => {
    const [background, oldObjects] = field;
    let newObjects = oldObjects;
    if (i === oldSpaceshipPosition[0] && j === oldSpaceshipPosition[1]) {
      if (outsideWorld(fields, newSpaceshipPosition)) {
        let border = null;
        if (i === 0) {
          border = 'top';
        } else if (j === 0) {
          border = 'left';
        } else {
          border = 'right';
        }
        newObjects = [`spaceship-out-${border}`];
      } else {
        newObjects = removeSpaceship(oldObjects);
      }
    }
    if (i === newSpaceshipPosition[0] && j === newSpaceshipPosition[1]) {
      if (onRock(fields, newSpaceshipPosition)) {
        newObjects = [...newObjects, 'spaceship-broken'];
      } else {
        newObjects = [...newObjects, 'S'];
      }
    }
    return [background, newObjects];
  }));
  return newFields;
}
158768
def duplicate(self):
        """"""
        return Location(self.city, self.state, self.country,
                        self.latitude, self.longitude, self.time_zone, self.elevation,
                        self.station_id, self.source)
989108
function (arrArg) {
    return arrArg.filter(function (elem, pos, arr) {
        return arr.indexOf(elem) === pos;
    });
}
1258590
function() {
		var yOffset = _panOffset.y - self.currItem.initialPosition.y; // difference between initial and current position
		return 1 -  Math.abs( yOffset / (_viewportSize.y / 2)  );
	}
459505
def x(self, position=None):
        """"""
        p = self.GetPosition()
        if position is None:
            return p[0]
        self.SetPosition(position, p[1], p[2])
        if self.trail:
            self.updateTrail()
        return self
454826
def recycle_view(self, position):
        
        d = self.declaration

        if position < len(d.parent.items):
            d.index = position
            d.item = d.parent.items[position]
        else:
            d.index = -1
            d.item = None
694007
private void bind() {
    distanceRemainingText = findViewById(R.id.distanceRemainingText);
    timeRemainingText = findViewById(R.id.timeRemainingText);
    arrivalTimeText = findViewById(R.id.arrivalTimeText);
    rerouteProgressBar = findViewById(R.id.rerouteProgressBar);
    updateRouteOverviewImage();
  }