If X or Y is null, return an empty Point
771196
private Point makePointValid(Point point) {
        CoordinateSequence sequence = point.getCoordinateSequence();
        GeometryFactory factory = point.getFactory();
        CoordinateSequenceFactory csFactory = factory.getCoordinateSequenceFactory();
        if (sequence.size() == 0) {
            return point;
        } else if (Double.isNaN(sequence.getOrdinate(0, 0)) || Double.isNaN(sequence.getOrdinate(0, 1))) {
            return factory.createPoint(csFactory.create(0, sequence.getDimension()));
        } else if (sequence.size() == 1) {
            return point;
        } else {
            throw new RuntimeException("JTS cannot create a point from a CoordinateSequence containing several points");
        }
    }
906062
def _assign_to_null(obj, path, value, force=True):
    
    try:
        if obj is Null:
            return
        if _get(obj, CLASS) is NullType:
            d = _get(obj, "__dict__")
            o = d[OBJ]
            p = d["__key__"]
            s = [p]+path
            return _assign_to_null(o, s, value)

        path0 = path[0]

        if len(path) == 1:
            if force:
                obj[path0] = value
            else:
                _setdefault(obj, path0, value)
            return

        old_value = obj.get(path0)
        if old_value == None:
            if value == None:
                return
            else:
                obj[path0] = old_value = {}

        _assign_to_null(old_value, path[1:], value)
    except Exception as e:
        raise e
602831
function nullFrom(nfa, node) {
  let result = []
  scan(node)
  return result.sort(cmp)

  function scan(node) {
    let edges = nfa[node]
    if (edges.length == 1 && !edges[0].term) return scan(edges[0].to)
    result.push(node)
    for (let i = 0; i < edges.length; i++) {
      let {term, to} = edges[i]
      if (!term && result.indexOf(to) == -1) scan(to)
    }
  }
}
1110404
function (level, x, y) {
            var context = null;
            if (level >= this.minLevel && level <= this.maxLevel) {
                context = this.levels[level].context2D;
            }
            return context;
        }
371064
public Space findSpace(float x, float y) {
		for (int i=0;i<spaces.size();i++) {
			Space space = getSpace(i);
			if (space.contains(x,y)) {
				return space;
			}
		}
		
		return null;
	}
734873
function (pts, center, point)
	{
		var min = null;
		
		for (var i = 0; i < pts.length - 1; i++)
		{
			var pt = mxUtils.intersection(pts[i].x, pts[i].y, pts[i + 1].x, pts[i + 1].y,
				center.x, center.y, point.x, point.y);
			
			if (pt != null)
			{
				var dx = point.x - pt.x;
				var dy = point.y - pt.y;
				var ip = {p: pt, distSq: dy * dy + dx * dx};
				
				if (ip != null && (min == null || min.distSq > ip.distSq))
				{
					min = ip;
				}
			}
		}
		
		return (min != null) ? min.p : null;
	}
1032135
function(pos) {
            var layers = this.getChildren(),
                len = layers.length,
                end = len - 1,
                n, shape;

            for(n = end; n >= 0; n--) {
                shape = layers[n].getIntersection(pos);
                if (shape) {
                    return shape;
                }
            }

            return null;
        }
890080
function(x, y) {
        if ( (x == null) || (y == null) ) {
            throw new TypeError('Pixel.add cannot receive null values');
        }
        return new OpenLayers.Pixel(this.x + x, this.y + y);
    }
208773
def getPixelValue(self, x, y):
        """"""
        assert x < self.size, "x: %d<%d" % (x, self.size)
        assert y < self.size, "y: %d<%d" % (y, self.size)
        # Same as calcOffset, inlined for performance reasons
        offset = x + self.size * (self.size - y - 1)
        #print offset
        value = self.data[offset]
        if value == -32768:
            return -1 # -32768 is a special value for areas with no data
        return value
1008632
public final Shape<?> findShapeAtPoint(final int x, final int y)
    {
        if (isVisible())
        {
            final NFastArrayList<Layer> layers = getChildNodes();

            if (null != layers)
            {
                final int size = layers.size();

                for (int i = size - 1; i >= 0; i--)
                {
                    final Layer layer = layers.get(i);

                    if (null != layer)
                    {
                        final Shape<?> shape = layer.findShapeAtPoint(x, y);

                        if (null != shape)
                        {
                            return shape;
                        }
                    }
                }
            }
        }
        return null;
    }
712906
def filter_missing_X_and_y(X, y):
    """"""
    y_nans = np.isnan(y)
    x_nans = np.isnan(X).any(axis=1)
    unioned_nans = np.logical_or(x_nans, y_nans)

    return X[~unioned_nans], y[~unioned_nans]
687269
def point_from_string(string = "0x0")
      string = "0x0" if string.empty?
      raise ArgumentError if !string.match(/(\d*x)|(x\d*)/)

      x, y = string.scan(/(\d*)x(\d*)/)[0].map(&:to_i)

      x = 0 if x.nil?
      y = 0 if y.nil?
      {
        x: x,
        y: y
      }
    end
1281374
def pos(self, x=None, y=None):
        '''
        if x is not None:
            System.Console.CursorLeft=x
        else:
            x = System.Console.CursorLeft
        if y is not None:
            System.Console.CursorTop=y
        else:
            y = System.Console.CursorTop
        return x, y
854253
private static Point getIntersection(Shape shape,
                                         Line2D.Double line) {
        if (shape instanceof Ellipse2D) {
            return getEllipseIntersection(shape,
                                          line);
        } else if (shape instanceof Rectangle2D || shape instanceof Path2D) {
            return getShapeIntersection(shape,
                                        line);
        } else {
            // something strange
            return null;
        }
    }
27003
function(obj) {
                var theta;
                if (obj.normal) {
                  // obj is a plane
                  theta = this.normal.angleFrom(obj.normal);
                  return (Math.abs(theta) <= sylvester.precision || Math.abs(Math.PI - theta) <= sylvester.precision);
                } else if (obj.direction) {
                  // obj is a line
                  return this.normal.isPerpendicularTo(obj.direction);
                }
                return null;
              }
1293313
public static Point createPoint(double x, double y) throws SQLException {
        return createPoint(x, y, Coordinate.NULL_ORDINATE);
    }
867624
function(x, y) {
        var array = this.getAllData(x, y);
        return array && array.length ? array[0] : undefined;
    }