original_docstring: Returns the minimum and maximum indices of non-zero lines in axis 0 of `img', followed by that for axis 1.
docstring: Returns the minimum and maximum indices of non-zero lines in axis 0 of `img', followed by that for axis 1.
docstring_tokens: Returns the minimum and maximum indices of non - zero lines in axis 0 of ` img ' followed by that for axis 1 .
code: def img_bounds(img):
      """Returns the minimum and maximum indices of non-zero lines in axis 0 of `img', followed by that for axis 1."""
      ax0 = np.any(img, axis=0)
      ax1 = np.any(img, axis=1)
      return np.concatenate((np.where(ax0)[0][[0, -1]], np.where(ax1)[0][[0, -1]]))
code_tokens: def img_bounds ( img ) : ax0 = np . any ( img , axis = 0 ) ax1 = np . any ( img , axis = 1 ) return np . concatenate ( ( np . where ( ax0 ) [ 0 ] [ [ 0 , - 1 ] ] , np . where ( ax1 ) [ 0 ] [ [ 0 , - 1 ] ] ) )
short_docstring: Returns the minimum and maximum indices of non-zero lines in axis 0 of `img', followed by that for axis 1.
short_docstring_tokens: Returns the minimum and maximum indices of non - zero lines in axis 0 of ` img ' followed by that for axis 1 .
comment: """Returns the minimum and maximum indices of non-zero lines in axis 0 of `img', followed by that for axis 1."""