This determines how many waypoint items will be seen for a scaffolded wrong answer
349372
def set_max_waypoint_items(self, max_waypoint_items):
        """"""
        if self.get_max_waypoint_items_metadata().is_read_only():
            raise NoAccess()
        if not self.my_osid_object_form._is_valid_cardinal(max_waypoint_items,
                                                           self.get_max_waypoint_items_metadata()):
            raise InvalidArgument()
        self.my_osid_object_form._my_map['maxWaypointItems'] = max_waypoint_items
240469
function (map) {
            var didSomething = false;
            _.forEach(map, function (arr, key) {
                // length > 1 means we have duplicates that need to be resolved
                if (arr.length > 1) {
                    arr.forEach(function (index) {
                        if (filePaths[index].length !== 0) {
                            displayPaths[index] = filePaths[index].pop() + "/" + displayPaths[index];
                            didSomething = true;

                            if (!map[displayPaths[index]]) {
                                map[displayPaths[index]] = [index];
                            } else {
                                map[displayPaths[index]].push(index);
                            }
                        }
                    });
                }
                delete map[key];
            });
            return didSomething;
        }
918318
def check_generic_request(self, item_session: ItemSession) -> Tuple[bool, str]:
        '''
        '''
        verdict, reason, test_info = self.consult_filters(
            item_session.request.url_info,
            item_session.url_record)

        verdict, reason = self.consult_hook(item_session, verdict,
                                            reason, test_info)

        return verdict, reason
768190
def get_correctness_for_response(self, response):
        """"""
        for answer in self.my_osid_object.get_answers():
            if self._is_match(response, answer):
                try:
                    return answer.get_score()
                except AttributeError:
                    return 100
        for answer in self.my_osid_object.get_wrong_answers():
            if self._is_match(response, answer):
                try:
                    return answer.get_score()
                except AttributeError:
                    return 0
        return 0
170543
function (x, y, w, h, wrapper) {

			if (wrapper) {
				w = h = 2 * wrapper.r;
			}

			// Center correction, #1682
			if (wrapper && wrapper.isCircle) {
				x -= w / 2;
				y -= h / 2;
			}

			// Return the path
			return [
				'wa', // clockwisearcto
				x, // left
				y, // top
				x + w, // right
				y + h, // bottom
				x + w, // start x
				y + h / 2,     // start y
				x + w, // end x
				y + h / 2,     // end y
				//'x', // finish path
				'e' // close
			];
		}
926512
def result(self, s, a):
        ''''''
        # result: boat on opposite side, and numbers of missioners and
        # cannibals updated according to the move
        if s[2] == 0:
            return (s[0] - a[1][0], s[1] - a[1][1], 1)
        else:
            return (s[0] + a[1][0], s[1] + a[1][1], 0)
425056
public int currentStepCount() {
    if (currentDirectionRoute() == null) {
      return 0;
    }
    int stepCount = 0;
    for (RouteLeg leg : currentDirectionRoute().legs()) {
      stepCount += leg.steps().size();
    }
    return stepCount;
  }
114166
def waypoint_count_send(self, seq):
        ''''''
        if self.mavlink10():
            self.mav.mission_count_send(self.target_system, self.target_component, seq)
        else:
            self.mav.waypoint_count_send(self.target_system, self.target_component, seq)
1338889
private int processBinOp(int seen) {
        if (binaryOps.get(seen) && (stack.getStackDepth() >= 2)) {
            OpcodeStack.Item item = stack.getStackItem(1);
            return item.getRegisterNumber();
        }
        return -1;
    }
795477
def return_item_count_on_page(self, page=1, total_items=1):
        
        up_to_page = ((page - 1) * self.page_items)
        #   Number of items up to the page in question

        if total_items > up_to_page:
            #   Remove all the items up to the page in question
            #
            count = total_items - up_to_page

        if count >= self.page_items:
            # The remaining items are greater than the items per page
            # so the answer is a full page
            return self.page_items
        else:
            #   There are less items than a full page,
            #
            return count
503385
private static void checkBehindCamera(SceneStructureMetric structure, SceneObservations observations, BundleAdjustment<SceneStructureMetric> bundleAdjustment) {

		int totalBehind = 0;
		Point3D_F64 X = new Point3D_F64();
		for (int i = 0; i < structure.points.length; i++) {
			structure.points[i].get(X);
			if( X.z < 0 )
				totalBehind++;
		}
		structure.views[1].worldToView.T.print();
		if( totalBehind > structure.points.length/2 ) {
			System.out.println("Flipping because it's reversed. score = "+bundleAdjustment.getFitScore());
			for (int i = 1; i < structure.views.length; i++) {
				Se3_F64 w2v = structure.views[i].worldToView;
				w2v.set(w2v.invert(null));
			}
			triangulatePoints(structure,observations);

			bundleAdjustment.setParameters(structure,observations);
			bundleAdjustment.optimize(structure);
			System.out.println("  after = "+bundleAdjustment.getFitScore());
		} else {
			System.out.println("Points not behind camera. "+totalBehind+" / "+structure.points.length);
		}
	}
