class_docstr: Grid of data.
class_docstr_tok: ["Grid","of","data","."]
docstr: Return whether (*xi*, *yi*) is a valid index of the grid.
docstr_tok: ["Return","whether","(","*","xi","*",",","*","yi","*",")","is","a","valid","index","of","the","grid","."]
code: def within_grid(self, xi, yi):
      """Return whether (*xi*, *yi*) is a valid index of the grid."""
      # Note that xi/yi can be floats; so, for example, we can't simply check
      # `xi < self.nx` since *xi* can be `self.nx - 1 < xi < self.nx`
      return 0 <= xi <= self.nx - 1 and 0 <= yi <= self.ny - 1
  
imports: import numpy
  import matplotlib
  from matplotlib import _api, cm, patches
  import matplotlib.colors
  import matplotlib.collections
  import matplotlib.lines
label_desc: Use image node_id 3 for calling the Grid obj's underlying member method code with example usage: obj.within_grid(xi, yi) and returns: unknown