getNeighbours will get the pixel value of i's neighbour that's ox and oy
away from i, if the point is outside the image, then 0 is returned.
This version gets from source image.
@param d_w
@param d_h
327090
private int getNeighbours( int[] src1d, int i, int ox, int oy, int d_w, int d_h ) {
        int x, y, result;

        x = (i % d_w) + ox; // d_w and d_h are assumed to be set to the
        y = (i / d_w) + oy; // width and height of scr1d

        if ((x < 0) || (x >= d_w) || (y < 0) || (y >= d_h)) {
            result = 0;
        } else {
            result = src1d[y * d_w + x] & 0x000000ff;
        }
        return result;
    }
1278119
protected int getInternalDayFromLocation(float x, float y) {
        int dayStart = mEdgePadding;
        if (x < dayStart || x > mWidth - mEdgePadding) {
            return -1;
        }
        // Selection is (x - start) / (pixels/day) == (x -s) * day / pixels
        int row = (int) (y - getMonthHeaderSize()) / mRowHeight;
        int column = (int) ((x - dayStart) * mNumDays / (mWidth - dayStart - mEdgePadding));

        int day = column - findDayOffset() + 1;
        day += row * mNumDays;
        return day;
    }
97265
protected boolean containsRightNeighbor(CLIQUEUnit unit, int d) {
    final int e = dims.length - 1;
    return checkDimensions(unit, e) && bounds[e << 1] == unit.bounds[(e << 1) + 1];
  }
48294
Neighbour getRecoveredNeighbour(SIBUuid8 neighbourUuid)
    {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.entry(tc, "getRecoveredNeighbour", neighbourUuid);

      Neighbour neighbour = null;
      synchronized(_recoveredNeighbours)
      {
        neighbour = (Neighbour) _recoveredNeighbours.get(neighbourUuid);
      }

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.exit(tc, "getRecoveredNeighbour", neighbour);

      return neighbour;
    }
267767
private List<Point2D> getNeighbors(final Point2D point, KDTree<Point2D> points) {
    	double[] key = {point.x, point.y};
        final List<Point2D> neighbors = new ArrayList<Point2D>();
        
        neighbors.addAll(points.nearestEuclidean(key, eps));
        
        return neighbors; 
    }
223278
def neighbors(self, subid, params=None):
        ''' 
        '''
        params = update_params(params, {'SUBID': subid})
        return self.request('/v1/server/neighbors', params, 'GET')
750971
def neighbour(lat:0, lng:0)
      new_point = Point.new(
        lat: southwest.lat + dlat(lat),
        lng: southwest.lng + dlng(lng))
      Tile.including(new_point, depth: depth)
    end
1040156
def neighborhood(self, node, degree=4):
    """"""
    assert self.by_name[node.name] == node
    already_visited = frontier = set([node.name])
    for _ in range(degree):
      neighbor_names = set()
      for node_name in frontier:
        outgoing = set(n.name for n in self.by_input[node_name])
        incoming = set(self.by_name[node_name].input)
        neighbor_names |= incoming | outgoing
      frontier = neighbor_names - already_visited
      already_visited |= neighbor_names
    return [self.by_name[name] for name in already_visited]
26608
Neighbour getBusNeighbour(String busId)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "getBusNeighbour", busId);
      
    Neighbour neighbour = null;
    synchronized(_neighbours)
    {
      Iterator neighbours = _neighbours.keySet().iterator();
      while (neighbours.hasNext())
      {
        neighbour = getNeighbour((SIBUuid8) neighbours.next());
        if (neighbour.getBusId().equals(busId)) 
        {
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "getBusNeighbour", neighbour);
          return neighbour;
        }        
      }
    }

    synchronized(_recoveredNeighbours)
    {
      Iterator recoveredNeighbours = _recoveredNeighbours.keySet().iterator();
      while (recoveredNeighbours.hasNext())
      {
        neighbour = (Neighbour) _recoveredNeighbours.get(recoveredNeighbours.next());
        if (neighbour.getBusId().equals(busId)) 
        {
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "getBusNeighbour", neighbour);
          return neighbour;
        }        
      }
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "getBusNeighbour", null);
    return null;
  }
1336390
function getNeighbor(owner, item, dataPropertyName) {
	const data = validateAttached(owner)
	return obtainTrueValue(item[data[dataPropertyName]])
}
762497
public boolean intersects (double x, double y, double w, double h)
    {
        return _bounds.intersects(x, y, w, h);
    }
847106
public Set<Tile> getNeighbours() {
        Set<Tile> neighbours = new HashSet<Tile>(8);
        neighbours.add(getLeft());
        neighbours.add(getAboveLeft());
        neighbours.add(getAbove());
        neighbours.add(getAboveRight());
        neighbours.add(getRight());
        neighbours.add(getBelowRight());
        neighbours.add(getBelow());
        neighbours.add(getBelowLeft());
        return neighbours;
    }
387767
private void connectToNeighbors(int x, int y ) {
		List<LineSegment2D_F32> lines = grid.get(x,y);

		Iterator<LineSegment2D_F32> iter = lines.iterator();
		while( iter.hasNext() )
		{
			LineSegment2D_F32 l = iter.next();
			boolean connected = false;

			if( connectTry(l,x+1,y) )
				connected = true;
			if( !connected && connectTry(l,x+1,y+1) )
				connected = true;
			if( !connected && connectTry(l,x,y+1) )
				connected = true;
			if( !connected && connectTry(l,x-1,y+1) )
				connected = true;

			// the line was added to the connecting grid
			// remove it to avoid double counting the line
			if( connected )
				iter.remove();
		}
	}
1253169
def get_neighbors(distance_matrix, source, eps):
    

    return [dest for dest, distance in enumerate(distance_matrix[source]) if distance < eps]
705984
private void createNeighborhoods() {
    neighbours = new ArrayList<List<Integer>>(solutionListSize);

    for (int i = 0; i < solutionListSize; i++) {
      neighbours.add(new ArrayList<Integer>());
      neighbours.get(i).add(i);
    }
  }
476647
def neighbours
      offsets = (-1..1).to_a.product((-1..1).to_a)
      offsets.map do |lat, lng|
        begin 
          neighbour(lat:lat, lng:lng)
        rescue ArgumentError
          nil # occurs on world boundaries
        end
      end.compact
    end
90710
List<Integer> getNeighbours(int rank) {
        if(rank < 0) {
            throw new IllegalStateException("Rank should be non negative");
        }

        if(rank >= numWorkers) {
            throw new IllegalStateException("Rank ["+rank+"] too high for the number of workers ["+numWorkers+"]");
        }

        rank += 1;
        List<Integer> neighbour = new ArrayList<>();

        if(rank > 1) {
            neighbour.add(rank / 2 - 1);
        }
        if(rank * 2 - 1 < numWorkers) {
            neighbour.add(rank * 2 - 1);
        }
        if(rank * 2 < numWorkers) {
            neighbour.add(rank * 2);
        }

        return neighbour;
    }