631763
def check_next_match(self, match, new_relations, subject_graph, one_match):
        """"""
        # avoid duplicate rings (order of traversal)
        if len(match) == 3:
            if match.forward[1] < match.forward[2]:
                #print "RingPattern.check_next_match: duplicate order", match.forward[1], match.forward[2]
                return False
        # avoid duplicate rings (starting point)
        for vertex1 in new_relations.values():
            if vertex1 < match.forward[0]:
                #print "RingPattern.check_next_match: duplicate start", vertex1, match.forward[0]
                return False
        # can this ever become a strong ring?
        for vertex1 in new_relations.values():
            paths = list(subject_graph.iter_shortest_paths(vertex1, match.forward[0]))
            if len(paths) != 1:
                #print "RingPattern.check_next_match: not strong 1"
                return False
            if len(paths[0]) != (len(match)+1)//2:
                #print "RingPattern.check_next_match: not strong 2"
                return False
        return True
961637
def return_item_count_on_subpage(self, subpage=1, total_items=1):
        
        up_to_subpage = ((subpage - 1) * self.subpage_items)
        #   Number of items up to the page in question

        if total_items > up_to_subpage:
            #   Remove all the items up to the page in question
            #
            count = total_items - up_to_subpage
        else:
            count = total_items

        if count >= self.subpage_items:
            # The remaining items are greater than the items per page
            # so the answer is a full page
            return self.subpage_items
        else:
            #   There are less items than a full page,
            #
            return count
1141088
def itemtypes(cls, mapped_types, coll_type, visitor):
        
        rv = list(v for k, v in mapped_types)
        return rv[0] if len(rv) == 1 else rv
318609
def _is_match(self, response, answer):
        

        def compare_conditions(droppable_id, spatial_units, response_conditions):
            """Compare response coordinates with spatial units for droppable_id"""
            coordinate_match = True
            for coordinate in response_conditions['coordinate_conditions']['include'][droppable_id]:
                answer_match = False
                for spatial_unit in spatial_units:
                    if (coordinate['containerId'] == spatial_unit['containerId'] and
                            coordinate['coordinate'] in spatial_unit['spatialUnit']):
                        answer_match = True
                        break
                coordinate_match = coordinate_match and answer_match
            return coordinate_match

        # Did the consumer application already do the work for us?
        if response.has_zone_conditions():
            return bool(response.get_zone_conditions() == answer.get_zone_conditions())

        answer_conditions = self._get_conditions_map(answer)
        response_conditions = self._get_conditions_map(response)

        # Check to see if the lists of droppables used are the same:
        if set(answer_conditions['spatial_unit_conditions']['include']) != set(response_conditions['coordinate_conditions']['include']):
            return False

        # Compare included answer spatial unit areas to response coordinates
        for droppable_id, spatial_units in answer_conditions['spatial_unit_conditions']['include'].items():
            # Do the number of defined include conditions match:
            if len(spatial_units) != len(response_conditions['coordinate_conditions']['include'][droppable_id]):
                return False
            if not compare_conditions(droppable_id, spatial_units, response_conditions):
                return False

        # Compare excluded answer spatial unit areas to response coordinates
        for droppable_id, spatial_units in answer_conditions['spatial_unit_conditions']['exclude'].items():
            if compare_conditions(droppable_id, spatial_units, response_conditions):
                return False
        return True
459201
function(left, right) {
                const leftIndex = entryPoints.indexOf(left.names[0]);
                const rightIndex = entryPoints.indexOf(right.names[0]);
                let direction = 0;

                if (leftIndex > rightIndex) {
                    direction = 1;
                } else if (leftIndex < rightIndex) {
                    direction = -1;
                }

                return direction;
            }
408536
function(parentContextWalkCount){
		var walkCount = parentContextWalkCount || 0;
		return function shouldSkipSpecialContexts(currentScope){
			// after walking past the correct number of contexts,
			// should not skip notContext scopes
			// so that ../foo can be used to read from a notContext scope
			if (walkCount < 0 && currentScope._meta.notContext) {
				return false;
			}

			if(currentScope.isSpecial()) {
				return true;
			}
			walkCount--;

			if(walkCount < 0) {
				return false;
			}
			return true;
		};
	}